diff --git a/Gruntfile.js b/Gruntfile.js index f799e8b..da3a6d9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,4 +1,5 @@ module.exports = function (grunt) { + grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-karma'); grunt.loadNpmTasks('grunt-typescript'); @@ -53,11 +54,31 @@ module.exports = function (grunt) { "sourcemap": true } } + }, + uglify: { + base: { + options: { + sourceMap: true, + sourceMapIncludeSources: true, + inSourceMap: "<%= typescript.base.dest%>.map", + sourceMapName: "build/typertext.min.js.map", + mangle: true, + beautify: false, + compress: true + }, + files: { + 'build/typertext.min.js': [ + '<%= typescript.base.dest %>' + ] + } + } } }); grunt.registerTask('default', ['typescript']); + grunt.registerTask('build', ['typescript:base', 'uglify:base']); + grunt.registerTask('test', ['typescript', 'karma:phantom', 'karma:chrome']); grunt.registerTask('test:travis', ['typescript', 'karma:travis']); }; \ No newline at end of file diff --git a/node_modules/grunt-typescript/.npmignore b/node_modules/grunt-typescript/.npmignore deleted file mode 100644 index d7a8ee3..0000000 --- a/node_modules/grunt-typescript/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -node_modules -npm-debug.log -test -/.idea -src -/.gitignore -/egen.sh \ No newline at end of file diff --git a/node_modules/grunt-typescript/.travis.yml b/node_modules/grunt-typescript/.travis.yml deleted file mode 100644 index 4497683..0000000 --- a/node_modules/grunt-typescript/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - 0.10 - -before_install: - - npm install -g grunt-cli - - npm install - - npm start - - grunt egen - -notifications: - email: false diff --git a/node_modules/grunt-typescript/Gruntfile.js b/node_modules/grunt-typescript/Gruntfile.js deleted file mode 100644 index d22b7cd..0000000 --- a/node_modules/grunt-typescript/Gruntfile.js +++ /dev/null @@ -1,322 +0,0 @@ -module.exports = function (grunt) { - "use strict"; - - var fs = require("fs"), - path = require("path"), - cp = require('child_process'), - Q = require('q'); - - grunt.initConfig({ - clean:{ - test:[ - "test/fixtures/**/*.js", - "test/fixtures/**/*.js.map", - "test/fixtures/**/*.d.ts", - "test/temp/**/*.*", - "test/temp" - ], - expect: "test/expected" - }, - typescript:{ - simple:{ - src: ["test/fixtures/simple.ts"], - options:{ - } - }, - declaration:{ - src:"test/fixtures/declaration.ts", - options:{ - declaration:true - } - }, - sourcemap:{ - src:"test/fixtures/sourcemap.ts", - dest:"test/fixtures/sourcemap/", - options:{ - base_path: "test/fixtures/", - sourcemap:true - } - }, - dest:{ - src:"test/fixtures/dest.ts", - dest: "test/temp/dest", - options:{ - sourcemap: true, - declaration: true, - base_path: "test/fixtures" - } - }, - single:{ - src:"test/fixtures/single/**/*.ts", - dest: "test/temp/single.js" - }, - es5:{ - src:"test/fixtures/es5.ts", - options:{ - target:"ES5" - } - }, - amd:{ - src:"test/fixtures/amd.ts", - options:{ - module:"amd" - } - }, - commonjs:{ - src:"test/fixtures/commonjs.ts", - options:{ - module:"commonjs" - } - }, - "single-sourcemap":{ - src:"test/fixtures/single/**/*.ts", - dest: "test/temp/single-sourcemap.js", - options:{ - sourcemap: true - } - }, - multi:{ - src:"test/fixtures/multi/**/*.ts", - dest:"test/temp/multi" - }, - basePath:{ - src:"test/fixtures/multi/**/*.ts", - dest:"test/temp/basePath", - options: { - base_path: "test/fixtures/multi" - } - }, - "utf8-with-bom":{ - src:"test/fixtures/utf8-with-bom.ts" - }, - "no-output":{ - //存在しないファイル - src:"text/fixtures/no-output.ts", - dest:"test/temp/no-output.js" - }, - comments:{ - src:"test/fixtures/comments.ts", - options:{ - comments:true - } - }, - noImplicitAny:{ - src:"test/fixtures/noImplicitAny.ts", - options:{ - //ignoreTypeCheck: false, - noImplicitAny: true - - } - }, - noImplicitAny2:{ - src:"test/fixtures/noImplicitAny2.ts", - options:{ - //ignoreTypeCheck: false, - noImplicitAny: true - - } - }, - newline_lf: { - src:"test/fixtures/newline.ts", - dest: "test/fixtures/newline_lf.js", - options:{ - //ignoreTypeCheck: false, - newLine: "lf" - } - }, - newline_crlf: { - src:"test/fixtures/newline.ts", - dest: "test/fixtures/newline_crlf.js", - options:{ - //ignoreTypeCheck: false, - newLine: "crlf" - } - }, - newline_auto: { - src:"test/fixtures/newline.ts", - dest: "test/fixtures/newline_auto.js", - options:{ - //ignoreTypeCheck: false, - newLine: "auto" - } - }, - useTabIndent: { - src:"test/fixtures/useTabIndent.ts", - dest: "test/fixtures/useTabIndent.js", - options:{ - useTabIndent: true - } - }, - indentStep0: { - src:"test/fixtures/indentStep.ts", - dest: "test/fixtures/indentStep_0.js", - options:{ - indentStep: 0 - } - }, - priorityUseTabIndent: { - src:"test/fixtures/indentStep.ts", - dest: "test/fixtures/indentStep_2.js", - options:{ - indentStep: 2 - } - }, - indentStep2: { - src:"test/fixtures/useTabIndent.ts", - dest: "test/fixtures/useTabIndent_priority.js", - options:{ - useTabIndent: true, - indentStep: 2 - } - } - , errortypecheck: { - src: "test/fixtures/error-typecheck.ts", - options: { - //ignoreTypeCheck: false - } - } -// , errorsyntax:{ -// src: "test/fixtures/error-syntax.ts" -// } - }, - nodeunit:{ - tests:["test/test.js"] - }, - exec:{ - build:{ - command: function(){ - var files = fs.readdirSync("src").filter(function(file){ - file = "src/" + file; - return fs.statSync(file).isFile() && /.*\.ts$/.test(file); //絞り込み - }).map(function(file){ - return "src" + path.sep + file; - }).join(" "); - return ["node_modules", ".bin", "tsc " + files + " --out tasks", "typescript.js"].join(path.sep); - } - } - } - }); - - grunt.loadTasks("tasks"); - grunt.loadNpmTasks('grunt-exec'); - grunt.loadNpmTasks("grunt-contrib-nodeunit"); - grunt.loadNpmTasks("grunt-contrib-clean"); - - grunt.registerTask("build", ["exec:build"]); - grunt.registerTask("test", ["clean:test", "typescript", "nodeunit"]); - grunt.registerTask("default", ["test"]); - - grunt.registerTask('egen', 'Genereate test expected files.', function() { - var done = this.async(), - command = "node " + path.resolve(path.dirname(require.resolve("typescript")), "tsc "), - tsc = function(option){ - var defer = Q.defer(), - childProcess = cp.exec(command + option, {}); - childProcess.stdout.on('data', function (d) { grunt.log.writeln(d); }); - childProcess.stderr.on('data', function (d) { grunt.log.error(d); }); - - childProcess.on('exit', function(code) { - if (code !== 0) { - defer.reject();; - } - defer.resolve(); - }); - return defer.promise; - }; - - grunt.file.mkdir("test/expected/multi/dir"); - grunt.file.mkdir("test/expected/single"); - grunt.file.mkdir("test/expected/sourcemap"); - - grunt.log.writeln("Simple"); - tsc("test/fixtures/simple.ts").then(function(){ - grunt.file.copy("test/fixtures/simple.js", "test/expected/simple.js"); - - grunt.log.writeln("Declaration"); - return tsc("test/fixtures/declaration.ts --declaration"); - }).then(function(){ - grunt.file.copy("test/fixtures/declaration.js", "test/expected/declaration.js"); - grunt.file.copy("test/fixtures/declaration.d.ts", "test/expected/declaration.d.ts"); - - grunt.log.writeln("Sourcemap"); - return tsc("test/fixtures/sourcemap.ts --outDir test/fixtures/sourcemap --sourcemap"); - }).then(function(){ - grunt.file.copy("test/fixtures/sourcemap/sourcemap.js","test/expected/sourcemap/sourcemap.js"); - grunt.file.copy("test/fixtures/sourcemap/sourcemap.js.map", "test/expected/sourcemap/sourcemap.js.map"); - - grunt.log.writeln("Target ES5"); - return tsc("test/fixtures/es5.ts --target ES5"); - }).then(function(){ - grunt.file.copy("test/fixtures/es5.js", "test/expected/es5.js"); - - grunt.log.writeln("AMD"); - return tsc("test/fixtures/amd.ts --module amd"); - }).then(function(){ - grunt.file.copy("test/fixtures/amd.js", "test/expected/amd.js"); - - grunt.log.writeln("CommonJS"); - return tsc("test/fixtures/commonjs.ts --module commonjs"); - }).then(function(){ - grunt.file.copy("test/fixtures/commonjs.js", "test/expected/commonjs.js"); - - grunt.log.writeln("Single"); - return tsc("test/fixtures/single/dir/single2.ts test/fixtures/single/single1.ts --out test/temp/single.js"); - }).then(function(){ - grunt.file.copy("test/temp/single.js", "test/expected/single/single.js"); - - grunt.log.writeln("Single-SourceMap"); - return tsc("test/fixtures/single/dir/single2.ts test/fixtures/single/single1.ts --out test/temp/single-sourcemap.js --sourcemap"); - }).then(function(){ - grunt.file.copy("test/temp/single-sourcemap.js", "test/expected/single/single-sourcemap.js"); - grunt.file.copy("test/temp/single-sourcemap.js.map", "test/expected/single/single-sourcemap.js.map"); - - grunt.log.writeln("Multi"); - return tsc("test/fixtures/multi/multi1.ts --outDir test/temp/multi").then(function(){ - return tsc("test/fixtures/multi/dir/multi2.ts --outDir test/temp/multi/dir"); - }); - }).then(function(){ - grunt.file.copy("test/temp/multi/multi1.js", "test/expected/multi/multi1.js"); - grunt.file.copy("test/temp/multi/dir/multi2.js", "test/expected/multi/dir/multi2.js"); - - grunt.log.writeln("BOM"); - return tsc("test/fixtures/utf8-with-bom.ts"); - }).then(function(){ - grunt.file.copy("test/fixtures/utf8-with-bom.js", "test/expected/utf8-with-bom.js"); - - grunt.log.writeln("Comment"); - return tsc("test/fixtures/comments.ts"); - }).then(function(){ - grunt.file.copy("test/fixtures/comments.js", "test/expected/comments.js"); - - grunt.log.writeln("NewLine"); - return tsc("test/fixtures/newline.ts"); - }).then(function(){ - grunt.file.copy("test/fixtures/newline.js", "test/expected/newline_auto.js"); - var val = grunt.file.read("test/fixtures/newline.js").toString(); - val = val.replace(/\r\n/g, "\n"); - grunt.file.write("test/expected/newline_lf.js", val); - val = val.replace(/\n/g, "\r\n"); - grunt.file.write("test/expected/newline_crlf.js", val); - - grunt.log.writeln("UseTabIndent"); - return tsc("test/fixtures/useTabIndent.ts"); - }).then(function(){ - var val = grunt.file.read("test/fixtures/useTabIndent.js").toString(); - val = val.replace(/ /g, "\t"); - grunt.file.write("test/expected/useTabIndent.js", val); - grunt.file.write("test/expected/useTabIndent_priority.js", val); - - grunt.log.writeln("IndentStep"); - return tsc("test/fixtures/indentStep.ts"); - }).then(function(){ - var val = grunt.file.read("test/fixtures/indentStep.js").toString(); - grunt.file.write("test/expected/indentStep_0.js", val.replace(/ /g, "")); - grunt.file.write("test/expected/indentStep_2.js", val.replace(/ /g, " ")); - - }).then(function(){ - done(true); - }).fail(function(){ - done(false); - }); - }); -}; diff --git a/node_modules/grunt-typescript/LICENSE b/node_modules/grunt-typescript/LICENSE deleted file mode 100644 index 7b107db..0000000 --- a/node_modules/grunt-typescript/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2013 Kazuhide Maruyama - -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/grunt-typescript/README.md b/node_modules/grunt-typescript/README.md deleted file mode 100644 index 7e20747..0000000 --- a/node_modules/grunt-typescript/README.md +++ /dev/null @@ -1,94 +0,0 @@ -grunt-typescript [![Build Status](https://travis-ci.org/k-maru/grunt-typescript.png?branch=master)](https://travis-ci.org/k-maru/grunt-typescript) -================ - -Compile TypeScript - -## Documentation -You'll need to install `grunt-typescript` first: - - npm install grunt-typescript --save-dev - -Then modify your `Gruntfile.js` file by adding the following line: - - grunt.loadNpmTasks('grunt-typescript'); - -Then add some configuration for the plugin like so: - - grunt.initConfig({ - ... - typescript: { - base: { - src: ['path/to/typescript/files/**/*.ts'], - dest: 'where/you/want/your/js/files', - options: { - module: 'amd', //or commonjs - target: 'es5', //or es3 - base_path: 'path/to/typescript/files', - sourcemap: true, - declaration: true - } - } - }, - ... - }); - -If you want to create a js file that is a concatenation of all the ts file (like -out option from tsc), -you should specify the name of the file with the '.js' extension to dest option. - - grunt.initConfig({ - ... - typescript: { - base: { - src: ['path/to/typescript/files/**/*.ts'], - dest: 'where/you/want/your/js/file.js', - options: { - module: 'amd', //or commonjs - } - } - }, - ... - }); - -##Options - -###nolib `boolean` -Do not include a default lib.d.ts with global declarations - -###target `string` -Specify ECMAScript target version: "ES3" (default) or "ES5" - -###module `string` -Specify module code generation: "commonjs" (default) or "amd" - -###sourcemap `boolean` -Generates corresponding .map files - -###declaration `boolean` -Generates corresponding .d.ts file - -###comments `boolean` -Emit comments to output - -###noImplicitAny `boolean` -Warn on expressions and declarations with an implied 'any' type. - -##Original Options - -###newLine `string` -Specify newline code: "auto" (default) or "crlf" or "lf". This options is experimental. - -###indentStep `number` -Specify space indent count for code generation: This value will be disregarded if the useTabIndent option is specified. This options is experimental. - -###useTabIndent `boolean` -Specify tab indent for code generation: false (default) or true. This options is experimental. - -###ignoreTypeCheck `boolean` -Default value is true. This options is experimental. - -###disallowAsi `boolean` -Do not allow auto semicolon insertion. This options is experimental. - -###base_path `string` - -※I'm sorry for poor English diff --git a/node_modules/grunt-typescript/node_modules/.bin/tsc b/node_modules/grunt-typescript/node_modules/.bin/tsc deleted file mode 120000 index 0863208..0000000 --- a/node_modules/grunt-typescript/node_modules/.bin/tsc +++ /dev/null @@ -1 +0,0 @@ -../typescript/bin/tsc \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/.npmignore b/node_modules/grunt-typescript/node_modules/typescript/.npmignore deleted file mode 100644 index fd2663a..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -built -doc -samples -src -tests -typings -bin/winjs.d.ts -bin/winrt.d.ts -bin/*.bat -bin/jquery.d.ts -bin/typescriptServices.js -Jakefile diff --git a/node_modules/grunt-typescript/node_modules/typescript/CopyrightNotice.txt b/node_modules/grunt-typescript/node_modules/typescript/CopyrightNotice.txt deleted file mode 100644 index 0f6db1f..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/CopyrightNotice.txt +++ /dev/null @@ -1,15 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - diff --git a/node_modules/grunt-typescript/node_modules/typescript/LICENSE.txt b/node_modules/grunt-typescript/node_modules/typescript/LICENSE.txt deleted file mode 100644 index 8746124..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/LICENSE.txt +++ /dev/null @@ -1,55 +0,0 @@ -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 diff --git a/node_modules/grunt-typescript/node_modules/typescript/README.txt b/node_modules/grunt-typescript/node_modules/typescript/README.txt deleted file mode 100644 index 7e571e5..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/README.txt +++ /dev/null @@ -1,27 +0,0 @@ -# TypeScript - -Scalable JavaScript development with types, classes and modules. - -## Install - - npm install -g typescript - -## Usage - - tsc hello.ts - - -## Build - -1. Install Node if you haven't already (http://nodejs.org/) -2. Install Jake, the tool we use to build our compiler (https://github.com/mde/jake). To do this, run "npm install -g jake". -3. To use jake, run one of the following commands: - - jake local - This builds the compiler. The output is in built/local in the public directory - - jake clean - deletes the build compiler - - jake LKG - This replaces the LKG (last known good) version of the compiler with the built one. - - This is a bootstrapping step to be executed whenever the built compiler reaches a stable state. - - jake tests - This builds the test infrastructure, using the built compiler. - - jake runtests - This runs the tests, using the built compiler and built test infrastructure. - - You can also override the host or specify a test for this command. Use host= or tests=. - - jake baseline-accept - This replaces the baseline test results with the results obtained from jake runtests. - - jake -T lists the above commands. diff --git a/node_modules/grunt-typescript/node_modules/typescript/ThirdPartyNoticeText.txt b/node_modules/grunt-typescript/node_modules/typescript/ThirdPartyNoticeText.txt deleted file mode 100644 index ef7619a..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/ThirdPartyNoticeText.txt +++ /dev/null @@ -1,85 +0,0 @@ -/*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- - -The TypeScript software is based on or incorporates material and code from the projects listed below -(collectively "Third Party Code"). Microsoft is not the original author of the -Third Party Code. The original copyright notice and the license, under which -Microsoft received such Third Party Code, are set forth below. Such license and -notices are provided for informational purposes only. Microsoft licenses the Third -Party Code to you under the terms of the Apache 2.0 License. -All Third Party Code licensed by Microsoft 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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR -CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions and -limitations under the License. ---------------------------------------------- -Third Party Code Components --------------------------------------------- ----- Mozilla Developer Code--------- -The following Mozilla Developer Code is under Public Domain as updated after Aug. 20, 2012, see, https://developer.mozilla.org/en-US/docs/Project:Copyrights -1. Array filter Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/filter -Any copyright is dedicated to the Public Domain. - -2. Array forEach Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/forEach -Any copyright is dedicated to the Public Domain. - -3. Array indexOf Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf -Any copyright is dedicated to the Public Domain. - -4. Array map Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map -Any copyright is dedicated to the Public Domain. - -5. Array Reduce Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/Reduce -Any copyright is dedicated to the Public Domain. - -6. String Trim Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim -Any copyright is dedicated to the Public Domain. - -7. Date now Compatibility Method, -Available at https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/now -Any copyright is dedicated to the Public Domain. - -------------JSON2 Script------------------------ -json2.js 2012-10-08 -Public Domain. -NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. -See, http://www.JSON.org/js.html - ---------------r.js---------------------- -Copyright (c) 2010-2011 Dojo Foundation. All Rights Reserved. -Originally License under MIT License -------------------------------------------------------------------------- -Provided for Informational Purposes Only -MIT License - -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. --------------------------------------------------------------------------------------- - -------------- End of ThirdPartyNotices --------------------------------------------------- */ diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/lib.d.ts b/node_modules/grunt-typescript/node_modules/typescript/bin/lib.d.ts deleted file mode 100644 index 94c477f..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/lib.d.ts +++ /dev/null @@ -1,14931 +0,0 @@ -/* ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -/// - -///////////////////////////// -/// ECMAScript APIs -///////////////////////////// - -declare var NaN: number; -declare var Infinity: number; - -/** - * Evaluates JavaScript code and executes it. - * @param x A String value that contains valid JavaScript code. - */ -declare function eval(x: string): any; - -/** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ -declare function parseInt(s: string, radix?: number): number; - -/** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ -declare function parseFloat(string: string): number; - -/** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number). - * @param number A numeric value. - */ -declare function isNaN(number: number): boolean; - -/** - * Determines whether a supplied number is finite. - * @param number Any numeric value. - */ -declare function isFinite(number: number): boolean; - -/** - * Gets the unencoded version of an encoded Uniform Resource Identifier (URI). - * @param encodedURI A value representing an encoded URI. - */ -declare function decodeURI(encodedURI: string): string; - -/** - * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI). - * @param encodedURIComponent A value representing an encoded URI component. - */ -declare function decodeURIComponent(encodedURIComponent: string): string; - -/** - * Encodes a text string as a valid Uniform Resource Identifier (URI) - * @param uri A value representing an encoded URI. - */ -declare function encodeURI(uri: string): string; - -/** - * Encodes a text string as a valid component of a Uniform Resource Identifier (URI). - * @param uriComponent A value representing an encoded URI component. - */ -declare function encodeURIComponent(uriComponent: string): string; - -interface PropertyDescriptor { - configurable?: boolean; - enumerable?: boolean; - value?: any; - writable?: boolean; - get? (): any; - set? (v: any): void; -} - -interface PropertyDescriptorMap { - [s: string]: PropertyDescriptor; -} - -interface Object { - /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */ - constructor: Function; - - /** Returns a string representation of an object. */ - toString(): string; - - /** Returns a date converted to a string using the current locale. */ - toLocaleString(): string; - - /** Returns the primitive value of the specified object. */ - valueOf(): Object; - - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: string): boolean; - - /** - * Determines whether an object exists in another object's prototype chain. - * @param v Another object whose prototype chain is to be checked. - */ - isPrototypeOf(v: Object): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: string): boolean; -} - -/** - * Provides functionality common to all JavaScript objects. - */ -declare var Object: { - new (value?: any): Object; - (): any; - (value: any): any; - - /** A reference to the prototype for a class of objects. */ - prototype: Object; - - /** - * Returns the prototype of an object. - * @param o The object that references the prototype. - */ - getPrototypeOf(o: any): any; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; - - /** - * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly - * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions. - * @param o Object that contains the own properties. - */ - getOwnPropertyNames(o: any): string[]; - - /** - * Creates an object that has the specified prototype, and that optionally contains specified properties. - * @param o Object to use as a prototype. May be null - * @param properties JavaScript object that contains one or more property descriptors. - */ - create(o: any, properties?: PropertyDescriptorMap): any; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor property. - */ - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; - - /** - * Adds one or more properties to an object, and/or modifies attributes of existing properties. - * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object. - * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property. - */ - defineProperties(o: any, properties: PropertyDescriptorMap): any; - - /** - * Prevents the modification of attributes of existing properties, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - seal(o: any): any; - - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: any): any; - - /** - * Prevents the addition of new properties to an object. - * @param o Object to make non-extensible. - */ - preventExtensions(o: any): any; - - /** - * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object. - * @param o Object to test. - */ - isSealed(o: any): boolean; - - /** - * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object. - * @param o Object to test. - */ - isFrozen(o: any): boolean; - - /** - * Returns a value that indicates whether new properties can be added to an object. - * @param o Object to test. - */ - isExtensible(o: any): boolean; - - /** - * Returns the names of the enumerable properties and methods of an object. - * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. - */ - keys(o: any): string[]; -} - -/** - * Creates a new function. - */ -interface Function { - /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. - * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. - */ - apply(thisArg: any, argArray?: any): any; - - /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. - */ - call(thisArg: any, ...argArray: any[]): any; - - /** - * For a given function, creates a bound function that has the same body as the original function. - * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. - */ - bind(thisArg: any, ...argArray: any[]): any; - - prototype: any; - length: number; - - // Non-standard extensions - arguments: any; - caller: Function; -} - -declare var Function: { - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; -} - -interface IArguments { - [index: number]: any; - length: number; - callee: Function; -} - -interface String { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): string[]; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): string[]; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Removes the leading and trailing white space and line terminator characters from a string. */ - trim(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - [index: number]: string; -} - -/** - * Allows manipulation and formatting of text strings and determination and location of substrings within strings. - */ -declare var String: { - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; -} - -interface Boolean { -} -declare var Boolean: { - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; -} - -interface Number { - /** - * Returns a string representation of an object. - * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers. - */ - toString(radix?: number): string; - - /** - * Returns a string representing a number in fixed-point notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toFixed(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented in exponential notation. - * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive. - */ - toExponential(fractionDigits?: number): string; - - /** - * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits. - * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive. - */ - toPrecision(precision?: number): string; -} - -/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */ -declare var Number: { - new (value?: any): Number; - (value?: any): number; - prototype: Number; - - /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */ - MAX_VALUE: number; - - /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */ - MIN_VALUE: number; - - /** - * A value that is not a number. - * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function. - */ - NaN: number; - - /** - * A value that is less than the largest negative number that can be represented in JavaScript. - * JavaScript displays NEGATIVE_INFINITY values as -infinity. - */ - NEGATIVE_INFINITY: number; - - /** - * A value greater than the largest number that can be represented in JavaScript. - * JavaScript displays POSITIVE_INFINITY values as infinity. - */ - POSITIVE_INFINITY: number; -} - -interface Math { - /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */ - E: number; - /** The natural logarithm of 10. */ - LN10: number; - /** The natural logarithm of 2. */ - LN2: number; - /** The base-2 logarithm of e. */ - LOG2E: number; - /** The base-10 logarithm of e. */ - LOG10E: number; - /** Pi. This is the ratio of the circumference of a circle to its diameter. */ - PI: number; - /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */ - SQRT1_2: number; - /** The square root of 2. */ - SQRT2: number; - /** - * Returns the absolute value of a number (the value without regard to whether it is positive or negative). - * For example, the absolute value of -5 is the same as the absolute value of 5. - * @param x A numeric expression for which the absolute value is needed. - */ - abs(x: number): number; - /** - * Returns the arc cosine (or inverse cosine) of a number. - * @param x A numeric expression. - */ - acos(x: number): number; - /** - * Returns the arcsine of a number. - * @param x A numeric expression. - */ - asin(x: number): number; - /** - * Returns the arctangent of a number. - * @param x A numeric expression for which the arctangent is needed. - */ - atan(x: number): number; - /** - * Returns the angle (in radians) from the X axis to a point (y,x). - * @param y A numeric expression representing the cartesian y-coordinate. - * @param x A numeric expression representing the cartesian x-coordinate. - */ - atan2(y: number, x: number): number; - /** - * Returns the smallest number greater than or equal to its numeric argument. - * @param x A numeric expression. - */ - ceil(x: number): number; - /** - * Returns the cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cos(x: number): number; - /** - * Returns e (the base of natural logarithms) raised to a power. - * @param x A numeric expression representing the power of e. - */ - exp(x: number): number; - /** - * Returns the greatest number less than or equal to its numeric argument. - * @param x A numeric expression. - */ - floor(x: number): number; - /** - * Returns the natural logarithm (base e) of a number. - * @param x A numeric expression. - */ - log(x: number): number; - /** - * Returns the larger of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - max(...values: number[]): number; - /** - * Returns the smaller of a set of supplied numeric expressions. - * @param values Numeric expressions to be evaluated. - */ - min(...values: number[]): number; - /** - * Returns the value of a base expression taken to a specified power. - * @param x The base value of the expression. - * @param y The exponent value of the expression. - */ - pow(x: number, y: number): number; - /** Returns a pseudorandom number between 0 and 1. */ - random(): number; - /** - * Returns a supplied numeric expression rounded to the nearest number. - * @param x The value to be rounded to the nearest number. - */ - round(x: number): number; - /** - * Returns the sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sin(x: number): number; - /** - * Returns the square root of a number. - * @param x A numeric expression. - */ - sqrt(x: number): number; - /** - * Returns the tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tan(x: number): number; -} -/** An intrinsic object that provides basic mathematics functionality and constants. */ -declare var Math: Math; - -/** Enables basic storage and retrieval of dates and times. */ -interface Date { - /** Returns a string representation of a date. The format of the string depends on the locale. */ - toString(): string; - /** Returns a date as a string value. */ - toDateString(): string; - /** Returns a time as a string value. */ - toTimeString(): string; - /** Returns a value as a string value appropriate to the host environment's current locale. */ - toLocaleString(): string; - /** Returns a date as a string value appropriate to the host environment's current locale. */ - toLocaleDateString(): string; - /** Returns a time as a string value appropriate to the host environment's current locale. */ - toLocaleTimeString(): string; - /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */ - valueOf(): number; - /** Gets the time value in milliseconds. */ - getTime(): number; - /** Gets the year, using local time. */ - getFullYear(): number; - /** Gets the year using Universal Coordinated Time (UTC). */ - getUTCFullYear(): number; - /** Gets the month, using local time. */ - getMonth(): number; - /** Gets the month of a Date object using Universal Coordinated Time (UTC). */ - getUTCMonth(): number; - /** Gets the day-of-the-month, using local time. */ - getDate(): number; - /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */ - getUTCDate(): number; - /** Gets the day of the week, using local time. */ - getDay(): number; - /** Gets the day of the week using Universal Coordinated Time (UTC). */ - getUTCDay(): number; - /** Gets the hours in a date, using local time. */ - getHours(): number; - /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */ - getUTCHours(): number; - /** Gets the minutes of a Date object, using local time. */ - getMinutes(): number; - /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */ - getUTCMinutes(): number; - /** Gets the seconds of a Date object, using local time. */ - getSeconds(): number; - /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCSeconds(): number; - /** Gets the milliseconds of a Date, using local time. */ - getMilliseconds(): number; - /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */ - getUTCMilliseconds(): number; - /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */ - getTimezoneOffset(): number; - /** - * Sets the date and time value in the Date object. - * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT. - */ - setTime(time: number): number; - /** - * Sets the milliseconds value in the Date object using local time. - * @param ms A numeric value equal to the millisecond value. - */ - setMilliseconds(ms: number): number; - /** - * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC). - * @param ms A numeric value equal to the millisecond value. - */ - setUTCMilliseconds(ms: number): number; - - /** - * Sets the seconds value in the Date object using local time. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setSeconds(sec: number, ms?: number): number; - /** - * Sets the seconds value in the Date object using Universal Coordinated Time (UTC). - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCSeconds(sec: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using local time. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the minutes value in the Date object using Universal Coordinated Time (UTC). - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCMinutes(min: number, sec?: number, ms?: number): number; - /** - * Sets the hour value in the Date object using local time. - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the hours value in the Date object using Universal Coordinated Time (UTC). - * @param hours A numeric value equal to the hours value. - * @param min A numeric value equal to the minutes value. - * @param sec A numeric value equal to the seconds value. - * @param ms A numeric value equal to the milliseconds value. - */ - setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number; - /** - * Sets the numeric day-of-the-month value of the Date object using local time. - * @param date A numeric value equal to the day of the month. - */ - setDate(date: number): number; - /** - * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC). - * @param date A numeric value equal to the day of the month. - */ - setUTCDate(date: number): number; - /** - * Sets the month value in the Date object using local time. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used. - */ - setMonth(month: number, date?: number): number; - /** - * Sets the month value in the Date object using Universal Coordinated Time (UTC). - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. - * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used. - */ - setUTCMonth(month: number, date?: number): number; - /** - * Sets the year of the Date object using local time. - * @param year A numeric value for the year. - * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified. - * @param date A numeric value equal for the day of the month. - */ - setFullYear(year: number, month?: number, date?: number): number; - /** - * Sets the year value in the Date object using Universal Coordinated Time (UTC). - * @param year A numeric value equal to the year. - * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied. - * @param date A numeric value equal to the day of the month. - */ - setUTCFullYear(year: number, month?: number, date?: number): number; - /** Returns a date converted to a string using Universal Coordinated Time (UTC). */ - toUTCString(): string; - /** Returns a date as a string value in ISO format. */ - toISOString(): string; - /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */ - toJSON(key?: any): string; -} - -declare var Date: { - new (): Date; - new (value: number): Date; - new (value: string): Date; - new (year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date; - (): string; - prototype: Date; - /** - * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970. - * @param s A date string - */ - parse(s: string): number; - /** - * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date. - * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year. - * @param month The month as an number between 0 and 11 (January to December). - * @param date The date as an number between 1 and 31. - * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour. - * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes. - * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds. - * @param ms An number from 0 to 999 that specifies the milliseconds. - */ - UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number; - now(): number; -} - -interface RegExpExecArray { - [index: number]: string; - length: number; - - index: number; - input: string; - - toString(): string; - toLocaleString(): string; - concat(...items: string[][]): string[]; - join(separator?: string): string; - pop(): string; - push(...items: string[]): number; - reverse(): string[]; - shift(): string; - slice(start?: number, end?: number): string[]; - sort(compareFn?: (a: string, b: string) => number): string[]; - splice(start: number): string[]; - splice(start: number, deleteCount: number, ...items: string[]): string[]; - unshift(...items: string[]): number; - - indexOf(searchElement: string, fromIndex?: number): number; - lastIndexOf(searchElement: string, fromIndex?: number): number; - every(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; - some(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): boolean; - forEach(callbackfn: (value: string, index: number, array: string[]) => void, thisArg?: any): void; - map(callbackfn: (value: string, index: number, array: string[]) => any, thisArg?: any): any[]; - filter(callbackfn: (value: string, index: number, array: string[]) => boolean, thisArg?: any): string[]; - reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; - reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: string[]) => any, initialValue?: any): any; -} - - -interface RegExp { - /** - * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. - * @param string The String object or string literal on which to perform the search. - */ - exec(string: string): RegExpExecArray; - - /** - * Returns a Boolean value that indicates whether or not a pattern exists in a searched string. - * @param string String on which to perform the search. - */ - test(string: string): boolean; - - /** Returns a copy of the text of the regular expression pattern. Read-only. The rgExp argument is a Regular expression object. It can be a variable name or a literal. */ - source: string; - - /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */ - global: boolean; - - /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */ - ignoreCase: boolean; - - /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */ - multiline: boolean; - - lastIndex: number; - - // Non-standard extensions - compile(): RegExp; -} -declare var RegExp: { - new (pattern: string, flags?: string): RegExp; - (pattern: string, flags?: string): RegExp; - - // Non-standard extensions - $1: string; - $2: string; - $3: string; - $4: string; - $5: string; - $6: string; - $7: string; - $8: string; - $9: string; - lastMatch: string; -} - -interface Error { - name: string; - message: string; -} -declare var Error: { - new (message?: string): Error; - (message?: string): Error; - prototype: Error; -} - -interface EvalError extends Error { -} -declare var EvalError: { - new (message?: string): EvalError; - (message?: string): EvalError; - prototype: EvalError; -} - -interface RangeError extends Error { -} -declare var RangeError: { - new (message?: string): RangeError; - (message?: string): RangeError; - prototype: RangeError; -} - -interface ReferenceError extends Error { -} -declare var ReferenceError: { - new (message?: string): ReferenceError; - (message?: string): ReferenceError; - prototype: ReferenceError; -} - -interface SyntaxError extends Error { -} -declare var SyntaxError: { - new (message?: string): SyntaxError; - (message?: string): SyntaxError; - prototype: SyntaxError; -} - -interface TypeError extends Error { -} -declare var TypeError: { - new (message?: string): TypeError; - (message?: string): TypeError; - prototype: TypeError; -} - -interface URIError extends Error { -} -declare var URIError: { - new (message?: string): URIError; - (message?: string): URIError; - prototype: URIError; -} - -interface JSON { - /** - * Converts a JavaScript Object Notation (JSON) string into an object. - * @param text A valid JSON string. - * @param reviver A function that transforms the results. This function is called for each member of the object. - * If a member contains nested objects, the nested objects are transformed before the parent object is. - */ - parse(text: string, reviver?: (key: any, value: any) => any): any; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - */ - stringify(value: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - */ - stringify(value: any, replacer: (key: string, value: any) => any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - */ - stringify(value: any, replacer: any[]): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer A function that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: (key: string, value: any) => any, space: any): string; - /** - * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. - * @param value A JavaScript value, usually an object or array, to be converted. - * @param replacer Array that transforms the results. - * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. - */ - stringify(value: any, replacer: any[], space: any): string; -} -/** - * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format. - */ -declare var JSON: JSON; - - -///////////////////////////// -/// ECMAScript Array API (specially handled by compiler) -///////////////////////////// - -interface Array { - /** - * Returns a string representation of an array. - */ - toString(): string; - toLocaleString(): string; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: U[]): T[]; - /** - * Combines two or more arrays. - * @param items Additional items to add to the end of array1. - */ - concat(...items: T[]): T[]; - /** - * Adds all the elements of an array separated by the specified separator string. - * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - */ - join(separator?: string): string; - /** - * Removes the last element from an array and returns it. - */ - pop(): T; - /** - * Appends new elements to an array, and returns the new length of the array. - * @param items New elements of the Array. - */ - push(...items: T[]): number; - /** - * Reverses the elements in an Array. - */ - reverse(): T[]; - /** - * Removes the first element from an array and returns it. - */ - shift(): T; - /** - * Returns a section of an array. - * @param start The beginning of the specified portion of the array. - * @param end The end of the specified portion of the array. - */ - slice(start?: number, end?: number): T[]; - - /** - * Sorts an array. - * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - */ - sort(compareFn?: (a: T, b: T) => number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(start: number): T[]; - - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - * @param deleteCount The number of elements to remove. - * @param items Elements to insert into the array in place of the deleted elements. - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - - /** - * Inserts new elements at the start of an array. - * @param items Elements to insert at the start of the Array. - */ - unshift(...items: T[]): number; - - /** - * Returns the index of the first occurrence of a value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - */ - indexOf(searchElement: T, fromIndex?: number): number; - - /** - * Returns the index of the last occurrence of a specified value in an array. - * @param searchElement The value to locate in the array. - * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - */ - lastIndexOf(searchElement: T, fromIndex?: number): number; - - /** - * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - /** - * Performs the specified action for each element in an array. - * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - /** - * Calls a defined callback function on each element of an array, and returns an array that contains the results. - * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - /** - * Returns the elements of an array that meet the condition specified in a callback function. - * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - */ - filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - */ - reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - /** - * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - */ - length: number; - - [n: number]: T; -} -declare var Array: { - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; -} - - -///////////////////////////// -/// IE10 ECMAScript Extensions -///////////////////////////// - -/** - * Represents a raw buffer of binary data, which is used to store data for the - * different typed arrays. ArrayBuffers cannot be read from or written to directly, - * but can be passed to a typed array or DataView Object to interpret the raw - * buffer as needed. - */ -interface ArrayBuffer { - /** - * Read-only. The length of the ArrayBuffer (in bytes). - */ - byteLength: number; -} - -declare var ArrayBuffer: { - prototype: ArrayBuffer; - new (byteLength: number): ArrayBuffer; -} - -interface ArrayBufferView { - buffer: ArrayBuffer; - byteOffset: number; - byteLength: number; -} - -/** - * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int8Array; -} -declare var Int8Array: { - prototype: Int8Array; - new (length: number): Int8Array; - new (array: Int8Array): Int8Array; - new (array: number[]): Int8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint8Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint8Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint8Array; -} -declare var Uint8Array: { - prototype: Uint8Array; - new (length: number): Uint8Array; - new (array: Uint8Array): Uint8Array; - new (array: number[]): Uint8Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint8Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int16Array; -} -declare var Int16Array: { - prototype: Int16Array; - new (length: number): Int16Array; - new (array: Int16Array): Int16Array; - new (array: number[]): Int16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint16Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint16Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Uint16Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint16Array; -} -declare var Uint16Array: { - prototype: Uint16Array; - new (length: number): Uint16Array; - new (array: Uint16Array): Uint16Array; - new (array: number[]): Uint16Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint16Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Int32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Int32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Int32Array; -} -declare var Int32Array: { - prototype: Int32Array; - new (length: number): Int32Array; - new (array: Int32Array): Int32Array; - new (array: number[]): Int32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Int32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Uint32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Uint32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Uint32Array; -} -declare var Uint32Array: { - prototype: Uint32Array; - new (length: number): Uint32Array; - new (array: Uint32Array): Uint32Array; - new (array: number[]): Uint32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Uint32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float32Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float32Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float32Array; -} -declare var Float32Array: { - prototype: Float32Array; - new (length: number): Float32Array; - new (array: Float32Array): Float32Array; - new (array: number[]): Float32Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float32Array; - BYTES_PER_ELEMENT: number; -} - -/** - * A typed array of 64-bit float values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised. - */ -interface Float64Array extends ArrayBufferView { - /** - * The size in bytes of each element in the array. - */ - BYTES_PER_ELEMENT: number; - - /** - * The length of the array. - */ - length: number; - [index: number]: number; - - /** - * Gets the element at the specified index. - * @param index The index at which to get the element of the array. - */ - get(index: number): number; - - /** - * Sets a value or an array of values. - * @param index The index of the location to set. - * @param value The value to set. - */ - set(index: number, value: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: Float64Array, offset?: number): void; - - /** - * Sets a value or an array of values. - * @param A typed or untyped array of values to set. - * @param offset The index in the current array at which the values are to be written. - */ - set(array: number[], offset?: number): void; - - /** - * Gets a new Float64Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray. - * @param begin The index of the beginning of the array. - * @param end The index of the end of the array. - */ - subarray(begin: number, end?: number): Float64Array; -} -declare var Float64Array: { - prototype: Float64Array; - new (length: number): Float64Array; - new (array: Float64Array): Float64Array; - new (array: number[]): Float64Array; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float64Array; - BYTES_PER_ELEMENT: number; -} - -/** - * You can use a DataView object to read and write the different kinds of binary data to any location in the ArrayBuffer. - */ -interface DataView extends ArrayBufferView { - /** - * Gets the Int8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt8(byteOffset: number): number; - - /** - * Gets the Uint8 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint8(byteOffset: number): number; - - /** - * Gets the Int16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint16 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint16(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Int32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getInt32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Uint32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getUint32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float32 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat32(byteOffset: number, littleEndian?: boolean): number; - - /** - * Gets the Float64 value at the specified byte offset from the start of the view. There is no alignment constraint; multi-byte values may be fetched from any offset. - * @param byteOffset The place in the buffer at which the value should be retrieved. - */ - getFloat64(byteOffset: number, littleEndian?: boolean): number; - - /** - * Stores an Int8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setInt8(byteOffset: number, value: number): void; - - /** - * Stores an Uint8 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - */ - setUint8(byteOffset: number, value: number): void; - - /** - * Stores an Int16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint16 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint16(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Int32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setInt32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Uint32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setUint32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float32 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void; - - /** - * Stores an Float64 value at the specified byte offset from the start of the view. - * @param byteOffset The place in the buffer at which the value should be set. - * @param value The value to set. - * @param littleEndian If false or undefined, a big-endian value should be written, otherwise a little-endian value should be written. - */ - setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void; -} -declare var DataView: { - prototype: DataView; - new (buffer: ArrayBuffer, byteOffset?: number, length?: number): DataView; -} - -///////////////////////////// -/// IE11 ECMAScript Extensions -///////////////////////////// - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): Map; - size: number; -} -declare var Map: { - new (): Map; -} - -interface WeakMap { - clear(): void; - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value: V): WeakMap; -} -declare var WeakMap: { - new (): WeakMap; -} - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} -declare var Set: { - new (): Set; -} - -declare module Intl { - - interface CollatorOptions { - usage?: string; - localeMatcher?: string; - numeric?: boolean; - caseFirst?: string; - sensitivity?: string; - ignorePunctuation?: boolean; - } - - interface ResolvedCollatorOptions { - locale: string; - usage: string; - sensitivity: string; - ignorePunctuation: boolean; - collation: string; - caseFirst: string; - numeric: boolean; - } - - interface Collator { - compare(x: string, y: string): number; - resolvedOptions(): ResolvedCollatorOptions; - } - var Collator: { - new (locales?: string[], options?: CollatorOptions): Collator; - new (locale?: string, options?: CollatorOptions): Collator; - (locales?: string[], options?: CollatorOptions): Collator; - (locale?: string, options?: CollatorOptions): Collator; - supportedLocalesOf(locales: string[], options?: CollatorOptions): string[]; - supportedLocalesOf(locale: string, options?: CollatorOptions): string[]; - } - - interface NumberFormatOptions { - localeMatcher?: string; - style?: string; - currency?: string; - currencyDisplay?: string; - useGrouping?: boolean; - } - - interface ResolvedNumberFormatOptions { - locale: string; - numberingSystem: string; - style: string; - currency?: string; - currencyDisplay?: string; - minimumintegerDigits: number; - minimumFractionDigits: number; - maximumFractionDigits: number; - minimumSignificantDigits?: number; - maximumSignificantDigits?: number; - useGrouping: boolean; - } - - interface NumberFormat { - format(value: number): string; - resolvedOptions(): ResolvedNumberFormatOptions; - } - var NumberFormat: { - new (locales?: string[], options?: NumberFormatOptions): Collator; - new (locale?: string, options?: NumberFormatOptions): Collator; - (locales?: string[], options?: NumberFormatOptions): Collator; - (locale?: string, options?: NumberFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: NumberFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: NumberFormatOptions): string[]; - } - - interface DateTimeFormatOptions { - localeMatcher?: string; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - formatMatcher?: string; - hour12: boolean; - } - - interface ResolvedDateTimeFormatOptions { - locale: string; - calendar: string; - numberingSystem: string; - timeZone: string; - hour12?: boolean; - weekday?: string; - era?: string; - year?: string; - month?: string; - day?: string; - hour?: string; - minute?: string; - second?: string; - timeZoneName?: string; - } - - interface DateTimeFormat { - format(date: number): string; - resolvedOptions(): ResolvedDateTimeFormatOptions; - } - var DateTimeFormat: { - new (locales?: string[], options?: DateTimeFormatOptions): Collator; - new (locale?: string, options?: DateTimeFormatOptions): Collator; - (locales?: string[], options?: DateTimeFormatOptions): Collator; - (locale?: string, options?: DateTimeFormatOptions): Collator; - supportedLocalesOf(locales: string[], options?: DateTimeFormatOptions): string[]; - supportedLocalesOf(locale: string, options?: DateTimeFormatOptions): string[]; - } -} - -interface String { - localeCompare(that: string, locales: string[], options?: Intl.CollatorOptions): number; - localeCompare(that: string, locale: string, options?: Intl.CollatorOptions): number; -} - -interface Number { - toLocaleString(locales?: string[], options?: Intl.NumberFormatOptions): string; - toLocaleString(locale?: string, options?: Intl.NumberFormatOptions): string; -} - -interface Date { - toLocaleString(locales?: string[], options?: Intl.DateTimeFormatOptions): string; - toLocaleString(locale?: string, options?: Intl.DateTimeFormatOptions): string; -} - - -///////////////////////////// -/// IE9 DOM APIs -///////////////////////////// - -interface PositionOptions { - enableHighAccuracy?: boolean; - timeout?: number; - maximumAge?: number; -} - -interface NavigatorID { - appVersion: string; - appName: string; - userAgent: string; - platform: string; -} - -interface HTMLTableElement extends HTMLElement, MSDataBindingTableExtensions, MSDataBindingExtensions, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the amount of space between cells in a table. - */ - cellSpacing: string; - /** - * Retrieves the tFoot object of the table. - */ - tFoot: HTMLTableSectionElement; - /** - * Sets or retrieves the way the border frame around the table is displayed. - */ - frame: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Sets or retrieves which dividing lines (inner borders) are displayed. - */ - rules: string; - /** - * Sets or retrieves the number of columns in the table. - */ - cols: number; - /** - * Sets or retrieves a description and/or structure of the object. - */ - summary: string; - /** - * Retrieves the caption object of a table. - */ - caption: HTMLTableCaptionElement; - /** - * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order. - */ - tBodies: HTMLCollection; - /** - * Retrieves the tHead object of the table. - */ - tHead: HTMLTableSectionElement; - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Retrieves a collection of all cells in the table row or in the entire table. - */ - cells: HTMLCollection; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the amount of space between the border of the cell and the content of the cell. - */ - cellPadding: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Creates an empty tBody element in the table. - */ - createTBody(): HTMLElement; - /** - * Deletes the caption element and its contents from the table. - */ - deleteCaption(): void; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; - /** - * Deletes the tFoot element and its contents from the table. - */ - deleteTFoot(): void; - /** - * Returns the tHead element object if successful, or null otherwise. - */ - createTHead(): HTMLElement; - /** - * Deletes the tHead element and its contents from the table. - */ - deleteTHead(): void; - /** - * Creates an empty caption element in the table. - */ - createCaption(): HTMLElement; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): Object; - /** - * Creates an empty tFoot element in the table. - */ - createTFoot(): HTMLElement; -} -declare var HTMLTableElement: { - prototype: HTMLTableElement; - new (): HTMLTableElement; -} - -interface TreeWalker { - whatToShow: number; - filter: NodeFilter; - root: Node; - currentNode: Node; - expandEntityReferences: boolean; - previousSibling(): Node; - lastChild(): Node; - nextSibling(): Node; - nextNode(): Node; - parentNode(): Node; - firstChild(): Node; - previousNode(): Node; -} -declare var TreeWalker: { - prototype: TreeWalker; - new (): TreeWalker; -} - -interface GetSVGDocument { - getSVGDocument(): Document; -} - -interface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticRel: { - prototype: SVGPathSegCurvetoQuadraticRel; - new (): SVGPathSegCurvetoQuadraticRel; -} - -interface Performance { - navigation: PerformanceNavigation; - timing: PerformanceTiming; - getEntriesByType(entryType: string): any; - toJSON(): any; - getMeasures(measureName?: string): any; - clearMarks(markName?: string): void; - getMarks(markName?: string): any; - clearResourceTimings(): void; - mark(markName: string): void; - measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - getEntriesByName(name: string, entryType?: string): any; - getEntries(): any; - clearMeasures(measureName?: string): void; - setResourceTimingBufferSize(maxSize: number): void; -} -declare var Performance: { - prototype: Performance; - new (): Performance; -} - -interface MSDataBindingTableExtensions { - dataPageSize: number; - nextPage(): void; - firstPage(): void; - refresh(): void; - previousPage(): void; - lastPage(): void; -} - -interface CompositionEvent extends UIEvent { - data: string; - locale: string; - initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void; -} -declare var CompositionEvent: { - prototype: CompositionEvent; - new (): CompositionEvent; -} - -interface WindowTimers { - clearTimeout(handle: number): void; - setTimeout(handler: any, timeout?: any, ...args: any[]): number; - clearInterval(handle: number): void; - setInterval(handler: any, timeout?: any, ...args: any[]): number; -} - -interface SVGMarkerElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { - orientType: SVGAnimatedEnumeration; - markerUnits: SVGAnimatedEnumeration; - markerWidth: SVGAnimatedLength; - markerHeight: SVGAnimatedLength; - orientAngle: SVGAnimatedAngle; - refY: SVGAnimatedLength; - refX: SVGAnimatedLength; - setOrientToAngle(angle: SVGAngle): void; - setOrientToAuto(): void; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} -declare var SVGMarkerElement: { - prototype: SVGMarkerElement; - new (): SVGMarkerElement; - SVG_MARKER_ORIENT_UNKNOWN: number; - SVG_MARKER_ORIENT_ANGLE: number; - SVG_MARKERUNITS_UNKNOWN: number; - SVG_MARKERUNITS_STROKEWIDTH: number; - SVG_MARKER_ORIENT_AUTO: number; - SVG_MARKERUNITS_USERSPACEONUSE: number; -} - -interface CSSStyleDeclaration { - backgroundAttachment: string; - visibility: string; - textAlignLast: string; - borderRightStyle: string; - counterIncrement: string; - orphans: string; - cssText: string; - borderStyle: string; - pointerEvents: string; - borderTopColor: string; - markerEnd: string; - textIndent: string; - listStyleImage: string; - cursor: string; - listStylePosition: string; - wordWrap: string; - borderTopStyle: string; - alignmentBaseline: string; - opacity: string; - direction: string; - strokeMiterlimit: string; - maxWidth: string; - color: string; - clip: string; - borderRightWidth: string; - verticalAlign: string; - overflow: string; - mask: string; - borderLeftStyle: string; - emptyCells: string; - stopOpacity: string; - paddingRight: string; - parentRule: CSSRule; - background: string; - boxSizing: string; - textJustify: string; - height: string; - paddingTop: string; - length: number; - right: string; - baselineShift: string; - borderLeft: string; - widows: string; - lineHeight: string; - left: string; - textUnderlinePosition: string; - glyphOrientationHorizontal: string; - display: string; - textAnchor: string; - cssFloat: string; - strokeDasharray: string; - rubyAlign: string; - fontSizeAdjust: string; - borderLeftColor: string; - backgroundImage: string; - listStyleType: string; - strokeWidth: string; - textOverflow: string; - fillRule: string; - borderBottomColor: string; - zIndex: string; - position: string; - listStyle: string; - msTransformOrigin: string; - dominantBaseline: string; - overflowY: string; - fill: string; - captionSide: string; - borderCollapse: string; - boxShadow: string; - quotes: string; - tableLayout: string; - unicodeBidi: string; - borderBottomWidth: string; - backgroundSize: string; - textDecoration: string; - strokeDashoffset: string; - fontSize: string; - border: string; - pageBreakBefore: string; - borderTopRightRadius: string; - msTransform: string; - borderBottomLeftRadius: string; - textTransform: string; - rubyPosition: string; - strokeLinejoin: string; - clipPath: string; - borderRightColor: string; - fontFamily: string; - clear: string; - content: string; - backgroundClip: string; - marginBottom: string; - counterReset: string; - outlineWidth: string; - marginRight: string; - paddingLeft: string; - borderBottom: string; - wordBreak: string; - marginTop: string; - top: string; - fontWeight: string; - borderRight: string; - width: string; - kerning: string; - pageBreakAfter: string; - borderBottomStyle: string; - fontStretch: string; - padding: string; - strokeOpacity: string; - markerStart: string; - bottom: string; - borderLeftWidth: string; - clipRule: string; - backgroundPosition: string; - backgroundColor: string; - pageBreakInside: string; - backgroundOrigin: string; - strokeLinecap: string; - borderTopWidth: string; - outlineStyle: string; - borderTop: string; - outlineColor: string; - paddingBottom: string; - marginLeft: string; - font: string; - outline: string; - wordSpacing: string; - maxHeight: string; - fillOpacity: string; - letterSpacing: string; - borderSpacing: string; - backgroundRepeat: string; - borderRadius: string; - borderWidth: string; - borderBottomRightRadius: string; - whiteSpace: string; - fontStyle: string; - minWidth: string; - stopColor: string; - borderTopLeftRadius: string; - borderColor: string; - marker: string; - glyphOrientationVertical: string; - markerMid: string; - fontVariant: string; - minHeight: string; - stroke: string; - rubyOverhang: string; - overflowX: string; - textAlign: string; - margin: string; - getPropertyPriority(propertyName: string): string; - getPropertyValue(propertyName: string): string; - removeProperty(propertyName: string): string; - item(index: number): string; - [index: number]: string; - setProperty(propertyName: string, value: string, priority?: string): void; -} -declare var CSSStyleDeclaration: { - prototype: CSSStyleDeclaration; - new (): CSSStyleDeclaration; -} - -interface SVGGElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGGElement: { - prototype: SVGGElement; - new (): SVGGElement; -} - -interface MSStyleCSSProperties extends MSCSSProperties { - pixelWidth: number; - posHeight: number; - posLeft: number; - pixelTop: number; - pixelBottom: number; - textDecorationNone: boolean; - pixelLeft: number; - posTop: number; - posBottom: number; - textDecorationOverline: boolean; - posWidth: number; - textDecorationLineThrough: boolean; - pixelHeight: number; - textDecorationBlink: boolean; - posRight: number; - pixelRight: number; - textDecorationUnderline: boolean; -} -declare var MSStyleCSSProperties: { - prototype: MSStyleCSSProperties; - new (): MSStyleCSSProperties; -} - -interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, MSNavigatorExtensions, NavigatorGeolocation, MSNavigatorDoNotTrack, NavigatorStorageUtils { -} -declare var Navigator: { - prototype: Navigator; - new (): Navigator; -} - -interface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothAbs: { - prototype: SVGPathSegCurvetoCubicSmoothAbs; - new (): SVGPathSegCurvetoCubicSmoothAbs; -} - -interface SVGZoomEvent extends UIEvent { - zoomRectScreen: SVGRect; - previousScale: number; - newScale: number; - previousTranslate: SVGPoint; - newTranslate: SVGPoint; -} -declare var SVGZoomEvent: { - prototype: SVGZoomEvent; - new (): SVGZoomEvent; -} - -interface NodeSelector { - querySelectorAll(selectors: string): NodeList; - querySelector(selectors: string): Element; -} - -interface HTMLTableDataCellElement extends HTMLTableCellElement { -} -declare var HTMLTableDataCellElement: { - prototype: HTMLTableDataCellElement; - new (): HTMLTableDataCellElement; -} - -interface HTMLBaseElement extends HTMLElement { - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Gets or sets the baseline URL on which relative links are based. - */ - href: string; -} -declare var HTMLBaseElement: { - prototype: HTMLBaseElement; - new (): HTMLBaseElement; -} - -interface ClientRect { - left: number; - width: number; - right: number; - top: number; - bottom: number; - height: number; -} -declare var ClientRect: { - prototype: ClientRect; - new (): ClientRect; -} - -interface PositionErrorCallback { - (error: PositionError): void; -} - -interface DOMImplementation { - createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; - createDocument(namespaceURI: string, qualifiedName: string, doctype: DocumentType): Document; - hasFeature(feature: string, version?: string): boolean; - createHTMLDocument(title: string): Document; -} -declare var DOMImplementation: { - prototype: DOMImplementation; - new (): DOMImplementation; -} - -interface SVGUnitTypes { - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} -declare var SVGUnitTypes: { - prototype: SVGUnitTypes; - new (): SVGUnitTypes; - SVG_UNIT_TYPE_UNKNOWN: number; - SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number; - SVG_UNIT_TYPE_USERSPACEONUSE: number; -} - -interface Element extends Node, NodeSelector, ElementTraversal { - scrollTop: number; - clientLeft: number; - scrollLeft: number; - tagName: string; - clientWidth: number; - scrollWidth: number; - clientHeight: number; - clientTop: number; - scrollHeight: number; - getAttribute(name?: string): string; - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - hasAttributeNS(namespaceURI: string, localName: string): boolean; - getBoundingClientRect(): ClientRect; - getAttributeNS(namespaceURI: string, localName: string): string; - getAttributeNodeNS(namespaceURI: string, localName: string): Attr; - setAttributeNodeNS(newAttr: Attr): Attr; - msMatchesSelector(selectors: string): boolean; - hasAttribute(name: string): boolean; - removeAttribute(name?: string): void; - setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void; - getAttributeNode(name: string): Attr; - fireEvent(eventName: string, eventObj?: any): boolean; - getElementsByTagName(name: "a"): NodeListOf; - getElementsByTagName(name: "abbr"): NodeListOf; - getElementsByTagName(name: "address"): NodeListOf; - getElementsByTagName(name: "area"): NodeListOf; - getElementsByTagName(name: "article"): NodeListOf; - getElementsByTagName(name: "aside"): NodeListOf; - getElementsByTagName(name: "audio"): NodeListOf; - getElementsByTagName(name: "b"): NodeListOf; - getElementsByTagName(name: "base"): NodeListOf; - getElementsByTagName(name: "bdi"): NodeListOf; - getElementsByTagName(name: "bdo"): NodeListOf; - getElementsByTagName(name: "blockquote"): NodeListOf; - getElementsByTagName(name: "body"): NodeListOf; - getElementsByTagName(name: "br"): NodeListOf; - getElementsByTagName(name: "button"): NodeListOf; - getElementsByTagName(name: "canvas"): NodeListOf; - getElementsByTagName(name: "caption"): NodeListOf; - getElementsByTagName(name: "cite"): NodeListOf; - getElementsByTagName(name: "code"): NodeListOf; - getElementsByTagName(name: "col"): NodeListOf; - getElementsByTagName(name: "colgroup"): NodeListOf; - getElementsByTagName(name: "datalist"): NodeListOf; - getElementsByTagName(name: "dd"): NodeListOf; - getElementsByTagName(name: "del"): NodeListOf; - getElementsByTagName(name: "dfn"): NodeListOf; - getElementsByTagName(name: "div"): NodeListOf; - getElementsByTagName(name: "dl"): NodeListOf; - getElementsByTagName(name: "dt"): NodeListOf; - getElementsByTagName(name: "em"): NodeListOf; - getElementsByTagName(name: "embed"): NodeListOf; - getElementsByTagName(name: "fieldset"): NodeListOf; - getElementsByTagName(name: "figcaption"): NodeListOf; - getElementsByTagName(name: "figure"): NodeListOf; - getElementsByTagName(name: "footer"): NodeListOf; - getElementsByTagName(name: "form"): NodeListOf; - getElementsByTagName(name: "h1"): NodeListOf; - getElementsByTagName(name: "h2"): NodeListOf; - getElementsByTagName(name: "h3"): NodeListOf; - getElementsByTagName(name: "h4"): NodeListOf; - getElementsByTagName(name: "h5"): NodeListOf; - getElementsByTagName(name: "h6"): NodeListOf; - getElementsByTagName(name: "head"): NodeListOf; - getElementsByTagName(name: "header"): NodeListOf; - getElementsByTagName(name: "hgroup"): NodeListOf; - getElementsByTagName(name: "hr"): NodeListOf; - getElementsByTagName(name: "html"): NodeListOf; - getElementsByTagName(name: "i"): NodeListOf; - getElementsByTagName(name: "iframe"): NodeListOf; - getElementsByTagName(name: "img"): NodeListOf; - getElementsByTagName(name: "input"): NodeListOf; - getElementsByTagName(name: "ins"): NodeListOf; - getElementsByTagName(name: "kbd"): NodeListOf; - getElementsByTagName(name: "label"): NodeListOf; - getElementsByTagName(name: "legend"): NodeListOf; - getElementsByTagName(name: "li"): NodeListOf; - getElementsByTagName(name: "link"): NodeListOf; - getElementsByTagName(name: "main"): NodeListOf; - getElementsByTagName(name: "map"): NodeListOf; - getElementsByTagName(name: "mark"): NodeListOf; - getElementsByTagName(name: "menu"): NodeListOf; - getElementsByTagName(name: "meta"): NodeListOf; - getElementsByTagName(name: "nav"): NodeListOf; - getElementsByTagName(name: "noscript"): NodeListOf; - getElementsByTagName(name: "object"): NodeListOf; - getElementsByTagName(name: "ol"): NodeListOf; - getElementsByTagName(name: "optgroup"): NodeListOf; - getElementsByTagName(name: "option"): NodeListOf; - getElementsByTagName(name: "p"): NodeListOf; - getElementsByTagName(name: "param"): NodeListOf; - getElementsByTagName(name: "pre"): NodeListOf; - getElementsByTagName(name: "progress"): NodeListOf; - getElementsByTagName(name: "q"): NodeListOf; - getElementsByTagName(name: "rp"): NodeListOf; - getElementsByTagName(name: "rt"): NodeListOf; - getElementsByTagName(name: "ruby"): NodeListOf; - getElementsByTagName(name: "s"): NodeListOf; - getElementsByTagName(name: "samp"): NodeListOf; - getElementsByTagName(name: "script"): NodeListOf; - getElementsByTagName(name: "section"): NodeListOf; - getElementsByTagName(name: "select"): NodeListOf; - getElementsByTagName(name: "small"): NodeListOf; - getElementsByTagName(name: "source"): NodeListOf; - getElementsByTagName(name: "span"): NodeListOf; - getElementsByTagName(name: "strong"): NodeListOf; - getElementsByTagName(name: "style"): NodeListOf; - getElementsByTagName(name: "sub"): NodeListOf; - getElementsByTagName(name: "summary"): NodeListOf; - getElementsByTagName(name: "sup"): NodeListOf; - getElementsByTagName(name: "table"): NodeListOf; - getElementsByTagName(name: "tbody"): NodeListOf; - getElementsByTagName(name: "td"): NodeListOf; - getElementsByTagName(name: "textarea"): NodeListOf; - getElementsByTagName(name: "tfoot"): NodeListOf; - getElementsByTagName(name: "th"): NodeListOf; - getElementsByTagName(name: "thead"): NodeListOf; - getElementsByTagName(name: "title"): NodeListOf; - getElementsByTagName(name: "tr"): NodeListOf; - getElementsByTagName(name: "track"): NodeListOf; - getElementsByTagName(name: "u"): NodeListOf; - getElementsByTagName(name: "ul"): NodeListOf; - getElementsByTagName(name: "var"): NodeListOf; - getElementsByTagName(name: "video"): NodeListOf; - getElementsByTagName(name: "wbr"): NodeListOf; - getElementsByTagName(name: string): NodeList; - getClientRects(): ClientRectList; - setAttributeNode(newAttr: Attr): Attr; - removeAttributeNode(oldAttr: Attr): Attr; - setAttribute(name?: string, value?: string): void; - removeAttributeNS(namespaceURI: string, localName: string): void; -} -declare var Element: { - prototype: Element; - new (): Element; -} - -interface HTMLNextIdElement extends HTMLElement { - n: string; -} -declare var HTMLNextIdElement: { - prototype: HTMLNextIdElement; - new (): HTMLNextIdElement; -} - -interface SVGPathSegMovetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoRel: { - prototype: SVGPathSegMovetoRel; - new (): SVGPathSegMovetoRel; -} - -interface SVGLineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLineElement: { - prototype: SVGLineElement; - new (): SVGLineElement; -} - -interface HTMLParagraphElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; -} -declare var HTMLParagraphElement: { - prototype: HTMLParagraphElement; - new (): HTMLParagraphElement; -} - -interface HTMLAreasCollection extends HTMLCollection { - /** - * Removes an element from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - */ - add(element: HTMLElement, before?: any): void; -} -declare var HTMLAreasCollection: { - prototype: HTMLAreasCollection; - new (): HTMLAreasCollection; -} - -interface SVGDescElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGDescElement: { - prototype: SVGDescElement; - new (): SVGDescElement; -} - -interface Node extends EventTarget { - nodeType: number; - previousSibling: Node; - localName: string; - namespaceURI: string; - textContent: string; - parentNode: Node; - nextSibling: Node; - nodeValue: string; - lastChild: Node; - childNodes: NodeList; - nodeName: string; - ownerDocument: Document; - attributes: NamedNodeMap; - firstChild: Node; - prefix: string; - removeChild(oldChild: Node): Node; - appendChild(newChild: Node): Node; - isSupported(feature: string, version: string): boolean; - isEqualNode(arg: Node): boolean; - lookupPrefix(namespaceURI: string): string; - isDefaultNamespace(namespaceURI: string): boolean; - compareDocumentPosition(other: Node): number; - normalize(): void; - isSameNode(other: Node): boolean; - hasAttributes(): boolean; - lookupNamespaceURI(prefix: string): string; - cloneNode(deep?: boolean): Node; - hasChildNodes(): boolean; - replaceChild(newChild: Node, oldChild: Node): Node; - insertBefore(newChild: Node, refChild?: Node): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} -declare var Node: { - prototype: Node; - new (): Node; - ENTITY_REFERENCE_NODE: number; - ATTRIBUTE_NODE: number; - DOCUMENT_FRAGMENT_NODE: number; - TEXT_NODE: number; - ELEMENT_NODE: number; - COMMENT_NODE: number; - DOCUMENT_POSITION_DISCONNECTED: number; - DOCUMENT_POSITION_CONTAINED_BY: number; - DOCUMENT_POSITION_CONTAINS: number; - DOCUMENT_TYPE_NODE: number; - DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number; - DOCUMENT_NODE: number; - ENTITY_NODE: number; - PROCESSING_INSTRUCTION_NODE: number; - CDATA_SECTION_NODE: number; - NOTATION_NODE: number; - DOCUMENT_POSITION_FOLLOWING: number; - DOCUMENT_POSITION_PRECEDING: number; -} - -interface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothRel: { - prototype: SVGPathSegCurvetoQuadraticSmoothRel; - new (): SVGPathSegCurvetoQuadraticSmoothRel; -} - -interface DOML2DeprecatedListSpaceReduction { - compact: boolean; -} - -interface MSScriptHost { -} -declare var MSScriptHost: { - prototype: MSScriptHost; - new (): MSScriptHost; -} - -interface SVGClipPathElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - clipPathUnits: SVGAnimatedEnumeration; -} -declare var SVGClipPathElement: { - prototype: SVGClipPathElement; - new (): SVGClipPathElement; -} - -interface MouseEvent extends UIEvent { - toElement: Element; - layerY: number; - fromElement: Element; - which: number; - pageX: number; - offsetY: number; - x: number; - y: number; - metaKey: boolean; - altKey: boolean; - ctrlKey: boolean; - offsetX: number; - screenX: number; - clientY: number; - shiftKey: boolean; - layerX: number; - screenY: number; - relatedTarget: EventTarget; - button: number; - pageY: number; - buttons: number; - clientX: number; - initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget): void; - getModifierState(keyArg: string): boolean; -} -declare var MouseEvent: { - prototype: MouseEvent; - new (): MouseEvent; -} - -interface RangeException { - code: number; - message: string; - toString(): string; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} -declare var RangeException: { - prototype: RangeException; - new (): RangeException; - INVALID_NODE_TYPE_ERR: number; - BAD_BOUNDARYPOINTS_ERR: number; -} - -interface SVGTextPositioningElement extends SVGTextContentElement { - y: SVGAnimatedLengthList; - rotate: SVGAnimatedNumberList; - dy: SVGAnimatedLengthList; - x: SVGAnimatedLengthList; - dx: SVGAnimatedLengthList; -} -declare var SVGTextPositioningElement: { - prototype: SVGTextPositioningElement; - new (): SVGTextPositioningElement; -} - -interface HTMLAppletElement extends HTMLElement, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - width: number; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - object: string; - form: HTMLFormElement; - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned. - */ - contentDocument: Document; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - /** - * Sets or retrieves a character string that can be used to implement your own declare functionality for the object. - */ - declare: boolean; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLAppletElement: { - prototype: HTMLAppletElement; - new (): HTMLAppletElement; -} - -interface TextMetrics { - width: number; -} -declare var TextMetrics: { - prototype: TextMetrics; - new (): TextMetrics; -} - -interface DocumentEvent { - createEvent(eventInterface: string): Event; -} - -interface HTMLOListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * The starting number. - */ - start: number; -} -declare var HTMLOListElement: { - prototype: HTMLOListElement; - new (): HTMLOListElement; -} - -interface SVGPathSegLinetoVerticalRel extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalRel: { - prototype: SVGPathSegLinetoVerticalRel; - new (): SVGPathSegLinetoVerticalRel; -} - -interface SVGAnimatedString { - animVal: string; - baseVal: string; -} -declare var SVGAnimatedString: { - prototype: SVGAnimatedString; - new (): SVGAnimatedString; -} - -interface CDATASection extends Text { -} -declare var CDATASection: { - prototype: CDATASection; - new (): CDATASection; -} - -interface StyleMedia { - type: string; - matchMedium(mediaquery: string): boolean; -} -declare var StyleMedia: { - prototype: StyleMedia; - new (): StyleMedia; -} - -interface HTMLSelectElement extends HTMLElement, MSHTMLCollectionExtensions, MSDataBindingExtensions { - options: HTMLSelectElement; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the number of rows in the list box. - */ - size: number; - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the index of the selected option in a select object. - */ - selectedIndex: number; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Retrieves the type of select control based on the value of the MULTIPLE attribute. - */ - type: string; - /** - * Removes an element from the collection. - * @param index Number that specifies the zero-based index of the element to remove from the collection. - */ - remove(index?: number): void; - /** - * Adds an element to the areas, controlRange, or options collection. - * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection. - * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection. - */ - add(element: HTMLElement, before?: any): void; - /** - * Retrieves a select object or an object from an options collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Retrieves a select object or an object from an options collection. - * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made. - */ - namedItem(name: string): any; - [name: string]: any; -} -declare var HTMLSelectElement: { - prototype: HTMLSelectElement; - new (): HTMLSelectElement; -} - -interface TextRange { - boundingLeft: number; - htmlText: string; - offsetLeft: number; - boundingWidth: number; - boundingHeight: number; - boundingTop: number; - text: string; - offsetTop: number; - moveToPoint(x: number, y: number): void; - queryCommandValue(cmdID: string): any; - getBookmark(): string; - move(unit: string, count?: number): number; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(fStart?: boolean): void; - findText(string: string, count?: number, flags?: number): boolean; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - getBoundingClientRect(): ClientRect; - moveToBookmark(bookmark: string): boolean; - isEqual(range: TextRange): boolean; - duplicate(): TextRange; - collapse(start?: boolean): void; - queryCommandText(cmdID: string): string; - select(): void; - pasteHTML(html: string): void; - inRange(range: TextRange): boolean; - moveEnd(unit: string, count?: number): number; - getClientRects(): ClientRectList; - moveStart(unit: string, count?: number): number; - parentElement(): Element; - queryCommandState(cmdID: string): boolean; - compareEndPoints(how: string, sourceRange: TextRange): number; - execCommandShowHelp(cmdID: string): boolean; - moveToElementText(element: Element): void; - expand(Unit: string): boolean; - queryCommandSupported(cmdID: string): boolean; - setEndPoint(how: string, SourceRange: TextRange): void; - queryCommandEnabled(cmdID: string): boolean; -} -declare var TextRange: { - prototype: TextRange; - new (): TextRange; -} - -interface SVGTests { - requiredFeatures: SVGStringList; - requiredExtensions: SVGStringList; - systemLanguage: SVGStringList; - hasExtension(extension: string): boolean; -} - -interface HTMLBlockElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLBlockElement: { - prototype: HTMLBlockElement; - new (): HTMLBlockElement; -} - -interface CSSStyleSheet extends StyleSheet { - owningElement: Element; - imports: StyleSheetList; - isAlternate: boolean; - rules: MSCSSRuleList; - isPrefAlternate: boolean; - readOnly: boolean; - cssText: string; - ownerRule: CSSRule; - href: string; - cssRules: CSSRuleList; - id: string; - pages: StyleSheetPageList; - addImport(bstrURL: string, lIndex?: number): number; - addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - insertRule(rule: string, index?: number): number; - removeRule(lIndex: number): void; - deleteRule(index?: number): void; - addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number; - removeImport(lIndex: number): void; -} -declare var CSSStyleSheet: { - prototype: CSSStyleSheet; - new (): CSSStyleSheet; -} - -interface MSSelection { - type: string; - typeDetail: string; - createRange(): TextRange; - clear(): void; - createRangeCollection(): TextRangeCollection; - empty(): void; -} -declare var MSSelection: { - prototype: MSSelection; - new (): MSSelection; -} - -interface HTMLMetaElement extends HTMLElement { - /** - * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header. - */ - httpEquiv: string; - /** - * Sets or retrieves the value specified in the content attribute of the meta object. - */ - name: string; - /** - * Gets or sets meta-information to associate with httpEquiv or name. - */ - content: string; - /** - * Sets or retrieves the URL property that will be loaded after the specified time has elapsed. - */ - url: string; - /** - * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object. - */ - scheme: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; -} -declare var HTMLMetaElement: { - prototype: HTMLMetaElement; - new (): HTMLMetaElement; -} - -interface SVGPatternElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired, SVGURIReference { - patternUnits: SVGAnimatedEnumeration; - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - patternContentUnits: SVGAnimatedEnumeration; - patternTransform: SVGAnimatedTransformList; - height: SVGAnimatedLength; -} -declare var SVGPatternElement: { - prototype: SVGPatternElement; - new (): SVGPatternElement; -} - -interface SVGAnimatedAngle { - animVal: SVGAngle; - baseVal: SVGAngle; -} -declare var SVGAnimatedAngle: { - prototype: SVGAnimatedAngle; - new (): SVGAnimatedAngle; -} - -interface Selection { - isCollapsed: boolean; - anchorNode: Node; - focusNode: Node; - anchorOffset: number; - focusOffset: number; - rangeCount: number; - addRange(range: Range): void; - collapseToEnd(): void; - toString(): string; - selectAllChildren(parentNode: Node): void; - getRangeAt(index: number): Range; - collapse(parentNode: Node, offset: number): void; - removeAllRanges(): void; - collapseToStart(): void; - deleteFromDocument(): void; - removeRange(range: Range): void; -} -declare var Selection: { - prototype: Selection; - new (): Selection; -} - -interface SVGScriptElement extends SVGElement, SVGExternalResourcesRequired, SVGURIReference { - type: string; -} -declare var SVGScriptElement: { - prototype: SVGScriptElement; - new (): SVGScriptElement; -} - -interface HTMLDDElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDDElement: { - prototype: HTMLDDElement; - new (): HTMLDDElement; -} - -interface MSDataBindingRecordSetReadonlyExtensions { - recordset: Object; - namedRecordset(dataMember: string, hierarchy?: any): Object; -} - -interface CSSStyleRule extends CSSRule { - selectorText: string; - style: MSStyleCSSProperties; - readOnly: boolean; -} -declare var CSSStyleRule: { - prototype: CSSStyleRule; - new (): CSSStyleRule; -} - -interface NodeIterator { - whatToShow: number; - filter: NodeFilter; - root: Node; - expandEntityReferences: boolean; - nextNode(): Node; - detach(): void; - previousNode(): Node; -} -declare var NodeIterator: { - prototype: NodeIterator; - new (): NodeIterator; -} - -interface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox, SVGExternalResourcesRequired { - viewTarget: SVGStringList; -} -declare var SVGViewElement: { - prototype: SVGViewElement; - new (): SVGViewElement; -} - -interface HTMLLinkElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; -} -declare var HTMLLinkElement: { - prototype: HTMLLinkElement; - new (): HTMLLinkElement; -} - -interface SVGLocatable { - farthestViewportElement: SVGElement; - nearestViewportElement: SVGElement; - getBBox(): SVGRect; - getTransformToElement(element: SVGElement): SVGMatrix; - getCTM(): SVGMatrix; - getScreenCTM(): SVGMatrix; -} - -interface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; -} -declare var HTMLFontElement: { - prototype: HTMLFontElement; - new (): HTMLFontElement; -} - -interface SVGTitleElement extends SVGElement, SVGStylable, SVGLangSpace { -} -declare var SVGTitleElement: { - prototype: SVGTitleElement; - new (): SVGTitleElement; -} - -interface ControlRangeCollection { - length: number; - queryCommandValue(cmdID: string): any; - remove(index: number): void; - add(item: Element): void; - queryCommandIndeterm(cmdID: string): boolean; - scrollIntoView(varargStart?: any): void; - item(index: number): Element; - [index: number]: Element; - execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; - addElement(item: Element): void; - queryCommandState(cmdID: string): boolean; - queryCommandSupported(cmdID: string): boolean; - queryCommandEnabled(cmdID: string): boolean; - queryCommandText(cmdID: string): string; - select(): void; -} -declare var ControlRangeCollection: { - prototype: ControlRangeCollection; - new (): ControlRangeCollection; -} - -interface MSNamespaceInfo extends MSEventAttachmentTarget { - urn: string; - onreadystatechange: (ev: Event) => any; - name: string; - readyState: string; - doImport(implementationUrl: string): void; -} -declare var MSNamespaceInfo: { - prototype: MSNamespaceInfo; - new (): MSNamespaceInfo; -} - -interface WindowSessionStorage { - sessionStorage: Storage; -} - -interface SVGAnimatedTransformList { - animVal: SVGTransformList; - baseVal: SVGTransformList; -} -declare var SVGAnimatedTransformList: { - prototype: SVGAnimatedTransformList; - new (): SVGAnimatedTransformList; -} - -interface HTMLTableCaptionElement extends HTMLElement { - /** - * Sets or retrieves the alignment of the caption or legend. - */ - align: string; - /** - * Sets or retrieves whether the caption appears at the top or bottom of the table. - */ - vAlign: string; -} -declare var HTMLTableCaptionElement: { - prototype: HTMLTableCaptionElement; - new (): HTMLTableCaptionElement; -} - -interface HTMLOptionElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; - create(): HTMLOptionElement; -} -declare var HTMLOptionElement: { - prototype: HTMLOptionElement; - new (): HTMLOptionElement; -} - -interface HTMLMapElement extends HTMLElement { - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves a collection of the area objects defined for the given map object. - */ - areas: HTMLAreasCollection; -} -declare var HTMLMapElement: { - prototype: HTMLMapElement; - new (): HTMLMapElement; -} - -interface HTMLMenuElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { - type: string; -} -declare var HTMLMenuElement: { - prototype: HTMLMenuElement; - new (): HTMLMenuElement; -} - -interface MouseWheelEvent extends MouseEvent { - wheelDelta: number; - initMouseWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, wheelDeltaArg: number): void; -} -declare var MouseWheelEvent: { - prototype: MouseWheelEvent; - new (): MouseWheelEvent; -} - -interface SVGFitToViewBox { - viewBox: SVGAnimatedRect; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface SVGPointList { - numberOfItems: number; - replaceItem(newItem: SVGPoint, index: number): SVGPoint; - getItem(index: number): SVGPoint; - clear(): void; - appendItem(newItem: SVGPoint): SVGPoint; - initialize(newItem: SVGPoint): SVGPoint; - removeItem(index: number): SVGPoint; - insertItemBefore(newItem: SVGPoint, index: number): SVGPoint; -} -declare var SVGPointList: { - prototype: SVGPointList; - new (): SVGPointList; -} - -interface SVGAnimatedLengthList { - animVal: SVGLengthList; - baseVal: SVGLengthList; -} -declare var SVGAnimatedLengthList: { - prototype: SVGAnimatedLengthList; - new (): SVGAnimatedLengthList; -} - -interface Window extends EventTarget, MSEventAttachmentTarget, WindowLocalStorage, MSWindowExtensions, WindowSessionStorage, WindowTimers { - ondragend: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - ondragover: (ev: DragEvent) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - screenX: number; - onmouseover: (ev: MouseEvent) => any; - ondragleave: (ev: DragEvent) => any; - history: History; - pageXOffset: number; - name: string; - onafterprint: (ev: Event) => any; - onpause: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - top: Window; - onmousedown: (ev: MouseEvent) => any; - onseeked: (ev: Event) => any; - opener: Window; - onclick: (ev: MouseEvent) => any; - innerHeight: number; - onwaiting: (ev: Event) => any; - ononline: (ev: Event) => any; - ondurationchange: (ev: Event) => any; - frames: Window; - onblur: (ev: FocusEvent) => any; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - outerWidth: number; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - innerWidth: number; - onoffline: (ev: Event) => any; - length: number; - screen: Screen; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onratechange: (ev: Event) => any; - onstorage: (ev: StorageEvent) => any; - onloadstart: (ev: Event) => any; - ondragenter: (ev: DragEvent) => any; - onsubmit: (ev: Event) => any; - self: Window; - document: Document; - onprogress: (ev: any) => any; - ondblclick: (ev: MouseEvent) => any; - pageYOffset: number; - oncontextmenu: (ev: MouseEvent) => any; - onchange: (ev: Event) => any; - onloadedmetadata: (ev: Event) => any; - onplay: (ev: Event) => any; - onerror: ErrorEventHandler; - onplaying: (ev: Event) => any; - parent: Window; - location: Location; - oncanplaythrough: (ev: Event) => any; - onabort: (ev: UIEvent) => any; - onreadystatechange: (ev: Event) => any; - outerHeight: number; - onkeypress: (ev: KeyboardEvent) => any; - frameElement: Element; - onloadeddata: (ev: Event) => any; - onsuspend: (ev: Event) => any; - window: Window; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - onselect: (ev: UIEvent) => any; - navigator: Navigator; - styleMedia: StyleMedia; - ondrop: (ev: DragEvent) => any; - onmouseout: (ev: MouseEvent) => any; - onended: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onunload: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - screenY: number; - onmousewheel: (ev: MouseWheelEvent) => any; - onload: (ev: Event) => any; - onvolumechange: (ev: Event) => any; - oninput: (ev: Event) => any; - performance: Performance; - alert(message?: any): void; - scroll(x?: number, y?: number): void; - focus(): void; - scrollTo(x?: number, y?: number): void; - print(): void; - prompt(message?: string, defaul?: string): string; - toString(): string; - open(url?: string, target?: string, features?: string, replace?: boolean): Window; - scrollBy(x?: number, y?: number): void; - confirm(message?: string): boolean; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; - showModalDialog(url?: string, argument?: any, options?: any): any; - blur(): void; - getSelection(): Selection; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -} -declare var Window: { - prototype: Window; - new (): Window; -} - -interface SVGAnimatedPreserveAspectRatio { - animVal: SVGPreserveAspectRatio; - baseVal: SVGPreserveAspectRatio; -} -declare var SVGAnimatedPreserveAspectRatio: { - prototype: SVGAnimatedPreserveAspectRatio; - new (): SVGAnimatedPreserveAspectRatio; -} - -interface MSSiteModeEvent extends Event { - buttonID: number; - actionURL: string; -} -declare var MSSiteModeEvent: { - prototype: MSSiteModeEvent; - new (): MSSiteModeEvent; -} - -interface DOML2DeprecatedTextFlowControl { - clear: string; -} - -interface StyleSheetPageList { - length: number; - item(index: number): CSSPageRule; - [index: number]: CSSPageRule; -} -declare var StyleSheetPageList: { - prototype: StyleSheetPageList; - new (): StyleSheetPageList; -} - -interface MSCSSProperties extends CSSStyleDeclaration { - scrollbarShadowColor: string; - scrollbarHighlightColor: string; - layoutGridChar: string; - layoutGridType: string; - textAutospace: string; - textKashidaSpace: string; - writingMode: string; - scrollbarFaceColor: string; - backgroundPositionY: string; - lineBreak: string; - imeMode: string; - msBlockProgression: string; - layoutGridLine: string; - scrollbarBaseColor: string; - layoutGrid: string; - layoutFlow: string; - textKashida: string; - filter: string; - zoom: string; - scrollbarArrowColor: string; - behavior: string; - backgroundPositionX: string; - accelerator: string; - layoutGridMode: string; - textJustifyTrim: string; - scrollbar3dLightColor: string; - msInterpolationMode: string; - scrollbarTrackColor: string; - scrollbarDarkShadowColor: string; - styleFloat: string; - getAttribute(attributeName: string, flags?: number): any; - setAttribute(attributeName: string, AttributeValue: any, flags?: number): void; - removeAttribute(attributeName: string, flags?: number): boolean; -} -declare var MSCSSProperties: { - prototype: MSCSSProperties; - new (): MSCSSProperties; -} - -interface HTMLCollection extends MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Retrieves an object from various collections. - */ - item(nameOrIndex?: any, optionalIndex?: any): Element; - /** - * Retrieves a select object or an object from an options collection. - */ - namedItem(name: string): Element; - [name: number]: Element; -} -declare var HTMLCollection: { - prototype: HTMLCollection; - new (): HTMLCollection; -} - -interface SVGExternalResourcesRequired { - externalResourcesRequired: SVGAnimatedBoolean; -} - -interface HTMLImageElement extends HTMLElement, MSImageResourceExtensions, MSDataBindingExtensions, MSResourceMetadata { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * The original height of the image resource before sizing. - */ - naturalHeight: number; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * The original width of the image resource before sizing. - */ - naturalWidth: number; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: number; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object. - */ - longDesc: string; - /** - * Contains the hypertext reference (HREF) of the URL. - */ - href: string; - /** - * Sets or retrieves whether the image is a server-side image map. - */ - isMap: boolean; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - create(): HTMLImageElement; -} -declare var HTMLImageElement: { - prototype: HTMLImageElement; - new (): HTMLImageElement; -} - -interface HTMLAreaElement extends HTMLElement { - /** - * Sets or retrieves the protocol portion of a URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Sets or retrieves the host name part of the location or URL. - */ - hostname: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Sets or retrieves the file name or path specified by the object. - */ - pathname: string; - /** - * Sets or retrieves the hostname and port number of the location or URL. - */ - host: string; - /** - * Sets or retrieves the subsection of the href property that follows the number sign (#). - */ - hash: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or gets whether clicks in this region cause action. - */ - noHref: boolean; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAreaElement: { - prototype: HTMLAreaElement; - new (): HTMLAreaElement; -} - -interface EventTarget { - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - dispatchEvent(evt: Event): boolean; -} - -interface SVGAngle { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} -declare var SVGAngle: { - prototype: SVGAngle; - new (): SVGAngle; - SVG_ANGLETYPE_RAD: number; - SVG_ANGLETYPE_UNKNOWN: number; - SVG_ANGLETYPE_UNSPECIFIED: number; - SVG_ANGLETYPE_DEG: number; - SVG_ANGLETYPE_GRAD: number; -} - -interface HTMLButtonElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the default or selected value of the control. - */ - value: string; - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets the classification and default behavior of the button. - */ - type: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; -} -declare var HTMLButtonElement: { - prototype: HTMLButtonElement; - new (): HTMLButtonElement; -} - -interface HTMLSourceElement extends HTMLElement { - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the intended media type of the media source. - */ - media: string; - /** - * Gets or sets the MIME type of a media resource. - */ - type: string; -} -declare var HTMLSourceElement: { - prototype: HTMLSourceElement; - new (): HTMLSourceElement; -} - -interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -declare var CanvasGradient: { - prototype: CanvasGradient; - new (): CanvasGradient; -} - -interface KeyboardEvent extends UIEvent { - location: number; - keyCode: number; - shiftKey: boolean; - which: number; - locale: string; - key: string; - altKey: boolean; - metaKey: boolean; - char: string; - ctrlKey: boolean; - repeat: boolean; - charCode: number; - getModifierState(keyArg: string): boolean; - initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} -declare var KeyboardEvent: { - prototype: KeyboardEvent; - new (): KeyboardEvent; - DOM_KEY_LOCATION_RIGHT: number; - DOM_KEY_LOCATION_STANDARD: number; - DOM_KEY_LOCATION_LEFT: number; - DOM_KEY_LOCATION_NUMPAD: number; - DOM_KEY_LOCATION_JOYSTICK: number; - DOM_KEY_LOCATION_MOBILE: number; -} - -interface Document extends Node, NodeSelector, MSEventAttachmentTarget, DocumentEvent, MSResourceMetadata, MSNodeExtensions { - /** - * Retrieves the collection of user agents and versions declared in the X-UA-Compatible - */ - compatible: MSCompatibleInfoCollection; - /** - * Fires when the user presses a key. - * @param ev The keyboard event - */ - onkeydown: (ev: KeyboardEvent) => any; - /** - * Fires when the user releases a key. - * @param ev The keyboard event - */ - onkeyup: (ev: KeyboardEvent) => any; - - /** - * Gets the implementation object of the current document. - */ - implementation: DOMImplementation; - /** - * Fires when the user resets a form. - * @param ev The event. - */ - onreset: (ev: Event) => any; - - /** - * Retrieves a collection of all script objects in the document. - */ - scripts: HTMLCollection; - - /** - * Fires when the user presses the F1 key while the browser is the active window. - * @param ev The event. - */ - onhelp: (ev: Event) => any; - - /** - * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. - * @param ev The drag event. - */ - ondragleave: (ev: DragEvent) => any; - - /** - * Gets or sets the character set used to encode the object. - */ - charset: string; - - /** - * Fires for an element just prior to setting focus on that element. - * @param ev The focus event - */ - onfocusin: (ev: FocusEvent) => any; - - - /** - * Sets or gets the color of the links that the user has visited. - */ - vlinkColor: string; - - /** - * Occurs when the seek operation ends. - * @param ev The event. - */ - onseeked: (ev: Event) => any; - - security: string; - - /** - * Contains the title of the document. - */ - title: string; - - /** - * Retrieves a collection of namespace objects. - */ - namespaces: MSNamespaceInfoCollection; - - /** - * Gets the default character set from the current regional language settings. - */ - defaultCharset: string; - - /** - * Retrieves a collection of all embed objects in the document. - */ - embeds: HTMLCollection; - - /** - * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. - */ - styleSheets: StyleSheetList; - - /** - * Retrieves a collection of all window objects defined by the given document or defined by the document associated with the given window. - */ - frames: Window; - - /** - * Occurs when the duration attribute is updated. - * @param ev The event. - */ - ondurationchange: (ev: Event) => any; - - - /** - * Returns a reference to the collection of elements contained by the object. - */ - all: HTMLCollection; - - /** - * Retrieves a collection, in source order, of all form objects in the document. - */ - forms: HTMLCollection; - - /** - * Fires when the object loses the input focus. - * @param ev The focus event. - */ - onblur: (ev: FocusEvent) => any; - - - /** - * Sets or retrieves a value that indicates the reading order of the object. - */ - dir: string; - - /** - * Occurs when the media element is reset to its initial state. - * @param ev The event. - */ - onemptied: (ev: Event) => any; - - - /** - * Sets or gets a value that indicates whether the document can be edited. - */ - designMode: string; - - /** - * Occurs when the current playback position is moved. - * @param ev The event. - */ - onseeking: (ev: Event) => any; - - - /** - * Fires when the activeElement is changed from the current object to another object in the parent document. - * @param ev The UI Event - */ - ondeactivate: (ev: UIEvent) => any; - - - /** - * Occurs when playback is possible, but would require further buffering. - * @param ev The event. - */ - oncanplay: (ev: Event) => any; - - - /** - * Fires when the data set exposed by a data source object changes. - * @param ev The event. - */ - ondatasetchanged: (ev: MSEventObj) => any; - - - /** - * Fires when rows are about to be deleted from the recordset. - * @param ev The event - */ - onrowsdelete: (ev: MSEventObj) => any; - - Script: MSScriptHost; - - /** - * Occurs when Internet Explorer begins looking for media data. - * @param ev The event. - */ - onloadstart: (ev: Event) => any; - - - /** - * Gets the URL for the document, stripped of any character encoding. - */ - URLUnencoded: string; - - defaultView: Window; - - /** - * Fires when the user is about to make a control selection of the object. - * @param ev The event. - */ - oncontrolselect: (ev: MSEventObj) => any; - - - /** - * Fires on the target element when the user drags the object to a valid drop target. - * @param ev The drag event. - */ - ondragenter: (ev: DragEvent) => any; - - onsubmit: (ev: Event) => any; - - /** - * Returns the character encoding used to create the webpage that is loaded into the document object. - */ - inputEncoding: string; - - /** - * Gets the object that has the focus when the parent document has focus. - */ - activeElement: Element; - - /** - * Fires when the contents of the object or selection have changed. - * @param ev The event. - */ - onchange: (ev: Event) => any; - - - /** - * Retrieves a collection of all a objects that specify the href property and all area objects in the document. - */ - links: HTMLCollection; - - /** - * Retrieves an autogenerated, unique identifier for the object. - */ - uniqueID: string; - - /** - * Sets or gets the URL for the current document. - */ - URL: string; - - /** - * Fires immediately before the object is set as the active element. - * @param ev The event. - */ - onbeforeactivate: (ev: UIEvent) => any; - - head: HTMLHeadElement; - cookie: string; - xmlEncoding: string; - oncanplaythrough: (ev: Event) => any; - - /** - * Retrieves the document compatibility mode of the document. - */ - documentMode: number; - - characterSet: string; - - /** - * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. - */ - anchors: HTMLCollection; - - onbeforeupdate: (ev: MSEventObj) => any; - - /** - * Fires to indicate that all data is available from the data source object. - * @param ev The event. - */ - ondatasetcomplete: (ev: MSEventObj) => any; - - plugins: HTMLCollection; - - /** - * Occurs if the load operation has been intentionally halted. - * @param ev The event. - */ - onsuspend: (ev: Event) => any; - - - /** - * Gets the root svg element in the document hierarchy. - */ - rootElement: SVGSVGElement; - - /** - * Retrieves a value that indicates the current state of the object. - */ - readyState: string; - - /** - * Gets the URL of the location that referred the user to the current page. - */ - referrer: string; - - /** - * Sets or gets the color of all active links in the document. - */ - alinkColor: string; - - /** - * Fires on a databound object when an error occurs while updating the associated data in the data source object. - * @param ev The event. - */ - onerrorupdate: (ev: MSEventObj) => any; - - - /** - * Gets a reference to the container object of the window. - */ - parentWindow: Window; - - /** - * Fires when the user moves the mouse pointer outside the boundaries of the object. - * @param ev The mouse event. - */ - onmouseout: (ev: MouseEvent) => any; - - - /** - * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode. - * @param ev The event. - */ - onmsthumbnailclick: (ev: MSSiteModeEvent) => any; - - - /** - * Fires when the wheel button is rotated. - * @param ev The mouse event - */ - onmousewheel: (ev: MouseWheelEvent) => any; - - - /** - * Occurs when the volume is changed, or playback is muted or unmuted. - * @param ev The event. - */ - onvolumechange: (ev: Event) => any; - - - /** - * Fires when data changes in the data provider. - * @param ev The event. - */ - oncellchange: (ev: MSEventObj) => any; - - - /** - * Fires just before the data source control changes the current row in the object. - * @param ev The event. - */ - onrowexit: (ev: MSEventObj) => any; - - - /** - * Fires just after new rows are inserted in the current recordset. - * @param ev The event. - */ - onrowsinserted: (ev: MSEventObj) => any; - - - /** - * Gets or sets the version attribute specified in the declaration of an XML document. - */ - xmlVersion: string; - - msCapsLockWarningOff: boolean; - - /** - * Fires when a property changes on the object. - * @param ev The event. - */ - onpropertychange: (ev: MSEventObj) => any; - - - /** - * Fires on the source object when the user releases the mouse at the close of a drag operation. - * @param ev The event. - */ - ondragend: (ev: DragEvent) => any; - - - /** - * Gets an object representing the document type declaration associated with the current document. - */ - doctype: DocumentType; - - /** - * Fires on the target element continuously while the user drags the object over a valid drop target. - * @param ev The event. - */ - ondragover: (ev: DragEvent) => any; - - - /** - * Deprecated. Sets or retrieves a value that indicates the background color behind the object. - */ - bgColor: string; - - /** - * Fires on the source object when the user starts to drag a text selection or selected object. - * @param ev The event. - */ - ondragstart: (ev: DragEvent) => any; - - - /** - * Fires when the user releases a mouse button while the mouse is over the object. - * @param ev The mouse event. - */ - onmouseup: (ev: MouseEvent) => any; - - - /** - * Fires on the source object continuously during a drag operation. - * @param ev The event. - */ - ondrag: (ev: DragEvent) => any; - - - /** - * Fires when the user moves the mouse pointer into the object. - * @param ev The mouse event. - */ - onmouseover: (ev: MouseEvent) => any; - - - /** - * Sets or gets the color of the document links. - */ - linkColor: string; - - /** - * Occurs when playback is paused. - * @param ev The event. - */ - onpause: (ev: Event) => any; - - - /** - * Fires when the user clicks the object with either mouse button. - * @param ev The mouse event. - */ - onmousedown: (ev: MouseEvent) => any; - - - /** - * Fires when the user clicks the left mouse button on the object - * @param ev The mouse event. - */ - onclick: (ev: MouseEvent) => any; - - - /** - * Occurs when playback stops because the next frame of a video resource is not available. - * @param ev The event. - */ - onwaiting: (ev: Event) => any; - - - /** - * Fires when the user clicks the Stop button or leaves the Web page. - * @param ev The event. - */ - onstop: (ev: Event) => any; - - /** - * false (false)[rolls - */ - - /** - * Occurs when an item is removed from a Jump List of a webpage running in Site Mode. - * @param ev The event. - */ - onmssitemodejumplistitemremoved: (ev: MSSiteModeEvent) => any; - - - /** - * Retrieves a collection of all applet objects in the document. - */ - applets: HTMLCollection; - - /** - * Specifies the beginning and end of the document body. - */ - body: HTMLElement; - - /** - * Sets or gets the security domain of the document. - */ - domain: string; - - xmlStandalone: boolean; - - /** - * Represents the active selection, which is a highlighted block of text or other elements in the document that a user or a script can carry out some action on. - */ - selection: MSSelection; - - /** - * Occurs when the download has stopped. - * @param ev The event. - */ - onstalled: (ev: Event) => any; - - - /** - * Fires when the user moves the mouse over the object. - * @param ev The mouse event. - */ - onmousemove: (ev: MouseEvent) => any; - - - /** - * Gets a reference to the root node of the document. - */ - documentElement: HTMLElement; - - /** - * Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. - * @param ev The event. - */ - onbeforeeditfocus: (ev: MSEventObj) => any; - - - /** - * Occurs when the playback rate is increased or decreased. - * @param ev The event. - */ - onratechange: (ev: Event) => any; - - - /** - * Occurs to indicate progress while downloading media data. - * @param ev The event. - */ - onprogress: (ev: any) => any; - - - /** - * Fires when the user double-clicks the object. - * @param ev The mouse event. - */ - ondblclick: (ev: MouseEvent) => any; - - - /** - * Fires when the user clicks the right mouse button in the client area, opening the context menu. - * @param ev The mouse event. - */ - oncontextmenu: (ev: MouseEvent) => any; - - - /** - * Occurs when the duration and dimensions of the media have been determined. - * @param ev The event. - */ - onloadedmetadata: (ev: Event) => any; - - media: string; - - /** - * Fires when an error occurs during object loading. - * @param ev The event. - */ - onerror: (ev: Event) => any; - - - /** - * Occurs when the play method is requested. - * @param ev The event. - */ - onplay: (ev: Event) => any; - - onafterupdate: (ev: MSEventObj) => any; - - /** - * Occurs when the audio or video has started playing. - * @param ev The event. - */ - onplaying: (ev: Event) => any; - - - /** - * Retrieves a collection, in source order, of img objects in the document. - */ - images: HTMLCollection; - - /** - * Contains information about the current URL. - */ - location: Location; - - /** - * Fires when the user aborts the download. - * @param ev The event. - */ - onabort: (ev: UIEvent) => any; - - - /** - * Fires for the current element with focus immediately after moving focus to another element. - * @param ev The event. - */ - onfocusout: (ev: FocusEvent) => any; - - - /** - * Fires when the selection state of a document changes. - * @param ev The event. - */ - onselectionchange: (ev: Event) => any; - - - /** - * Fires when a local DOM Storage area is written to disk. - * @param ev The event. - */ - onstoragecommit: (ev: StorageEvent) => any; - - - /** - * Fires periodically as data arrives from data source objects that asynchronously transmit their data. - * @param ev The event. - */ - ondataavailable: (ev: MSEventObj) => any; - - - /** - * Fires when the state of the object has changed. - * @param ev The event - */ - onreadystatechange: (ev: Event) => any; - - - /** - * Gets the date that the page was last modified, if the page supplies one. - */ - lastModified: string; - - /** - * Fires when the user presses an alphanumeric key. - * @param ev The event. - */ - onkeypress: (ev: KeyboardEvent) => any; - - - /** - * Occurs when media data is loaded at the current playback position. - * @param ev The event. - */ - onloadeddata: (ev: Event) => any; - - - /** - * Fires immediately before the activeElement is changed from the current object to another object in the parent document. - * @param ev The event. - */ - onbeforedeactivate: (ev: UIEvent) => any; - - - /** - * Fires when the object is set as the active element. - * @param ev The event. - */ - onactivate: (ev: UIEvent) => any; - - - onselectstart: (ev: Event) => any; - - /** - * Fires when the object receives focus. - * @param ev The event. - */ - onfocus: (ev: FocusEvent) => any; - - - /** - * Sets or gets the foreground (text) color of the document. - */ - fgColor: string; - - /** - * Occurs to indicate the current playback position. - * @param ev The event. - */ - ontimeupdate: (ev: Event) => any; - - - /** - * Fires when the current selection changes. - * @param ev The event. - */ - onselect: (ev: UIEvent) => any; - - ondrop: (ev: DragEvent) => any; - - /** - * Occurs when the end of playback is reached. - * @param ev The event - */ - onended: (ev: Event) => any; - - - /** - * Gets a value that indicates whether standards-compliant mode is switched on for the object. - */ - compatMode: string; - - /** - * Fires when the user repositions the scroll box in the scroll bar on the object. - * @param ev The event. - */ - onscroll: (ev: UIEvent) => any; - - - /** - * Fires to indicate that the current row has changed in the data source and new data values are available on the object. - * @param ev The event. - */ - onrowenter: (ev: MSEventObj) => any; - - - /** - * Fires immediately after the browser loads the object. - * @param ev The event. - */ - onload: (ev: Event) => any; - - oninput: (ev: Event) => any; - - /** - * Returns the current value of the document, range, or current selection for the given command. - * @param commandId String that specifies a command identifier. - */ - queryCommandValue(commandId: string): string; - - adoptNode(source: Node): Node; - - /** - * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. - * @param commandId String that specifies a command identifier. - */ - queryCommandIndeterm(commandId: string): boolean; - - getElementsByTagNameNS(namespaceURI: string, localName: string): NodeList; - createProcessingInstruction(target: string, data: string): ProcessingInstruction; - - /** - * Executes a command on the current document, current selection, or the given range. - * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. - * @param showUI Display the user interface, defaults to false. - * @param value Value to assign. - */ - execCommand(commandId: string, showUI?: boolean, value?: any): boolean; - - /** - * Returns the element for the specified x coordinate and the specified y coordinate. - * @param x The x-offset - * @param y The y-offset - */ - elementFromPoint(x: number, y: number): Element; - createCDATASection(data: string): CDATASection; - - /** - * Retrieves the string associated with a command. - * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers. - */ - queryCommandText(commandId: string): string; - - /** - * Writes one or more HTML expressions to a document in the specified window. - * @param content Specifies the text and HTML tags to write. - */ - write(...content: string[]): void; - - /** - * Allows updating the print settings for the page. - */ - updateSettings(): void; - - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "a"): HTMLAnchorElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "abbr"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "address"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "area"): HTMLAreaElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "article"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "aside"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "audio"): HTMLAudioElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "b"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "base"): HTMLBaseElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "bdi"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "bdo"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "blockquote"): HTMLQuoteElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "body"): HTMLBodyElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "br"): HTMLBRElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "button"): HTMLButtonElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "canvas"): HTMLCanvasElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "caption"): HTMLTableCaptionElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "cite"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "code"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "col"): HTMLTableColElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "colgroup"): HTMLTableColElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "datalist"): HTMLDataListElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "dd"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "del"): HTMLModElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "dfn"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "div"): HTMLDivElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "dl"): HTMLDListElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "dt"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "em"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "embed"): HTMLEmbedElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "fieldset"): HTMLFieldSetElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "figcaption"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "figure"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "footer"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "form"): HTMLFormElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h1"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h2"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h3"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h4"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h5"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "h6"): HTMLHeadingElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "head"): HTMLHeadElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "header"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "hgroup"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "hr"): HTMLHRElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "html"): HTMLHtmlElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "i"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "iframe"): HTMLIFrameElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "img"): HTMLImageElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "input"): HTMLInputElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "ins"): HTMLModElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "kbd"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "label"): HTMLLabelElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "legend"): HTMLLegendElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "li"): HTMLLIElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "link"): HTMLLinkElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "main"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "map"): HTMLMapElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "mark"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "menu"): HTMLMenuElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "meta"): HTMLMetaElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "nav"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "noscript"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "object"): HTMLObjectElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "ol"): HTMLOListElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "optgroup"): HTMLOptGroupElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "option"): HTMLOptionElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "p"): HTMLParagraphElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "param"): HTMLParamElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "pre"): HTMLPreElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "progress"): HTMLProgressElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "q"): HTMLQuoteElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "rp"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "rt"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "ruby"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "s"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "samp"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "script"): HTMLScriptElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "section"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "select"): HTMLSelectElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "small"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "source"): HTMLSourceElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "span"): HTMLSpanElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "strong"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "style"): HTMLStyleElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "sub"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "summary"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "sup"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "table"): HTMLTableElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "tbody"): HTMLTableSectionElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "td"): HTMLTableDataCellElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "textarea"): HTMLTextAreaElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "tfoot"): HTMLTableSectionElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "th"): HTMLTableHeaderCellElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "thead"): HTMLTableSectionElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "title"): HTMLTitleElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "tr"): HTMLTableRowElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "track"): HTMLTrackElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "u"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "ul"): HTMLUListElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "var"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "video"): HTMLVideoElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: "wbr"): HTMLElement; - /** - * Creates an instance of the element for the specified tag. - * @param tagName The name of an element. - */ - createElement(tagName: string): HTMLElement; - - /** - * Removes mouse capture from the object in the current document. - */ - releaseCapture(): void; - - /** - * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. - * @param content The text and HTML tags to write. - */ - writeln(...content: string[]): void; - createElementNS(namespaceURI: string, qualifiedName: string): Element; - - /** - * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. - * @param url Specifies a MIME type for the document. - * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. - * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. - * @param replace Specifies whether the existing entry for the document is replaced in the history list. - */ - open(url?: string, name?: string, features?: string, replace?: boolean): any; - - /** - * Returns a Boolean value that indicates whether the current command is supported on the current range. - * @param commandId Specifies a command identifier. - */ - queryCommandSupported(commandId: string): boolean; - - /** - * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. - * @param filter A custom NodeFilter function to use. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createTreeWalker(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): TreeWalker; - createAttributeNS(namespaceURI: string, qualifiedName: string): Attr; - - /** - * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. - * @param commandId Specifies a command identifier. - */ - queryCommandEnabled(commandId: string): boolean; - - /** - * Causes the element to receive the focus and executes the code specified by the onfocus event. - */ - focus(): void; - - /** - * Closes an output stream and forces the sent data to display. - */ - close(): void; - - getElementsByClassName(classNames: string): NodeList; - importNode(importedNode: Node, deep: boolean): Node; - - /** - * Returns an empty range object that has both of its boundary points positioned at the beginning of the document. - */ - createRange(): Range; - - /** - * Fires a specified event on the object. - * @param eventName Specifies the name of the event to fire. - * @param eventObj Object that specifies the event object from which to obtain event object properties. - */ - fireEvent(eventName: string, eventObj?: any): boolean; - - /** - * Creates a comment object with the specified data. - * @param data Sets the comment object's data. - */ - createComment(data: string): Comment; - - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "a"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "abbr"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "address"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "area"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "article"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "aside"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "audio"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "b"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "base"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "bdi"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "bdo"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "blockquote"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "body"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "br"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "button"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "canvas"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "caption"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "cite"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "code"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "col"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "colgroup"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "datalist"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "dd"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "del"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "dfn"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "div"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "dl"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "dt"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "em"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "embed"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "fieldset"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "figcaption"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "figure"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "footer"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "form"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h1"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h2"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h3"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h4"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h5"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "h6"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "head"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "header"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "hgroup"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "hr"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "html"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "i"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "iframe"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "img"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "input"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "ins"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "kbd"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "label"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "legend"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "li"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "link"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "main"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "map"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "mark"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "menu"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "meta"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "nav"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "noscript"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "object"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "ol"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "optgroup"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "option"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "p"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "param"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "pre"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "progress"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "q"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "rp"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "rt"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "ruby"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "s"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "samp"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "script"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "section"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "select"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "small"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "source"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "span"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "strong"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "style"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "sub"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "summary"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "sup"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "table"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "tbody"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "td"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "textarea"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "tfoot"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "th"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "thead"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "title"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "tr"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "track"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "u"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "ul"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "var"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "video"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: "wbr"): NodeListOf; - /** - * Retrieves a collection of objects based on the specified element name. - * @param name Specifies the name of an element. - */ - getElementsByTagName(name: string): NodeList; - - /** - * Creates a new document. - */ - createDocumentFragment(): DocumentFragment; - - /** - * Creates a style sheet for the document. - * @param href Specifies how to add the style sheet to the document. If a file name is specified for the URL, the style information is added as a link object. If the URL contains style information, it is added to the style object. - * @param index Specifies the index that indicates where the new style sheet is inserted in the styleSheets collection. The default is to insert the new style sheet at the end of the collection. - */ - createStyleSheet(href?: string, index?: number): CSSStyleSheet; - - /** - * Gets a collection of objects based on the value of the NAME or ID attribute. - * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. - */ - getElementsByName(elementName: string): NodeList; - - /** - * Returns a Boolean value that indicates the current state of the command. - * @param commandId String that specifies a command identifier. - */ - queryCommandState(commandId: string): boolean; - - /** - * Gets a value indicating whether the object currently has focus. - */ - hasFocus(): boolean; - - /** - * Displays help information for the given command identifier. - * @param commandId Displays help information for the given command identifier. - */ - execCommandShowHelp(commandId: string): boolean; - - /** - * Creates an attribute object with a specified name. - * @param name String that sets the attribute object's name. - */ - createAttribute(name: string): Attr; - - /** - * Creates a text string from the specified value. - * @param data String that specifies the nodeValue property of the text node. - */ - createTextNode(data: string): Text; - - /** - * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. - * @param root The root element or node to start traversing on. - * @param whatToShow The type of nodes or elements to appear in the node list - * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. - * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded. - */ - createNodeIterator(root: Node, whatToShow: number, filter: NodeFilter, entityReferenceExpansion: boolean): NodeIterator; - - /** - * Generates an event object to pass event context information when you use the fireEvent method. - * @param eventObj An object that specifies an existing event object on which to base the new object. - */ - createEventObject(eventObj?: any): MSEventObj; - - /** - * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. - */ - getSelection(): Selection; - - /** - * Returns a reference to the first object with the specified value of the ID or NAME attribute. - * @param elementId String that specifies the ID value. Case-insensitive. - */ - getElementById(elementId: string): HTMLElement; -} - -declare var Document: { - prototype: Document; - new (): Document; -} - -interface MessageEvent extends Event { - source: Window; - origin: string; - data: any; - initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void; -} -declare var MessageEvent: { - prototype: MessageEvent; - new (): MessageEvent; -} - -interface SVGElement extends Element { - onmouseover: (ev: MouseEvent) => any; - viewportElement: SVGElement; - onmousemove: (ev: MouseEvent) => any; - onmouseout: (ev: MouseEvent) => any; - ondblclick: (ev: MouseEvent) => any; - onfocusout: (ev: FocusEvent) => any; - onfocusin: (ev: FocusEvent) => any; - xmlbase: string; - onmousedown: (ev: MouseEvent) => any; - onload: (ev: Event) => any; - onmouseup: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - ownerSVGElement: SVGSVGElement; - id: string; -} -declare var SVGElement: { - prototype: SVGElement; - new (): SVGElement; -} - -interface HTMLScriptElement extends HTMLElement { - /** - * Sets or retrieves the status of the script. - */ - defer: boolean; - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; - /** - * Retrieves the URL to an external file that contains the source code or data. - */ - src: string; - /** - * Sets or retrieves the object that is bound to the event script. - */ - htmlFor: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the MIME type for the associated scripting engine. - */ - type: string; - /** - * Sets or retrieves the event for which the script is written. - */ - event: string; -} -declare var HTMLScriptElement: { - prototype: HTMLScriptElement; - new (): HTMLScriptElement; -} - -interface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Retrieves the position of the object in the rows collection for the table. - */ - rowIndex: number; - /** - * Retrieves a collection of all cells in the table row. - */ - cells: HTMLCollection; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Retrieves the position of the object in the collection. - */ - sectionRowIndex: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; - /** - * Removes the specified cell from the table row, as well as from the cells collection. - * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted. - */ - deleteCell(index?: number): void; - /** - * Creates a new cell in the table row, and adds the cell to the cells collection. - * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection. - */ - insertCell(index?: number): HTMLElement; -} -declare var HTMLTableRowElement: { - prototype: HTMLTableRowElement; - new (): HTMLTableRowElement; -} - -interface CanvasRenderingContext2D { - miterLimit: number; - font: string; - globalCompositeOperation: string; - msFillRule: string; - lineCap: string; - msImageSmoothingEnabled: boolean; - lineDashOffset: number; - shadowColor: string; - lineJoin: string; - shadowOffsetX: number; - lineWidth: number; - canvas: HTMLCanvasElement; - strokeStyle: any; - globalAlpha: number; - shadowOffsetY: number; - fillStyle: any; - shadowBlur: number; - textAlign: string; - textBaseline: string; - restore(): void; - setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - save(): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - measureText(text: string): TextMetrics; - isPointInPath(x: number, y: number, fillRule?: string): boolean; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void; - rotate(angle: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - translate(x: number, y: number): void; - scale(x: number, y: number): void; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - lineTo(x: number, y: number): void; - getLineDash(): Array; - fill(fillRule?: string): void; - createImageData(imageDataOrSw: any, sh?: number): ImageData; - createPattern(image: HTMLElement, repetition: string): CanvasPattern; - closePath(): void; - rect(x: number, y: number, w: number, h: number): void; - clip(fillRule?: string): void; - clearRect(x: number, y: number, w: number, h: number): void; - moveTo(x: number, y: number): void; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - fillRect(x: number, y: number, w: number, h: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - drawImage(image: HTMLElement, offsetX: number, offsetY: number, width?: number, height?: number, canvasOffsetX?: number, canvasOffsetY?: number, canvasImageWidth?: number, canvasImageHeight?: number): void; - transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void; - stroke(): void; - strokeRect(x: number, y: number, w: number, h: number): void; - setLineDash(segments: Array): void; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - beginPath(): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; -} -declare var CanvasRenderingContext2D: { - prototype: CanvasRenderingContext2D; - new (): CanvasRenderingContext2D; -} - -interface MSCSSRuleList { - length: number; - item(index?: number): CSSStyleRule; - [index: number]: CSSStyleRule; -} -declare var MSCSSRuleList: { - prototype: MSCSSRuleList; - new (): MSCSSRuleList; -} - -interface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalAbs: { - prototype: SVGPathSegLinetoHorizontalAbs; - new (): SVGPathSegLinetoHorizontalAbs; -} - -interface SVGPathSegArcAbs extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcAbs: { - prototype: SVGPathSegArcAbs; - new (): SVGPathSegArcAbs; -} - -interface SVGTransformList { - numberOfItems: number; - getItem(index: number): SVGTransform; - consolidate(): SVGTransform; - clear(): void; - appendItem(newItem: SVGTransform): SVGTransform; - initialize(newItem: SVGTransform): SVGTransform; - removeItem(index: number): SVGTransform; - insertItemBefore(newItem: SVGTransform, index: number): SVGTransform; - replaceItem(newItem: SVGTransform, index: number): SVGTransform; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; -} -declare var SVGTransformList: { - prototype: SVGTransformList; - new (): SVGTransformList; -} - -interface HTMLHtmlElement extends HTMLElement { - /** - * Sets or retrieves the DTD version that governs the current document. - */ - version: string; -} -declare var HTMLHtmlElement: { - prototype: HTMLHtmlElement; - new (): HTMLHtmlElement; -} - -interface SVGPathSegClosePath extends SVGPathSeg { -} -declare var SVGPathSegClosePath: { - prototype: SVGPathSegClosePath; - new (): SVGPathSegClosePath; -} - -interface HTMLFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; -} -declare var HTMLFrameElement: { - prototype: HTMLFrameElement; - new (): HTMLFrameElement; -} - -interface SVGAnimatedLength { - animVal: SVGLength; - baseVal: SVGLength; -} -declare var SVGAnimatedLength: { - prototype: SVGAnimatedLength; - new (): SVGAnimatedLength; -} - -interface SVGAnimatedPoints { - points: SVGPointList; - animatedPoints: SVGPointList; -} - -interface SVGDefsElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGDefsElement: { - prototype: SVGDefsElement; - new (): SVGDefsElement; -} - -interface HTMLQuoteElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLQuoteElement: { - prototype: HTMLQuoteElement; - new (): HTMLQuoteElement; -} - -interface CSSMediaRule extends CSSRule { - media: MediaList; - cssRules: CSSRuleList; - insertRule(rule: string, index?: number): number; - deleteRule(index?: number): void; -} -declare var CSSMediaRule: { - prototype: CSSMediaRule; - new (): CSSMediaRule; -} - -interface WindowModal { - dialogArguments: any; - returnValue: any; -} - -interface XMLHttpRequest extends EventTarget { - responseBody: any; - status: number; - readyState: number; - responseText: string; - responseXML: Document; - ontimeout: (ev: Event) => any; - statusText: string; - onreadystatechange: (ev: Event) => any; - timeout: number; - onload: (ev: Event) => any; - open(method: string, url: string, async?: boolean, user?: string, password?: string): void; - create(): XMLHttpRequest; - send(data?: any): void; - abort(): void; - getAllResponseHeaders(): string; - setRequestHeader(header: string, value: string): void; - getResponseHeader(header: string): string; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; -} -declare var XMLHttpRequest: { - prototype: XMLHttpRequest; - new (): XMLHttpRequest; - LOADING: number; - DONE: number; - UNSENT: number; - OPENED: number; - HEADERS_RECEIVED: number; -} - -interface HTMLTableHeaderCellElement extends HTMLTableCellElement { - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; -} -declare var HTMLTableHeaderCellElement: { - prototype: HTMLTableHeaderCellElement; - new (): HTMLTableHeaderCellElement; -} - -interface HTMLDListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction { -} -declare var HTMLDListElement: { - prototype: HTMLDListElement; - new (): HTMLDListElement; -} - -interface MSDataBindingExtensions { - dataSrc: string; - dataFormatAs: string; - dataFld: string; -} - -interface SVGPathSegLinetoHorizontalRel extends SVGPathSeg { - x: number; -} -declare var SVGPathSegLinetoHorizontalRel: { - prototype: SVGPathSegLinetoHorizontalRel; - new (): SVGPathSegLinetoHorizontalRel; -} - -interface SVGEllipseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - ry: SVGAnimatedLength; - cx: SVGAnimatedLength; - rx: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGEllipseElement: { - prototype: SVGEllipseElement; - new (): SVGEllipseElement; -} - -interface SVGAElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - target: SVGAnimatedString; -} -declare var SVGAElement: { - prototype: SVGAElement; - new (): SVGAElement; -} - -interface SVGStylable { - className: SVGAnimatedString; - style: CSSStyleDeclaration; -} - -interface SVGTransformable extends SVGLocatable { - transform: SVGAnimatedTransformList; -} - -interface HTMLFrameSetElement extends HTMLElement { - ononline: (ev: Event) => any; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves the frame heights of the object. - */ - rows: string; - /** - * Sets or retrieves the frame widths of the object. - */ - cols: string; - /** - * Fires when the object loses the input focus. - */ - onblur: (ev: FocusEvent) => any; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Fires when the object receives focus. - */ - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - onerror: (ev: Event) => any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - onresize: (ev: UIEvent) => any; - name: string; - onafterprint: (ev: Event) => any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - border: string; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - onstorage: (ev: StorageEvent) => any; -} -declare var HTMLFrameSetElement: { - prototype: HTMLFrameSetElement; - new (): HTMLFrameSetElement; -} - -interface Screen { - width: number; - deviceXDPI: number; - fontSmoothingEnabled: boolean; - bufferDepth: number; - logicalXDPI: number; - systemXDPI: number; - availHeight: number; - height: number; - logicalYDPI: number; - systemYDPI: number; - updateInterval: number; - colorDepth: number; - availWidth: number; - deviceYDPI: number; - pixelDepth: number; -} -declare var Screen: { - prototype: Screen; - new (): Screen; -} - -interface Coordinates { - altitudeAccuracy: number; - longitude: number; - latitude: number; - speed: number; - heading: number; - altitude: number; - accuracy: number; -} -declare var Coordinates: { - prototype: Coordinates; - new (): Coordinates; -} - -interface NavigatorGeolocation { - geolocation: Geolocation; -} - -interface NavigatorContentUtils { -} - -interface EventListener { - (evt: Event): void; -} - -interface SVGLangSpace { - xmllang: string; - xmlspace: string; -} - -interface DataTransfer { - effectAllowed: string; - dropEffect: string; - clearData(format?: string): boolean; - setData(format: string, data: string): boolean; - getData(format: string): string; -} -declare var DataTransfer: { - prototype: DataTransfer; - new (): DataTransfer; -} - -interface FocusEvent extends UIEvent { - relatedTarget: EventTarget; - initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void; -} -declare var FocusEvent: { - prototype: FocusEvent; - new (): FocusEvent; -} - -interface Range { - startOffset: number; - collapsed: boolean; - endOffset: number; - startContainer: Node; - endContainer: Node; - commonAncestorContainer: Node; - setStart(refNode: Node, offset: number): void; - setEndBefore(refNode: Node): void; - setStartBefore(refNode: Node): void; - selectNode(refNode: Node): void; - detach(): void; - getBoundingClientRect(): ClientRect; - toString(): string; - compareBoundaryPoints(how: number, sourceRange: Range): number; - insertNode(newNode: Node): void; - collapse(toStart: boolean): void; - selectNodeContents(refNode: Node): void; - cloneContents(): DocumentFragment; - setEnd(refNode: Node, offset: number): void; - cloneRange(): Range; - getClientRects(): ClientRectList; - surroundContents(newParent: Node): void; - deleteContents(): void; - setStartAfter(refNode: Node): void; - extractContents(): DocumentFragment; - setEndAfter(refNode: Node): void; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} -declare var Range: { - prototype: Range; - new (): Range; - END_TO_END: number; - START_TO_START: number; - START_TO_END: number; - END_TO_START: number; -} - -interface SVGPoint { - y: number; - x: number; - matrixTransform(matrix: SVGMatrix): SVGPoint; -} -declare var SVGPoint: { - prototype: SVGPoint; - new (): SVGPoint; -} - -interface MSPluginsCollection { - length: number; - refresh(reload?: boolean): void; -} -declare var MSPluginsCollection: { - prototype: MSPluginsCollection; - new (): MSPluginsCollection; -} - -interface SVGAnimatedNumberList { - animVal: SVGNumberList; - baseVal: SVGNumberList; -} -declare var SVGAnimatedNumberList: { - prototype: SVGAnimatedNumberList; - new (): SVGAnimatedNumberList; -} - -interface SVGSVGElement extends SVGElement, SVGStylable, SVGZoomAndPan, DocumentEvent, SVGLangSpace, SVGLocatable, SVGTests, SVGFitToViewBox, SVGExternalResourcesRequired { - width: SVGAnimatedLength; - x: SVGAnimatedLength; - contentStyleType: string; - onzoom: (ev: any) => any; - y: SVGAnimatedLength; - viewport: SVGRect; - onerror: (ev: Event) => any; - pixelUnitToMillimeterY: number; - onresize: (ev: UIEvent) => any; - screenPixelToMillimeterY: number; - height: SVGAnimatedLength; - onabort: (ev: UIEvent) => any; - contentScriptType: string; - pixelUnitToMillimeterX: number; - currentTranslate: SVGPoint; - onunload: (ev: Event) => any; - currentScale: number; - onscroll: (ev: UIEvent) => any; - screenPixelToMillimeterX: number; - setCurrentTime(seconds: number): void; - createSVGLength(): SVGLength; - getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeList; - unpauseAnimations(): void; - createSVGRect(): SVGRect; - checkIntersection(element: SVGElement, rect: SVGRect): boolean; - unsuspendRedrawAll(): void; - pauseAnimations(): void; - suspendRedraw(maxWaitMilliseconds: number): number; - deselectAll(): void; - createSVGAngle(): SVGAngle; - getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeList; - createSVGTransform(): SVGTransform; - unsuspendRedraw(suspendHandleID: number): void; - forceRedraw(): void; - getCurrentTime(): number; - checkEnclosure(element: SVGElement, rect: SVGRect): boolean; - createSVGMatrix(): SVGMatrix; - createSVGPoint(): SVGPoint; - createSVGNumber(): SVGNumber; - createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform; - getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; - getElementById(elementId: string): Element; -} -declare var SVGSVGElement: { - prototype: SVGSVGElement; - new (): SVGSVGElement; -} - -interface HTMLLabelElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the object to which the given label object is assigned. - */ - htmlFor: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLabelElement: { - prototype: HTMLLabelElement; - new (): HTMLLabelElement; -} - -interface MSResourceMetadata { - protocol: string; - fileSize: string; - fileUpdatedDate: string; - nameProp: string; - fileCreatedDate: string; - fileModifiedDate: string; - mimeType: string; -} - -interface HTMLLegendElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLLegendElement: { - prototype: HTMLLegendElement; - new (): HTMLLegendElement; -} - -interface HTMLDirectoryElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLDirectoryElement: { - prototype: HTMLDirectoryElement; - new (): HTMLDirectoryElement; -} - -interface SVGAnimatedInteger { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedInteger: { - prototype: SVGAnimatedInteger; - new (): SVGAnimatedInteger; -} - -interface SVGTextElement extends SVGTextPositioningElement, SVGTransformable { -} -declare var SVGTextElement: { - prototype: SVGTextElement; - new (): SVGTextElement; -} - -interface SVGTSpanElement extends SVGTextPositioningElement { -} -declare var SVGTSpanElement: { - prototype: SVGTSpanElement; - new (): SVGTSpanElement; -} - -interface HTMLLIElement extends HTMLElement, DOML2DeprecatedListNumberingAndBulletStyle { - /** - * Sets or retrieves the value of a list item. - */ - value: number; -} -declare var HTMLLIElement: { - prototype: HTMLLIElement; - new (): HTMLLIElement; -} - -interface SVGPathSegLinetoVerticalAbs extends SVGPathSeg { - y: number; -} -declare var SVGPathSegLinetoVerticalAbs: { - prototype: SVGPathSegLinetoVerticalAbs; - new (): SVGPathSegLinetoVerticalAbs; -} - -interface MSStorageExtensions { - remainingSpace: number; -} - -interface SVGStyleElement extends SVGElement, SVGLangSpace { - media: string; - type: string; - title: string; -} -declare var SVGStyleElement: { - prototype: SVGStyleElement; - new (): SVGStyleElement; -} - -interface MSCurrentStyleCSSProperties extends MSCSSProperties { - blockDirection: string; - clipBottom: string; - clipLeft: string; - clipRight: string; - clipTop: string; - hasLayout: string; -} -declare var MSCurrentStyleCSSProperties: { - prototype: MSCurrentStyleCSSProperties; - new (): MSCurrentStyleCSSProperties; -} - -interface MSHTMLCollectionExtensions { - urns(urn: any): Object; - tags(tagName: any): Object; -} - -interface Storage extends MSStorageExtensions { - length: number; - getItem(key: string): any; - [key: string]: any; - setItem(key: string, data: string): void; - clear(): void; - removeItem(key: string): void; - key(index: number): string; - [index: number]: any; -} -declare var Storage: { - prototype: Storage; - new (): Storage; -} - -interface HTMLIFrameElement extends HTMLElement, GetSVGDocument, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves whether the frame can be scrolled. - */ - scrolling: string; - /** - * Sets or retrieves the top and bottom margin heights before displaying the text in a frame. - */ - marginHeight: string; - /** - * Sets or retrieves the left and right margin widths before displaying the text in a frame. - */ - marginWidth: string; - /** - * Sets or retrieves the amount of additional space between the frames. - */ - frameSpacing: any; - /** - * Sets or retrieves whether to display a border for the frame. - */ - frameBorder: string; - /** - * Sets or retrieves whether the user can resize the frame. - */ - noResize: boolean; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Retrieves the object of the specified. - */ - contentWindow: Window; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the frame name. - */ - name: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Specifies the properties of a border drawn around an object. - */ - border: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Sets or retrieves the horizontal margin for the object. - */ - hspace: number; - /** - * Sets or retrieves a URI to a long description of the object. - */ - longDesc: string; - /** - * Sets the value indicating whether the source file of a frame or iframe has specific security restrictions applied. - */ - security: any; - /** - * Raised when the object has been completely received from the server. - */ - onload: (ev: Event) => any; -} -declare var HTMLIFrameElement: { - prototype: HTMLIFrameElement; - new (): HTMLIFrameElement; -} - -interface TextRangeCollection { - length: number; - item(index: number): TextRange; - [index: number]: TextRange; -} -declare var TextRangeCollection: { - prototype: TextRangeCollection; - new (): TextRangeCollection; -} - -interface HTMLBodyElement extends HTMLElement, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - scroll: string; - ononline: (ev: Event) => any; - onblur: (ev: FocusEvent) => any; - noWrap: boolean; - onfocus: (ev: FocusEvent) => any; - onmessage: (ev: MessageEvent) => any; - text: any; - onerror: (ev: Event) => any; - bgProperties: string; - onresize: (ev: UIEvent) => any; - link: any; - aLink: any; - bottomMargin: any; - topMargin: any; - onafterprint: (ev: Event) => any; - vLink: any; - onbeforeprint: (ev: Event) => any; - onoffline: (ev: Event) => any; - onunload: (ev: Event) => any; - onhashchange: (ev: Event) => any; - onload: (ev: Event) => any; - rightMargin: any; - onbeforeunload: (ev: BeforeUnloadEvent) => any; - leftMargin: any; - onstorage: (ev: StorageEvent) => any; - createTextRange(): TextRange; -} -declare var HTMLBodyElement: { - prototype: HTMLBodyElement; - new (): HTMLBodyElement; -} - -interface DocumentType extends Node { - name: string; - notations: NamedNodeMap; - systemId: string; - internalSubset: string; - entities: NamedNodeMap; - publicId: string; -} -declare var DocumentType: { - prototype: DocumentType; - new (): DocumentType; -} - -interface SVGRadialGradientElement extends SVGGradientElement { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; - fx: SVGAnimatedLength; - fy: SVGAnimatedLength; -} -declare var SVGRadialGradientElement: { - prototype: SVGRadialGradientElement; - new (): SVGRadialGradientElement; -} - -interface MutationEvent extends Event { - newValue: string; - attrChange: number; - attrName: string; - prevValue: string; - relatedNode: Node; - initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} -declare var MutationEvent: { - prototype: MutationEvent; - new (): MutationEvent; - MODIFICATION: number; - REMOVAL: number; - ADDITION: number; -} - -interface DragEvent extends MouseEvent { - dataTransfer: DataTransfer; - initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void; -} -declare var DragEvent: { - prototype: DragEvent; - new (): DragEvent; -} - -interface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: HTMLCollection; - /** - * Removes the specified row (tr) from the element and from the rows collection. - * @param index Number that specifies the zero-based position in the rows collection of the row to remove. - */ - deleteRow(index?: number): void; - /** - * Moves a table row to a new position. - * @param indexFrom Number that specifies the index in the rows collection of the table row that is moved. - * @param indexTo Number that specifies where the row is moved within the rows collection. - */ - moveRow(indexFrom?: number, indexTo?: number): Object; - /** - * Creates a new row (tr) in the table, and adds the row to the rows collection. - * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection. - */ - insertRow(index?: number): HTMLElement; -} -declare var HTMLTableSectionElement: { - prototype: HTMLTableSectionElement; - new (): HTMLTableSectionElement; -} - -interface DOML2DeprecatedListNumberingAndBulletStyle { - type: string; -} - -interface HTMLInputElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - status: boolean; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - indeterminate: boolean; - readOnly: boolean; - size: number; - loop: number; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Sets or retrieves the URL of the virtual reality modeling language (VRML) world to be displayed in the window. - */ - vrml: string; - /** - * Sets or retrieves a lower resolution image to display. - */ - lowsrc: string; - /** - * Sets or retrieves the vertical margin for the object. - */ - vspace: number; - /** - * Sets or retrieves a comma-separated list of content types. - */ - accept: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - defaultChecked: boolean; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Returns the value of the data at the cursor's current position. - */ - value: string; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - border: string; - dynsrc: string; - /** - * Sets or retrieves the state of the check box or radio button. - */ - checked: boolean; - /** - * Sets or retrieves the width of the border to draw around the object. - */ - hspace: number; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns the content type of the object. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Retrieves whether the object is fully loaded. - */ - complete: boolean; - start: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Makes the selection equal to the current object. - */ - select(): void; -} -declare var HTMLInputElement: { - prototype: HTMLInputElement; - new (): HTMLInputElement; -} - -interface HTMLAnchorElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rel: string; - /** - * Contains the protocol of the URL. - */ - protocol: string; - /** - * Sets or retrieves the substring of the href property that follows the question mark. - */ - search: string; - /** - * Sets or retrieves the coordinates of the object. - */ - coords: string; - /** - * Contains the hostname of a URL. - */ - hostname: string; - /** - * Contains the pathname of the URL. - */ - pathname: string; - Methods: string; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - protocolLong: string; - /** - * Sets or retrieves a destination URL or an anchor point. - */ - href: string; - /** - * Sets or retrieves the shape of the object. - */ - name: string; - /** - * Sets or retrieves the character set used to encode the object. - */ - charset: string; - /** - * Sets or retrieves the language code of the object. - */ - hreflang: string; - /** - * Sets or retrieves the port number associated with a URL. - */ - port: string; - /** - * Contains the hostname and port values of the URL. - */ - host: string; - /** - * Contains the anchor portion of the URL including the hash sign (#). - */ - hash: string; - nameProp: string; - urn: string; - /** - * Sets or retrieves the relationship between the object and the destination of the link. - */ - rev: string; - /** - * Sets or retrieves the shape of the object. - */ - shape: string; - type: string; - mimeType: string; - /** - * Returns a string representation of an object. - */ - toString(): string; -} -declare var HTMLAnchorElement: { - prototype: HTMLAnchorElement; - new (): HTMLAnchorElement; -} - -interface HTMLParamElement extends HTMLElement { - /** - * Sets or retrieves the value of an input parameter for an element. - */ - value: string; - /** - * Sets or retrieves the name of an input parameter for an element. - */ - name: string; - /** - * Sets or retrieves the content type of the resource designated by the value attribute. - */ - type: string; - /** - * Sets or retrieves the data type of the value attribute. - */ - valueType: string; -} -declare var HTMLParamElement: { - prototype: HTMLParamElement; - new (): HTMLParamElement; -} - -interface SVGImageElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGImageElement: { - prototype: SVGImageElement; - new (): SVGImageElement; -} - -interface SVGAnimatedNumber { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedNumber: { - prototype: SVGAnimatedNumber; - new (): SVGAnimatedNumber; -} - -interface PerformanceTiming { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - msFirstPaint: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - toJSON(): any; -} -declare var PerformanceTiming: { - prototype: PerformanceTiming; - new (): PerformanceTiming; -} - -interface HTMLPreElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or gets a value that you can use to implement your own width functionality for the object. - */ - width: number; - /** - * Indicates a citation by rendering text in italic type. - */ - cite: string; -} -declare var HTMLPreElement: { - prototype: HTMLPreElement; - new (): HTMLPreElement; -} - -interface EventException { - code: number; - message: string; - toString(): string; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} -declare var EventException: { - prototype: EventException; - new (): EventException; - DISPATCH_REQUEST_ERR: number; - UNSPECIFIED_EVENT_TYPE_ERR: number; -} - -interface MSNavigatorDoNotTrack { - msDoNotTrack: string; -} - -interface NavigatorOnLine { - onLine: boolean; -} - -interface WindowLocalStorage { - localStorage: Storage; -} - -interface SVGMetadataElement extends SVGElement { -} -declare var SVGMetadataElement: { - prototype: SVGMetadataElement; - new (): SVGMetadataElement; -} - -interface SVGPathSegArcRel extends SVGPathSeg { - y: number; - sweepFlag: boolean; - r2: number; - x: number; - angle: number; - r1: number; - largeArcFlag: boolean; -} -declare var SVGPathSegArcRel: { - prototype: SVGPathSegArcRel; - new (): SVGPathSegArcRel; -} - -interface SVGPathSegMovetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegMovetoAbs: { - prototype: SVGPathSegMovetoAbs; - new (): SVGPathSegMovetoAbs; -} - -interface SVGStringList { - numberOfItems: number; - replaceItem(newItem: string, index: number): string; - getItem(index: number): string; - clear(): void; - appendItem(newItem: string): string; - initialize(newItem: string): string; - removeItem(index: number): string; - insertItemBefore(newItem: string, index: number): string; -} -declare var SVGStringList: { - prototype: SVGStringList; - new (): SVGStringList; -} - -interface XDomainRequest { - timeout: number; - onerror: (ev: Event) => any; - onload: (ev: Event) => any; - onprogress: (ev: any) => any; - ontimeout: (ev: Event) => any; - responseText: string; - contentType: string; - open(method: string, url: string): void; - create(): XDomainRequest; - abort(): void; - send(data?: any): void; -} -declare var XDomainRequest: { - prototype: XDomainRequest; - new (): XDomainRequest; -} - -interface DOML2DeprecatedBackgroundColorStyle { - bgColor: any; -} - -interface ElementTraversal { - childElementCount: number; - previousElementSibling: Element; - lastElementChild: Element; - nextElementSibling: Element; - firstElementChild: Element; -} - -interface SVGLength { - valueAsString: string; - valueInSpecifiedUnits: number; - value: number; - unitType: number; - newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void; - convertToSpecifiedUnits(unitType: number): void; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} -declare var SVGLength: { - prototype: SVGLength; - new (): SVGLength; - SVG_LENGTHTYPE_NUMBER: number; - SVG_LENGTHTYPE_CM: number; - SVG_LENGTHTYPE_PC: number; - SVG_LENGTHTYPE_PERCENTAGE: number; - SVG_LENGTHTYPE_MM: number; - SVG_LENGTHTYPE_PT: number; - SVG_LENGTHTYPE_IN: number; - SVG_LENGTHTYPE_EMS: number; - SVG_LENGTHTYPE_PX: number; - SVG_LENGTHTYPE_UNKNOWN: number; - SVG_LENGTHTYPE_EXS: number; -} - -interface SVGPolygonElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolygonElement: { - prototype: SVGPolygonElement; - new (): SVGPolygonElement; -} - -interface HTMLPhraseElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLPhraseElement: { - prototype: HTMLPhraseElement; - new (): HTMLPhraseElement; -} - -interface NavigatorStorageUtils { -} - -interface SVGPathSegCurvetoCubicRel extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicRel: { - prototype: SVGPathSegCurvetoCubicRel; - new (): SVGPathSegCurvetoCubicRel; -} - -interface MSEventObj extends Event { - nextPage: string; - keyCode: number; - toElement: Element; - returnValue: any; - dataFld: string; - y: number; - dataTransfer: DataTransfer; - propertyName: string; - url: string; - offsetX: number; - recordset: Object; - screenX: number; - buttonID: number; - wheelDelta: number; - reason: number; - origin: string; - data: string; - srcFilter: Object; - boundElements: HTMLCollection; - cancelBubble: boolean; - altLeft: boolean; - behaviorCookie: number; - bookmarks: BookmarkCollection; - type: string; - repeat: boolean; - srcElement: Element; - source: Window; - fromElement: Element; - offsetY: number; - x: number; - behaviorPart: number; - qualifier: string; - altKey: boolean; - ctrlKey: boolean; - clientY: number; - shiftKey: boolean; - shiftLeft: boolean; - contentOverflow: boolean; - screenY: number; - ctrlLeft: boolean; - button: number; - srcUrn: string; - clientX: number; - actionURL: string; - getAttribute(strAttributeName: string, lFlags?: number): any; - setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - removeAttribute(strAttributeName: string, lFlags?: number): boolean; -} -declare var MSEventObj: { - prototype: MSEventObj; - new (): MSEventObj; -} - -interface SVGTextContentElement extends SVGElement, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - textLength: SVGAnimatedLength; - lengthAdjust: SVGAnimatedEnumeration; - getCharNumAtPosition(point: SVGPoint): number; - getStartPositionOfChar(charnum: number): SVGPoint; - getExtentOfChar(charnum: number): SVGRect; - getComputedTextLength(): number; - getSubStringLength(charnum: number, nchars: number): number; - selectSubString(charnum: number, nchars: number): void; - getNumberOfChars(): number; - getRotationOfChar(charnum: number): number; - getEndPositionOfChar(charnum: number): SVGPoint; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} -declare var SVGTextContentElement: { - prototype: SVGTextContentElement; - new (): SVGTextContentElement; - LENGTHADJUST_SPACING: number; - LENGTHADJUST_SPACINGANDGLYPHS: number; - LENGTHADJUST_UNKNOWN: number; -} - -interface DOML2DeprecatedColorProperty { - color: string; -} - -interface HTMLCanvasElement extends HTMLElement { - /** - * Gets or sets the width of a canvas element on a document. - */ - width: number; - /** - * Gets or sets the height of a canvas element on a document. - */ - height: number; - /** - * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element. - * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. - */ - toDataURL(type?: string, ...args: any[]): string; - /** - * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas. - * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext("2d"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext("experimental-webgl"); - */ - getContext(contextId: "2d"): CanvasRenderingContext2D; - getContext(contextId: "experimental-webgl"): WebGLRenderingContext; - getContext(contextId: string, ...args: any[]): any; -} -declare var HTMLCanvasElement: { - prototype: HTMLCanvasElement; - new (): HTMLCanvasElement; -} - -interface Location { - hash: string; - protocol: string; - search: string; - href: string; - hostname: string; - port: string; - pathname: string; - host: string; - reload(flag?: boolean): void; - replace(url: string): void; - assign(url: string): void; - toString(): string; -} -declare var Location: { - prototype: Location; - new (): Location; -} - -interface HTMLTitleElement extends HTMLElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} -declare var HTMLTitleElement: { - prototype: HTMLTitleElement; - new (): HTMLTitleElement; -} - -interface HTMLStyleElement extends HTMLElement, LinkStyle { - /** - * Sets or retrieves the media type. - */ - media: string; - /** - * Retrieves the CSS language in which the style sheet is written. - */ - type: string; -} -declare var HTMLStyleElement: { - prototype: HTMLStyleElement; - new (): HTMLStyleElement; -} - -interface PerformanceEntry { - name: string; - startTime: number; - duration: number; - entryType: string; -} -declare var PerformanceEntry: { - prototype: PerformanceEntry; - new (): PerformanceEntry; -} - -interface SVGTransform { - type: number; - angle: number; - matrix: SVGMatrix; - setTranslate(tx: number, ty: number): void; - setScale(sx: number, sy: number): void; - setMatrix(matrix: SVGMatrix): void; - setSkewY(angle: number): void; - setRotate(angle: number, cx: number, cy: number): void; - setSkewX(angle: number): void; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} -declare var SVGTransform: { - prototype: SVGTransform; - new (): SVGTransform; - SVG_TRANSFORM_SKEWX: number; - SVG_TRANSFORM_UNKNOWN: number; - SVG_TRANSFORM_SCALE: number; - SVG_TRANSFORM_TRANSLATE: number; - SVG_TRANSFORM_MATRIX: number; - SVG_TRANSFORM_ROTATE: number; - SVG_TRANSFORM_SKEWY: number; -} - -interface UIEvent extends Event { - detail: number; - view: Window; - initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void; -} -declare var UIEvent: { - prototype: UIEvent; - new (): UIEvent; -} - -interface SVGURIReference { - href: SVGAnimatedString; -} - -interface SVGPathSeg { - pathSegType: number; - pathSegTypeAsLetter: string; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} -declare var SVGPathSeg: { - prototype: SVGPathSeg; - new (): SVGPathSeg; - PATHSEG_MOVETO_REL: number; - PATHSEG_LINETO_VERTICAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number; - PATHSEG_CURVETO_QUADRATIC_REL: number; - PATHSEG_CURVETO_CUBIC_ABS: number; - PATHSEG_LINETO_HORIZONTAL_ABS: number; - PATHSEG_CURVETO_QUADRATIC_ABS: number; - PATHSEG_LINETO_ABS: number; - PATHSEG_CLOSEPATH: number; - PATHSEG_LINETO_HORIZONTAL_REL: number; - PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number; - PATHSEG_LINETO_REL: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number; - PATHSEG_ARC_REL: number; - PATHSEG_CURVETO_CUBIC_REL: number; - PATHSEG_UNKNOWN: number; - PATHSEG_LINETO_VERTICAL_ABS: number; - PATHSEG_ARC_ABS: number; - PATHSEG_MOVETO_ABS: number; - PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number; -} - -interface WheelEvent extends MouseEvent { - deltaZ: number; - deltaX: number; - deltaMode: number; - deltaY: number; - initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} -declare var WheelEvent: { - prototype: WheelEvent; - new (): WheelEvent; - DOM_DELTA_PIXEL: number; - DOM_DELTA_LINE: number; - DOM_DELTA_PAGE: number; -} - -interface MSEventAttachmentTarget { - attachEvent(event: string, listener: EventListener): boolean; - detachEvent(event: string, listener: EventListener): void; -} - -interface SVGNumber { - value: number; -} -declare var SVGNumber: { - prototype: SVGNumber; - new (): SVGNumber; -} - -interface SVGPathElement extends SVGElement, SVGStylable, SVGAnimatedPathData, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - getPathSegAtLength(distance: number): number; - getPointAtLength(distance: number): SVGPoint; - createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs; - createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel; - createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel; - createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs; - createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs; - createSVGPathSegClosePath(): SVGPathSegClosePath; - createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel; - createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel; - createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel; - createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs; - createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs; - createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel; - createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel; - createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs; - createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel; - getTotalLength(): number; - createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel; - createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs; - createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs; - createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs; -} -declare var SVGPathElement: { - prototype: SVGPathElement; - new (): SVGPathElement; -} - -interface MSCompatibleInfo { - version: string; - userAgent: string; -} -declare var MSCompatibleInfo: { - prototype: MSCompatibleInfo; - new (): MSCompatibleInfo; -} - -interface Text extends CharacterData, MSNodeExtensions { - wholeText: string; - splitText(offset: number): Text; - replaceWholeText(content: string): Text; -} -declare var Text: { - prototype: Text; - new (): Text; -} - -interface SVGAnimatedRect { - animVal: SVGRect; - baseVal: SVGRect; -} -declare var SVGAnimatedRect: { - prototype: SVGAnimatedRect; - new (): SVGAnimatedRect; -} - -interface CSSNamespaceRule extends CSSRule { - namespaceURI: string; - prefix: string; -} -declare var CSSNamespaceRule: { - prototype: CSSNamespaceRule; - new (): CSSNamespaceRule; -} - -interface SVGPathSegList { - numberOfItems: number; - replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg; - getItem(index: number): SVGPathSeg; - clear(): void; - appendItem(newItem: SVGPathSeg): SVGPathSeg; - initialize(newItem: SVGPathSeg): SVGPathSeg; - removeItem(index: number): SVGPathSeg; - insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg; -} -declare var SVGPathSegList: { - prototype: SVGPathSegList; - new (): SVGPathSegList; -} - -interface HTMLUnknownElement extends HTMLElement, MSDataBindingRecordSetReadonlyExtensions { -} -declare var HTMLUnknownElement: { - prototype: HTMLUnknownElement; - new (): HTMLUnknownElement; -} - -interface HTMLAudioElement extends HTMLMediaElement { -} -declare var HTMLAudioElement: { - prototype: HTMLAudioElement; - new (): HTMLAudioElement; -} - -interface MSImageResourceExtensions { - dynsrc: string; - vrml: string; - lowsrc: string; - start: string; - loop: number; -} - -interface PositionError { - code: number; - message: string; - toString(): string; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} -declare var PositionError: { - prototype: PositionError; - new (): PositionError; - POSITION_UNAVAILABLE: number; - PERMISSION_DENIED: number; - TIMEOUT: number; -} - -interface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment, DOML2DeprecatedBackgroundStyle, DOML2DeprecatedBackgroundColorStyle { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves a list of header cells that provide information for the object. - */ - headers: string; - /** - * Retrieves the position of the object in the cells collection of a row. - */ - cellIndex: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorLight: any; - /** - * Sets or retrieves the number columns in the table that the object should span. - */ - colSpan: number; - /** - * Sets or retrieves the border color of the object. - */ - borderColor: any; - /** - * Sets or retrieves a comma-delimited list of conceptual categories associated with the object. - */ - axis: string; - /** - * Sets or retrieves the height of the object. - */ - height: any; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; - /** - * Sets or retrieves abbreviated text for the object. - */ - abbr: string; - /** - * Sets or retrieves how many rows in a table the cell should span. - */ - rowSpan: number; - /** - * Sets or retrieves the group of cells in a table to which the object's information applies. - */ - scope: string; - /** - * Sets or retrieves the color for one of the two colors used to draw the 3-D border of the object. - */ - borderColorDark: any; -} -declare var HTMLTableCellElement: { - prototype: HTMLTableCellElement; - new (): HTMLTableCellElement; -} - -interface SVGElementInstance extends EventTarget { - previousSibling: SVGElementInstance; - parentNode: SVGElementInstance; - lastChild: SVGElementInstance; - nextSibling: SVGElementInstance; - childNodes: SVGElementInstanceList; - correspondingUseElement: SVGUseElement; - correspondingElement: SVGElement; - firstChild: SVGElementInstance; -} -declare var SVGElementInstance: { - prototype: SVGElementInstance; - new (): SVGElementInstance; -} - -interface MSNamespaceInfoCollection { - length: number; - add(namespace?: string, urn?: string, implementationUrl?: any): Object; - item(index: any): Object; - [index: string]: Object; -} -declare var MSNamespaceInfoCollection: { - prototype: MSNamespaceInfoCollection; - new (): MSNamespaceInfoCollection; -} - -interface SVGCircleElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - cx: SVGAnimatedLength; - r: SVGAnimatedLength; - cy: SVGAnimatedLength; -} -declare var SVGCircleElement: { - prototype: SVGCircleElement; - new (): SVGCircleElement; -} - -interface StyleSheetList { - length: number; - item(index?: number): StyleSheet; - [index: number]: StyleSheet; -} -declare var StyleSheetList: { - prototype: StyleSheetList; - new (): StyleSheetList; -} - -interface CSSImportRule extends CSSRule { - styleSheet: CSSStyleSheet; - href: string; - media: MediaList; -} -declare var CSSImportRule: { - prototype: CSSImportRule; - new (): CSSImportRule; -} - -interface CustomEvent extends Event { - detail: any; - initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any): void; -} -declare var CustomEvent: { - prototype: CustomEvent; - new (): CustomEvent; -} - -interface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty { - /** - * Sets or retrieves the current typeface family. - */ - face: string; - /** - * Sets or retrieves the font size of the object. - */ - size: number; -} -declare var HTMLBaseFontElement: { - prototype: HTMLBaseFontElement; - new (): HTMLBaseFontElement; -} - -interface HTMLTextAreaElement extends HTMLElement, MSDataBindingExtensions { - /** - * Retrieves or sets the text in the entry field of the textArea element. - */ - value: string; - /** - * Sets or retrieves the value indicating whether the control is selected. - */ - status: any; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Gets or sets the starting position or offset of a text selection. - */ - selectionStart: number; - /** - * Sets or retrieves the number of horizontal rows contained in the object. - */ - rows: number; - /** - * Sets or retrieves the width of the object. - */ - cols: number; - /** - * Sets or retrieves the value indicated whether the content of the object is read-only. - */ - readOnly: boolean; - /** - * Sets or retrieves how to handle wordwrapping in the object. - */ - wrap: string; - /** - * Gets or sets the end position or offset of a text selection. - */ - selectionEnd: number; - /** - * Retrieves the type of control. - */ - type: string; - /** - * Sets or retrieves the initial contents of the object. - */ - defaultValue: string; - /** - * Creates a TextRange object for the element. - */ - createTextRange(): TextRange; - /** - * Sets the start and end positions of a selection in a text field. - * @param start The offset into the text field for the start of the selection. - * @param end The offset into the text field for the end of the selection. - */ - setSelectionRange(start: number, end: number): void; - /** - * Highlights the input area of a form element. - */ - select(): void; -} -declare var HTMLTextAreaElement: { - prototype: HTMLTextAreaElement; - new (): HTMLTextAreaElement; -} - -interface Geolocation { - clearWatch(watchId: number): void; - getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void; - watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number; -} -declare var Geolocation: { - prototype: Geolocation; - new (): Geolocation; -} - -interface DOML2DeprecatedMarginStyle { - vspace: number; - hspace: number; -} - -interface MSWindowModeless { - dialogTop: any; - dialogLeft: any; - dialogWidth: any; - dialogHeight: any; - menuArguments: any; -} - -interface DOML2DeprecatedAlignmentStyle { - align: string; -} - -interface HTMLMarqueeElement extends HTMLElement, MSDataBindingExtensions, DOML2DeprecatedBackgroundColorStyle { - width: string; - onbounce: (ev: Event) => any; - vspace: number; - trueSpeed: boolean; - scrollAmount: number; - scrollDelay: number; - behavior: string; - height: string; - loop: number; - direction: string; - hspace: number; - onstart: (ev: Event) => any; - onfinish: (ev: Event) => any; - stop(): void; - start(): void; -} -declare var HTMLMarqueeElement: { - prototype: HTMLMarqueeElement; - new (): HTMLMarqueeElement; -} - -interface SVGRect { - y: number; - width: number; - x: number; - height: number; -} -declare var SVGRect: { - prototype: SVGRect; - new (): SVGRect; -} - -interface MSNodeExtensions { - swapNode(otherNode: Node): Node; - removeNode(deep?: boolean): Node; - replaceNode(replacement: Node): Node; -} - -interface History { - length: number; - back(distance?: any): void; - forward(distance?: any): void; - go(delta?: any): void; -} -declare var History: { - prototype: History; - new (): History; -} - -interface SVGPathSegCurvetoCubicAbs extends SVGPathSeg { - y: number; - y1: number; - x2: number; - x: number; - x1: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicAbs: { - prototype: SVGPathSegCurvetoCubicAbs; - new (): SVGPathSegCurvetoCubicAbs; -} - -interface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg { - y: number; - y1: number; - x: number; - x1: number; -} -declare var SVGPathSegCurvetoQuadraticAbs: { - prototype: SVGPathSegCurvetoQuadraticAbs; - new (): SVGPathSegCurvetoQuadraticAbs; -} - -interface TimeRanges { - length: number; - start(index: number): number; - end(index: number): number; -} -declare var TimeRanges: { - prototype: TimeRanges; - new (): TimeRanges; -} - -interface CSSRule { - cssText: string; - parentStyleSheet: CSSStyleSheet; - parentRule: CSSRule; - type: number; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; -} -declare var CSSRule: { - prototype: CSSRule; - new (): CSSRule; - IMPORT_RULE: number; - MEDIA_RULE: number; - STYLE_RULE: number; - NAMESPACE_RULE: number; - PAGE_RULE: number; - UNKNOWN_RULE: number; - FONT_FACE_RULE: number; - CHARSET_RULE: number; -} - -interface SVGPathSegLinetoAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoAbs: { - prototype: SVGPathSegLinetoAbs; - new (): SVGPathSegLinetoAbs; -} - -interface HTMLModElement extends HTMLElement { - /** - * Sets or retrieves the date and time of a modification to the object. - */ - dateTime: string; - /** - * Sets or retrieves reference information about the object. - */ - cite: string; -} -declare var HTMLModElement: { - prototype: HTMLModElement; - new (): HTMLModElement; -} - -interface SVGMatrix { - e: number; - c: number; - a: number; - b: number; - d: number; - f: number; - multiply(secondMatrix: SVGMatrix): SVGMatrix; - flipY(): SVGMatrix; - skewY(angle: number): SVGMatrix; - inverse(): SVGMatrix; - scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix; - rotate(angle: number): SVGMatrix; - flipX(): SVGMatrix; - translate(x: number, y: number): SVGMatrix; - scale(scaleFactor: number): SVGMatrix; - rotateFromVector(x: number, y: number): SVGMatrix; - skewX(angle: number): SVGMatrix; -} -declare var SVGMatrix: { - prototype: SVGMatrix; - new (): SVGMatrix; -} - -interface MSPopupWindow { - document: Document; - isOpen: boolean; - show(x: number, y: number, w: number, h: number, element?: any): void; - hide(): void; -} -declare var MSPopupWindow: { - prototype: MSPopupWindow; - new (): MSPopupWindow; -} - -interface BeforeUnloadEvent extends Event { - returnValue: string; -} -declare var BeforeUnloadEvent: { - prototype: BeforeUnloadEvent; - new (): BeforeUnloadEvent; -} - -interface SVGUseElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired, SVGURIReference { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - animatedInstanceRoot: SVGElementInstance; - instanceRoot: SVGElementInstance; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGUseElement: { - prototype: SVGUseElement; - new (): SVGUseElement; -} - -interface Event { - timeStamp: number; - defaultPrevented: boolean; - isTrusted: boolean; - currentTarget: EventTarget; - cancelBubble: boolean; - target: EventTarget; - eventPhase: number; - cancelable: boolean; - type: string; - srcElement: Element; - bubbles: boolean; - initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} -declare var Event: { - prototype: Event; - new (): Event; - CAPTURING_PHASE: number; - AT_TARGET: number; - BUBBLING_PHASE: number; -} - -interface ImageData { - width: number; - data: Uint8Array; - height: number; -} -declare var ImageData: { - prototype: ImageData; - new (): ImageData; -} - -interface HTMLTableColElement extends HTMLElement, HTMLTableAlignment { - /** - * Sets or retrieves the width of the object. - */ - width: any; - /** - * Sets or retrieves the alignment of the object relative to the display or table. - */ - align: string; - /** - * Sets or retrieves the number of columns in the group. - */ - span: number; -} -declare var HTMLTableColElement: { - prototype: HTMLTableColElement; - new (): HTMLTableColElement; -} - -interface SVGException { - code: number; - message: string; - toString(): string; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} -declare var SVGException: { - prototype: SVGException; - new (): SVGException; - SVG_MATRIX_NOT_INVERTABLE: number; - SVG_WRONG_TYPE_ERR: number; - SVG_INVALID_VALUE_ERR: number; -} - -interface SVGLinearGradientElement extends SVGGradientElement { - y1: SVGAnimatedLength; - x2: SVGAnimatedLength; - x1: SVGAnimatedLength; - y2: SVGAnimatedLength; -} -declare var SVGLinearGradientElement: { - prototype: SVGLinearGradientElement; - new (): SVGLinearGradientElement; -} - -interface HTMLTableAlignment { - /** - * Sets or retrieves a value that you can use to implement your own ch functionality for the object. - */ - ch: string; - /** - * Sets or retrieves how text and other content are vertically aligned within the object that contains them. - */ - vAlign: string; - /** - * Sets or retrieves a value that you can use to implement your own chOff functionality for the object. - */ - chOff: string; -} - -interface SVGAnimatedEnumeration { - animVal: number; - baseVal: number; -} -declare var SVGAnimatedEnumeration: { - prototype: SVGAnimatedEnumeration; - new (): SVGAnimatedEnumeration; -} - -interface DOML2DeprecatedSizeProperty { - size: number; -} - -interface HTMLUListElement extends HTMLElement, DOML2DeprecatedListSpaceReduction, DOML2DeprecatedListNumberingAndBulletStyle { -} -declare var HTMLUListElement: { - prototype: HTMLUListElement; - new (): HTMLUListElement; -} - -interface SVGRectElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - ry: SVGAnimatedLength; - rx: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGRectElement: { - prototype: SVGRectElement; - new (): SVGRectElement; -} - -interface ErrorEventHandler { - (event: Event, source: string, fileno: number, columnNumber: number): void; - (message: any, uri: string, lineNumber: number, columnNumber?: number): void; -} - -interface HTMLDivElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDivElement: { - prototype: HTMLDivElement; - new (): HTMLDivElement; -} - -interface DOML2DeprecatedBorderStyle { - border: string; -} - -interface NamedNodeMap { - length: number; - removeNamedItemNS(namespaceURI: string, localName: string): Attr; - item(index: number): Attr; - [index: number]: Attr; - removeNamedItem(name: string): Attr; - getNamedItem(name: string): Attr; - setNamedItem(arg: Attr): Attr; - getNamedItemNS(namespaceURI: string, localName: string): Attr; - setNamedItemNS(arg: Attr): Attr; -} -declare var NamedNodeMap: { - prototype: NamedNodeMap; - new (): NamedNodeMap; -} - -interface MediaList { - length: number; - mediaText: string; - deleteMedium(oldMedium: string): void; - appendMedium(newMedium: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} -declare var MediaList: { - prototype: MediaList; - new (): MediaList; -} - -interface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegCurvetoQuadraticSmoothAbs: { - prototype: SVGPathSegCurvetoQuadraticSmoothAbs; - new (): SVGPathSegCurvetoQuadraticSmoothAbs; -} - -interface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg { - y: number; - x2: number; - x: number; - y2: number; -} -declare var SVGPathSegCurvetoCubicSmoothRel: { - prototype: SVGPathSegCurvetoCubicSmoothRel; - new (): SVGPathSegCurvetoCubicSmoothRel; -} - -interface SVGLengthList { - numberOfItems: number; - replaceItem(newItem: SVGLength, index: number): SVGLength; - getItem(index: number): SVGLength; - clear(): void; - appendItem(newItem: SVGLength): SVGLength; - initialize(newItem: SVGLength): SVGLength; - removeItem(index: number): SVGLength; - insertItemBefore(newItem: SVGLength, index: number): SVGLength; -} -declare var SVGLengthList: { - prototype: SVGLengthList; - new (): SVGLengthList; -} - -interface ProcessingInstruction extends Node { - target: string; - data: string; -} -declare var ProcessingInstruction: { - prototype: ProcessingInstruction; - new (): ProcessingInstruction; -} - -interface MSWindowExtensions { - status: string; - onmouseleave: (ev: MouseEvent) => any; - screenLeft: number; - offscreenBuffering: any; - maxConnectionsPerServer: number; - onmouseenter: (ev: MouseEvent) => any; - clipboardData: DataTransfer; - defaultStatus: string; - clientInformation: Navigator; - closed: boolean; - onhelp: (ev: Event) => any; - external: External; - event: MSEventObj; - onfocusout: (ev: FocusEvent) => any; - screenTop: number; - onfocusin: (ev: FocusEvent) => any; - showModelessDialog(url?: string, argument?: any, options?: any): Window; - navigate(url: string): void; - resizeBy(x?: number, y?: number): void; - item(index: any): any; - resizeTo(x?: number, y?: number): void; - createPopup(arguments?: any): MSPopupWindow; - toStaticHTML(html: string): string; - execScript(code: string, language?: string): any; - msWriteProfilerMark(profilerMarkName: string): void; - moveTo(x?: number, y?: number): void; - moveBy(x?: number, y?: number): void; - showHelp(url: string, helpArg?: any, features?: string): void; -} - -interface MSBehaviorUrnsCollection { - length: number; - item(index: number): string; -} -declare var MSBehaviorUrnsCollection: { - prototype: MSBehaviorUrnsCollection; - new (): MSBehaviorUrnsCollection; -} - -interface CSSFontFaceRule extends CSSRule { - style: CSSStyleDeclaration; -} -declare var CSSFontFaceRule: { - prototype: CSSFontFaceRule; - new (): CSSFontFaceRule; -} - -interface DOML2DeprecatedBackgroundStyle { - background: string; -} - -interface TextEvent extends UIEvent { - inputMethod: number; - data: string; - locale: string; - initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} -declare var TextEvent: { - prototype: TextEvent; - new (): TextEvent; - DOM_INPUT_METHOD_KEYBOARD: number; - DOM_INPUT_METHOD_DROP: number; - DOM_INPUT_METHOD_IME: number; - DOM_INPUT_METHOD_SCRIPT: number; - DOM_INPUT_METHOD_VOICE: number; - DOM_INPUT_METHOD_UNKNOWN: number; - DOM_INPUT_METHOD_PASTE: number; - DOM_INPUT_METHOD_HANDWRITING: number; - DOM_INPUT_METHOD_OPTION: number; - DOM_INPUT_METHOD_MULTIMODAL: number; -} - -interface DocumentFragment extends Node, NodeSelector, MSEventAttachmentTarget, MSNodeExtensions { -} -declare var DocumentFragment: { - prototype: DocumentFragment; - new (): DocumentFragment; -} - -interface SVGPolylineElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGAnimatedPoints, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGPolylineElement: { - prototype: SVGPolylineElement; - new (): SVGPolylineElement; -} - -interface SVGAnimatedPathData { - pathSegList: SVGPathSegList; -} - -interface Position { - timestamp: number; - coords: Coordinates; -} -declare var Position: { - prototype: Position; - new (): Position; -} - -interface BookmarkCollection { - length: number; - item(index: number): any; - [index: number]: any; -} -declare var BookmarkCollection: { - prototype: BookmarkCollection; - new (): BookmarkCollection; -} - -interface PerformanceMark extends PerformanceEntry { -} -declare var PerformanceMark: { - prototype: PerformanceMark; - new (): PerformanceMark; -} - -interface CSSPageRule extends CSSRule { - pseudoClass: string; - selectorText: string; - selector: string; - style: CSSStyleDeclaration; -} -declare var CSSPageRule: { - prototype: CSSPageRule; - new (): CSSPageRule; -} - -interface HTMLBRElement extends HTMLElement { - /** - * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document. - */ - clear: string; -} -declare var HTMLBRElement: { - prototype: HTMLBRElement; - new (): HTMLBRElement; -} - -interface MSNavigatorExtensions { - userLanguage: string; - plugins: MSPluginsCollection; - cookieEnabled: boolean; - appCodeName: string; - cpuClass: string; - appMinorVersion: string; - connectionSpeed: number; - browserLanguage: string; - mimeTypes: MSMimeTypesCollection; - systemLanguage: string; - javaEnabled(): boolean; - taintEnabled(): boolean; -} - -interface HTMLSpanElement extends HTMLElement, MSDataBindingExtensions { -} -declare var HTMLSpanElement: { - prototype: HTMLSpanElement; - new (): HTMLSpanElement; -} - -interface HTMLHeadElement extends HTMLElement { - profile: string; -} -declare var HTMLHeadElement: { - prototype: HTMLHeadElement; - new (): HTMLHeadElement; -} - -interface HTMLHeadingElement extends HTMLElement, DOML2DeprecatedTextFlowControl { - /** - * Sets or retrieves a value that indicates the table alignment. - */ - align: string; -} -declare var HTMLHeadingElement: { - prototype: HTMLHeadingElement; - new (): HTMLHeadingElement; -} - -interface HTMLFormElement extends HTMLElement, MSHTMLCollectionExtensions { - /** - * Sets or retrieves the number of objects in a collection. - */ - length: number; - /** - * Sets or retrieves the window or frame at which to target content. - */ - target: string; - /** - * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form. - */ - acceptCharset: string; - /** - * Sets or retrieves the encoding type for the form. - */ - enctype: string; - /** - * Retrieves a collection, in source order, of all controls in a given form. - */ - elements: HTMLCollection; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves how to send the form data to the server. - */ - method: string; - /** - * Sets or retrieves the MIME encoding for the form. - */ - encoding: string; - /** - * Fires when the user resets a form. - */ - reset(): void; - /** - * Retrieves a form object or an object from an elements collection. - * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made. - * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned. - */ - item(name?: any, index?: any): any; - /** - * Fires when a FORM is about to be submitted. - */ - submit(): void; - /** - * Retrieves a form object or an object from an elements collection. - */ - namedItem(name: string): any; - [name: string]: any; -} -declare var HTMLFormElement: { - prototype: HTMLFormElement; - new (): HTMLFormElement; -} - -interface SVGZoomAndPan { - zoomAndPan: number; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} -declare var SVGZoomAndPan: { - prototype: SVGZoomAndPan; - new (): SVGZoomAndPan; - SVG_ZOOMANDPAN_MAGNIFY: number; - SVG_ZOOMANDPAN_UNKNOWN: number; - SVG_ZOOMANDPAN_DISABLE: number; -} - -interface HTMLMediaElement extends HTMLElement { - /** - * Gets the earliest possible position, in seconds, that the playback can begin. - */ - initialTime: number; - /** - * Gets TimeRanges for the current media resource that has been played. - */ - played: TimeRanges; - /** - * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement. - */ - currentSrc: string; - readyState: any; - /** - * The autobuffer element is not supported by Internet Explorer 9. Use the preload element instead. - */ - autobuffer: boolean; - /** - * Gets or sets a flag to specify whether playback should restart after it completes. - */ - loop: boolean; - /** - * Gets information about whether the playback has ended or not. - */ - ended: boolean; - /** - * Gets a collection of buffered time ranges. - */ - buffered: TimeRanges; - /** - * Returns an object representing the current error state of the audio or video element. - */ - error: MediaError; - /** - * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. - */ - seekable: TimeRanges; - /** - * Gets or sets a value that indicates whether to start playing the media automatically. - */ - autoplay: boolean; - /** - * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player). - */ - controls: boolean; - /** - * Gets or sets the volume level for audio portions of the media element. - */ - volume: number; - /** - * The address or URL of the a media resource that is to be considered. - */ - src: string; - /** - * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource. - */ - playbackRate: number; - /** - * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming. - */ - duration: number; - /** - * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted. - */ - muted: boolean; - /** - * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource. - */ - defaultPlaybackRate: number; - /** - * Gets a flag that specifies whether playback is paused. - */ - paused: boolean; - /** - * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource. - */ - seeking: boolean; - /** - * Gets or sets the current playback position, in seconds. - */ - currentTime: number; - /** - * Gets or sets the current playback position, in seconds. - */ - preload: string; - /** - * Gets the current network activity for the element. - */ - networkState: number; - /** - * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not. - */ - pause(): void; - /** - * Loads and starts playback of a media resource. - */ - play(): void; - /** - * Fires immediately after the client loads the object. - */ - load(): void; - /** - * Returns a string that specifies whether the client can play a given media resource type. - */ - canPlayType(type: string): string; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} -declare var HTMLMediaElement: { - prototype: HTMLMediaElement; - new (): HTMLMediaElement; - HAVE_METADATA: number; - HAVE_CURRENT_DATA: number; - HAVE_NOTHING: number; - NETWORK_NO_SOURCE: number; - HAVE_ENOUGH_DATA: number; - NETWORK_EMPTY: number; - NETWORK_LOADING: number; - NETWORK_IDLE: number; - HAVE_FUTURE_DATA: number; -} - -interface ElementCSSInlineStyle { - runtimeStyle: MSStyleCSSProperties; - currentStyle: MSCurrentStyleCSSProperties; - doScroll(component?: any): void; - componentFromPoint(x: number, y: number): string; -} - -interface DOMParser { - parseFromString(source: string, mimeType: string): Document; -} -declare var DOMParser: { - prototype: DOMParser; - new (): DOMParser; -} - -interface MSMimeTypesCollection { - length: number; -} -declare var MSMimeTypesCollection: { - prototype: MSMimeTypesCollection; - new (): MSMimeTypesCollection; -} - -interface StyleSheet { - disabled: boolean; - ownerNode: Node; - parentStyleSheet: StyleSheet; - href: string; - media: MediaList; - type: string; - title: string; -} -declare var StyleSheet: { - prototype: StyleSheet; - new (): StyleSheet; -} - -interface SVGTextPathElement extends SVGTextContentElement, SVGURIReference { - startOffset: SVGAnimatedLength; - method: SVGAnimatedEnumeration; - spacing: SVGAnimatedEnumeration; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} -declare var SVGTextPathElement: { - prototype: SVGTextPathElement; - new (): SVGTextPathElement; - TEXTPATH_SPACINGTYPE_EXACT: number; - TEXTPATH_METHODTYPE_STRETCH: number; - TEXTPATH_SPACINGTYPE_AUTO: number; - TEXTPATH_SPACINGTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_UNKNOWN: number; - TEXTPATH_METHODTYPE_ALIGN: number; -} - -interface HTMLDTElement extends HTMLElement { - /** - * Sets or retrieves whether the browser automatically performs wordwrap. - */ - noWrap: boolean; -} -declare var HTMLDTElement: { - prototype: HTMLDTElement; - new (): HTMLDTElement; -} - -interface NodeList { - length: number; - item(index: number): Node; - [index: number]: Node; -} -declare var NodeList: { - prototype: NodeList; - new (): NodeList; -} - -interface NodeListOf extends NodeList { - length: number; - item(index: number): TNode; - [index: number]: TNode; -} - -interface XMLSerializer { - serializeToString(target: Node): string; -} -declare var XMLSerializer: { - prototype: XMLSerializer; - new (): XMLSerializer; -} - -interface PerformanceMeasure extends PerformanceEntry { -} -declare var PerformanceMeasure: { - prototype: PerformanceMeasure; - new (): PerformanceMeasure; -} - -interface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGExternalResourcesRequired, SVGURIReference { - spreadMethod: SVGAnimatedEnumeration; - gradientTransform: SVGAnimatedTransformList; - gradientUnits: SVGAnimatedEnumeration; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} -declare var SVGGradientElement: { - prototype: SVGGradientElement; - new (): SVGGradientElement; - SVG_SPREADMETHOD_REFLECT: number; - SVG_SPREADMETHOD_PAD: number; - SVG_SPREADMETHOD_UNKNOWN: number; - SVG_SPREADMETHOD_REPEAT: number; -} - -interface NodeFilter { - acceptNode(n: Node): number; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} -declare var NodeFilter: { - prototype: NodeFilter; - new (): NodeFilter; - SHOW_ENTITY_REFERENCE: number; - SHOW_NOTATION: number; - SHOW_ENTITY: number; - SHOW_DOCUMENT: number; - SHOW_PROCESSING_INSTRUCTION: number; - FILTER_REJECT: number; - SHOW_CDATA_SECTION: number; - FILTER_ACCEPT: number; - SHOW_ALL: number; - SHOW_DOCUMENT_TYPE: number; - SHOW_TEXT: number; - SHOW_ELEMENT: number; - SHOW_COMMENT: number; - FILTER_SKIP: number; - SHOW_ATTRIBUTE: number; - SHOW_DOCUMENT_FRAGMENT: number; -} - -interface SVGNumberList { - numberOfItems: number; - replaceItem(newItem: SVGNumber, index: number): SVGNumber; - getItem(index: number): SVGNumber; - clear(): void; - appendItem(newItem: SVGNumber): SVGNumber; - initialize(newItem: SVGNumber): SVGNumber; - removeItem(index: number): SVGNumber; - insertItemBefore(newItem: SVGNumber, index: number): SVGNumber; -} -declare var SVGNumberList: { - prototype: SVGNumberList; - new (): SVGNumberList; -} - -interface MediaError { - code: number; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; -} -declare var MediaError: { - prototype: MediaError; - new (): MediaError; - MEDIA_ERR_ABORTED: number; - MEDIA_ERR_NETWORK: number; - MEDIA_ERR_SRC_NOT_SUPPORTED: number; - MEDIA_ERR_DECODE: number; -} - -interface HTMLFieldSetElement extends HTMLElement { - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} -declare var HTMLFieldSetElement: { - prototype: HTMLFieldSetElement; - new (): HTMLFieldSetElement; -} - -interface HTMLBGSoundElement extends HTMLElement { - /** - * Sets or gets the value indicating how the volume of the background sound is divided between the left speaker and the right speaker. - */ - balance: any; - /** - * Sets or gets the volume setting for the sound. - */ - volume: any; - /** - * Sets or gets the URL of a sound to play. - */ - src: string; - /** - * Sets or retrieves the number of times a sound or video clip will loop when activated. - */ - loop: number; -} -declare var HTMLBGSoundElement: { - prototype: HTMLBGSoundElement; - new (): HTMLBGSoundElement; -} - -interface HTMLElement extends Element, ElementCSSInlineStyle, MSEventAttachmentTarget, MSNodeExtensions { - onmouseleave: (ev: MouseEvent) => any; - onbeforecut: (ev: DragEvent) => any; - onkeydown: (ev: KeyboardEvent) => any; - onmove: (ev: MSEventObj) => any; - onkeyup: (ev: KeyboardEvent) => any; - onreset: (ev: Event) => any; - onhelp: (ev: Event) => any; - ondragleave: (ev: DragEvent) => any; - className: string; - onfocusin: (ev: FocusEvent) => any; - onseeked: (ev: Event) => any; - recordNumber: any; - title: string; - parentTextEdit: Element; - outerHTML: string; - ondurationchange: (ev: Event) => any; - offsetHeight: number; - all: HTMLCollection; - onblur: (ev: FocusEvent) => any; - dir: string; - onemptied: (ev: Event) => any; - onseeking: (ev: Event) => any; - oncanplay: (ev: Event) => any; - ondeactivate: (ev: UIEvent) => any; - ondatasetchanged: (ev: MSEventObj) => any; - onrowsdelete: (ev: MSEventObj) => any; - sourceIndex: number; - onloadstart: (ev: Event) => any; - onlosecapture: (ev: MSEventObj) => any; - ondragenter: (ev: DragEvent) => any; - oncontrolselect: (ev: MSEventObj) => any; - onsubmit: (ev: Event) => any; - behaviorUrns: MSBehaviorUrnsCollection; - scopeName: string; - onchange: (ev: Event) => any; - id: string; - onlayoutcomplete: (ev: MSEventObj) => any; - uniqueID: string; - onbeforeactivate: (ev: UIEvent) => any; - oncanplaythrough: (ev: Event) => any; - onbeforeupdate: (ev: MSEventObj) => any; - onfilterchange: (ev: MSEventObj) => any; - offsetParent: Element; - ondatasetcomplete: (ev: MSEventObj) => any; - onsuspend: (ev: Event) => any; - readyState: any; - onmouseenter: (ev: MouseEvent) => any; - innerText: string; - onerrorupdate: (ev: MSEventObj) => any; - onmouseout: (ev: MouseEvent) => any; - parentElement: HTMLElement; - onmousewheel: (ev: MouseWheelEvent) => any; - onvolumechange: (ev: Event) => any; - oncellchange: (ev: MSEventObj) => any; - onrowexit: (ev: MSEventObj) => any; - onrowsinserted: (ev: MSEventObj) => any; - onpropertychange: (ev: MSEventObj) => any; - filters: Object; - children: HTMLCollection; - ondragend: (ev: DragEvent) => any; - onbeforepaste: (ev: DragEvent) => any; - ondragover: (ev: DragEvent) => any; - offsetTop: number; - onmouseup: (ev: MouseEvent) => any; - ondragstart: (ev: DragEvent) => any; - onbeforecopy: (ev: DragEvent) => any; - ondrag: (ev: DragEvent) => any; - innerHTML: string; - onmouseover: (ev: MouseEvent) => any; - lang: string; - uniqueNumber: number; - onpause: (ev: Event) => any; - tagUrn: string; - onmousedown: (ev: MouseEvent) => any; - onclick: (ev: MouseEvent) => any; - onwaiting: (ev: Event) => any; - onresizestart: (ev: MSEventObj) => any; - offsetLeft: number; - isTextEdit: boolean; - isDisabled: boolean; - onpaste: (ev: DragEvent) => any; - canHaveHTML: boolean; - onmoveend: (ev: MSEventObj) => any; - language: string; - onstalled: (ev: Event) => any; - onmousemove: (ev: MouseEvent) => any; - style: MSStyleCSSProperties; - isContentEditable: boolean; - onbeforeeditfocus: (ev: MSEventObj) => any; - onratechange: (ev: Event) => any; - contentEditable: string; - tabIndex: number; - document: Document; - onprogress: (ev: any) => any; - ondblclick: (ev: MouseEvent) => any; - oncontextmenu: (ev: MouseEvent) => any; - onloadedmetadata: (ev: Event) => any; - onafterupdate: (ev: MSEventObj) => any; - onerror: (ev: Event) => any; - onplay: (ev: Event) => any; - onresizeend: (ev: MSEventObj) => any; - onplaying: (ev: Event) => any; - isMultiLine: boolean; - onfocusout: (ev: FocusEvent) => any; - onabort: (ev: UIEvent) => any; - ondataavailable: (ev: MSEventObj) => any; - hideFocus: boolean; - onreadystatechange: (ev: Event) => any; - onkeypress: (ev: KeyboardEvent) => any; - onloadeddata: (ev: Event) => any; - onbeforedeactivate: (ev: UIEvent) => any; - outerText: string; - disabled: boolean; - onactivate: (ev: UIEvent) => any; - accessKey: string; - onmovestart: (ev: MSEventObj) => any; - onselectstart: (ev: Event) => any; - onfocus: (ev: FocusEvent) => any; - ontimeupdate: (ev: Event) => any; - onresize: (ev: UIEvent) => any; - oncut: (ev: DragEvent) => any; - onselect: (ev: UIEvent) => any; - ondrop: (ev: DragEvent) => any; - offsetWidth: number; - oncopy: (ev: DragEvent) => any; - onended: (ev: Event) => any; - onscroll: (ev: UIEvent) => any; - onrowenter: (ev: MSEventObj) => any; - onload: (ev: Event) => any; - canHaveChildren: boolean; - oninput: (ev: Event) => any; - dragDrop(): boolean; - scrollIntoView(top?: boolean): void; - addFilter(filter: Object): void; - setCapture(containerCapture?: boolean): void; - focus(): void; - getAdjacentText(where: string): string; - insertAdjacentText(where: string, text: string): void; - getElementsByClassName(classNames: string): NodeList; - setActive(): void; - removeFilter(filter: Object): void; - blur(): void; - clearAttributes(): void; - releaseCapture(): void; - createControlRange(): ControlRangeCollection; - removeBehavior(cookie: number): boolean; - contains(child: HTMLElement): boolean; - click(): void; - insertAdjacentElement(position: string, insertedElement: Element): Element; - mergeAttributes(source: HTMLElement, preserveIdentity?: boolean): void; - replaceAdjacentText(where: string, newText: string): string; - applyElement(apply: Element, where?: string): Element; - addBehavior(bstrUrl: string, factory?: any): number; - insertAdjacentHTML(where: string, html: string): void; -} -declare var HTMLElement: { - prototype: HTMLElement; - new (): HTMLElement; -} - -interface Comment extends CharacterData { - text: string; -} -declare var Comment: { - prototype: Comment; - new (): Comment; -} - -interface PerformanceResourceTiming extends PerformanceEntry { - redirectStart: number; - redirectEnd: number; - domainLookupEnd: number; - responseStart: number; - domainLookupStart: number; - fetchStart: number; - requestStart: number; - connectEnd: number; - connectStart: number; - initiatorType: string; - responseEnd: number; -} -declare var PerformanceResourceTiming: { - prototype: PerformanceResourceTiming; - new (): PerformanceResourceTiming; -} - -interface CanvasPattern { -} -declare var CanvasPattern: { - prototype: CanvasPattern; - new (): CanvasPattern; -} - -interface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty { - /** - * Sets or retrieves the width of the object. - */ - width: number; - /** - * Sets or retrieves how the object is aligned with adjacent text. - */ - align: string; - /** - * Sets or retrieves whether the horizontal rule is drawn with 3-D shading. - */ - noShade: boolean; -} -declare var HTMLHRElement: { - prototype: HTMLHRElement; - new (): HTMLHRElement; -} - -interface HTMLObjectElement extends HTMLElement, GetSVGDocument, DOML2DeprecatedMarginStyle, DOML2DeprecatedBorderStyle, DOML2DeprecatedAlignmentStyle, MSDataBindingExtensions, MSDataBindingRecordSetExtensions { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Sets or retrieves the Internet media type for the code associated with the object. - */ - codeType: string; - /** - * Retrieves the contained object. - */ - object: Object; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL of the file containing the compiled Java class. - */ - code: string; - /** - * Sets or retrieves a character string that can be used to implement your own archive functionality for the object. - */ - archive: string; - /** - * Sets or retrieves a message to be displayed while an object is loading. - */ - standby: string; - /** - * Sets or retrieves a text alternative to the graphic. - */ - alt: string; - /** - * Sets or retrieves the class identifier for the object. - */ - classid: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map. - */ - useMap: string; - /** - * Sets or retrieves the URL that references the data of the object. - */ - data: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Retrieves the document object of the page or frame. - */ - contentDocument: Document; - /** - * Gets or sets the optional alternative HTML script to execute if the object fails to load. - */ - altHtml: string; - /** - * Sets or retrieves the URL of the component. - */ - codeBase: string; - declare: boolean; - /** - * Sets or retrieves the MIME type of the object. - */ - type: string; - /** - * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element. - */ - BaseHref: string; -} -declare var HTMLObjectElement: { - prototype: HTMLObjectElement; - new (): HTMLObjectElement; -} - -interface HTMLEmbedElement extends HTMLElement, GetSVGDocument { - /** - * Sets or retrieves the width of the object. - */ - width: string; - /** - * Retrieves the palette used for the embedded document. - */ - palette: string; - /** - * Sets or retrieves a URL to be loaded by the object. - */ - src: string; - /** - * Sets or retrieves the name of the object. - */ - name: string; - /** - * Retrieves the URL of the plug-in used to view an embedded document. - */ - pluginspage: string; - /** - * Sets or retrieves the height of the object. - */ - height: string; - /** - * Sets or retrieves the height and width units of the embed object. - */ - units: string; -} -declare var HTMLEmbedElement: { - prototype: HTMLEmbedElement; - new (): HTMLEmbedElement; -} - -interface StorageEvent extends Event { - oldValue: any; - newValue: any; - url: string; - storageArea: Storage; - key: string; - initStorageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, keyArg: string, oldValueArg: any, newValueArg: any, urlArg: string, storageAreaArg: Storage): void; -} -declare var StorageEvent: { - prototype: StorageEvent; - new (): StorageEvent; -} - -interface CharacterData extends Node { - length: number; - data: string; - deleteData(offset: number, count: number): void; - replaceData(offset: number, count: number, arg: string): void; - appendData(arg: string): void; - insertData(offset: number, arg: string): void; - substringData(offset: number, count: number): string; -} -declare var CharacterData: { - prototype: CharacterData; - new (): CharacterData; -} - -interface HTMLOptGroupElement extends HTMLElement, MSDataBindingExtensions { - /** - * Sets or retrieves the ordinal position of an option in a list box. - */ - index: number; - /** - * Sets or retrieves the status of an option. - */ - defaultSelected: boolean; - /** - * Sets or retrieves the text string specified by the option tag. - */ - text: string; - /** - * Sets or retrieves the value which is returned to the server when the form control is submitted. - */ - value: string; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves a value that you can use to implement your own label functionality for the object. - */ - label: string; - /** - * Sets or retrieves whether the option in the list box is the default item. - */ - selected: boolean; -} -declare var HTMLOptGroupElement: { - prototype: HTMLOptGroupElement; - new (): HTMLOptGroupElement; -} - -interface HTMLIsIndexElement extends HTMLElement { - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; - /** - * Sets or retrieves the URL to which the form content is sent for processing. - */ - action: string; - prompt: string; -} -declare var HTMLIsIndexElement: { - prototype: HTMLIsIndexElement; - new (): HTMLIsIndexElement; -} - -interface SVGPathSegLinetoRel extends SVGPathSeg { - y: number; - x: number; -} -declare var SVGPathSegLinetoRel: { - prototype: SVGPathSegLinetoRel; - new (): SVGPathSegLinetoRel; -} - -interface DOMException { - code: number; - message: string; - toString(): string; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; -} -declare var DOMException: { - prototype: DOMException; - new (): DOMException; - HIERARCHY_REQUEST_ERR: number; - NO_MODIFICATION_ALLOWED_ERR: number; - INVALID_MODIFICATION_ERR: number; - NAMESPACE_ERR: number; - INVALID_CHARACTER_ERR: number; - TYPE_MISMATCH_ERR: number; - ABORT_ERR: number; - INVALID_STATE_ERR: number; - SECURITY_ERR: number; - NETWORK_ERR: number; - WRONG_DOCUMENT_ERR: number; - QUOTA_EXCEEDED_ERR: number; - INDEX_SIZE_ERR: number; - DOMSTRING_SIZE_ERR: number; - SYNTAX_ERR: number; - SERIALIZE_ERR: number; - VALIDATION_ERR: number; - NOT_FOUND_ERR: number; - URL_MISMATCH_ERR: number; - PARSE_ERR: number; - NO_DATA_ALLOWED_ERR: number; - NOT_SUPPORTED_ERR: number; - INVALID_ACCESS_ERR: number; - INUSE_ATTRIBUTE_ERR: number; -} - -interface SVGAnimatedBoolean { - animVal: boolean; - baseVal: boolean; -} -declare var SVGAnimatedBoolean: { - prototype: SVGAnimatedBoolean; - new (): SVGAnimatedBoolean; -} - -interface MSCompatibleInfoCollection { - length: number; - item(index: number): MSCompatibleInfo; -} -declare var MSCompatibleInfoCollection: { - prototype: MSCompatibleInfoCollection; - new (): MSCompatibleInfoCollection; -} - -interface SVGSwitchElement extends SVGElement, SVGStylable, SVGTransformable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { -} -declare var SVGSwitchElement: { - prototype: SVGSwitchElement; - new (): SVGSwitchElement; -} - -interface SVGPreserveAspectRatio { - align: number; - meetOrSlice: number; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} -declare var SVGPreserveAspectRatio: { - prototype: SVGPreserveAspectRatio; - new (): SVGPreserveAspectRatio; - SVG_PRESERVEASPECTRATIO_NONE: number; - SVG_PRESERVEASPECTRATIO_XMINYMID: number; - SVG_PRESERVEASPECTRATIO_XMAXYMIN: number; - SVG_PRESERVEASPECTRATIO_XMINYMAX: number; - SVG_PRESERVEASPECTRATIO_XMAXYMAX: number; - SVG_MEETORSLICE_UNKNOWN: number; - SVG_PRESERVEASPECTRATIO_XMAXYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMAX: number; - SVG_PRESERVEASPECTRATIO_XMINYMIN: number; - SVG_MEETORSLICE_MEET: number; - SVG_PRESERVEASPECTRATIO_XMIDYMID: number; - SVG_PRESERVEASPECTRATIO_XMIDYMIN: number; - SVG_MEETORSLICE_SLICE: number; - SVG_PRESERVEASPECTRATIO_UNKNOWN: number; -} - -interface Attr extends Node { - expando: boolean; - specified: boolean; - ownerElement: Element; - value: string; - name: string; -} -declare var Attr: { - prototype: Attr; - new (): Attr; -} - -interface PerformanceNavigation { - redirectCount: number; - type: number; - toJSON(): any; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} -declare var PerformanceNavigation: { - prototype: PerformanceNavigation; - new (): PerformanceNavigation; - TYPE_RELOAD: number; - TYPE_RESERVED: number; - TYPE_BACK_FORWARD: number; - TYPE_NAVIGATE: number; -} - -interface SVGStopElement extends SVGElement, SVGStylable { - offset: SVGAnimatedNumber; -} -declare var SVGStopElement: { - prototype: SVGStopElement; - new (): SVGStopElement; -} - -interface PositionCallback { - (position: Position): void; -} - -interface SVGSymbolElement extends SVGElement, SVGStylable, SVGLangSpace, SVGFitToViewBox, SVGExternalResourcesRequired { -} -declare var SVGSymbolElement: { - prototype: SVGSymbolElement; - new (): SVGSymbolElement; -} - -interface SVGElementInstanceList { - length: number; - item(index: number): SVGElementInstance; -} -declare var SVGElementInstanceList: { - prototype: SVGElementInstanceList; - new (): SVGElementInstanceList; -} - -interface CSSRuleList { - length: number; - item(index: number): CSSRule; - [index: number]: CSSRule; -} -declare var CSSRuleList: { - prototype: CSSRuleList; - new (): CSSRuleList; -} - -interface MSDataBindingRecordSetExtensions { - recordset: Object; - namedRecordset(dataMember: string, hierarchy?: any): Object; -} - -interface LinkStyle { - styleSheet: StyleSheet; - sheet: StyleSheet; -} - -interface HTMLVideoElement extends HTMLMediaElement { - /** - * Gets or sets the width of the video element. - */ - width: number; - /** - * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoWidth: number; - /** - * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known. - */ - videoHeight: number; - /** - * Gets or sets the height of the video element. - */ - height: number; - /** - * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available. - */ - poster: string; -} -declare var HTMLVideoElement: { - prototype: HTMLVideoElement; - new (): HTMLVideoElement; -} - -interface ClientRectList { - length: number; - item(index: number): ClientRect; - [index: number]: ClientRect; -} -declare var ClientRectList: { - prototype: ClientRectList; - new (): ClientRectList; -} - -interface SVGMaskElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGTests, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - maskUnits: SVGAnimatedEnumeration; - maskContentUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; -} -declare var SVGMaskElement: { - prototype: SVGMaskElement; - new (): SVGMaskElement; -} - -interface External { -} -declare var External: { - prototype: External; - new (): External; -} - -declare var Audio: { new (src?: string): HTMLAudioElement; }; -declare var Option: { new (text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; }; -declare var Image: { new (width?: number, height?: number): HTMLImageElement; }; - -declare var ondragend: (ev: DragEvent) => any; -declare var onkeydown: (ev: KeyboardEvent) => any; -declare var ondragover: (ev: DragEvent) => any; -declare var onkeyup: (ev: KeyboardEvent) => any; -declare var onreset: (ev: Event) => any; -declare var onmouseup: (ev: MouseEvent) => any; -declare var ondragstart: (ev: DragEvent) => any; -declare var ondrag: (ev: DragEvent) => any; -declare var screenX: number; -declare var onmouseover: (ev: MouseEvent) => any; -declare var ondragleave: (ev: DragEvent) => any; -declare var history: History; -declare var pageXOffset: number; -declare var name: string; -declare var onafterprint: (ev: Event) => any; -declare var onpause: (ev: Event) => any; -declare var onbeforeprint: (ev: Event) => any; -declare var top: Window; -declare var onmousedown: (ev: MouseEvent) => any; -declare var onseeked: (ev: Event) => any; -declare var opener: Window; -declare var onclick: (ev: MouseEvent) => any; -declare var innerHeight: number; -declare var onwaiting: (ev: Event) => any; -declare var ononline: (ev: Event) => any; -declare var ondurationchange: (ev: Event) => any; -declare var frames: Window; -declare var onblur: (ev: FocusEvent) => any; -declare var onemptied: (ev: Event) => any; -declare var onseeking: (ev: Event) => any; -declare var oncanplay: (ev: Event) => any; -declare var outerWidth: number; -declare var onstalled: (ev: Event) => any; -declare var onmousemove: (ev: MouseEvent) => any; -declare var innerWidth: number; -declare var onoffline: (ev: Event) => any; -declare var length: number; -declare var screen: Screen; -declare var onbeforeunload: (ev: BeforeUnloadEvent) => any; -declare var onratechange: (ev: Event) => any; -declare var onstorage: (ev: StorageEvent) => any; -declare var onloadstart: (ev: Event) => any; -declare var ondragenter: (ev: DragEvent) => any; -declare var onsubmit: (ev: Event) => any; -declare var self: Window; -declare var document: Document; -declare var onprogress: (ev: any) => any; -declare var ondblclick: (ev: MouseEvent) => any; -declare var pageYOffset: number; -declare var oncontextmenu: (ev: MouseEvent) => any; -declare var onchange: (ev: Event) => any; -declare var onloadedmetadata: (ev: Event) => any; -declare var onplay: (ev: Event) => any; -declare var onerror: ErrorEventHandler; -declare var onplaying: (ev: Event) => any; -declare var parent: Window; -declare var location: Location; -declare var oncanplaythrough: (ev: Event) => any; -declare var onabort: (ev: UIEvent) => any; -declare var onreadystatechange: (ev: Event) => any; -declare var outerHeight: number; -declare var onkeypress: (ev: KeyboardEvent) => any; -declare var frameElement: Element; -declare var onloadeddata: (ev: Event) => any; -declare var onsuspend: (ev: Event) => any; -declare var window: Window; -declare var onfocus: (ev: FocusEvent) => any; -declare var onmessage: (ev: MessageEvent) => any; -declare var ontimeupdate: (ev: Event) => any; -declare var onresize: (ev: UIEvent) => any; -declare var onselect: (ev: UIEvent) => any; -declare var navigator: Navigator; -declare var styleMedia: StyleMedia; -declare var ondrop: (ev: DragEvent) => any; -declare var onmouseout: (ev: MouseEvent) => any; -declare var onended: (ev: Event) => any; -declare var onhashchange: (ev: Event) => any; -declare var onunload: (ev: Event) => any; -declare var onscroll: (ev: UIEvent) => any; -declare var screenY: number; -declare var onmousewheel: (ev: MouseWheelEvent) => any; -declare var onload: (ev: Event) => any; -declare var onvolumechange: (ev: Event) => any; -declare var oninput: (ev: Event) => any; -declare var performance: Performance; -declare function alert(message?: any): void; -declare function scroll(x?: number, y?: number): void; -declare function focus(): void; -declare function scrollTo(x?: number, y?: number): void; -declare function print(): void; -declare function prompt(message?: string, defaul?: string): string; -declare function toString(): string; -declare function open(url?: string, target?: string, features?: string, replace?: boolean): Window; -declare function scrollBy(x?: number, y?: number): void; -declare function confirm(message?: string): boolean; -declare function close(): void; -declare function postMessage(message: any, targetOrigin: string, ports?: any): void; -declare function showModalDialog(url?: string, argument?: any, options?: any): any; -declare function blur(): void; -declare function getSelection(): Selection; -declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration; -declare function removeEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -declare function dispatchEvent(evt: Event): boolean; -declare function attachEvent(event: string, listener: EventListener): boolean; -declare function detachEvent(event: string, listener: EventListener): void; -declare var localStorage: Storage; -declare var status: string; -declare var onmouseleave: (ev: MouseEvent) => any; -declare var screenLeft: number; -declare var offscreenBuffering: any; -declare var maxConnectionsPerServer: number; -declare var onmouseenter: (ev: MouseEvent) => any; -declare var clipboardData: DataTransfer; -declare var defaultStatus: string; -declare var clientInformation: Navigator; -declare var closed: boolean; -declare var onhelp: (ev: Event) => any; -declare var external: External; -declare var event: MSEventObj; -declare var onfocusout: (ev: FocusEvent) => any; -declare var screenTop: number; -declare var onfocusin: (ev: FocusEvent) => any; -declare function showModelessDialog(url?: string, argument?: any, options?: any): Window; -declare function navigate(url: string): void; -declare function resizeBy(x?: number, y?: number): void; -declare function item(index: any): any; -declare function resizeTo(x?: number, y?: number): void; -declare function createPopup(arguments?: any): MSPopupWindow; -declare function toStaticHTML(html: string): string; -declare function execScript(code: string, language?: string): any; -declare function msWriteProfilerMark(profilerMarkName: string): void; -declare function moveTo(x?: number, y?: number): void; -declare function moveBy(x?: number, y?: number): void; -declare function showHelp(url: string, helpArg?: any, features?: string): void; -declare var sessionStorage: Storage; -declare function clearTimeout(handle: number): void; -declare function setTimeout(handler: any, timeout?: any, ...args: any[]): number; -declare function clearInterval(handle: number): void; -declare function setInterval(handler: any, timeout?: any, ...args: any[]): number; - - -///////////////////////////// -/// IE10 DOM APIs -///////////////////////////// - - -interface ObjectURLOptions { - oneTimeOnly?: boolean; -} - -interface HTMLBodyElement { - onpopstate: (ev: PopStateEvent) => any; -} - -interface MSGestureEvent extends UIEvent { - offsetY: number; - translationY: number; - velocityExpansion: number; - velocityY: number; - velocityAngular: number; - translationX: number; - velocityX: number; - hwTimestamp: number; - offsetX: number; - screenX: number; - rotation: number; - expansion: number; - clientY: number; - screenY: number; - scale: number; - gestureObject: any; - clientX: number; - initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void; - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} -declare var MSGestureEvent: { - MSGESTURE_FLAG_BEGIN: number; - MSGESTURE_FLAG_END: number; - MSGESTURE_FLAG_CANCEL: number; - MSGESTURE_FLAG_INERTIA: number; - MSGESTURE_FLAG_NONE: number; -} - -interface HTMLAnchorElement { - /** - * Retrieves or sets the text of the object as a string. - */ - text: string; -} - -interface HTMLInputElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a FileList object on a file type input object. - */ - files: FileList; - /** - * Defines the maximum acceptable value for an input element with type="number".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field. - */ - max: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field. - */ - step: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Returns the input field value as a number. - */ - valueAsNumber: number; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Specifies the ID of a pre-defined datalist of options for an input element. - */ - list: HTMLElement; - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Defines the minimum acceptable value for an input element with type="number". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field. - */ - min: string; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Gets or sets a string containing a regular expression that the user's input must match. - */ - pattern: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list. - */ - multiple: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value. - * @param n Value to decrement the value by. - */ - stepDown(n?: number): void; - /** - * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value. - * @param n Value to increment the value by. - */ - stepUp(n?: number): void; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface ErrorEvent extends Event { - colno: number; - filename: string; - error: any; - lineno: number; - message: string; - initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void; -} - -interface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGStylable, SVGLangSpace, SVGURIReference, SVGExternalResourcesRequired { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - filterResX: SVGAnimatedInteger; - filterUnits: SVGAnimatedEnumeration; - primitiveUnits: SVGAnimatedEnumeration; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - filterResY: SVGAnimatedInteger; - setFilterRes(filterResX: number, filterResY: number): void; -} - -interface TrackEvent extends Event { - track: any; -} - -interface SVGFEMergeNodeElement extends SVGElement { - in1: SVGAnimatedString; -} - -interface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} - -interface MSGesture { - target: Element; - addPointer(pointerId: number): void; - stop(): void; -} -declare var MSGesture: { - prototype: MSGesture; - new (): MSGesture; -} - -interface TextTrackCue extends EventTarget { - onenter: (ev: Event) => any; - track: TextTrack; - endTime: number; - text: string; - pauseOnExit: boolean; - id: string; - startTime: number; - onexit: (ev: Event) => any; - getCueAsHTML(): DocumentFragment; -} -declare var TextTrackCue: { - prototype: TextTrackCue; - new (): TextTrackCue; -} - -interface MSStreamReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(stream: MSStream, size?: number): void; - readAsBlob(stream: MSStream, size?: number): void; - readAsDataURL(stream: MSStream, size?: number): void; - readAsText(stream: MSStream, encoding?: string, size?: number): void; -} -declare var MSStreamReader: { - prototype: MSStreamReader; - new (): MSStreamReader; -} - -interface DOMTokenList { - length: number; - contains(token: string): boolean; - remove(token: string): void; - toggle(token: string): boolean; - add(token: string): void; - item(index: number): string; - [index: number]: string; - toString(): string; -} - -interface EventException { - name: string; -} - -interface Performance { - now(): number; -} - -interface SVGFEFuncAElement extends SVGComponentTransferFunctionElement { -} - -interface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} - -interface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - mode: SVGAnimatedEnumeration; - in1: SVGAnimatedString; - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} -declare var SVGFEBlendElement: { - SVG_FEBLEND_MODE_DARKEN: number; - SVG_FEBLEND_MODE_UNKNOWN: number; - SVG_FEBLEND_MODE_MULTIPLY: number; - SVG_FEBLEND_MODE_NORMAL: number; - SVG_FEBLEND_MODE_SCREEN: number; - SVG_FEBLEND_MODE_LIGHTEN: number; -} - -interface WindowTimers extends WindowTimersExtension { -} - -interface CSSStyleDeclaration { - animationFillMode: string; - floodColor: string; - animationIterationCount: string; - textShadow: string; - backfaceVisibility: string; - msAnimationIterationCount: string; - animationDelay: string; - animationTimingFunction: string; - columnWidth: any; - msScrollSnapX: string; - columnRuleColor: any; - columnRuleWidth: any; - transitionDelay: string; - transition: string; - msFlowFrom: string; - msScrollSnapType: string; - msContentZoomSnapType: string; - msGridColumns: string; - msAnimationName: string; - msGridRowAlign: string; - msContentZoomChaining: string; - msGridColumn: any; - msHyphenateLimitZone: any; - msScrollRails: string; - msAnimationDelay: string; - enableBackground: string; - msWrapThrough: string; - columnRuleStyle: string; - msAnimation: string; - msFlexFlow: string; - msScrollSnapY: string; - msHyphenateLimitLines: any; - msTouchAction: string; - msScrollLimit: string; - animation: string; - transform: string; - filter: string; - colorInterpolationFilters: string; - transitionTimingFunction: string; - msBackfaceVisibility: string; - animationPlayState: string; - transformOrigin: string; - msScrollLimitYMin: any; - msFontFeatureSettings: string; - msContentZoomLimitMin: any; - columnGap: any; - transitionProperty: string; - msAnimationDuration: string; - msAnimationFillMode: string; - msFlexDirection: string; - msTransitionDuration: string; - fontFeatureSettings: string; - breakBefore: string; - msFlexWrap: string; - perspective: string; - msFlowInto: string; - msTransformStyle: string; - msScrollTranslation: string; - msTransitionProperty: string; - msUserSelect: string; - msOverflowStyle: string; - msScrollSnapPointsY: string; - animationDirection: string; - animationDuration: string; - msFlex: string; - msTransitionTimingFunction: string; - animationName: string; - columnRule: string; - msGridColumnSpan: any; - msFlexNegative: string; - columnFill: string; - msGridRow: any; - msFlexOrder: string; - msFlexItemAlign: string; - msFlexPositive: string; - msContentZoomLimitMax: any; - msScrollLimitYMax: any; - msGridColumnAlign: string; - perspectiveOrigin: string; - lightingColor: string; - columns: string; - msScrollChaining: string; - msHyphenateLimitChars: string; - msTouchSelect: string; - floodOpacity: string; - msAnimationDirection: string; - msAnimationPlayState: string; - columnSpan: string; - msContentZooming: string; - msPerspective: string; - msFlexPack: string; - msScrollSnapPointsX: string; - msContentZoomSnapPoints: string; - msGridRowSpan: any; - msContentZoomSnap: string; - msScrollLimitXMin: any; - breakInside: string; - msHighContrastAdjust: string; - msFlexLinePack: string; - msGridRows: string; - transitionDuration: string; - msHyphens: string; - breakAfter: string; - msTransition: string; - msPerspectiveOrigin: string; - msContentZoomLimit: string; - msScrollLimitXMax: any; - msFlexAlign: string; - msWrapMargin: any; - columnCount: any; - msAnimationTimingFunction: string; - msTransitionDelay: string; - transformStyle: string; - msWrapFlow: string; - msFlexPreferredSize: string; -} - -interface MessageChannel { - port2: MessagePort; - port1: MessagePort; -} -declare var MessageChannel: { - prototype: MessageChannel; - new (): MessageChannel; -} - -interface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { -} - -interface Navigator extends MSFileSaver { - msMaxTouchPoints: number; - msPointerEnabled: boolean; - msManipulationViewsEnabled: boolean; - msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void; -} - -interface TransitionEvent extends Event { - propertyName: string; - elapsedTime: number; - initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void; -} - -interface MediaQueryList { - matches: boolean; - media: string; - addListener(listener: MediaQueryListListener): void; - removeListener(listener: MediaQueryListListener): void; -} - -interface DOMError { - name: string; - toString(): string; -} - -interface CloseEvent extends Event { - wasClean: boolean; - reason: string; - code: number; - initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void; -} - -interface WebSocket extends EventTarget { - protocol: string; - readyState: number; - bufferedAmount: number; - onopen: (ev: Event) => any; - extensions: string; - onmessage: (ev: any) => any; - onclose: (ev: CloseEvent) => any; - onerror: (ev: ErrorEvent) => any; - binaryType: string; - url: string; - close(code?: number, reason?: string): void; - send(data: any): void; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} -declare var WebSocket: { - prototype: WebSocket; - new (url: string): WebSocket; - new (url: string, prototcol: string): WebSocket; - new (url: string, prototcol: string[]): WebSocket; - OPEN: number; - CLOSING: number; - CONNECTING: number; - CLOSED: number; -} - -interface SVGFEPointLightElement extends SVGElement { - y: SVGAnimatedNumber; - x: SVGAnimatedNumber; - z: SVGAnimatedNumber; -} - -interface ProgressEvent extends Event { - loaded: number; - lengthComputable: boolean; - total: number; - initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void; -} - -interface IDBObjectStore { - indexNames: DOMStringList; - name: string; - transaction: IDBTransaction; - keyPath: string; - count(key?: any): IDBRequest; - add(value: any, key?: any): IDBRequest; - clear(): IDBRequest; - createIndex(name: string, keyPath: string, optionalParameters?: any): IDBIndex; - put(value: any, key?: any): IDBRequest; - openCursor(range?: any, direction?: string): IDBRequest; - deleteIndex(indexName: string): void; - index(name: string): IDBIndex; - get(key: any): IDBRequest; - delete(key: any): IDBRequest; -} - -interface HTMLCanvasElement { - /** - * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing. - */ - msToBlob(): Blob; -} - -interface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - stdDeviationX: SVGAnimatedNumber; - in1: SVGAnimatedString; - stdDeviationY: SVGAnimatedNumber; - setStdDeviation(stdDeviationX: number, stdDeviationY: number): void; -} - -interface SVGFilterPrimitiveStandardAttributes extends SVGStylable { - y: SVGAnimatedLength; - width: SVGAnimatedLength; - x: SVGAnimatedLength; - height: SVGAnimatedLength; - result: SVGAnimatedString; -} - -interface Element { - msRegionOverflow: string; - onmspointerdown: (ev: any) => any; - onmsgotpointercapture: (ev: any) => any; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - onmslostpointercapture: (ev: any) => any; - onmspointerover: (ev: any) => any; - msContentZoomFactor: number; - onmspointerup: (ev: any) => any; - msGetRegionContent(): MSRangeCollection; - msReleasePointerCapture(pointerId: number): void; - msSetPointerCapture(pointerId: number): void; -} - -interface IDBVersionChangeEvent extends Event { - newVersion: number; - oldVersion: number; -} - -interface IDBIndex { - unique: boolean; - name: string; - keyPath: string; - objectStore: IDBObjectStore; - count(key?: any): IDBRequest; - getKey(key: any): IDBRequest; - openKeyCursor(range?: IDBKeyRange, direction?: string): IDBRequest; - get(key: any): IDBRequest; - openCursor(range?: IDBKeyRange, direction?: string): IDBRequest; -} - -interface WheelEvent { - getCurrentPoint(element: Element): void; -} - -interface FileList { - length: number; - item(index: number): File; - [index: number]: File; -} - -interface IDBCursor { - source: any; - direction: string; - key: any; - primaryKey: any; - advance(count: number): void; - delete(): IDBRequest; - continue(key?: any): void; - update(value: any): IDBRequest; -} - -interface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - specularConstant: SVGAnimatedNumber; -} - -interface File extends Blob { - lastModifiedDate: any; - name: string; -} - -interface URL { - revokeObjectURL(url: string): void; - createObjectURL(object: any, options?: ObjectURLOptions): string; -} -declare var URL: URL; - -interface RangeException { - name: string; -} - -interface IDBCursorWithValue extends IDBCursor { - value: any; -} - -interface HTMLTextAreaElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Sets or retrieves the maximum number of characters that the user can enter in a text control. - */ - maxLength: number; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field. - */ - placeholder: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface XMLHttpRequestEventTarget extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: any) => any; - ontimeout: (ev: any) => any; - onabort: (ev: any) => any; - onloadstart: (ev: any) => any; - onloadend: (ev: ProgressEvent) => any; -} - -interface IDBEnvironment { - msIndexedDB: IDBFactory; - indexedDB: IDBFactory; -} - -interface AudioTrackList extends EventTarget { - length: number; - onchange: (ev: any) => any; - onaddtrack: (ev: TrackEvent) => any; - getTrackById(id: string): AudioTrack; - item(index: number): AudioTrack; - [index: number]: AudioTrack; -} - -interface MSBaseReader extends EventTarget { - onprogress: (ev: ProgressEvent) => any; - readyState: number; - onabort: (ev: any) => any; - onloadend: (ev: ProgressEvent) => any; - onerror: (ev: ErrorEvent) => any; - onload: (ev: any) => any; - onloadstart: (ev: any) => any; - result: any; - abort(): void; - LOADING: number; - EMPTY: number; - DONE: number; -} - -interface History { - state: any; - replaceState(statedata: any, title: string, url?: string): void; - pushState(statedata: any, title: string, url?: string): void; -} - -interface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - radiusX: SVGAnimatedNumber; - radiusY: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} -declare var SVGFEMorphologyElement: { - SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number; - SVG_MORPHOLOGY_OPERATOR_ERODE: number; - SVG_MORPHOLOGY_OPERATOR_DILATE: number; -} - -interface HTMLSelectElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * When present, marks an element that can't be submitted without a value. - */ - required: boolean; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface CSSRule { - KEYFRAMES_RULE: number; - KEYFRAME_RULE: number; - VIEWPORT_RULE: number; -} -//declare var CSSRule: { -// KEYFRAMES_RULE: number; -// KEYFRAME_RULE: number; -// VIEWPORT_RULE: number; -//} - -interface SVGFEFuncRElement extends SVGComponentTransferFunctionElement { -} - -interface WindowTimersExtension { - msSetImmediate(expression: any, ...args: any[]): number; - clearImmediate(handle: number): void; - msClearImmediate(handle: number): void; - setImmediate(expression: any, ...args: any[]): number; -} - -interface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in2: SVGAnimatedString; - xChannelSelector: SVGAnimatedEnumeration; - yChannelSelector: SVGAnimatedEnumeration; - scale: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} -declare var SVGFEDisplacementMapElement: { - SVG_CHANNEL_B: number; - SVG_CHANNEL_R: number; - SVG_CHANNEL_G: number; - SVG_CHANNEL_UNKNOWN: number; - SVG_CHANNEL_A: number; -} - -interface AnimationEvent extends Event { - animationName: string; - elapsedTime: number; - initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void; -} - -interface SVGComponentTransferFunctionElement extends SVGElement { - tableValues: SVGAnimatedNumberList; - slope: SVGAnimatedNumber; - type: SVGAnimatedEnumeration; - exponent: SVGAnimatedNumber; - amplitude: SVGAnimatedNumber; - intercept: SVGAnimatedNumber; - offset: SVGAnimatedNumber; - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} -declare var SVGComponentTransferFunctionElement: { - SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number; - SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number; - SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number; - SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number; - SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number; - SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number; -} - -interface MSRangeCollection { - length: number; - item(index: number): Range; - [index: number]: Range; -} - -interface SVGFEDistantLightElement extends SVGElement { - azimuth: SVGAnimatedNumber; - elevation: SVGAnimatedNumber; -} - -interface SVGException { - name: string; -} - -interface SVGFEFuncBElement extends SVGComponentTransferFunctionElement { -} - -interface IDBKeyRange { - upper: any; - upperOpen: boolean; - lower: any; - lowerOpen: boolean; - bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange; - only(value: any): IDBKeyRange; - lowerBound(bound: any, open?: boolean): IDBKeyRange; - upperBound(bound: any, open?: boolean): IDBKeyRange; -} - -interface WindowConsole { - console: Console; -} - -interface IDBTransaction extends EventTarget { - oncomplete: (ev: Event) => any; - db: IDBDatabase; - mode: string; - error: DOMError; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - abort(): void; - objectStore(name: string): IDBObjectStore; -} - -interface AudioTrack { - kind: string; - language: string; - id: string; - label: string; - enabled: boolean; -} - -interface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - orderY: SVGAnimatedInteger; - kernelUnitLengthY: SVGAnimatedNumber; - orderX: SVGAnimatedInteger; - preserveAlpha: SVGAnimatedBoolean; - kernelMatrix: SVGAnimatedNumberList; - edgeMode: SVGAnimatedEnumeration; - kernelUnitLengthX: SVGAnimatedNumber; - bias: SVGAnimatedNumber; - targetX: SVGAnimatedInteger; - targetY: SVGAnimatedInteger; - divisor: SVGAnimatedNumber; - in1: SVGAnimatedString; - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} -declare var SVGFEConvolveMatrixElement: { - SVG_EDGEMODE_WRAP: number; - SVG_EDGEMODE_DUPLICATE: number; - SVG_EDGEMODE_UNKNOWN: number; - SVG_EDGEMODE_NONE: number; -} - -interface TextTrackCueList { - length: number; - item(index: number): TextTrackCue; - [index: number]: TextTrackCue; - getCueById(id: string): TextTrackCue; -} - -interface CSSKeyframesRule extends CSSRule { - name: string; - cssRules: CSSRuleList; - findRule(rule: string): CSSKeyframeRule; - deleteRule(rule: string): void; - appendRule(rule: string): void; -} - -interface Window extends WindowBase64, IDBEnvironment, WindowConsole { - onmspointerdown: (ev: any) => any; - animationStartTime: number; - onmsgesturedoubletap: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - msAnimationStartTime: number; - applicationCache: ApplicationCache; - onmsinertiastart: (ev: any) => any; - onmspointerover: (ev: any) => any; - onpopstate: (ev: PopStateEvent) => any; - onmspointerup: (ev: any) => any; - msCancelRequestAnimationFrame(handle: number): void; - matchMedia(mediaQuery: string): MediaQueryList; - cancelAnimationFrame(handle: number): void; - msIsStaticHTML(html: string): boolean; - msMatchMedia(mediaQuery: string): MediaQueryList; - requestAnimationFrame(callback: FrameRequestCallback): number; - msRequestAnimationFrame(callback: FrameRequestCallback): number; -} - -interface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - baseFrequencyX: SVGAnimatedNumber; - numOctaves: SVGAnimatedInteger; - type: SVGAnimatedEnumeration; - baseFrequencyY: SVGAnimatedNumber; - stitchTiles: SVGAnimatedEnumeration; - seed: SVGAnimatedNumber; - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} -declare var SVGFETurbulenceElement: { - SVG_STITCHTYPE_UNKNOWN: number; - SVG_STITCHTYPE_NOSTITCH: number; - SVG_TURBULENCE_TYPE_UNKNOWN: number; - SVG_TURBULENCE_TYPE_TURBULENCE: number; - SVG_TURBULENCE_TYPE_FRACTALNOISE: number; - SVG_STITCHTYPE_STITCH: number; -} - -interface TextTrackList { - length: number; - item(index: number): TextTrack; - [index: number]: TextTrack; -} - -interface SVGFEFuncGElement extends SVGComponentTransferFunctionElement { -} - -interface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; - type: SVGAnimatedEnumeration; - values: SVGAnimatedNumberList; - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} -declare var SVGFEColorMatrixElement: { - SVG_FECOLORMATRIX_TYPE_SATURATE: number; - SVG_FECOLORMATRIX_TYPE_UNKNOWN: number; - SVG_FECOLORMATRIX_TYPE_MATRIX: number; - SVG_FECOLORMATRIX_TYPE_HUEROTATE: number; - SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number; -} - -interface Console { - info(message?: any, ...optionalParams: any[]): void; - profile(reportName?: string): void; - assert(test?: boolean, message?: string, ...optionalParams: any[]): void; - msIsIndependentlyComposed(element: Element): boolean; - clear(): void; - dir(value?: any, ...optionalParams: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - profileEnd(): void; -} - -interface SVGFESpotLightElement extends SVGElement { - pointsAtY: SVGAnimatedNumber; - y: SVGAnimatedNumber; - limitingConeAngle: SVGAnimatedNumber; - specularExponent: SVGAnimatedNumber; - x: SVGAnimatedNumber; - pointsAtZ: SVGAnimatedNumber; - z: SVGAnimatedNumber; - pointsAtX: SVGAnimatedNumber; -} - -interface HTMLImageElement { - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} - -interface WindowBase64 { - btoa(rawString: string): string; - atob(encodedString: string): string; -} - -interface IDBDatabase extends EventTarget { - version: string; - name: string; - objectStoreNames: DOMStringList; - onerror: (ev: ErrorEvent) => any; - onabort: (ev: any) => any; - createObjectStore(name: string, optionalParameters?: any): IDBObjectStore; - close(): void; - transaction(storeNames: any, mode?: string): IDBTransaction; - deleteObjectStore(name: string): void; -} - -interface DOMStringList { - length: number; - contains(str: string): boolean; - item(index: number): string; - [index: number]: string; -} - -interface HTMLButtonElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Overrides the target attribute on a form element. - */ - formTarget: string; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Overrides the action attribute (where the data on a form is sent) on the parent form element. - */ - formAction: string; - /** - * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing. - */ - autofocus: boolean; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a "save draft"-type submit option. - */ - formNoValidate: string; - /** - * Used to override the encoding (formEnctype attribute) specified on the form element. - */ - formEnctype: string; - /** - * Overrides the submit method attribute previously specified on a form element. - */ - formMethod: string; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface IDBOpenDBRequest extends IDBRequest { - onupgradeneeded: (ev: IDBVersionChangeEvent) => any; - onblocked: (ev: Event) => any; -} - -interface HTMLProgressElement extends HTMLElement { - /** - * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value. - */ - value: number; - /** - * Defines the maximum, or "done" value for a progress element. - */ - max: number; - /** - * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar). - */ - position: number; - /** - * Retrieves a reference to the form that the object is embedded in. - */ - form: HTMLFormElement; -} - -interface MSLaunchUriCallback { - (): void; -} - -interface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - dy: SVGAnimatedNumber; - in1: SVGAnimatedString; - dx: SVGAnimatedNumber; -} - -interface HTMLFormElement { - /** - * Specifies whether autocomplete is applied to an editable text field. - */ - autocomplete: string; - /** - * Designates a form that is not validated when submitted. - */ - noValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; -} - -interface MSUnsafeFunctionCallback { - (): any; -} - -interface Document { - onmspointerdown: (ev: any) => any; - msHidden: boolean; - msVisibilityState: string; - onmsgesturedoubletap: (ev: any) => any; - visibilityState: string; - onmsmanipulationstatechanged: (ev: any) => any; - onmspointerhover: (ev: any) => any; - onmscontentzoom: (ev: any) => any; - onmspointermove: (ev: any) => any; - onmsgesturehold: (ev: any) => any; - onmsgesturechange: (ev: any) => any; - onmsgesturestart: (ev: any) => any; - onmspointercancel: (ev: any) => any; - onmsgestureend: (ev: any) => any; - onmsgesturetap: (ev: any) => any; - onmspointerout: (ev: any) => any; - onmsinertiastart: (ev: any) => any; - msCSSOMElementFloatMetrics: boolean; - onmspointerover: (ev: any) => any; - hidden: boolean; - onmspointerup: (ev: any) => any; - msElementsFromPoint(x: number, y: number): NodeList; - msElementsFromRect(left: number, top: number, width: number, height: number): NodeList; - clear(): void; -} - -interface MessageEvent extends Event { - ports: any; -} - -interface HTMLScriptElement { - async: boolean; -} - -interface HTMLMediaElement { - /** - * Specifies the purpose of the audio or video media, such as background audio or alerts. - */ - msAudioCategory: string; - /** - * Specifies whether or not to enable low-latency playback on the media element. - */ - msRealTime: boolean; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - textTracks: TextTrackList; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - /** - * Returns an AudioTrackList object with the audio tracks for a given video element. - */ - audioTracks: AudioTrackList; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; - /** - * Specifies the output device id that the audio will be sent to. - */ - msAudioDeviceType: string; - /** - * Clears all effects from the media pipeline. - */ - msClearEffects(): void; - /** - * Specifies the media protection manager for a given media pipeline. - */ - msSetMediaProtectionManager(mediaProtectionManager?: any): void; - /** - * Inserts the specified audio effect into media pipeline. - */ - msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; -} - -interface TextTrack extends EventTarget { - language: string; - mode: any; - readyState: number; - activeCues: TextTrackCueList; - cues: TextTrackCueList; - oncuechange: (ev: Event) => any; - kind: string; - onload: (ev: any) => any; - onerror: (ev: ErrorEvent) => any; - label: string; - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} -declare var TextTrack: { - ERROR: number; - SHOWING: number; - LOADING: number; - LOADED: number; - NONE: number; - HIDDEN: number; - DISABLED: number; -} - -interface MediaQueryListListener { - (mql: MediaQueryList): void; -} - -interface IDBRequest extends EventTarget { - source: any; - onsuccess: (ev: Event) => any; - error: DOMError; - transaction: IDBTransaction; - onerror: (ev: ErrorEvent) => any; - readyState: string; - result: any; -} - -interface MessagePort extends EventTarget { - onmessage: (ev: any) => any; - close(): void; - postMessage(message?: any, ports?: any): void; - start(): void; -} - -interface FileReader extends MSBaseReader { - error: DOMError; - readAsArrayBuffer(blob: Blob): void; - readAsDataURL(blob: Blob): void; - readAsText(blob: Blob, encoding?: string): void; -} -declare var FileReader: { - prototype: FileReader; - new (): FileReader; -} - -interface BlobPropertyBag { - type?: string; - endings?: string; -} - -interface Blob { - type: string; - size: number; - msDetachStream(): any; - slice(start?: number, end?: number, contentType?: string): Blob; - msClose(): void; -} -declare var Blob: { - prototype: Blob; - new (blobParts?: any[], options?: BlobPropertyBag): Blob; -} - -interface ApplicationCache extends EventTarget { - status: number; - ondownloading: (ev: Event) => any; - onprogress: (ev: ProgressEvent) => any; - onupdateready: (ev: Event) => any; - oncached: (ev: Event) => any; - onobsolete: (ev: Event) => any; - onerror: (ev: ErrorEvent) => any; - onchecking: (ev: Event) => any; - onnoupdate: (ev: Event) => any; - swapCache(): void; - abort(): void; - update(): void; - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; -} -declare var ApplicationCache: { - CHECKING: number; - UNCACHED: number; - UPDATEREADY: number; - DOWNLOADING: number; - IDLE: number; - OBSOLETE: number; -} - -interface FrameRequestCallback { - (time: number): void; -} - -interface XMLHttpRequest { - response: any; - withCredentials: boolean; - onprogress: (ev: ProgressEvent) => any; - onabort: (ev: any) => any; - responseType: string; - onloadend: (ev: ProgressEvent) => any; - upload: XMLHttpRequestEventTarget; - onerror: (ev: ErrorEvent) => any; - onloadstart: (ev: any) => any; -} - -interface PopStateEvent extends Event { - state: any; - initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void; -} - -interface CSSKeyframeRule extends CSSRule { - keyText: string; - style: CSSStyleDeclaration; -} - -interface MSFileSaver { - msSaveBlob(blob: any, defaultName?: string): boolean; - msSaveOrOpenBlob(blob: any, defaultName?: string): boolean; -} - -interface MSStream { - type: string; - msDetachStream(): any; - msClose(): void; -} - -interface MediaError { - msExtendedCode: number; -} - -interface HTMLFieldSetElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface MSBlobBuilder { - append(data: any, endings?: string): void; - getBlob(contentType?: string): Blob; -} -declare var MSBlobBuilder: { - prototype: MSBlobBuilder; - new (): MSBlobBuilder; -} - -interface HTMLElement { - onmscontentzoom: (ev: any) => any; - oncuechange: (ev: Event) => any; - spellcheck: boolean; - classList: DOMTokenList; - onmsmanipulationstatechanged: (ev: any) => any; - draggable: boolean; -} - -interface DataTransfer { - types: DOMStringList; - files: FileList; -} - -interface DOMSettableTokenList extends DOMTokenList { - value: string; -} - -interface IDBFactory { - open(name: string, version?: number): IDBOpenDBRequest; - cmp(first: any, second: any): number; - deleteDatabase(name: string): IDBOpenDBRequest; -} - -interface Range { - createContextualFragment(fragment: string): DocumentFragment; -} - -interface HTMLObjectElement { - /** - * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as "this is a required field". The result is that the user sees validation messages without actually submitting. - */ - validationMessage: string; - /** - * Returns a ValidityState object that represents the validity states of an element. - */ - validity: ValidityState; - /** - * Returns whether an element will successfully validate based on forms validation rules and constraints. - */ - willValidate: boolean; - /** - * Returns whether a form will validate when it is submitted, without having to submit it. - */ - checkValidity(): boolean; - /** - * Sets a custom error message that is displayed when a form is submitted. - * @param error Sets a custom error message that is displayed when a form is submitted. - */ - setCustomValidity(error: string): void; -} - -interface MSPointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} -declare var MSPointerEvent: { - MSPOINTER_TYPE_PEN: number; - MSPOINTER_TYPE_MOUSE: number; - MSPOINTER_TYPE_TOUCH: number; -} - -interface DOMException { - name: string; - INVALID_NODE_TYPE_ERR: number; - DATA_CLONE_ERR: number; - TIMEOUT_ERR: number; -} -//declare var DOMException: { -// INVALID_NODE_TYPE_ERR: number; -// DATA_CLONE_ERR: number; -// TIMEOUT_ERR: number; -//} - -interface MSManipulationEvent extends UIEvent { - lastState: number; - currentState: number; - initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void; - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; -} -declare var MSManipulationEvent: { - MS_MANIPULATION_STATE_STOPPED: number; - MS_MANIPULATION_STATE_ACTIVE: number; - MS_MANIPULATION_STATE_INERTIA: number; -} - -interface FormData { - append(name: any, value: any, blobName?: string): void; -} -declare var FormData: { - prototype: FormData; - new (form?: HTMLFormElement): FormData; -} - -interface HTMLDataListElement extends HTMLElement { - options: HTMLCollection; -} - -interface SVGFEImageElement extends SVGElement, SVGLangSpace, SVGFilterPrimitiveStandardAttributes, SVGURIReference, SVGExternalResourcesRequired { - preserveAspectRatio: SVGAnimatedPreserveAspectRatio; -} - -interface AbstractWorker extends EventTarget { - onerror: (ev: ErrorEvent) => any; -} - -interface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - operator: SVGAnimatedEnumeration; - in2: SVGAnimatedString; - k2: SVGAnimatedNumber; - k1: SVGAnimatedNumber; - k3: SVGAnimatedNumber; - in1: SVGAnimatedString; - k4: SVGAnimatedNumber; - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} -declare var SVGFECompositeElement: { - SVG_FECOMPOSITE_OPERATOR_OUT: number; - SVG_FECOMPOSITE_OPERATOR_OVER: number; - SVG_FECOMPOSITE_OPERATOR_XOR: number; - SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number; - SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number; - SVG_FECOMPOSITE_OPERATOR_IN: number; - SVG_FECOMPOSITE_OPERATOR_ATOP: number; -} - -interface ValidityState { - customError: boolean; - valueMissing: boolean; - stepMismatch: boolean; - rangeUnderflow: boolean; - rangeOverflow: boolean; - typeMismatch: boolean; - patternMismatch: boolean; - tooLong: boolean; - valid: boolean; -} - -interface HTMLTrackElement extends HTMLElement { - kind: string; - src: string; - srclang: string; - track: TextTrack; - label: string; - default: boolean; -} - -interface MSApp { - createFileFromStorageFile(storageFile: any): File; - createBlobFromRandomAccessStream(type: string, seeker: any): Blob; - createStreamFromInputStream(type: string, inputStream: any): MSStream; - terminateApp(exceptionObject: any): void; - createDataPackage(object: any): any; - execUnsafeLocalFunction(unsafeFunction: MSUnsafeFunctionCallback): any; - getHtmlPrintDocumentSource(htmlDoc: any): any; - addPublicLocalApplicationUri(uri: string): void; - createDataPackageFromSelection(): any; -} -declare var MSApp: MSApp; - -interface HTMLVideoElement { - msIsStereo3D: boolean; - msStereo3DPackingMode: string; - onMSVideoOptimalLayoutChanged: (ev: any) => any; - onMSVideoFrameStepCompleted: (ev: any) => any; - msStereo3DRenderMode: string; - msIsLayoutOptimalForPlayback: boolean; - msHorizontalMirror: boolean; - onMSVideoFormatChanged: (ev: any) => any; - msZoom: boolean; - msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void; - msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void; - msFrameStep(forward: boolean): void; -} - -interface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - in1: SVGAnimatedString; -} - -interface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes { - kernelUnitLengthY: SVGAnimatedNumber; - surfaceScale: SVGAnimatedNumber; - in1: SVGAnimatedString; - kernelUnitLengthX: SVGAnimatedNumber; - diffuseConstant: SVGAnimatedNumber; -} - -interface MSCSSMatrix { - m24: number; - m34: number; - a: number; - d: number; - m32: number; - m41: number; - m11: number; - f: number; - e: number; - m23: number; - m14: number; - m33: number; - m22: number; - m21: number; - c: number; - m12: number; - b: number; - m42: number; - m31: number; - m43: number; - m13: number; - m44: number; - multiply(secondMatrix: MSCSSMatrix): MSCSSMatrix; - skewY(angle: number): MSCSSMatrix; - setMatrixValue(value: string): void; - inverse(): MSCSSMatrix; - rotateAxisAngle(x: number, y: number, z: number, angle: number): MSCSSMatrix; - toString(): string; - rotate(angleX: number, angleY?: number, angleZ?: number): MSCSSMatrix; - translate(x: number, y: number, z?: number): MSCSSMatrix; - scale(scaleX: number, scaleY?: number, scaleZ?: number): MSCSSMatrix; - skewX(angle: number): MSCSSMatrix; -} -declare var MSCSSMatrix: { - prototype: MSCSSMatrix; - new (text?: string): MSCSSMatrix; -} - -interface Worker extends AbstractWorker { - onmessage: (ev: any) => any; - postMessage(message: any, ports?: any): void; - terminate(): void; -} -declare var Worker: { - prototype: Worker; - new (stringUrl: string): Worker; -} - -interface HTMLIFrameElement { - sandbox: DOMSettableTokenList; -} - -declare var onmspointerdown: (ev: any) => any; -declare var animationStartTime: number; -declare var onmsgesturedoubletap: (ev: any) => any; -declare var onmspointerhover: (ev: any) => any; -declare var onmsgesturehold: (ev: any) => any; -declare var onmspointermove: (ev: any) => any; -declare var onmsgesturechange: (ev: any) => any; -declare var onmsgesturestart: (ev: any) => any; -declare var onmspointercancel: (ev: any) => any; -declare var onmsgestureend: (ev: any) => any; -declare var onmsgesturetap: (ev: any) => any; -declare var onmspointerout: (ev: any) => any; -declare var msAnimationStartTime: number; -declare var applicationCache: ApplicationCache; -declare var onmsinertiastart: (ev: any) => any; -declare var onmspointerover: (ev: any) => any; -declare var onpopstate: (ev: PopStateEvent) => any; -declare var onmspointerup: (ev: any) => any; -declare function msCancelRequestAnimationFrame(handle: number): void; -declare function matchMedia(mediaQuery: string): MediaQueryList; -declare function cancelAnimationFrame(handle: number): void; -declare function msIsStaticHTML(html: string): boolean; -declare function msMatchMedia(mediaQuery: string): MediaQueryList; -declare function requestAnimationFrame(callback: FrameRequestCallback): number; -declare function msRequestAnimationFrame(callback: FrameRequestCallback): number; -declare function btoa(rawString: string): string; -declare function atob(encodedString: string): string; -declare var msIndexedDB: IDBFactory; -declare var indexedDB: IDBFactory; -declare var console: Console; - - -///////////////////////////// -/// IE11 DOM APIs -///////////////////////////// - - -interface StoreExceptionsInformation extends ExceptionInformation { - siteName?: string; - explanationString?: string; - detailURI?: string; -} - -interface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation { - arrayOfDomainStrings?: Array; -} - -interface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation { - arrayOfDomainStrings?: Array; -} - -interface AlgorithmParameters { -} - -interface MutationObserverInit { - childList?: boolean; - attributes?: boolean; - characterData?: boolean; - subtree?: boolean; - attributeOldValue?: boolean; - characterDataOldValue?: boolean; - attributeFilter?: Array; -} - -interface ExceptionInformation { - domain?: string; -} - -interface MsZoomToOptions { - contentX?: number; - contentY?: number; - viewportX?: string; - viewportY?: string; - scaleFactor?: number; - animate?: string; -} - -interface DeviceAccelerationDict { - x?: number; - y?: number; - z?: number; -} - -interface DeviceRotationRateDict { - alpha?: number; - beta?: number; - gamma?: number; -} - -interface Algorithm { - name?: string; - params?: AlgorithmParameters; -} - -interface NavigatorID { - product: string; - vendor: string; -} - -interface HTMLBodyElement { - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; -} - -interface MSExecAtPriorityFunctionCallback { - (...args: any[]): any; -} - -interface MSWindowExtensions { - captureEvents(): void; - releaseEvents(): void; -} - -interface MSGraphicsTrust { - status: string; - constrictionActive: boolean; -} - -interface AudioTrack { - sourceBuffer: SourceBuffer; -} - -interface DragEvent { - msConvertURL(file: File, targetType: string, targetURL?: string): void; -} - -interface SubtleCrypto { - unwrapKey(wrappedKey: ArrayBufferView, keyAlgorithm: any, keyEncryptionKey: Key, extractable?: boolean, keyUsages?: string[]): KeyOperation; - encrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - importKey(format: string, keyData: ArrayBufferView, algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - wrapKey(key: Key, keyEncryptionKey: Key, keyWrappingAlgorithm: any): KeyOperation; - verify(algorithm: any, key: Key, signature: ArrayBufferView, buffer?: ArrayBufferView): CryptoOperation; - deriveKey(algorithm: any, baseKey: Key, derivedKeyType: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - digest(algorithm: any, buffer?: ArrayBufferView): CryptoOperation; - exportKey(format: string, key: Key): KeyOperation; - generateKey(algorithm: any, extractable?: boolean, keyUsages?: string[]): KeyOperation; - sign(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; - decrypt(algorithm: any, key: Key, buffer?: ArrayBufferView): CryptoOperation; -} - -interface Crypto extends RandomSource { - subtle: SubtleCrypto; -} - -interface VideoPlaybackQuality { - totalFrameDelay: number; - creationTime: number; - totalVideoFrames: number; - droppedVideoFrames: number; -} - -interface GlobalEventHandlers { - onpointerenter: (ev: PointerEvent) => any; - onpointerout: (ev: PointerEvent) => any; - onpointerdown: (ev: PointerEvent) => any; - onpointerup: (ev: PointerEvent) => any; - onpointercancel: (ev: PointerEvent) => any; - onpointerover: (ev: PointerEvent) => any; - onpointermove: (ev: PointerEvent) => any; - onpointerleave: (ev: PointerEvent) => any; -} - -interface Window extends GlobalEventHandlers { - onpageshow: (ev: PageTransitionEvent) => any; - ondevicemotion: (ev: DeviceMotionEvent) => any; - devicePixelRatio: number; - msCrypto: Crypto; - ondeviceorientation: (ev: DeviceOrientationEvent) => any; - doNotTrack: string; - onmspointerenter: (ev: any) => any; - onpagehide: (ev: PageTransitionEvent) => any; - onmspointerleave: (ev: any) => any; -} - -interface Key { - algorithm: Algorithm; - type: string; - extractable: boolean; - keyUsage: string[]; -} - -interface TextTrackList extends EventTarget { - onaddtrack: (ev: any) => any; -} - -interface DeviceAcceleration { - y: number; - x: number; - z: number; -} - -interface Console { - count(countTitle?: string): void; - groupEnd(): void; - time(timerName?: string): void; - timeEnd(timerName?: string): void; - trace(): void; - group(groupTitle?: string): void; - dirxml(value: any): void; - debug(message?: string, ...optionalParams: any[]): void; - groupCollapsed(groupTitle?: string): void; - select(element: Element): void; -} - -interface MSNavigatorDoNotTrack { - removeSiteSpecificTrackingException(args: ExceptionInformation): void; - removeWebWideTrackingException(args: ExceptionInformation): void; - storeWebWideTrackingException(args: StoreExceptionsInformation): void; - storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void; - confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean; - confirmWebWideTrackingException(args: ExceptionInformation): boolean; -} - -interface HTMLImageElement { - crossOrigin: string; - msPlayToPreferredSourceUri: string; -} - -interface HTMLAllCollection extends HTMLCollection { - namedItem(name: string): Element; - //[name: string]: Element; -} - -interface MSNavigatorExtensions { - language: string; -} - -interface AesGcmEncryptResult { - ciphertext: ArrayBuffer; - tag: ArrayBuffer; -} - -interface HTMLSourceElement { - msKeySystem: string; -} - -interface CSSStyleDeclaration { - alignItems: string; - borderImageSource: string; - flexBasis: string; - borderImageWidth: string; - borderImageRepeat: string; - order: string; - flex: string; - alignContent: string; - msImeAlign: string; - flexShrink: string; - flexGrow: string; - borderImageSlice: string; - flexWrap: string; - borderImageOutset: string; - flexDirection: string; - touchAction: string; - flexFlow: string; - borderImage: string; - justifyContent: string; - alignSelf: string; - msTextCombineHorizontal: string; -} - -interface NavigationCompletedEvent extends NavigationEvent { - webErrorStatus: number; - isSuccess: boolean; -} - -interface MutationRecord { - oldValue: string; - previousSibling: Node; - addedNodes: NodeList; - attributeName: string; - removedNodes: NodeList; - target: Node; - nextSibling: Node; - attributeNamespace: string; - type: string; -} - -interface Navigator { - pointerEnabled: boolean; - maxTouchPoints: number; -} - -interface Document extends MSDocumentExtensions, GlobalEventHandlers { - msFullscreenEnabled: boolean; - onmsfullscreenerror: (ev: any) => any; - onmspointerenter: (ev: any) => any; - msFullscreenElement: Element; - onmsfullscreenchange: (ev: any) => any; - onmspointerleave: (ev: any) => any; - msExitFullscreen(): void; -} - -interface MimeTypeArray { - length: number; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(type: string): Plugin; - //[type: string]: Plugin; -} - -interface HTMLMediaElement { - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - onmsneedkey: (ev: MSMediaKeyNeededEvent) => any; - /** - * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element. - */ - msKeys: MSMediaKeys; - msGraphicsTrustStatus: MSGraphicsTrust; - msSetMediaKeys(mediaKeys: MSMediaKeys): void; - addTextTrack(kind: string, label?: string, language?: string): TextTrack; -} - -interface TextTrack { - addCue(cue: TextTrackCue): void; - removeCue(cue: TextTrackCue): void; -} - -interface KeyOperation extends EventTarget { - oncomplete: (ev: any) => any; - onerror: (ev: any) => any; - result: any; -} - -interface DOMStringMap { -} - -interface DeviceOrientationEvent extends Event { - gamma: number; - alpha: number; - absolute: boolean; - beta: number; - initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number, beta: number, gamma: number, absolute: boolean): void; -} - -interface MSMediaKeys { - keySystem: string; - createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession; - isTypeSupported(keySystem: string, type?: string): boolean; -} -declare var MSMediaKeys: { - prototype: MSMediaKeys; - new (): MSMediaKeys; -} - -interface MSMediaKeyMessageEvent extends Event { - destinationURL: string; - message: Uint8Array; -} - -interface MSHTMLWebViewElement extends HTMLElement { - documentTitle: string; - width: number; - src: string; - canGoForward: boolean; - height: number; - canGoBack: boolean; - navigateWithHttpRequestMessage(requestMessage: any): void; - goBack(): void; - navigate(uri: string): void; - stop(): void; - navigateToString(contents: string): void; - captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation; - capturePreviewToBlobAsync(): MSWebViewAsyncOperation; - refresh(): void; - goForward(): void; - navigateToLocalStreamUri(source: string, streamResolver: any): void; - invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation; - buildLocalStreamUri(contentIdentifier: string, relativePath: string): string; -} - -interface NavigationEvent extends Event { - uri: string; -} - -interface Element extends GlobalEventHandlers { - onlostpointercapture: (ev: PointerEvent) => any; - onmspointerenter: (ev: any) => any; - ongotpointercapture: (ev: PointerEvent) => any; - onmspointerleave: (ev: any) => any; - msZoomTo(args: MsZoomToOptions): void; - setPointerCapture(pointerId: number): void; - msGetUntransformedBounds(): ClientRect; - releasePointerCapture(pointerId: number): void; - msRequestFullscreen(): void; -} - -interface RandomSource { - getRandomValues(array: ArrayBufferView): ArrayBufferView; -} - -interface XMLHttpRequest { - msCaching: string; - msCachingEnabled(): boolean; - overrideMimeType(mime: string): void; -} - -interface SourceBuffer extends EventTarget { - updating: boolean; - appendWindowStart: number; - appendWindowEnd: number; - buffered: TimeRanges; - timestampOffset: number; - audioTracks: AudioTrackList; - appendBuffer(data: ArrayBuffer): void; - remove(start: number, end: number): void; - abort(): void; - appendStream(stream: MSStream, maxSize?: number): void; -} - -interface MSInputMethodContext extends EventTarget { - oncandidatewindowshow: (ev: any) => any; - target: HTMLElement; - compositionStartOffset: number; - oncandidatewindowhide: (ev: any) => any; - oncandidatewindowupdate: (ev: any) => any; - compositionEndOffset: number; - getCompositionAlternatives(): string[]; - getCandidateWindowClientRect(): ClientRect; - hasComposition(): boolean; - isCandidateWindowVisible(): boolean; -} - -interface DeviceRotationRate { - gamma: number; - alpha: number; - beta: number; -} - -interface PluginArray { - length: number; - refresh(reload?: boolean): void; - item(index: number): Plugin; - [index: number]: Plugin; - namedItem(name: string): Plugin; - //[name: string]: Plugin; -} - -interface MSMediaKeyError { - systemCode: number; - code: number; - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} -declare var MSMediaKeyError: { - MS_MEDIA_KEYERR_SERVICE: number; - MS_MEDIA_KEYERR_HARDWARECHANGE: number; - MS_MEDIA_KEYERR_OUTPUT: number; - MS_MEDIA_KEYERR_DOMAIN: number; - MS_MEDIA_KEYERR_UNKNOWN: number; - MS_MEDIA_KEYERR_CLIENT: number; -} - -interface Plugin { - length: number; - filename: string; - version: string; - name: string; - description: string; - item(index: number): MimeType; - [index: number]: MimeType; - namedItem(type: string): MimeType; - //[type: string]: MimeType; -} - -interface HTMLFrameSetElement { - onpageshow: (ev: PageTransitionEvent) => any; - onpagehide: (ev: PageTransitionEvent) => any; -} - -interface Screen extends EventTarget { - msOrientation: string; - onmsorientationchange: (ev: any) => any; - msLockOrientation(orientations: string[]): boolean; - msUnlockOrientation(): void; -} - -interface MediaSource extends EventTarget { - sourceBuffers: SourceBufferList; - duration: number; - readyState: string; - activeSourceBuffers: SourceBufferList; - addSourceBuffer(type: string): SourceBuffer; - endOfStream(error?: string): void; - isTypeSupported(type: string): boolean; - removeSourceBuffer(sourceBuffer: SourceBuffer): void; -} -declare var MediaSource: { - prototype: MediaSource; - new (): MediaSource; -} - -interface MediaError { - MS_MEDIA_ERR_ENCRYPTED: number; -} -//declare var MediaError: { -// MS_MEDIA_ERR_ENCRYPTED: number; -//} - -interface SourceBufferList extends EventTarget { - length: number; - item(index: number): SourceBuffer; - [index: number]: SourceBuffer; -} - -interface XMLDocument extends Document { -} - -interface DeviceMotionEvent extends Event { - rotationRate: DeviceRotationRate; - acceleration: DeviceAcceleration; - interval: number; - accelerationIncludingGravity: DeviceAcceleration; - initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict, accelerationIncludingGravity: DeviceAccelerationDict, rotationRate: DeviceRotationRateDict, interval: number): void; -} - -interface MimeType { - enabledPlugin: Plugin; - suffixes: string; - type: string; - description: string; -} - -interface PointerEvent extends MouseEvent { - width: number; - rotation: number; - pressure: number; - pointerType: any; - isPrimary: boolean; - tiltY: number; - height: number; - intermediatePoints: any; - currentPoint: any; - tiltX: number; - hwTimestamp: number; - pointerId: number; - initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void; - getCurrentPoint(element: Element): void; - getIntermediatePoints(element: Element): void; -} - -interface MSDocumentExtensions { - captureEvents(): void; - releaseEvents(): void; -} - -interface HTMLElement { - dataset: DOMStringMap; - hidden: boolean; - msGetInputContext(): MSInputMethodContext; -} - -interface MutationObserver { - observe(target: Node, options: MutationObserverInit): void; - takeRecords(): MutationRecord[]; - disconnect(): void; -} -declare var MutationObserver: { - prototype: MutationObserver; - new (): MutationObserver; -} - -interface AudioTrackList { - onremovetrack: (ev: PluginArray) => any; -} - -interface HTMLObjectElement { - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: number; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} - -interface HTMLEmbedElement { - /** - * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server. - */ - msPlayToPreferredSourceUri: string; - /** - * Gets or sets the primary DLNA PlayTo device. - */ - msPlayToPrimary: boolean; - /** - * Gets or sets whether the DLNA PlayTo device is available. - */ - msPlayToDisabled: boolean; - readyState: string; - /** - * Gets the source associated with the media element for use by the PlayToManager. - */ - msPlayToSource: any; -} - -interface MSWebViewAsyncOperation extends EventTarget { - target: MSHTMLWebViewElement; - oncomplete: (ev: any) => any; - error: DOMError; - onerror: (ev: any) => any; - readyState: number; - type: number; - result: any; - start(): void; - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; -} -declare var MSWebViewAsyncOperation: { - ERROR: number; - TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number; - TYPE_INVOKE_SCRIPT: number; - COMPLETED: number; - TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number; - STARTED: number; -} - -interface ScriptNotifyEvent extends Event { - value: string; - callingUri: string; -} - -interface PerformanceNavigationTiming extends PerformanceEntry { - redirectStart: number; - domainLookupEnd: number; - responseStart: number; - domComplete: number; - domainLookupStart: number; - loadEventStart: number; - unloadEventEnd: number; - fetchStart: number; - requestStart: number; - domInteractive: number; - navigationStart: number; - connectEnd: number; - loadEventEnd: number; - connectStart: number; - responseEnd: number; - domLoading: number; - redirectEnd: number; - redirectCount: number; - unloadEventStart: number; - domContentLoadedEventStart: number; - domContentLoadedEventEnd: number; - type: string; -} - -interface MSMediaKeyNeededEvent extends Event { - initData: Uint8Array; -} - -interface MSManipulationEvent { - MS_MANIPULATION_STATE_SELECTING: number; - MS_MANIPULATION_STATE_COMMITTED: number; - MS_MANIPULATION_STATE_PRESELECT: number; - MS_MANIPULATION_STATE_DRAGGING: number; - MS_MANIPULATION_STATE_CANCELLED: number; -} -//declare var MSManipulationEvent: { -// MS_MANIPULATION_STATE_SELECTING: number; -// MS_MANIPULATION_STATE_COMMITTED: number; -// MS_MANIPULATION_STATE_PRESELECT: number; -// MS_MANIPULATION_STATE_DRAGGING: number; -// MS_MANIPULATION_STATE_CANCELLED: number; -//} - -interface LongRunningScriptDetectedEvent extends Event { - stopPageScriptExecution: boolean; - executionTime: number; -} - -interface MSAppView { - viewId: number; - close(): void; - postMessage(message: any, targetOrigin: string, ports?: any): void; -} - -interface PerfWidgetExternal { - maxCpuSpeed: number; - independentRenderingEnabled: boolean; - irDisablingContentString: string; - irStatusAvailable: boolean; - performanceCounter: number; - averagePaintTime: number; - activeNetworkRequestCount: number; - paintRequestsPerSecond: number; - extraInformationEnabled: boolean; - performanceCounterFrequency: number; - averageFrameTime: number; - repositionWindow(x: number, y: number): void; - getRecentMemoryUsage(last: number): any; - getMemoryUsage(): number; - resizeWindow(width: number, height: number): void; - getProcessCpuUsage(): number; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - removeEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentCpuUsage(last: number): any; - addEventListener(eventType: string, callback: (ev: any) => any): void; - getRecentFrames(last: number): any; - getRecentPaintRequests(last: number): any; -} - -interface PageTransitionEvent extends Event { - persisted: boolean; -} - -interface MutationCallback { - (mutations: MutationRecord[], observer: MutationObserver): void; -} - -interface HTMLDocument extends Document { -} - -interface KeyPair { - privateKey: Key; - publicKey: Key; -} - -interface MSApp { - getViewOpener(): MSAppView; - suppressSubdownloadCredentialPrompts(suppress: boolean): void; - execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void; - isTaskScheduledAtPriorityOrHigher(priority: string): boolean; - execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any; - createNewView(uri: string): MSAppView; - getCurrentPriority(): string; - NORMAL: string; - HIGH: string; - IDLE: string; - CURRENT: string; -} -//declare var MSApp: { -// NORMAL: string; -// HIGH: string; -// IDLE: string; -// CURRENT: string; -//} - -interface MSMediaKeySession extends EventTarget { - sessionId: string; - error: MSMediaKeyError; - keySystem: string; - close(): void; - update(key: Uint8Array): void; -} - -interface HTMLTrackElement { - readyState: number; - ERROR: number; - LOADING: number; - LOADED: number; - NONE: number; -} -//declare var HTMLTrackElement: { -// ERROR: number; -// LOADING: number; -// LOADED: number; -// NONE: number; -//} - -interface HTMLVideoElement { - getVideoPlaybackQuality(): VideoPlaybackQuality; -} - -interface UnviewableContentIdentifiedEvent extends NavigationEvent { - referrer: string; -} - -interface CryptoOperation extends EventTarget { - algorithm: Algorithm; - oncomplete: (ev: any) => any; - onerror: (ev: any) => any; - onprogress: (ev: any) => any; - onabort: (ev: any) => any; - key: Key; - result: any; - abort(): void; - finish(): void; - process(buffer: ArrayBufferView): void; -} - -declare var onpageshow: (ev: PageTransitionEvent) => any; -declare var ondevicemotion: (ev: DeviceMotionEvent) => any; -declare var devicePixelRatio: number; -declare var msCrypto: Crypto; -declare var ondeviceorientation: (ev: DeviceOrientationEvent) => any; -declare var doNotTrack: string; -declare var onmspointerenter: (ev: any) => any; -declare var onpagehide: (ev: PageTransitionEvent) => any; -declare var onmspointerleave: (ev: any) => any; -declare var onpointerenter: (ev: PointerEvent) => any; -declare var onpointerout: (ev: PointerEvent) => any; -declare var onpointerdown: (ev: PointerEvent) => any; -declare var onpointerup: (ev: PointerEvent) => any; -declare var onpointercancel: (ev: PointerEvent) => any; -declare var onpointerover: (ev: PointerEvent) => any; -declare var onpointermove: (ev: PointerEvent) => any; -declare var onpointerleave: (ev: PointerEvent) => any; - - -///////////////////////////// -/// WebGL APIs -///////////////////////////// - - -interface WebGLTexture extends WebGLObject { -} - -interface OES_texture_float { -} - -interface WebGLContextEvent extends Event { - statusMessage: string; -} -declare var WebGLContextEvent: { - prototype: WebGLContextEvent; - new (): WebGLContextEvent; -} - -interface WebGLRenderbuffer extends WebGLObject { -} - -interface WebGLUniformLocation { -} - -interface WebGLActiveInfo { - name: string; - type: number; - size: number; -} - -interface WEBGL_compressed_texture_s3tc { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} -declare var WEBGL_compressed_texture_s3tc: { - COMPRESSED_RGBA_S3TC_DXT1_EXT: number; - COMPRESSED_RGBA_S3TC_DXT5_EXT: number; - COMPRESSED_RGBA_S3TC_DXT3_EXT: number; - COMPRESSED_RGB_S3TC_DXT1_EXT: number; -} - -interface WebGLContextAttributes { - alpha: boolean; - depth: boolean; - stencil: boolean; - antialias: boolean; - premultipliedAlpha: boolean; - preserveDrawingBuffer: boolean; -} - -interface WebGLRenderingContext { - drawingBufferWidth: number; - drawingBufferHeight: number; - canvas: HTMLCanvasElement; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation; - bindTexture(target: number, texture: WebGLTexture): void; - bufferData(target: number, size: number, usage: number): void; - depthMask(flag: boolean): void; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - vertexAttrib3fv(indx: number, values: Float32Array): void; - linkProgram(program: WebGLProgram): void; - getSupportedExtensions(): string[]; - bufferSubData(target: number, offset: number, data: ArrayBufferView): void; - vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void; - polygonOffset(factor: number, units: number): void; - blendColor(red: number, green: number, blue: number, alpha: number): void; - createTexture(): WebGLTexture; - hint(target: number, mode: number): void; - getVertexAttrib(index: number, pname: number): any; - enableVertexAttribArray(index: number): void; - depthRange(zNear: number, zFar: number): void; - cullFace(mode: number): void; - createFramebuffer(): WebGLFramebuffer; - uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture, level: number): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer): void; - colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void; - compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void; - uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - getExtension(name: string): Object; - createProgram(): WebGLProgram; - deleteShader(shader: WebGLShader): void; - getAttachedShaders(program: WebGLProgram): WebGLShader[]; - enable(cap: number): void; - blendEquation(mode: number): void; - texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageData): void; - createBuffer(): WebGLBuffer; - deleteTexture(texture: WebGLTexture): void; - useProgram(program: WebGLProgram): void; - vertexAttrib2fv(indx: number, values: Float32Array): void; - checkFramebufferStatus(target: number): number; - frontFace(mode: number): void; - getBufferParameter(target: number, pname: number): any; - texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageData): void; - copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void; - getVertexAttribOffset(index: number, pname: number): number; - disableVertexAttribArray(index: number): void; - blendFunc(sfactor: number, dfactor: number): void; - drawElements(mode: number, count: number, type: number, offset: number): void; - isFramebuffer(framebuffer: WebGLFramebuffer): boolean; - uniform3iv(location: WebGLUniformLocation, v: Int32Array): void; - lineWidth(width: number): void; - getShaderInfoLog(shader: WebGLShader): string; - getTexParameter(target: number, pname: number): any; - getParameter(pname: number): any; - getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat; - getContextAttributes(): WebGLContextAttributes; - vertexAttrib1f(indx: number, x: number): void; - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void; - compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void; - isContextLost(): boolean; - uniform1iv(location: WebGLUniformLocation, v: Int32Array): void; - getRenderbufferParameter(target: number, pname: number): any; - uniform2fv(location: WebGLUniformLocation, v: Float32Array): void; - isTexture(texture: WebGLTexture): boolean; - getError(): number; - shaderSource(shader: WebGLShader, source: string): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer): void; - stencilMask(mask: number): void; - bindBuffer(target: number, buffer: WebGLBuffer): void; - getAttribLocation(program: WebGLProgram, name: string): number; - uniform3i(location: WebGLUniformLocation, x: number, y: number, z: number): void; - blendEquationSeparate(modeRGB: number, modeAlpha: number): void; - clear(mask: number): void; - blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void; - stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void; - readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView): void; - scissor(x: number, y: number, width: number, height: number): void; - uniform2i(location: WebGLUniformLocation, x: number, y: number): void; - getActiveAttrib(program: WebGLProgram, index: number): WebGLActiveInfo; - getShaderSource(shader: WebGLShader): string; - generateMipmap(target: number): void; - bindAttribLocation(program: WebGLProgram, index: number, name: string): void; - uniform1fv(location: WebGLUniformLocation, v: Float32Array): void; - uniform2iv(location: WebGLUniformLocation, v: Int32Array): void; - stencilOp(fail: number, zfail: number, zpass: number): void; - uniform4fv(location: WebGLUniformLocation, v: Float32Array): void; - vertexAttrib1fv(indx: number, values: Float32Array): void; - flush(): void; - uniform4f(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - deleteProgram(program: WebGLProgram): void; - isRenderbuffer(renderbuffer: WebGLRenderbuffer): boolean; - uniform1i(location: WebGLUniformLocation, x: number): void; - getProgramParameter(program: WebGLProgram, pname: number): any; - getActiveUniform(program: WebGLProgram, index: number): WebGLActiveInfo; - stencilFunc(func: number, ref: number, mask: number): void; - pixelStorei(pname: number, param: number): void; - disable(cap: number): void; - vertexAttrib4fv(indx: number, values: Float32Array): void; - createRenderbuffer(): WebGLRenderbuffer; - isBuffer(buffer: WebGLBuffer): boolean; - stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void; - getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any; - uniform4i(location: WebGLUniformLocation, x: number, y: number, z: number, w: number): void; - sampleCoverage(value: number, invert: boolean): void; - depthFunc(func: number): void; - texParameterf(target: number, pname: number, param: number): void; - vertexAttrib3f(indx: number, x: number, y: number, z: number): void; - drawArrays(mode: number, first: number, count: number): void; - texParameteri(target: number, pname: number, param: number): void; - vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void; - getShaderParameter(shader: WebGLShader, pname: number): any; - clearDepth(depth: number): void; - activeTexture(texture: number): void; - viewport(x: number, y: number, width: number, height: number): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - uniform1f(location: WebGLUniformLocation, x: number): void; - uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array): void; - deleteBuffer(buffer: WebGLBuffer): void; - copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void; - uniform3fv(location: WebGLUniformLocation, v: Float32Array): void; - stencilMaskSeparate(face: number, mask: number): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - compileShader(shader: WebGLShader): void; - clearColor(red: number, green: number, blue: number, alpha: number): void; - isShader(shader: WebGLShader): boolean; - clearStencil(s: number): void; - framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer): void; - finish(): void; - uniform2f(location: WebGLUniformLocation, x: number, y: number): void; - renderbufferStorage(target: number, internalformat: number, width: number, height: number): void; - uniform3f(location: WebGLUniformLocation, x: number, y: number, z: number): void; - getProgramInfoLog(program: WebGLProgram): string; - validateProgram(program: WebGLProgram): void; - isEnabled(cap: number): boolean; - vertexAttrib2f(indx: number, x: number, y: number): void; - isProgram(program: WebGLProgram): boolean; - createShader(type: number): WebGLShader; - bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void; - uniform4iv(location: WebGLUniformLocation, v: Int32Array): void; - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} -declare var WebGLRenderingContext: { - DEPTH_FUNC: number; - DEPTH_COMPONENT16: number; - REPLACE: number; - REPEAT: number; - VERTEX_ATTRIB_ARRAY_ENABLED: number; - FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number; - STENCIL_BUFFER_BIT: number; - RENDERER: number; - STENCIL_BACK_REF: number; - TEXTURE26: number; - RGB565: number; - DITHER: number; - CONSTANT_COLOR: number; - GENERATE_MIPMAP_HINT: number; - POINTS: number; - DECR: number; - INT_VEC3: number; - TEXTURE28: number; - ONE_MINUS_CONSTANT_ALPHA: number; - BACK: number; - RENDERBUFFER_STENCIL_SIZE: number; - UNPACK_FLIP_Y_WEBGL: number; - BLEND: number; - TEXTURE9: number; - ARRAY_BUFFER_BINDING: number; - MAX_VIEWPORT_DIMS: number; - INVALID_FRAMEBUFFER_OPERATION: number; - TEXTURE: number; - TEXTURE0: number; - TEXTURE31: number; - TEXTURE24: number; - HIGH_INT: number; - RENDERBUFFER_BINDING: number; - BLEND_COLOR: number; - FASTEST: number; - STENCIL_WRITEMASK: number; - ALIASED_POINT_SIZE_RANGE: number; - TEXTURE12: number; - DST_ALPHA: number; - BLEND_EQUATION_RGB: number; - FRAMEBUFFER_COMPLETE: number; - NEAREST_MIPMAP_NEAREST: number; - VERTEX_ATTRIB_ARRAY_SIZE: number; - TEXTURE3: number; - DEPTH_WRITEMASK: number; - CONTEXT_LOST_WEBGL: number; - INVALID_VALUE: number; - TEXTURE_MAG_FILTER: number; - ONE_MINUS_CONSTANT_COLOR: number; - ONE_MINUS_SRC_ALPHA: number; - TEXTURE_CUBE_MAP_POSITIVE_Z: number; - NOTEQUAL: number; - ALPHA: number; - DEPTH_STENCIL: number; - MAX_VERTEX_UNIFORM_VECTORS: number; - DEPTH_COMPONENT: number; - RENDERBUFFER_RED_SIZE: number; - TEXTURE20: number; - RED_BITS: number; - RENDERBUFFER_BLUE_SIZE: number; - SCISSOR_BOX: number; - VENDOR: number; - FRONT_AND_BACK: number; - CONSTANT_ALPHA: number; - VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number; - NEAREST: number; - CULL_FACE: number; - ALIASED_LINE_WIDTH_RANGE: number; - TEXTURE19: number; - FRONT: number; - DEPTH_CLEAR_VALUE: number; - GREEN_BITS: number; - TEXTURE29: number; - TEXTURE23: number; - MAX_RENDERBUFFER_SIZE: number; - STENCIL_ATTACHMENT: number; - TEXTURE27: number; - BOOL_VEC2: number; - OUT_OF_MEMORY: number; - MIRRORED_REPEAT: number; - POLYGON_OFFSET_UNITS: number; - TEXTURE_MIN_FILTER: number; - STENCIL_BACK_PASS_DEPTH_PASS: number; - LINE_LOOP: number; - FLOAT_MAT3: number; - TEXTURE14: number; - LINEAR: number; - RGB5_A1: number; - ONE_MINUS_SRC_COLOR: number; - SAMPLE_COVERAGE_INVERT: number; - DONT_CARE: number; - FRAMEBUFFER_BINDING: number; - RENDERBUFFER_ALPHA_SIZE: number; - STENCIL_REF: number; - ZERO: number; - DECR_WRAP: number; - SAMPLE_COVERAGE: number; - STENCIL_BACK_FUNC: number; - TEXTURE30: number; - VIEWPORT: number; - STENCIL_BITS: number; - FLOAT: number; - COLOR_WRITEMASK: number; - SAMPLE_COVERAGE_VALUE: number; - TEXTURE_CUBE_MAP_NEGATIVE_Y: number; - STENCIL_BACK_FAIL: number; - FLOAT_MAT4: number; - UNSIGNED_SHORT_4_4_4_4: number; - TEXTURE6: number; - RENDERBUFFER_WIDTH: number; - RGBA4: number; - ALWAYS: number; - BLEND_EQUATION_ALPHA: number; - COLOR_BUFFER_BIT: number; - TEXTURE_CUBE_MAP: number; - DEPTH_BUFFER_BIT: number; - STENCIL_CLEAR_VALUE: number; - BLEND_EQUATION: number; - RENDERBUFFER_GREEN_SIZE: number; - NEAREST_MIPMAP_LINEAR: number; - VERTEX_ATTRIB_ARRAY_TYPE: number; - INCR_WRAP: number; - ONE_MINUS_DST_COLOR: number; - HIGH_FLOAT: number; - BYTE: number; - FRONT_FACE: number; - SAMPLE_ALPHA_TO_COVERAGE: number; - CCW: number; - TEXTURE13: number; - MAX_VERTEX_ATTRIBS: number; - MAX_VERTEX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_WRAP_T: number; - UNPACK_PREMULTIPLY_ALPHA_WEBGL: number; - FLOAT_VEC2: number; - LUMINANCE: number; - GREATER: number; - INT_VEC2: number; - VALIDATE_STATUS: number; - FRAMEBUFFER: number; - FRAMEBUFFER_UNSUPPORTED: number; - TEXTURE5: number; - FUNC_SUBTRACT: number; - BLEND_DST_ALPHA: number; - SAMPLER_CUBE: number; - ONE_MINUS_DST_ALPHA: number; - LESS: number; - TEXTURE_CUBE_MAP_POSITIVE_X: number; - BLUE_BITS: number; - DEPTH_TEST: number; - VERTEX_ATTRIB_ARRAY_STRIDE: number; - DELETE_STATUS: number; - TEXTURE18: number; - POLYGON_OFFSET_FACTOR: number; - UNSIGNED_INT: number; - TEXTURE_2D: number; - DST_COLOR: number; - FLOAT_MAT2: number; - COMPRESSED_TEXTURE_FORMATS: number; - MAX_FRAGMENT_UNIFORM_VECTORS: number; - DEPTH_STENCIL_ATTACHMENT: number; - LUMINANCE_ALPHA: number; - CW: number; - VERTEX_ATTRIB_ARRAY_NORMALIZED: number; - TEXTURE_CUBE_MAP_NEGATIVE_Z: number; - LINEAR_MIPMAP_LINEAR: number; - BUFFER_SIZE: number; - SAMPLE_BUFFERS: number; - TEXTURE15: number; - ACTIVE_TEXTURE: number; - VERTEX_SHADER: number; - TEXTURE22: number; - VERTEX_ATTRIB_ARRAY_POINTER: number; - INCR: number; - COMPILE_STATUS: number; - MAX_COMBINED_TEXTURE_IMAGE_UNITS: number; - TEXTURE7: number; - UNSIGNED_SHORT_5_5_5_1: number; - DEPTH_BITS: number; - RGBA: number; - TRIANGLE_STRIP: number; - COLOR_CLEAR_VALUE: number; - BROWSER_DEFAULT_WEBGL: number; - INVALID_ENUM: number; - SCISSOR_TEST: number; - LINE_STRIP: number; - FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number; - STENCIL_FUNC: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number; - RENDERBUFFER_HEIGHT: number; - TEXTURE8: number; - TRIANGLES: number; - FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number; - STENCIL_BACK_VALUE_MASK: number; - TEXTURE25: number; - RENDERBUFFER: number; - LEQUAL: number; - TEXTURE1: number; - STENCIL_INDEX8: number; - FUNC_ADD: number; - STENCIL_FAIL: number; - BLEND_SRC_ALPHA: number; - BOOL: number; - ALPHA_BITS: number; - LOW_INT: number; - TEXTURE10: number; - SRC_COLOR: number; - MAX_VARYING_VECTORS: number; - BLEND_DST_RGB: number; - TEXTURE_BINDING_CUBE_MAP: number; - STENCIL_INDEX: number; - TEXTURE_BINDING_2D: number; - MEDIUM_INT: number; - SHADER_TYPE: number; - POLYGON_OFFSET_FILL: number; - DYNAMIC_DRAW: number; - TEXTURE4: number; - STENCIL_BACK_PASS_DEPTH_FAIL: number; - STREAM_DRAW: number; - MAX_CUBE_MAP_TEXTURE_SIZE: number; - TEXTURE17: number; - TRIANGLE_FAN: number; - UNPACK_ALIGNMENT: number; - CURRENT_PROGRAM: number; - LINES: number; - INVALID_OPERATION: number; - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number; - LINEAR_MIPMAP_NEAREST: number; - CLAMP_TO_EDGE: number; - RENDERBUFFER_DEPTH_SIZE: number; - TEXTURE_WRAP_S: number; - ELEMENT_ARRAY_BUFFER: number; - UNSIGNED_SHORT_5_6_5: number; - ACTIVE_UNIFORMS: number; - FLOAT_VEC3: number; - NO_ERROR: number; - ATTACHED_SHADERS: number; - DEPTH_ATTACHMENT: number; - TEXTURE11: number; - STENCIL_TEST: number; - ONE: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number; - STATIC_DRAW: number; - GEQUAL: number; - BOOL_VEC4: number; - COLOR_ATTACHMENT0: number; - PACK_ALIGNMENT: number; - MAX_TEXTURE_SIZE: number; - STENCIL_PASS_DEPTH_FAIL: number; - CULL_FACE_MODE: number; - TEXTURE16: number; - STENCIL_BACK_WRITEMASK: number; - SRC_ALPHA: number; - UNSIGNED_SHORT: number; - TEXTURE21: number; - FUNC_REVERSE_SUBTRACT: number; - SHADING_LANGUAGE_VERSION: number; - EQUAL: number; - FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number; - BOOL_VEC3: number; - SAMPLER_2D: number; - TEXTURE_CUBE_MAP_NEGATIVE_X: number; - MAX_TEXTURE_IMAGE_UNITS: number; - TEXTURE_CUBE_MAP_POSITIVE_Y: number; - RENDERBUFFER_INTERNAL_FORMAT: number; - STENCIL_VALUE_MASK: number; - ELEMENT_ARRAY_BUFFER_BINDING: number; - ARRAY_BUFFER: number; - DEPTH_RANGE: number; - NICEST: number; - ACTIVE_ATTRIBUTES: number; - NEVER: number; - FLOAT_VEC4: number; - CURRENT_VERTEX_ATTRIB: number; - STENCIL_PASS_DEPTH_PASS: number; - INVERT: number; - LINK_STATUS: number; - RGB: number; - INT_VEC4: number; - TEXTURE2: number; - UNPACK_COLORSPACE_CONVERSION_WEBGL: number; - MEDIUM_FLOAT: number; - SRC_ALPHA_SATURATE: number; - BUFFER_USAGE: number; - SHORT: number; - NONE: number; - UNSIGNED_BYTE: number; - INT: number; - SUBPIXEL_BITS: number; - KEEP: number; - SAMPLES: number; - FRAGMENT_SHADER: number; - LINE_WIDTH: number; - BLEND_SRC_RGB: number; - LOW_FLOAT: number; - VERSION: number; -} - -interface WebGLProgram extends WebGLObject { -} - -interface OES_standard_derivatives { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} -declare var OES_standard_derivatives: { - FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number; -} - -interface WebGLFramebuffer extends WebGLObject { -} - -interface WebGLShader extends WebGLObject { -} - -interface OES_texture_float_linear { -} - -interface WebGLObject { -} - -interface WebGLBuffer extends WebGLObject { -} - -interface WebGLShaderPrecisionFormat { - rangeMin: number; - rangeMax: number; - precision: number; -} - -interface EXT_texture_filter_anisotropic { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} -declare var EXT_texture_filter_anisotropic: { - TEXTURE_MAX_ANISOTROPY_EXT: number; - MAX_TEXTURE_MAX_ANISOTROPY_EXT: number; -} - - -///////////////////////////// -/// addEventListener overloads -///////////////////////////// - -interface HTMLElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Document { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "msthumbnailclick", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stop", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mssitemodejumplistitemremoved", listener: (ev: MSSiteModeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectionchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storagecommit", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenerror", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msfullscreenchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Element { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSNamespaceInfo { - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Window { - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLFrameElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface XMLHttpRequest { - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLFrameSetElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface Screen { - addEventListener(type: "msorientationchange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface SVGSVGElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "zoom", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLIFrameElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLBodyElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; - addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface XDomainRequest { - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLMarqueeElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "bounce", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "start", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "finish", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSWindowExtensions { - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLMediaElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface HTMLVideoElement { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgotpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mslostpointercapture", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "lostpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "gotpointercapture", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "move", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "deactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "datasetchanged", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsdelete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "losecapture", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "controlselect", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "layoutcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "beforeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforeupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "filterchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "datasetcomplete", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "errorupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; - addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cellchange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowexit", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "rowsinserted", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "propertychange", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforepaste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforecopy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "paste", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "moveend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "beforeeditfocus", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "afterupdate", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resizeend", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "dataavailable", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "beforedeactivate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "activate", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "movestart", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "selectstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; - addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "cut", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "copy", listener: (ev: DragEvent) => any, useCapture?: boolean): void; - addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "rowenter", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "mscontentzoom", listener: (ev: MSEventObj) => any, useCapture?: boolean): void; - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "msmanipulationstatechanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "msneedkey", listener: (ev: MSMediaKeyNeededEvent) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoOptimalLayoutChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFrameStepCompleted", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "MSVideoFormatChanged", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface TextTrackCue { - addEventListener(type: "enter", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "exit", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface WebSocket { - addEventListener(type: "open", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: "close", listener: (ev: CloseEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface XMLHttpRequestEventTarget { - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "timeout", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface AudioTrackList { - addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: "removetrack", listener: (ev: any /*PluginArray*/) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSBaseReader { - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: "loadend", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -interface IDBTransaction { - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface TextTrackList { - addEventListener(type: "addtrack", listener: (ev: TrackEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBDatabase { - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBOpenDBRequest { - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "upgradeneeded", listener: (ev: IDBVersionChangeEvent) => any, useCapture?: boolean): void; - addEventListener(type: "blocked", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface TextTrack { - addEventListener(type: "cuechange", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface IDBRequest { - addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MessagePort { - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface ApplicationCache { - addEventListener(type: "downloading", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "updateready", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "cached", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "obsolete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "checking", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "noupdate", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface AbstractWorker { - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -interface Worker { - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface GlobalEventHandlers { - addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} -interface KeyOperation { - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSInputMethodContext { - addEventListener(type: "candidatewindowshow", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowhide", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: "candidatewindowupdate", listener: (ev: any) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface MSWebViewAsyncOperation { - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - -interface CryptoOperation { - addEventListener(type: "complete", listener: (ev: Event) => any, useCapture?: boolean): void; - addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void; - addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; - addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; - addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; -} - - -declare function addEventListener(type: "mouseleave", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseenter", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "help", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusout", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focusin", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerenter", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerout", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerdown", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerup", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointercancel", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerover", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointermove", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pointerleave", listener: (ev: PointerEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragend", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keydown", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragover", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keyup", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "reset", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseup", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragstart", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drag", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseover", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragleave", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "afterprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pause", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeprint", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousedown", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeked", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "click", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "waiting", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "online", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "durationchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "blur", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "emptied", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "seeking", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplay", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "stalled", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousemove", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "offline", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "beforeunload", listener: (ev: BeforeUnloadEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ratechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "storage", listener: (ev: StorageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadstart", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dragenter", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "submit", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "progress", listener: (ev: ProgressEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "dblclick", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "contextmenu", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "change", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadedmetadata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "play", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "playing", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "canplaythrough", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "abort", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "readystatechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "keypress", listener: (ev: KeyboardEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "loadeddata", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "suspend", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "focus", listener: (ev: FocusEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "message", listener: (ev: MessageEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "timeupdate", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "resize", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "select", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "drop", listener: (ev: DragEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mouseout", listener: (ev: MouseEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "ended", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "hashchange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "unload", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "scroll", listener: (ev: UIEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mousewheel", listener: (ev: MouseWheelEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "load", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "volumechange", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "input", listener: (ev: Event) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerdown", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturedoubletap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerhover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturehold", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointermove", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturechange", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturestart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointercancel", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgestureend", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msgesturetap", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerout", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "msinertiastart", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerover", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "popstate", listener: (ev: PopStateEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerup", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pageshow", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "devicemotion", listener: (ev: DeviceMotionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "deviceorientation", listener: (ev: DeviceOrientationEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerenter", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: "pagehide", listener: (ev: PageTransitionEvent) => any, useCapture?: boolean): void; -declare function addEventListener(type: "mspointerleave", listener: (ev: any) => any, useCapture?: boolean): void; -declare function addEventListener(type: string, listener: EventListener, useCapture?: boolean): void; - - -///////////////////////////// -/// WorkerGlobalScope APIs -///////////////////////////// -// TODO: These are only available in a Web Worker - should be in a separate lib file -declare function importScripts(...urls: string[]): void; - - -///////////////////////////// -/// Windows Script Host APIS -///////////////////////////// -declare var ActiveXObject: { new (s: string): any; }; - -interface ITextWriter { - Write(s: string): void; - WriteLine(s: string): void; - Close(): void; -} - -declare var WScript: { - Echo(s: any): void; - StdErr: ITextWriter; - StdOut: ITextWriter; - Arguments: { length: number; Item(n: number): string; }; - ScriptFullName: string; - Quit(exitCode?: number): number; -} diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/cz/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/cz/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/cz/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cs/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cz/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cz/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/cz/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/de/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/de/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/de/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/us/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/us/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/en/us/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/es/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/es/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/es/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/fr/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/fr/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/fr/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/it/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/it/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/it/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/jp/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/jp/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ja/jp/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/kr/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/kr/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ko/kr/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pl/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pl/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pl/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/br/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/br/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/br/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/pt/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ru/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ru/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/ru/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/tr/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/tr/diagnosticMessages.generated.json deleted file mode 100644 index 91d8040..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/tr/diagnosticMessages.generated.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file": "Concatenate and emit output to single file", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Redirect output structure to the directory": "Redirect output structure to the directory", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE": "FILE", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "DIRECTORY": "DIRECTORY", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/cn/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/cn/diagnosticMessages.generated.json deleted file mode 100644 index e4988f2..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/cn/diagnosticMessages.generated.json +++ /dev/null @@ -1,373 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Cannot compile external modules when emitting into single file.": "Cannot compile external modules when emitting into single file.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file | Redirect output structure to the directory": "Concatenate and emit output to single file | Redirect output structure to the directory", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE|DIRECTORY": "FILE|DIRECTORY", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/tw/diagnosticMessages.generated.json b/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/tw/diagnosticMessages.generated.json deleted file mode 100644 index e4988f2..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/resources/zh/tw/diagnosticMessages.generated.json +++ /dev/null @@ -1,373 +0,0 @@ -{ - "error TS{0}: {1}": "error TS{0}: {1}", - "warning TS{0}: {1}": "warning TS{0}: {1}", - "Unrecognized escape sequence.": "Unrecognized escape sequence.", - "Unexpected character {0}.": "Unexpected character {0}.", - "Missing close quote character.": "Missing close quote character.", - "Identifier expected.": "Identifier expected.", - "'{0}' keyword expected.": "'{0}' keyword expected.", - "'{0}' expected.": "'{0}' expected.", - "Identifier expected; '{0}' is a keyword.": "Identifier expected; '{0}' is a keyword.", - "Automatic semicolon insertion not allowed.": "Automatic semicolon insertion not allowed.", - "Unexpected token; '{0}' expected.": "Unexpected token; '{0}' expected.", - "Trailing separator not allowed.": "Trailing separator not allowed.", - "'*/' expected.": "'*/' expected.", - "'public' or 'private' modifier must precede 'static'.": "'public' or 'private' modifier must precede 'static'.", - "Unexpected token.": "Unexpected token.", - "Catch clause parameter cannot have a type annotation.": "Catch clause parameter cannot have a type annotation.", - "Rest parameter must be last in list.": "Rest parameter must be last in list.", - "Parameter cannot have question mark and initializer.": "Parameter cannot have question mark and initializer.", - "Required parameter cannot follow optional parameter.": "Required parameter cannot follow optional parameter.", - "Index signatures cannot have rest parameters.": "Index signatures cannot have rest parameters.", - "Index signature parameter cannot have accessibility modifiers.": "Index signature parameter cannot have accessibility modifiers.", - "Index signature parameter cannot have a question mark.": "Index signature parameter cannot have a question mark.", - "Index signature parameter cannot have an initializer.": "Index signature parameter cannot have an initializer.", - "Index signature must have a type annotation.": "Index signature must have a type annotation.", - "Index signature parameter must have a type annotation.": "Index signature parameter must have a type annotation.", - "Index signature parameter type must be 'string' or 'number'.": "Index signature parameter type must be 'string' or 'number'.", - "'extends' clause already seen.": "'extends' clause already seen.", - "'extends' clause must precede 'implements' clause.": "'extends' clause must precede 'implements' clause.", - "Classes can only extend a single class.": "Classes can only extend a single class.", - "'implements' clause already seen.": "'implements' clause already seen.", - "Accessibility modifier already seen.": "Accessibility modifier already seen.", - "'{0}' modifier must precede '{1}' modifier.": "'{0}' modifier must precede '{1}' modifier.", - "'{0}' modifier already seen.": "'{0}' modifier already seen.", - "'{0}' modifier cannot appear on a class element.": "'{0}' modifier cannot appear on a class element.", - "Interface declaration cannot have 'implements' clause.": "Interface declaration cannot have 'implements' clause.", - "'super' invocation cannot have type arguments.": "'super' invocation cannot have type arguments.", - "Only ambient modules can use quoted names.": "Only ambient modules can use quoted names.", - "Statements are not allowed in ambient contexts.": "Statements are not allowed in ambient contexts.", - "Implementations are not allowed in ambient contexts.": "Implementations are not allowed in ambient contexts.", - "'declare' modifier not allowed for code already in an ambient context.": "'declare' modifier not allowed for code already in an ambient context.", - "Initializers are not allowed in ambient contexts.": "Initializers are not allowed in ambient contexts.", - "Parameter property declarations can only be used in constructors.": "Parameter property declarations can only be used in constructors.", - "Function implementation expected.": "Function implementation expected.", - "Constructor implementation expected.": "Constructor implementation expected.", - "Function overload name must be '{0}'.": "Function overload name must be '{0}'.", - "'{0}' modifier cannot appear on a module element.": "'{0}' modifier cannot appear on a module element.", - "'declare' modifier cannot appear on an interface declaration.": "'declare' modifier cannot appear on an interface declaration.", - "'declare' modifier required for top level element.": "'declare' modifier required for top level element.", - "Rest parameter cannot be optional.": "Rest parameter cannot be optional.", - "Rest parameter cannot have an initializer.": "Rest parameter cannot have an initializer.", - "'set' accessor must have one and only one parameter.": "'set' accessor must have one and only one parameter.", - "'set' accessor parameter cannot have accessibility modifier.": "'set' accessor parameter cannot have accessibility modifier.", - "'set' accessor parameter cannot be optional.": "'set' accessor parameter cannot be optional.", - "'set' accessor parameter cannot have an initializer.": "'set' accessor parameter cannot have an initializer.", - "'set' accessor cannot have rest parameter.": "'set' accessor cannot have rest parameter.", - "'get' accessor cannot have parameters.": "'get' accessor cannot have parameters.", - "Modifiers cannot appear here.": "Modifiers cannot appear here.", - "Accessors are only available when targeting ECMAScript 5 and higher.": "Accessors are only available when targeting ECMAScript 5 and higher.", - "Class name cannot be '{0}'.": "Class name cannot be '{0}'.", - "Interface name cannot be '{0}'.": "Interface name cannot be '{0}'.", - "Enum name cannot be '{0}'.": "Enum name cannot be '{0}'.", - "Module name cannot be '{0}'.": "Module name cannot be '{0}'.", - "Enum member must have initializer.": "Enum member must have initializer.", - "Export assignment cannot be used in internal modules.": "Export assignment cannot be used in internal modules.", - "Export assignment not allowed in module with exported element.": "Export assignment not allowed in module with exported element.", - "Module cannot have multiple export assignments.": "Module cannot have multiple export assignments.", - "Ambient enum elements can only have integer literal initializers.": "Ambient enum elements can only have integer literal initializers.", - "module, class, interface, enum, import or statement": "module, class, interface, enum, import or statement", - "constructor, function, accessor or variable": "constructor, function, accessor or variable", - "statement": "statement", - "case or default clause": "case or default clause", - "identifier": "identifier", - "call, construct, index, property or function signature": "call, construct, index, property or function signature", - "expression": "expression", - "type name": "type name", - "property or accessor": "property or accessor", - "parameter": "parameter", - "type": "type", - "type parameter": "type parameter", - "'declare' modifier not allowed on import declaration.": "'declare' modifier not allowed on import declaration.", - "Function overload must be static": "Function overload must be static", - "Function overload must not be static": "Function overload must not be static", - "Duplicate identifier '{0}'.": "Duplicate identifier '{0}'.", - "The name '{0}' does not exist in the current scope.": "The name '{0}' does not exist in the current scope.", - "The name '{0}' does not refer to a value.": "The name '{0}' does not refer to a value.", - "'super' can only be used inside a class instance method.": "'super' can only be used inside a class instance method.", - "The left-hand side of an assignment expression must be a variable, property or indexer.": "The left-hand side of an assignment expression must be a variable, property or indexer.", - "Value of type '{0}' is not callable. Did you mean to include 'new'?": "Value of type '{0}' is not callable. Did you mean to include 'new'?", - "Value of type '{0}' is not callable.": "Value of type '{0}' is not callable.", - "Value of type '{0}' is not newable.": "Value of type '{0}' is not newable.", - "Value of type '{0}' is not indexable by type '{1}'.": "Value of type '{0}' is not indexable by type '{1}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - "Cannot convert '{0}' to '{1}'.": "Cannot convert '{0}' to '{1}'.", - "Cannot convert '{0}' to '{1}':{NL}{2}": "Cannot convert '{0}' to '{1}':{NL}{2}", - "Expected var, class, interface, or module.": "Expected var, class, interface, or module.", - "Operator '{0}' cannot be applied to type '{1}'.": "Operator '{0}' cannot be applied to type '{1}'.", - "Getter '{0}' already declared.": "Getter '{0}' already declared.", - "Setter '{0}' already declared.": "Setter '{0}' already declared.", - "Accessors cannot have type parameters.": "Accessors cannot have type parameters.", - "Exported class '{0}' extends private class '{1}'.": "Exported class '{0}' extends private class '{1}'.", - "Exported class '{0}' implements private interface '{1}'.": "Exported class '{0}' implements private interface '{1}'.", - "Exported interface '{0}' extends private interface '{1}'.": "Exported interface '{0}' extends private interface '{1}'.", - "Exported class '{0}' extends class from inaccessible module {1}.": "Exported class '{0}' extends class from inaccessible module {1}.", - "Exported class '{0}' implements interface from inaccessible module {1}.": "Exported class '{0}' implements interface from inaccessible module {1}.", - "Exported interface '{0}' extends interface from inaccessible module {1}.": "Exported interface '{0}' extends interface from inaccessible module {1}.", - "Public static property '{0}' of exported class has or is using private type '{1}'.": "Public static property '{0}' of exported class has or is using private type '{1}'.", - "Public property '{0}' of exported class has or is using private type '{1}'.": "Public property '{0}' of exported class has or is using private type '{1}'.", - "Property '{0}' of exported interface has or is using private type '{1}'.": "Property '{0}' of exported interface has or is using private type '{1}'.", - "Exported variable '{0}' has or is using private type '{1}'.": "Exported variable '{0}' has or is using private type '{1}'.", - "Public static property '{0}' of exported class is using inaccessible module {1}.": "Public static property '{0}' of exported class is using inaccessible module {1}.", - "Public property '{0}' of exported class is using inaccessible module {1}.": "Public property '{0}' of exported class is using inaccessible module {1}.", - "Property '{0}' of exported interface is using inaccessible module {1}.": "Property '{0}' of exported interface is using inaccessible module {1}.", - "Exported variable '{0}' is using inaccessible module {1}.": "Exported variable '{0}' is using inaccessible module {1}.", - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - "Parameter '{0}' of exported function has or is using private type '{1}'.": "Parameter '{0}' of exported function has or is using private type '{1}'.", - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - "Parameter '{0}' of exported function is using inaccessible module {1}.": "Parameter '{0}' of exported function is using inaccessible module {1}.", - "Return type of public static property getter from exported class has or is using private type '{0}'.": "Return type of public static property getter from exported class has or is using private type '{0}'.", - "Return type of public property getter from exported class has or is using private type '{0}'.": "Return type of public property getter from exported class has or is using private type '{0}'.", - "Return type of constructor signature from exported interface has or is using private type '{0}'.": "Return type of constructor signature from exported interface has or is using private type '{0}'.", - "Return type of call signature from exported interface has or is using private type '{0}'.": "Return type of call signature from exported interface has or is using private type '{0}'.", - "Return type of index signature from exported interface has or is using private type '{0}'.": "Return type of index signature from exported interface has or is using private type '{0}'.", - "Return type of public static method from exported class has or is using private type '{0}'.": "Return type of public static method from exported class has or is using private type '{0}'.", - "Return type of public method from exported class has or is using private type '{0}'.": "Return type of public method from exported class has or is using private type '{0}'.", - "Return type of method from exported interface has or is using private type '{0}'.": "Return type of method from exported interface has or is using private type '{0}'.", - "Return type of exported function has or is using private type '{0}'.": "Return type of exported function has or is using private type '{0}'.", - "Return type of public static property getter from exported class is using inaccessible module {0}.": "Return type of public static property getter from exported class is using inaccessible module {0}.", - "Return type of public property getter from exported class is using inaccessible module {0}.": "Return type of public property getter from exported class is using inaccessible module {0}.", - "Return type of constructor signature from exported interface is using inaccessible module {0}.": "Return type of constructor signature from exported interface is using inaccessible module {0}.", - "Return type of call signature from exported interface is using inaccessible module {0}.": "Return type of call signature from exported interface is using inaccessible module {0}.", - "Return type of index signature from exported interface is using inaccessible module {0}.": "Return type of index signature from exported interface is using inaccessible module {0}.", - "Return type of public static method from exported class is using inaccessible module {0}.": "Return type of public static method from exported class is using inaccessible module {0}.", - "Return type of public method from exported class is using inaccessible module {0}.": "Return type of public method from exported class is using inaccessible module {0}.", - "Return type of method from exported interface is using inaccessible module {0}.": "Return type of method from exported interface is using inaccessible module {0}.", - "Return type of exported function is using inaccessible module {0}.": "Return type of exported function is using inaccessible module {0}.", - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - "A parameter list must follow a generic type argument list. '(' expected.": "A parameter list must follow a generic type argument list. '(' expected.", - "Multiple constructor implementations are not allowed.": "Multiple constructor implementations are not allowed.", - "Unable to resolve external module '{0}'.": "Unable to resolve external module '{0}'.", - "Module cannot be aliased to a non-module type.": "Module cannot be aliased to a non-module type.", - "A class may only extend another class.": "A class may only extend another class.", - "A class may only implement another class or interface.": "A class may only implement another class or interface.", - "An interface may only extend another class or interface.": "An interface may only extend another class or interface.", - "An interface cannot implement another type.": "An interface cannot implement another type.", - "Unable to resolve type.": "Unable to resolve type.", - "Unable to resolve type of '{0}'.": "Unable to resolve type of '{0}'.", - "Unable to resolve type parameter constraint.": "Unable to resolve type parameter constraint.", - "Type parameter constraint cannot be a primitive type.": "Type parameter constraint cannot be a primitive type.", - "Supplied parameters do not match any signature of call target.": "Supplied parameters do not match any signature of call target.", - "Supplied parameters do not match any signature of call target:{NL}{0}": "Supplied parameters do not match any signature of call target:{NL}{0}", - "Invalid 'new' expression.": "Invalid 'new' expression.", - "Call signatures used in a 'new' expression must have a 'void' return type.": "Call signatures used in a 'new' expression must have a 'void' return type.", - "Could not select overload for 'new' expression.": "Could not select overload for 'new' expression.", - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - "Could not select overload for 'call' expression.": "Could not select overload for 'call' expression.", - "Cannot invoke an expression whose type lacks a call signature.": "Cannot invoke an expression whose type lacks a call signature.", - "Calls to 'super' are only valid inside a class.": "Calls to 'super' are only valid inside a class.", - "Generic type '{0}' requires {1} type argument(s).": "Generic type '{0}' requires {1} type argument(s).", - "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.": "Type of conditional expression cannot be determined. Best common type could not be found between '{0}' and '{1}'.", - "Type of array literal cannot be determined. Best common type could not be found for array elements.": "Type of array literal cannot be determined. Best common type could not be found for array elements.", - "Could not find enclosing symbol for dotted name '{0}'.": "Could not find enclosing symbol for dotted name '{0}'.", - "The property '{0}' does not exist on value of type '{1}'.": "The property '{0}' does not exist on value of type '{1}'.", - "Could not find symbol '{0}'.": "Could not find symbol '{0}'.", - "'get' and 'set' accessor must have the same type.": "'get' and 'set' accessor must have the same type.", - "'this' cannot be referenced in current location.": "'this' cannot be referenced in current location.", - "Static methods cannot reference class type parameters.": "Static methods cannot reference class type parameters.", - "Class '{0}' is recursively referenced as a base type of itself.": "Class '{0}' is recursively referenced as a base type of itself.", - "Interface '{0}' is recursively referenced as a base type of itself.": "Interface '{0}' is recursively referenced as a base type of itself.", - "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.": "'super' property access is permitted only in a constructor, instance member function, or instance member accessor of a derived class.", - "'super' cannot be referenced in non-derived classes.": "'super' cannot be referenced in non-derived classes.", - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - "Constructors for derived classes must contain a 'super' call.": "Constructors for derived classes must contain a 'super' call.", - "Super calls are not permitted outside constructors or in local functions inside constructors.": "Super calls are not permitted outside constructors or in local functions inside constructors.", - "'{0}.{1}' is inaccessible.": "'{0}.{1}' is inaccessible.", - "'this' cannot be referenced within module bodies.": "'this' cannot be referenced within module bodies.", - "Invalid '+' expression - types not known to support the addition operator.": "Invalid '+' expression - types not known to support the addition operator.", - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - "Variable declarations of a 'for' statement cannot use a type annotation.": "Variable declarations of a 'for' statement cannot use a type annotation.", - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'in' expression must be of types 'string' or 'any'.": "The left-hand side of an 'in' expression must be of types 'string' or 'any'.", - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.": "The right-hand side of an 'instanceof' expression must be of type 'any' or a subtype of the 'Function' interface type.", - "Setters cannot return a value.": "Setters cannot return a value.", - "Tried to query type of uninitialized module '{0}'.": "Tried to query type of uninitialized module '{0}'.", - "Tried to set variable type to uninitialized module type '{0}'.": "Tried to set variable type to uninitialized module type '{0}'.", - "Function '{0}' declared a non-void return type, but has no return expression.": "Function '{0}' declared a non-void return type, but has no return expression.", - "Getters must return a value.": "Getters must return a value.", - "Getter and setter accessors do not agree in visibility.": "Getter and setter accessors do not agree in visibility.", - "Invalid left-hand side of assignment expression.": "Invalid left-hand side of assignment expression.", - "Function declared a non-void return type, but has no return expression.": "Function declared a non-void return type, but has no return expression.", - "Cannot resolve return type reference.": "Cannot resolve return type reference.", - "Constructors cannot have a return type of 'void'.": "Constructors cannot have a return type of 'void'.", - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - "All symbols within a with block will be resolved to 'any'.": "All symbols within a with block will be resolved to 'any'.", - "Import declarations in an internal module cannot reference an external module.": "Import declarations in an internal module cannot reference an external module.", - "Class {0} declares interface {1} but does not implement it:{NL}{2}": "Class {0} declares interface {1} but does not implement it:{NL}{2}", - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - "The operand of an increment or decrement operator must be a variable, property or indexer.": "The operand of an increment or decrement operator must be a variable, property or indexer.", - "'this' cannot be referenced in static initializers in a class body.": "'this' cannot be referenced in static initializers in a class body.", - "Class '{0}' cannot extend class '{1}':{NL}{2}": "Class '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend class '{1}':{NL}{2}": "Interface '{0}' cannot extend class '{1}':{NL}{2}", - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - "Duplicate overload signature for '{0}'.": "Duplicate overload signature for '{0}'.", - "Duplicate constructor overload signature.": "Duplicate constructor overload signature.", - "Duplicate overload call signature.": "Duplicate overload call signature.", - "Duplicate overload construct signature.": "Duplicate overload construct signature.", - "Overload signature is not compatible with function definition.": "Overload signature is not compatible with function definition.", - "Overload signature is not compatible with function definition:{NL}{0}": "Overload signature is not compatible with function definition:{NL}{0}", - "Overload signatures must all be public or private.": "Overload signatures must all be public or private.", - "Overload signatures must all be exported or local.": "Overload signatures must all be exported or local.", - "Overload signatures must all be ambient or non-ambient.": "Overload signatures must all be ambient or non-ambient.", - "Overload signatures must all be optional or required.": "Overload signatures must all be optional or required.", - "Specialized overload signature is not subtype of any non-specialized signature.": "Specialized overload signature is not subtype of any non-specialized signature.", - "'this' cannot be referenced in constructor arguments.": "'this' cannot be referenced in constructor arguments.", - "Static member cannot be accessed off an instance variable.": "Static member cannot be accessed off an instance variable.", - "Instance member cannot be accessed off a class.": "Instance member cannot be accessed off a class.", - "Untyped function calls may not accept type arguments.": "Untyped function calls may not accept type arguments.", - "Non-generic functions may not accept type arguments.": "Non-generic functions may not accept type arguments.", - "A generic type may not reference itself with a wrapped form of its own type parameters.": "A generic type may not reference itself with a wrapped form of its own type parameters.", - "Rest parameters must be array types.": "Rest parameters must be array types.", - "Overload signature implementation cannot use specialized type.": "Overload signature implementation cannot use specialized type.", - "Export assignments may only be used at the top-level of external modules.": "Export assignments may only be used at the top-level of external modules.", - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules": "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules", - "Only public instance methods of the base class are accessible via the 'super' keyword.": "Only public instance methods of the base class are accessible via the 'super' keyword.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}'.", - "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}": "Numeric indexer type '{0}' must be a subtype of string indexer type '{1}':{NL}{2}", - "All numerically named properties must be subtypes of numeric indexer type '{0}'.": "All numerically named properties must be subtypes of numeric indexer type '{0}'.", - "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}": "All numerically named properties must be subtypes of numeric indexer type '{0}':{NL}{1}", - "All named properties must be subtypes of string indexer type '{0}'.": "All named properties must be subtypes of string indexer type '{0}'.", - "All named properties must be subtypes of string indexer type '{0}':{NL}{1}": "All named properties must be subtypes of string indexer type '{0}':{NL}{1}", - "Generic type references must include all type arguments.": "Generic type references must include all type arguments.", - "Default arguments are not allowed in an overload parameter.": "Default arguments are not allowed in an overload parameter.", - "Overloads cannot differ only by return type.": "Overloads cannot differ only by return type.", - "Function expression declared a non-void return type, but has no return expression.": "Function expression declared a non-void return type, but has no return expression.", - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - "Could not find symbol '{0}' in module '{1}'.": "Could not find symbol '{0}' in module '{1}'.", - "Unable to resolve module reference '{0}'.": "Unable to resolve module reference '{0}'.", - "Could not find module '{0}' in module '{1}'.": "Could not find module '{0}' in module '{1}'.", - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.": "Type reference '{0}' in extends clause doesn't reference constructor function for '{1}'.", - "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.": "Internal module reference '{0}' in import declaration doesn't reference module instance for '{1}'.", - "Type '{0}' is missing property '{1}' from type '{2}'.": "Type '{0}' is missing property '{1}' from type '{2}'.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - "Types '{0}' and '{1}' define property '{2}' as private.": "Types '{0}' and '{1}' define property '{2}' as private.", - "Call signatures of types '{0}' and '{1}' are incompatible.": "Call signatures of types '{0}' and '{1}' are incompatible.", - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a call signature, but type '{1}' lacks one.": "Type '{0}' requires a call signature, but type '{1}' lacks one.", - "Construct signatures of types '{0}' and '{1}' are incompatible.": "Construct signatures of types '{0}' and '{1}' are incompatible.", - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - "Index signatures of types '{0}' and '{1}' are incompatible.": "Index signatures of types '{0}' and '{1}' are incompatible.", - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - "Call signature expects {0} or fewer parameters.": "Call signature expects {0} or fewer parameters.", - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - "Type reference cannot refer to container '{0}'.": "Type reference cannot refer to container '{0}'.", - "Type reference must refer to type.": "Type reference must refer to type.", - "Enums with multiple declarations must provide an initializer for the first enum element.": "Enums with multiple declarations must provide an initializer for the first enum element.", - " (+ {0} overload(s))": " (+ {0} overload(s))", - "Current host does not support '{0}' option.": "Current host does not support '{0}' option.", - "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.": "ECMAScript target version '{0}' not supported. Using default '{1}' code generation.", - "Module code generation '{0}' not supported.": "Module code generation '{0}' not supported.", - "Could not find file: '{0}'.": "Could not find file: '{0}'.", - "A file cannot have a reference to itself.": "A file cannot have a reference to itself.", - "Cannot resolve referenced file: '{0}'.": "Cannot resolve referenced file: '{0}'.", - "Cannot find the common subdirectory path for the input files.": "Cannot find the common subdirectory path for the input files.", - "Cannot compile external modules when emitting into single file.": "Cannot compile external modules when emitting into single file.", - "Emit Error: {0}.": "Emit Error: {0}.", - "Cannot read file '{0}': {1}": "Cannot read file '{0}': {1}", - "Unsupported file encoding.": "Unsupported file encoding.", - "Locale must be of the form or -. For example '{0}' or '{1}'.": "Locale must be of the form or -. For example '{0}' or '{1}'.", - "Unsupported locale: '{0}'.": "Unsupported locale: '{0}'.", - "Execution Failed.{NL}": "Execution Failed.{NL}", - "Should not emit a type query": "Should not emit a type query", - "Should not emit a type reference": "Should not emit a type reference", - "Invalid call to 'up'": "Invalid call to 'up'", - "Invalid call to 'down'": "Invalid call to 'down'", - "Base64 value '{0}' finished with a continuation bit": "Base64 value '{0}' finished with a continuation bit", - "Key was already in table": "Key was already in table", - "Unknown option '{0}'": "Unknown option '{0}'", - "Expected {0} arguments to message, got {1} instead": "Expected {0} arguments to message, got {1} instead", - "Expected the message '{0}' to have {1} arguments, but it had {2}": "Expected the message '{0}' to have {1} arguments, but it had {2}", - "Invalid argument: {0}. {1}": "Invalid argument: {0}. {1}", - "Invalid argument: {0}.": "Invalid argument: {0}.", - "Argument out of range: {0}.": "Argument out of range: {0}.", - "Argument null: {0}.": "Argument null: {0}.", - "Operation not implemented properly by subclass.": "Operation not implemented properly by subclass.", - "Not yet implemented.": "Not yet implemented.", - "Invalid operation: {0}": "Invalid operation: {0}", - "Invalid operation.": "Invalid operation.", - "Could not delete file '{0}'": "Could not delete file '{0}'", - "Could not create directory '{0}'": "Could not create directory '{0}'", - "Error while executing file '{0}': ": "Error while executing file '{0}': ", - "Cannot compile external modules unless the '--module' flag is provided.": "Cannot compile external modules unless the '--module' flag is provided.", - "Option mapRoot cannot be specified without specifying sourcemap option.": "Option mapRoot cannot be specified without specifying sourcemap option.", - "Option sourceRoot cannot be specified without specifying sourcemap option.": "Option sourceRoot cannot be specified without specifying sourcemap option.", - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - "Concatenate and emit output to single file | Redirect output structure to the directory": "Concatenate and emit output to single file | Redirect output structure to the directory", - "Generates corresponding {0} file": "Generates corresponding {0} file", - "Specifies the location where debugger should locate map files instead of generated locations.": "Specifies the location where debugger should locate map files instead of generated locations.", - "Specifies the location where debugger should locate TypeScript files instead of source locations.": "Specifies the location where debugger should locate TypeScript files instead of source locations.", - "Watch input files": "Watch input files", - "Do not emit comments to output": "Do not emit comments to output", - "Skip resolution and preprocessing": "Skip resolution and preprocessing", - "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"": "Specify ECMAScript target version: \"{0}\" (default), or \"{1}\"", - "Specify module code generation: \"{0}\" or \"{1}\"": "Specify module code generation: \"{0}\" or \"{1}\"", - "Print this message": "Print this message", - "Print the compiler's version: {0}": "Print the compiler's version: {0}", - "Allow use of deprecated \"{0}\" keyword when referencing an external module": "Allow use of deprecated \"{0}\" keyword when referencing an external module", - "Specify locale for errors and messages. For example '{0}' or '{1}'": "Specify locale for errors and messages. For example '{0}' or '{1}'", - "Syntax: {0}": "Syntax: {0}", - "options": "options", - "file": "file", - "Examples:": "Examples:", - "Options:": "Options:", - "Insert command line options and files from a file.": "Insert command line options and files from a file.", - "Version {0}": "Version {0}", - "Use the '{0}' flag to see options": "Use the '{0}' flag to see options", - "{NL}Recompiling ({0}):": "{NL}Recompiling ({0}):", - "STRING": "STRING", - "KIND": "KIND", - "FILE|DIRECTORY": "FILE|DIRECTORY", - "VERSION": "VERSION", - "LOCATION": "LOCATION", - "This version of the Javascript runtime does not support the '{0}' function.": "This version of the Javascript runtime does not support the '{0}' function.", - "Looking up path for identifier token did not result in an identifer.": "Looking up path for identifier token did not result in an identifer.", - "Unknown rule": "Unknown rule", - "Invalid line number ({0})": "Invalid line number ({0})", - "Warn on expressions and declarations with an implied 'any' type.": "Warn on expressions and declarations with an implied 'any' type.", - "Variable '{0}' implicitly has an 'any' type.": "Variable '{0}' implicitly has an 'any' type.", - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - "Parameter '{0}' of function type implicitly has an 'any' type.": "Parameter '{0}' of function type implicitly has an 'any' type.", - "Member '{0}' of object type implicitly has an 'any' type.": "Member '{0}' of object type implicitly has an 'any' type.", - "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.": "\"New\" expression, which lacks a constructor signature, implicitly has an 'any' type.", - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - "Parameter '{0}' of lambda function implicitly has an 'any' type.": "Parameter '{0}' of lambda function implicitly has an 'any' type.", - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - "Array Literal implicitly has an 'any' type from widening.": "Array Literal implicitly has an 'any' type from widening." -} \ No newline at end of file diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/tsc b/node_modules/grunt-typescript/node_modules/typescript/bin/tsc deleted file mode 100755 index 3c0dab5..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/tsc +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('./tsc.js') diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/tsc.js b/node_modules/grunt-typescript/node_modules/typescript/bin/tsc.js deleted file mode 100644 index 01bea50..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/tsc.js +++ /dev/null @@ -1,62790 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -var TypeScript; -(function (TypeScript) { - TypeScript.DiagnosticCode = { - error_TS_0_1: "error TS{0}: {1}", - warning_TS_0_1: "warning TS{0}: {1}", - Unrecognized_escape_sequence: "Unrecognized escape sequence.", - Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", - Identifier_expected: "Identifier expected.", - _0_keyword_expected: "'{0}' keyword expected.", - _0_expected: "'{0}' expected.", - Identifier_expected_0_is_a_keyword: "Identifier expected; '{0}' is a keyword.", - Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", - Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", - Trailing_separator_not_allowed: "Trailing separator not allowed.", - AsteriskSlash_expected: "'*/' expected.", - public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", - Unexpected_token: "Unexpected token.", - Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", - Rest_parameter_must_be_last_in_list: "Rest parameter must be last in list.", - Parameter_cannot_have_question_mark_and_initializer: "Parameter cannot have question mark and initializer.", - Required_parameter_cannot_follow_optional_parameter: "Required parameter cannot follow optional parameter.", - Index_signatures_cannot_have_rest_parameters: "Index signatures cannot have rest parameters.", - Index_signature_parameter_cannot_have_accessibility_modifiers: "Index signature parameter cannot have accessibility modifiers.", - Index_signature_parameter_cannot_have_a_question_mark: "Index signature parameter cannot have a question mark.", - Index_signature_parameter_cannot_have_an_initializer: "Index signature parameter cannot have an initializer.", - Index_signature_must_have_a_type_annotation: "Index signature must have a type annotation.", - Index_signature_parameter_must_have_a_type_annotation: "Index signature parameter must have a type annotation.", - Index_signature_parameter_type_must_be_string_or_number: "Index signature parameter type must be 'string' or 'number'.", - extends_clause_already_seen: "'extends' clause already seen.", - extends_clause_must_precede_implements_clause: "'extends' clause must precede 'implements' clause.", - Classes_can_only_extend_a_single_class: "Classes can only extend a single class.", - implements_clause_already_seen: "'implements' clause already seen.", - Accessibility_modifier_already_seen: "Accessibility modifier already seen.", - _0_modifier_must_precede_1_modifier: "'{0}' modifier must precede '{1}' modifier.", - _0_modifier_already_seen: "'{0}' modifier already seen.", - _0_modifier_cannot_appear_on_a_class_element: "'{0}' modifier cannot appear on a class element.", - Interface_declaration_cannot_have_implements_clause: "Interface declaration cannot have 'implements' clause.", - super_invocation_cannot_have_type_arguments: "'super' invocation cannot have type arguments.", - Only_ambient_modules_can_use_quoted_names: "Only ambient modules can use quoted names.", - Statements_are_not_allowed_in_ambient_contexts: "Statements are not allowed in ambient contexts.", - Implementations_are_not_allowed_in_ambient_contexts: "Implementations are not allowed in ambient contexts.", - declare_modifier_not_allowed_for_code_already_in_an_ambient_context: "'declare' modifier not allowed for code already in an ambient context.", - Initializers_are_not_allowed_in_ambient_contexts: "Initializers are not allowed in ambient contexts.", - Parameter_property_declarations_can_only_be_used_in_a_non_ambient_constructor_declaration: "Parameter property declarations can only be used in a non-ambient constructor declaration.", - Function_implementation_expected: "Function implementation expected.", - Constructor_implementation_expected: "Constructor implementation expected.", - Function_overload_name_must_be_0: "Function overload name must be '{0}'.", - _0_modifier_cannot_appear_on_a_module_element: "'{0}' modifier cannot appear on a module element.", - declare_modifier_cannot_appear_on_an_interface_declaration: "'declare' modifier cannot appear on an interface declaration.", - declare_modifier_required_for_top_level_element: "'declare' modifier required for top level element.", - Rest_parameter_cannot_be_optional: "Rest parameter cannot be optional.", - Rest_parameter_cannot_have_an_initializer: "Rest parameter cannot have an initializer.", - set_accessor_must_have_one_and_only_one_parameter: "'set' accessor must have one and only one parameter.", - set_accessor_parameter_cannot_be_optional: "'set' accessor parameter cannot be optional.", - set_accessor_parameter_cannot_have_an_initializer: "'set' accessor parameter cannot have an initializer.", - set_accessor_cannot_have_rest_parameter: "'set' accessor cannot have rest parameter.", - get_accessor_cannot_have_parameters: "'get' accessor cannot have parameters.", - Modifiers_cannot_appear_here: "Modifiers cannot appear here.", - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: "Accessors are only available when targeting ECMAScript 5 and higher.", - Class_name_cannot_be_0: "Class name cannot be '{0}'.", - Interface_name_cannot_be_0: "Interface name cannot be '{0}'.", - Enum_name_cannot_be_0: "Enum name cannot be '{0}'.", - Module_name_cannot_be_0: "Module name cannot be '{0}'.", - Enum_member_must_have_initializer: "Enum member must have initializer.", - Export_assignment_cannot_be_used_in_internal_modules: "Export assignment cannot be used in internal modules.", - Export_assignment_not_allowed_in_module_with_exported_element: "Export assignment not allowed in module with exported element.", - Module_cannot_have_multiple_export_assignments: "Module cannot have multiple export assignments.", - Ambient_enum_elements_can_only_have_integer_literal_initializers: "Ambient enum elements can only have integer literal initializers.", - module_class_interface_enum_import_or_statement: "module, class, interface, enum, import or statement", - constructor_function_accessor_or_variable: "constructor, function, accessor or variable", - statement: "statement", - case_or_default_clause: "case or default clause", - identifier: "identifier", - call_construct_index_property_or_function_signature: "call, construct, index, property or function signature", - expression: "expression", - type_name: "type name", - property_or_accessor: "property or accessor", - parameter: "parameter", - type: "type", - type_parameter: "type parameter", - declare_modifier_not_allowed_on_import_declaration: "'declare' modifier not allowed on import declaration.", - Function_overload_must_be_static: "Function overload must be static.", - Function_overload_must_not_be_static: "Function overload must not be static.", - Parameter_property_declarations_cannot_be_used_in_a_constructor_overload: "Parameter property declarations cannot be used in a constructor overload.", - Invalid_reference_directive_syntax: "Invalid 'reference' directive syntax.", - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: "Octal literals are not available when targeting ECMAScript 5 and higher.", - Accessors_are_not_allowed_in_ambient_contexts: "Accessors are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_constructor_declaration: "'{0}' modifier cannot appear on a constructor declaration.", - _0_modifier_cannot_appear_on_a_parameter: "'{0}' modifier cannot appear on a parameter.", - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: "Only a single variable declaration is allowed in a 'for...in' statement.", - Type_parameters_cannot_appear_on_a_constructor_declaration: "Type parameters cannot appear on a constructor declaration.", - Type_annotation_cannot_appear_on_a_constructor_declaration: "Type annotation cannot appear on a constructor declaration.", - Duplicate_identifier_0: "Duplicate identifier '{0}'.", - The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", - The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", - super_can_only_be_used_inside_a_class_instance_method: "'super' can only be used inside a class instance method.", - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: "The left-hand side of an assignment expression must be a variable, property or indexer.", - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: "Value of type '{0}' is not callable. Did you mean to include 'new'?", - Value_of_type_0_is_not_callable: "Value of type '{0}' is not callable.", - Value_of_type_0_is_not_newable: "Value of type '{0}' is not newable.", - Value_of_type_0_is_not_indexable_by_type_1: "Value of type '{0}' is not indexable by type '{1}'.", - Operator_0_cannot_be_applied_to_types_1_and_2: "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - Operator_0_cannot_be_applied_to_types_1_and_2_3: "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - Cannot_convert_0_to_1: "Cannot convert '{0}' to '{1}'.", - Cannot_convert_0_to_1_NL_2: "Cannot convert '{0}' to '{1}':{NL}{2}", - Expected_var_class_interface_or_module: "Expected var, class, interface, or module.", - Operator_0_cannot_be_applied_to_type_1: "Operator '{0}' cannot be applied to type '{1}'.", - Getter_0_already_declared: "Getter '{0}' already declared.", - Setter_0_already_declared: "Setter '{0}' already declared.", - Exported_class_0_extends_private_class_1: "Exported class '{0}' extends private class '{1}'.", - Exported_class_0_implements_private_interface_1: "Exported class '{0}' implements private interface '{1}'.", - Exported_interface_0_extends_private_interface_1: "Exported interface '{0}' extends private interface '{1}'.", - Exported_class_0_extends_class_from_inaccessible_module_1: "Exported class '{0}' extends class from inaccessible module {1}.", - Exported_class_0_implements_interface_from_inaccessible_module_1: "Exported class '{0}' implements interface from inaccessible module {1}.", - Exported_interface_0_extends_interface_from_inaccessible_module_1: "Exported interface '{0}' extends interface from inaccessible module {1}.", - Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: "Public static property '{0}' of exported class has or is using private type '{1}'.", - Public_property_0_of_exported_class_has_or_is_using_private_type_1: "Public property '{0}' of exported class has or is using private type '{1}'.", - Property_0_of_exported_interface_has_or_is_using_private_type_1: "Property '{0}' of exported interface has or is using private type '{1}'.", - Exported_variable_0_has_or_is_using_private_type_1: "Exported variable '{0}' has or is using private type '{1}'.", - Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: "Public static property '{0}' of exported class is using inaccessible module {1}.", - Public_property_0_of_exported_class_is_using_inaccessible_module_1: "Public property '{0}' of exported class is using inaccessible module {1}.", - Property_0_of_exported_interface_is_using_inaccessible_module_1: "Property '{0}' of exported interface is using inaccessible module {1}.", - Exported_variable_0_is_using_inaccessible_module_1: "Exported variable '{0}' is using inaccessible module {1}.", - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - Parameter_0_of_exported_function_has_or_is_using_private_type_1: "Parameter '{0}' of exported function has or is using private type '{1}'.", - Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - Parameter_0_of_exported_function_is_using_inaccessible_module_1: "Parameter '{0}' of exported function is using inaccessible module {1}.", - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public static property getter from exported class has or is using private type '{0}'.", - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public property getter from exported class has or is using private type '{0}'.", - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of constructor signature from exported interface has or is using private type '{0}'.", - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of call signature from exported interface has or is using private type '{0}'.", - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of index signature from exported interface has or is using private type '{0}'.", - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public static method from exported class has or is using private type '{0}'.", - Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public method from exported class has or is using private type '{0}'.", - Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: "Return type of method from exported interface has or is using private type '{0}'.", - Return_type_of_exported_function_has_or_is_using_private_type_0: "Return type of exported function has or is using private type '{0}'.", - Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public static property getter from exported class is using inaccessible module {0}.", - Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public property getter from exported class is using inaccessible module {0}.", - Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of constructor signature from exported interface is using inaccessible module {0}.", - Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of call signature from exported interface is using inaccessible module {0}.", - Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of index signature from exported interface is using inaccessible module {0}.", - Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public static method from exported class is using inaccessible module {0}.", - Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public method from exported class is using inaccessible module {0}.", - Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: "Return type of method from exported interface is using inaccessible module {0}.", - Return_type_of_exported_function_is_using_inaccessible_module_0: "Return type of exported function is using inaccessible module {0}.", - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - A_parameter_list_must_follow_a_generic_type_argument_list_expected: "A parameter list must follow a generic type argument list. '(' expected.", - Multiple_constructor_implementations_are_not_allowed: "Multiple constructor implementations are not allowed.", - Unable_to_resolve_external_module_0: "Unable to resolve external module '{0}'.", - Module_cannot_be_aliased_to_a_non_module_type: "Module cannot be aliased to a non-module type.", - A_class_may_only_extend_another_class: "A class may only extend another class.", - A_class_may_only_implement_another_class_or_interface: "A class may only implement another class or interface.", - An_interface_may_only_extend_another_class_or_interface: "An interface may only extend another class or interface.", - Unable_to_resolve_type: "Unable to resolve type.", - Unable_to_resolve_type_of_0: "Unable to resolve type of '{0}'.", - Unable_to_resolve_type_parameter_constraint: "Unable to resolve type parameter constraint.", - Type_parameter_constraint_cannot_be_a_primitive_type: "Type parameter constraint cannot be a primitive type.", - Supplied_parameters_do_not_match_any_signature_of_call_target: "Supplied parameters do not match any signature of call target.", - Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: "Supplied parameters do not match any signature of call target:{NL}{0}", - Invalid_new_expression: "Invalid 'new' expression.", - Call_signatures_used_in_a_new_expression_must_have_a_void_return_type: "Call signatures used in a 'new' expression must have a 'void' return type.", - Could_not_select_overload_for_new_expression: "Could not select overload for 'new' expression.", - Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2: "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - Could_not_select_overload_for_call_expression: "Could not select overload for 'call' expression.", - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: "Cannot invoke an expression whose type lacks a call signature.", - Calls_to_super_are_only_valid_inside_a_class: "Calls to 'super' are only valid inside a class.", - Generic_type_0_requires_1_type_argument_s: "Generic type '{0}' requires {1} type argument(s).", - Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: "Type of array literal cannot be determined. Best common type could not be found for array elements.", - Could_not_find_enclosing_symbol_for_dotted_name_0: "Could not find enclosing symbol for dotted name '{0}'.", - The_property_0_does_not_exist_on_value_of_type_1: "The property '{0}' does not exist on value of type '{1}'.", - Could_not_find_symbol_0: "Could not find symbol '{0}'.", - get_and_set_accessor_must_have_the_same_type: "'get' and 'set' accessor must have the same type.", - this_cannot_be_referenced_in_current_location: "'this' cannot be referenced in current location.", - Static_members_cannot_reference_class_type_parameters: "Static members cannot reference class type parameters.", - Class_0_is_recursively_referenced_as_a_base_type_of_itself: "Class '{0}' is recursively referenced as a base type of itself.", - Interface_0_is_recursively_referenced_as_a_base_type_of_itself: "Interface '{0}' is recursively referenced as a base type of itself.", - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.", - super_cannot_be_referenced_in_non_derived_classes: "'super' cannot be referenced in non-derived classes.", - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - Constructors_for_derived_classes_must_contain_a_super_call: "Constructors for derived classes must contain a 'super' call.", - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: "Super calls are not permitted outside constructors or in nested functions inside constructors.", - _0_1_is_inaccessible: "'{0}.{1}' is inaccessible.", - this_cannot_be_referenced_within_module_bodies: "'this' cannot be referenced within module bodies.", - Invalid_expression_types_not_known_to_support_the_addition_operator: "Invalid '+' expression - types not known to support the addition operator.", - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type: "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: "Variable declarations of a 'for' statement cannot use a type annotation.", - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.", - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.", - Setters_cannot_return_a_value: "Setters cannot return a value.", - Tried_to_query_type_of_uninitialized_module_0: "Tried to query type of uninitialized module '{0}'.", - Tried_to_set_variable_type_to_uninitialized_module_type_0: "Tried to set variable type to uninitialized module type '{0}'.", - Type_0_does_not_have_type_parameters: "Type '{0}' does not have type parameters.", - Getters_must_return_a_value: "Getters must return a value.", - Getter_and_setter_accessors_do_not_agree_in_visibility: "Getter and setter accessors do not agree in visibility.", - Invalid_left_hand_side_of_assignment_expression: "Invalid left-hand side of assignment expression.", - Function_declared_a_non_void_return_type_but_has_no_return_expression: "Function declared a non-void return type, but has no return expression.", - Cannot_resolve_return_type_reference: "Cannot resolve return type reference.", - Constructors_cannot_have_a_return_type_of_void: "Constructors cannot have a return type of 'void'.", - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - All_symbols_within_a_with_block_will_be_resolved_to_any: "All symbols within a with block will be resolved to 'any'.", - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: "Import declarations in an internal module cannot reference an external module.", - Class_0_declares_interface_1_but_does_not_implement_it_NL_2: "Class {0} declares interface {1} but does not implement it:{NL}{2}", - Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: "The operand of an increment or decrement operator must be a variable, property or indexer.", - this_cannot_be_referenced_in_static_initializers_in_a_class_body: "'this' cannot be referenced in static initializers in a class body.", - Class_0_cannot_extend_class_1_NL_2: "Class '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_class_1_NL_2: "Interface '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_interface_1_NL_2: "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - Duplicate_overload_signature_for_0: "Duplicate overload signature for '{0}'.", - Duplicate_constructor_overload_signature: "Duplicate constructor overload signature.", - Duplicate_overload_call_signature: "Duplicate overload call signature.", - Duplicate_overload_construct_signature: "Duplicate overload construct signature.", - Overload_signature_is_not_compatible_with_function_definition: "Overload signature is not compatible with function definition.", - Overload_signature_is_not_compatible_with_function_definition_NL_0: "Overload signature is not compatible with function definition:{NL}{0}", - Overload_signatures_must_all_be_public_or_private: "Overload signatures must all be public or private.", - Overload_signatures_must_all_be_exported_or_not_exported: "Overload signatures must all be exported or not exported.", - Overload_signatures_must_all_be_ambient_or_non_ambient: "Overload signatures must all be ambient or non-ambient.", - Overload_signatures_must_all_be_optional_or_required: "Overload signatures must all be optional or required.", - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: "Specialized overload signature is not assignable to any non-specialized signature.", - this_cannot_be_referenced_in_constructor_arguments: "'this' cannot be referenced in constructor arguments.", - Instance_member_cannot_be_accessed_off_a_class: "Instance member cannot be accessed off a class.", - Untyped_function_calls_may_not_accept_type_arguments: "Untyped function calls may not accept type arguments.", - Non_generic_functions_may_not_accept_type_arguments: "Non-generic functions may not accept type arguments.", - A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: "A generic type may not reference itself with a wrapped form of its own type parameters.", - Rest_parameters_must_be_array_types: "Rest parameters must be array types.", - Overload_signature_implementation_cannot_use_specialized_type: "Overload signature implementation cannot use specialized type.", - Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: "Export assignments may only be used at the top-level of external modules.", - Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.", - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: "Only public methods of the base class are accessible via the 'super' keyword.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: "All numerically named properties must be assignable to numeric indexer type '{0}'.", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}", - All_named_properties_must_be_assignable_to_string_indexer_type_0: "All named properties must be assignable to string indexer type '{0}'.", - All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: "All named properties must be assignable to string indexer type '{0}':{NL}{1}", - Generic_type_references_must_include_all_type_arguments: "Generic type references must include all type arguments.", - Default_arguments_are_only_allowed_in_implementation: "Default arguments are only allowed in implementation.", - Overloads_cannot_differ_only_by_return_type: "Overloads cannot differ only by return type.", - Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: "Function expression declared a non-void return type, but has no return expression.", - Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - Could_not_find_symbol_0_in_module_1: "Could not find symbol '{0}' in module '{1}'.", - Unable_to_resolve_module_reference_0: "Unable to resolve module reference '{0}'.", - Could_not_find_module_0_in_module_1: "Could not find module '{0}' in module '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: "Type name '{0}' in extends clause does not reference constructor function for '{1}'.", - Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.", - Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.", - Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}", - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.", - Ambient_external_module_declaration_cannot_be_reopened: "Ambient external module declaration cannot be reopened.", - All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: "All declarations of merged declaration '{0}' must be exported or not exported.", - super_cannot_be_referenced_in_constructor_arguments: "'super' cannot be referenced in constructor arguments.", - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: "Return type of constructor signature must be assignable to the instance type of the class.", - Ambient_external_module_declaration_must_be_defined_in_global_context: "Ambient external module declaration must be defined in global context.", - Ambient_external_module_declaration_cannot_specify_relative_module_name: "Ambient external module declaration cannot specify relative module name.", - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.", - Could_not_find_the_best_common_type_of_types_of_all_return_statement_expressions: "Could not find the best common type of types of all return statement expressions.", - Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: "Import declaration cannot refer to external module reference when --noResolve option is set.", - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.", - continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: "'continue' statement can only be used within an enclosing iteration statement.", - break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: "'break' statement can only be used within an enclosing iteration or switch statement.", - Jump_target_not_found: "Jump target not found.", - Jump_target_cannot_cross_function_boundary: "Jump target cannot cross function boundary.", - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.", - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.", - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: "Expression resolves to '_super' that compiler uses to capture base class reference.", - TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported function has or is using private type '{1}'.", - TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}", - TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported function is using inaccessible module {1}.", - TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported class has or is using private type '{1}'.", - TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported class is using inaccessible module {1}.", - TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported interface is using inaccessible module {1}.", - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.", - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", - Type_of_conditional_0_must_be_identical_to_1_or_2: "Type of conditional '{0}' must be identical to '{1}' or '{2}'.", - Type_of_conditional_0_must_be_identical_to_1_2_or_3: "Type of conditional '{0}' must be identical to '{1}', '{2}' or '{3}'.", - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.", - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.", - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.", - Parameter_0_cannot_be_referenced_in_its_initializer: "Parameter '{0}' cannot be referenced in its initializer.", - Duplicate_string_index_signature: "Duplicate string index signature.", - Duplicate_number_index_signature: "Duplicate number index signature.", - All_declarations_of_an_interface_must_have_identical_type_parameters: "All declarations of an interface must have identical type parameters.", - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.", - Type_0_is_missing_property_1_from_type_2: "Type '{0}' is missing property '{1}' from type '{2}'.", - Types_of_property_0_of_types_1_and_2_are_incompatible: "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_property_2_as_private: "Types '{0}' and '{1}' define property '{2}' as private.", - Call_signatures_of_types_0_and_1_are_incompatible: "Call signatures of types '{0}' and '{1}' are incompatible.", - Call_signatures_of_types_0_and_1_are_incompatible_NL_2: "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_call_signature_but_type_1_lacks_one: "Type '{0}' requires a call signature, but type '{1}' lacks one.", - Construct_signatures_of_types_0_and_1_are_incompatible: "Construct signatures of types '{0}' and '{1}' are incompatible.", - Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_construct_signature_but_type_1_lacks_one: "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - Index_signatures_of_types_0_and_1_are_incompatible: "Index signatures of types '{0}' and '{1}' are incompatible.", - Index_signatures_of_types_0_and_1_are_incompatible_NL_2: "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Call_signature_expects_0_or_fewer_parameters: "Call signature expects {0} or fewer parameters.", - Could_not_apply_type_0_to_argument_1_which_is_of_type_2: "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - Type_reference_cannot_refer_to_container_0: "Type reference cannot refer to container '{0}'.", - Type_reference_must_refer_to_type: "Type reference must refer to type.", - In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.", - _0_overload_s: " (+ {0} overload(s))", - Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: "Variable declaration cannot have the same name as an import declaration.", - Signature_expected_0_type_arguments_got_1_instead: "Signature expected {0} type arguments, got {1} instead.", - Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}", - Named_properties_0_of_types_1_and_2_are_not_identical: "Named properties '{0}' of types '{1}' and '{2}' are not identical.", - Types_of_string_indexer_of_types_0_and_1_are_not_identical: "Types of string indexer of types '{0}' and '{1}' are not identical.", - Types_of_number_indexer_of_types_0_and_1_are_not_identical: "Types of number indexer of types '{0}' and '{1}' are not identical.", - Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}", - Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}", - Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}", - Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_static_property_2_as_private: "Types '{0}' and '{1}' define static property '{2}' as private.", - Current_host_does_not_support_0_option: "Current host does not support '{0}' option.", - ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'", - Module_code_generation_0_not_supported: "Module code generation '{0}' not supported.", - Could_not_find_file_0: "Could not find file: '{0}'.", - A_file_cannot_have_a_reference_to_itself: "A file cannot have a reference to itself.", - Cannot_resolve_referenced_file_0: "Cannot resolve referenced file: '{0}'.", - Cannot_find_the_common_subdirectory_path_for_the_input_files: "Cannot find the common subdirectory path for the input files.", - Emit_Error_0: "Emit Error: {0}.", - Cannot_read_file_0_1: "Cannot read file '{0}': {1}", - Unsupported_file_encoding: "Unsupported file encoding.", - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: "Locale must be of the form or -. For example '{0}' or '{1}'.", - Unsupported_locale_0: "Unsupported locale: '{0}'.", - Execution_Failed_NL: "Execution Failed.{NL}", - Invalid_call_to_up: "Invalid call to 'up'", - Invalid_call_to_down: "Invalid call to 'down'", - Base64_value_0_finished_with_a_continuation_bit: "Base64 value '{0}' finished with a continuation bit.", - Unknown_option_0: "Unknown option '{0}'", - Expected_0_arguments_to_message_got_1_instead: "Expected {0} arguments to message, got {1} instead.", - Expected_the_message_0_to_have_1_arguments_but_it_had_2: "Expected the message '{0}' to have {1} arguments, but it had {2}", - Could_not_delete_file_0: "Could not delete file '{0}'", - Could_not_create_directory_0: "Could not create directory '{0}'", - Error_while_executing_file_0: "Error while executing file '{0}': ", - Cannot_compile_external_modules_unless_the_module_flag_is_provided: "Cannot compile external modules unless the '--module' flag is provided.", - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option mapRoot cannot be specified without specifying sourcemap option.", - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option sourceRoot cannot be specified without specifying sourcemap option.", - Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - Option_0_specified_without_1: "Option '{0}' specified without '{1}'", - codepage_option_not_supported_on_current_platform: "'codepage' option not supported on current platform.", - Concatenate_and_emit_output_to_single_file: "Concatenate and emit output to single file.", - Generates_corresponding_0_file: "Generates corresponding {0} file.", - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: "Specifies the location where debugger should locate map files instead of generated locations.", - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: "Specifies the location where debugger should locate TypeScript files instead of source locations.", - Watch_input_files: "Watch input files.", - Redirect_output_structure_to_the_directory: "Redirect output structure to the directory.", - Do_not_emit_comments_to_output: "Do not emit comments to output.", - Skip_resolution_and_preprocessing: "Skip resolution and preprocessing.", - Specify_ECMAScript_target_version_0_default_or_1: "Specify ECMAScript target version: '{0}' (default), or '{1}'", - Specify_module_code_generation_0_or_1: "Specify module code generation: '{0}' or '{1}'", - Print_this_message: "Print this message.", - Print_the_compiler_s_version_0: "Print the compiler's version: {0}", - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: "Allow use of deprecated '{0}' keyword when referencing an external module.", - Specify_locale_for_errors_and_messages_For_example_0_or_1: "Specify locale for errors and messages. For example '{0}' or '{1}'", - Syntax_0: "Syntax: {0}", - options: "options", - file1: "file", - Examples: "Examples:", - Options: "Options:", - Insert_command_line_options_and_files_from_a_file: "Insert command line options and files from a file.", - Version_0: "Version {0}", - Use_the_0_flag_to_see_options: "Use the '{0}' flag to see options.", - NL_Recompiling_0: "{NL}Recompiling ({0}):", - STRING: "STRING", - KIND: "KIND", - file2: "FILE", - VERSION: "VERSION", - LOCATION: "LOCATION", - DIRECTORY: "DIRECTORY", - NUMBER: "NUMBER", - Specify_the_codepage_to_use_when_opening_source_files: "Specify the codepage to use when opening source files.", - Additional_locations: "Additional locations:", - This_version_of_the_Javascript_runtime_does_not_support_the_0_function: "This version of the Javascript runtime does not support the '{0}' function.", - Unknown_rule: "Unknown rule.", - Invalid_line_number_0: "Invalid line number ({0})", - Warn_on_expressions_and_declarations_with_an_implied_any_type: "Warn on expressions and declarations with an implied 'any' type.", - Variable_0_implicitly_has_an_any_type: "Variable '{0}' implicitly has an 'any' type.", - Parameter_0_of_1_implicitly_has_an_any_type: "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - Parameter_0_of_function_type_implicitly_has_an_any_type: "Parameter '{0}' of function type implicitly has an 'any' type.", - Member_0_of_object_type_implicitly_has_an_any_type: "Member '{0}' of object type implicitly has an 'any' type.", - new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.", - _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - Parameter_0_of_lambda_function_implicitly_has_an_any_type: "Parameter '{0}' of lambda function implicitly has an 'any' type.", - Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - Array_Literal_implicitly_has_an_any_type_from_widening: "Array Literal implicitly has an 'any' type from widening.", - _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.", - Index_signature_of_object_type_implicitly_has_an_any_type: "Index signature of object type implicitly has an 'any' type.", - Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: "Object literal's property '{0}' implicitly has an 'any' type from widening." - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ArrayUtilities = (function () { - function ArrayUtilities() { - } - ArrayUtilities.isArray = function (value) { - return Object.prototype.toString.apply(value, []) === '[object Array]'; - }; - - ArrayUtilities.sequenceEquals = function (array1, array2, equals) { - if (array1 === array2) { - return true; - } - - if (array1 === null || array2 === null) { - return false; - } - - if (array1.length !== array2.length) { - return false; - } - - for (var i = 0, n = array1.length; i < n; i++) { - if (!equals(array1[i], array2[i])) { - return false; - } - } - - return true; - }; - - ArrayUtilities.contains = function (array, value) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return true; - } - } - - return false; - }; - - ArrayUtilities.groupBy = function (array, func) { - var result = {}; - - for (var i = 0, n = array.length; i < n; i++) { - var v = array[i]; - var k = func(v); - - var list = result[k] || []; - list.push(v); - result[k] = list; - } - - return result; - }; - - ArrayUtilities.distinct = function (array, equalsFn) { - var result = []; - - for (var i = 0, n = array.length; i < n; i++) { - var current = array[i]; - for (var j = 0; j < result.length; j++) { - if (equalsFn(result[j], current)) { - break; - } - } - - if (j === result.length) { - result.push(current); - } - } - - return result; - }; - - ArrayUtilities.min = function (array, func) { - var min = func(array[0]); - - for (var i = 1; i < array.length; i++) { - var next = func(array[i]); - if (next < min) { - min = next; - } - } - - return min; - }; - - ArrayUtilities.max = function (array, func) { - var max = func(array[0]); - - for (var i = 1; i < array.length; i++) { - var next = func(array[i]); - if (next > max) { - max = next; - } - } - - return max; - }; - - ArrayUtilities.last = function (array) { - if (array.length === 0) { - throw TypeScript.Errors.argumentOutOfRange('array'); - } - - return array[array.length - 1]; - }; - - ArrayUtilities.lastOrDefault = function (array, predicate) { - for (var i = array.length - 1; i >= 0; i--) { - var v = array[i]; - if (predicate(v, i)) { - return v; - } - } - - return null; - }; - - ArrayUtilities.firstOrDefault = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (func(value, i)) { - return value; - } - } - - return null; - }; - - ArrayUtilities.first = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (!func || func(value, i)) { - return value; - } - } - - throw TypeScript.Errors.invalidOperation(); - }; - - ArrayUtilities.sum = function (array, func) { - var result = 0; - - for (var i = 0, n = array.length; i < n; i++) { - result += func(array[i]); - } - - return result; - }; - - ArrayUtilities.select = function (values, func) { - var result = new Array(values.length); - - for (var i = 0; i < values.length; i++) { - result[i] = func(values[i]); - } - - return result; - }; - - ArrayUtilities.where = function (values, func) { - var result = new Array(); - - for (var i = 0; i < values.length; i++) { - if (func(values[i])) { - result.push(values[i]); - } - } - - return result; - }; - - ArrayUtilities.any = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (func(array[i])) { - return true; - } - } - - return false; - }; - - ArrayUtilities.all = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (!func(array[i])) { - return false; - } - } - - return true; - }; - - ArrayUtilities.binarySearch = function (array, value) { - var low = 0; - var high = array.length - 1; - - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - - if (midValue === value) { - return middle; - } else if (midValue > value) { - high = middle - 1; - } else { - low = middle + 1; - } - } - - return ~low; - }; - - ArrayUtilities.createArray = function (length, defaultValue) { - var result = new Array(length); - for (var i = 0; i < length; i++) { - result[i] = defaultValue; - } - - return result; - }; - - ArrayUtilities.grow = function (array, length, defaultValue) { - var count = length - array.length; - for (var i = 0; i < count; i++) { - array.push(defaultValue); - } - }; - - ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (var i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - }; - - ArrayUtilities.indexOf = function (array, predicate) { - for (var i = 0, n = array.length; i < n; i++) { - if (predicate(array[i])) { - return i; - } - } - - return -1; - }; - return ArrayUtilities; - })(); - TypeScript.ArrayUtilities = ArrayUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (BitVector) { - var pool = []; - var Constants; - (function (Constants) { - Constants[Constants["MaxBitsPerEncodedNumber"] = 30] = "MaxBitsPerEncodedNumber"; - Constants[Constants["BitsPerEncodedBiStateValue"] = 1] = "BitsPerEncodedBiStateValue"; - - Constants[Constants["BitsPerEncodedTriStateValue"] = 2] = "BitsPerEncodedTriStateValue"; - - Constants[Constants["BiStateEncodedTrue"] = 1] = "BiStateEncodedTrue"; - Constants[Constants["BiStateClearBitsMask"] = 1] = "BiStateClearBitsMask"; - - Constants[Constants["TriStateEncodedFalse"] = 1] = "TriStateEncodedFalse"; - Constants[Constants["TriStateEncodedTrue"] = 2] = "TriStateEncodedTrue"; - Constants[Constants["TriStateClearBitsMask"] = 3] = "TriStateClearBitsMask"; - })(Constants || (Constants = {})); - - var BitVectorImpl = (function () { - function BitVectorImpl(allowUndefinedValues) { - this.allowUndefinedValues = allowUndefinedValues; - this.isReleased = false; - this.bits = []; - } - BitVectorImpl.prototype.computeTriStateArrayIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 2 /* BitsPerEncodedTriStateValue */; - - return (index / encodedValuesPerNumber) >>> 0; - }; - - BitVectorImpl.prototype.computeBiStateArrayIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 1 /* BitsPerEncodedBiStateValue */; - - return (index / encodedValuesPerNumber) >>> 0; - }; - - BitVectorImpl.prototype.computeTriStateEncodedValueIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 2 /* BitsPerEncodedTriStateValue */; - - return (index % encodedValuesPerNumber) * 2 /* BitsPerEncodedTriStateValue */; - }; - - BitVectorImpl.prototype.computeBiStateEncodedValueIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 1 /* BitsPerEncodedBiStateValue */; - - return (index % encodedValuesPerNumber) * 1 /* BitsPerEncodedBiStateValue */; - }; - - BitVectorImpl.prototype.valueAt = function (index) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - if (this.allowUndefinedValues) { - var arrayIndex = this.computeTriStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - return undefined; - } - - var bitIndex = this.computeTriStateEncodedValueIndex(index); - if (encoded & (2 /* TriStateEncodedTrue */ << bitIndex)) { - return true; - } else if (encoded & (1 /* TriStateEncodedFalse */ << bitIndex)) { - return false; - } else { - return undefined; - } - } else { - var arrayIndex = this.computeBiStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - return false; - } - - var bitIndex = this.computeBiStateEncodedValueIndex(index); - if (encoded & (1 /* BiStateEncodedTrue */ << bitIndex)) { - return true; - } else { - return false; - } - } - }; - - BitVectorImpl.prototype.setValueAt = function (index, value) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - if (this.allowUndefinedValues) { - TypeScript.Debug.assert(value === true || value === false || value === undefined, "value must only be true, false or undefined."); - - var arrayIndex = this.computeTriStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - if (value === undefined) { - return; - } - - encoded = 0; - } - - var bitIndex = this.computeTriStateEncodedValueIndex(index); - - var clearMask = ~(3 /* TriStateClearBitsMask */ << bitIndex); - encoded = encoded & clearMask; - - if (value === true) { - encoded = encoded | (2 /* TriStateEncodedTrue */ << bitIndex); - } else if (value === false) { - encoded = encoded | (1 /* TriStateEncodedFalse */ << bitIndex); - } - - this.bits[arrayIndex] = encoded; - } else { - TypeScript.Debug.assert(value === true || value === false, "value must only be true or false."); - - var arrayIndex = this.computeBiStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - if (value === false) { - return; - } - - encoded = 0; - } - - var bitIndex = this.computeBiStateEncodedValueIndex(index); - - encoded = encoded & ~(1 /* BiStateClearBitsMask */ << bitIndex); - - if (value) { - encoded = encoded | (1 /* BiStateEncodedTrue */ << bitIndex); - } - - this.bits[arrayIndex] = encoded; - } - }; - - BitVectorImpl.prototype.release = function () { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - this.isReleased = true; - this.bits.length = 0; - pool.push(this); - }; - return BitVectorImpl; - })(); - - function getBitVector(allowUndefinedValues) { - if (pool.length === 0) { - return new BitVectorImpl(allowUndefinedValues); - } - - var vector = pool.pop(); - vector.isReleased = false; - vector.allowUndefinedValues = allowUndefinedValues; - - return vector; - } - BitVector.getBitVector = getBitVector; - })(TypeScript.BitVector || (TypeScript.BitVector = {})); - var BitVector = TypeScript.BitVector; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (BitMatrix) { - var pool = []; - - var BitMatrixImpl = (function () { - function BitMatrixImpl(allowUndefinedValues) { - this.allowUndefinedValues = allowUndefinedValues; - this.isReleased = false; - this.vectors = []; - } - BitMatrixImpl.prototype.valueAt = function (x, y) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - var vector = this.vectors[x]; - if (!vector) { - return this.allowUndefinedValues ? undefined : false; - } - - return vector.valueAt(y); - }; - - BitMatrixImpl.prototype.setValueAt = function (x, y, value) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - var vector = this.vectors[x]; - if (!vector) { - if (value === undefined) { - return; - } - - vector = TypeScript.BitVector.getBitVector(this.allowUndefinedValues); - this.vectors[x] = vector; - } - - vector.setValueAt(y, value); - }; - - BitMatrixImpl.prototype.release = function () { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - this.isReleased = true; - - for (var name in this.vectors) { - if (this.vectors.hasOwnProperty(name)) { - var vector = this.vectors[name]; - vector.release(); - } - } - - this.vectors.length = 0; - pool.push(this); - }; - return BitMatrixImpl; - })(); - - function getBitMatrix(allowUndefinedValues) { - if (pool.length === 0) { - return new BitMatrixImpl(allowUndefinedValues); - } - - var matrix = pool.pop(); - matrix.isReleased = false; - matrix.allowUndefinedValues = allowUndefinedValues; - - return matrix; - } - BitMatrix.getBitMatrix = getBitMatrix; - })(TypeScript.BitMatrix || (TypeScript.BitMatrix = {})); - var BitMatrix = TypeScript.BitMatrix; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Constants) { - Constants[Constants["Max31BitInteger"] = 1073741823] = "Max31BitInteger"; - Constants[Constants["Min31BitInteger"] = -1073741824] = "Min31BitInteger"; - })(TypeScript.Constants || (TypeScript.Constants = {})); - var Constants = TypeScript.Constants; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(TypeScript.AssertionLevel || (TypeScript.AssertionLevel = {})); - var AssertionLevel = TypeScript.AssertionLevel; - - var Debug = (function () { - function Debug() { - } - Debug.shouldAssert = function (level) { - return this.currentAssertionLevel >= level; - }; - - Debug.assert = function (expression, message, verboseDebugInfo) { - if (typeof message === "undefined") { message = ""; } - if (typeof verboseDebugInfo === "undefined") { verboseDebugInfo = null; } - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); - } - - throw new Error("Debug Failure. False expression: " + message + verboseDebugString); - } - }; - - Debug.fail = function (message) { - Debug.assert(false, message); - }; - Debug.currentAssertionLevel = 0 /* None */; - return Debug; - })(); - TypeScript.Debug = Debug; -})(TypeScript || (TypeScript = {})); -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var TypeScript; -(function (TypeScript) { - TypeScript.LocalizedDiagnosticMessages = null; - - var Location = (function () { - function Location(fileName, lineMap, start, length) { - this._fileName = fileName; - this._lineMap = lineMap; - this._start = start; - this._length = length; - } - Location.prototype.fileName = function () { - return this._fileName; - }; - - Location.prototype.lineMap = function () { - return this._lineMap; - }; - - Location.prototype.line = function () { - return this._lineMap ? this._lineMap.getLineNumberFromPosition(this.start()) : 0; - }; - - Location.prototype.character = function () { - return this._lineMap ? this._lineMap.getLineAndCharacterFromPosition(this.start()).character() : 0; - }; - - Location.prototype.start = function () { - return this._start; - }; - - Location.prototype.length = function () { - return this._length; - }; - - Location.equals = function (location1, location2) { - return location1._fileName === location2._fileName && location1._start === location2._start && location1._length === location2._length; - }; - return Location; - })(); - TypeScript.Location = Location; - - var Diagnostic = (function (_super) { - __extends(Diagnostic, _super); - function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - _super.call(this, fileName, lineMap, start, length); - this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; - } - Diagnostic.prototype.toJSON = function (key) { - var result = {}; - result.start = this.start(); - result.length = this.length(); - - result.diagnosticCode = this._diagnosticKey; - - var _arguments = this.arguments(); - if (_arguments && _arguments.length > 0) { - result.arguments = _arguments; - } - - return result; - }; - - Diagnostic.prototype.diagnosticKey = function () { - return this._diagnosticKey; - }; - - Diagnostic.prototype.arguments = function () { - return this._arguments; - }; - - Diagnostic.prototype.text = function () { - return TypeScript.getLocalizedText(this._diagnosticKey, this._arguments); - }; - - Diagnostic.prototype.message = function () { - return TypeScript.getDiagnosticMessage(this._diagnosticKey, this._arguments); - }; - - Diagnostic.prototype.additionalLocations = function () { - return this._additionalLocations || []; - }; - - Diagnostic.equals = function (diagnostic1, diagnostic2) { - return Location.equals(diagnostic1, diagnostic2) && diagnostic1._diagnosticKey === diagnostic2._diagnosticKey && TypeScript.ArrayUtilities.sequenceEquals(diagnostic1._arguments, diagnostic2._arguments, function (v1, v2) { - return v1 === v2; - }); - }; - - Diagnostic.prototype.info = function () { - return getDiagnosticInfoFromKey(this.diagnosticKey()); - }; - return Diagnostic; - })(Location); - TypeScript.Diagnostic = Diagnostic; - - function newLine() { - return TypeScript.Environment ? TypeScript.Environment.newLine : "\r\n"; - } - TypeScript.newLine = newLine; - - function getLargestIndex(diagnostic) { - var largest = -1; - var regex = /\{(\d+)\}/g; - - var match; - while (match = regex.exec(diagnostic)) { - var val = parseInt(match[1]); - if (!isNaN(val) && val > largest) { - largest = val; - } - } - - return largest; - } - - function getDiagnosticInfoFromKey(diagnosticKey) { - var result = TypeScript.diagnosticInformationMap[diagnosticKey]; - TypeScript.Debug.assert(result); - return result; - } - - function getLocalizedText(diagnosticKey, args) { - if (TypeScript.LocalizedDiagnosticMessages) { - } - - var diagnosticMessageText = TypeScript.LocalizedDiagnosticMessages ? TypeScript.LocalizedDiagnosticMessages[diagnosticKey] : diagnosticKey; - TypeScript.Debug.assert(diagnosticMessageText !== undefined && diagnosticMessageText !== null); - - var actualCount = args ? args.length : 0; - - var expectedCount = 1 + getLargestIndex(diagnosticKey); - - if (expectedCount !== actualCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_0_arguments_to_message_got_1_instead, [expectedCount, actualCount])); - } - - var valueCount = 1 + getLargestIndex(diagnosticMessageText); - if (valueCount !== expectedCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_the_message_0_to_have_1_arguments_but_it_had_2, [diagnosticMessageText, expectedCount, valueCount])); - } - - diagnosticMessageText = diagnosticMessageText.replace(/{(\d+)}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; - }); - - diagnosticMessageText = diagnosticMessageText.replace(/{(NL)}/g, function (match) { - return TypeScript.newLine(); - }); - - return diagnosticMessageText; - } - TypeScript.getLocalizedText = getLocalizedText; - - function getDiagnosticMessage(diagnosticKey, args) { - var diagnostic = getDiagnosticInfoFromKey(diagnosticKey); - var diagnosticMessageText = getLocalizedText(diagnosticKey, args); - - var message; - if (diagnostic.category === 1 /* Error */) { - message = getLocalizedText(TypeScript.DiagnosticCode.error_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } else if (diagnostic.category === 0 /* Warning */) { - message = getLocalizedText(TypeScript.DiagnosticCode.warning_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } else { - message = diagnosticMessageText; - } - - return message; - } - TypeScript.getDiagnosticMessage = getDiagnosticMessage; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Errors = (function () { - function Errors() { - } - Errors.argument = function (argument, message) { - return new Error("Invalid argument: " + argument + ". " + message); - }; - - Errors.argumentOutOfRange = function (argument) { - return new Error("Argument out of range: " + argument); - }; - - Errors.argumentNull = function (argument) { - return new Error("Argument null: " + argument); - }; - - Errors.abstract = function () { - return new Error("Operation not implemented properly by subclass."); - }; - - Errors.notYetImplemented = function () { - return new Error("Not yet implemented."); - }; - - Errors.invalidOperation = function (message) { - return new Error("Invalid operation: " + message); - }; - return Errors; - })(); - TypeScript.Errors = Errors; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Hash = (function () { - function Hash() { - } - Hash.computeFnv1aCharArrayHashCode = function (text, start, len) { - var hashCode = Hash.FNV_BASE; - var end = start + len; - - for (var i = start; i < end; i++) { - hashCode = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(hashCode ^ text[i], Hash.FNV_PRIME); - } - - return hashCode; - }; - - Hash.computeSimple31BitCharArrayHashCode = function (key, start, len) { - var hash = 0; - - for (var i = 0; i < len; i++) { - var ch = key[start + i]; - - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - - return hash & 0x7FFFFFFF; - }; - - Hash.computeSimple31BitStringHashCode = function (key) { - var hash = 0; - - var start = 0; - var len = key.length; - - for (var i = 0; i < len; i++) { - var ch = key.charCodeAt(start + i); - - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - - return hash & 0x7FFFFFFF; - }; - - Hash.computeMurmur2StringHashCode = function (key, seed) { - var m = 0x5bd1e995; - var r = 24; - - var numberOfCharsLeft = key.length; - var h = Math.abs(seed ^ numberOfCharsLeft); - - var index = 0; - while (numberOfCharsLeft >= 2) { - var c1 = key.charCodeAt(index); - var c2 = key.charCodeAt(index + 1); - - var k = Math.abs(c1 | (c2 << 16)); - - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - k ^= k >> r; - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= k; - - index += 2; - numberOfCharsLeft -= 2; - } - - if (numberOfCharsLeft === 1) { - h ^= key.charCodeAt(index); - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - } - - h ^= h >> 13; - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= h >> 15; - - return h; - }; - - Hash.getPrime = function (min) { - for (var i = 0; i < Hash.primes.length; i++) { - var num = Hash.primes[i]; - if (num >= min) { - return num; - } - } - - throw TypeScript.Errors.notYetImplemented(); - }; - - Hash.expandPrime = function (oldSize) { - var num = oldSize << 1; - if (num > 2146435069 && 2146435069 > oldSize) { - return 2146435069; - } - return Hash.getPrime(num); - }; - - Hash.combine = function (value, currentHash) { - return (((currentHash << 5) + currentHash) + value) & 0x7FFFFFFF; - }; - Hash.FNV_BASE = 2166136261; - Hash.FNV_PRIME = 16777619; - - Hash.primes = [ - 3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, - 631, 761, 919, 1103, 1327, 1597, 1931, 2333, 2801, 3371, 4049, 4861, 5839, 7013, 8419, - 10103, 12143, 14591, 17519, 21023, 25229, 30293, 36353, 43627, 52361, 62851, 75431, - 90523, 108631, 130363, 156437, 187751, 225307, 270371, 324449, 389357, 467237, 560689, - 672827, 807403, 968897, 1162687, 1395263, 1674319, 2009191, 2411033, 2893249, 3471899, - 4166287, 4999559, 5999471, 7199369]; - return Hash; - })(); - TypeScript.Hash = Hash; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Collections) { - Collections.DefaultHashTableCapacity = 1024; - - var HashTableEntry = (function () { - function HashTableEntry(Key, Value, HashCode, Next) { - this.Key = Key; - this.Value = Value; - this.HashCode = HashCode; - this.Next = Next; - } - return HashTableEntry; - })(); - - var HashTable = (function () { - function HashTable(capacity, hash) { - this.hash = hash; - this.count = 0; - var size = TypeScript.Hash.getPrime(capacity); - this.entries = TypeScript.ArrayUtilities.createArray(size, null); - } - HashTable.prototype.set = function (key, value) { - this.addOrSet(key, value, false); - }; - - HashTable.prototype.add = function (key, value) { - this.addOrSet(key, value, true); - }; - - HashTable.prototype.containsKey = function (key) { - var hashCode = this.computeHashCode(key); - var entry = this.findEntry(key, hashCode); - return entry !== null; - }; - - HashTable.prototype.get = function (key) { - var hashCode = this.computeHashCode(key); - var entry = this.findEntry(key, hashCode); - - return entry === null ? null : entry.Value; - }; - - HashTable.prototype.computeHashCode = function (key) { - var hashCode = this.hash === null ? key.hashCode : this.hash(key); - - hashCode = hashCode & 0x7FFFFFFF; - TypeScript.Debug.assert(hashCode >= 0); - - return hashCode; - }; - - HashTable.prototype.addOrSet = function (key, value, throwOnExistingEntry) { - var hashCode = this.computeHashCode(key); - - var entry = this.findEntry(key, hashCode); - if (entry !== null) { - if (throwOnExistingEntry) { - throw TypeScript.Errors.argument('key', "Key was already in table."); - } - - entry.Key = key; - entry.Value = value; - return; - } - - return this.addEntry(key, value, hashCode); - }; - - HashTable.prototype.findEntry = function (key, hashCode) { - for (var e = this.entries[hashCode % this.entries.length]; e !== null; e = e.Next) { - if (e.HashCode === hashCode && key === e.Key) { - return e; - } - } - - return null; - }; - - HashTable.prototype.addEntry = function (key, value, hashCode) { - var index = hashCode % this.entries.length; - - var e = new HashTableEntry(key, value, hashCode, this.entries[index]); - - this.entries[index] = e; - - if (this.count >= (this.entries.length / 2)) { - this.grow(); - } - - this.count++; - return e.Key; - }; - - HashTable.prototype.grow = function () { - var newSize = TypeScript.Hash.expandPrime(this.entries.length); - - var oldEntries = this.entries; - var newEntries = TypeScript.ArrayUtilities.createArray(newSize, null); - - this.entries = newEntries; - - for (var i = 0; i < oldEntries.length; i++) { - var e = oldEntries[i]; - - while (e !== null) { - var newIndex = e.HashCode % newSize; - var tmp = e.Next; - e.Next = newEntries[newIndex]; - newEntries[newIndex] = e; - e = tmp; - } - } - }; - return HashTable; - })(); - Collections.HashTable = HashTable; - - function createHashTable(capacity, hash) { - if (typeof capacity === "undefined") { capacity = Collections.DefaultHashTableCapacity; } - if (typeof hash === "undefined") { hash = null; } - return new HashTable(capacity, hash); - } - Collections.createHashTable = createHashTable; - - var currentHashCode = 1; - function identityHashCode(value) { - if (value.__hash === undefined) { - value.__hash = currentHashCode; - currentHashCode++; - } - - return value.__hash; - } - Collections.identityHashCode = identityHashCode; - })(TypeScript.Collections || (TypeScript.Collections = {})); - var Collections = TypeScript.Collections; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMakeDirectoryTime = 0; - TypeScript.nodeCreateBufferTime = 0; - TypeScript.nodeWriteFileSyncTime = 0; - - (function (ByteOrderMark) { - ByteOrderMark[ByteOrderMark["None"] = 0] = "None"; - ByteOrderMark[ByteOrderMark["Utf8"] = 1] = "Utf8"; - ByteOrderMark[ByteOrderMark["Utf16BigEndian"] = 2] = "Utf16BigEndian"; - ByteOrderMark[ByteOrderMark["Utf16LittleEndian"] = 3] = "Utf16LittleEndian"; - })(TypeScript.ByteOrderMark || (TypeScript.ByteOrderMark = {})); - var ByteOrderMark = TypeScript.ByteOrderMark; - - var FileInformation = (function () { - function FileInformation(contents, byteOrderMark) { - this.contents = contents; - this.byteOrderMark = byteOrderMark; - } - return FileInformation; - })(); - TypeScript.FileInformation = FileInformation; - - TypeScript.Environment = (function () { - function getWindowsScriptHostEnvironment() { - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - } catch (e) { - return null; - } - - var streamObjectPool = []; - - function getStreamObject() { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - newLine: "\r\n", - currentDirectory: function () { - return WScript.CreateObject("WScript.Shell").CurrentDirectory; - }, - supportsCodePage: function () { - return WScript.ReadFile; - }, - readFile: function (path, codepage) { - try { - if (codepage !== null && this.supportsCodePage()) { - try { - var contents = WScript.ReadFile(path, codepage); - return new FileInformation(contents, 0 /* None */); - } catch (e) { - } - } - - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; - - streamObj.Charset = 'x-ansi'; - - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); - - streamObj.Position = 0; - - var byteOrderMark = 0 /* None */; - - if (bomChar.charCodeAt(0) === 0xFE && bomChar.charCodeAt(1) === 0xFF) { - streamObj.Charset = 'unicode'; - byteOrderMark = 2 /* Utf16BigEndian */; - } else if (bomChar.charCodeAt(0) === 0xFF && bomChar.charCodeAt(1) === 0xFE) { - streamObj.Charset = 'unicode'; - byteOrderMark = 3 /* Utf16LittleEndian */; - } else if (bomChar.charCodeAt(0) === 0xEF && bomChar.charCodeAt(1) === 0xBB) { - streamObj.Charset = 'utf-8'; - byteOrderMark = 1 /* Utf8 */; - } else { - streamObj.Charset = 'utf-8'; - } - - var contents = streamObj.ReadText(-1); - streamObj.Close(); - releaseStreamObject(streamObj); - return new FileInformation(contents, byteOrderMark); - } catch (err) { - var message; - if (err.number === -2147024809) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unsupported_file_encoding, null); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Cannot_read_file_0_1, [path, err.message]); - } - - throw new Error(message); - } - }, - writeFile: function (path, contents, writeByteOrderMark) { - var textStream = getStreamObject(); - textStream.Charset = 'utf-8'; - textStream.Open(); - textStream.WriteText(contents, 0); - - if (!writeByteOrderMark) { - textStream.Position = 3; - } else { - textStream.Position = 0; - } - - var fileStream = getStreamObject(); - fileStream.Type = 1; - fileStream.Open(); - - textStream.CopyTo(fileStream); - - fileStream.Flush(); - fileStream.SaveToFile(path, 2); - fileStream.Close(); - - textStream.Flush(); - textStream.Close(); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - deleteFile: function (path) { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - listFiles: function (path, spec, options) { - options = options || {}; - function filesInFolder(folder, root) { - var paths = []; - var fc; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "\\" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd(); fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "\\" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - arguments: args, - standardOut: WScript.StdOut - }; - } - ; - - function getNodeEnvironment() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - var _os = require('os'); - - return { - newLine: _os.EOL, - currentDirectory: function () { - return process.cwd(); - }, - supportsCodePage: function () { - return false; - }, - readFile: function (file, codepage) { - if (codepage !== null) { - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.codepage_option_not_supported_on_current_platform, null)); - } - - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] === 0xFF) { - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return new FileInformation(buffer.toString("ucs2", 2), 2 /* Utf16BigEndian */); - } - break; - case 0xFF: - if (buffer[1] === 0xFE) { - return new FileInformation(buffer.toString("ucs2", 2), 3 /* Utf16LittleEndian */); - } - break; - case 0xEF: - if (buffer[1] === 0xBB) { - return new FileInformation(buffer.toString("utf8", 3), 1 /* Utf8 */); - } - } - - return new FileInformation(buffer.toString("utf8", 0), 0 /* None */); - }, - writeFile: function (path, contents, writeByteOrderMark) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - throw "\"" + path + "\" exists but isn't a directory."; - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 509); - } - } - var start = new Date().getTime(); - mkdirRecursiveSync(_path.dirname(path)); - TypeScript.nodeMakeDirectoryTime += new Date().getTime() - start; - - if (writeByteOrderMark) { - contents = '\uFEFF' + contents; - } - - var start = new Date().getTime(); - - var chunkLength = 4 * 1024; - var fileDescriptor = _fs.openSync(path, "w"); - try { - for (var index = 0; index < contents.length; index += chunkLength) { - var bufferStart = new Date().getTime(); - var buffer = new Buffer(contents.substr(index, chunkLength), "utf8"); - TypeScript.nodeCreateBufferTime += new Date().getTime() - bufferStart; - - _fs.writeSync(fileDescriptor, buffer, 0, buffer.length, null); - } - } finally { - _fs.closeSync(fileDescriptor); - } - - TypeScript.nodeWriteFileSyncTime += new Date().getTime() - start; - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }, - listFiles: function dir(path, spec, options) { - options = options || {}; - - function filesInFolder(folder) { - var paths = []; - - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "\\" + files[i]); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "\\" + files[i])); - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "\\" + files[i]); - } - } - - return paths; - } - - return filesInFolder(path); - }, - arguments: process.argv.slice(2), - standardOut: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - } - }; - } - ; - - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - return getWindowsScriptHostEnvironment(); - } else if (typeof module !== 'undefined' && module.exports) { - return getNodeEnvironment(); - } else { - return null; - } - })(); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (IntegerUtilities) { - function integerDivide(numerator, denominator) { - return (numerator / denominator) >> 0; - } - IntegerUtilities.integerDivide = integerDivide; - - function integerMultiplyLow32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; - return resultLow32; - } - IntegerUtilities.integerMultiplyLow32Bits = integerMultiplyLow32Bits; - - function integerMultiplyHigh32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - - var resultHigh32 = n1High16 * n2High16 + ((((n1Low16 * n2Low16) >>> 17) + n1Low16 * n2High16) >>> 15); - return resultHigh32; - } - IntegerUtilities.integerMultiplyHigh32Bits = integerMultiplyHigh32Bits; - - function isInteger(text) { - return /^[0-9]+$/.test(text); - } - IntegerUtilities.isInteger = isInteger; - - function isHexInteger(text) { - return /^0(x|X)[0-9a-fA-F]+$/.test(text); - } - IntegerUtilities.isHexInteger = isHexInteger; - })(TypeScript.IntegerUtilities || (TypeScript.IntegerUtilities = {})); - var IntegerUtilities = TypeScript.IntegerUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap = (function () { - function LineMap(_computeLineStarts, length) { - this._computeLineStarts = _computeLineStarts; - this.length = length; - this._lineStarts = null; - } - LineMap.prototype.toJSON = function (key) { - return { lineStarts: this.lineStarts(), length: this.length }; - }; - - LineMap.prototype.equals = function (other) { - return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { - return v1 === v2; - }); - }; - - LineMap.prototype.lineStarts = function () { - if (this._lineStarts === null) { - this._lineStarts = this._computeLineStarts(); - } - - return this._lineStarts; - }; - - LineMap.prototype.lineCount = function () { - return this.lineStarts().length; - }; - - LineMap.prototype.getPosition = function (line, character) { - return this.lineStarts()[line] + character; - }; - - LineMap.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - if (position === this.length) { - return this.lineCount() - 1; - } - - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this.lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - - return lineNumber; - }; - - LineMap.prototype.getLineStartPosition = function (lineNumber) { - return this.lineStarts()[lineNumber]; - }; - - LineMap.prototype.fillLineAndCharacterFromPosition = function (position, lineAndCharacter) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - lineAndCharacter.line = lineNumber; - lineAndCharacter.character = position - this.lineStarts()[lineNumber]; - }; - - LineMap.prototype.getLineAndCharacterFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - - return new TypeScript.LineAndCharacter(lineNumber, position - this.lineStarts()[lineNumber]); - }; - LineMap.empty = new LineMap(function () { - return [0]; - }, 0); - return LineMap; - })(); - TypeScript.LineMap = LineMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineAndCharacter = (function () { - function LineAndCharacter(line, character) { - this._line = 0; - this._character = 0; - if (line < 0) { - throw TypeScript.Errors.argumentOutOfRange("line"); - } - - if (character < 0) { - throw TypeScript.Errors.argumentOutOfRange("character"); - } - - this._line = line; - this._character = character; - } - LineAndCharacter.prototype.line = function () { - return this._line; - }; - - LineAndCharacter.prototype.character = function () { - return this._character; - }; - return LineAndCharacter; - })(); - TypeScript.LineAndCharacter = LineAndCharacter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var MathPrototype = (function () { - function MathPrototype() { - } - MathPrototype.max = function (a, b) { - return a >= b ? a : b; - }; - - MathPrototype.min = function (a, b) { - return a <= b ? a : b; - }; - return MathPrototype; - })(); - TypeScript.MathPrototype = MathPrototype; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Collections) { - Collections.DefaultStringTableCapacity = 256; - - var StringTableEntry = (function () { - function StringTableEntry(Text, HashCode, Next) { - this.Text = Text; - this.HashCode = HashCode; - this.Next = Next; - } - return StringTableEntry; - })(); - - var StringTable = (function () { - function StringTable(capacity) { - this.count = 0; - var size = TypeScript.Hash.getPrime(capacity); - this.entries = TypeScript.ArrayUtilities.createArray(size, null); - } - StringTable.prototype.addCharArray = function (key, start, len) { - var hashCode = TypeScript.Hash.computeSimple31BitCharArrayHashCode(key, start, len) & 0x7FFFFFFF; - - var entry = this.findCharArrayEntry(key, start, len, hashCode); - if (entry !== null) { - return entry.Text; - } - - var slice = key.slice(start, start + len); - return this.addEntry(TypeScript.StringUtilities.fromCharCodeArray(slice), hashCode); - }; - - StringTable.prototype.findCharArrayEntry = function (key, start, len, hashCode) { - for (var e = this.entries[hashCode % this.entries.length]; e !== null; e = e.Next) { - if (e.HashCode === hashCode && StringTable.textCharArrayEquals(e.Text, key, start, len)) { - return e; - } - } - - return null; - }; - - StringTable.prototype.addEntry = function (text, hashCode) { - var index = hashCode % this.entries.length; - - var e = new StringTableEntry(text, hashCode, this.entries[index]); - - this.entries[index] = e; - - if (this.count === this.entries.length) { - this.grow(); - } - - this.count++; - return e.Text; - }; - - StringTable.prototype.grow = function () { - var newSize = TypeScript.Hash.expandPrime(this.entries.length); - - var oldEntries = this.entries; - var newEntries = TypeScript.ArrayUtilities.createArray(newSize, null); - - this.entries = newEntries; - - for (var i = 0; i < oldEntries.length; i++) { - var e = oldEntries[i]; - while (e !== null) { - var newIndex = e.HashCode % newSize; - var tmp = e.Next; - e.Next = newEntries[newIndex]; - newEntries[newIndex] = e; - e = tmp; - } - } - }; - - StringTable.textCharArrayEquals = function (text, array, start, length) { - if (text.length !== length) { - return false; - } - - var s = start; - for (var i = 0; i < length; i++) { - if (text.charCodeAt(i) !== array[s]) { - return false; - } - - s++; - } - - return true; - }; - return StringTable; - })(); - Collections.StringTable = StringTable; - - Collections.DefaultStringTable = new StringTable(Collections.DefaultStringTableCapacity); - })(TypeScript.Collections || (TypeScript.Collections = {})); - var Collections = TypeScript.Collections; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var StringUtilities = (function () { - function StringUtilities() { - } - StringUtilities.isString = function (value) { - return Object.prototype.toString.apply(value, []) === '[object String]'; - }; - - StringUtilities.fromCharCodeArray = function (array) { - return String.fromCharCode.apply(null, array); - }; - - StringUtilities.endsWith = function (string, value) { - return string.substring(string.length - value.length, string.length) === value; - }; - - StringUtilities.startsWith = function (string, value) { - return string.substr(0, value.length) === value; - }; - - StringUtilities.copyTo = function (source, sourceIndex, destination, destinationIndex, count) { - for (var i = 0; i < count; i++) { - destination[destinationIndex + i] = source.charCodeAt(sourceIndex + i); - } - }; - - StringUtilities.repeat = function (value, count) { - return Array(count + 1).join(value); - }; - - StringUtilities.stringEquals = function (val1, val2) { - return val1 === val2; - }; - return StringUtilities; - })(); - TypeScript.StringUtilities = StringUtilities; -})(TypeScript || (TypeScript = {})); -var global = Function("return this").call(null); - -var TypeScript; -(function (TypeScript) { - var Clock; - (function (Clock) { - Clock.now; - Clock.resolution; - - if (typeof WScript !== "undefined" && typeof global['WScript'].InitializeProjection !== "undefined") { - global['WScript'].InitializeProjection(); - - Clock.now = function () { - return TestUtilities.QueryPerformanceCounter(); - }; - - Clock.resolution = TestUtilities.QueryPerformanceFrequency(); - } else { - Clock.now = function () { - return Date.now(); - }; - - Clock.resolution = 1000; - } - })(Clock || (Clock = {})); - - var Timer = (function () { - function Timer() { - this.time = 0; - } - Timer.prototype.start = function () { - this.time = 0; - this.startTime = Clock.now(); - }; - - Timer.prototype.end = function () { - this.time = (Clock.now() - this.startTime); - }; - return Timer; - })(); - TypeScript.Timer = Timer; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; - })(TypeScript.DiagnosticCategory || (TypeScript.DiagnosticCategory = {})); - var DiagnosticCategory = TypeScript.DiagnosticCategory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.diagnosticInformationMap = { - "error TS{0}: {1}": { - "code": 0, - "category": 3 /* NoPrefix */ - }, - "warning TS{0}: {1}": { - "code": 1, - "category": 3 /* NoPrefix */ - }, - "Unrecognized escape sequence.": { - "code": 1000, - "category": 1 /* Error */ - }, - "Unexpected character {0}.": { - "code": 1001, - "category": 1 /* Error */ - }, - "Missing close quote character.": { - "code": 1002, - "category": 1 /* Error */ - }, - "Identifier expected.": { - "code": 1003, - "category": 1 /* Error */ - }, - "'{0}' keyword expected.": { - "code": 1004, - "category": 1 /* Error */ - }, - "'{0}' expected.": { - "code": 1005, - "category": 1 /* Error */ - }, - "Identifier expected; '{0}' is a keyword.": { - "code": 1006, - "category": 1 /* Error */ - }, - "Automatic semicolon insertion not allowed.": { - "code": 1007, - "category": 1 /* Error */ - }, - "Unexpected token; '{0}' expected.": { - "code": 1008, - "category": 1 /* Error */ - }, - "Trailing separator not allowed.": { - "code": 1009, - "category": 1 /* Error */ - }, - "'*/' expected.": { - "code": 1010, - "category": 1 /* Error */ - }, - "'public' or 'private' modifier must precede 'static'.": { - "code": 1011, - "category": 1 /* Error */ - }, - "Unexpected token.": { - "code": 1012, - "category": 1 /* Error */ - }, - "Catch clause parameter cannot have a type annotation.": { - "code": 1013, - "category": 1 /* Error */ - }, - "Rest parameter must be last in list.": { - "code": 1014, - "category": 1 /* Error */ - }, - "Parameter cannot have question mark and initializer.": { - "code": 1015, - "category": 1 /* Error */ - }, - "Required parameter cannot follow optional parameter.": { - "code": 1016, - "category": 1 /* Error */ - }, - "Index signatures cannot have rest parameters.": { - "code": 1017, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have accessibility modifiers.": { - "code": 1018, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have a question mark.": { - "code": 1019, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have an initializer.": { - "code": 1020, - "category": 1 /* Error */ - }, - "Index signature must have a type annotation.": { - "code": 1021, - "category": 1 /* Error */ - }, - "Index signature parameter must have a type annotation.": { - "code": 1022, - "category": 1 /* Error */ - }, - "Index signature parameter type must be 'string' or 'number'.": { - "code": 1023, - "category": 1 /* Error */ - }, - "'extends' clause already seen.": { - "code": 1024, - "category": 1 /* Error */ - }, - "'extends' clause must precede 'implements' clause.": { - "code": 1025, - "category": 1 /* Error */ - }, - "Classes can only extend a single class.": { - "code": 1026, - "category": 1 /* Error */ - }, - "'implements' clause already seen.": { - "code": 1027, - "category": 1 /* Error */ - }, - "Accessibility modifier already seen.": { - "code": 1028, - "category": 1 /* Error */ - }, - "'{0}' modifier must precede '{1}' modifier.": { - "code": 1029, - "category": 1 /* Error */ - }, - "'{0}' modifier already seen.": { - "code": 1030, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a class element.": { - "code": 1031, - "category": 1 /* Error */ - }, - "Interface declaration cannot have 'implements' clause.": { - "code": 1032, - "category": 1 /* Error */ - }, - "'super' invocation cannot have type arguments.": { - "code": 1034, - "category": 1 /* Error */ - }, - "Only ambient modules can use quoted names.": { - "code": 1035, - "category": 1 /* Error */ - }, - "Statements are not allowed in ambient contexts.": { - "code": 1036, - "category": 1 /* Error */ - }, - "Implementations are not allowed in ambient contexts.": { - "code": 1037, - "category": 1 /* Error */ - }, - "'declare' modifier not allowed for code already in an ambient context.": { - "code": 1038, - "category": 1 /* Error */ - }, - "Initializers are not allowed in ambient contexts.": { - "code": 1039, - "category": 1 /* Error */ - }, - "Parameter property declarations can only be used in a non-ambient constructor declaration.": { - "code": 1040, - "category": 1 /* Error */ - }, - "Function implementation expected.": { - "code": 1041, - "category": 1 /* Error */ - }, - "Constructor implementation expected.": { - "code": 1042, - "category": 1 /* Error */ - }, - "Function overload name must be '{0}'.": { - "code": 1043, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a module element.": { - "code": 1044, - "category": 1 /* Error */ - }, - "'declare' modifier cannot appear on an interface declaration.": { - "code": 1045, - "category": 1 /* Error */ - }, - "'declare' modifier required for top level element.": { - "code": 1046, - "category": 1 /* Error */ - }, - "Rest parameter cannot be optional.": { - "code": 1047, - "category": 1 /* Error */ - }, - "Rest parameter cannot have an initializer.": { - "code": 1048, - "category": 1 /* Error */ - }, - "'set' accessor must have one and only one parameter.": { - "code": 1049, - "category": 1 /* Error */ - }, - "'set' accessor parameter cannot be optional.": { - "code": 1051, - "category": 1 /* Error */ - }, - "'set' accessor parameter cannot have an initializer.": { - "code": 1052, - "category": 1 /* Error */ - }, - "'set' accessor cannot have rest parameter.": { - "code": 1053, - "category": 1 /* Error */ - }, - "'get' accessor cannot have parameters.": { - "code": 1054, - "category": 1 /* Error */ - }, - "Modifiers cannot appear here.": { - "code": 1055, - "category": 1 /* Error */ - }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { - "code": 1056, - "category": 1 /* Error */ - }, - "Class name cannot be '{0}'.": { - "code": 1057, - "category": 1 /* Error */ - }, - "Interface name cannot be '{0}'.": { - "code": 1058, - "category": 1 /* Error */ - }, - "Enum name cannot be '{0}'.": { - "code": 1059, - "category": 1 /* Error */ - }, - "Module name cannot be '{0}'.": { - "code": 1060, - "category": 1 /* Error */ - }, - "Enum member must have initializer.": { - "code": 1061, - "category": 1 /* Error */ - }, - "Export assignment cannot be used in internal modules.": { - "code": 1063, - "category": 1 /* Error */ - }, - "Export assignment not allowed in module with exported element.": { - "code": 1064, - "category": 1 /* Error */ - }, - "Module cannot have multiple export assignments.": { - "code": 1065, - "category": 1 /* Error */ - }, - "Ambient enum elements can only have integer literal initializers.": { - "code": 1066, - "category": 1 /* Error */ - }, - "module, class, interface, enum, import or statement": { - "code": 1067, - "category": 3 /* NoPrefix */ - }, - "constructor, function, accessor or variable": { - "code": 1068, - "category": 3 /* NoPrefix */ - }, - "statement": { - "code": 1069, - "category": 3 /* NoPrefix */ - }, - "case or default clause": { - "code": 1070, - "category": 3 /* NoPrefix */ - }, - "identifier": { - "code": 1071, - "category": 3 /* NoPrefix */ - }, - "call, construct, index, property or function signature": { - "code": 1072, - "category": 3 /* NoPrefix */ - }, - "expression": { - "code": 1073, - "category": 3 /* NoPrefix */ - }, - "type name": { - "code": 1074, - "category": 3 /* NoPrefix */ - }, - "property or accessor": { - "code": 1075, - "category": 3 /* NoPrefix */ - }, - "parameter": { - "code": 1076, - "category": 3 /* NoPrefix */ - }, - "type": { - "code": 1077, - "category": 3 /* NoPrefix */ - }, - "type parameter": { - "code": 1078, - "category": 3 /* NoPrefix */ - }, - "'declare' modifier not allowed on import declaration.": { - "code": 1079, - "category": 1 /* Error */ - }, - "Function overload must be static.": { - "code": 1080, - "category": 1 /* Error */ - }, - "Function overload must not be static.": { - "code": 1081, - "category": 1 /* Error */ - }, - "Parameter property declarations cannot be used in a constructor overload.": { - "code": 1083, - "category": 1 /* Error */ - }, - "Invalid 'reference' directive syntax.": { - "code": 1084, - "category": 1 /* Error */ - }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { - "code": 1085, - "category": 1 /* Error */ - }, - "Accessors are not allowed in ambient contexts.": { - "code": 1086, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a constructor declaration.": { - "code": 1089, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a parameter.": { - "code": 1090, - "category": 1 /* Error */ - }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { - "code": 1091, - "category": 1 /* Error */ - }, - "Type parameters cannot appear on a constructor declaration.": { - "code": 1091, - "category": 1 /* Error */ - }, - "Type annotation cannot appear on a constructor declaration.": { - "code": 1092, - "category": 1 /* Error */ - }, - "Duplicate identifier '{0}'.": { - "code": 2000, - "category": 1 /* Error */ - }, - "The name '{0}' does not exist in the current scope.": { - "code": 2001, - "category": 1 /* Error */ - }, - "The name '{0}' does not refer to a value.": { - "code": 2002, - "category": 1 /* Error */ - }, - "'super' can only be used inside a class instance method.": { - "code": 2003, - "category": 1 /* Error */ - }, - "The left-hand side of an assignment expression must be a variable, property or indexer.": { - "code": 2004, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { - "code": 2161, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not callable.": { - "code": 2006, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not newable.": { - "code": 2007, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not indexable by type '{1}'.": { - "code": 2008, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { - "code": 2009, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": { - "code": 2010, - "category": 1 /* Error */ - }, - "Cannot convert '{0}' to '{1}'.": { - "code": 2011, - "category": 1 /* Error */ - }, - "Cannot convert '{0}' to '{1}':{NL}{2}": { - "code": 2012, - "category": 1 /* Error */ - }, - "Expected var, class, interface, or module.": { - "code": 2013, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to type '{1}'.": { - "code": 2014, - "category": 1 /* Error */ - }, - "Getter '{0}' already declared.": { - "code": 2015, - "category": 1 /* Error */ - }, - "Setter '{0}' already declared.": { - "code": 2016, - "category": 1 /* Error */ - }, - "Exported class '{0}' extends private class '{1}'.": { - "code": 2018, - "category": 1 /* Error */ - }, - "Exported class '{0}' implements private interface '{1}'.": { - "code": 2019, - "category": 1 /* Error */ - }, - "Exported interface '{0}' extends private interface '{1}'.": { - "code": 2020, - "category": 1 /* Error */ - }, - "Exported class '{0}' extends class from inaccessible module {1}.": { - "code": 2021, - "category": 1 /* Error */ - }, - "Exported class '{0}' implements interface from inaccessible module {1}.": { - "code": 2022, - "category": 1 /* Error */ - }, - "Exported interface '{0}' extends interface from inaccessible module {1}.": { - "code": 2023, - "category": 1 /* Error */ - }, - "Public static property '{0}' of exported class has or is using private type '{1}'.": { - "code": 2024, - "category": 1 /* Error */ - }, - "Public property '{0}' of exported class has or is using private type '{1}'.": { - "code": 2025, - "category": 1 /* Error */ - }, - "Property '{0}' of exported interface has or is using private type '{1}'.": { - "code": 2026, - "category": 1 /* Error */ - }, - "Exported variable '{0}' has or is using private type '{1}'.": { - "code": 2027, - "category": 1 /* Error */ - }, - "Public static property '{0}' of exported class is using inaccessible module {1}.": { - "code": 2028, - "category": 1 /* Error */ - }, - "Public property '{0}' of exported class is using inaccessible module {1}.": { - "code": 2029, - "category": 1 /* Error */ - }, - "Property '{0}' of exported interface is using inaccessible module {1}.": { - "code": 2030, - "category": 1 /* Error */ - }, - "Exported variable '{0}' is using inaccessible module {1}.": { - "code": 2031, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": { - "code": 2032, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": { - "code": 2033, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": { - "code": 2034, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { - "code": 2035, - "category": 1 /* Error */ - }, - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { - "code": 2036, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": { - "code": 2037, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": { - "code": 2038, - "category": 1 /* Error */ - }, - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": { - "code": 2039, - "category": 1 /* Error */ - }, - "Parameter '{0}' of exported function has or is using private type '{1}'.": { - "code": 2040, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": { - "code": 2041, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": { - "code": 2042, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": { - "code": 2043, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { - "code": 2044, - "category": 1 /* Error */ - }, - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": { - "code": 2045, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": { - "code": 2046, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": { - "code": 2047, - "category": 1 /* Error */ - }, - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": { - "code": 2048, - "category": 1 /* Error */ - }, - "Parameter '{0}' of exported function is using inaccessible module {1}.": { - "code": 2049, - "category": 1 /* Error */ - }, - "Return type of public static property getter from exported class has or is using private type '{0}'.": { - "code": 2050, - "category": 1 /* Error */ - }, - "Return type of public property getter from exported class has or is using private type '{0}'.": { - "code": 2051, - "category": 1 /* Error */ - }, - "Return type of constructor signature from exported interface has or is using private type '{0}'.": { - "code": 2052, - "category": 1 /* Error */ - }, - "Return type of call signature from exported interface has or is using private type '{0}'.": { - "code": 2053, - "category": 1 /* Error */ - }, - "Return type of index signature from exported interface has or is using private type '{0}'.": { - "code": 2054, - "category": 1 /* Error */ - }, - "Return type of public static method from exported class has or is using private type '{0}'.": { - "code": 2055, - "category": 1 /* Error */ - }, - "Return type of public method from exported class has or is using private type '{0}'.": { - "code": 2056, - "category": 1 /* Error */ - }, - "Return type of method from exported interface has or is using private type '{0}'.": { - "code": 2057, - "category": 1 /* Error */ - }, - "Return type of exported function has or is using private type '{0}'.": { - "code": 2058, - "category": 1 /* Error */ - }, - "Return type of public static property getter from exported class is using inaccessible module {0}.": { - "code": 2059, - "category": 1 /* Error */ - }, - "Return type of public property getter from exported class is using inaccessible module {0}.": { - "code": 2060, - "category": 1 /* Error */ - }, - "Return type of constructor signature from exported interface is using inaccessible module {0}.": { - "code": 2061, - "category": 1 /* Error */ - }, - "Return type of call signature from exported interface is using inaccessible module {0}.": { - "code": 2062, - "category": 1 /* Error */ - }, - "Return type of index signature from exported interface is using inaccessible module {0}.": { - "code": 2063, - "category": 1 /* Error */ - }, - "Return type of public static method from exported class is using inaccessible module {0}.": { - "code": 2064, - "category": 1 /* Error */ - }, - "Return type of public method from exported class is using inaccessible module {0}.": { - "code": 2065, - "category": 1 /* Error */ - }, - "Return type of method from exported interface is using inaccessible module {0}.": { - "code": 2066, - "category": 1 /* Error */ - }, - "Return type of exported function is using inaccessible module {0}.": { - "code": 2067, - "category": 1 /* Error */ - }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { - "code": 2068, - "category": 1 /* Error */ - }, - "A parameter list must follow a generic type argument list. '(' expected.": { - "code": 2069, - "category": 1 /* Error */ - }, - "Multiple constructor implementations are not allowed.": { - "code": 2070, - "category": 1 /* Error */ - }, - "Unable to resolve external module '{0}'.": { - "code": 2071, - "category": 1 /* Error */ - }, - "Module cannot be aliased to a non-module type.": { - "code": 2072, - "category": 1 /* Error */ - }, - "A class may only extend another class.": { - "code": 2073, - "category": 1 /* Error */ - }, - "A class may only implement another class or interface.": { - "code": 2074, - "category": 1 /* Error */ - }, - "An interface may only extend another class or interface.": { - "code": 2075, - "category": 1 /* Error */ - }, - "Unable to resolve type.": { - "code": 2077, - "category": 1 /* Error */ - }, - "Unable to resolve type of '{0}'.": { - "code": 2078, - "category": 1 /* Error */ - }, - "Unable to resolve type parameter constraint.": { - "code": 2079, - "category": 1 /* Error */ - }, - "Type parameter constraint cannot be a primitive type.": { - "code": 2080, - "category": 1 /* Error */ - }, - "Supplied parameters do not match any signature of call target.": { - "code": 2081, - "category": 1 /* Error */ - }, - "Supplied parameters do not match any signature of call target:{NL}{0}": { - "code": 2082, - "category": 1 /* Error */ - }, - "Invalid 'new' expression.": { - "code": 2083, - "category": 1 /* Error */ - }, - "Call signatures used in a 'new' expression must have a 'void' return type.": { - "code": 2084, - "category": 1 /* Error */ - }, - "Could not select overload for 'new' expression.": { - "code": 2085, - "category": 1 /* Error */ - }, - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": { - "code": 2086, - "category": 1 /* Error */ - }, - "Could not select overload for 'call' expression.": { - "code": 2087, - "category": 1 /* Error */ - }, - "Cannot invoke an expression whose type lacks a call signature.": { - "code": 2088, - "category": 1 /* Error */ - }, - "Calls to 'super' are only valid inside a class.": { - "code": 2089, - "category": 1 /* Error */ - }, - "Generic type '{0}' requires {1} type argument(s).": { - "code": 2090, - "category": 1 /* Error */ - }, - "Type of array literal cannot be determined. Best common type could not be found for array elements.": { - "code": 2092, - "category": 1 /* Error */ - }, - "Could not find enclosing symbol for dotted name '{0}'.": { - "code": 2093, - "category": 1 /* Error */ - }, - "The property '{0}' does not exist on value of type '{1}'.": { - "code": 2094, - "category": 1 /* Error */ - }, - "Could not find symbol '{0}'.": { - "code": 2095, - "category": 1 /* Error */ - }, - "'get' and 'set' accessor must have the same type.": { - "code": 2096, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in current location.": { - "code": 2097, - "category": 1 /* Error */ - }, - "Static members cannot reference class type parameters.": { - "code": 2099, - "category": 1 /* Error */ - }, - "Class '{0}' is recursively referenced as a base type of itself.": { - "code": 2100, - "category": 1 /* Error */ - }, - "Interface '{0}' is recursively referenced as a base type of itself.": { - "code": 2101, - "category": 1 /* Error */ - }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.": { - "code": 2102, - "category": 1 /* Error */ - }, - "'super' cannot be referenced in non-derived classes.": { - "code": 2103, - "category": 1 /* Error */ - }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { - "code": 2104, - "category": 1 /* Error */ - }, - "Constructors for derived classes must contain a 'super' call.": { - "code": 2105, - "category": 1 /* Error */ - }, - "Super calls are not permitted outside constructors or in nested functions inside constructors.": { - "code": 2106, - "category": 1 /* Error */ - }, - "'{0}.{1}' is inaccessible.": { - "code": 2107, - "category": 1 /* Error */ - }, - "'this' cannot be referenced within module bodies.": { - "code": 2108, - "category": 1 /* Error */ - }, - "Invalid '+' expression - types not known to support the addition operator.": { - "code": 2111, - "category": 1 /* Error */ - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "code": 2112, - "category": 1 /* Error */ - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "code": 2113, - "category": 1 /* Error */ - }, - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": { - "code": 2114, - "category": 1 /* Error */ - }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { - "code": 2115, - "category": 1 /* Error */ - }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { - "code": 2116, - "category": 1 /* Error */ - }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { - "code": 2117, - "category": 1 /* Error */ - }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { - "code": 2118, - "category": 1 /* Error */ - }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": { - "code": 2119, - "category": 1 /* Error */ - }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { - "code": 2120, - "category": 1 /* Error */ - }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { - "code": 2121, - "category": 1 /* Error */ - }, - "Setters cannot return a value.": { - "code": 2122, - "category": 1 /* Error */ - }, - "Tried to query type of uninitialized module '{0}'.": { - "code": 2123, - "category": 1 /* Error */ - }, - "Tried to set variable type to uninitialized module type '{0}'.": { - "code": 2124, - "category": 1 /* Error */ - }, - "Type '{0}' does not have type parameters.": { - "code": 2125, - "category": 1 /* Error */ - }, - "Getters must return a value.": { - "code": 2126, - "category": 1 /* Error */ - }, - "Getter and setter accessors do not agree in visibility.": { - "code": 2127, - "category": 1 /* Error */ - }, - "Invalid left-hand side of assignment expression.": { - "code": 2130, - "category": 1 /* Error */ - }, - "Function declared a non-void return type, but has no return expression.": { - "code": 2131, - "category": 1 /* Error */ - }, - "Cannot resolve return type reference.": { - "code": 2132, - "category": 1 /* Error */ - }, - "Constructors cannot have a return type of 'void'.": { - "code": 2133, - "category": 1 /* Error */ - }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { - "code": 2134, - "category": 1 /* Error */ - }, - "All symbols within a with block will be resolved to 'any'.": { - "code": 2135, - "category": 1 /* Error */ - }, - "Import declarations in an internal module cannot reference an external module.": { - "code": 2136, - "category": 1 /* Error */ - }, - "Class {0} declares interface {1} but does not implement it:{NL}{2}": { - "code": 2137, - "category": 1 /* Error */ - }, - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": { - "code": 2138, - "category": 1 /* Error */ - }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { - "code": 2139, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in static initializers in a class body.": { - "code": 2140, - "category": 1 /* Error */ - }, - "Class '{0}' cannot extend class '{1}':{NL}{2}": { - "code": 2141, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot extend class '{1}':{NL}{2}": { - "code": 2142, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": { - "code": 2143, - "category": 1 /* Error */ - }, - "Duplicate overload signature for '{0}'.": { - "code": 2144, - "category": 1 /* Error */ - }, - "Duplicate constructor overload signature.": { - "code": 2145, - "category": 1 /* Error */ - }, - "Duplicate overload call signature.": { - "code": 2146, - "category": 1 /* Error */ - }, - "Duplicate overload construct signature.": { - "code": 2147, - "category": 1 /* Error */ - }, - "Overload signature is not compatible with function definition.": { - "code": 2148, - "category": 1 /* Error */ - }, - "Overload signature is not compatible with function definition:{NL}{0}": { - "code": 2149, - "category": 1 /* Error */ - }, - "Overload signatures must all be public or private.": { - "code": 2150, - "category": 1 /* Error */ - }, - "Overload signatures must all be exported or not exported.": { - "code": 2151, - "category": 1 /* Error */ - }, - "Overload signatures must all be ambient or non-ambient.": { - "code": 2152, - "category": 1 /* Error */ - }, - "Overload signatures must all be optional or required.": { - "code": 2153, - "category": 1 /* Error */ - }, - "Specialized overload signature is not assignable to any non-specialized signature.": { - "code": 2154, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in constructor arguments.": { - "code": 2155, - "category": 1 /* Error */ - }, - "Instance member cannot be accessed off a class.": { - "code": 2157, - "category": 1 /* Error */ - }, - "Untyped function calls may not accept type arguments.": { - "code": 2158, - "category": 1 /* Error */ - }, - "Non-generic functions may not accept type arguments.": { - "code": 2159, - "category": 1 /* Error */ - }, - "A generic type may not reference itself with a wrapped form of its own type parameters.": { - "code": 2160, - "category": 1 /* Error */ - }, - "Rest parameters must be array types.": { - "code": 2162, - "category": 1 /* Error */ - }, - "Overload signature implementation cannot use specialized type.": { - "code": 2163, - "category": 1 /* Error */ - }, - "Export assignments may only be used at the top-level of external modules.": { - "code": 2164, - "category": 1 /* Error */ - }, - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.": { - "code": 2165, - "category": 1 /* Error */ - }, - "Only public methods of the base class are accessible via the 'super' keyword.": { - "code": 2166, - "category": 1 /* Error */ - }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.": { - "code": 2167, - "category": 1 /* Error */ - }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}": { - "code": 2168, - "category": 1 /* Error */ - }, - "All numerically named properties must be assignable to numeric indexer type '{0}'.": { - "code": 2169, - "category": 1 /* Error */ - }, - "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}": { - "code": 2170, - "category": 1 /* Error */ - }, - "All named properties must be assignable to string indexer type '{0}'.": { - "code": 2171, - "category": 1 /* Error */ - }, - "All named properties must be assignable to string indexer type '{0}':{NL}{1}": { - "code": 2172, - "category": 1 /* Error */ - }, - "Generic type references must include all type arguments.": { - "code": 2173, - "category": 1 /* Error */ - }, - "Default arguments are only allowed in implementation.": { - "code": 2174, - "category": 1 /* Error */ - }, - "Overloads cannot differ only by return type.": { - "code": 2175, - "category": 1 /* Error */ - }, - "Function expression declared a non-void return type, but has no return expression.": { - "code": 2176, - "category": 1 /* Error */ - }, - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": { - "code": 2177, - "category": 1 /* Error */ - }, - "Could not find symbol '{0}' in module '{1}'.": { - "code": 2178, - "category": 1 /* Error */ - }, - "Unable to resolve module reference '{0}'.": { - "code": 2179, - "category": 1 /* Error */ - }, - "Could not find module '{0}' in module '{1}'.": { - "code": 2180, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": { - "code": 2181, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": { - "code": 2182, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": { - "code": 2183, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": { - "code": 2184, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": { - "code": 2185, - "category": 1 /* Error */ - }, - "Type name '{0}' in extends clause does not reference constructor function for '{1}'.": { - "code": 2186, - "category": 1 /* Error */ - }, - "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.": { - "code": 2187, - "category": 1 /* Error */ - }, - "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.": { - "code": 2188, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}": { - "code": 2189, - "category": 1 /* Error */ - }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { - "code": 2190, - "category": 1 /* Error */ - }, - "Ambient external module declaration cannot be reopened.": { - "code": 2191, - "category": 1 /* Error */ - }, - "All declarations of merged declaration '{0}' must be exported or not exported.": { - "code": 2192, - "category": 1 /* Error */ - }, - "'super' cannot be referenced in constructor arguments.": { - "code": 2193, - "category": 1 /* Error */ - }, - "Return type of constructor signature must be assignable to the instance type of the class.": { - "code": 2194, - "category": 1 /* Error */ - }, - "Ambient external module declaration must be defined in global context.": { - "code": 2195, - "category": 1 /* Error */ - }, - "Ambient external module declaration cannot specify relative module name.": { - "code": 2196, - "category": 1 /* Error */ - }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { - "code": 2197, - "category": 1 /* Error */ - }, - "Could not find the best common type of types of all return statement expressions.": { - "code": 2198, - "category": 1 /* Error */ - }, - "Import declaration cannot refer to external module reference when --noResolve option is set.": { - "code": 2199, - "category": 1 /* Error */ - }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { - "code": 2200, - "category": 1 /* Error */ - }, - "'continue' statement can only be used within an enclosing iteration statement.": { - "code": 2201, - "category": 1 /* Error */ - }, - "'break' statement can only be used within an enclosing iteration or switch statement.": { - "code": 2202, - "category": 1 /* Error */ - }, - "Jump target not found.": { - "code": 2203, - "category": 1 /* Error */ - }, - "Jump target cannot cross function boundary.": { - "code": 2204, - "category": 1 /* Error */ - }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { - "code": 2205, - "category": 1 /* Error */ - }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { - "code": 2206, - "category": 1 /* Error */ - }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { - "code": 2207, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { - "code": 2208, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { - "code": 2209, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.": { - "code": 2210, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.": { - "code": 2211, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.": { - "code": 2212, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported function has or is using private type '{1}'.": { - "code": 2213, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { - "code": 2214, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}": { - "code": 2215, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.": { - "code": 2216, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.": { - "code": 2217, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.": { - "code": 2218, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported function is using inaccessible module {1}.": { - "code": 2219, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported class has or is using private type '{1}'.": { - "code": 2220, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported interface has or is using private type '{1}'.": { - "code": 2221, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported class is using inaccessible module {1}.": { - "code": 2222, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported interface is using inaccessible module {1}.": { - "code": 2223, - "category": 1 /* Error */ - }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { - "code": 2224, - "category": 1 /* Error */ - }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { - "code": 2225, - "category": 1 /* Error */ - }, - "Type of conditional '{0}' must be identical to '{1}' or '{2}'.": { - "code": 2226, - "category": 1 /* Error */ - }, - "Type of conditional '{0}' must be identical to '{1}', '{2}' or '{3}'.": { - "code": 2227, - "category": 1 /* Error */ - }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { - "code": 2228, - "category": 1 /* Error */ - }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { - "code": 2229, - "category": 1 /* Error */ - }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { - "code": 2230, - "category": 1 /* Error */ - }, - "Parameter '{0}' cannot be referenced in its initializer.": { - "code": 2231, - "category": 1 /* Error */ - }, - "Duplicate string index signature.": { - "code": 2232, - "category": 1 /* Error */ - }, - "Duplicate number index signature.": { - "code": 2233, - "category": 1 /* Error */ - }, - "All declarations of an interface must have identical type parameters.": { - "code": 2234, - "category": 1 /* Error */ - }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { - "code": 2235, - "category": 1 /* Error */ - }, - "Type '{0}' is missing property '{1}' from type '{2}'.": { - "code": 4000, - "category": 3 /* NoPrefix */ - }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": { - "code": 4001, - "category": 3 /* NoPrefix */ - }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": { - "code": 4002, - "category": 3 /* NoPrefix */ - }, - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { - "code": 4003, - "category": 3 /* NoPrefix */ - }, - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { - "code": 4004, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' define property '{2}' as private.": { - "code": 4005, - "category": 3 /* NoPrefix */ - }, - "Call signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4006, - "category": 3 /* NoPrefix */ - }, - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4007, - "category": 3 /* NoPrefix */ - }, - "Type '{0}' requires a call signature, but type '{1}' lacks one.": { - "code": 4008, - "category": 3 /* NoPrefix */ - }, - "Construct signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4009, - "category": 3 /* NoPrefix */ - }, - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4010, - "category": 3 /* NoPrefix */ - }, - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": { - "code": 4011, - "category": 3 /* NoPrefix */ - }, - "Index signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4012, - "category": 3 /* NoPrefix */ - }, - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4013, - "category": 3 /* NoPrefix */ - }, - "Call signature expects {0} or fewer parameters.": { - "code": 4014, - "category": 3 /* NoPrefix */ - }, - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": { - "code": 4015, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "code": 4016, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "code": 4017, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "code": 4018, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "code": 4019, - "category": 3 /* NoPrefix */ - }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": { - "code": 4020, - "category": 3 /* NoPrefix */ - }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": { - "code": 4021, - "category": 3 /* NoPrefix */ - }, - "Type reference cannot refer to container '{0}'.": { - "code": 4022, - "category": 1 /* Error */ - }, - "Type reference must refer to type.": { - "code": 4023, - "category": 1 /* Error */ - }, - "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.": { - "code": 4024, - "category": 1 /* Error */ - }, - " (+ {0} overload(s))": { - "code": 4025, - "category": 2 /* Message */ - }, - "Variable declaration cannot have the same name as an import declaration.": { - "code": 4026, - "category": 1 /* Error */ - }, - "Signature expected {0} type arguments, got {1} instead.": { - "code": 4027, - "category": 1 /* Error */ - }, - "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.": { - "code": 4028, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.": { - "code": 4029, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.": { - "code": 4030, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}": { - "code": 4031, - "category": 3 /* NoPrefix */ - }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { - "code": 4032, - "category": 3 /* NoPrefix */ - }, - "Types of string indexer of types '{0}' and '{1}' are not identical.": { - "code": 4033, - "category": 3 /* NoPrefix */ - }, - "Types of number indexer of types '{0}' and '{1}' are not identical.": { - "code": 4034, - "category": 3 /* NoPrefix */ - }, - "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}": { - "code": 4035, - "category": 3 /* NoPrefix */ - }, - "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}": { - "code": 4036, - "category": 3 /* NoPrefix */ - }, - "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}": { - "code": 4037, - "category": 3 /* NoPrefix */ - }, - "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { - "code": 4038, - "category": 3 /* NoPrefix */ - }, - "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { - "code": 4039, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' define static property '{2}' as private.": { - "code": 4040, - "category": 3 /* NoPrefix */ - }, - "Current host does not support '{0}' option.": { - "code": 5001, - "category": 1 /* Error */ - }, - "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'": { - "code": 5002, - "category": 1 /* Error */ - }, - "Module code generation '{0}' not supported.": { - "code": 5003, - "category": 1 /* Error */ - }, - "Could not find file: '{0}'.": { - "code": 5004, - "category": 1 /* Error */ - }, - "A file cannot have a reference to itself.": { - "code": 5006, - "category": 1 /* Error */ - }, - "Cannot resolve referenced file: '{0}'.": { - "code": 5007, - "category": 1 /* Error */ - }, - "Cannot find the common subdirectory path for the input files.": { - "code": 5009, - "category": 1 /* Error */ - }, - "Emit Error: {0}.": { - "code": 5011, - "category": 1 /* Error */ - }, - "Cannot read file '{0}': {1}": { - "code": 5012, - "category": 1 /* Error */ - }, - "Unsupported file encoding.": { - "code": 5013, - "category": 3 /* NoPrefix */ - }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { - "code": 5014, - "category": 1 /* Error */ - }, - "Unsupported locale: '{0}'.": { - "code": 5015, - "category": 1 /* Error */ - }, - "Execution Failed.{NL}": { - "code": 5016, - "category": 1 /* Error */ - }, - "Invalid call to 'up'": { - "code": 5019, - "category": 1 /* Error */ - }, - "Invalid call to 'down'": { - "code": 5020, - "category": 1 /* Error */ - }, - "Base64 value '{0}' finished with a continuation bit.": { - "code": 5021, - "category": 1 /* Error */ - }, - "Unknown option '{0}'": { - "code": 5023, - "category": 1 /* Error */ - }, - "Expected {0} arguments to message, got {1} instead.": { - "code": 5024, - "category": 1 /* Error */ - }, - "Expected the message '{0}' to have {1} arguments, but it had {2}": { - "code": 5025, - "category": 1 /* Error */ - }, - "Could not delete file '{0}'": { - "code": 5034, - "category": 1 /* Error */ - }, - "Could not create directory '{0}'": { - "code": 5035, - "category": 1 /* Error */ - }, - "Error while executing file '{0}': ": { - "code": 5036, - "category": 1 /* Error */ - }, - "Cannot compile external modules unless the '--module' flag is provided.": { - "code": 5037, - "category": 1 /* Error */ - }, - "Option mapRoot cannot be specified without specifying sourcemap option.": { - "code": 5038, - "category": 1 /* Error */ - }, - "Option sourceRoot cannot be specified without specifying sourcemap option.": { - "code": 5039, - "category": 1 /* Error */ - }, - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": { - "code": 5040, - "category": 1 /* Error */ - }, - "Option '{0}' specified without '{1}'": { - "code": 5041, - "category": 1 /* Error */ - }, - "'codepage' option not supported on current platform.": { - "code": 5042, - "category": 1 /* Error */ - }, - "Concatenate and emit output to single file.": { - "code": 6001, - "category": 2 /* Message */ - }, - "Generates corresponding {0} file.": { - "code": 6002, - "category": 2 /* Message */ - }, - "Specifies the location where debugger should locate map files instead of generated locations.": { - "code": 6003, - "category": 2 /* Message */ - }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { - "code": 6004, - "category": 2 /* Message */ - }, - "Watch input files.": { - "code": 6005, - "category": 2 /* Message */ - }, - "Redirect output structure to the directory.": { - "code": 6006, - "category": 2 /* Message */ - }, - "Do not emit comments to output.": { - "code": 6009, - "category": 2 /* Message */ - }, - "Skip resolution and preprocessing.": { - "code": 6010, - "category": 2 /* Message */ - }, - "Specify ECMAScript target version: '{0}' (default), or '{1}'": { - "code": 6015, - "category": 2 /* Message */ - }, - "Specify module code generation: '{0}' or '{1}'": { - "code": 6016, - "category": 2 /* Message */ - }, - "Print this message.": { - "code": 6017, - "category": 2 /* Message */ - }, - "Print the compiler's version: {0}": { - "code": 6019, - "category": 2 /* Message */ - }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { - "code": 6021, - "category": 2 /* Message */ - }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { - "code": 6022, - "category": 2 /* Message */ - }, - "Syntax: {0}": { - "code": 6023, - "category": 2 /* Message */ - }, - "options": { - "code": 6024, - "category": 2 /* Message */ - }, - "file1": { - "code": 6025, - "category": 2 /* Message */ - }, - "Examples:": { - "code": 6026, - "category": 2 /* Message */ - }, - "Options:": { - "code": 6027, - "category": 2 /* Message */ - }, - "Insert command line options and files from a file.": { - "code": 6030, - "category": 2 /* Message */ - }, - "Version {0}": { - "code": 6029, - "category": 2 /* Message */ - }, - "Use the '{0}' flag to see options.": { - "code": 6031, - "category": 2 /* Message */ - }, - "{NL}Recompiling ({0}):": { - "code": 6032, - "category": 2 /* Message */ - }, - "STRING": { - "code": 6033, - "category": 2 /* Message */ - }, - "KIND": { - "code": 6034, - "category": 2 /* Message */ - }, - "file2": { - "code": 6035, - "category": 2 /* Message */ - }, - "VERSION": { - "code": 6036, - "category": 2 /* Message */ - }, - "LOCATION": { - "code": 6037, - "category": 2 /* Message */ - }, - "DIRECTORY": { - "code": 6038, - "category": 2 /* Message */ - }, - "NUMBER": { - "code": 6039, - "category": 2 /* Message */ - }, - "Specify the codepage to use when opening source files.": { - "code": 6040, - "category": 2 /* Message */ - }, - "Additional locations:": { - "code": 6041, - "category": 2 /* Message */ - }, - "This version of the Javascript runtime does not support the '{0}' function.": { - "code": 7000, - "category": 1 /* Error */ - }, - "Unknown rule.": { - "code": 7002, - "category": 1 /* Error */ - }, - "Invalid line number ({0})": { - "code": 7003, - "category": 1 /* Error */ - }, - "Warn on expressions and declarations with an implied 'any' type.": { - "code": 7004, - "category": 2 /* Message */ - }, - "Variable '{0}' implicitly has an 'any' type.": { - "code": 7005, - "category": 1 /* Error */ - }, - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": { - "code": 7006, - "category": 1 /* Error */ - }, - "Parameter '{0}' of function type implicitly has an 'any' type.": { - "code": 7007, - "category": 1 /* Error */ - }, - "Member '{0}' of object type implicitly has an 'any' type.": { - "code": 7008, - "category": 1 /* Error */ - }, - "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.": { - "code": 7009, - "category": 1 /* Error */ - }, - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7010, - "category": 1 /* Error */ - }, - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7011, - "category": 1 /* Error */ - }, - "Parameter '{0}' of lambda function implicitly has an 'any' type.": { - "code": 7012, - "category": 1 /* Error */ - }, - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7013, - "category": 1 /* Error */ - }, - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7014, - "category": 1 /* Error */ - }, - "Array Literal implicitly has an 'any' type from widening.": { - "code": 7015, - "category": 1 /* Error */ - }, - "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.": { - "code": 7016, - "category": 1 /* Error */ - }, - "Index signature of object type implicitly has an 'any' type.": { - "code": 7017, - "category": 1 /* Error */ - }, - "Object literal's property '{0}' implicitly has an 'any' type from widening.": { - "code": 7018, - "category": 1 /* Error */ - } - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(TypeScript.CharacterCodes || (TypeScript.CharacterCodes = {})); - var CharacterCodes = TypeScript.CharacterCodes; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - - - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = null; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - - StringScriptSnapshot.prototype.getLineStartPositions = function () { - if (!this._lineStartPositions) { - this._lineStartPositions = TypeScript.TextUtilities.parseLineStarts(this.text); - } - - return this._lineStartPositions; - }; - - StringScriptSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { - throw TypeScript.Errors.notYetImplemented(); - }; - return StringScriptSnapshot; - })(); - - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(TypeScript.ScriptSnapshot || (TypeScript.ScriptSnapshot = {})); - var ScriptSnapshot = TypeScript.ScriptSnapshot; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (LineMap1) { - function fromSimpleText(text) { - return new TypeScript.LineMap(function () { - return TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { - return text.charCodeAt(index); - }, length: text.length() }); - }, text.length()); - } - LineMap1.fromSimpleText = fromSimpleText; - - function fromScriptSnapshot(scriptSnapshot) { - return new TypeScript.LineMap(function () { - return scriptSnapshot.getLineStartPositions(); - }, scriptSnapshot.getLength()); - } - LineMap1.fromScriptSnapshot = fromScriptSnapshot; - - function fromString(text) { - return new TypeScript.LineMap(function () { - return TypeScript.TextUtilities.parseLineStarts(text); - }, text.length); - } - LineMap1.fromString = fromString; - })(TypeScript.LineMap1 || (TypeScript.LineMap1 = {})); - var LineMap1 = TypeScript.LineMap1; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (TextFactory) { - function getStartAndLengthOfLineBreakEndingAt(text, index, info) { - var c = text.charCodeAt(index); - if (c === 10 /* lineFeed */) { - if (index > 0 && text.charCodeAt(index - 1) === 13 /* carriageReturn */) { - info.startPosition = index - 1; - info.length = 2; - } else { - info.startPosition = index; - info.length = 1; - } - } else if (TypeScript.TextUtilities.isAnyLineBreakCharacter(c)) { - info.startPosition = index; - info.length = 1; - } else { - info.startPosition = index + 1; - info.length = 0; - } - } - - var LinebreakInfo = (function () { - function LinebreakInfo(startPosition, length) { - this.startPosition = startPosition; - this.length = length; - } - return LinebreakInfo; - })(); - - var TextLine = (function () { - function TextLine(text, body, lineBreakLength, lineNumber) { - this._text = null; - this._textSpan = null; - if (text === null) { - throw TypeScript.Errors.argumentNull('text'); - } - TypeScript.Debug.assert(lineBreakLength >= 0); - TypeScript.Debug.assert(lineNumber >= 0); - this._text = text; - this._textSpan = body; - this._lineBreakLength = lineBreakLength; - this._lineNumber = lineNumber; - } - TextLine.prototype.start = function () { - return this._textSpan.start(); - }; - - TextLine.prototype.end = function () { - return this._textSpan.end(); - }; - - TextLine.prototype.endIncludingLineBreak = function () { - return this.end() + this._lineBreakLength; - }; - - TextLine.prototype.extent = function () { - return this._textSpan; - }; - - TextLine.prototype.extentIncludingLineBreak = function () { - return TypeScript.TextSpan.fromBounds(this.start(), this.endIncludingLineBreak()); - }; - - TextLine.prototype.toString = function () { - return this._text.toString(this._textSpan); - }; - - TextLine.prototype.lineNumber = function () { - return this._lineNumber; - }; - return TextLine; - })(); - - var TextBase = (function () { - function TextBase() { - this.linebreakInfo = new LinebreakInfo(0, 0); - this.lastLineFoundForPosition = null; - } - TextBase.prototype.length = function () { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.charCodeAt = function (position) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.checkSubSpan = function (span) { - if (span.start() < 0 || span.start() > this.length() || span.end() > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("span"); - } - }; - - TextBase.prototype.toString = function (span) { - if (typeof span === "undefined") { span = null; } - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SubText(this, span); - }; - - TextBase.prototype.substr = function (start, length, intern) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.lineCount = function () { - return this._lineStarts().length; - }; - - TextBase.prototype.lines = function () { - var lines = []; - - var length = this.lineCount(); - for (var i = 0; i < length; ++i) { - lines[i] = this.getLineFromLineNumber(i); - } - - return lines; - }; - - TextBase.prototype.lineMap = function () { - var _this = this; - return new TypeScript.LineMap(function () { - return _this._lineStarts(); - }, this.length()); - }; - - TextBase.prototype._lineStarts = function () { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.getLineFromLineNumber = function (lineNumber) { - var lineStarts = this._lineStarts(); - - if (lineNumber < 0 || lineNumber >= lineStarts.length) { - throw TypeScript.Errors.argumentOutOfRange("lineNumber"); - } - - var first = lineStarts[lineNumber]; - if (lineNumber === lineStarts.length - 1) { - return new TextLine(this, new TypeScript.TextSpan(first, this.length() - first), 0, lineNumber); - } else { - getStartAndLengthOfLineBreakEndingAt(this, lineStarts[lineNumber + 1] - 1, this.linebreakInfo); - return new TextLine(this, new TypeScript.TextSpan(first, this.linebreakInfo.startPosition - first), this.linebreakInfo.length, lineNumber); - } - }; - - TextBase.prototype.getLineFromPosition = function (position) { - var lastFound = this.lastLineFoundForPosition; - if (lastFound !== null && lastFound.start() <= position && lastFound.endIncludingLineBreak() > position) { - return lastFound; - } - - var lineNumber = this.getLineNumberFromPosition(position); - - var result = this.getLineFromLineNumber(lineNumber); - this.lastLineFoundForPosition = result; - return result; - }; - - TextBase.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - if (position === this.length()) { - return this.lineCount() - 1; - } - - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this._lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - - return lineNumber; - }; - - TextBase.prototype.getLinePosition = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - - return new TypeScript.LineAndCharacter(lineNumber, position - this._lineStarts()[lineNumber]); - }; - return TextBase; - })(); - - var SubText = (function (_super) { - __extends(SubText, _super); - function SubText(text, span) { - _super.call(this); - this._lazyLineStarts = null; - - if (text === null) { - throw TypeScript.Errors.argumentNull("text"); - } - - if (span.start() < 0 || span.start() >= text.length() || span.end() < 0 || span.end() > text.length()) { - throw TypeScript.Errors.argument("span"); - } - - this.text = text; - this.span = span; - } - SubText.prototype.length = function () { - return this.span.length(); - }; - - SubText.prototype.charCodeAt = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - return this.text.charCodeAt(this.span.start() + position); - }; - - SubText.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SubText(this.text, this.getCompositeSpan(span.start(), span.length())); - }; - - SubText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var span = this.getCompositeSpan(sourceIndex, count); - this.text.copyTo(span.start(), destination, destinationIndex, span.length()); - }; - - SubText.prototype.substr = function (start, length, intern) { - var startInOriginalText = this.span.start() + start; - return this.text.substr(startInOriginalText, length, intern); - }; - - SubText.prototype.getCompositeSpan = function (start, length) { - var compositeStart = TypeScript.MathPrototype.min(this.text.length(), this.span.start() + start); - var compositeEnd = TypeScript.MathPrototype.min(this.text.length(), compositeStart + length); - return new TypeScript.TextSpan(compositeStart, compositeEnd - compositeStart); - }; - - SubText.prototype._lineStarts = function () { - var _this = this; - if (!this._lazyLineStarts) { - this._lazyLineStarts = TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { - return _this.charCodeAt(index); - }, length: this.length() }); - } - - return this._lazyLineStarts; - }; - return SubText; - })(TextBase); - - var StringText = (function (_super) { - __extends(StringText, _super); - function StringText(data) { - _super.call(this); - this.source = null; - this._lazyLineStarts = null; - - if (data === null) { - throw TypeScript.Errors.argumentNull("data"); - } - - this.source = data; - } - StringText.prototype.length = function () { - return this.source.length; - }; - - StringText.prototype.charCodeAt = function (position) { - if (position < 0 || position >= this.source.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - return this.source.charCodeAt(position); - }; - - StringText.prototype.substr = function (start, length, intern) { - return this.source.substr(start, length); - }; - - StringText.prototype.toString = function (span) { - if (typeof span === "undefined") { span = null; } - if (span === null) { - span = new TypeScript.TextSpan(0, this.length()); - } - - this.checkSubSpan(span); - - if (span.start() === 0 && span.length() === this.length()) { - return this.source; - } - - return this.source.substr(span.start(), span.length()); - }; - - StringText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - TypeScript.StringUtilities.copyTo(this.source, sourceIndex, destination, destinationIndex, count); - }; - - StringText.prototype._lineStarts = function () { - if (this._lazyLineStarts === null) { - this._lazyLineStarts = TypeScript.TextUtilities.parseLineStarts(this.source); - } - - return this._lazyLineStarts; - }; - return StringText; - })(TextBase); - - function createText(value) { - return new StringText(value); - } - TextFactory.createText = createText; - })(TypeScript.TextFactory || (TypeScript.TextFactory = {})); - var TextFactory = TypeScript.TextFactory; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (SimpleText) { - var SimpleSubText = (function () { - function SimpleSubText(text, span) { - this.text = null; - this.span = null; - if (text === null) { - throw TypeScript.Errors.argumentNull("text"); - } - - if (span.start() < 0 || span.start() >= text.length() || span.end() < 0 || span.end() > text.length()) { - throw TypeScript.Errors.argument("span"); - } - - this.text = text; - this.span = span; - } - SimpleSubText.prototype.checkSubSpan = function (span) { - if (span.start() < 0 || span.start() > this.length() || span.end() > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("span"); - } - }; - - SimpleSubText.prototype.checkSubPosition = function (position) { - if (position < 0 || position >= this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - }; - - SimpleSubText.prototype.length = function () { - return this.span.length(); - }; - - SimpleSubText.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SimpleSubText(this.text, this.getCompositeSpan(span.start(), span.length())); - }; - - SimpleSubText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var span = this.getCompositeSpan(sourceIndex, count); - this.text.copyTo(span.start(), destination, destinationIndex, span.length()); - }; - - SimpleSubText.prototype.substr = function (start, length, intern) { - var span = this.getCompositeSpan(start, length); - return this.text.substr(span.start(), span.length(), intern); - }; - - SimpleSubText.prototype.getCompositeSpan = function (start, length) { - var compositeStart = TypeScript.MathPrototype.min(this.text.length(), this.span.start() + start); - var compositeEnd = TypeScript.MathPrototype.min(this.text.length(), compositeStart + length); - return new TypeScript.TextSpan(compositeStart, compositeEnd - compositeStart); - }; - - SimpleSubText.prototype.charCodeAt = function (index) { - this.checkSubPosition(index); - return this.text.charCodeAt(this.span.start() + index); - }; - - SimpleSubText.prototype.lineMap = function () { - return TypeScript.LineMap1.fromSimpleText(this); - }; - return SimpleSubText; - })(); - - var SimpleStringText = (function () { - function SimpleStringText(value) { - this.value = value; - this._lineMap = null; - } - SimpleStringText.prototype.length = function () { - return this.value.length; - }; - - SimpleStringText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - TypeScript.StringUtilities.copyTo(this.value, sourceIndex, destination, destinationIndex, count); - }; - - SimpleStringText.prototype.substr = function (start, length, intern) { - if (intern) { - var array = length <= SimpleStringText.charArray.length ? SimpleStringText.charArray : TypeScript.ArrayUtilities.createArray(length, 0); - this.copyTo(start, array, 0, length); - return TypeScript.Collections.DefaultStringTable.addCharArray(array, 0, length); - } - - return this.value.substr(start, length); - }; - - SimpleStringText.prototype.subText = function (span) { - return new SimpleSubText(this, span); - }; - - SimpleStringText.prototype.charCodeAt = function (index) { - return this.value.charCodeAt(index); - }; - - SimpleStringText.prototype.lineMap = function () { - if (!this._lineMap) { - this._lineMap = TypeScript.LineMap1.fromString(this.value); - } - - return this._lineMap; - }; - SimpleStringText.charArray = TypeScript.ArrayUtilities.createArray(1024, 0); - return SimpleStringText; - })(); - - var SimpleScriptSnapshotText = (function () { - function SimpleScriptSnapshotText(scriptSnapshot) { - this.scriptSnapshot = scriptSnapshot; - } - SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { - return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); - }; - - SimpleScriptSnapshotText.prototype.length = function () { - return this.scriptSnapshot.getLength(); - }; - - SimpleScriptSnapshotText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var text = this.scriptSnapshot.getText(sourceIndex, sourceIndex + count); - TypeScript.StringUtilities.copyTo(text, 0, destination, destinationIndex, count); - }; - - SimpleScriptSnapshotText.prototype.substr = function (start, length, intern) { - return this.scriptSnapshot.getText(start, start + length); - }; - - SimpleScriptSnapshotText.prototype.subText = function (span) { - return new SimpleSubText(this, span); - }; - - SimpleScriptSnapshotText.prototype.lineMap = function () { - var _this = this; - return new TypeScript.LineMap(function () { - return _this.scriptSnapshot.getLineStartPositions(); - }, this.length()); - }; - return SimpleScriptSnapshotText; - })(); - - function fromString(value) { - return new SimpleStringText(value); - } - SimpleText.fromString = fromString; - - function fromScriptSnapshot(scriptSnapshot) { - return new SimpleScriptSnapshotText(scriptSnapshot); - } - SimpleText.fromScriptSnapshot = fromScriptSnapshot; - })(TypeScript.SimpleText || (TypeScript.SimpleText = {})); - var SimpleText = TypeScript.SimpleText; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (TextUtilities) { - function parseLineStarts(text) { - var length = text.length; - - if (0 === length) { - var result = new Array(); - result.push(0); - return result; - } - - var position = 0; - var index = 0; - var arrayBuilder = new Array(); - var lineNumber = 0; - - while (index < length) { - var c = text.charCodeAt(index); - var lineBreakLength; - - if (c > 13 /* carriageReturn */ && c <= 127) { - index++; - continue; - } else if (c === 13 /* carriageReturn */ && index + 1 < length && text.charCodeAt(index + 1) === 10 /* lineFeed */) { - lineBreakLength = 2; - } else if (c === 10 /* lineFeed */) { - lineBreakLength = 1; - } else { - lineBreakLength = TextUtilities.getLengthOfLineBreak(text, index); - } - - if (0 === lineBreakLength) { - index++; - } else { - arrayBuilder.push(position); - index += lineBreakLength; - position = index; - lineNumber++; - } - } - - arrayBuilder.push(position); - - return arrayBuilder; - } - TextUtilities.parseLineStarts = parseLineStarts; - - function getLengthOfLineBreakSlow(text, index, c) { - if (c === 13 /* carriageReturn */) { - var next = index + 1; - return (next < text.length) && 10 /* lineFeed */ === text.charCodeAt(next) ? 2 : 1; - } else if (isAnyLineBreakCharacter(c)) { - return 1; - } else { - return 0; - } - } - TextUtilities.getLengthOfLineBreakSlow = getLengthOfLineBreakSlow; - - function getLengthOfLineBreak(text, index) { - var c = text.charCodeAt(index); - - if (c > 13 /* carriageReturn */ && c <= 127) { - return 0; - } - - return getLengthOfLineBreakSlow(text, index, c); - } - TextUtilities.getLengthOfLineBreak = getLengthOfLineBreak; - - function isAnyLineBreakCharacter(c) { - return c === 10 /* lineFeed */ || c === 13 /* carriageReturn */ || c === 133 /* nextLine */ || c === 8232 /* lineSeparator */ || c === 8233 /* paragraphSeparator */; - } - TextUtilities.isAnyLineBreakCharacter = isAnyLineBreakCharacter; - })(TypeScript.TextUtilities || (TypeScript.TextUtilities = {})); - var TextUtilities = TypeScript.TextUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextSpan = (function () { - function TextSpan(start, length) { - if (start < 0) { - TypeScript.Errors.argument("start"); - } - - if (length < 0) { - TypeScript.Errors.argument("length"); - } - - this._start = start; - this._length = length; - } - TextSpan.prototype.start = function () { - return this._start; - }; - - TextSpan.prototype.length = function () { - return this._length; - }; - - TextSpan.prototype.end = function () { - return this._start + this._length; - }; - - TextSpan.prototype.isEmpty = function () { - return this._length === 0; - }; - - TextSpan.prototype.containsPosition = function (position) { - return position >= this._start && position < this.end(); - }; - - TextSpan.prototype.containsTextSpan = function (span) { - return span._start >= this._start && span.end() <= this.end(); - }; - - TextSpan.prototype.overlapsWith = function (span) { - var overlapStart = TypeScript.MathPrototype.max(this._start, span._start); - var overlapEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - return overlapStart < overlapEnd; - }; - - TextSpan.prototype.overlap = function (span) { - var overlapStart = TypeScript.MathPrototype.max(this._start, span._start); - var overlapEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - if (overlapStart < overlapEnd) { - return TextSpan.fromBounds(overlapStart, overlapEnd); - } - - return null; - }; - - TextSpan.prototype.intersectsWithTextSpan = function (span) { - return span._start <= this.end() && span.end() >= this._start; - }; - - TextSpan.prototype.intersectsWith = function (start, length) { - var end = start + length; - return start <= this.end() && end >= this._start; - }; - - TextSpan.prototype.intersectsWithPosition = function (position) { - return position <= this.end() && position >= this._start; - }; - - TextSpan.prototype.intersection = function (span) { - var intersectStart = TypeScript.MathPrototype.max(this._start, span._start); - var intersectEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - if (intersectStart <= intersectEnd) { - return TextSpan.fromBounds(intersectStart, intersectEnd); - } - - return null; - }; - - TextSpan.fromBounds = function (start, end) { - TypeScript.Debug.assert(start >= 0); - TypeScript.Debug.assert(end - start >= 0); - return new TextSpan(start, end - start); - }; - return TextSpan; - })(); - TypeScript.TextSpan = TextSpan; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextChangeRange = (function () { - function TextChangeRange(span, newLength) { - if (newLength < 0) { - throw TypeScript.Errors.argumentOutOfRange("newLength"); - } - - this._span = span; - this._newLength = newLength; - } - TextChangeRange.prototype.span = function () { - return this._span; - }; - - TextChangeRange.prototype.newLength = function () { - return this._newLength; - }; - - TextChangeRange.prototype.newSpan = function () { - return new TypeScript.TextSpan(this.span().start(), this.newLength()); - }; - - TextChangeRange.prototype.isUnchanged = function () { - return this.span().isEmpty() && this.newLength() === 0; - }; - - TextChangeRange.collapseChangesFromSingleVersion = function (changes) { - var diff = 0; - var start = 1073741823 /* Max31BitInteger */; - var end = 0; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - diff += change.newLength() - change.span().length(); - - if (change.span().start() < start) { - start = change.span().start(); - } - - if (change.span().end() > end) { - end = change.span().end(); - } - } - - if (start > end) { - return null; - } - - var combined = TypeScript.TextSpan.fromBounds(start, end); - var newLen = combined.length() + diff; - - return new TextChangeRange(combined, newLen); - }; - - TextChangeRange.collapseChangesAcrossMultipleVersions = function (changes) { - if (changes.length === 0) { - return TextChangeRange.unchanged; - } - - if (changes.length === 1) { - return changes[0]; - } - - var change0 = changes[0]; - - var oldStartN = change0.span().start(); - var oldEndN = change0.span().end(); - var newEndN = oldStartN + change0.newLength(); - - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - - var oldStart2 = nextChange.span().start(); - var oldEnd2 = nextChange.span().end(); - var newEnd2 = oldStart2 + nextChange.newLength(); - - oldStartN = TypeScript.MathPrototype.min(oldStart1, oldStart2); - oldEndN = TypeScript.MathPrototype.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = TypeScript.MathPrototype.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - - return new TextChangeRange(TypeScript.TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); - }; - TextChangeRange.unchanged = new TextChangeRange(new TypeScript.TextSpan(0, 0), 0); - return TextChangeRange; - })(); - TypeScript.TextChangeRange = TextChangeRange; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CharacterInfo = (function () { - function CharacterInfo() { - } - CharacterInfo.isDecimalDigit = function (c) { - return c >= 48 /* _0 */ && c <= 57 /* _9 */; - }; - CharacterInfo.isOctalDigit = function (c) { - return c >= 48 /* _0 */ && c <= 55 /* _7 */; - }; - - CharacterInfo.isHexDigit = function (c) { - return CharacterInfo.isDecimalDigit(c) || (c >= 65 /* A */ && c <= 70 /* F */) || (c >= 97 /* a */ && c <= 102 /* f */); - }; - - CharacterInfo.hexValue = function (c) { - return CharacterInfo.isDecimalDigit(c) ? (c - 48 /* _0 */) : (c >= 65 /* A */ && c <= 70 /* F */) ? c - 65 /* A */ + 10 : c - 97 /* a */ + 10; - }; - - CharacterInfo.isWhitespace = function (ch) { - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - return true; - } - - return false; - }; - - CharacterInfo.isLineTerminator = function (ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - } - - return false; - }; - return CharacterInfo; - })(); - TypeScript.CharacterInfo = CharacterInfo; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxConstants) { - SyntaxConstants[SyntaxConstants["TriviaNewLineMask"] = 0x00000001] = "TriviaNewLineMask"; - SyntaxConstants[SyntaxConstants["TriviaCommentMask"] = 0x00000002] = "TriviaCommentMask"; - SyntaxConstants[SyntaxConstants["TriviaFullWidthShift"] = 2] = "TriviaFullWidthShift"; - - SyntaxConstants[SyntaxConstants["NodeDataComputed"] = 0x00000001] = "NodeDataComputed"; - SyntaxConstants[SyntaxConstants["NodeIncrementallyUnusableMask"] = 0x00000002] = "NodeIncrementallyUnusableMask"; - SyntaxConstants[SyntaxConstants["NodeParsedInStrictModeMask"] = 0x00000004] = "NodeParsedInStrictModeMask"; - SyntaxConstants[SyntaxConstants["NodeFullWidthShift"] = 3] = "NodeFullWidthShift"; - - SyntaxConstants[SyntaxConstants["IsVariableWidthKeyword"] = 1 << 31] = "IsVariableWidthKeyword"; - })(TypeScript.SyntaxConstants || (TypeScript.SyntaxConstants = {})); - var SyntaxConstants = TypeScript.SyntaxConstants; -})(TypeScript || (TypeScript = {})); -var FormattingOptions = (function () { - function FormattingOptions(useTabs, spacesPerTab, indentSpaces, newLineCharacter) { - this.useTabs = useTabs; - this.spacesPerTab = spacesPerTab; - this.indentSpaces = indentSpaces; - this.newLineCharacter = newLineCharacter; - } - FormattingOptions.defaultOptions = new FormattingOptions(false, 4, 4, "\r\n"); - return FormattingOptions; -})(); -var TypeScript; -(function (TypeScript) { - (function (Indentation) { - function columnForEndOfToken(token, syntaxInformationMap, options) { - return columnForStartOfToken(token, syntaxInformationMap, options) + token.width(); - } - Indentation.columnForEndOfToken = columnForEndOfToken; - - function columnForStartOfToken(token, syntaxInformationMap, options) { - var firstTokenInLine = syntaxInformationMap.firstTokenInLineContainingToken(token); - var leadingTextInReverse = []; - - var current = token; - while (current !== firstTokenInLine) { - current = syntaxInformationMap.previousToken(current); - - if (current === firstTokenInLine) { - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } else { - leadingTextInReverse.push(current.fullText()); - } - } - - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfToken = columnForStartOfToken; - - function columnForStartOfFirstTokenInLineContainingToken(token, syntaxInformationMap, options) { - var firstTokenInLine = syntaxInformationMap.firstTokenInLineContainingToken(token); - var leadingTextInReverse = []; - - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfFirstTokenInLineContainingToken = columnForStartOfFirstTokenInLineContainingToken; - - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { - break; - } - - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); - - if (lineSegments.length > 0) { - break; - } - } - - leadingTextInReverse.push(trivia.fullText()); - } - } - - function columnForLeadingTextInReverse(leadingTextInReverse, options) { - var column = 0; - - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - - return column; - } - - function columnForPositionInString(input, position, options) { - return columnForPositionInStringWorker(input, position, 0, options); - } - Indentation.columnForPositionInString = columnForPositionInString; - - function columnForPositionInStringWorker(input, position, startColumn, options) { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - - if (ch === 9 /* tab */) { - column += spacesPerTab - column % spacesPerTab; - } else { - column++; - } - } - - return column; - } - - function indentationString(column, options) { - var numberOfTabs = 0; - var numberOfSpaces = TypeScript.MathPrototype.max(0, column); - - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - - return TypeScript.StringUtilities.repeat('\t', numberOfTabs) + TypeScript.StringUtilities.repeat(' ', numberOfSpaces); - } - Indentation.indentationString = indentationString; - - function indentationTrivia(column, options) { - return TypeScript.Syntax.whitespace(this.indentationString(column, options)); - } - Indentation.indentationTrivia = indentationTrivia; - - function firstNonWhitespacePosition(value) { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!TypeScript.CharacterInfo.isWhitespace(ch)) { - return i; - } - } - - return value.length; - } - Indentation.firstNonWhitespacePosition = firstNonWhitespacePosition; - })(TypeScript.Indentation || (TypeScript.Indentation = {})); - var Indentation = TypeScript.Indentation; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - })(TypeScript.LanguageVersion || (TypeScript.LanguageVersion = {})); - var LanguageVersion = TypeScript.LanguageVersion; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ParseOptions = (function () { - function ParseOptions(languageVersion, allowAutomaticSemicolonInsertion) { - this._languageVersion = languageVersion; - this._allowAutomaticSemicolonInsertion = allowAutomaticSemicolonInsertion; - } - ParseOptions.prototype.toJSON = function (key) { - return { allowAutomaticSemicolonInsertion: this._allowAutomaticSemicolonInsertion }; - }; - - ParseOptions.prototype.languageVersion = function () { - return this._languageVersion; - }; - - ParseOptions.prototype.allowAutomaticSemicolonInsertion = function () { - return this._allowAutomaticSemicolonInsertion; - }; - return ParseOptions; - })(); - TypeScript.ParseOptions = ParseOptions; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PositionedElement = (function () { - function PositionedElement(parent, element, fullStart) { - this._parent = parent; - this._element = element; - this._fullStart = fullStart; - } - PositionedElement.create = function (parent, element, fullStart) { - if (element === null) { - return null; - } - - if (element.isNode()) { - return new PositionedNode(parent, element, fullStart); - } else if (element.isToken()) { - return new PositionedToken(parent, element, fullStart); - } else if (element.isList()) { - return new PositionedList(parent, element, fullStart); - } else if (element.isSeparatedList()) { - return new PositionedSeparatedList(parent, element, fullStart); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - PositionedElement.prototype.parent = function () { - return this._parent; - }; - - PositionedElement.prototype.parentElement = function () { - return this._parent && this._parent._element; - }; - - PositionedElement.prototype.element = function () { - return this._element; - }; - - PositionedElement.prototype.kind = function () { - return this.element().kind(); - }; - - PositionedElement.prototype.childIndex = function (child) { - return TypeScript.Syntax.childIndex(this.element(), child); - }; - - PositionedElement.prototype.childCount = function () { - return this.element().childCount(); - }; - - PositionedElement.prototype.childAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - return PositionedElement.create(this, this.element().childAt(index), this.fullStart() + offset); - }; - - PositionedElement.prototype.childStart = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return this.fullStart() + offset + child.leadingTriviaWidth(); - }; - - PositionedElement.prototype.childEnd = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return this.fullStart() + offset + child.leadingTriviaWidth() + child.width(); - }; - - PositionedElement.prototype.childStartAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - var child = this.element().childAt(index); - return this.fullStart() + offset + child.leadingTriviaWidth(); - }; - - PositionedElement.prototype.childEndAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - var child = this.element().childAt(index); - return this.fullStart() + offset + child.leadingTriviaWidth() + child.width(); - }; - - PositionedElement.prototype.getPositionedChild = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return PositionedElement.create(this, child, this.fullStart() + offset); - }; - - PositionedElement.prototype.fullStart = function () { - return this._fullStart; - }; - - PositionedElement.prototype.fullEnd = function () { - return this.fullStart() + this.element().fullWidth(); - }; - - PositionedElement.prototype.fullWidth = function () { - return this.element().fullWidth(); - }; - - PositionedElement.prototype.start = function () { - return this.fullStart() + this.element().leadingTriviaWidth(); - }; - - PositionedElement.prototype.end = function () { - return this.fullStart() + this.element().leadingTriviaWidth() + this.element().width(); - }; - - PositionedElement.prototype.root = function () { - var current = this; - while (current.parent() !== null) { - current = current.parent(); - } - - return current; - }; - - PositionedElement.prototype.containingNode = function () { - var current = this.parent(); - - while (current !== null && !current.element().isNode()) { - current = current.parent(); - } - - return current; - }; - return PositionedElement; - })(); - TypeScript.PositionedElement = PositionedElement; - - var PositionedNodeOrToken = (function (_super) { - __extends(PositionedNodeOrToken, _super); - function PositionedNodeOrToken(parent, nodeOrToken, fullStart) { - _super.call(this, parent, nodeOrToken, fullStart); - } - PositionedNodeOrToken.prototype.nodeOrToken = function () { - return this.element(); - }; - return PositionedNodeOrToken; - })(PositionedElement); - TypeScript.PositionedNodeOrToken = PositionedNodeOrToken; - - var PositionedNode = (function (_super) { - __extends(PositionedNode, _super); - function PositionedNode(parent, node, fullStart) { - _super.call(this, parent, node, fullStart); - } - PositionedNode.prototype.node = function () { - return this.element(); - }; - return PositionedNode; - })(PositionedNodeOrToken); - TypeScript.PositionedNode = PositionedNode; - - var PositionedToken = (function (_super) { - __extends(PositionedToken, _super); - function PositionedToken(parent, token, fullStart) { - _super.call(this, parent, token, fullStart); - } - PositionedToken.prototype.token = function () { - return this.element(); - }; - - PositionedToken.prototype.previousToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var triviaList = this.token().leadingTrivia(); - if (includeSkippedTokens && triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = this.start(); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return new PositionedSkippedToken(this, trivia.skippedToken(), currentTriviaEndPosition - trivia.fullWidth()); - } - - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - - var start = this.fullStart(); - if (start === 0) { - return null; - } - - return this.root().node().findToken(start - 1, includeSkippedTokens); - }; - - PositionedToken.prototype.nextToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - if (this.token().tokenKind === 10 /* EndOfFileToken */) { - return null; - } - - var triviaList = this.token().trailingTrivia(); - if (includeSkippedTokens && triviaList && triviaList.hasSkippedToken()) { - var fullStart = this.end(); - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return new PositionedSkippedToken(this, trivia.skippedToken(), fullStart); - } - - fullStart += trivia.fullWidth(); - } - } - - return this.root().node().findToken(this.fullEnd(), includeSkippedTokens); - }; - return PositionedToken; - })(PositionedNodeOrToken); - TypeScript.PositionedToken = PositionedToken; - - var PositionedList = (function (_super) { - __extends(PositionedList, _super); - function PositionedList(parent, list, fullStart) { - _super.call(this, parent, list, fullStart); - } - PositionedList.prototype.list = function () { - return this.element(); - }; - return PositionedList; - })(PositionedElement); - TypeScript.PositionedList = PositionedList; - - var PositionedSeparatedList = (function (_super) { - __extends(PositionedSeparatedList, _super); - function PositionedSeparatedList(parent, list, fullStart) { - _super.call(this, parent, list, fullStart); - } - PositionedSeparatedList.prototype.list = function () { - return this.element(); - }; - return PositionedSeparatedList; - })(PositionedElement); - TypeScript.PositionedSeparatedList = PositionedSeparatedList; - - var PositionedSkippedToken = (function (_super) { - __extends(PositionedSkippedToken, _super); - function PositionedSkippedToken(parentToken, token, fullStart) { - _super.call(this, parentToken.parent(), token, fullStart); - this._parentToken = parentToken; - } - PositionedSkippedToken.prototype.parentToken = function () { - return this._parentToken; - }; - - PositionedSkippedToken.prototype.previousToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var start = this.fullStart(); - - if (includeSkippedTokens) { - var previousToken; - - if (start >= this.parentToken().end()) { - previousToken = TypeScript.Syntax.findSkippedTokenInTrailingTriviaList(this.parentToken(), start - 1); - - if (previousToken) { - return previousToken; - } - - return this.parentToken(); - } else { - previousToken = TypeScript.Syntax.findSkippedTokenInLeadingTriviaList(this.parentToken(), start - 1); - - if (previousToken) { - return previousToken; - } - } - } - - var start = this.parentToken().fullStart(); - if (start === 0) { - return null; - } - - return this.root().node().findToken(start - 1, includeSkippedTokens); - }; - - PositionedSkippedToken.prototype.nextToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - if (this.token().tokenKind === 10 /* EndOfFileToken */) { - return null; - } - - if (includeSkippedTokens) { - var end = this.end(); - var nextToken; - - if (end <= this.parentToken().start()) { - nextToken = TypeScript.Syntax.findSkippedTokenInLeadingTriviaList(this.parentToken(), end); - - if (nextToken) { - return nextToken; - } - - return this.parentToken(); - } else { - nextToken = TypeScript.Syntax.findSkippedTokenInTrailingTriviaList(this.parentToken(), end); - - if (nextToken) { - return nextToken; - } - } - } - - return this.root().node().findToken(this.parentToken().fullEnd(), includeSkippedTokens); - }; - return PositionedSkippedToken; - })(PositionedToken); - TypeScript.PositionedSkippedToken = PositionedSkippedToken; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["None"] = 0] = "None"; - SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 128] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 129] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 130] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 131] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 132] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 133] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 134] = "ExportAssignment"; - - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 135] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 136] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 137] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 138] = "IndexMemberDeclaration"; - - SyntaxKind[SyntaxKind["GetAccessor"] = 139] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 140] = "SetAccessor"; - - SyntaxKind[SyntaxKind["PropertySignature"] = 141] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 142] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 143] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 144] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 145] = "MethodSignature"; - - SyntaxKind[SyntaxKind["Block"] = 146] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 148] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 149] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 150] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 151] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 152] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 153] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 154] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 155] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 156] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 157] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 158] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 159] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 160] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 161] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 162] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; - - SyntaxKind[SyntaxKind["PlusExpression"] = 164] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 165] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 166] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 167] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 168] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 169] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 173] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 174] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 175] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 176] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 177] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 178] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 179] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 180] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 181] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 182] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 183] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 184] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 185] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 186] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 187] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 188] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 189] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 190] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 191] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 192] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 193] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 194] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 195] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 196] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 197] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 198] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 199] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 200] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 201] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 202] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 203] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 204] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 205] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 206] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 207] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 208] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 209] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 210] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 211] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 212] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 213] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 214] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 215] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 216] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 218] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 219] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 220] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 221] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 222] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 223] = "OmittedExpression"; - - SyntaxKind[SyntaxKind["VariableDeclaration"] = 224] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 225] = "VariableDeclarator"; - - SyntaxKind[SyntaxKind["ArgumentList"] = 226] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 227] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 228] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 229] = "TypeParameterList"; - - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 230] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 231] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 232] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 233] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 234] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 235] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 236] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 237] = "FinallyClause"; - - SyntaxKind[SyntaxKind["TypeParameter"] = 238] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 239] = "Constraint"; - - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 240] = "SimplePropertyAssignment"; - - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 241] = "FunctionPropertyAssignment"; - - SyntaxKind[SyntaxKind["Parameter"] = 242] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 243] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 244] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 246] = "ModuleNameModuleReference"; - SyntaxKind[SyntaxKind["Last"] = SyntaxKind.ModuleNameModuleReference] = "Last"; - - SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; - SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; - - SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; - - SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; - - SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; - SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; - - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; - - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; - - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; - - SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; - SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; - - SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; - SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; - })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); - var SyntaxKind = TypeScript.SyntaxKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ - }; - - var kindToText = new Array(); - - for (var name in textToKeywordKind) { - if (textToKeywordKind.hasOwnProperty(name)) { - kindToText[textToKeywordKind[name]] = name; - } - } - - kindToText[62 /* ConstructorKeyword */] = "constructor"; - - function getTokenKind(text) { - if (textToKeywordKind.hasOwnProperty(text)) { - return textToKeywordKind[text]; - } - - return 0 /* None */; - } - SyntaxFacts.getTokenKind = getTokenKind; - - function getText(kind) { - var result = kindToText[kind]; - return result !== undefined ? result : null; - } - SyntaxFacts.getText = getText; - - function isTokenKind(kind) { - return kind >= 9 /* FirstToken */ && kind <= 119 /* LastToken */; - } - SyntaxFacts.isTokenKind = isTokenKind; - - function isAnyKeyword(kind) { - return kind >= 15 /* FirstKeyword */ && kind <= 69 /* LastKeyword */; - } - SyntaxFacts.isAnyKeyword = isAnyKeyword; - - function isStandardKeyword(kind) { - return kind >= 15 /* FirstStandardKeyword */ && kind <= 43 /* LastStandardKeyword */; - } - SyntaxFacts.isStandardKeyword = isStandardKeyword; - - function isFutureReservedKeyword(kind) { - return kind >= 44 /* FirstFutureReservedKeyword */ && kind <= 50 /* LastFutureReservedKeyword */; - } - SyntaxFacts.isFutureReservedKeyword = isFutureReservedKeyword; - - function isFutureReservedStrictKeyword(kind) { - return kind >= 51 /* FirstFutureReservedStrictKeyword */ && kind <= 59 /* LastFutureReservedStrictKeyword */; - } - SyntaxFacts.isFutureReservedStrictKeyword = isFutureReservedStrictKeyword; - - function isAnyPunctuation(kind) { - return kind >= 70 /* FirstPunctuation */ && kind <= 119 /* LastPunctuation */; - } - SyntaxFacts.isAnyPunctuation = isAnyPunctuation; - - function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; - - function isBinaryExpressionOperatorToken(tokenKind) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - - function getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 164 /* PlusExpression */; - case 90 /* MinusToken */: - return 165 /* NegateExpression */; - case 102 /* TildeToken */: - return 166 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 167 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 168 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 169 /* PreDecrementExpression */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 210 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 211 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 205 /* MultiplyExpression */; - - case 118 /* SlashToken */: - return 206 /* DivideExpression */; - - case 92 /* PercentToken */: - return 207 /* ModuloExpression */; - - case 89 /* PlusToken */: - return 208 /* AddExpression */; - - case 90 /* MinusToken */: - return 209 /* SubtractExpression */; - - case 95 /* LessThanLessThanToken */: - return 202 /* LeftShiftExpression */; - - case 96 /* GreaterThanGreaterThanToken */: - return 203 /* SignedRightShiftExpression */; - - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 204 /* UnsignedRightShiftExpression */; - - case 80 /* LessThanToken */: - return 196 /* LessThanExpression */; - - case 81 /* GreaterThanToken */: - return 197 /* GreaterThanExpression */; - - case 82 /* LessThanEqualsToken */: - return 198 /* LessThanOrEqualExpression */; - - case 83 /* GreaterThanEqualsToken */: - return 199 /* GreaterThanOrEqualExpression */; - - case 30 /* InstanceOfKeyword */: - return 200 /* InstanceOfExpression */; - - case 29 /* InKeyword */: - return 201 /* InExpression */; - - case 84 /* EqualsEqualsToken */: - return 192 /* EqualsWithTypeConversionExpression */; - - case 86 /* ExclamationEqualsToken */: - return 193 /* NotEqualsWithTypeConversionExpression */; - - case 87 /* EqualsEqualsEqualsToken */: - return 194 /* EqualsExpression */; - - case 88 /* ExclamationEqualsEqualsToken */: - return 195 /* NotEqualsExpression */; - - case 98 /* AmpersandToken */: - return 191 /* BitwiseAndExpression */; - - case 100 /* CaretToken */: - return 190 /* BitwiseExclusiveOrExpression */; - - case 99 /* BarToken */: - return 189 /* BitwiseOrExpression */; - - case 103 /* AmpersandAmpersandToken */: - return 188 /* LogicalAndExpression */; - - case 104 /* BarBarToken */: - return 187 /* LogicalOrExpression */; - - case 116 /* BarEqualsToken */: - return 182 /* OrAssignmentExpression */; - - case 115 /* AmpersandEqualsToken */: - return 180 /* AndAssignmentExpression */; - - case 117 /* CaretEqualsToken */: - return 181 /* ExclusiveOrAssignmentExpression */; - - case 112 /* LessThanLessThanEqualsToken */: - return 183 /* LeftShiftAssignmentExpression */; - - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 184 /* SignedRightShiftAssignmentExpression */; - - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 185 /* UnsignedRightShiftAssignmentExpression */; - - case 108 /* PlusEqualsToken */: - return 175 /* AddAssignmentExpression */; - - case 109 /* MinusEqualsToken */: - return 176 /* SubtractAssignmentExpression */; - - case 110 /* AsteriskEqualsToken */: - return 177 /* MultiplyAssignmentExpression */; - - case 119 /* SlashEqualsToken */: - return 178 /* DivideAssignmentExpression */; - - case 111 /* PercentEqualsToken */: - return 179 /* ModuloAssignmentExpression */; - - case 107 /* EqualsToken */: - return 174 /* AssignmentExpression */; - - case 79 /* CommaToken */: - return 173 /* CommaExpression */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 205 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - - case 206 /* DivideExpression */: - return 118 /* SlashToken */; - - case 207 /* ModuloExpression */: - return 92 /* PercentToken */; - - case 208 /* AddExpression */: - return 89 /* PlusToken */; - - case 209 /* SubtractExpression */: - return 90 /* MinusToken */; - - case 202 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - - case 203 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - - case 204 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - - case 196 /* LessThanExpression */: - return 80 /* LessThanToken */; - - case 197 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - - case 198 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - - case 199 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - - case 200 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - - case 201 /* InExpression */: - return 29 /* InKeyword */; - - case 192 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - - case 193 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - - case 194 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - - case 195 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - - case 191 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - - case 190 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - - case 189 /* BitwiseOrExpression */: - return 99 /* BarToken */; - - case 188 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - - case 187 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - - case 182 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - - case 180 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - - case 181 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - - case 183 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - - case 184 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - - case 185 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - - case 175 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - - case 176 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - - case 177 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - - case 178 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - - case 179 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - - case 174 /* AssignmentExpression */: - return 107 /* EqualsToken */; - - case 173 /* CommaExpression */: - return 79 /* CommaToken */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; - - function isAnyDivideToken(kind) { - switch (kind) { - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isAnyDivideToken = isAnyDivideToken; - - function isAnyDivideOrRegularExpressionToken(kind) { - switch (kind) { - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 12 /* RegularExpressionLiteral */: - return true; - default: - return false; - } - } - SyntaxFacts.isAnyDivideOrRegularExpressionToken = isAnyDivideOrRegularExpressionToken; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var isKeywordStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierPartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isNumericLiteralStart = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - - for (var character = 0; character < 127 /* maxAsciiCharacter */; character++) { - if (character >= 97 /* a */ && character <= 122 /* z */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } else if ((character >= 65 /* A */ && character <= 90 /* Z */) || character === 95 /* _ */ || character === 36 /* $ */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } else if (character >= 48 /* _0 */ && character <= 57 /* _9 */) { - isIdentifierPartCharacter[character] = true; - isNumericLiteralStart[character] = true; - } - } - - isNumericLiteralStart[46 /* dot */] = true; - - for (var keywordKind = 15 /* FirstKeyword */; keywordKind <= 69 /* LastKeyword */; keywordKind++) { - var keyword = TypeScript.SyntaxFacts.getText(keywordKind); - isKeywordStartCharacter[keyword.charCodeAt(0)] = true; - } - - var Scanner = (function () { - function Scanner(fileName, text, languageVersion, window) { - if (typeof window === "undefined") { window = TypeScript.ArrayUtilities.createArray(2048, 0); } - this.slidingWindow = new TypeScript.SlidingWindow(this, window, 0, text.length()); - this.fileName = fileName; - this.text = text; - this._languageVersion = languageVersion; - } - Scanner.prototype.languageVersion = function () { - return this._languageVersion; - }; - - Scanner.prototype.fetchMoreItems = function (argument, sourceIndex, window, destinationIndex, spaceAvailable) { - var charactersRemaining = this.text.length() - sourceIndex; - var amountToRead = TypeScript.MathPrototype.min(charactersRemaining, spaceAvailable); - this.text.copyTo(sourceIndex, window, destinationIndex, amountToRead); - return amountToRead; - }; - - Scanner.prototype.currentCharCode = function () { - return this.slidingWindow.currentItem(null); - }; - - Scanner.prototype.absoluteIndex = function () { - return this.slidingWindow.absoluteIndex(); - }; - - Scanner.prototype.setAbsoluteIndex = function (index) { - this.slidingWindow.setAbsoluteIndex(index); - }; - - Scanner.prototype.scan = function (diagnostics, allowRegularExpression) { - var diagnosticsLength = diagnostics.length; - var fullStart = this.slidingWindow.absoluteIndex(); - var leadingTriviaInfo = this.scanTriviaInfo(diagnostics, false); - - var start = this.slidingWindow.absoluteIndex(); - var kindAndFlags = this.scanSyntaxToken(diagnostics, allowRegularExpression); - var end = this.slidingWindow.absoluteIndex(); - - var trailingTriviaInfo = this.scanTriviaInfo(diagnostics, true); - var fullEnd = this.slidingWindow.absoluteIndex(); - - var isVariableWidthKeyword = (kindAndFlags & -2147483648 /* IsVariableWidthKeyword */) !== 0; - var kind = kindAndFlags & ~-2147483648 /* IsVariableWidthKeyword */; - - var token = this.createToken(fullStart, leadingTriviaInfo, start, kind, end, fullEnd, trailingTriviaInfo, isVariableWidthKeyword); - - return diagnosticsLength !== diagnostics.length ? TypeScript.Syntax.realizeToken(token) : token; - }; - - Scanner.prototype.createToken = function (fullStart, leadingTriviaInfo, start, kind, end, fullEnd, trailingTriviaInfo, isVariableWidthKeyword) { - if (!isVariableWidthKeyword && kind >= 15 /* FirstFixedWidth */) { - if (leadingTriviaInfo === 0) { - if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.FixedWidthTokenWithNoTrivia(kind); - } else { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo); - } - } else if (trailingTriviaInfo === 0) { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo); - } else { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo); - } - } else { - var width = end - start; - - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - - if (leadingTriviaInfo === 0) { - if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.VariableWidthTokenWithNoTrivia(fullText, kind); - } else { - return new TypeScript.Syntax.VariableWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo); - } - } else if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.VariableWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo); - } else { - return new TypeScript.Syntax.VariableWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo); - } - } - }; - - Scanner.scanTrivia = function (text, start, length, isTrailing) { - var scanner = new Scanner(null, text.subText(new TypeScript.TextSpan(start, length)), 1 /* EcmaScript5 */, Scanner.triviaWindow); - return scanner.scanTrivia(text, start, isTrailing); - }; - - Scanner.prototype.scanTrivia = function (underlyingText, underlyingTextStart, isTrailing) { - var trivia = new Array(); - - while (true) { - if (!this.slidingWindow.isAtEndOfSource()) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - trivia.push(this.scanWhitespaceTrivia(underlyingText, underlyingTextStart)); - continue; - - case 47 /* slash */: - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 47 /* slash */) { - trivia.push(this.scanSingleLineCommentTrivia(underlyingText, underlyingTextStart)); - continue; - } - - if (ch2 === 42 /* asterisk */) { - trivia.push(this.scanMultiLineCommentTrivia(underlyingText, underlyingTextStart)); - continue; - } - - throw TypeScript.Errors.invalidOperation(); - - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - trivia.push(this.scanLineTerminatorSequenceTrivia(ch)); - - if (!isTrailing) { - continue; - } - - break; - - default: - throw TypeScript.Errors.invalidOperation(); - } - } - - return TypeScript.Syntax.triviaList(trivia); - } - }; - - Scanner.prototype.scanTriviaInfo = function (diagnostics, isTrailing) { - var width = 0; - var hasCommentOrNewLine = 0; - - while (true) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - this.slidingWindow.moveToNextItem(); - width++; - continue; - - case 47 /* slash */: - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 47 /* slash */) { - hasCommentOrNewLine |= 2 /* TriviaCommentMask */; - width += this.scanSingleLineCommentTriviaLength(); - continue; - } - - if (ch2 === 42 /* asterisk */) { - hasCommentOrNewLine |= 2 /* TriviaCommentMask */; - width += this.scanMultiLineCommentTriviaLength(diagnostics); - continue; - } - - break; - - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - hasCommentOrNewLine |= 1 /* TriviaNewLineMask */; - width += this.scanLineTerminatorSequenceLength(ch); - - if (!isTrailing) { - continue; - } - - break; - } - - return (width << 2 /* TriviaFullWidthShift */) | hasCommentOrNewLine; - } - }; - - Scanner.prototype.isNewLineCharacter = function (ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - default: - return false; - } - }; - - Scanner.prototype.scanWhitespaceTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.absoluteIndex(); - - var width = 0; - while (true) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - this.slidingWindow.moveToNextItem(); - width++; - continue; - } - - break; - } - - return TypeScript.Syntax.deferredTrivia(4 /* WhitespaceTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanSingleLineCommentTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.slidingWindow.absoluteIndex(); - var width = this.scanSingleLineCommentTriviaLength(); - - return TypeScript.Syntax.deferredTrivia(7 /* SingleLineCommentTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanSingleLineCommentTriviaLength = function () { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - var width = 2; - while (true) { - if (this.slidingWindow.isAtEndOfSource() || this.isNewLineCharacter(this.currentCharCode())) { - return width; - } - - this.slidingWindow.moveToNextItem(); - width++; - } - }; - - Scanner.prototype.scanMultiLineCommentTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.absoluteIndex(); - var width = this.scanMultiLineCommentTriviaLength(null); - - return TypeScript.Syntax.deferredTrivia(6 /* MultiLineCommentTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanMultiLineCommentTriviaLength = function (diagnostics) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - var width = 2; - while (true) { - if (this.slidingWindow.isAtEndOfSource()) { - if (diagnostics !== null) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), this.slidingWindow.absoluteIndex(), 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null)); - } - - return width; - } - - var ch = this.currentCharCode(); - if (ch === 42 /* asterisk */ && this.slidingWindow.peekItemN(1) === 47 /* slash */) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - width += 2; - return width; - } - - this.slidingWindow.moveToNextItem(); - width++; - } - }; - - Scanner.prototype.scanLineTerminatorSequenceTrivia = function (ch) { - var absoluteStartIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - var width = this.scanLineTerminatorSequenceLength(ch); - - var text = this.substring(absoluteStartIndex, absoluteStartIndex + width, false); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(absoluteStartIndex); - - return TypeScript.Syntax.trivia(5 /* NewLineTrivia */, text); - }; - - Scanner.prototype.scanLineTerminatorSequenceLength = function (ch) { - this.slidingWindow.moveToNextItem(); - - if (ch === 13 /* carriageReturn */ && this.currentCharCode() === 10 /* lineFeed */) { - this.slidingWindow.moveToNextItem(); - return 2; - } else { - return 1; - } - }; - - Scanner.prototype.scanSyntaxToken = function (diagnostics, allowRegularExpression) { - if (this.slidingWindow.isAtEndOfSource()) { - return 10 /* EndOfFileToken */; - } - - var character = this.currentCharCode(); - - switch (character) { - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - return this.scanStringLiteral(diagnostics); - - case 47 /* slash */: - return this.scanSlashToken(allowRegularExpression); - - case 46 /* dot */: - return this.scanDotToken(diagnostics); - - case 45 /* minus */: - return this.scanMinusToken(); - - case 33 /* exclamation */: - return this.scanExclamationToken(); - - case 61 /* equals */: - return this.scanEqualsToken(); - - case 124 /* bar */: - return this.scanBarToken(); - - case 42 /* asterisk */: - return this.scanAsteriskToken(); - - case 43 /* plus */: - return this.scanPlusToken(); - - case 37 /* percent */: - return this.scanPercentToken(); - - case 38 /* ampersand */: - return this.scanAmpersandToken(); - - case 94 /* caret */: - return this.scanCaretToken(); - - case 60 /* lessThan */: - return this.scanLessThanToken(); - - case 62 /* greaterThan */: - return this.advanceAndSetTokenKind(81 /* GreaterThanToken */); - - case 44 /* comma */: - return this.advanceAndSetTokenKind(79 /* CommaToken */); - - case 58 /* colon */: - return this.advanceAndSetTokenKind(106 /* ColonToken */); - - case 59 /* semicolon */: - return this.advanceAndSetTokenKind(78 /* SemicolonToken */); - - case 126 /* tilde */: - return this.advanceAndSetTokenKind(102 /* TildeToken */); - - case 40 /* openParen */: - return this.advanceAndSetTokenKind(72 /* OpenParenToken */); - - case 41 /* closeParen */: - return this.advanceAndSetTokenKind(73 /* CloseParenToken */); - - case 123 /* openBrace */: - return this.advanceAndSetTokenKind(70 /* OpenBraceToken */); - - case 125 /* closeBrace */: - return this.advanceAndSetTokenKind(71 /* CloseBraceToken */); - - case 91 /* openBracket */: - return this.advanceAndSetTokenKind(74 /* OpenBracketToken */); - - case 93 /* closeBracket */: - return this.advanceAndSetTokenKind(75 /* CloseBracketToken */); - - case 63 /* question */: - return this.advanceAndSetTokenKind(105 /* QuestionToken */); - } - - if (isNumericLiteralStart[character]) { - return this.scanNumericLiteral(diagnostics); - } - - if (isIdentifierStartCharacter[character]) { - var result = this.tryFastScanIdentifierOrKeyword(character); - if (result !== 0 /* None */) { - return result; - } - } - - if (this.isIdentifierStart(this.peekCharOrUnicodeEscape())) { - return this.slowScanIdentifierOrKeyword(diagnostics); - } - - return this.scanDefaultCharacter(character, diagnostics); - }; - - Scanner.prototype.isIdentifierStart = function (interpretedChar) { - if (isIdentifierStartCharacter[interpretedChar]) { - return true; - } - - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierStart(interpretedChar, this._languageVersion); - }; - - Scanner.prototype.isIdentifierPart = function (interpretedChar) { - if (isIdentifierPartCharacter[interpretedChar]) { - return true; - } - - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierPart(interpretedChar, this._languageVersion); - }; - - Scanner.prototype.tryFastScanIdentifierOrKeyword = function (firstCharacter) { - var slidingWindow = this.slidingWindow; - var window = slidingWindow.window; - - var startIndex = slidingWindow.currentRelativeItemIndex; - var endIndex = slidingWindow.windowCount; - var currentIndex = startIndex; - var character = 0; - - while (currentIndex < endIndex) { - character = window[currentIndex]; - if (!isIdentifierPartCharacter[character]) { - break; - } - - currentIndex++; - } - - if (currentIndex === endIndex) { - return 0 /* None */; - } else if (character === 92 /* backslash */ || character > 127 /* maxAsciiCharacter */) { - return 0 /* None */; - } else { - var kind; - var identifierLength = currentIndex - startIndex; - if (isKeywordStartCharacter[firstCharacter]) { - kind = TypeScript.ScannerUtilities.identifierKind(window, startIndex, identifierLength); - } else { - kind = 11 /* IdentifierName */; - } - - slidingWindow.setAbsoluteIndex(slidingWindow.absoluteIndex() + identifierLength); - - return kind; - } - }; - - Scanner.prototype.slowScanIdentifierOrKeyword = function (diagnostics) { - var startIndex = this.slidingWindow.absoluteIndex(); - var sawUnicodeEscape = false; - - do { - var unicodeEscape = this.scanCharOrUnicodeEscape(diagnostics); - sawUnicodeEscape = sawUnicodeEscape || unicodeEscape; - } while(this.isIdentifierPart(this.peekCharOrUnicodeEscape())); - - var length = this.slidingWindow.absoluteIndex() - startIndex; - var text = this.text.substr(startIndex, length, false); - var valueText = TypeScript.Syntax.massageEscapes(text); - - var keywordKind = TypeScript.SyntaxFacts.getTokenKind(valueText); - if (keywordKind >= 15 /* FirstKeyword */ && keywordKind <= 69 /* LastKeyword */) { - if (sawUnicodeEscape) { - return keywordKind | -2147483648 /* IsVariableWidthKeyword */; - } else { - return keywordKind; - } - } - - return 11 /* IdentifierName */; - }; - - Scanner.prototype.scanNumericLiteral = function (diagnostics) { - if (this.isHexNumericLiteral()) { - this.scanHexNumericLiteral(); - } else if (this.isOctalNumericLiteral()) { - this.scanOctalNumericLiteral(diagnostics); - } else { - this.scanDecimalNumericLiteral(); - } - - return 13 /* NumericLiteral */; - }; - - Scanner.prototype.isOctalNumericLiteral = function () { - return this.currentCharCode() === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(this.slidingWindow.peekItemN(1)); - }; - - Scanner.prototype.scanOctalNumericLiteral = function (diagnostics) { - var position = this.absoluteIndex(); - - while (TypeScript.CharacterInfo.isOctalDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - - if (this.languageVersion() >= 1 /* EcmaScript5 */) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), position, this.absoluteIndex() - position, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null)); - } - }; - - Scanner.prototype.scanDecimalDigits = function () { - while (TypeScript.CharacterInfo.isDecimalDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - }; - - Scanner.prototype.scanDecimalNumericLiteral = function () { - this.scanDecimalDigits(); - - if (this.currentCharCode() === 46 /* dot */) { - this.slidingWindow.moveToNextItem(); - } - - this.scanDecimalDigits(); - - var ch = this.currentCharCode(); - if (ch === 101 /* e */ || ch === 69 /* E */) { - var nextChar1 = this.slidingWindow.peekItemN(1); - - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar1)) { - this.slidingWindow.moveToNextItem(); - this.scanDecimalDigits(); - } else if (nextChar1 === 45 /* minus */ || nextChar1 === 43 /* plus */) { - var nextChar2 = this.slidingWindow.peekItemN(2); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar2)) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - this.scanDecimalDigits(); - } - } - } - }; - - Scanner.prototype.scanHexNumericLiteral = function () { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - while (TypeScript.CharacterInfo.isHexDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - }; - - Scanner.prototype.isHexNumericLiteral = function () { - if (this.currentCharCode() === 48 /* _0 */) { - var ch = this.slidingWindow.peekItemN(1); - - if (ch === 120 /* x */ || ch === 88 /* X */) { - ch = this.slidingWindow.peekItemN(2); - - return TypeScript.CharacterInfo.isHexDigit(ch); - } - } - - return false; - }; - - Scanner.prototype.advanceAndSetTokenKind = function (kind) { - this.slidingWindow.moveToNextItem(); - return kind; - }; - - Scanner.prototype.scanLessThanToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 82 /* LessThanEqualsToken */; - } else if (this.currentCharCode() === 60 /* lessThan */) { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 112 /* LessThanLessThanEqualsToken */; - } else { - return 95 /* LessThanLessThanToken */; - } - } else { - return 80 /* LessThanToken */; - } - }; - - Scanner.prototype.scanBarToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 116 /* BarEqualsToken */; - } else if (this.currentCharCode() === 124 /* bar */) { - this.slidingWindow.moveToNextItem(); - return 104 /* BarBarToken */; - } else { - return 99 /* BarToken */; - } - }; - - Scanner.prototype.scanCaretToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 117 /* CaretEqualsToken */; - } else { - return 100 /* CaretToken */; - } - }; - - Scanner.prototype.scanAmpersandToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 115 /* AmpersandEqualsToken */; - } else if (this.currentCharCode() === 38 /* ampersand */) { - this.slidingWindow.moveToNextItem(); - return 103 /* AmpersandAmpersandToken */; - } else { - return 98 /* AmpersandToken */; - } - }; - - Scanner.prototype.scanPercentToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 111 /* PercentEqualsToken */; - } else { - return 92 /* PercentToken */; - } - }; - - Scanner.prototype.scanMinusToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 109 /* MinusEqualsToken */; - } else if (character === 45 /* minus */) { - this.slidingWindow.moveToNextItem(); - return 94 /* MinusMinusToken */; - } else { - return 90 /* MinusToken */; - } - }; - - Scanner.prototype.scanPlusToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 108 /* PlusEqualsToken */; - } else if (character === 43 /* plus */) { - this.slidingWindow.moveToNextItem(); - return 93 /* PlusPlusToken */; - } else { - return 89 /* PlusToken */; - } - }; - - Scanner.prototype.scanAsteriskToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 110 /* AsteriskEqualsToken */; - } else { - return 91 /* AsteriskToken */; - } - }; - - Scanner.prototype.scanEqualsToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - return 87 /* EqualsEqualsEqualsToken */; - } else { - return 84 /* EqualsEqualsToken */; - } - } else if (character === 62 /* greaterThan */) { - this.slidingWindow.moveToNextItem(); - return 85 /* EqualsGreaterThanToken */; - } else { - return 107 /* EqualsToken */; - } - }; - - Scanner.prototype.isDotPrefixedNumericLiteral = function () { - if (this.currentCharCode() === 46 /* dot */) { - var ch = this.slidingWindow.peekItemN(1); - return TypeScript.CharacterInfo.isDecimalDigit(ch); - } - - return false; - }; - - Scanner.prototype.scanDotToken = function (diagnostics) { - if (this.isDotPrefixedNumericLiteral()) { - return this.scanNumericLiteral(diagnostics); - } - - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 46 /* dot */ && this.slidingWindow.peekItemN(1) === 46 /* dot */) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - return 77 /* DotDotDotToken */; - } else { - return 76 /* DotToken */; - } - }; - - Scanner.prototype.scanSlashToken = function (allowRegularExpression) { - if (allowRegularExpression) { - var result = this.tryScanRegularExpressionToken(); - if (result !== 0 /* None */) { - return result; - } - } - - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 119 /* SlashEqualsToken */; - } else { - return 118 /* SlashToken */; - } - }; - - Scanner.prototype.tryScanRegularExpressionToken = function () { - var startIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - this.slidingWindow.moveToNextItem(); - - var inEscape = false; - var inCharacterClass = false; - while (true) { - var ch = this.currentCharCode(); - - if (this.isNewLineCharacter(ch) || this.slidingWindow.isAtEndOfSource()) { - this.slidingWindow.rewindToPinnedIndex(startIndex); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - return 0 /* None */; - } - - this.slidingWindow.moveToNextItem(); - if (inEscape) { - inEscape = false; - continue; - } - - switch (ch) { - case 92 /* backslash */: - inEscape = true; - continue; - - case 91 /* openBracket */: - inCharacterClass = true; - continue; - - case 93 /* closeBracket */: - inCharacterClass = false; - continue; - - case 47 /* slash */: - if (inCharacterClass) { - continue; - } - - break; - - default: - continue; - } - - break; - } - - while (isIdentifierPartCharacter[this.currentCharCode()]) { - this.slidingWindow.moveToNextItem(); - } - - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - return 12 /* RegularExpressionLiteral */; - }; - - Scanner.prototype.scanExclamationToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - return 88 /* ExclamationEqualsEqualsToken */; - } else { - return 86 /* ExclamationEqualsToken */; - } - } else { - return 101 /* ExclamationToken */; - } - }; - - Scanner.prototype.scanDefaultCharacter = function (character, diagnostics) { - var position = this.slidingWindow.absoluteIndex(); - this.slidingWindow.moveToNextItem(); - - var text = String.fromCharCode(character); - var messageText = this.getErrorMessageText(text); - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), position, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText])); - - return 9 /* ErrorToken */; - }; - - Scanner.prototype.getErrorMessageText = function (text) { - if (text === "\\") { - return '"\\"'; - } - - return JSON.stringify(text); - }; - - Scanner.prototype.skipEscapeSequence = function (diagnostics) { - var rewindPoint = this.slidingWindow.getAndPinAbsoluteIndex(); - - this.slidingWindow.moveToNextItem(); - - var ch = this.currentCharCode(); - this.slidingWindow.moveToNextItem(); - switch (ch) { - case 120 /* x */: - case 117 /* u */: - this.slidingWindow.rewindToPinnedIndex(rewindPoint); - var value = this.scanUnicodeOrHexEscape(diagnostics); - break; - - case 13 /* carriageReturn */: - if (this.currentCharCode() === 10 /* lineFeed */) { - this.slidingWindow.moveToNextItem(); - } - break; - - default: - break; - } - - this.slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint); - }; - - Scanner.prototype.scanStringLiteral = function (diagnostics) { - var quoteCharacter = this.currentCharCode(); - - this.slidingWindow.moveToNextItem(); - - while (true) { - var ch = this.currentCharCode(); - if (ch === 92 /* backslash */) { - this.skipEscapeSequence(diagnostics); - } else if (ch === quoteCharacter) { - this.slidingWindow.moveToNextItem(); - break; - } else if (this.isNewLineCharacter(ch) || this.slidingWindow.isAtEndOfSource()) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), TypeScript.MathPrototype.min(this.slidingWindow.absoluteIndex(), this.text.length()), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null)); - break; - } else { - this.slidingWindow.moveToNextItem(); - } - } - - return 14 /* StringLiteral */; - }; - - Scanner.prototype.isUnicodeEscape = function (character) { - if (character === 92 /* backslash */) { - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 117 /* u */) { - return true; - } - } - - return false; - }; - - Scanner.prototype.peekCharOrUnicodeEscape = function () { - var character = this.currentCharCode(); - if (this.isUnicodeEscape(character)) { - return this.peekUnicodeOrHexEscape(); - } else { - return character; - } - }; - - Scanner.prototype.peekUnicodeOrHexEscape = function () { - var startIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - var ch = this.scanUnicodeOrHexEscape(null); - - this.slidingWindow.rewindToPinnedIndex(startIndex); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - - return ch; - }; - - Scanner.prototype.scanCharOrUnicodeEscape = function (errors) { - var ch = this.currentCharCode(); - if (ch === 92 /* backslash */) { - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 117 /* u */) { - this.scanUnicodeOrHexEscape(errors); - return true; - } - } - - this.slidingWindow.moveToNextItem(); - return false; - }; - - Scanner.prototype.scanUnicodeOrHexEscape = function (errors) { - var start = this.slidingWindow.absoluteIndex(); - var character = this.currentCharCode(); - - this.slidingWindow.moveToNextItem(); - - character = this.currentCharCode(); - - var intChar = 0; - this.slidingWindow.moveToNextItem(); - - var count = character === 117 /* u */ ? 4 : 2; - - for (var i = 0; i < count; i++) { - var ch2 = this.currentCharCode(); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - if (errors !== null) { - var end = this.slidingWindow.absoluteIndex(); - var info = this.createIllegalEscapeDiagnostic(start, end); - errors.push(info); - } - - break; - } - - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - this.slidingWindow.moveToNextItem(); - } - - return intChar; - }; - - Scanner.prototype.substring = function (start, end, intern) { - var length = end - start; - var offset = start - this.slidingWindow.windowAbsoluteStartIndex; - - if (intern) { - return TypeScript.Collections.DefaultStringTable.addCharArray(this.slidingWindow.window, offset, length); - } else { - return TypeScript.StringUtilities.fromCharCodeArray(this.slidingWindow.window.slice(offset, offset + length)); - } - }; - - Scanner.prototype.createIllegalEscapeDiagnostic = function (start, end) { - return new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), start, end - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); - }; - - Scanner.isValidIdentifier = function (text, languageVersion) { - var scanner = new Scanner(null, text, languageVersion, Scanner.triviaWindow); - var errors = new Array(); - var token = scanner.scan(errors, false); - - return errors.length === 0 && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && token.width() === text.length(); - }; - Scanner.triviaWindow = TypeScript.ArrayUtilities.createArray(2048, 0); - return Scanner; - })(); - TypeScript.Scanner = Scanner; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScannerUtilities = (function () { - function ScannerUtilities() { - } - ScannerUtilities.identifierKind = function (array, startIndex, length) { - switch (length) { - case 2: - switch (array[startIndex]) { - case 100 /* d */: - return (array[startIndex + 1] === 111 /* o */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - switch (array[startIndex + 1]) { - case 102 /* f */: - return 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 3: - switch (array[startIndex]) { - case 102 /* f */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 97 /* a */: - return (array[startIndex + 1] === 110 /* n */ && array[startIndex + 2] === 121 /* y */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 4: - switch (array[startIndex]) { - case 99 /* c */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 101 /* e */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - switch (array[startIndex + 1]) { - case 108 /* l */: - return (array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 101 /* e */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 2] === 117 /* u */ && array[startIndex + 3] === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 110 /* n */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 108 /* l */) ? 32 /* NullKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (array[startIndex + 1]) { - case 104 /* h */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 115 /* s */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 2] === 117 /* u */ && array[startIndex + 3] === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 118 /* v */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 100 /* d */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 5: - switch (array[startIndex]) { - case 98 /* b */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 101 /* e */ && array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 107 /* k */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - switch (array[startIndex + 1]) { - case 97 /* a */: - return (array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 99 /* c */ && array[startIndex + 4] === 104 /* h */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (array[startIndex + 2] === 97 /* a */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 102 /* f */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 101 /* e */) ? 24 /* FalseKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (array[startIndex + 1] === 104 /* h */ && array[startIndex + 2] === 114 /* r */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 119 /* w */) ? 36 /* ThrowKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (array[startIndex + 1] === 104 /* h */ && array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */) ? 42 /* WhileKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 114 /* r */) ? 50 /* SuperKeyword */ : 11 /* IdentifierName */; - case 121 /* y */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 101 /* e */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 100 /* d */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 6: - switch (array[startIndex]) { - case 100 /* d */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 101 /* e */) ? 21 /* DeleteKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 110 /* n */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - switch (array[startIndex + 1]) { - case 119 /* w */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 99 /* c */ && array[startIndex + 5] === 104 /* h */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (array[startIndex + 2]) { - case 97 /* a */: - return (array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 99 /* c */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 3] === 105 /* i */ && array[startIndex + 4] === 110 /* n */ && array[startIndex + 5] === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 116 /* t */: - return (array[startIndex + 1] === 121 /* y */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 111 /* o */ && array[startIndex + 5] === 102 /* f */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (array[startIndex + 1] === 120 /* x */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 116 /* t */) ? 47 /* ExportKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - return (array[startIndex + 1] === 109 /* m */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 116 /* t */) ? 49 /* ImportKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 98 /* b */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 99 /* c */) ? 57 /* PublicKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 100 /* d */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 108 /* l */ && array[startIndex + 5] === 101 /* e */) ? 65 /* ModuleKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 109 /* m */ && array[startIndex + 3] === 98 /* b */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 114 /* r */) ? 67 /* NumberKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 7: - switch (array[startIndex]) { - case 100 /* d */: - switch (array[startIndex + 1]) { - case 101 /* e */: - switch (array[startIndex + 2]) { - case 102 /* f */: - return (array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 117 /* u */ && array[startIndex + 5] === 108 /* l */ && array[startIndex + 6] === 116 /* t */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - return (array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 101 /* e */) ? 63 /* DeclareKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 102 /* f */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 108 /* l */ && array[startIndex + 5] === 108 /* l */ && array[startIndex + 6] === 121 /* y */) ? 25 /* FinallyKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (array[startIndex + 1] === 120 /* x */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 110 /* n */ && array[startIndex + 5] === 100 /* d */ && array[startIndex + 6] === 115 /* s */) ? 48 /* ExtendsKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - switch (array[startIndex + 1]) { - case 97 /* a */: - return (array[startIndex + 2] === 99 /* c */ && array[startIndex + 3] === 107 /* k */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 103 /* g */ && array[startIndex + 6] === 101 /* e */) ? 54 /* PackageKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 118 /* v */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 116 /* t */ && array[startIndex + 6] === 101 /* e */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 98 /* b */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 111 /* o */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 97 /* a */ && array[startIndex + 6] === 110 /* n */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 113 /* q */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 101 /* e */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 8: - switch (array[startIndex]) { - case 99 /* c */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 110 /* n */ && array[startIndex + 6] === 117 /* u */ && array[startIndex + 7] === 101 /* e */) ? 18 /* ContinueKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 98 /* b */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 103 /* g */ && array[startIndex + 5] === 103 /* g */ && array[startIndex + 6] === 101 /* e */ && array[startIndex + 7] === 114 /* r */) ? 19 /* DebuggerKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 99 /* c */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 105 /* i */ && array[startIndex + 6] === 111 /* o */ && array[startIndex + 7] === 110 /* n */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 9: - switch (array[startIndex]) { - case 105 /* i */: - return (array[startIndex + 1] === 110 /* n */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 102 /* f */ && array[startIndex + 6] === 97 /* a */ && array[startIndex + 7] === 99 /* c */ && array[startIndex + 8] === 101 /* e */) ? 52 /* InterfaceKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 111 /* o */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 99 /* c */ && array[startIndex + 6] === 116 /* t */ && array[startIndex + 7] === 101 /* e */ && array[startIndex + 8] === 100 /* d */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 10: - switch (array[startIndex]) { - case 105 /* i */: - switch (array[startIndex + 1]) { - case 110 /* n */: - return (array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 110 /* n */ && array[startIndex + 6] === 99 /* c */ && array[startIndex + 7] === 101 /* e */ && array[startIndex + 8] === 111 /* o */ && array[startIndex + 9] === 102 /* f */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 109 /* m */ && array[startIndex + 6] === 101 /* e */ && array[startIndex + 7] === 110 /* n */ && array[startIndex + 8] === 116 /* t */ && array[startIndex + 9] === 115 /* s */) ? 51 /* ImplementsKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 11: - return (array[startIndex] === 99 /* c */ && array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 117 /* u */ && array[startIndex + 7] === 99 /* c */ && array[startIndex + 8] === 116 /* t */ && array[startIndex + 9] === 111 /* o */ && array[startIndex + 10] === 114 /* r */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var EmptySeparatedSyntaxList = (function () { - function EmptySeparatedSyntaxList() { - } - EmptySeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - EmptySeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isList = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - - EmptySeparatedSyntaxList.prototype.toJSON = function (key) { - return []; - }; - - EmptySeparatedSyntaxList.prototype.childCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.separatorCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.toArray = function () { - return []; - }; - - EmptySeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - return []; - }; - - EmptySeparatedSyntaxList.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.separatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.collectTextElements = function (elements) { - }; - - EmptySeparatedSyntaxList.prototype.firstToken = function () { - return null; - }; - - EmptySeparatedSyntaxList.prototype.lastToken = function () { - return null; - }; - - EmptySeparatedSyntaxList.prototype.fullWidth = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.fullText = function () { - return ""; - }; - - EmptySeparatedSyntaxList.prototype.width = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - throw TypeScript.Errors.invalidOperation(); - }; - - EmptySeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - }; - - EmptySeparatedSyntaxList.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySeparatedSyntaxList.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return 0; - }; - return EmptySeparatedSyntaxList; - })(); - - Syntax.emptySeparatedList = new EmptySeparatedSyntaxList(); - - var SingletonSeparatedSyntaxList = (function () { - function SingletonSeparatedSyntaxList(item) { - this.item = item; - } - SingletonSeparatedSyntaxList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - SingletonSeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isList = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - - SingletonSeparatedSyntaxList.prototype.childCount = function () { - return 1; - }; - SingletonSeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return 1; - }; - SingletonSeparatedSyntaxList.prototype.separatorCount = function () { - return 0; - }; - - SingletonSeparatedSyntaxList.prototype.toArray = function () { - return [this.item]; - }; - SingletonSeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - return [this.item]; - }; - - SingletonSeparatedSyntaxList.prototype.childAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSeparatedSyntaxList.prototype.separatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - SingletonSeparatedSyntaxList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSeparatedSyntaxList.prototype.firstToken = function () { - return this.item.firstToken(); - }; - - SingletonSeparatedSyntaxList.prototype.lastToken = function () { - return this.item.lastToken(); - }; - - SingletonSeparatedSyntaxList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.width = function () { - return this.item.width(); - }; - - SingletonSeparatedSyntaxList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSeparatedSyntaxList.prototype.leadingTrivia = function () { - return this.item.leadingTrivia(); - }; - - SingletonSeparatedSyntaxList.prototype.trailingTrivia = function () { - return this.item.trailingTrivia(); - }; - - SingletonSeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return this.item.leadingTriviaWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return this.item.trailingTriviaWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - return this.item.isTypeScriptSpecific(); - }; - - SingletonSeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return this.item.isIncrementallyUnusable(); - }; - - SingletonSeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - return this.item.findTokenInternal(new TypeScript.PositionedSeparatedList(parent, this, fullStart), position, fullStart); - }; - - SingletonSeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - array.splice(index, 0, this.item); - }; - return SingletonSeparatedSyntaxList; - })(); - - var NormalSeparatedSyntaxList = (function () { - function NormalSeparatedSyntaxList(elements) { - this._data = 0; - this.elements = elements; - } - NormalSeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - NormalSeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isList = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - NormalSeparatedSyntaxList.prototype.toJSON = function (key) { - return this.elements; - }; - - NormalSeparatedSyntaxList.prototype.childCount = function () { - return this.elements.length; - }; - NormalSeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return TypeScript.IntegerUtilities.integerDivide(this.elements.length + 1, 2); - }; - NormalSeparatedSyntaxList.prototype.separatorCount = function () { - return TypeScript.IntegerUtilities.integerDivide(this.elements.length, 2); - }; - - NormalSeparatedSyntaxList.prototype.toArray = function () { - return this.elements.slice(0); - }; - - NormalSeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - var result = []; - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - result.push(this.nonSeparatorAt(i)); - } - - return result; - }; - - NormalSeparatedSyntaxList.prototype.childAt = function (index) { - if (index < 0 || index >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[index]; - }; - - NormalSeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - var value = index * 2; - if (value < 0 || value >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[value]; - }; - - NormalSeparatedSyntaxList.prototype.separatorAt = function (index) { - var value = index * 2 + 1; - if (value < 0 || value >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[value]; - }; - - NormalSeparatedSyntaxList.prototype.firstToken = function () { - var token; - for (var i = 0, n = this.elements.length; i < n; i++) { - if (i % 2 === 0) { - var nodeOrToken = this.elements[i]; - token = nodeOrToken.firstToken(); - if (token !== null) { - return token; - } - } else { - token = this.elements[i]; - if (token.width() > 0) { - return token; - } - } - } - - return null; - }; - - NormalSeparatedSyntaxList.prototype.lastToken = function () { - var token; - for (var i = this.elements.length - 1; i >= 0; i--) { - if (i % 2 === 0) { - var nodeOrToken = this.elements[i]; - token = nodeOrToken.lastToken(); - if (token !== null) { - return token; - } - } else { - token = this.elements[i]; - if (token.width() > 0) { - return token; - } - } - } - - return null; - }; - - NormalSeparatedSyntaxList.prototype.fullText = function () { - var elements = []; - this.collectTextElements(elements); - return elements.join(""); - }; - - NormalSeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - if (this.nonSeparatorAt(i).isTypeScriptSpecific()) { - return true; - } - } - - return false; - }; - - NormalSeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - NormalSeparatedSyntaxList.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - NormalSeparatedSyntaxList.prototype.width = function () { - var fullWidth = this.fullWidth(); - return fullWidth - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.leadingTrivia = function () { - return this.firstToken().leadingTrivia(); - }; - - NormalSeparatedSyntaxList.prototype.trailingTrivia = function () { - return this.lastToken().trailingTrivia(); - }; - - NormalSeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return this.firstToken().leadingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return this.lastToken().trailingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.computeData = function () { - var fullWidth = 0; - var isIncrementallyUnusable = false; - - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - - var childWidth = element.fullWidth(); - fullWidth += childWidth; - - isIncrementallyUnusable = isIncrementallyUnusable || element.isIncrementallyUnusable(); - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - NormalSeparatedSyntaxList.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data = this.computeData(); - } - - return this._data; - }; - - NormalSeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedSeparatedList(parent, this, fullStart); - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - - var childWidth = element.fullWidth(); - if (position < childWidth) { - return element.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - NormalSeparatedSyntaxList.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - element.collectTextElements(elements); - } - }; - - NormalSeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - if (index === 0) { - array.unshift.apply(array, this.elements); - } else { - array.splice.apply(array, [index, 0].concat(this.elements)); - } - }; - return NormalSeparatedSyntaxList; - })(); - - function separatedList(nodes) { - return separatedListAndValidate(nodes, false); - } - Syntax.separatedList = separatedList; - - function separatedListAndValidate(nodes, validate) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return Syntax.emptySeparatedList; - } - - if (validate) { - for (var i = 0; i < nodes.length; i++) { - var item = nodes[i]; - - if (i % 2 === 1) { - } - } - } - - if (nodes.length === 1) { - return new SingletonSeparatedSyntaxList(nodes[0]); - } - - return new NormalSeparatedSyntaxList(nodes); - } - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SlidingWindow = (function () { - function SlidingWindow(source, window, defaultValue, sourceLength) { - if (typeof sourceLength === "undefined") { sourceLength = -1; } - this.source = source; - this.window = window; - this.defaultValue = defaultValue; - this.sourceLength = sourceLength; - this.windowCount = 0; - this.windowAbsoluteStartIndex = 0; - this.currentRelativeItemIndex = 0; - this._pinCount = 0; - this.firstPinnedAbsoluteIndex = -1; - } - SlidingWindow.prototype.windowAbsoluteEndIndex = function () { - return this.windowAbsoluteStartIndex + this.windowCount; - }; - - SlidingWindow.prototype.addMoreItemsToWindow = function (argument) { - if (this.sourceLength >= 0 && this.absoluteIndex() >= this.sourceLength) { - return false; - } - - if (this.windowCount >= this.window.length) { - this.tryShiftOrGrowWindow(); - } - - var spaceAvailable = this.window.length - this.windowCount; - var amountFetched = this.source.fetchMoreItems(argument, this.windowAbsoluteEndIndex(), this.window, this.windowCount, spaceAvailable); - - this.windowCount += amountFetched; - return amountFetched > 0; - }; - - SlidingWindow.prototype.tryShiftOrGrowWindow = function () { - var currentIndexIsPastWindowHalfwayPoint = this.currentRelativeItemIndex > (this.window.length >>> 1); - - var isAllowedToShift = this.firstPinnedAbsoluteIndex === -1 || this.firstPinnedAbsoluteIndex > this.windowAbsoluteStartIndex; - - if (currentIndexIsPastWindowHalfwayPoint && isAllowedToShift) { - var shiftStartIndex = this.firstPinnedAbsoluteIndex === -1 ? this.currentRelativeItemIndex : this.firstPinnedAbsoluteIndex - this.windowAbsoluteStartIndex; - - var shiftCount = this.windowCount - shiftStartIndex; - - if (shiftCount > 0) { - TypeScript.ArrayUtilities.copy(this.window, shiftStartIndex, this.window, 0, shiftCount); - } - - this.windowAbsoluteStartIndex += shiftStartIndex; - - this.windowCount -= shiftStartIndex; - - this.currentRelativeItemIndex -= shiftStartIndex; - } else { - TypeScript.ArrayUtilities.grow(this.window, this.window.length * 2, this.defaultValue); - } - }; - - SlidingWindow.prototype.absoluteIndex = function () { - return this.windowAbsoluteStartIndex + this.currentRelativeItemIndex; - }; - - SlidingWindow.prototype.isAtEndOfSource = function () { - return this.absoluteIndex() >= this.sourceLength; - }; - - SlidingWindow.prototype.getAndPinAbsoluteIndex = function () { - var absoluteIndex = this.absoluteIndex(); - var pinCount = this._pinCount++; - if (pinCount === 0) { - this.firstPinnedAbsoluteIndex = absoluteIndex; - } - - return absoluteIndex; - }; - - SlidingWindow.prototype.releaseAndUnpinAbsoluteIndex = function (absoluteIndex) { - this._pinCount--; - if (this._pinCount === 0) { - this.firstPinnedAbsoluteIndex = -1; - } - }; - - SlidingWindow.prototype.rewindToPinnedIndex = function (absoluteIndex) { - var relativeIndex = absoluteIndex - this.windowAbsoluteStartIndex; - - this.currentRelativeItemIndex = relativeIndex; - }; - - SlidingWindow.prototype.currentItem = function (argument) { - if (this.currentRelativeItemIndex >= this.windowCount) { - if (!this.addMoreItemsToWindow(argument)) { - return this.defaultValue; - } - } - - return this.window[this.currentRelativeItemIndex]; - }; - - SlidingWindow.prototype.peekItemN = function (n) { - while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { - return this.defaultValue; - } - } - - return this.window[this.currentRelativeItemIndex + n]; - }; - - SlidingWindow.prototype.moveToNextItem = function () { - this.currentRelativeItemIndex++; - }; - - SlidingWindow.prototype.disgardAllItemsFromCurrentIndexOnwards = function () { - this.windowCount = this.currentRelativeItemIndex; - }; - - SlidingWindow.prototype.setAbsoluteIndex = function (absoluteIndex) { - if (this.absoluteIndex() === absoluteIndex) { - return; - } - - if (this._pinCount > 0) { - } - - if (absoluteIndex >= this.windowAbsoluteStartIndex && absoluteIndex < this.windowAbsoluteEndIndex()) { - this.currentRelativeItemIndex = (absoluteIndex - this.windowAbsoluteStartIndex); - } else { - this.windowAbsoluteStartIndex = absoluteIndex; - - this.windowCount = 0; - - this.currentRelativeItemIndex = 0; - } - }; - - SlidingWindow.prototype.pinCount = function () { - return this._pinCount; - }; - return SlidingWindow; - })(); - TypeScript.SlidingWindow = SlidingWindow; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - function emptySourceUnit() { - return TypeScript.Syntax.normalModeFactory.sourceUnit(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(10 /* EndOfFileToken */, { text: "" })); - } - Syntax.emptySourceUnit = emptySourceUnit; - - function getStandaloneExpression(positionedToken) { - var token = positionedToken.token(); - if (positionedToken !== null && positionedToken.kind() === 11 /* IdentifierName */) { - var parentPositionedNode = positionedToken.containingNode(); - var parentNode = parentPositionedNode.node(); - - if (parentNode.kind() === 121 /* QualifiedName */ && parentNode.right === token) { - return parentPositionedNode; - } else if (parentNode.kind() === 212 /* MemberAccessExpression */ && parentNode.name === token) { - return parentPositionedNode; - } - } - - return positionedToken; - } - Syntax.getStandaloneExpression = getStandaloneExpression; - - function isInModuleOrTypeContext(positionedToken) { - if (positionedToken !== null) { - var positionedNodeOrToken = TypeScript.Syntax.getStandaloneExpression(positionedToken); - var parent = positionedNodeOrToken.containingNode(); - - if (parent !== null) { - switch (parent.kind()) { - case 246 /* ModuleNameModuleReference */: - return true; - case 121 /* QualifiedName */: - return true; - default: - return isInTypeOnlyContext(positionedToken); - } - } - } - - return false; - } - Syntax.isInModuleOrTypeContext = isInModuleOrTypeContext; - - function isInTypeOnlyContext(positionedToken) { - var positionedNodeOrToken = TypeScript.Syntax.getStandaloneExpression(positionedToken); - var positionedParent = positionedNodeOrToken.containingNode(); - - var parent = positionedParent.node(); - var nodeOrToken = positionedNodeOrToken.nodeOrToken(); - - if (parent !== null) { - switch (parent.kind()) { - case 124 /* ArrayType */: - return parent.type === nodeOrToken; - case 220 /* CastExpression */: - return parent.type === nodeOrToken; - case 244 /* TypeAnnotation */: - case 230 /* ExtendsHeritageClause */: - case 231 /* ImplementsHeritageClause */: - case 228 /* TypeArgumentList */: - return true; - } - } - - return false; - } - Syntax.isInTypeOnlyContext = isInTypeOnlyContext; - - function childOffset(parent, child) { - var offset = 0; - for (var i = 0, n = parent.childCount(); i < n; i++) { - var current = parent.childAt(i); - if (current === child) { - return offset; - } - - if (current !== null) { - offset += current.fullWidth(); - } - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childOffset = childOffset; - - function childOffsetAt(parent, index) { - var offset = 0; - for (var i = 0; i < index; i++) { - var current = parent.childAt(i); - if (current !== null) { - offset += current.fullWidth(); - } - } - - return offset; - } - Syntax.childOffsetAt = childOffsetAt; - - function childIndex(parent, child) { - for (var i = 0, n = parent.childCount(); i < n; i++) { - var current = parent.childAt(i); - if (current === child) { - return i; - } - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; - - function nodeStructuralEquals(node1, node2) { - if (node1 === null) { - return node2 === null; - } - - return node1.structuralEquals(node2); - } - Syntax.nodeStructuralEquals = nodeStructuralEquals; - - function nodeOrTokenStructuralEquals(node1, node2) { - if (node1 === node2) { - return true; - } - - if (node1 === null || node2 === null) { - return false; - } - - if (node1.isToken()) { - return node2.isToken() ? tokenStructuralEquals(node1, node2) : false; - } - - return node2.isNode() ? nodeStructuralEquals(node1, node2) : false; - } - Syntax.nodeOrTokenStructuralEquals = nodeOrTokenStructuralEquals; - - function tokenStructuralEquals(token1, token2) { - if (token1 === token2) { - return true; - } - - if (token1 === null || token2 === null) { - return false; - } - - return token1.kind() === token2.kind() && token1.width() === token2.width() && token1.fullWidth() === token2.fullWidth() && token1.text() === token2.text() && TypeScript.Syntax.triviaListStructuralEquals(token1.leadingTrivia(), token2.leadingTrivia()) && TypeScript.Syntax.triviaListStructuralEquals(token1.trailingTrivia(), token2.trailingTrivia()); - } - Syntax.tokenStructuralEquals = tokenStructuralEquals; - - function triviaListStructuralEquals(triviaList1, triviaList2) { - if (triviaList1.count() !== triviaList2.count()) { - return false; - } - - for (var i = 0, n = triviaList1.count(); i < n; i++) { - if (!TypeScript.Syntax.triviaStructuralEquals(triviaList1.syntaxTriviaAt(i), triviaList2.syntaxTriviaAt(i))) { - return false; - } - } - - return true; - } - Syntax.triviaListStructuralEquals = triviaListStructuralEquals; - - function triviaStructuralEquals(trivia1, trivia2) { - return trivia1.kind() === trivia2.kind() && trivia1.fullWidth() === trivia2.fullWidth() && trivia1.fullText() === trivia2.fullText(); - } - Syntax.triviaStructuralEquals = triviaStructuralEquals; - - function listStructuralEquals(list1, list2) { - if (list1.childCount() !== list2.childCount()) { - return false; - } - - for (var i = 0, n = list1.childCount(); i < n; i++) { - var child1 = list1.childAt(i); - var child2 = list2.childAt(i); - - if (!TypeScript.Syntax.nodeOrTokenStructuralEquals(child1, child2)) { - return false; - } - } - - return true; - } - Syntax.listStructuralEquals = listStructuralEquals; - - function separatedListStructuralEquals(list1, list2) { - if (list1.childCount() !== list2.childCount()) { - return false; - } - - for (var i = 0, n = list1.childCount(); i < n; i++) { - var element1 = list1.childAt(i); - var element2 = list2.childAt(i); - if (!TypeScript.Syntax.nodeOrTokenStructuralEquals(element1, element2)) { - return false; - } - } - - return true; - } - Syntax.separatedListStructuralEquals = separatedListStructuralEquals; - - function elementStructuralEquals(element1, element2) { - if (element1 === element2) { - return true; - } - - if (element1 === null || element2 === null) { - return false; - } - - if (element2.kind() !== element2.kind()) { - return false; - } - - if (element1.isToken()) { - return tokenStructuralEquals(element1, element2); - } else if (element1.isNode()) { - return nodeStructuralEquals(element1, element2); - } else if (element1.isList()) { - return listStructuralEquals(element1, element2); - } else if (element1.isSeparatedList()) { - return separatedListStructuralEquals(element1, element2); - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.elementStructuralEquals = elementStructuralEquals; - - function identifierName(text, info) { - if (typeof info === "undefined") { info = null; } - return TypeScript.Syntax.identifier(text); - } - Syntax.identifierName = identifierName; - - function trueExpression() { - return TypeScript.Syntax.token(37 /* TrueKeyword */); - } - Syntax.trueExpression = trueExpression; - - function falseExpression() { - return TypeScript.Syntax.token(24 /* FalseKeyword */); - } - Syntax.falseExpression = falseExpression; - - function numericLiteralExpression(text) { - return TypeScript.Syntax.token(13 /* NumericLiteral */, { text: text }); - } - Syntax.numericLiteralExpression = numericLiteralExpression; - - function stringLiteralExpression(text) { - return TypeScript.Syntax.token(14 /* StringLiteral */, { text: text }); - } - Syntax.stringLiteralExpression = stringLiteralExpression; - - function isSuperInvocationExpression(node) { - return node.kind() === 213 /* InvocationExpression */ && node.expression.kind() === 50 /* SuperKeyword */; - } - Syntax.isSuperInvocationExpression = isSuperInvocationExpression; - - function isSuperInvocationExpressionStatement(node) { - return node.kind() === 149 /* ExpressionStatement */ && isSuperInvocationExpression(node.expression); - } - Syntax.isSuperInvocationExpressionStatement = isSuperInvocationExpressionStatement; - - function isSuperMemberAccessExpression(node) { - return node.kind() === 212 /* MemberAccessExpression */ && node.expression.kind() === 50 /* SuperKeyword */; - } - Syntax.isSuperMemberAccessExpression = isSuperMemberAccessExpression; - - function isSuperMemberAccessInvocationExpression(node) { - return node.kind() === 213 /* InvocationExpression */ && isSuperMemberAccessExpression(node.expression); - } - Syntax.isSuperMemberAccessInvocationExpression = isSuperMemberAccessInvocationExpression; - - function assignmentExpression(left, token, right) { - return TypeScript.Syntax.normalModeFactory.binaryExpression(174 /* AssignmentExpression */, left, token, right); - } - Syntax.assignmentExpression = assignmentExpression; - - function nodeHasSkippedOrMissingTokens(node) { - for (var i = 0; i < node.childCount(); i++) { - var child = node.childAt(i); - if (child !== null && child.isToken()) { - var token = child; - - if (token.hasSkippedToken() || (token.width() === 0 && token.kind() !== 10 /* EndOfFileToken */)) { - return true; - } - } - } - return false; - } - Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; - - function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { - var text = token.text(); - return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); - } - - return false; - } - Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; - - function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var text = trivia.fullText(); - return text.length < 4 || text.substring(text.length - 2) !== "*/"; - } - return false; - } - Syntax.isUnterminatedMultilineCommentTrivia = isUnterminatedMultilineCommentTrivia; - - function isEntirelyInsideCommentTrivia(trivia, fullStart, position) { - if (trivia && trivia.isComment() && position > fullStart) { - var end = fullStart + trivia.fullWidth(); - if (position < end) { - return true; - } else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); - } - } - - return false; - } - Syntax.isEntirelyInsideCommentTrivia = isEntirelyInsideCommentTrivia; - - function isEntirelyInsideComment(sourceUnit, position) { - var positionedToken = sourceUnit.findToken(position); - var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - if (positionedToken.token().hasLeadingTrivia()) { - triviaList = positionedToken.token().leadingTrivia(); - } else { - positionedToken = positionedToken.previousToken(); - if (positionedToken) { - if (positionedToken && positionedToken.token().hasTrailingTrivia()) { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - } - } - } else { - if (position <= (fullStart + positionedToken.token().leadingTriviaWidth())) { - triviaList = positionedToken.token().leadingTrivia(); - } else if (position >= (fullStart + positionedToken.token().width())) { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - } - - if (triviaList) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - break; - } else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - lastTriviaBeforeToken = trivia; - break; - } - - fullStart += trivia.fullWidth(); - } - } - - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - Syntax.isEntirelyInsideComment = isEntirelyInsideComment; - - function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { - var positionedToken = sourceUnit.findToken(position); - - if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - positionedToken = positionedToken.previousToken(); - return positionedToken && positionedToken.token().trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken.token()); - } else if (position > positionedToken.start()) { - return (position < positionedToken.end() && (positionedToken.kind() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= positionedToken.end() && isUnterminatedStringLiteral(positionedToken.token())); - } - } - - return false; - } - Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - - function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullStart; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.token().leadingTrivia(); - fullStart = positionedToken.fullStart(); - } else { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return new TypeScript.PositionedSkippedToken(positionedToken, trivia.skippedToken(), fullStart); - } - - fullStart += triviaWidth; - } - } - - return null; - } - - function findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.token().leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } else { - triviaList = positionedToken.token().trailingTrivia(); - fullEnd = positionedToken.fullEnd(); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullEnd) { - return new TypeScript.PositionedSkippedToken(positionedToken, trivia.skippedToken(), fullEnd - triviaWidth); - } - - fullEnd -= triviaWidth; - } - } - - return null; - } - - function findSkippedTokenInLeadingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, true); - } - Syntax.findSkippedTokenInLeadingTriviaList = findSkippedTokenInLeadingTriviaList; - - function findSkippedTokenInTrailingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, false); - } - Syntax.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; - - function findSkippedTokenInPositionedToken(positionedToken, position) { - var positionInLeadingTriviaList = (position < positionedToken.start()); - return findSkippedTokenInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenInPositionedToken = findSkippedTokenInPositionedToken; - - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < positionedToken.start()); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; - - function getAncestorOfKind(positionedToken, kind) { - while (positionedToken && positionedToken.parent()) { - if (positionedToken.parent().kind() === kind) { - return positionedToken.parent(); - } - - positionedToken = positionedToken.parent(); - } - - return null; - } - Syntax.getAncestorOfKind = getAncestorOfKind; - - function hasAncestorOfKind(positionedToken, kind) { - return TypeScript.Syntax.getAncestorOfKind(positionedToken, kind) !== null; - } - Syntax.hasAncestorOfKind = hasAncestorOfKind; - - function isIntegerLiteral(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return expression.isToken() && TypeScript.IntegerUtilities.isInteger(expression.text()); - - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - Syntax.isIntegerLiteral = isIntegerLiteral; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var NormalModeFactory = (function () { - function NormalModeFactory() { - } - NormalModeFactory.prototype.sourceUnit = function (moduleElements, endOfFileToken) { - return new TypeScript.SourceUnitSyntax(moduleElements, endOfFileToken, false); - }; - NormalModeFactory.prototype.externalModuleReference = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - return new TypeScript.ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, false); - }; - NormalModeFactory.prototype.moduleNameModuleReference = function (moduleName) { - return new TypeScript.ModuleNameModuleReferenceSyntax(moduleName, false); - }; - NormalModeFactory.prototype.importDeclaration = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new TypeScript.ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, false); - }; - NormalModeFactory.prototype.exportAssignment = function (exportKeyword, equalsToken, identifier, semicolonToken) { - return new TypeScript.ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.classDeclaration = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - return new TypeScript.ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.interfaceDeclaration = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - return new TypeScript.InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, false); - }; - NormalModeFactory.prototype.heritageClause = function (kind, extendsOrImplementsKeyword, typeNames) { - return new TypeScript.HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, false); - }; - NormalModeFactory.prototype.moduleDeclaration = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - return new TypeScript.ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.functionDeclaration = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - return new TypeScript.FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.variableStatement = function (modifiers, variableDeclaration, semicolonToken) { - return new TypeScript.VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, false); - }; - NormalModeFactory.prototype.variableDeclaration = function (varKeyword, variableDeclarators) { - return new TypeScript.VariableDeclarationSyntax(varKeyword, variableDeclarators, false); - }; - NormalModeFactory.prototype.variableDeclarator = function (propertyName, typeAnnotation, equalsValueClause) { - return new TypeScript.VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, false); - }; - NormalModeFactory.prototype.equalsValueClause = function (equalsToken, value) { - return new TypeScript.EqualsValueClauseSyntax(equalsToken, value, false); - }; - NormalModeFactory.prototype.prefixUnaryExpression = function (kind, operatorToken, operand) { - return new TypeScript.PrefixUnaryExpressionSyntax(kind, operatorToken, operand, false); - }; - NormalModeFactory.prototype.arrayLiteralExpression = function (openBracketToken, expressions, closeBracketToken) { - return new TypeScript.ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, false); - }; - NormalModeFactory.prototype.omittedExpression = function () { - return new TypeScript.OmittedExpressionSyntax(false); - }; - NormalModeFactory.prototype.parenthesizedExpression = function (openParenToken, expression, closeParenToken) { - return new TypeScript.ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, false); - }; - NormalModeFactory.prototype.simpleArrowFunctionExpression = function (identifier, equalsGreaterThanToken, block, expression) { - return new TypeScript.SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, false); - }; - NormalModeFactory.prototype.parenthesizedArrowFunctionExpression = function (callSignature, equalsGreaterThanToken, block, expression) { - return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, false); - }; - NormalModeFactory.prototype.qualifiedName = function (left, dotToken, right) { - return new TypeScript.QualifiedNameSyntax(left, dotToken, right, false); - }; - NormalModeFactory.prototype.typeArgumentList = function (lessThanToken, typeArguments, greaterThanToken) { - return new TypeScript.TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, false); - }; - NormalModeFactory.prototype.constructorType = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, false); - }; - NormalModeFactory.prototype.functionType = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, false); - }; - NormalModeFactory.prototype.objectType = function (openBraceToken, typeMembers, closeBraceToken) { - return new TypeScript.ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, false); - }; - NormalModeFactory.prototype.arrayType = function (type, openBracketToken, closeBracketToken) { - return new TypeScript.ArrayTypeSyntax(type, openBracketToken, closeBracketToken, false); - }; - NormalModeFactory.prototype.genericType = function (name, typeArgumentList) { - return new TypeScript.GenericTypeSyntax(name, typeArgumentList, false); - }; - NormalModeFactory.prototype.typeQuery = function (typeOfKeyword, name) { - return new TypeScript.TypeQuerySyntax(typeOfKeyword, name, false); - }; - NormalModeFactory.prototype.typeAnnotation = function (colonToken, type) { - return new TypeScript.TypeAnnotationSyntax(colonToken, type, false); - }; - NormalModeFactory.prototype.block = function (openBraceToken, statements, closeBraceToken) { - return new TypeScript.BlockSyntax(openBraceToken, statements, closeBraceToken, false); - }; - NormalModeFactory.prototype.parameter = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - return new TypeScript.ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, false); - }; - NormalModeFactory.prototype.memberAccessExpression = function (expression, dotToken, name) { - return new TypeScript.MemberAccessExpressionSyntax(expression, dotToken, name, false); - }; - NormalModeFactory.prototype.postfixUnaryExpression = function (kind, operand, operatorToken) { - return new TypeScript.PostfixUnaryExpressionSyntax(kind, operand, operatorToken, false); - }; - NormalModeFactory.prototype.elementAccessExpression = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - return new TypeScript.ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, false); - }; - NormalModeFactory.prototype.invocationExpression = function (expression, argumentList) { - return new TypeScript.InvocationExpressionSyntax(expression, argumentList, false); - }; - NormalModeFactory.prototype.argumentList = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - return new TypeScript.ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, false); - }; - NormalModeFactory.prototype.binaryExpression = function (kind, left, operatorToken, right) { - return new TypeScript.BinaryExpressionSyntax(kind, left, operatorToken, right, false); - }; - NormalModeFactory.prototype.conditionalExpression = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - return new TypeScript.ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, false); - }; - NormalModeFactory.prototype.constructSignature = function (newKeyword, callSignature) { - return new TypeScript.ConstructSignatureSyntax(newKeyword, callSignature, false); - }; - NormalModeFactory.prototype.methodSignature = function (propertyName, questionToken, callSignature) { - return new TypeScript.MethodSignatureSyntax(propertyName, questionToken, callSignature, false); - }; - NormalModeFactory.prototype.indexSignature = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - return new TypeScript.IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, false); - }; - NormalModeFactory.prototype.propertySignature = function (propertyName, questionToken, typeAnnotation) { - return new TypeScript.PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, false); - }; - NormalModeFactory.prototype.callSignature = function (typeParameterList, parameterList, typeAnnotation) { - return new TypeScript.CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, false); - }; - NormalModeFactory.prototype.parameterList = function (openParenToken, parameters, closeParenToken) { - return new TypeScript.ParameterListSyntax(openParenToken, parameters, closeParenToken, false); - }; - NormalModeFactory.prototype.typeParameterList = function (lessThanToken, typeParameters, greaterThanToken) { - return new TypeScript.TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, false); - }; - NormalModeFactory.prototype.typeParameter = function (identifier, constraint) { - return new TypeScript.TypeParameterSyntax(identifier, constraint, false); - }; - NormalModeFactory.prototype.constraint = function (extendsKeyword, type) { - return new TypeScript.ConstraintSyntax(extendsKeyword, type, false); - }; - NormalModeFactory.prototype.elseClause = function (elseKeyword, statement) { - return new TypeScript.ElseClauseSyntax(elseKeyword, statement, false); - }; - NormalModeFactory.prototype.ifStatement = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - return new TypeScript.IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, false); - }; - NormalModeFactory.prototype.expressionStatement = function (expression, semicolonToken) { - return new TypeScript.ExpressionStatementSyntax(expression, semicolonToken, false); - }; - NormalModeFactory.prototype.constructorDeclaration = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - return new TypeScript.ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.memberFunctionDeclaration = function (modifiers, propertyName, callSignature, block, semicolonToken) { - return new TypeScript.MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.getAccessor = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - return new TypeScript.GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, false); - }; - NormalModeFactory.prototype.setAccessor = function (modifiers, setKeyword, propertyName, parameterList, block) { - return new TypeScript.SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, false); - }; - NormalModeFactory.prototype.memberVariableDeclaration = function (modifiers, variableDeclarator, semicolonToken) { - return new TypeScript.MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, false); - }; - NormalModeFactory.prototype.indexMemberDeclaration = function (modifiers, indexSignature, semicolonToken) { - return new TypeScript.IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, false); - }; - NormalModeFactory.prototype.throwStatement = function (throwKeyword, expression, semicolonToken) { - return new TypeScript.ThrowStatementSyntax(throwKeyword, expression, semicolonToken, false); - }; - NormalModeFactory.prototype.returnStatement = function (returnKeyword, expression, semicolonToken) { - return new TypeScript.ReturnStatementSyntax(returnKeyword, expression, semicolonToken, false); - }; - NormalModeFactory.prototype.objectCreationExpression = function (newKeyword, expression, argumentList) { - return new TypeScript.ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, false); - }; - NormalModeFactory.prototype.switchStatement = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - return new TypeScript.SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, false); - }; - NormalModeFactory.prototype.caseSwitchClause = function (caseKeyword, expression, colonToken, statements) { - return new TypeScript.CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, false); - }; - NormalModeFactory.prototype.defaultSwitchClause = function (defaultKeyword, colonToken, statements) { - return new TypeScript.DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, false); - }; - NormalModeFactory.prototype.breakStatement = function (breakKeyword, identifier, semicolonToken) { - return new TypeScript.BreakStatementSyntax(breakKeyword, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.continueStatement = function (continueKeyword, identifier, semicolonToken) { - return new TypeScript.ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.forStatement = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - return new TypeScript.ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.forInStatement = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - return new TypeScript.ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.whileStatement = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.withStatement = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.enumDeclaration = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - return new TypeScript.EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.enumElement = function (propertyName, equalsValueClause) { - return new TypeScript.EnumElementSyntax(propertyName, equalsValueClause, false); - }; - NormalModeFactory.prototype.castExpression = function (lessThanToken, type, greaterThanToken, expression) { - return new TypeScript.CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, false); - }; - NormalModeFactory.prototype.objectLiteralExpression = function (openBraceToken, propertyAssignments, closeBraceToken) { - return new TypeScript.ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, false); - }; - NormalModeFactory.prototype.simplePropertyAssignment = function (propertyName, colonToken, expression) { - return new TypeScript.SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, false); - }; - NormalModeFactory.prototype.functionPropertyAssignment = function (propertyName, callSignature, block) { - return new TypeScript.FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, false); - }; - NormalModeFactory.prototype.functionExpression = function (functionKeyword, identifier, callSignature, block) { - return new TypeScript.FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, false); - }; - NormalModeFactory.prototype.emptyStatement = function (semicolonToken) { - return new TypeScript.EmptyStatementSyntax(semicolonToken, false); - }; - NormalModeFactory.prototype.tryStatement = function (tryKeyword, block, catchClause, finallyClause) { - return new TypeScript.TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, false); - }; - NormalModeFactory.prototype.catchClause = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - return new TypeScript.CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, false); - }; - NormalModeFactory.prototype.finallyClause = function (finallyKeyword, block) { - return new TypeScript.FinallyClauseSyntax(finallyKeyword, block, false); - }; - NormalModeFactory.prototype.labeledStatement = function (identifier, colonToken, statement) { - return new TypeScript.LabeledStatementSyntax(identifier, colonToken, statement, false); - }; - NormalModeFactory.prototype.doStatement = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - return new TypeScript.DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, false); - }; - NormalModeFactory.prototype.typeOfExpression = function (typeOfKeyword, expression) { - return new TypeScript.TypeOfExpressionSyntax(typeOfKeyword, expression, false); - }; - NormalModeFactory.prototype.deleteExpression = function (deleteKeyword, expression) { - return new TypeScript.DeleteExpressionSyntax(deleteKeyword, expression, false); - }; - NormalModeFactory.prototype.voidExpression = function (voidKeyword, expression) { - return new TypeScript.VoidExpressionSyntax(voidKeyword, expression, false); - }; - NormalModeFactory.prototype.debuggerStatement = function (debuggerKeyword, semicolonToken) { - return new TypeScript.DebuggerStatementSyntax(debuggerKeyword, semicolonToken, false); - }; - return NormalModeFactory; - })(); - Syntax.NormalModeFactory = NormalModeFactory; - - var StrictModeFactory = (function () { - function StrictModeFactory() { - } - StrictModeFactory.prototype.sourceUnit = function (moduleElements, endOfFileToken) { - return new TypeScript.SourceUnitSyntax(moduleElements, endOfFileToken, true); - }; - StrictModeFactory.prototype.externalModuleReference = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - return new TypeScript.ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, true); - }; - StrictModeFactory.prototype.moduleNameModuleReference = function (moduleName) { - return new TypeScript.ModuleNameModuleReferenceSyntax(moduleName, true); - }; - StrictModeFactory.prototype.importDeclaration = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new TypeScript.ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, true); - }; - StrictModeFactory.prototype.exportAssignment = function (exportKeyword, equalsToken, identifier, semicolonToken) { - return new TypeScript.ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.classDeclaration = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - return new TypeScript.ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.interfaceDeclaration = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - return new TypeScript.InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, true); - }; - StrictModeFactory.prototype.heritageClause = function (kind, extendsOrImplementsKeyword, typeNames) { - return new TypeScript.HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, true); - }; - StrictModeFactory.prototype.moduleDeclaration = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - return new TypeScript.ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.functionDeclaration = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - return new TypeScript.FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.variableStatement = function (modifiers, variableDeclaration, semicolonToken) { - return new TypeScript.VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, true); - }; - StrictModeFactory.prototype.variableDeclaration = function (varKeyword, variableDeclarators) { - return new TypeScript.VariableDeclarationSyntax(varKeyword, variableDeclarators, true); - }; - StrictModeFactory.prototype.variableDeclarator = function (propertyName, typeAnnotation, equalsValueClause) { - return new TypeScript.VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, true); - }; - StrictModeFactory.prototype.equalsValueClause = function (equalsToken, value) { - return new TypeScript.EqualsValueClauseSyntax(equalsToken, value, true); - }; - StrictModeFactory.prototype.prefixUnaryExpression = function (kind, operatorToken, operand) { - return new TypeScript.PrefixUnaryExpressionSyntax(kind, operatorToken, operand, true); - }; - StrictModeFactory.prototype.arrayLiteralExpression = function (openBracketToken, expressions, closeBracketToken) { - return new TypeScript.ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, true); - }; - StrictModeFactory.prototype.omittedExpression = function () { - return new TypeScript.OmittedExpressionSyntax(true); - }; - StrictModeFactory.prototype.parenthesizedExpression = function (openParenToken, expression, closeParenToken) { - return new TypeScript.ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, true); - }; - StrictModeFactory.prototype.simpleArrowFunctionExpression = function (identifier, equalsGreaterThanToken, block, expression) { - return new TypeScript.SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, true); - }; - StrictModeFactory.prototype.parenthesizedArrowFunctionExpression = function (callSignature, equalsGreaterThanToken, block, expression) { - return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, true); - }; - StrictModeFactory.prototype.qualifiedName = function (left, dotToken, right) { - return new TypeScript.QualifiedNameSyntax(left, dotToken, right, true); - }; - StrictModeFactory.prototype.typeArgumentList = function (lessThanToken, typeArguments, greaterThanToken) { - return new TypeScript.TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, true); - }; - StrictModeFactory.prototype.constructorType = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, true); - }; - StrictModeFactory.prototype.functionType = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, true); - }; - StrictModeFactory.prototype.objectType = function (openBraceToken, typeMembers, closeBraceToken) { - return new TypeScript.ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, true); - }; - StrictModeFactory.prototype.arrayType = function (type, openBracketToken, closeBracketToken) { - return new TypeScript.ArrayTypeSyntax(type, openBracketToken, closeBracketToken, true); - }; - StrictModeFactory.prototype.genericType = function (name, typeArgumentList) { - return new TypeScript.GenericTypeSyntax(name, typeArgumentList, true); - }; - StrictModeFactory.prototype.typeQuery = function (typeOfKeyword, name) { - return new TypeScript.TypeQuerySyntax(typeOfKeyword, name, true); - }; - StrictModeFactory.prototype.typeAnnotation = function (colonToken, type) { - return new TypeScript.TypeAnnotationSyntax(colonToken, type, true); - }; - StrictModeFactory.prototype.block = function (openBraceToken, statements, closeBraceToken) { - return new TypeScript.BlockSyntax(openBraceToken, statements, closeBraceToken, true); - }; - StrictModeFactory.prototype.parameter = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - return new TypeScript.ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, true); - }; - StrictModeFactory.prototype.memberAccessExpression = function (expression, dotToken, name) { - return new TypeScript.MemberAccessExpressionSyntax(expression, dotToken, name, true); - }; - StrictModeFactory.prototype.postfixUnaryExpression = function (kind, operand, operatorToken) { - return new TypeScript.PostfixUnaryExpressionSyntax(kind, operand, operatorToken, true); - }; - StrictModeFactory.prototype.elementAccessExpression = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - return new TypeScript.ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, true); - }; - StrictModeFactory.prototype.invocationExpression = function (expression, argumentList) { - return new TypeScript.InvocationExpressionSyntax(expression, argumentList, true); - }; - StrictModeFactory.prototype.argumentList = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - return new TypeScript.ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, true); - }; - StrictModeFactory.prototype.binaryExpression = function (kind, left, operatorToken, right) { - return new TypeScript.BinaryExpressionSyntax(kind, left, operatorToken, right, true); - }; - StrictModeFactory.prototype.conditionalExpression = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - return new TypeScript.ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, true); - }; - StrictModeFactory.prototype.constructSignature = function (newKeyword, callSignature) { - return new TypeScript.ConstructSignatureSyntax(newKeyword, callSignature, true); - }; - StrictModeFactory.prototype.methodSignature = function (propertyName, questionToken, callSignature) { - return new TypeScript.MethodSignatureSyntax(propertyName, questionToken, callSignature, true); - }; - StrictModeFactory.prototype.indexSignature = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - return new TypeScript.IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, true); - }; - StrictModeFactory.prototype.propertySignature = function (propertyName, questionToken, typeAnnotation) { - return new TypeScript.PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, true); - }; - StrictModeFactory.prototype.callSignature = function (typeParameterList, parameterList, typeAnnotation) { - return new TypeScript.CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, true); - }; - StrictModeFactory.prototype.parameterList = function (openParenToken, parameters, closeParenToken) { - return new TypeScript.ParameterListSyntax(openParenToken, parameters, closeParenToken, true); - }; - StrictModeFactory.prototype.typeParameterList = function (lessThanToken, typeParameters, greaterThanToken) { - return new TypeScript.TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, true); - }; - StrictModeFactory.prototype.typeParameter = function (identifier, constraint) { - return new TypeScript.TypeParameterSyntax(identifier, constraint, true); - }; - StrictModeFactory.prototype.constraint = function (extendsKeyword, type) { - return new TypeScript.ConstraintSyntax(extendsKeyword, type, true); - }; - StrictModeFactory.prototype.elseClause = function (elseKeyword, statement) { - return new TypeScript.ElseClauseSyntax(elseKeyword, statement, true); - }; - StrictModeFactory.prototype.ifStatement = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - return new TypeScript.IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, true); - }; - StrictModeFactory.prototype.expressionStatement = function (expression, semicolonToken) { - return new TypeScript.ExpressionStatementSyntax(expression, semicolonToken, true); - }; - StrictModeFactory.prototype.constructorDeclaration = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - return new TypeScript.ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.memberFunctionDeclaration = function (modifiers, propertyName, callSignature, block, semicolonToken) { - return new TypeScript.MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.getAccessor = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - return new TypeScript.GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, true); - }; - StrictModeFactory.prototype.setAccessor = function (modifiers, setKeyword, propertyName, parameterList, block) { - return new TypeScript.SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, true); - }; - StrictModeFactory.prototype.memberVariableDeclaration = function (modifiers, variableDeclarator, semicolonToken) { - return new TypeScript.MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, true); - }; - StrictModeFactory.prototype.indexMemberDeclaration = function (modifiers, indexSignature, semicolonToken) { - return new TypeScript.IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, true); - }; - StrictModeFactory.prototype.throwStatement = function (throwKeyword, expression, semicolonToken) { - return new TypeScript.ThrowStatementSyntax(throwKeyword, expression, semicolonToken, true); - }; - StrictModeFactory.prototype.returnStatement = function (returnKeyword, expression, semicolonToken) { - return new TypeScript.ReturnStatementSyntax(returnKeyword, expression, semicolonToken, true); - }; - StrictModeFactory.prototype.objectCreationExpression = function (newKeyword, expression, argumentList) { - return new TypeScript.ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, true); - }; - StrictModeFactory.prototype.switchStatement = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - return new TypeScript.SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, true); - }; - StrictModeFactory.prototype.caseSwitchClause = function (caseKeyword, expression, colonToken, statements) { - return new TypeScript.CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, true); - }; - StrictModeFactory.prototype.defaultSwitchClause = function (defaultKeyword, colonToken, statements) { - return new TypeScript.DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, true); - }; - StrictModeFactory.prototype.breakStatement = function (breakKeyword, identifier, semicolonToken) { - return new TypeScript.BreakStatementSyntax(breakKeyword, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.continueStatement = function (continueKeyword, identifier, semicolonToken) { - return new TypeScript.ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.forStatement = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - return new TypeScript.ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.forInStatement = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - return new TypeScript.ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.whileStatement = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.withStatement = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.enumDeclaration = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - return new TypeScript.EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.enumElement = function (propertyName, equalsValueClause) { - return new TypeScript.EnumElementSyntax(propertyName, equalsValueClause, true); - }; - StrictModeFactory.prototype.castExpression = function (lessThanToken, type, greaterThanToken, expression) { - return new TypeScript.CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, true); - }; - StrictModeFactory.prototype.objectLiteralExpression = function (openBraceToken, propertyAssignments, closeBraceToken) { - return new TypeScript.ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, true); - }; - StrictModeFactory.prototype.simplePropertyAssignment = function (propertyName, colonToken, expression) { - return new TypeScript.SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, true); - }; - StrictModeFactory.prototype.functionPropertyAssignment = function (propertyName, callSignature, block) { - return new TypeScript.FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, true); - }; - StrictModeFactory.prototype.functionExpression = function (functionKeyword, identifier, callSignature, block) { - return new TypeScript.FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, true); - }; - StrictModeFactory.prototype.emptyStatement = function (semicolonToken) { - return new TypeScript.EmptyStatementSyntax(semicolonToken, true); - }; - StrictModeFactory.prototype.tryStatement = function (tryKeyword, block, catchClause, finallyClause) { - return new TypeScript.TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, true); - }; - StrictModeFactory.prototype.catchClause = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - return new TypeScript.CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, true); - }; - StrictModeFactory.prototype.finallyClause = function (finallyKeyword, block) { - return new TypeScript.FinallyClauseSyntax(finallyKeyword, block, true); - }; - StrictModeFactory.prototype.labeledStatement = function (identifier, colonToken, statement) { - return new TypeScript.LabeledStatementSyntax(identifier, colonToken, statement, true); - }; - StrictModeFactory.prototype.doStatement = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - return new TypeScript.DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, true); - }; - StrictModeFactory.prototype.typeOfExpression = function (typeOfKeyword, expression) { - return new TypeScript.TypeOfExpressionSyntax(typeOfKeyword, expression, true); - }; - StrictModeFactory.prototype.deleteExpression = function (deleteKeyword, expression) { - return new TypeScript.DeleteExpressionSyntax(deleteKeyword, expression, true); - }; - StrictModeFactory.prototype.voidExpression = function (voidKeyword, expression) { - return new TypeScript.VoidExpressionSyntax(voidKeyword, expression, true); - }; - StrictModeFactory.prototype.debuggerStatement = function (debuggerKeyword, semicolonToken) { - return new TypeScript.DebuggerStatementSyntax(debuggerKeyword, semicolonToken, true); - }; - return StrictModeFactory; - })(); - Syntax.StrictModeFactory = StrictModeFactory; - - Syntax.normalModeFactory = new NormalModeFactory(); - Syntax.strictModeFactory = new StrictModeFactory(); - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - function isDirectivePrologueElement(node) { - if (node.kind() === 149 /* ExpressionStatement */) { - var expressionStatement = node; - var expression = expressionStatement.expression; - - if (expression.kind() === 14 /* StringLiteral */) { - return true; - } - } - - return false; - } - SyntaxFacts.isDirectivePrologueElement = isDirectivePrologueElement; - - function isUseStrictDirective(node) { - var expressionStatement = node; - var stringLiteral = expressionStatement.expression; - - var text = stringLiteral.text(); - return text === '"use strict"' || text === "'use strict'"; - } - SyntaxFacts.isUseStrictDirective = isUseStrictDirective; - - function isIdentifierNameOrAnyKeyword(token) { - var tokenKind = token.tokenKind; - return tokenKind === 11 /* IdentifierName */ || TypeScript.SyntaxFacts.isAnyKeyword(tokenKind); - } - SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var EmptySyntaxList = (function () { - function EmptySyntaxList() { - } - EmptySyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - EmptySyntaxList.prototype.isNode = function () { - return false; - }; - EmptySyntaxList.prototype.isToken = function () { - return false; - }; - EmptySyntaxList.prototype.isList = function () { - return true; - }; - EmptySyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - EmptySyntaxList.prototype.toJSON = function (key) { - return []; - }; - - EmptySyntaxList.prototype.childCount = function () { - return 0; - }; - - EmptySyntaxList.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySyntaxList.prototype.toArray = function () { - return []; - }; - - EmptySyntaxList.prototype.collectTextElements = function (elements) { - }; - - EmptySyntaxList.prototype.firstToken = function () { - return null; - }; - - EmptySyntaxList.prototype.lastToken = function () { - return null; - }; - - EmptySyntaxList.prototype.fullWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.width = function () { - return 0; - }; - - EmptySyntaxList.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySyntaxList.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySyntaxList.prototype.leadingTriviaWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.trailingTriviaWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.fullText = function () { - return ""; - }; - - EmptySyntaxList.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptySyntaxList.prototype.isIncrementallyUnusable = function () { - return false; - }; - - EmptySyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - throw TypeScript.Errors.invalidOperation(); - }; - - EmptySyntaxList.prototype.insertChildrenInto = function (array, index) { - }; - return EmptySyntaxList; - })(); - Syntax.EmptySyntaxList = EmptySyntaxList; - - Syntax.emptyList = new EmptySyntaxList(); - - var SingletonSyntaxList = (function () { - function SingletonSyntaxList(item) { - this.item = item; - } - SingletonSyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - SingletonSyntaxList.prototype.isToken = function () { - return false; - }; - SingletonSyntaxList.prototype.isNode = function () { - return false; - }; - SingletonSyntaxList.prototype.isList = function () { - return true; - }; - SingletonSyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - SingletonSyntaxList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSyntaxList.prototype.childCount = function () { - return 1; - }; - - SingletonSyntaxList.prototype.childAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSyntaxList.prototype.toArray = function () { - return [this.item]; - }; - - SingletonSyntaxList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSyntaxList.prototype.firstToken = function () { - return this.item.firstToken(); - }; - - SingletonSyntaxList.prototype.lastToken = function () { - return this.item.lastToken(); - }; - - SingletonSyntaxList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSyntaxList.prototype.width = function () { - return this.item.width(); - }; - - SingletonSyntaxList.prototype.leadingTrivia = function () { - return this.item.leadingTrivia(); - }; - - SingletonSyntaxList.prototype.trailingTrivia = function () { - return this.item.trailingTrivia(); - }; - - SingletonSyntaxList.prototype.leadingTriviaWidth = function () { - return this.item.leadingTriviaWidth(); - }; - - SingletonSyntaxList.prototype.trailingTriviaWidth = function () { - return this.item.trailingTriviaWidth(); - }; - - SingletonSyntaxList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSyntaxList.prototype.isTypeScriptSpecific = function () { - return this.item.isTypeScriptSpecific(); - }; - - SingletonSyntaxList.prototype.isIncrementallyUnusable = function () { - return this.item.isIncrementallyUnusable(); - }; - - SingletonSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - return this.item.findTokenInternal(new TypeScript.PositionedList(parent, this, fullStart), position, fullStart); - }; - - SingletonSyntaxList.prototype.insertChildrenInto = function (array, index) { - array.splice(index, 0, this.item); - }; - return SingletonSyntaxList; - })(); - - var NormalSyntaxList = (function () { - function NormalSyntaxList(nodeOrTokens) { - this._data = 0; - this.nodeOrTokens = nodeOrTokens; - } - NormalSyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - NormalSyntaxList.prototype.isNode = function () { - return false; - }; - NormalSyntaxList.prototype.isToken = function () { - return false; - }; - NormalSyntaxList.prototype.isList = function () { - return true; - }; - NormalSyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - NormalSyntaxList.prototype.toJSON = function (key) { - return this.nodeOrTokens; - }; - - NormalSyntaxList.prototype.childCount = function () { - return this.nodeOrTokens.length; - }; - - NormalSyntaxList.prototype.childAt = function (index) { - if (index < 0 || index >= this.nodeOrTokens.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.nodeOrTokens[index]; - }; - - NormalSyntaxList.prototype.toArray = function () { - return this.nodeOrTokens.slice(0); - }; - - NormalSyntaxList.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var element = this.nodeOrTokens[i]; - element.collectTextElements(elements); - } - }; - - NormalSyntaxList.prototype.firstToken = function () { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var token = this.nodeOrTokens[i].firstToken(); - if (token !== null) { - return token; - } - } - - return null; - }; - - NormalSyntaxList.prototype.lastToken = function () { - for (var i = this.nodeOrTokens.length - 1; i >= 0; i--) { - var token = this.nodeOrTokens[i].lastToken(); - if (token !== null) { - return token; - } - } - - return null; - }; - - NormalSyntaxList.prototype.fullText = function () { - var elements = new Array(); - this.collectTextElements(elements); - return elements.join(""); - }; - - NormalSyntaxList.prototype.isTypeScriptSpecific = function () { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - if (this.nodeOrTokens[i].isTypeScriptSpecific()) { - return true; - } - } - - return false; - }; - - NormalSyntaxList.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - NormalSyntaxList.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - NormalSyntaxList.prototype.width = function () { - var fullWidth = this.fullWidth(); - return fullWidth - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - NormalSyntaxList.prototype.leadingTrivia = function () { - return this.firstToken().leadingTrivia(); - }; - - NormalSyntaxList.prototype.trailingTrivia = function () { - return this.lastToken().trailingTrivia(); - }; - - NormalSyntaxList.prototype.leadingTriviaWidth = function () { - return this.firstToken().leadingTriviaWidth(); - }; - - NormalSyntaxList.prototype.trailingTriviaWidth = function () { - return this.lastToken().trailingTriviaWidth(); - }; - - NormalSyntaxList.prototype.computeData = function () { - var fullWidth = 0; - var isIncrementallyUnusable = false; - - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var node = this.nodeOrTokens[i]; - fullWidth += node.fullWidth(); - isIncrementallyUnusable = isIncrementallyUnusable || node.isIncrementallyUnusable(); - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - NormalSyntaxList.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data = this.computeData(); - } - - return this._data; - }; - - NormalSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedList(parent, this, fullStart); - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var nodeOrToken = this.nodeOrTokens[i]; - - var childWidth = nodeOrToken.fullWidth(); - if (position < childWidth) { - return nodeOrToken.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - NormalSyntaxList.prototype.insertChildrenInto = function (array, index) { - if (index === 0) { - array.unshift.apply(array, this.nodeOrTokens); - } else { - array.splice.apply(array, [index, 0].concat(this.nodeOrTokens)); - } - }; - return NormalSyntaxList; - })(); - - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return Syntax.emptyList; - } - - if (nodes.length === 1) { - var item = nodes[0]; - return new SingletonSyntaxList(item); - } - - return new NormalSyntaxList(nodes); - } - Syntax.list = list; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(parsedInStrictMode) { - this._data = parsedInStrictMode ? 4 /* NodeParsedInStrictModeMask */ : 0; - } - SyntaxNode.prototype.isNode = function () { - return true; - }; - SyntaxNode.prototype.isToken = function () { - return false; - }; - SyntaxNode.prototype.isList = function () { - return false; - }; - SyntaxNode.prototype.isSeparatedList = function () { - return false; - }; - - SyntaxNode.prototype.kind = function () { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.childCount = function () { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.childAt = function (slot) { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.firstToken = function () { - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - if (element.fullWidth() > 0 || element.kind() === 10 /* EndOfFileToken */) { - return element.firstToken(); - } - } - } - - return null; - }; - - SyntaxNode.prototype.lastToken = function () { - for (var i = this.childCount() - 1; i >= 0; i--) { - var element = this.childAt(i); - - if (element !== null) { - if (element.fullWidth() > 0 || element.kind() === 10 /* EndOfFileToken */) { - return element.lastToken(); - } - } - } - - return null; - }; - - SyntaxNode.prototype.insertChildrenInto = function (array, index) { - for (var i = this.childCount() - 1; i >= 0; i--) { - var element = this.childAt(i); - - if (element !== null) { - if (element.isNode() || element.isToken()) { - array.splice(index, 0, element); - } else if (element.isList()) { - element.insertChildrenInto(array, index); - } else if (element.isSeparatedList()) { - element.insertChildrenInto(array, index); - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - } - }; - - SyntaxNode.prototype.leadingTrivia = function () { - var firstToken = this.firstToken(); - return firstToken ? firstToken.leadingTrivia() : TypeScript.Syntax.emptyTriviaList; - }; - - SyntaxNode.prototype.trailingTrivia = function () { - var lastToken = this.lastToken(); - return lastToken ? lastToken.trailingTrivia() : TypeScript.Syntax.emptyTriviaList; - }; - - SyntaxNode.prototype.toJSON = function (key) { - var result = { - kind: TypeScript.SyntaxKind[this.kind()], - fullWidth: this.fullWidth() - }; - - if (this.isIncrementallyUnusable()) { - result.isIncrementallyUnusable = true; - } - - if (this.parsedInStrictMode()) { - result.parsedInStrictMode = true; - } - - var thisAsIndexable = this; - for (var i = 0, n = this.childCount(); i < n; i++) { - var value = this.childAt(i); - - if (value) { - for (var name in this) { - if (value === thisAsIndexable[name]) { - result[name] = value; - break; - } - } - } - } - - return result; - }; - - SyntaxNode.prototype.accept = function (visitor) { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.fullText = function () { - var elements = []; - this.collectTextElements(elements); - return elements.join(""); - }; - - SyntaxNode.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - element.collectTextElements(elements); - } - } - }; - - SyntaxNode.prototype.replaceToken = function (token1, token2) { - if (token1 === token2) { - return this; - } - - return this.accept(new TypeScript.SyntaxTokenReplacer(token1, token2)); - }; - - SyntaxNode.prototype.withLeadingTrivia = function (trivia) { - return this.replaceToken(this.firstToken(), this.firstToken().withLeadingTrivia(trivia)); - }; - - SyntaxNode.prototype.withTrailingTrivia = function (trivia) { - return this.replaceToken(this.lastToken(), this.lastToken().withTrailingTrivia(trivia)); - }; - - SyntaxNode.prototype.hasLeadingTrivia = function () { - return this.lastToken().hasLeadingTrivia(); - }; - - SyntaxNode.prototype.hasTrailingTrivia = function () { - return this.lastToken().hasTrailingTrivia(); - }; - - SyntaxNode.prototype.isTypeScriptSpecific = function () { - return false; - }; - - SyntaxNode.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - SyntaxNode.prototype.parsedInStrictMode = function () { - return (this.data() & 4 /* NodeParsedInStrictModeMask */) !== 0; - }; - - SyntaxNode.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - SyntaxNode.prototype.computeData = function () { - var slotCount = this.childCount(); - - var fullWidth = 0; - var childWidth = 0; - - var isIncrementallyUnusable = ((this._data & 2 /* NodeIncrementallyUnusableMask */) !== 0) || slotCount === 0; - - for (var i = 0, n = slotCount; i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - childWidth = element.fullWidth(); - fullWidth += childWidth; - - if (!isIncrementallyUnusable) { - isIncrementallyUnusable = element.isIncrementallyUnusable(); - } - } - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - SyntaxNode.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data |= this.computeData(); - } - - return this._data; - }; - - SyntaxNode.prototype.findToken = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var endOfFileToken = this.tryGetEndOfFileAt(position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - - if (position < 0 || position >= this.fullWidth()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var positionedToken = this.findTokenInternal(null, position, 0); - - if (includeSkippedTokens) { - return TypeScript.Syntax.findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; - } - - return positionedToken; - }; - - SyntaxNode.prototype.tryGetEndOfFileAt = function (position) { - if (this.kind() === 120 /* SourceUnit */ && position === this.fullWidth()) { - var sourceUnit = this; - return new TypeScript.PositionedToken(new TypeScript.PositionedNode(null, sourceUnit, 0), sourceUnit.endOfFileToken, sourceUnit.moduleElements.fullWidth()); - } - - return null; - }; - - SyntaxNode.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedNode(parent, this, fullStart); - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - var childWidth = element.fullWidth(); - - if (position < childWidth) { - return element.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - } - - throw TypeScript.Errors.invalidOperation(); - }; - - SyntaxNode.prototype.findTokenOnLeft = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var positionedToken = this.findToken(position, false); - var start = positionedToken.start(); - - if (includeSkippedTokens) { - positionedToken = TypeScript.Syntax.findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - - if (position > start) { - return positionedToken; - } - - if (positionedToken.fullStart() === 0) { - return null; - } - - return positionedToken.previousToken(includeSkippedTokens); - }; - - SyntaxNode.prototype.findCompleteTokenOnLeft = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var positionedToken = this.findToken(position, false); - - if (includeSkippedTokens) { - positionedToken = TypeScript.Syntax.findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - - if (positionedToken.token().width() > 0 && position >= positionedToken.end()) { - return positionedToken; - } - - return positionedToken.previousToken(includeSkippedTokens); - }; - - SyntaxNode.prototype.isModuleElement = function () { - return false; - }; - - SyntaxNode.prototype.isClassElement = function () { - return false; - }; - - SyntaxNode.prototype.isTypeMember = function () { - return false; - }; - - SyntaxNode.prototype.isStatement = function () { - return false; - }; - - SyntaxNode.prototype.isExpression = function () { - return false; - }; - - SyntaxNode.prototype.isSwitchClause = function () { - return false; - }; - - SyntaxNode.prototype.structuralEquals = function (node) { - if (this === node) { - return true; - } - if (node === null) { - return false; - } - if (this.kind() !== node.kind()) { - return false; - } - - for (var i = 0, n = this.childCount(); i < n; i++) { - var element1 = this.childAt(i); - var element2 = node.childAt(i); - - if (!TypeScript.Syntax.elementStructuralEquals(element1, element2)) { - return false; - } - } - - return true; - }; - - SyntaxNode.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - SyntaxNode.prototype.leadingTriviaWidth = function () { - var firstToken = this.firstToken(); - return firstToken === null ? 0 : firstToken.leadingTriviaWidth(); - }; - - SyntaxNode.prototype.trailingTriviaWidth = function () { - var lastToken = this.lastToken(); - return lastToken === null ? 0 : lastToken.trailingTriviaWidth(); - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(moduleElements, endOfFileToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.moduleElements = moduleElements; - this.endOfFileToken = endOfFileToken; - } - SourceUnitSyntax.prototype.accept = function (visitor) { - return visitor.visitSourceUnit(this); - }; - - SourceUnitSyntax.prototype.kind = function () { - return 120 /* SourceUnit */; - }; - - SourceUnitSyntax.prototype.childCount = function () { - return 2; - }; - - SourceUnitSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.moduleElements; - case 1: - return this.endOfFileToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SourceUnitSyntax.prototype.update = function (moduleElements, endOfFileToken) { - if (this.moduleElements === moduleElements && this.endOfFileToken === endOfFileToken) { - return this; - } - - return new SourceUnitSyntax(moduleElements, endOfFileToken, this.parsedInStrictMode()); - }; - - SourceUnitSyntax.create = function (endOfFileToken) { - return new SourceUnitSyntax(TypeScript.Syntax.emptyList, endOfFileToken, false); - }; - - SourceUnitSyntax.create1 = function (endOfFileToken) { - return new SourceUnitSyntax(TypeScript.Syntax.emptyList, endOfFileToken, false); - }; - - SourceUnitSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SourceUnitSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SourceUnitSyntax.prototype.withModuleElements = function (moduleElements) { - return this.update(moduleElements, this.endOfFileToken); - }; - - SourceUnitSyntax.prototype.withModuleElement = function (moduleElement) { - return this.withModuleElements(TypeScript.Syntax.list([moduleElement])); - }; - - SourceUnitSyntax.prototype.withEndOfFileToken = function (endOfFileToken) { - return this.update(this.moduleElements, endOfFileToken); - }; - - SourceUnitSyntax.prototype.isTypeScriptSpecific = function () { - if (this.moduleElements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SourceUnitSyntax = SourceUnitSyntax; - - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.requireKeyword = requireKeyword; - this.openParenToken = openParenToken; - this.stringLiteral = stringLiteral; - this.closeParenToken = closeParenToken; - } - ExternalModuleReferenceSyntax.prototype.accept = function (visitor) { - return visitor.visitExternalModuleReference(this); - }; - - ExternalModuleReferenceSyntax.prototype.kind = function () { - return 245 /* ExternalModuleReference */; - }; - - ExternalModuleReferenceSyntax.prototype.childCount = function () { - return 4; - }; - - ExternalModuleReferenceSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.requireKeyword; - case 1: - return this.openParenToken; - case 2: - return this.stringLiteral; - case 3: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExternalModuleReferenceSyntax.prototype.isModuleReference = function () { - return true; - }; - - ExternalModuleReferenceSyntax.prototype.update = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - if (this.requireKeyword === requireKeyword && this.openParenToken === openParenToken && this.stringLiteral === stringLiteral && this.closeParenToken === closeParenToken) { - return this; - } - - return new ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, this.parsedInStrictMode()); - }; - - ExternalModuleReferenceSyntax.create1 = function (stringLiteral) { - return new ExternalModuleReferenceSyntax(TypeScript.Syntax.token(66 /* RequireKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), stringLiteral, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ExternalModuleReferenceSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExternalModuleReferenceSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExternalModuleReferenceSyntax.prototype.withRequireKeyword = function (requireKeyword) { - return this.update(requireKeyword, this.openParenToken, this.stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.requireKeyword, openParenToken, this.stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withStringLiteral = function (stringLiteral) { - return this.update(this.requireKeyword, this.openParenToken, stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.requireKeyword, this.openParenToken, this.stringLiteral, closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(moduleName, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.moduleName = moduleName; - } - ModuleNameModuleReferenceSyntax.prototype.accept = function (visitor) { - return visitor.visitModuleNameModuleReference(this); - }; - - ModuleNameModuleReferenceSyntax.prototype.kind = function () { - return 246 /* ModuleNameModuleReference */; - }; - - ModuleNameModuleReferenceSyntax.prototype.childCount = function () { - return 1; - }; - - ModuleNameModuleReferenceSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.moduleName; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ModuleNameModuleReferenceSyntax.prototype.isModuleReference = function () { - return true; - }; - - ModuleNameModuleReferenceSyntax.prototype.update = function (moduleName) { - if (this.moduleName === moduleName) { - return this; - } - - return new ModuleNameModuleReferenceSyntax(moduleName, this.parsedInStrictMode()); - }; - - ModuleNameModuleReferenceSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ModuleNameModuleReferenceSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ModuleNameModuleReferenceSyntax.prototype.withModuleName = function (moduleName) { - return this.update(moduleName); - }; - - ModuleNameModuleReferenceSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.importKeyword = importKeyword; - this.identifier = identifier; - this.equalsToken = equalsToken; - this.moduleReference = moduleReference; - this.semicolonToken = semicolonToken; - } - ImportDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitImportDeclaration(this); - }; - - ImportDeclarationSyntax.prototype.kind = function () { - return 133 /* ImportDeclaration */; - }; - - ImportDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - ImportDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.importKeyword; - case 2: - return this.identifier; - case 3: - return this.equalsToken; - case 4: - return this.moduleReference; - case 5: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ImportDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ImportDeclarationSyntax.prototype.update = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - if (this.modifiers === modifiers && this.importKeyword === importKeyword && this.identifier === identifier && this.equalsToken === equalsToken && this.moduleReference === moduleReference && this.semicolonToken === semicolonToken) { - return this; - } - - return new ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, this.parsedInStrictMode()); - }; - - ImportDeclarationSyntax.create = function (importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new ImportDeclarationSyntax(TypeScript.Syntax.emptyList, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, false); - }; - - ImportDeclarationSyntax.create1 = function (identifier, moduleReference) { - return new ImportDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(49 /* ImportKeyword */), identifier, TypeScript.Syntax.token(107 /* EqualsToken */), moduleReference, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ImportDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ImportDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ImportDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.importKeyword, this.identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ImportDeclarationSyntax.prototype.withImportKeyword = function (importKeyword) { - return this.update(this.modifiers, importKeyword, this.identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.importKeyword, identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(this.modifiers, this.importKeyword, this.identifier, equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withModuleReference = function (moduleReference) { - return this.update(this.modifiers, this.importKeyword, this.identifier, this.equalsToken, moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.importKeyword, this.identifier, this.equalsToken, this.moduleReference, semicolonToken); - }; - - ImportDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ImportDeclarationSyntax = ImportDeclarationSyntax; - - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.exportKeyword = exportKeyword; - this.equalsToken = equalsToken; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - ExportAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitExportAssignment(this); - }; - - ExportAssignmentSyntax.prototype.kind = function () { - return 134 /* ExportAssignment */; - }; - - ExportAssignmentSyntax.prototype.childCount = function () { - return 4; - }; - - ExportAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.exportKeyword; - case 1: - return this.equalsToken; - case 2: - return this.identifier; - case 3: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExportAssignmentSyntax.prototype.isModuleElement = function () { - return true; - }; - - ExportAssignmentSyntax.prototype.update = function (exportKeyword, equalsToken, identifier, semicolonToken) { - if (this.exportKeyword === exportKeyword && this.equalsToken === equalsToken && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - ExportAssignmentSyntax.create1 = function (identifier) { - return new ExportAssignmentSyntax(TypeScript.Syntax.token(47 /* ExportKeyword */), TypeScript.Syntax.token(107 /* EqualsToken */), identifier, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ExportAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExportAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExportAssignmentSyntax.prototype.withExportKeyword = function (exportKeyword) { - return this.update(exportKeyword, this.equalsToken, this.identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(this.exportKeyword, equalsToken, this.identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.exportKeyword, this.equalsToken, identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.exportKeyword, this.equalsToken, this.identifier, semicolonToken); - }; - - ExportAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExportAssignmentSyntax = ExportAssignmentSyntax; - - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.classKeyword = classKeyword; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.openBraceToken = openBraceToken; - this.classElements = classElements; - this.closeBraceToken = closeBraceToken; - } - ClassDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitClassDeclaration(this); - }; - - ClassDeclarationSyntax.prototype.kind = function () { - return 131 /* ClassDeclaration */; - }; - - ClassDeclarationSyntax.prototype.childCount = function () { - return 8; - }; - - ClassDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.classKeyword; - case 2: - return this.identifier; - case 3: - return this.typeParameterList; - case 4: - return this.heritageClauses; - case 5: - return this.openBraceToken; - case 6: - return this.classElements; - case 7: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ClassDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ClassDeclarationSyntax.prototype.update = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - if (this.modifiers === modifiers && this.classKeyword === classKeyword && this.identifier === identifier && this.typeParameterList === typeParameterList && this.heritageClauses === heritageClauses && this.openBraceToken === openBraceToken && this.classElements === classElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, this.parsedInStrictMode()); - }; - - ClassDeclarationSyntax.create = function (classKeyword, identifier, openBraceToken, closeBraceToken) { - return new ClassDeclarationSyntax(TypeScript.Syntax.emptyList, classKeyword, identifier, null, TypeScript.Syntax.emptyList, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - ClassDeclarationSyntax.create1 = function (identifier) { - return new ClassDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(44 /* ClassKeyword */), identifier, null, TypeScript.Syntax.emptyList, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ClassDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ClassDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ClassDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ClassDeclarationSyntax.prototype.withClassKeyword = function (classKeyword) { - return this.update(this.modifiers, classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.classKeyword, identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.modifiers, this.classKeyword, this.identifier, typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withHeritageClauses = function (heritageClauses) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withHeritageClause = function (heritageClause) { - return this.withHeritageClauses(TypeScript.Syntax.list([heritageClause])); - }; - - ClassDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withClassElements = function (classElements) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withClassElement = function (classElement) { - return this.withClassElements(TypeScript.Syntax.list([classElement])); - }; - - ClassDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ClassDeclarationSyntax = ClassDeclarationSyntax; - - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.interfaceKeyword = interfaceKeyword; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.body = body; - } - InterfaceDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitInterfaceDeclaration(this); - }; - - InterfaceDeclarationSyntax.prototype.kind = function () { - return 128 /* InterfaceDeclaration */; - }; - - InterfaceDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - InterfaceDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.interfaceKeyword; - case 2: - return this.identifier; - case 3: - return this.typeParameterList; - case 4: - return this.heritageClauses; - case 5: - return this.body; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - InterfaceDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - InterfaceDeclarationSyntax.prototype.update = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - if (this.modifiers === modifiers && this.interfaceKeyword === interfaceKeyword && this.identifier === identifier && this.typeParameterList === typeParameterList && this.heritageClauses === heritageClauses && this.body === body) { - return this; - } - - return new InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, this.parsedInStrictMode()); - }; - - InterfaceDeclarationSyntax.create = function (interfaceKeyword, identifier, body) { - return new InterfaceDeclarationSyntax(TypeScript.Syntax.emptyList, interfaceKeyword, identifier, null, TypeScript.Syntax.emptyList, body, false); - }; - - InterfaceDeclarationSyntax.create1 = function (identifier) { - return new InterfaceDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(52 /* InterfaceKeyword */), identifier, null, TypeScript.Syntax.emptyList, ObjectTypeSyntax.create1(), false); - }; - - InterfaceDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - InterfaceDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - InterfaceDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - InterfaceDeclarationSyntax.prototype.withInterfaceKeyword = function (interfaceKeyword) { - return this.update(this.modifiers, interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.interfaceKeyword, identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withHeritageClauses = function (heritageClauses) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withHeritageClause = function (heritageClause) { - return this.withHeritageClauses(TypeScript.Syntax.list([heritageClause])); - }; - - InterfaceDeclarationSyntax.prototype.withBody = function (body) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, body); - }; - - InterfaceDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword; - this.typeNames = typeNames; - - this._kind = kind; - } - HeritageClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitHeritageClause(this); - }; - - HeritageClauseSyntax.prototype.childCount = function () { - return 2; - }; - - HeritageClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.extendsOrImplementsKeyword; - case 1: - return this.typeNames; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - HeritageClauseSyntax.prototype.kind = function () { - return this._kind; - }; - - HeritageClauseSyntax.prototype.update = function (kind, extendsOrImplementsKeyword, typeNames) { - if (this._kind === kind && this.extendsOrImplementsKeyword === extendsOrImplementsKeyword && this.typeNames === typeNames) { - return this; - } - - return new HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, this.parsedInStrictMode()); - }; - - HeritageClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - HeritageClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - HeritageClauseSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.extendsOrImplementsKeyword, this.typeNames); - }; - - HeritageClauseSyntax.prototype.withExtendsOrImplementsKeyword = function (extendsOrImplementsKeyword) { - return this.update(this._kind, extendsOrImplementsKeyword, this.typeNames); - }; - - HeritageClauseSyntax.prototype.withTypeNames = function (typeNames) { - return this.update(this._kind, this.extendsOrImplementsKeyword, typeNames); - }; - - HeritageClauseSyntax.prototype.withTypeName = function (typeName) { - return this.withTypeNames(TypeScript.Syntax.separatedList([typeName])); - }; - - HeritageClauseSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.HeritageClauseSyntax = HeritageClauseSyntax; - - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.moduleKeyword = moduleKeyword; - this.name = name; - this.stringLiteral = stringLiteral; - this.openBraceToken = openBraceToken; - this.moduleElements = moduleElements; - this.closeBraceToken = closeBraceToken; - } - ModuleDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitModuleDeclaration(this); - }; - - ModuleDeclarationSyntax.prototype.kind = function () { - return 130 /* ModuleDeclaration */; - }; - - ModuleDeclarationSyntax.prototype.childCount = function () { - return 7; - }; - - ModuleDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.moduleKeyword; - case 2: - return this.name; - case 3: - return this.stringLiteral; - case 4: - return this.openBraceToken; - case 5: - return this.moduleElements; - case 6: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ModuleDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ModuleDeclarationSyntax.prototype.update = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - if (this.modifiers === modifiers && this.moduleKeyword === moduleKeyword && this.name === name && this.stringLiteral === stringLiteral && this.openBraceToken === openBraceToken && this.moduleElements === moduleElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, this.parsedInStrictMode()); - }; - - ModuleDeclarationSyntax.create = function (moduleKeyword, openBraceToken, closeBraceToken) { - return new ModuleDeclarationSyntax(TypeScript.Syntax.emptyList, moduleKeyword, null, null, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - ModuleDeclarationSyntax.create1 = function () { - return new ModuleDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(65 /* ModuleKeyword */), null, null, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ModuleDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ModuleDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ModuleDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ModuleDeclarationSyntax.prototype.withModuleKeyword = function (moduleKeyword) { - return this.update(this.modifiers, moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withName = function (name) { - return this.update(this.modifiers, this.moduleKeyword, name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withStringLiteral = function (stringLiteral) { - return this.update(this.modifiers, this.moduleKeyword, this.name, stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModuleElements = function (moduleElements) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModuleElement = function (moduleElement) { - return this.withModuleElements(TypeScript.Syntax.list([moduleElement])); - }; - - ModuleDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.functionKeyword = functionKeyword; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - FunctionDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionDeclaration(this); - }; - - FunctionDeclarationSyntax.prototype.kind = function () { - return 129 /* FunctionDeclaration */; - }; - - FunctionDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - FunctionDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.functionKeyword; - case 2: - return this.identifier; - case 3: - return this.callSignature; - case 4: - return this.block; - case 5: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionDeclarationSyntax.prototype.isStatement = function () { - return true; - }; - - FunctionDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - FunctionDeclarationSyntax.prototype.update = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.functionKeyword === functionKeyword && this.identifier === identifier && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - FunctionDeclarationSyntax.create = function (functionKeyword, identifier, callSignature) { - return new FunctionDeclarationSyntax(TypeScript.Syntax.emptyList, functionKeyword, identifier, callSignature, null, null, false); - }; - - FunctionDeclarationSyntax.create1 = function (identifier) { - return new FunctionDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(27 /* FunctionKeyword */), identifier, CallSignatureSyntax.create1(), null, null, false); - }; - - FunctionDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.functionKeyword, this.identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - FunctionDeclarationSyntax.prototype.withFunctionKeyword = function (functionKeyword) { - return this.update(this.modifiers, functionKeyword, this.identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.functionKeyword, identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, this.callSignature, block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, this.callSignature, this.block, semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block !== null && this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.variableDeclaration = variableDeclaration; - this.semicolonToken = semicolonToken; - } - VariableStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableStatement(this); - }; - - VariableStatementSyntax.prototype.kind = function () { - return 148 /* VariableStatement */; - }; - - VariableStatementSyntax.prototype.childCount = function () { - return 3; - }; - - VariableStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.variableDeclaration; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableStatementSyntax.prototype.isStatement = function () { - return true; - }; - - VariableStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - VariableStatementSyntax.prototype.update = function (modifiers, variableDeclaration, semicolonToken) { - if (this.modifiers === modifiers && this.variableDeclaration === variableDeclaration && this.semicolonToken === semicolonToken) { - return this; - } - - return new VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, this.parsedInStrictMode()); - }; - - VariableStatementSyntax.create = function (variableDeclaration, semicolonToken) { - return new VariableStatementSyntax(TypeScript.Syntax.emptyList, variableDeclaration, semicolonToken, false); - }; - - VariableStatementSyntax.create1 = function (variableDeclaration) { - return new VariableStatementSyntax(TypeScript.Syntax.emptyList, variableDeclaration, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - VariableStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableStatementSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.variableDeclaration, this.semicolonToken); - }; - - VariableStatementSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - VariableStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.modifiers, variableDeclaration, this.semicolonToken); - }; - - VariableStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.variableDeclaration, semicolonToken); - }; - - VariableStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableStatementSyntax = VariableStatementSyntax; - - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(varKeyword, variableDeclarators, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.varKeyword = varKeyword; - this.variableDeclarators = variableDeclarators; - } - VariableDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableDeclaration(this); - }; - - VariableDeclarationSyntax.prototype.kind = function () { - return 224 /* VariableDeclaration */; - }; - - VariableDeclarationSyntax.prototype.childCount = function () { - return 2; - }; - - VariableDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.varKeyword; - case 1: - return this.variableDeclarators; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableDeclarationSyntax.prototype.update = function (varKeyword, variableDeclarators) { - if (this.varKeyword === varKeyword && this.variableDeclarators === variableDeclarators) { - return this; - } - - return new VariableDeclarationSyntax(varKeyword, variableDeclarators, this.parsedInStrictMode()); - }; - - VariableDeclarationSyntax.create1 = function (variableDeclarators) { - return new VariableDeclarationSyntax(TypeScript.Syntax.token(40 /* VarKeyword */), variableDeclarators, false); - }; - - VariableDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableDeclarationSyntax.prototype.withVarKeyword = function (varKeyword) { - return this.update(varKeyword, this.variableDeclarators); - }; - - VariableDeclarationSyntax.prototype.withVariableDeclarators = function (variableDeclarators) { - return this.update(this.varKeyword, variableDeclarators); - }; - - VariableDeclarationSyntax.prototype.withVariableDeclarator = function (variableDeclarator) { - return this.withVariableDeclarators(TypeScript.Syntax.separatedList([variableDeclarator])); - }; - - VariableDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclarators.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableDeclarationSyntax = VariableDeclarationSyntax; - - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - } - VariableDeclaratorSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableDeclarator(this); - }; - - VariableDeclaratorSyntax.prototype.kind = function () { - return 225 /* VariableDeclarator */; - }; - - VariableDeclaratorSyntax.prototype.childCount = function () { - return 3; - }; - - VariableDeclaratorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.typeAnnotation; - case 2: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableDeclaratorSyntax.prototype.update = function (propertyName, typeAnnotation, equalsValueClause) { - if (this.propertyName === propertyName && this.typeAnnotation === typeAnnotation && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, this.parsedInStrictMode()); - }; - - VariableDeclaratorSyntax.create = function (propertyName) { - return new VariableDeclaratorSyntax(propertyName, null, null, false); - }; - - VariableDeclaratorSyntax.create1 = function (propertyName) { - return new VariableDeclaratorSyntax(propertyName, null, null, false); - }; - - VariableDeclaratorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableDeclaratorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableDeclaratorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.typeAnnotation, this.equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.propertyName, typeAnnotation, this.equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.propertyName, this.typeAnnotation, equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeAnnotation !== null) { - return true; - } - if (this.equalsValueClause !== null && this.equalsValueClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(equalsToken, value, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.equalsToken = equalsToken; - this.value = value; - } - EqualsValueClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitEqualsValueClause(this); - }; - - EqualsValueClauseSyntax.prototype.kind = function () { - return 232 /* EqualsValueClause */; - }; - - EqualsValueClauseSyntax.prototype.childCount = function () { - return 2; - }; - - EqualsValueClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.equalsToken; - case 1: - return this.value; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EqualsValueClauseSyntax.prototype.update = function (equalsToken, value) { - if (this.equalsToken === equalsToken && this.value === value) { - return this; - } - - return new EqualsValueClauseSyntax(equalsToken, value, this.parsedInStrictMode()); - }; - - EqualsValueClauseSyntax.create1 = function (value) { - return new EqualsValueClauseSyntax(TypeScript.Syntax.token(107 /* EqualsToken */), value, false); - }; - - EqualsValueClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EqualsValueClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EqualsValueClauseSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(equalsToken, this.value); - }; - - EqualsValueClauseSyntax.prototype.withValue = function (value) { - return this.update(this.equalsToken, value); - }; - - EqualsValueClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.value.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(kind, operatorToken, operand, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.operatorToken = operatorToken; - this.operand = operand; - - this._kind = kind; - } - PrefixUnaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitPrefixUnaryExpression(this); - }; - - PrefixUnaryExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - PrefixUnaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.operatorToken; - case 1: - return this.operand; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PrefixUnaryExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - PrefixUnaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - PrefixUnaryExpressionSyntax.prototype.update = function (kind, operatorToken, operand) { - if (this._kind === kind && this.operatorToken === operatorToken && this.operand === operand) { - return this; - } - - return new PrefixUnaryExpressionSyntax(kind, operatorToken, operand, this.parsedInStrictMode()); - }; - - PrefixUnaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PrefixUnaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PrefixUnaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.operatorToken, this.operand); - }; - - PrefixUnaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, operatorToken, this.operand); - }; - - PrefixUnaryExpressionSyntax.prototype.withOperand = function (operand) { - return this.update(this._kind, this.operatorToken, operand); - }; - - PrefixUnaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.operand.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBracketToken = openBracketToken; - this.expressions = expressions; - this.closeBracketToken = closeBracketToken; - } - ArrayLiteralExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitArrayLiteralExpression(this); - }; - - ArrayLiteralExpressionSyntax.prototype.kind = function () { - return 214 /* ArrayLiteralExpression */; - }; - - ArrayLiteralExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ArrayLiteralExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBracketToken; - case 1: - return this.expressions; - case 2: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArrayLiteralExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.update = function (openBracketToken, expressions, closeBracketToken) { - if (this.openBracketToken === openBracketToken && this.expressions === expressions && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, this.parsedInStrictMode()); - }; - - ArrayLiteralExpressionSyntax.create = function (openBracketToken, closeBracketToken) { - return new ArrayLiteralExpressionSyntax(openBracketToken, TypeScript.Syntax.emptySeparatedList, closeBracketToken, false); - }; - - ArrayLiteralExpressionSyntax.create1 = function () { - return new ArrayLiteralExpressionSyntax(TypeScript.Syntax.token(74 /* OpenBracketToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ArrayLiteralExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArrayLiteralExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArrayLiteralExpressionSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(openBracketToken, this.expressions, this.closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.withExpressions = function (expressions) { - return this.update(this.openBracketToken, expressions, this.closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.withExpression = function (expression) { - return this.withExpressions(TypeScript.Syntax.separatedList([expression])); - }; - - ArrayLiteralExpressionSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.openBracketToken, this.expressions, closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expressions.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - } - OmittedExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitOmittedExpression(this); - }; - - OmittedExpressionSyntax.prototype.kind = function () { - return 223 /* OmittedExpression */; - }; - - OmittedExpressionSyntax.prototype.childCount = function () { - return 0; - }; - - OmittedExpressionSyntax.prototype.childAt = function (slot) { - throw TypeScript.Errors.invalidOperation(); - }; - - OmittedExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - OmittedExpressionSyntax.prototype.update = function () { - return this; - }; - - OmittedExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - OmittedExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - OmittedExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.OmittedExpressionSyntax = OmittedExpressionSyntax; - - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openParenToken = openParenToken; - this.expression = expression; - this.closeParenToken = closeParenToken; - } - ParenthesizedExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitParenthesizedExpression(this); - }; - - ParenthesizedExpressionSyntax.prototype.kind = function () { - return 217 /* ParenthesizedExpression */; - }; - - ParenthesizedExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ParenthesizedExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openParenToken; - case 1: - return this.expression; - case 2: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParenthesizedExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.update = function (openParenToken, expression, closeParenToken) { - if (this.openParenToken === openParenToken && this.expression === expression && this.closeParenToken === closeParenToken) { - return this; - } - - return new ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, this.parsedInStrictMode()); - }; - - ParenthesizedExpressionSyntax.create1 = function (expression) { - return new ParenthesizedExpressionSyntax(TypeScript.Syntax.token(72 /* OpenParenToken */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ParenthesizedExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParenthesizedExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParenthesizedExpressionSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(openParenToken, this.expression, this.closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.openParenToken, expression, this.closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.openParenToken, this.expression, closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.block = block; - this.expression = expression; - } - SimpleArrowFunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitSimpleArrowFunctionExpression(this); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.kind = function () { - return 219 /* SimpleArrowFunctionExpression */; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.equalsGreaterThanToken; - case 2: - return this.block; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isArrowFunctionExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.update = function (identifier, equalsGreaterThanToken, block, expression) { - if (this.identifier === identifier && this.equalsGreaterThanToken === equalsGreaterThanToken && this.block === block && this.expression === expression) { - return this; - } - - return new SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, this.parsedInStrictMode()); - }; - - SimpleArrowFunctionExpressionSyntax.create = function (identifier, equalsGreaterThanToken) { - return new SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, null, null, false); - }; - - SimpleArrowFunctionExpressionSyntax.create1 = function (identifier) { - return new SimpleArrowFunctionExpressionSyntax(identifier, TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), null, null, false); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.equalsGreaterThanToken, this.block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.identifier, equalsGreaterThanToken, this.block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.identifier, this.equalsGreaterThanToken, block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.identifier, this.equalsGreaterThanToken, this.block, expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.callSignature = callSignature; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.block = block; - this.expression = expression; - } - ParenthesizedArrowFunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitParenthesizedArrowFunctionExpression(this); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = function () { - return 218 /* ParenthesizedArrowFunctionExpression */; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.callSignature; - case 1: - return this.equalsGreaterThanToken; - case 2: - return this.block; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isArrowFunctionExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.update = function (callSignature, equalsGreaterThanToken, block, expression) { - if (this.callSignature === callSignature && this.equalsGreaterThanToken === equalsGreaterThanToken && this.block === block && this.expression === expression) { - return this; - } - - return new ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, this.parsedInStrictMode()); - }; - - ParenthesizedArrowFunctionExpressionSyntax.create = function (callSignature, equalsGreaterThanToken) { - return new ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, null, null, false); - }; - - ParenthesizedArrowFunctionExpressionSyntax.create1 = function () { - return new ParenthesizedArrowFunctionExpressionSyntax(CallSignatureSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), null, null, false); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(callSignature, this.equalsGreaterThanToken, this.block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.callSignature, equalsGreaterThanToken, this.block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.callSignature, this.equalsGreaterThanToken, block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.callSignature, this.equalsGreaterThanToken, this.block, expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(left, dotToken, right, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.left = left; - this.dotToken = dotToken; - this.right = right; - } - QualifiedNameSyntax.prototype.accept = function (visitor) { - return visitor.visitQualifiedName(this); - }; - - QualifiedNameSyntax.prototype.kind = function () { - return 121 /* QualifiedName */; - }; - - QualifiedNameSyntax.prototype.childCount = function () { - return 3; - }; - - QualifiedNameSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.left; - case 1: - return this.dotToken; - case 2: - return this.right; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - QualifiedNameSyntax.prototype.isName = function () { - return true; - }; - - QualifiedNameSyntax.prototype.isType = function () { - return true; - }; - - QualifiedNameSyntax.prototype.update = function (left, dotToken, right) { - if (this.left === left && this.dotToken === dotToken && this.right === right) { - return this; - } - - return new QualifiedNameSyntax(left, dotToken, right, this.parsedInStrictMode()); - }; - - QualifiedNameSyntax.create1 = function (left, right) { - return new QualifiedNameSyntax(left, TypeScript.Syntax.token(76 /* DotToken */), right, false); - }; - - QualifiedNameSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - QualifiedNameSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - QualifiedNameSyntax.prototype.withLeft = function (left) { - return this.update(left, this.dotToken, this.right); - }; - - QualifiedNameSyntax.prototype.withDotToken = function (dotToken) { - return this.update(this.left, dotToken, this.right); - }; - - QualifiedNameSyntax.prototype.withRight = function (right) { - return this.update(this.left, this.dotToken, right); - }; - - QualifiedNameSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - TypeScript.QualifiedNameSyntax = QualifiedNameSyntax; - - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.typeArguments = typeArguments; - this.greaterThanToken = greaterThanToken; - } - TypeArgumentListSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeArgumentList(this); - }; - - TypeArgumentListSyntax.prototype.kind = function () { - return 228 /* TypeArgumentList */; - }; - - TypeArgumentListSyntax.prototype.childCount = function () { - return 3; - }; - - TypeArgumentListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.typeArguments; - case 2: - return this.greaterThanToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeArgumentListSyntax.prototype.update = function (lessThanToken, typeArguments, greaterThanToken) { - if (this.lessThanToken === lessThanToken && this.typeArguments === typeArguments && this.greaterThanToken === greaterThanToken) { - return this; - } - - return new TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, this.parsedInStrictMode()); - }; - - TypeArgumentListSyntax.create = function (lessThanToken, greaterThanToken) { - return new TypeArgumentListSyntax(lessThanToken, TypeScript.Syntax.emptySeparatedList, greaterThanToken, false); - }; - - TypeArgumentListSyntax.create1 = function () { - return new TypeArgumentListSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(81 /* GreaterThanToken */), false); - }; - - TypeArgumentListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeArgumentListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeArgumentListSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.typeArguments, this.greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.withTypeArguments = function (typeArguments) { - return this.update(this.lessThanToken, typeArguments, this.greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.withTypeArgument = function (typeArgument) { - return this.withTypeArguments(TypeScript.Syntax.separatedList([typeArgument])); - }; - - TypeArgumentListSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.typeArguments, greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeArgumentListSyntax = TypeArgumentListSyntax; - - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.type = type; - } - ConstructorTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructorType(this); - }; - - ConstructorTypeSyntax.prototype.kind = function () { - return 125 /* ConstructorType */; - }; - - ConstructorTypeSyntax.prototype.childCount = function () { - return 5; - }; - - ConstructorTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.typeParameterList; - case 2: - return this.parameterList; - case 3: - return this.equalsGreaterThanToken; - case 4: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructorTypeSyntax.prototype.isType = function () { - return true; - }; - - ConstructorTypeSyntax.prototype.update = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (this.newKeyword === newKeyword && this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.equalsGreaterThanToken === equalsGreaterThanToken && this.type === type) { - return this; - } - - return new ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, this.parsedInStrictMode()); - }; - - ConstructorTypeSyntax.create = function (newKeyword, parameterList, equalsGreaterThanToken, type) { - return new ConstructorTypeSyntax(newKeyword, null, parameterList, equalsGreaterThanToken, type, false); - }; - - ConstructorTypeSyntax.create1 = function (type) { - return new ConstructorTypeSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), null, ParameterListSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), type, false); - }; - - ConstructorTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructorTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructorTypeSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.newKeyword, typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.newKeyword, this.typeParameterList, parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.newKeyword, this.typeParameterList, this.parameterList, equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withType = function (type) { - return this.update(this.newKeyword, this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, type); - }; - - ConstructorTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructorTypeSyntax = ConstructorTypeSyntax; - - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.type = type; - } - FunctionTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionType(this); - }; - - FunctionTypeSyntax.prototype.kind = function () { - return 123 /* FunctionType */; - }; - - FunctionTypeSyntax.prototype.childCount = function () { - return 4; - }; - - FunctionTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeParameterList; - case 1: - return this.parameterList; - case 2: - return this.equalsGreaterThanToken; - case 3: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionTypeSyntax.prototype.isType = function () { - return true; - }; - - FunctionTypeSyntax.prototype.update = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.equalsGreaterThanToken === equalsGreaterThanToken && this.type === type) { - return this; - } - - return new FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, this.parsedInStrictMode()); - }; - - FunctionTypeSyntax.create = function (parameterList, equalsGreaterThanToken, type) { - return new FunctionTypeSyntax(null, parameterList, equalsGreaterThanToken, type, false); - }; - - FunctionTypeSyntax.create1 = function (type) { - return new FunctionTypeSyntax(null, ParameterListSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), type, false); - }; - - FunctionTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionTypeSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.typeParameterList, parameterList, this.equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.typeParameterList, this.parameterList, equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withType = function (type) { - return this.update(this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, type); - }; - - FunctionTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionTypeSyntax = FunctionTypeSyntax; - - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.typeMembers = typeMembers; - this.closeBraceToken = closeBraceToken; - } - ObjectTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectType(this); - }; - - ObjectTypeSyntax.prototype.kind = function () { - return 122 /* ObjectType */; - }; - - ObjectTypeSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.typeMembers; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectTypeSyntax.prototype.isType = function () { - return true; - }; - - ObjectTypeSyntax.prototype.update = function (openBraceToken, typeMembers, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.typeMembers === typeMembers && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, this.parsedInStrictMode()); - }; - - ObjectTypeSyntax.create = function (openBraceToken, closeBraceToken) { - return new ObjectTypeSyntax(openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - ObjectTypeSyntax.create1 = function () { - return new ObjectTypeSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ObjectTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectTypeSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.typeMembers, this.closeBraceToken); - }; - - ObjectTypeSyntax.prototype.withTypeMembers = function (typeMembers) { - return this.update(this.openBraceToken, typeMembers, this.closeBraceToken); - }; - - ObjectTypeSyntax.prototype.withTypeMember = function (typeMember) { - return this.withTypeMembers(TypeScript.Syntax.separatedList([typeMember])); - }; - - ObjectTypeSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.typeMembers, closeBraceToken); - }; - - ObjectTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectTypeSyntax = ObjectTypeSyntax; - - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(type, openBracketToken, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.type = type; - this.openBracketToken = openBracketToken; - this.closeBracketToken = closeBracketToken; - } - ArrayTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitArrayType(this); - }; - - ArrayTypeSyntax.prototype.kind = function () { - return 124 /* ArrayType */; - }; - - ArrayTypeSyntax.prototype.childCount = function () { - return 3; - }; - - ArrayTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.type; - case 1: - return this.openBracketToken; - case 2: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArrayTypeSyntax.prototype.isType = function () { - return true; - }; - - ArrayTypeSyntax.prototype.update = function (type, openBracketToken, closeBracketToken) { - if (this.type === type && this.openBracketToken === openBracketToken && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ArrayTypeSyntax(type, openBracketToken, closeBracketToken, this.parsedInStrictMode()); - }; - - ArrayTypeSyntax.create1 = function (type) { - return new ArrayTypeSyntax(type, TypeScript.Syntax.token(74 /* OpenBracketToken */), TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ArrayTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArrayTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArrayTypeSyntax.prototype.withType = function (type) { - return this.update(type, this.openBracketToken, this.closeBracketToken); - }; - - ArrayTypeSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(this.type, openBracketToken, this.closeBracketToken); - }; - - ArrayTypeSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.type, this.openBracketToken, closeBracketToken); - }; - - ArrayTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArrayTypeSyntax = ArrayTypeSyntax; - - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(name, typeArgumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.name = name; - this.typeArgumentList = typeArgumentList; - } - GenericTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitGenericType(this); - }; - - GenericTypeSyntax.prototype.kind = function () { - return 126 /* GenericType */; - }; - - GenericTypeSyntax.prototype.childCount = function () { - return 2; - }; - - GenericTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.name; - case 1: - return this.typeArgumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - GenericTypeSyntax.prototype.isType = function () { - return true; - }; - - GenericTypeSyntax.prototype.update = function (name, typeArgumentList) { - if (this.name === name && this.typeArgumentList === typeArgumentList) { - return this; - } - - return new GenericTypeSyntax(name, typeArgumentList, this.parsedInStrictMode()); - }; - - GenericTypeSyntax.create1 = function (name) { - return new GenericTypeSyntax(name, TypeArgumentListSyntax.create1(), false); - }; - - GenericTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - GenericTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - GenericTypeSyntax.prototype.withName = function (name) { - return this.update(name, this.typeArgumentList); - }; - - GenericTypeSyntax.prototype.withTypeArgumentList = function (typeArgumentList) { - return this.update(this.name, typeArgumentList); - }; - - GenericTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.GenericTypeSyntax = GenericTypeSyntax; - - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(typeOfKeyword, name, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeOfKeyword = typeOfKeyword; - this.name = name; - } - TypeQuerySyntax.prototype.accept = function (visitor) { - return visitor.visitTypeQuery(this); - }; - - TypeQuerySyntax.prototype.kind = function () { - return 127 /* TypeQuery */; - }; - - TypeQuerySyntax.prototype.childCount = function () { - return 2; - }; - - TypeQuerySyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeOfKeyword; - case 1: - return this.name; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeQuerySyntax.prototype.isType = function () { - return true; - }; - - TypeQuerySyntax.prototype.update = function (typeOfKeyword, name) { - if (this.typeOfKeyword === typeOfKeyword && this.name === name) { - return this; - } - - return new TypeQuerySyntax(typeOfKeyword, name, this.parsedInStrictMode()); - }; - - TypeQuerySyntax.create1 = function (name) { - return new TypeQuerySyntax(TypeScript.Syntax.token(39 /* TypeOfKeyword */), name, false); - }; - - TypeQuerySyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeQuerySyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeQuerySyntax.prototype.withTypeOfKeyword = function (typeOfKeyword) { - return this.update(typeOfKeyword, this.name); - }; - - TypeQuerySyntax.prototype.withName = function (name) { - return this.update(this.typeOfKeyword, name); - }; - - TypeQuerySyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeQuerySyntax = TypeQuerySyntax; - - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(colonToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.colonToken = colonToken; - this.type = type; - } - TypeAnnotationSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeAnnotation(this); - }; - - TypeAnnotationSyntax.prototype.kind = function () { - return 244 /* TypeAnnotation */; - }; - - TypeAnnotationSyntax.prototype.childCount = function () { - return 2; - }; - - TypeAnnotationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.colonToken; - case 1: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeAnnotationSyntax.prototype.update = function (colonToken, type) { - if (this.colonToken === colonToken && this.type === type) { - return this; - } - - return new TypeAnnotationSyntax(colonToken, type, this.parsedInStrictMode()); - }; - - TypeAnnotationSyntax.create1 = function (type) { - return new TypeAnnotationSyntax(TypeScript.Syntax.token(106 /* ColonToken */), type, false); - }; - - TypeAnnotationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeAnnotationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeAnnotationSyntax.prototype.withColonToken = function (colonToken) { - return this.update(colonToken, this.type); - }; - - TypeAnnotationSyntax.prototype.withType = function (type) { - return this.update(this.colonToken, type); - }; - - TypeAnnotationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeAnnotationSyntax = TypeAnnotationSyntax; - - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(openBraceToken, statements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.statements = statements; - this.closeBraceToken = closeBraceToken; - } - BlockSyntax.prototype.accept = function (visitor) { - return visitor.visitBlock(this); - }; - - BlockSyntax.prototype.kind = function () { - return 146 /* Block */; - }; - - BlockSyntax.prototype.childCount = function () { - return 3; - }; - - BlockSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.statements; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BlockSyntax.prototype.isStatement = function () { - return true; - }; - - BlockSyntax.prototype.isModuleElement = function () { - return true; - }; - - BlockSyntax.prototype.update = function (openBraceToken, statements, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.statements === statements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new BlockSyntax(openBraceToken, statements, closeBraceToken, this.parsedInStrictMode()); - }; - - BlockSyntax.create = function (openBraceToken, closeBraceToken) { - return new BlockSyntax(openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - BlockSyntax.create1 = function () { - return new BlockSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - BlockSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BlockSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BlockSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.statements, this.closeBraceToken); - }; - - BlockSyntax.prototype.withStatements = function (statements) { - return this.update(this.openBraceToken, statements, this.closeBraceToken); - }; - - BlockSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - BlockSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.statements, closeBraceToken); - }; - - BlockSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return BlockSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BlockSyntax = BlockSyntax; - - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.dotDotDotToken = dotDotDotToken; - this.modifiers = modifiers; - this.identifier = identifier; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - } - ParameterSyntax.prototype.accept = function (visitor) { - return visitor.visitParameter(this); - }; - - ParameterSyntax.prototype.kind = function () { - return 242 /* Parameter */; - }; - - ParameterSyntax.prototype.childCount = function () { - return 6; - }; - - ParameterSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.dotDotDotToken; - case 1: - return this.modifiers; - case 2: - return this.identifier; - case 3: - return this.questionToken; - case 4: - return this.typeAnnotation; - case 5: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParameterSyntax.prototype.update = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - if (this.dotDotDotToken === dotDotDotToken && this.modifiers === modifiers && this.identifier === identifier && this.questionToken === questionToken && this.typeAnnotation === typeAnnotation && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, this.parsedInStrictMode()); - }; - - ParameterSyntax.create = function (identifier) { - return new ParameterSyntax(null, TypeScript.Syntax.emptyList, identifier, null, null, null, false); - }; - - ParameterSyntax.create1 = function (identifier) { - return new ParameterSyntax(null, TypeScript.Syntax.emptyList, identifier, null, null, null, false); - }; - - ParameterSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParameterSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParameterSyntax.prototype.withDotDotDotToken = function (dotDotDotToken) { - return this.update(dotDotDotToken, this.modifiers, this.identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withModifiers = function (modifiers) { - return this.update(this.dotDotDotToken, modifiers, this.identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ParameterSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.dotDotDotToken, this.modifiers, identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, this.questionToken, typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, this.questionToken, this.typeAnnotation, equalsValueClause); - }; - - ParameterSyntax.prototype.isTypeScriptSpecific = function () { - if (this.dotDotDotToken !== null) { - return true; - } - if (this.modifiers.isTypeScriptSpecific()) { - return true; - } - if (this.questionToken !== null) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - if (this.equalsValueClause !== null) { - return true; - } - return false; - }; - return ParameterSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParameterSyntax = ParameterSyntax; - - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(expression, dotToken, name, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.dotToken = dotToken; - this.name = name; - } - MemberAccessExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberAccessExpression(this); - }; - - MemberAccessExpressionSyntax.prototype.kind = function () { - return 212 /* MemberAccessExpression */; - }; - - MemberAccessExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - MemberAccessExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.dotToken; - case 2: - return this.name; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberAccessExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.update = function (expression, dotToken, name) { - if (this.expression === expression && this.dotToken === dotToken && this.name === name) { - return this; - } - - return new MemberAccessExpressionSyntax(expression, dotToken, name, this.parsedInStrictMode()); - }; - - MemberAccessExpressionSyntax.create1 = function (expression, name) { - return new MemberAccessExpressionSyntax(expression, TypeScript.Syntax.token(76 /* DotToken */), name, false); - }; - - MemberAccessExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberAccessExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberAccessExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.dotToken, this.name); - }; - - MemberAccessExpressionSyntax.prototype.withDotToken = function (dotToken) { - return this.update(this.expression, dotToken, this.name); - }; - - MemberAccessExpressionSyntax.prototype.withName = function (name) { - return this.update(this.expression, this.dotToken, name); - }; - - MemberAccessExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(kind, operand, operatorToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.operand = operand; - this.operatorToken = operatorToken; - - this._kind = kind; - } - PostfixUnaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitPostfixUnaryExpression(this); - }; - - PostfixUnaryExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - PostfixUnaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.operand; - case 1: - return this.operatorToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PostfixUnaryExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - PostfixUnaryExpressionSyntax.prototype.update = function (kind, operand, operatorToken) { - if (this._kind === kind && this.operand === operand && this.operatorToken === operatorToken) { - return this; - } - - return new PostfixUnaryExpressionSyntax(kind, operand, operatorToken, this.parsedInStrictMode()); - }; - - PostfixUnaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PostfixUnaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PostfixUnaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.operand, this.operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.withOperand = function (operand) { - return this.update(this._kind, operand, this.operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, this.operand, operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.operand.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.openBracketToken = openBracketToken; - this.argumentExpression = argumentExpression; - this.closeBracketToken = closeBracketToken; - } - ElementAccessExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitElementAccessExpression(this); - }; - - ElementAccessExpressionSyntax.prototype.kind = function () { - return 221 /* ElementAccessExpression */; - }; - - ElementAccessExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - ElementAccessExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.openBracketToken; - case 2: - return this.argumentExpression; - case 3: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ElementAccessExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.update = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - if (this.expression === expression && this.openBracketToken === openBracketToken && this.argumentExpression === argumentExpression && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, this.parsedInStrictMode()); - }; - - ElementAccessExpressionSyntax.create1 = function (expression, argumentExpression) { - return new ElementAccessExpressionSyntax(expression, TypeScript.Syntax.token(74 /* OpenBracketToken */), argumentExpression, TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ElementAccessExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ElementAccessExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ElementAccessExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.openBracketToken, this.argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(this.expression, openBracketToken, this.argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withArgumentExpression = function (argumentExpression) { - return this.update(this.expression, this.openBracketToken, argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.expression, this.openBracketToken, this.argumentExpression, closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentExpression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(expression, argumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.argumentList = argumentList; - } - InvocationExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitInvocationExpression(this); - }; - - InvocationExpressionSyntax.prototype.kind = function () { - return 213 /* InvocationExpression */; - }; - - InvocationExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - InvocationExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.argumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - InvocationExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.update = function (expression, argumentList) { - if (this.expression === expression && this.argumentList === argumentList) { - return this; - } - - return new InvocationExpressionSyntax(expression, argumentList, this.parsedInStrictMode()); - }; - - InvocationExpressionSyntax.create1 = function (expression) { - return new InvocationExpressionSyntax(expression, ArgumentListSyntax.create1(), false); - }; - - InvocationExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - InvocationExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - InvocationExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.argumentList); - }; - - InvocationExpressionSyntax.prototype.withArgumentList = function (argumentList) { - return this.update(this.expression, argumentList); - }; - - InvocationExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentList.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.InvocationExpressionSyntax = InvocationExpressionSyntax; - - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeArgumentList = typeArgumentList; - this.openParenToken = openParenToken; - this.closeParenToken = closeParenToken; - - this.arguments = _arguments; - } - ArgumentListSyntax.prototype.accept = function (visitor) { - return visitor.visitArgumentList(this); - }; - - ArgumentListSyntax.prototype.kind = function () { - return 226 /* ArgumentList */; - }; - - ArgumentListSyntax.prototype.childCount = function () { - return 4; - }; - - ArgumentListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeArgumentList; - case 1: - return this.openParenToken; - case 2: - return this.arguments; - case 3: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArgumentListSyntax.prototype.update = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - if (this.typeArgumentList === typeArgumentList && this.openParenToken === openParenToken && this.arguments === _arguments && this.closeParenToken === closeParenToken) { - return this; - } - - return new ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, this.parsedInStrictMode()); - }; - - ArgumentListSyntax.create = function (openParenToken, closeParenToken) { - return new ArgumentListSyntax(null, openParenToken, TypeScript.Syntax.emptySeparatedList, closeParenToken, false); - }; - - ArgumentListSyntax.create1 = function () { - return new ArgumentListSyntax(null, TypeScript.Syntax.token(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ArgumentListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArgumentListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArgumentListSyntax.prototype.withTypeArgumentList = function (typeArgumentList) { - return this.update(typeArgumentList, this.openParenToken, this.arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.typeArgumentList, openParenToken, this.arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withArguments = function (_arguments) { - return this.update(this.typeArgumentList, this.openParenToken, _arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withArgument = function (_argument) { - return this.withArguments(TypeScript.Syntax.separatedList([_argument])); - }; - - ArgumentListSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.typeArgumentList, this.openParenToken, this.arguments, closeParenToken); - }; - - ArgumentListSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeArgumentList !== null && this.typeArgumentList.isTypeScriptSpecific()) { - return true; - } - if (this.arguments.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArgumentListSyntax = ArgumentListSyntax; - - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(kind, left, operatorToken, right, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.left = left; - this.operatorToken = operatorToken; - this.right = right; - - this._kind = kind; - } - BinaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitBinaryExpression(this); - }; - - BinaryExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - BinaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.left; - case 1: - return this.operatorToken; - case 2: - return this.right; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BinaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - BinaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - BinaryExpressionSyntax.prototype.update = function (kind, left, operatorToken, right) { - if (this._kind === kind && this.left === left && this.operatorToken === operatorToken && this.right === right) { - return this; - } - - return new BinaryExpressionSyntax(kind, left, operatorToken, right, this.parsedInStrictMode()); - }; - - BinaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BinaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BinaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.left, this.operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withLeft = function (left) { - return this.update(this._kind, left, this.operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, this.left, operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withRight = function (right) { - return this.update(this._kind, this.left, this.operatorToken, right); - }; - - BinaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.left.isTypeScriptSpecific()) { - return true; - } - if (this.right.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BinaryExpressionSyntax = BinaryExpressionSyntax; - - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.condition = condition; - this.questionToken = questionToken; - this.whenTrue = whenTrue; - this.colonToken = colonToken; - this.whenFalse = whenFalse; - } - ConditionalExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitConditionalExpression(this); - }; - - ConditionalExpressionSyntax.prototype.kind = function () { - return 186 /* ConditionalExpression */; - }; - - ConditionalExpressionSyntax.prototype.childCount = function () { - return 5; - }; - - ConditionalExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.condition; - case 1: - return this.questionToken; - case 2: - return this.whenTrue; - case 3: - return this.colonToken; - case 4: - return this.whenFalse; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConditionalExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ConditionalExpressionSyntax.prototype.update = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - if (this.condition === condition && this.questionToken === questionToken && this.whenTrue === whenTrue && this.colonToken === colonToken && this.whenFalse === whenFalse) { - return this; - } - - return new ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, this.parsedInStrictMode()); - }; - - ConditionalExpressionSyntax.create1 = function (condition, whenTrue, whenFalse) { - return new ConditionalExpressionSyntax(condition, TypeScript.Syntax.token(105 /* QuestionToken */), whenTrue, TypeScript.Syntax.token(106 /* ColonToken */), whenFalse, false); - }; - - ConditionalExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConditionalExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConditionalExpressionSyntax.prototype.withCondition = function (condition) { - return this.update(condition, this.questionToken, this.whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.condition, questionToken, this.whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withWhenTrue = function (whenTrue) { - return this.update(this.condition, this.questionToken, whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.condition, this.questionToken, this.whenTrue, colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withWhenFalse = function (whenFalse) { - return this.update(this.condition, this.questionToken, this.whenTrue, this.colonToken, whenFalse); - }; - - ConditionalExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.whenTrue.isTypeScriptSpecific()) { - return true; - } - if (this.whenFalse.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(newKeyword, callSignature, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.callSignature = callSignature; - } - ConstructSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructSignature(this); - }; - - ConstructSignatureSyntax.prototype.kind = function () { - return 143 /* ConstructSignature */; - }; - - ConstructSignatureSyntax.prototype.childCount = function () { - return 2; - }; - - ConstructSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.callSignature; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - ConstructSignatureSyntax.prototype.update = function (newKeyword, callSignature) { - if (this.newKeyword === newKeyword && this.callSignature === callSignature) { - return this; - } - - return new ConstructSignatureSyntax(newKeyword, callSignature, this.parsedInStrictMode()); - }; - - ConstructSignatureSyntax.create1 = function () { - return new ConstructSignatureSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), CallSignatureSyntax.create1(), false); - }; - - ConstructSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructSignatureSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.callSignature); - }; - - ConstructSignatureSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.newKeyword, callSignature); - }; - - ConstructSignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructSignatureSyntax = ConstructSignatureSyntax; - - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(propertyName, questionToken, callSignature, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.callSignature = callSignature; - } - MethodSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitMethodSignature(this); - }; - - MethodSignatureSyntax.prototype.kind = function () { - return 145 /* MethodSignature */; - }; - - MethodSignatureSyntax.prototype.childCount = function () { - return 3; - }; - - MethodSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.questionToken; - case 2: - return this.callSignature; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MethodSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - MethodSignatureSyntax.prototype.update = function (propertyName, questionToken, callSignature) { - if (this.propertyName === propertyName && this.questionToken === questionToken && this.callSignature === callSignature) { - return this; - } - - return new MethodSignatureSyntax(propertyName, questionToken, callSignature, this.parsedInStrictMode()); - }; - - MethodSignatureSyntax.create = function (propertyName, callSignature) { - return new MethodSignatureSyntax(propertyName, null, callSignature, false); - }; - - MethodSignatureSyntax.create1 = function (propertyName) { - return new MethodSignatureSyntax(propertyName, null, CallSignatureSyntax.create1(), false); - }; - - MethodSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MethodSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MethodSignatureSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.questionToken, this.callSignature); - }; - - MethodSignatureSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.propertyName, questionToken, this.callSignature); - }; - - MethodSignatureSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.propertyName, this.questionToken, callSignature); - }; - - MethodSignatureSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MethodSignatureSyntax = MethodSignatureSyntax; - - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBracketToken = openBracketToken; - this.parameter = parameter; - this.closeBracketToken = closeBracketToken; - this.typeAnnotation = typeAnnotation; - } - IndexSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitIndexSignature(this); - }; - - IndexSignatureSyntax.prototype.kind = function () { - return 144 /* IndexSignature */; - }; - - IndexSignatureSyntax.prototype.childCount = function () { - return 4; - }; - - IndexSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBracketToken; - case 1: - return this.parameter; - case 2: - return this.closeBracketToken; - case 3: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IndexSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - IndexSignatureSyntax.prototype.update = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - if (this.openBracketToken === openBracketToken && this.parameter === parameter && this.closeBracketToken === closeBracketToken && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, this.parsedInStrictMode()); - }; - - IndexSignatureSyntax.create = function (openBracketToken, parameter, closeBracketToken) { - return new IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, null, false); - }; - - IndexSignatureSyntax.create1 = function (parameter) { - return new IndexSignatureSyntax(TypeScript.Syntax.token(74 /* OpenBracketToken */), parameter, TypeScript.Syntax.token(75 /* CloseBracketToken */), null, false); - }; - - IndexSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IndexSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IndexSignatureSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(openBracketToken, this.parameter, this.closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withParameter = function (parameter) { - return this.update(this.openBracketToken, parameter, this.closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.openBracketToken, this.parameter, closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.openBracketToken, this.parameter, this.closeBracketToken, typeAnnotation); - }; - - IndexSignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IndexSignatureSyntax = IndexSignatureSyntax; - - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - } - PropertySignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitPropertySignature(this); - }; - - PropertySignatureSyntax.prototype.kind = function () { - return 141 /* PropertySignature */; - }; - - PropertySignatureSyntax.prototype.childCount = function () { - return 3; - }; - - PropertySignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.questionToken; - case 2: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PropertySignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - PropertySignatureSyntax.prototype.update = function (propertyName, questionToken, typeAnnotation) { - if (this.propertyName === propertyName && this.questionToken === questionToken && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, this.parsedInStrictMode()); - }; - - PropertySignatureSyntax.create = function (propertyName) { - return new PropertySignatureSyntax(propertyName, null, null, false); - }; - - PropertySignatureSyntax.create1 = function (propertyName) { - return new PropertySignatureSyntax(propertyName, null, null, false); - }; - - PropertySignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PropertySignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PropertySignatureSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.questionToken, this.typeAnnotation); - }; - - PropertySignatureSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.propertyName, questionToken, this.typeAnnotation); - }; - - PropertySignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.propertyName, this.questionToken, typeAnnotation); - }; - - PropertySignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PropertySignatureSyntax = PropertySignatureSyntax; - - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - } - CallSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitCallSignature(this); - }; - - CallSignatureSyntax.prototype.kind = function () { - return 142 /* CallSignature */; - }; - - CallSignatureSyntax.prototype.childCount = function () { - return 3; - }; - - CallSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeParameterList; - case 1: - return this.parameterList; - case 2: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CallSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - CallSignatureSyntax.prototype.update = function (typeParameterList, parameterList, typeAnnotation) { - if (this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, this.parsedInStrictMode()); - }; - - CallSignatureSyntax.create = function (parameterList) { - return new CallSignatureSyntax(null, parameterList, null, false); - }; - - CallSignatureSyntax.create1 = function () { - return new CallSignatureSyntax(null, ParameterListSyntax.create1(), null, false); - }; - - CallSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CallSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CallSignatureSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(typeParameterList, this.parameterList, this.typeAnnotation); - }; - - CallSignatureSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.typeParameterList, parameterList, this.typeAnnotation); - }; - - CallSignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.typeParameterList, this.parameterList, typeAnnotation); - }; - - CallSignatureSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeParameterList !== null) { - return true; - } - if (this.parameterList.isTypeScriptSpecific()) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - return false; - }; - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CallSignatureSyntax = CallSignatureSyntax; - - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(openParenToken, parameters, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openParenToken = openParenToken; - this.parameters = parameters; - this.closeParenToken = closeParenToken; - } - ParameterListSyntax.prototype.accept = function (visitor) { - return visitor.visitParameterList(this); - }; - - ParameterListSyntax.prototype.kind = function () { - return 227 /* ParameterList */; - }; - - ParameterListSyntax.prototype.childCount = function () { - return 3; - }; - - ParameterListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openParenToken; - case 1: - return this.parameters; - case 2: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParameterListSyntax.prototype.update = function (openParenToken, parameters, closeParenToken) { - if (this.openParenToken === openParenToken && this.parameters === parameters && this.closeParenToken === closeParenToken) { - return this; - } - - return new ParameterListSyntax(openParenToken, parameters, closeParenToken, this.parsedInStrictMode()); - }; - - ParameterListSyntax.create = function (openParenToken, closeParenToken) { - return new ParameterListSyntax(openParenToken, TypeScript.Syntax.emptySeparatedList, closeParenToken, false); - }; - - ParameterListSyntax.create1 = function () { - return new ParameterListSyntax(TypeScript.Syntax.token(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ParameterListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParameterListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParameterListSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(openParenToken, this.parameters, this.closeParenToken); - }; - - ParameterListSyntax.prototype.withParameters = function (parameters) { - return this.update(this.openParenToken, parameters, this.closeParenToken); - }; - - ParameterListSyntax.prototype.withParameter = function (parameter) { - return this.withParameters(TypeScript.Syntax.separatedList([parameter])); - }; - - ParameterListSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.openParenToken, this.parameters, closeParenToken); - }; - - ParameterListSyntax.prototype.isTypeScriptSpecific = function () { - if (this.parameters.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParameterListSyntax = ParameterListSyntax; - - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.typeParameters = typeParameters; - this.greaterThanToken = greaterThanToken; - } - TypeParameterListSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeParameterList(this); - }; - - TypeParameterListSyntax.prototype.kind = function () { - return 229 /* TypeParameterList */; - }; - - TypeParameterListSyntax.prototype.childCount = function () { - return 3; - }; - - TypeParameterListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.typeParameters; - case 2: - return this.greaterThanToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeParameterListSyntax.prototype.update = function (lessThanToken, typeParameters, greaterThanToken) { - if (this.lessThanToken === lessThanToken && this.typeParameters === typeParameters && this.greaterThanToken === greaterThanToken) { - return this; - } - - return new TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, this.parsedInStrictMode()); - }; - - TypeParameterListSyntax.create = function (lessThanToken, greaterThanToken) { - return new TypeParameterListSyntax(lessThanToken, TypeScript.Syntax.emptySeparatedList, greaterThanToken, false); - }; - - TypeParameterListSyntax.create1 = function () { - return new TypeParameterListSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(81 /* GreaterThanToken */), false); - }; - - TypeParameterListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeParameterListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeParameterListSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.typeParameters, this.greaterThanToken); - }; - - TypeParameterListSyntax.prototype.withTypeParameters = function (typeParameters) { - return this.update(this.lessThanToken, typeParameters, this.greaterThanToken); - }; - - TypeParameterListSyntax.prototype.withTypeParameter = function (typeParameter) { - return this.withTypeParameters(TypeScript.Syntax.separatedList([typeParameter])); - }; - - TypeParameterListSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.typeParameters, greaterThanToken); - }; - - TypeParameterListSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeParameterListSyntax = TypeParameterListSyntax; - - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(identifier, constraint, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.constraint = constraint; - } - TypeParameterSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeParameter(this); - }; - - TypeParameterSyntax.prototype.kind = function () { - return 238 /* TypeParameter */; - }; - - TypeParameterSyntax.prototype.childCount = function () { - return 2; - }; - - TypeParameterSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.constraint; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeParameterSyntax.prototype.update = function (identifier, constraint) { - if (this.identifier === identifier && this.constraint === constraint) { - return this; - } - - return new TypeParameterSyntax(identifier, constraint, this.parsedInStrictMode()); - }; - - TypeParameterSyntax.create = function (identifier) { - return new TypeParameterSyntax(identifier, null, false); - }; - - TypeParameterSyntax.create1 = function (identifier) { - return new TypeParameterSyntax(identifier, null, false); - }; - - TypeParameterSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeParameterSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeParameterSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.constraint); - }; - - TypeParameterSyntax.prototype.withConstraint = function (constraint) { - return this.update(this.identifier, constraint); - }; - - TypeParameterSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeParameterSyntax = TypeParameterSyntax; - - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(extendsKeyword, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.extendsKeyword = extendsKeyword; - this.type = type; - } - ConstraintSyntax.prototype.accept = function (visitor) { - return visitor.visitConstraint(this); - }; - - ConstraintSyntax.prototype.kind = function () { - return 239 /* Constraint */; - }; - - ConstraintSyntax.prototype.childCount = function () { - return 2; - }; - - ConstraintSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.extendsKeyword; - case 1: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstraintSyntax.prototype.update = function (extendsKeyword, type) { - if (this.extendsKeyword === extendsKeyword && this.type === type) { - return this; - } - - return new ConstraintSyntax(extendsKeyword, type, this.parsedInStrictMode()); - }; - - ConstraintSyntax.create1 = function (type) { - return new ConstraintSyntax(TypeScript.Syntax.token(48 /* ExtendsKeyword */), type, false); - }; - - ConstraintSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstraintSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstraintSyntax.prototype.withExtendsKeyword = function (extendsKeyword) { - return this.update(extendsKeyword, this.type); - }; - - ConstraintSyntax.prototype.withType = function (type) { - return this.update(this.extendsKeyword, type); - }; - - ConstraintSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstraintSyntax = ConstraintSyntax; - - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(elseKeyword, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.elseKeyword = elseKeyword; - this.statement = statement; - } - ElseClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitElseClause(this); - }; - - ElseClauseSyntax.prototype.kind = function () { - return 235 /* ElseClause */; - }; - - ElseClauseSyntax.prototype.childCount = function () { - return 2; - }; - - ElseClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.elseKeyword; - case 1: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ElseClauseSyntax.prototype.update = function (elseKeyword, statement) { - if (this.elseKeyword === elseKeyword && this.statement === statement) { - return this; - } - - return new ElseClauseSyntax(elseKeyword, statement, this.parsedInStrictMode()); - }; - - ElseClauseSyntax.create1 = function (statement) { - return new ElseClauseSyntax(TypeScript.Syntax.token(23 /* ElseKeyword */), statement, false); - }; - - ElseClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ElseClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ElseClauseSyntax.prototype.withElseKeyword = function (elseKeyword) { - return this.update(elseKeyword, this.statement); - }; - - ElseClauseSyntax.prototype.withStatement = function (statement) { - return this.update(this.elseKeyword, statement); - }; - - ElseClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ElseClauseSyntax = ElseClauseSyntax; - - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.ifKeyword = ifKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - this.elseClause = elseClause; - } - IfStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitIfStatement(this); - }; - - IfStatementSyntax.prototype.kind = function () { - return 147 /* IfStatement */; - }; - - IfStatementSyntax.prototype.childCount = function () { - return 6; - }; - - IfStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.ifKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - case 5: - return this.elseClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IfStatementSyntax.prototype.isStatement = function () { - return true; - }; - - IfStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - IfStatementSyntax.prototype.update = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - if (this.ifKeyword === ifKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement && this.elseClause === elseClause) { - return this; - } - - return new IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, this.parsedInStrictMode()); - }; - - IfStatementSyntax.create = function (ifKeyword, openParenToken, condition, closeParenToken, statement) { - return new IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, null, false); - }; - - IfStatementSyntax.create1 = function (condition, statement) { - return new IfStatementSyntax(TypeScript.Syntax.token(28 /* IfKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, null, false); - }; - - IfStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IfStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IfStatementSyntax.prototype.withIfKeyword = function (ifKeyword) { - return this.update(ifKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.ifKeyword, openParenToken, this.condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.ifKeyword, this.openParenToken, condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, this.closeParenToken, statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withElseClause = function (elseClause) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement, elseClause); - }; - - IfStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - if (this.elseClause !== null && this.elseClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IfStatementSyntax = IfStatementSyntax; - - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ExpressionStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitExpressionStatement(this); - }; - - ExpressionStatementSyntax.prototype.kind = function () { - return 149 /* ExpressionStatement */; - }; - - ExpressionStatementSyntax.prototype.childCount = function () { - return 2; - }; - - ExpressionStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExpressionStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ExpressionStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ExpressionStatementSyntax.prototype.update = function (expression, semicolonToken) { - if (this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ExpressionStatementSyntax(expression, semicolonToken, this.parsedInStrictMode()); - }; - - ExpressionStatementSyntax.create1 = function (expression) { - return new ExpressionStatementSyntax(expression, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ExpressionStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExpressionStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExpressionStatementSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.semicolonToken); - }; - - ExpressionStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.expression, semicolonToken); - }; - - ExpressionStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExpressionStatementSyntax = ExpressionStatementSyntax; - - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.constructorKeyword = constructorKeyword; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - ConstructorDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructorDeclaration(this); - }; - - ConstructorDeclarationSyntax.prototype.kind = function () { - return 137 /* ConstructorDeclaration */; - }; - - ConstructorDeclarationSyntax.prototype.childCount = function () { - return 5; - }; - - ConstructorDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.constructorKeyword; - case 2: - return this.callSignature; - case 3: - return this.block; - case 4: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructorDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - ConstructorDeclarationSyntax.prototype.update = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.constructorKeyword === constructorKeyword && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - ConstructorDeclarationSyntax.create = function (constructorKeyword, callSignature) { - return new ConstructorDeclarationSyntax(TypeScript.Syntax.emptyList, constructorKeyword, callSignature, null, null, false); - }; - - ConstructorDeclarationSyntax.create1 = function () { - return new ConstructorDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(62 /* ConstructorKeyword */), CallSignatureSyntax.create1(), null, null, false); - }; - - ConstructorDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructorDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructorDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.constructorKeyword, this.callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ConstructorDeclarationSyntax.prototype.withConstructorKeyword = function (constructorKeyword) { - return this.update(this.modifiers, constructorKeyword, this.callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.constructorKeyword, callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.constructorKeyword, this.callSignature, block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.constructorKeyword, this.callSignature, this.block, semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - MemberFunctionDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberFunctionDeclaration(this); - }; - - MemberFunctionDeclarationSyntax.prototype.kind = function () { - return 135 /* MemberFunctionDeclaration */; - }; - - MemberFunctionDeclarationSyntax.prototype.childCount = function () { - return 5; - }; - - MemberFunctionDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.propertyName; - case 2: - return this.callSignature; - case 3: - return this.block; - case 4: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberFunctionDeclarationSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - MemberFunctionDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - MemberFunctionDeclarationSyntax.prototype.update = function (modifiers, propertyName, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.propertyName === propertyName && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - MemberFunctionDeclarationSyntax.create = function (propertyName, callSignature) { - return new MemberFunctionDeclarationSyntax(TypeScript.Syntax.emptyList, propertyName, callSignature, null, null, false); - }; - - MemberFunctionDeclarationSyntax.create1 = function (propertyName) { - return new MemberFunctionDeclarationSyntax(TypeScript.Syntax.emptyList, propertyName, CallSignatureSyntax.create1(), null, null, false); - }; - - MemberFunctionDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberFunctionDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberFunctionDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.propertyName, this.callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - MemberFunctionDeclarationSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, propertyName, this.callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.propertyName, callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.propertyName, this.callSignature, block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.propertyName, this.callSignature, this.block, semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.getKeyword = getKeyword; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - this.block = block; - } - GetAccessorSyntax.prototype.accept = function (visitor) { - return visitor.visitGetAccessor(this); - }; - - GetAccessorSyntax.prototype.kind = function () { - return 139 /* GetAccessor */; - }; - - GetAccessorSyntax.prototype.childCount = function () { - return 6; - }; - - GetAccessorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.getKeyword; - case 2: - return this.propertyName; - case 3: - return this.parameterList; - case 4: - return this.typeAnnotation; - case 5: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - GetAccessorSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - GetAccessorSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - GetAccessorSyntax.prototype.isClassElement = function () { - return true; - }; - - GetAccessorSyntax.prototype.update = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - if (this.modifiers === modifiers && this.getKeyword === getKeyword && this.propertyName === propertyName && this.parameterList === parameterList && this.typeAnnotation === typeAnnotation && this.block === block) { - return this; - } - - return new GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, this.parsedInStrictMode()); - }; - - GetAccessorSyntax.create = function (getKeyword, propertyName, parameterList, block) { - return new GetAccessorSyntax(TypeScript.Syntax.emptyList, getKeyword, propertyName, parameterList, null, block, false); - }; - - GetAccessorSyntax.create1 = function (propertyName) { - return new GetAccessorSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(64 /* GetKeyword */), propertyName, ParameterListSyntax.create1(), null, BlockSyntax.create1(), false); - }; - - GetAccessorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - GetAccessorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - GetAccessorSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - GetAccessorSyntax.prototype.withGetKeyword = function (getKeyword) { - return this.update(this.modifiers, getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, this.getKeyword, propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, this.parameterList, typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, block); - }; - - GetAccessorSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.parameterList.isTypeScriptSpecific()) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.GetAccessorSyntax = GetAccessorSyntax; - - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.setKeyword = setKeyword; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.block = block; - } - SetAccessorSyntax.prototype.accept = function (visitor) { - return visitor.visitSetAccessor(this); - }; - - SetAccessorSyntax.prototype.kind = function () { - return 140 /* SetAccessor */; - }; - - SetAccessorSyntax.prototype.childCount = function () { - return 5; - }; - - SetAccessorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.setKeyword; - case 2: - return this.propertyName; - case 3: - return this.parameterList; - case 4: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SetAccessorSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - SetAccessorSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - SetAccessorSyntax.prototype.isClassElement = function () { - return true; - }; - - SetAccessorSyntax.prototype.update = function (modifiers, setKeyword, propertyName, parameterList, block) { - if (this.modifiers === modifiers && this.setKeyword === setKeyword && this.propertyName === propertyName && this.parameterList === parameterList && this.block === block) { - return this; - } - - return new SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, this.parsedInStrictMode()); - }; - - SetAccessorSyntax.create = function (setKeyword, propertyName, parameterList, block) { - return new SetAccessorSyntax(TypeScript.Syntax.emptyList, setKeyword, propertyName, parameterList, block, false); - }; - - SetAccessorSyntax.create1 = function (propertyName) { - return new SetAccessorSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(68 /* SetKeyword */), propertyName, ParameterListSyntax.create1(), BlockSyntax.create1(), false); - }; - - SetAccessorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SetAccessorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SetAccessorSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.setKeyword, this.propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - SetAccessorSyntax.prototype.withSetKeyword = function (setKeyword) { - return this.update(this.modifiers, setKeyword, this.propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, this.setKeyword, propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.modifiers, this.setKeyword, this.propertyName, parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.setKeyword, this.propertyName, this.parameterList, block); - }; - - SetAccessorSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SetAccessorSyntax = SetAccessorSyntax; - - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.variableDeclarator = variableDeclarator; - this.semicolonToken = semicolonToken; - } - MemberVariableDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberVariableDeclaration(this); - }; - - MemberVariableDeclarationSyntax.prototype.kind = function () { - return 136 /* MemberVariableDeclaration */; - }; - - MemberVariableDeclarationSyntax.prototype.childCount = function () { - return 3; - }; - - MemberVariableDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.variableDeclarator; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberVariableDeclarationSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - MemberVariableDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - MemberVariableDeclarationSyntax.prototype.update = function (modifiers, variableDeclarator, semicolonToken) { - if (this.modifiers === modifiers && this.variableDeclarator === variableDeclarator && this.semicolonToken === semicolonToken) { - return this; - } - - return new MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, this.parsedInStrictMode()); - }; - - MemberVariableDeclarationSyntax.create = function (variableDeclarator, semicolonToken) { - return new MemberVariableDeclarationSyntax(TypeScript.Syntax.emptyList, variableDeclarator, semicolonToken, false); - }; - - MemberVariableDeclarationSyntax.create1 = function (variableDeclarator) { - return new MemberVariableDeclarationSyntax(TypeScript.Syntax.emptyList, variableDeclarator, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - MemberVariableDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberVariableDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberVariableDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.variableDeclarator, this.semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - MemberVariableDeclarationSyntax.prototype.withVariableDeclarator = function (variableDeclarator) { - return this.update(this.modifiers, variableDeclarator, this.semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.variableDeclarator, semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.indexSignature = indexSignature; - this.semicolonToken = semicolonToken; - } - IndexMemberDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitIndexMemberDeclaration(this); - }; - - IndexMemberDeclarationSyntax.prototype.kind = function () { - return 138 /* IndexMemberDeclaration */; - }; - - IndexMemberDeclarationSyntax.prototype.childCount = function () { - return 3; - }; - - IndexMemberDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.indexSignature; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IndexMemberDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - IndexMemberDeclarationSyntax.prototype.update = function (modifiers, indexSignature, semicolonToken) { - if (this.modifiers === modifiers && this.indexSignature === indexSignature && this.semicolonToken === semicolonToken) { - return this; - } - - return new IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, this.parsedInStrictMode()); - }; - - IndexMemberDeclarationSyntax.create = function (indexSignature, semicolonToken) { - return new IndexMemberDeclarationSyntax(TypeScript.Syntax.emptyList, indexSignature, semicolonToken, false); - }; - - IndexMemberDeclarationSyntax.create1 = function (indexSignature) { - return new IndexMemberDeclarationSyntax(TypeScript.Syntax.emptyList, indexSignature, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - IndexMemberDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IndexMemberDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IndexMemberDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.indexSignature, this.semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - IndexMemberDeclarationSyntax.prototype.withIndexSignature = function (indexSignature) { - return this.update(this.modifiers, indexSignature, this.semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.indexSignature, semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(throwKeyword, expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.throwKeyword = throwKeyword; - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ThrowStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitThrowStatement(this); - }; - - ThrowStatementSyntax.prototype.kind = function () { - return 157 /* ThrowStatement */; - }; - - ThrowStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ThrowStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.throwKeyword; - case 1: - return this.expression; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ThrowStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ThrowStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ThrowStatementSyntax.prototype.update = function (throwKeyword, expression, semicolonToken) { - if (this.throwKeyword === throwKeyword && this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ThrowStatementSyntax(throwKeyword, expression, semicolonToken, this.parsedInStrictMode()); - }; - - ThrowStatementSyntax.create1 = function (expression) { - return new ThrowStatementSyntax(TypeScript.Syntax.token(36 /* ThrowKeyword */), expression, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ThrowStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ThrowStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ThrowStatementSyntax.prototype.withThrowKeyword = function (throwKeyword) { - return this.update(throwKeyword, this.expression, this.semicolonToken); - }; - - ThrowStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.throwKeyword, expression, this.semicolonToken); - }; - - ThrowStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.throwKeyword, this.expression, semicolonToken); - }; - - ThrowStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ThrowStatementSyntax = ThrowStatementSyntax; - - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(returnKeyword, expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.returnKeyword = returnKeyword; - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ReturnStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitReturnStatement(this); - }; - - ReturnStatementSyntax.prototype.kind = function () { - return 150 /* ReturnStatement */; - }; - - ReturnStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ReturnStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.returnKeyword; - case 1: - return this.expression; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ReturnStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ReturnStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ReturnStatementSyntax.prototype.update = function (returnKeyword, expression, semicolonToken) { - if (this.returnKeyword === returnKeyword && this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ReturnStatementSyntax(returnKeyword, expression, semicolonToken, this.parsedInStrictMode()); - }; - - ReturnStatementSyntax.create = function (returnKeyword, semicolonToken) { - return new ReturnStatementSyntax(returnKeyword, null, semicolonToken, false); - }; - - ReturnStatementSyntax.create1 = function () { - return new ReturnStatementSyntax(TypeScript.Syntax.token(33 /* ReturnKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ReturnStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ReturnStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ReturnStatementSyntax.prototype.withReturnKeyword = function (returnKeyword) { - return this.update(returnKeyword, this.expression, this.semicolonToken); - }; - - ReturnStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.returnKeyword, expression, this.semicolonToken); - }; - - ReturnStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.returnKeyword, this.expression, semicolonToken); - }; - - ReturnStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression !== null && this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ReturnStatementSyntax = ReturnStatementSyntax; - - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.expression = expression; - this.argumentList = argumentList; - } - ObjectCreationExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectCreationExpression(this); - }; - - ObjectCreationExpressionSyntax.prototype.kind = function () { - return 216 /* ObjectCreationExpression */; - }; - - ObjectCreationExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectCreationExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.expression; - case 2: - return this.argumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectCreationExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.update = function (newKeyword, expression, argumentList) { - if (this.newKeyword === newKeyword && this.expression === expression && this.argumentList === argumentList) { - return this; - } - - return new ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, this.parsedInStrictMode()); - }; - - ObjectCreationExpressionSyntax.create = function (newKeyword, expression) { - return new ObjectCreationExpressionSyntax(newKeyword, expression, null, false); - }; - - ObjectCreationExpressionSyntax.create1 = function (expression) { - return new ObjectCreationExpressionSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), expression, null, false); - }; - - ObjectCreationExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectCreationExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectCreationExpressionSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.expression, this.argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.newKeyword, expression, this.argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.withArgumentList = function (argumentList) { - return this.update(this.newKeyword, this.expression, argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentList !== null && this.argumentList.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.switchKeyword = switchKeyword; - this.openParenToken = openParenToken; - this.expression = expression; - this.closeParenToken = closeParenToken; - this.openBraceToken = openBraceToken; - this.switchClauses = switchClauses; - this.closeBraceToken = closeBraceToken; - } - SwitchStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitSwitchStatement(this); - }; - - SwitchStatementSyntax.prototype.kind = function () { - return 151 /* SwitchStatement */; - }; - - SwitchStatementSyntax.prototype.childCount = function () { - return 7; - }; - - SwitchStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.switchKeyword; - case 1: - return this.openParenToken; - case 2: - return this.expression; - case 3: - return this.closeParenToken; - case 4: - return this.openBraceToken; - case 5: - return this.switchClauses; - case 6: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SwitchStatementSyntax.prototype.isStatement = function () { - return true; - }; - - SwitchStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - SwitchStatementSyntax.prototype.update = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - if (this.switchKeyword === switchKeyword && this.openParenToken === openParenToken && this.expression === expression && this.closeParenToken === closeParenToken && this.openBraceToken === openBraceToken && this.switchClauses === switchClauses && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, this.parsedInStrictMode()); - }; - - SwitchStatementSyntax.create = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, closeBraceToken) { - return new SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - SwitchStatementSyntax.create1 = function (expression) { - return new SwitchStatementSyntax(TypeScript.Syntax.token(34 /* SwitchKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - SwitchStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SwitchStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SwitchStatementSyntax.prototype.withSwitchKeyword = function (switchKeyword) { - return this.update(switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.switchKeyword, openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.switchKeyword, this.openParenToken, expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withSwitchClauses = function (switchClauses) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withSwitchClause = function (switchClause) { - return this.withSwitchClauses(TypeScript.Syntax.list([switchClause])); - }; - - SwitchStatementSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, closeBraceToken); - }; - - SwitchStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.switchClauses.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SwitchStatementSyntax = SwitchStatementSyntax; - - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.caseKeyword = caseKeyword; - this.expression = expression; - this.colonToken = colonToken; - this.statements = statements; - } - CaseSwitchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitCaseSwitchClause(this); - }; - - CaseSwitchClauseSyntax.prototype.kind = function () { - return 233 /* CaseSwitchClause */; - }; - - CaseSwitchClauseSyntax.prototype.childCount = function () { - return 4; - }; - - CaseSwitchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.caseKeyword; - case 1: - return this.expression; - case 2: - return this.colonToken; - case 3: - return this.statements; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CaseSwitchClauseSyntax.prototype.isSwitchClause = function () { - return true; - }; - - CaseSwitchClauseSyntax.prototype.update = function (caseKeyword, expression, colonToken, statements) { - if (this.caseKeyword === caseKeyword && this.expression === expression && this.colonToken === colonToken && this.statements === statements) { - return this; - } - - return new CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, this.parsedInStrictMode()); - }; - - CaseSwitchClauseSyntax.create = function (caseKeyword, expression, colonToken) { - return new CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, TypeScript.Syntax.emptyList, false); - }; - - CaseSwitchClauseSyntax.create1 = function (expression) { - return new CaseSwitchClauseSyntax(TypeScript.Syntax.token(16 /* CaseKeyword */), expression, TypeScript.Syntax.token(106 /* ColonToken */), TypeScript.Syntax.emptyList, false); - }; - - CaseSwitchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CaseSwitchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CaseSwitchClauseSyntax.prototype.withCaseKeyword = function (caseKeyword) { - return this.update(caseKeyword, this.expression, this.colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withExpression = function (expression) { - return this.update(this.caseKeyword, expression, this.colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.caseKeyword, this.expression, colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withStatements = function (statements) { - return this.update(this.caseKeyword, this.expression, this.colonToken, statements); - }; - - CaseSwitchClauseSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - CaseSwitchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.defaultKeyword = defaultKeyword; - this.colonToken = colonToken; - this.statements = statements; - } - DefaultSwitchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitDefaultSwitchClause(this); - }; - - DefaultSwitchClauseSyntax.prototype.kind = function () { - return 234 /* DefaultSwitchClause */; - }; - - DefaultSwitchClauseSyntax.prototype.childCount = function () { - return 3; - }; - - DefaultSwitchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.defaultKeyword; - case 1: - return this.colonToken; - case 2: - return this.statements; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DefaultSwitchClauseSyntax.prototype.isSwitchClause = function () { - return true; - }; - - DefaultSwitchClauseSyntax.prototype.update = function (defaultKeyword, colonToken, statements) { - if (this.defaultKeyword === defaultKeyword && this.colonToken === colonToken && this.statements === statements) { - return this; - } - - return new DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, this.parsedInStrictMode()); - }; - - DefaultSwitchClauseSyntax.create = function (defaultKeyword, colonToken) { - return new DefaultSwitchClauseSyntax(defaultKeyword, colonToken, TypeScript.Syntax.emptyList, false); - }; - - DefaultSwitchClauseSyntax.create1 = function () { - return new DefaultSwitchClauseSyntax(TypeScript.Syntax.token(20 /* DefaultKeyword */), TypeScript.Syntax.token(106 /* ColonToken */), TypeScript.Syntax.emptyList, false); - }; - - DefaultSwitchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DefaultSwitchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DefaultSwitchClauseSyntax.prototype.withDefaultKeyword = function (defaultKeyword) { - return this.update(defaultKeyword, this.colonToken, this.statements); - }; - - DefaultSwitchClauseSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.defaultKeyword, colonToken, this.statements); - }; - - DefaultSwitchClauseSyntax.prototype.withStatements = function (statements) { - return this.update(this.defaultKeyword, this.colonToken, statements); - }; - - DefaultSwitchClauseSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - DefaultSwitchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(breakKeyword, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.breakKeyword = breakKeyword; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - BreakStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitBreakStatement(this); - }; - - BreakStatementSyntax.prototype.kind = function () { - return 152 /* BreakStatement */; - }; - - BreakStatementSyntax.prototype.childCount = function () { - return 3; - }; - - BreakStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.breakKeyword; - case 1: - return this.identifier; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BreakStatementSyntax.prototype.isStatement = function () { - return true; - }; - - BreakStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - BreakStatementSyntax.prototype.update = function (breakKeyword, identifier, semicolonToken) { - if (this.breakKeyword === breakKeyword && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new BreakStatementSyntax(breakKeyword, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - BreakStatementSyntax.create = function (breakKeyword, semicolonToken) { - return new BreakStatementSyntax(breakKeyword, null, semicolonToken, false); - }; - - BreakStatementSyntax.create1 = function () { - return new BreakStatementSyntax(TypeScript.Syntax.token(15 /* BreakKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - BreakStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BreakStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BreakStatementSyntax.prototype.withBreakKeyword = function (breakKeyword) { - return this.update(breakKeyword, this.identifier, this.semicolonToken); - }; - - BreakStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.breakKeyword, identifier, this.semicolonToken); - }; - - BreakStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.breakKeyword, this.identifier, semicolonToken); - }; - - BreakStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BreakStatementSyntax = BreakStatementSyntax; - - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.continueKeyword = continueKeyword; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - ContinueStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitContinueStatement(this); - }; - - ContinueStatementSyntax.prototype.kind = function () { - return 153 /* ContinueStatement */; - }; - - ContinueStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ContinueStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.continueKeyword; - case 1: - return this.identifier; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ContinueStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ContinueStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ContinueStatementSyntax.prototype.update = function (continueKeyword, identifier, semicolonToken) { - if (this.continueKeyword === continueKeyword && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - ContinueStatementSyntax.create = function (continueKeyword, semicolonToken) { - return new ContinueStatementSyntax(continueKeyword, null, semicolonToken, false); - }; - - ContinueStatementSyntax.create1 = function () { - return new ContinueStatementSyntax(TypeScript.Syntax.token(18 /* ContinueKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ContinueStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ContinueStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ContinueStatementSyntax.prototype.withContinueKeyword = function (continueKeyword) { - return this.update(continueKeyword, this.identifier, this.semicolonToken); - }; - - ContinueStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.continueKeyword, identifier, this.semicolonToken); - }; - - ContinueStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.continueKeyword, this.identifier, semicolonToken); - }; - - ContinueStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ContinueStatementSyntax = ContinueStatementSyntax; - - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.forKeyword = forKeyword; - this.openParenToken = openParenToken; - this.variableDeclaration = variableDeclaration; - this.initializer = initializer; - this.firstSemicolonToken = firstSemicolonToken; - this.condition = condition; - this.secondSemicolonToken = secondSemicolonToken; - this.incrementor = incrementor; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - ForStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitForStatement(this); - }; - - ForStatementSyntax.prototype.kind = function () { - return 154 /* ForStatement */; - }; - - ForStatementSyntax.prototype.childCount = function () { - return 10; - }; - - ForStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.forKeyword; - case 1: - return this.openParenToken; - case 2: - return this.variableDeclaration; - case 3: - return this.initializer; - case 4: - return this.firstSemicolonToken; - case 5: - return this.condition; - case 6: - return this.secondSemicolonToken; - case 7: - return this.incrementor; - case 8: - return this.closeParenToken; - case 9: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ForStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - ForStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ForStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ForStatementSyntax.prototype.update = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - if (this.forKeyword === forKeyword && this.openParenToken === openParenToken && this.variableDeclaration === variableDeclaration && this.initializer === initializer && this.firstSemicolonToken === firstSemicolonToken && this.condition === condition && this.secondSemicolonToken === secondSemicolonToken && this.incrementor === incrementor && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, this.parsedInStrictMode()); - }; - - ForStatementSyntax.create = function (forKeyword, openParenToken, firstSemicolonToken, secondSemicolonToken, closeParenToken, statement) { - return new ForStatementSyntax(forKeyword, openParenToken, null, null, firstSemicolonToken, null, secondSemicolonToken, null, closeParenToken, statement, false); - }; - - ForStatementSyntax.create1 = function (statement) { - return new ForStatementSyntax(TypeScript.Syntax.token(26 /* ForKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), null, null, TypeScript.Syntax.token(78 /* SemicolonToken */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), null, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - ForStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ForStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ForStatementSyntax.prototype.withForKeyword = function (forKeyword) { - return this.update(forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.forKeyword, openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.forKeyword, this.openParenToken, variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withInitializer = function (initializer) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withFirstSemicolonToken = function (firstSemicolonToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withSecondSemicolonToken = function (secondSemicolonToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withIncrementor = function (incrementor) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, statement); - }; - - ForStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclaration !== null && this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - if (this.initializer !== null && this.initializer.isTypeScriptSpecific()) { - return true; - } - if (this.condition !== null && this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.incrementor !== null && this.incrementor.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ForStatementSyntax = ForStatementSyntax; - - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.forKeyword = forKeyword; - this.openParenToken = openParenToken; - this.variableDeclaration = variableDeclaration; - this.left = left; - this.inKeyword = inKeyword; - this.expression = expression; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - ForInStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitForInStatement(this); - }; - - ForInStatementSyntax.prototype.kind = function () { - return 155 /* ForInStatement */; - }; - - ForInStatementSyntax.prototype.childCount = function () { - return 8; - }; - - ForInStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.forKeyword; - case 1: - return this.openParenToken; - case 2: - return this.variableDeclaration; - case 3: - return this.left; - case 4: - return this.inKeyword; - case 5: - return this.expression; - case 6: - return this.closeParenToken; - case 7: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ForInStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - ForInStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ForInStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ForInStatementSyntax.prototype.update = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - if (this.forKeyword === forKeyword && this.openParenToken === openParenToken && this.variableDeclaration === variableDeclaration && this.left === left && this.inKeyword === inKeyword && this.expression === expression && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, this.parsedInStrictMode()); - }; - - ForInStatementSyntax.create = function (forKeyword, openParenToken, inKeyword, expression, closeParenToken, statement) { - return new ForInStatementSyntax(forKeyword, openParenToken, null, null, inKeyword, expression, closeParenToken, statement, false); - }; - - ForInStatementSyntax.create1 = function (expression, statement) { - return new ForInStatementSyntax(TypeScript.Syntax.token(26 /* ForKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), null, null, TypeScript.Syntax.token(29 /* InKeyword */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - ForInStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ForInStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ForInStatementSyntax.prototype.withForKeyword = function (forKeyword) { - return this.update(forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.forKeyword, openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.forKeyword, this.openParenToken, variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withLeft = function (left) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withInKeyword = function (inKeyword) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, statement); - }; - - ForInStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclaration !== null && this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - if (this.left !== null && this.left.isTypeScriptSpecific()) { - return true; - } - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ForInStatementSyntax = ForInStatementSyntax; - - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.whileKeyword = whileKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - WhileStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitWhileStatement(this); - }; - - WhileStatementSyntax.prototype.kind = function () { - return 158 /* WhileStatement */; - }; - - WhileStatementSyntax.prototype.childCount = function () { - return 5; - }; - - WhileStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.whileKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - WhileStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - WhileStatementSyntax.prototype.isStatement = function () { - return true; - }; - - WhileStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - WhileStatementSyntax.prototype.update = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - if (this.whileKeyword === whileKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, this.parsedInStrictMode()); - }; - - WhileStatementSyntax.create1 = function (condition, statement) { - return new WhileStatementSyntax(TypeScript.Syntax.token(42 /* WhileKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - WhileStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - WhileStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - WhileStatementSyntax.prototype.withWhileKeyword = function (whileKeyword) { - return this.update(whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.whileKeyword, openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.whileKeyword, this.openParenToken, condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.whileKeyword, this.openParenToken, this.condition, closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, statement); - }; - - WhileStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.WhileStatementSyntax = WhileStatementSyntax; - - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.withKeyword = withKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - WithStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitWithStatement(this); - }; - - WithStatementSyntax.prototype.kind = function () { - return 163 /* WithStatement */; - }; - - WithStatementSyntax.prototype.childCount = function () { - return 5; - }; - - WithStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.withKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - WithStatementSyntax.prototype.isStatement = function () { - return true; - }; - - WithStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - WithStatementSyntax.prototype.update = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - if (this.withKeyword === withKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, this.parsedInStrictMode()); - }; - - WithStatementSyntax.create1 = function (condition, statement) { - return new WithStatementSyntax(TypeScript.Syntax.token(43 /* WithKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - WithStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - WithStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - WithStatementSyntax.prototype.withWithKeyword = function (withKeyword) { - return this.update(withKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.withKeyword, openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.withKeyword, this.openParenToken, condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.withKeyword, this.openParenToken, this.condition, closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.withKeyword, this.openParenToken, this.condition, this.closeParenToken, statement); - }; - - WithStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.WithStatementSyntax = WithStatementSyntax; - - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.enumKeyword = enumKeyword; - this.identifier = identifier; - this.openBraceToken = openBraceToken; - this.enumElements = enumElements; - this.closeBraceToken = closeBraceToken; - } - EnumDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitEnumDeclaration(this); - }; - - EnumDeclarationSyntax.prototype.kind = function () { - return 132 /* EnumDeclaration */; - }; - - EnumDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - EnumDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.enumKeyword; - case 2: - return this.identifier; - case 3: - return this.openBraceToken; - case 4: - return this.enumElements; - case 5: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EnumDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - EnumDeclarationSyntax.prototype.update = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - if (this.modifiers === modifiers && this.enumKeyword === enumKeyword && this.identifier === identifier && this.openBraceToken === openBraceToken && this.enumElements === enumElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, this.parsedInStrictMode()); - }; - - EnumDeclarationSyntax.create = function (enumKeyword, identifier, openBraceToken, closeBraceToken) { - return new EnumDeclarationSyntax(TypeScript.Syntax.emptyList, enumKeyword, identifier, openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - EnumDeclarationSyntax.create1 = function (identifier) { - return new EnumDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(46 /* EnumKeyword */), identifier, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - EnumDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EnumDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EnumDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.enumKeyword, this.identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - EnumDeclarationSyntax.prototype.withEnumKeyword = function (enumKeyword) { - return this.update(this.modifiers, enumKeyword, this.identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.enumKeyword, identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withEnumElements = function (enumElements) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, this.openBraceToken, enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withEnumElement = function (enumElement) { - return this.withEnumElements(TypeScript.Syntax.separatedList([enumElement])); - }; - - EnumDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, this.openBraceToken, this.enumElements, closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EnumDeclarationSyntax = EnumDeclarationSyntax; - - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(propertyName, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.equalsValueClause = equalsValueClause; - } - EnumElementSyntax.prototype.accept = function (visitor) { - return visitor.visitEnumElement(this); - }; - - EnumElementSyntax.prototype.kind = function () { - return 243 /* EnumElement */; - }; - - EnumElementSyntax.prototype.childCount = function () { - return 2; - }; - - EnumElementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EnumElementSyntax.prototype.update = function (propertyName, equalsValueClause) { - if (this.propertyName === propertyName && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new EnumElementSyntax(propertyName, equalsValueClause, this.parsedInStrictMode()); - }; - - EnumElementSyntax.create = function (propertyName) { - return new EnumElementSyntax(propertyName, null, false); - }; - - EnumElementSyntax.create1 = function (propertyName) { - return new EnumElementSyntax(propertyName, null, false); - }; - - EnumElementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EnumElementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EnumElementSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.equalsValueClause); - }; - - EnumElementSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.propertyName, equalsValueClause); - }; - - EnumElementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.equalsValueClause !== null && this.equalsValueClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EnumElementSyntax = EnumElementSyntax; - - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.type = type; - this.greaterThanToken = greaterThanToken; - this.expression = expression; - } - CastExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitCastExpression(this); - }; - - CastExpressionSyntax.prototype.kind = function () { - return 220 /* CastExpression */; - }; - - CastExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - CastExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.type; - case 2: - return this.greaterThanToken; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CastExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - CastExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - CastExpressionSyntax.prototype.update = function (lessThanToken, type, greaterThanToken, expression) { - if (this.lessThanToken === lessThanToken && this.type === type && this.greaterThanToken === greaterThanToken && this.expression === expression) { - return this; - } - - return new CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, this.parsedInStrictMode()); - }; - - CastExpressionSyntax.create1 = function (type, expression) { - return new CastExpressionSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), type, TypeScript.Syntax.token(81 /* GreaterThanToken */), expression, false); - }; - - CastExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CastExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CastExpressionSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.type, this.greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withType = function (type) { - return this.update(this.lessThanToken, type, this.greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.type, greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.lessThanToken, this.type, this.greaterThanToken, expression); - }; - - CastExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CastExpressionSyntax = CastExpressionSyntax; - - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.propertyAssignments = propertyAssignments; - this.closeBraceToken = closeBraceToken; - } - ObjectLiteralExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectLiteralExpression(this); - }; - - ObjectLiteralExpressionSyntax.prototype.kind = function () { - return 215 /* ObjectLiteralExpression */; - }; - - ObjectLiteralExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectLiteralExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.propertyAssignments; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectLiteralExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.update = function (openBraceToken, propertyAssignments, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.propertyAssignments === propertyAssignments && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, this.parsedInStrictMode()); - }; - - ObjectLiteralExpressionSyntax.create = function (openBraceToken, closeBraceToken) { - return new ObjectLiteralExpressionSyntax(openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - ObjectLiteralExpressionSyntax.create1 = function () { - return new ObjectLiteralExpressionSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ObjectLiteralExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectLiteralExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectLiteralExpressionSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.propertyAssignments, this.closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.withPropertyAssignments = function (propertyAssignments) { - return this.update(this.openBraceToken, propertyAssignments, this.closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.withPropertyAssignment = function (propertyAssignment) { - return this.withPropertyAssignments(TypeScript.Syntax.separatedList([propertyAssignment])); - }; - - ObjectLiteralExpressionSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.propertyAssignments, closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.propertyAssignments.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.colonToken = colonToken; - this.expression = expression; - } - SimplePropertyAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitSimplePropertyAssignment(this); - }; - - SimplePropertyAssignmentSyntax.prototype.kind = function () { - return 240 /* SimplePropertyAssignment */; - }; - - SimplePropertyAssignmentSyntax.prototype.childCount = function () { - return 3; - }; - - SimplePropertyAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.colonToken; - case 2: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SimplePropertyAssignmentSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - SimplePropertyAssignmentSyntax.prototype.update = function (propertyName, colonToken, expression) { - if (this.propertyName === propertyName && this.colonToken === colonToken && this.expression === expression) { - return this; - } - - return new SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, this.parsedInStrictMode()); - }; - - SimplePropertyAssignmentSyntax.create1 = function (propertyName, expression) { - return new SimplePropertyAssignmentSyntax(propertyName, TypeScript.Syntax.token(106 /* ColonToken */), expression, false); - }; - - SimplePropertyAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SimplePropertyAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SimplePropertyAssignmentSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.colonToken, this.expression); - }; - - SimplePropertyAssignmentSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.propertyName, colonToken, this.expression); - }; - - SimplePropertyAssignmentSyntax.prototype.withExpression = function (expression) { - return this.update(this.propertyName, this.colonToken, expression); - }; - - SimplePropertyAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - } - FunctionPropertyAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionPropertyAssignment(this); - }; - - FunctionPropertyAssignmentSyntax.prototype.kind = function () { - return 241 /* FunctionPropertyAssignment */; - }; - - FunctionPropertyAssignmentSyntax.prototype.childCount = function () { - return 3; - }; - - FunctionPropertyAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.callSignature; - case 2: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionPropertyAssignmentSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - FunctionPropertyAssignmentSyntax.prototype.update = function (propertyName, callSignature, block) { - if (this.propertyName === propertyName && this.callSignature === callSignature && this.block === block) { - return this; - } - - return new FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, this.parsedInStrictMode()); - }; - - FunctionPropertyAssignmentSyntax.create1 = function (propertyName) { - return new FunctionPropertyAssignmentSyntax(propertyName, CallSignatureSyntax.create1(), BlockSyntax.create1(), false); - }; - - FunctionPropertyAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionPropertyAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionPropertyAssignmentSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.callSignature, this.block); - }; - - FunctionPropertyAssignmentSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.propertyName, callSignature, this.block); - }; - - FunctionPropertyAssignmentSyntax.prototype.withBlock = function (block) { - return this.update(this.propertyName, this.callSignature, block); - }; - - FunctionPropertyAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.functionKeyword = functionKeyword; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - } - FunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionExpression(this); - }; - - FunctionExpressionSyntax.prototype.kind = function () { - return 222 /* FunctionExpression */; - }; - - FunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - FunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.functionKeyword; - case 1: - return this.identifier; - case 2: - return this.callSignature; - case 3: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.update = function (functionKeyword, identifier, callSignature, block) { - if (this.functionKeyword === functionKeyword && this.identifier === identifier && this.callSignature === callSignature && this.block === block) { - return this; - } - - return new FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, this.parsedInStrictMode()); - }; - - FunctionExpressionSyntax.create = function (functionKeyword, callSignature, block) { - return new FunctionExpressionSyntax(functionKeyword, null, callSignature, block, false); - }; - - FunctionExpressionSyntax.create1 = function () { - return new FunctionExpressionSyntax(TypeScript.Syntax.token(27 /* FunctionKeyword */), null, CallSignatureSyntax.create1(), BlockSyntax.create1(), false); - }; - - FunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionExpressionSyntax.prototype.withFunctionKeyword = function (functionKeyword) { - return this.update(functionKeyword, this.identifier, this.callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.functionKeyword, identifier, this.callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.functionKeyword, this.identifier, callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.functionKeyword, this.identifier, this.callSignature, block); - }; - - FunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionExpressionSyntax = FunctionExpressionSyntax; - - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.semicolonToken = semicolonToken; - } - EmptyStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitEmptyStatement(this); - }; - - EmptyStatementSyntax.prototype.kind = function () { - return 156 /* EmptyStatement */; - }; - - EmptyStatementSyntax.prototype.childCount = function () { - return 1; - }; - - EmptyStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EmptyStatementSyntax.prototype.isStatement = function () { - return true; - }; - - EmptyStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - EmptyStatementSyntax.prototype.update = function (semicolonToken) { - if (this.semicolonToken === semicolonToken) { - return this; - } - - return new EmptyStatementSyntax(semicolonToken, this.parsedInStrictMode()); - }; - - EmptyStatementSyntax.create1 = function () { - return new EmptyStatementSyntax(TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - EmptyStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EmptyStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EmptyStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(semicolonToken); - }; - - EmptyStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EmptyStatementSyntax = EmptyStatementSyntax; - - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.tryKeyword = tryKeyword; - this.block = block; - this.catchClause = catchClause; - this.finallyClause = finallyClause; - } - TryStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitTryStatement(this); - }; - - TryStatementSyntax.prototype.kind = function () { - return 159 /* TryStatement */; - }; - - TryStatementSyntax.prototype.childCount = function () { - return 4; - }; - - TryStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.tryKeyword; - case 1: - return this.block; - case 2: - return this.catchClause; - case 3: - return this.finallyClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TryStatementSyntax.prototype.isStatement = function () { - return true; - }; - - TryStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - TryStatementSyntax.prototype.update = function (tryKeyword, block, catchClause, finallyClause) { - if (this.tryKeyword === tryKeyword && this.block === block && this.catchClause === catchClause && this.finallyClause === finallyClause) { - return this; - } - - return new TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, this.parsedInStrictMode()); - }; - - TryStatementSyntax.create = function (tryKeyword, block) { - return new TryStatementSyntax(tryKeyword, block, null, null, false); - }; - - TryStatementSyntax.create1 = function () { - return new TryStatementSyntax(TypeScript.Syntax.token(38 /* TryKeyword */), BlockSyntax.create1(), null, null, false); - }; - - TryStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TryStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TryStatementSyntax.prototype.withTryKeyword = function (tryKeyword) { - return this.update(tryKeyword, this.block, this.catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withBlock = function (block) { - return this.update(this.tryKeyword, block, this.catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withCatchClause = function (catchClause) { - return this.update(this.tryKeyword, this.block, catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withFinallyClause = function (finallyClause) { - return this.update(this.tryKeyword, this.block, this.catchClause, finallyClause); - }; - - TryStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.block.isTypeScriptSpecific()) { - return true; - } - if (this.catchClause !== null && this.catchClause.isTypeScriptSpecific()) { - return true; - } - if (this.finallyClause !== null && this.finallyClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TryStatementSyntax = TryStatementSyntax; - - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.catchKeyword = catchKeyword; - this.openParenToken = openParenToken; - this.identifier = identifier; - this.typeAnnotation = typeAnnotation; - this.closeParenToken = closeParenToken; - this.block = block; - } - CatchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitCatchClause(this); - }; - - CatchClauseSyntax.prototype.kind = function () { - return 236 /* CatchClause */; - }; - - CatchClauseSyntax.prototype.childCount = function () { - return 6; - }; - - CatchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.catchKeyword; - case 1: - return this.openParenToken; - case 2: - return this.identifier; - case 3: - return this.typeAnnotation; - case 4: - return this.closeParenToken; - case 5: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CatchClauseSyntax.prototype.update = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - if (this.catchKeyword === catchKeyword && this.openParenToken === openParenToken && this.identifier === identifier && this.typeAnnotation === typeAnnotation && this.closeParenToken === closeParenToken && this.block === block) { - return this; - } - - return new CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, this.parsedInStrictMode()); - }; - - CatchClauseSyntax.create = function (catchKeyword, openParenToken, identifier, closeParenToken, block) { - return new CatchClauseSyntax(catchKeyword, openParenToken, identifier, null, closeParenToken, block, false); - }; - - CatchClauseSyntax.create1 = function (identifier) { - return new CatchClauseSyntax(TypeScript.Syntax.token(17 /* CatchKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), identifier, null, TypeScript.Syntax.token(73 /* CloseParenToken */), BlockSyntax.create1(), false); - }; - - CatchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CatchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CatchClauseSyntax.prototype.withCatchKeyword = function (catchKeyword) { - return this.update(catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.catchKeyword, openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.catchKeyword, this.openParenToken, identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withBlock = function (block) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, block); - }; - - CatchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeAnnotation !== null && this.typeAnnotation.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CatchClauseSyntax = CatchClauseSyntax; - - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(finallyKeyword, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.finallyKeyword = finallyKeyword; - this.block = block; - } - FinallyClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitFinallyClause(this); - }; - - FinallyClauseSyntax.prototype.kind = function () { - return 237 /* FinallyClause */; - }; - - FinallyClauseSyntax.prototype.childCount = function () { - return 2; - }; - - FinallyClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.finallyKeyword; - case 1: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FinallyClauseSyntax.prototype.update = function (finallyKeyword, block) { - if (this.finallyKeyword === finallyKeyword && this.block === block) { - return this; - } - - return new FinallyClauseSyntax(finallyKeyword, block, this.parsedInStrictMode()); - }; - - FinallyClauseSyntax.create1 = function () { - return new FinallyClauseSyntax(TypeScript.Syntax.token(25 /* FinallyKeyword */), BlockSyntax.create1(), false); - }; - - FinallyClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FinallyClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FinallyClauseSyntax.prototype.withFinallyKeyword = function (finallyKeyword) { - return this.update(finallyKeyword, this.block); - }; - - FinallyClauseSyntax.prototype.withBlock = function (block) { - return this.update(this.finallyKeyword, block); - }; - - FinallyClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FinallyClauseSyntax = FinallyClauseSyntax; - - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(identifier, colonToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.colonToken = colonToken; - this.statement = statement; - } - LabeledStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitLabeledStatement(this); - }; - - LabeledStatementSyntax.prototype.kind = function () { - return 160 /* LabeledStatement */; - }; - - LabeledStatementSyntax.prototype.childCount = function () { - return 3; - }; - - LabeledStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.colonToken; - case 2: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - LabeledStatementSyntax.prototype.isStatement = function () { - return true; - }; - - LabeledStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - LabeledStatementSyntax.prototype.update = function (identifier, colonToken, statement) { - if (this.identifier === identifier && this.colonToken === colonToken && this.statement === statement) { - return this; - } - - return new LabeledStatementSyntax(identifier, colonToken, statement, this.parsedInStrictMode()); - }; - - LabeledStatementSyntax.create1 = function (identifier, statement) { - return new LabeledStatementSyntax(identifier, TypeScript.Syntax.token(106 /* ColonToken */), statement, false); - }; - - LabeledStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - LabeledStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - LabeledStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.colonToken, this.statement); - }; - - LabeledStatementSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.identifier, colonToken, this.statement); - }; - - LabeledStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.identifier, this.colonToken, statement); - }; - - LabeledStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.LabeledStatementSyntax = LabeledStatementSyntax; - - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.doKeyword = doKeyword; - this.statement = statement; - this.whileKeyword = whileKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.semicolonToken = semicolonToken; - } - DoStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitDoStatement(this); - }; - - DoStatementSyntax.prototype.kind = function () { - return 161 /* DoStatement */; - }; - - DoStatementSyntax.prototype.childCount = function () { - return 7; - }; - - DoStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.doKeyword; - case 1: - return this.statement; - case 2: - return this.whileKeyword; - case 3: - return this.openParenToken; - case 4: - return this.condition; - case 5: - return this.closeParenToken; - case 6: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DoStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - DoStatementSyntax.prototype.isStatement = function () { - return true; - }; - - DoStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - DoStatementSyntax.prototype.update = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - if (this.doKeyword === doKeyword && this.statement === statement && this.whileKeyword === whileKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.semicolonToken === semicolonToken) { - return this; - } - - return new DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, this.parsedInStrictMode()); - }; - - DoStatementSyntax.create1 = function (statement, condition) { - return new DoStatementSyntax(TypeScript.Syntax.token(22 /* DoKeyword */), statement, TypeScript.Syntax.token(42 /* WhileKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - DoStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DoStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DoStatementSyntax.prototype.withDoKeyword = function (doKeyword) { - return this.update(doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.doKeyword, statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withWhileKeyword = function (whileKeyword) { - return this.update(this.doKeyword, this.statement, whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, semicolonToken); - }; - - DoStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - if (this.condition.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DoStatementSyntax = DoStatementSyntax; - - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(typeOfKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeOfKeyword = typeOfKeyword; - this.expression = expression; - } - TypeOfExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeOfExpression(this); - }; - - TypeOfExpressionSyntax.prototype.kind = function () { - return 171 /* TypeOfExpression */; - }; - - TypeOfExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - TypeOfExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeOfKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeOfExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - TypeOfExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - TypeOfExpressionSyntax.prototype.update = function (typeOfKeyword, expression) { - if (this.typeOfKeyword === typeOfKeyword && this.expression === expression) { - return this; - } - - return new TypeOfExpressionSyntax(typeOfKeyword, expression, this.parsedInStrictMode()); - }; - - TypeOfExpressionSyntax.create1 = function (expression) { - return new TypeOfExpressionSyntax(TypeScript.Syntax.token(39 /* TypeOfKeyword */), expression, false); - }; - - TypeOfExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeOfExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeOfExpressionSyntax.prototype.withTypeOfKeyword = function (typeOfKeyword) { - return this.update(typeOfKeyword, this.expression); - }; - - TypeOfExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.typeOfKeyword, expression); - }; - - TypeOfExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(deleteKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.deleteKeyword = deleteKeyword; - this.expression = expression; - } - DeleteExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitDeleteExpression(this); - }; - - DeleteExpressionSyntax.prototype.kind = function () { - return 170 /* DeleteExpression */; - }; - - DeleteExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - DeleteExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.deleteKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DeleteExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - DeleteExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - DeleteExpressionSyntax.prototype.update = function (deleteKeyword, expression) { - if (this.deleteKeyword === deleteKeyword && this.expression === expression) { - return this; - } - - return new DeleteExpressionSyntax(deleteKeyword, expression, this.parsedInStrictMode()); - }; - - DeleteExpressionSyntax.create1 = function (expression) { - return new DeleteExpressionSyntax(TypeScript.Syntax.token(21 /* DeleteKeyword */), expression, false); - }; - - DeleteExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DeleteExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DeleteExpressionSyntax.prototype.withDeleteKeyword = function (deleteKeyword) { - return this.update(deleteKeyword, this.expression); - }; - - DeleteExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.deleteKeyword, expression); - }; - - DeleteExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DeleteExpressionSyntax = DeleteExpressionSyntax; - - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(voidKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.voidKeyword = voidKeyword; - this.expression = expression; - } - VoidExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitVoidExpression(this); - }; - - VoidExpressionSyntax.prototype.kind = function () { - return 172 /* VoidExpression */; - }; - - VoidExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - VoidExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.voidKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VoidExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - VoidExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - VoidExpressionSyntax.prototype.update = function (voidKeyword, expression) { - if (this.voidKeyword === voidKeyword && this.expression === expression) { - return this; - } - - return new VoidExpressionSyntax(voidKeyword, expression, this.parsedInStrictMode()); - }; - - VoidExpressionSyntax.create1 = function (expression) { - return new VoidExpressionSyntax(TypeScript.Syntax.token(41 /* VoidKeyword */), expression, false); - }; - - VoidExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VoidExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VoidExpressionSyntax.prototype.withVoidKeyword = function (voidKeyword) { - return this.update(voidKeyword, this.expression); - }; - - VoidExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.voidKeyword, expression); - }; - - VoidExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VoidExpressionSyntax = VoidExpressionSyntax; - - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(debuggerKeyword, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.debuggerKeyword = debuggerKeyword; - this.semicolonToken = semicolonToken; - } - DebuggerStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitDebuggerStatement(this); - }; - - DebuggerStatementSyntax.prototype.kind = function () { - return 162 /* DebuggerStatement */; - }; - - DebuggerStatementSyntax.prototype.childCount = function () { - return 2; - }; - - DebuggerStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.debuggerKeyword; - case 1: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DebuggerStatementSyntax.prototype.isStatement = function () { - return true; - }; - - DebuggerStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - DebuggerStatementSyntax.prototype.update = function (debuggerKeyword, semicolonToken) { - if (this.debuggerKeyword === debuggerKeyword && this.semicolonToken === semicolonToken) { - return this; - } - - return new DebuggerStatementSyntax(debuggerKeyword, semicolonToken, this.parsedInStrictMode()); - }; - - DebuggerStatementSyntax.create1 = function () { - return new DebuggerStatementSyntax(TypeScript.Syntax.token(19 /* DebuggerKeyword */), TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - DebuggerStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DebuggerStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DebuggerStatementSyntax.prototype.withDebuggerKeyword = function (debuggerKeyword) { - return this.update(debuggerKeyword, this.semicolonToken); - }; - - DebuggerStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.debuggerKeyword, semicolonToken); - }; - - DebuggerStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DebuggerStatementSyntax = DebuggerStatementSyntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxRewriter = (function () { - function SyntaxRewriter() { - } - SyntaxRewriter.prototype.visitToken = function (token) { - return token; - }; - - SyntaxRewriter.prototype.visitNode = function (node) { - return node.accept(this); - }; - - SyntaxRewriter.prototype.visitNodeOrToken = function (node) { - return node.isToken() ? this.visitToken(node) : this.visitNode(node); - }; - - SyntaxRewriter.prototype.visitList = function (list) { - var newItems = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - var newItem = this.visitNodeOrToken(item); - - if (item !== newItem && newItems === null) { - newItems = []; - for (var j = 0; j < i; j++) { - newItems.push(list.childAt(j)); - } - } - - if (newItems) { - newItems.push(newItem); - } - } - - return newItems === null ? list : TypeScript.Syntax.list(newItems); - }; - - SyntaxRewriter.prototype.visitSeparatedList = function (list) { - var newItems = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - var newItem = item.isToken() ? this.visitToken(item) : this.visitNode(item); - - if (item !== newItem && newItems === null) { - newItems = []; - for (var j = 0; j < i; j++) { - newItems.push(list.childAt(j)); - } - } - - if (newItems) { - newItems.push(newItem); - } - } - - return newItems === null ? list : TypeScript.Syntax.separatedList(newItems); - }; - - SyntaxRewriter.prototype.visitSourceUnit = function (node) { - return node.update(this.visitList(node.moduleElements), this.visitToken(node.endOfFileToken)); - }; - - SyntaxRewriter.prototype.visitExternalModuleReference = function (node) { - return node.update(this.visitToken(node.requireKeyword), this.visitToken(node.openParenToken), this.visitToken(node.stringLiteral), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitModuleNameModuleReference = function (node) { - return node.update(this.visitNodeOrToken(node.moduleName)); - }; - - SyntaxRewriter.prototype.visitImportDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.importKeyword), this.visitToken(node.identifier), this.visitToken(node.equalsToken), this.visitNodeOrToken(node.moduleReference), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitExportAssignment = function (node) { - return node.update(this.visitToken(node.exportKeyword), this.visitToken(node.equalsToken), this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitClassDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.classKeyword), this.visitToken(node.identifier), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitList(node.heritageClauses), this.visitToken(node.openBraceToken), this.visitList(node.classElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitInterfaceDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.interfaceKeyword), this.visitToken(node.identifier), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitList(node.heritageClauses), this.visitNode(node.body)); - }; - - SyntaxRewriter.prototype.visitHeritageClause = function (node) { - return node.update(node.kind(), this.visitToken(node.extendsOrImplementsKeyword), this.visitSeparatedList(node.typeNames)); - }; - - SyntaxRewriter.prototype.visitModuleDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.moduleKeyword), node.name === null ? null : this.visitNodeOrToken(node.name), node.stringLiteral === null ? null : this.visitToken(node.stringLiteral), this.visitToken(node.openBraceToken), this.visitList(node.moduleElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitFunctionDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.functionKeyword), this.visitToken(node.identifier), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitVariableStatement = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.variableDeclaration), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitVariableDeclaration = function (node) { - return node.update(this.visitToken(node.varKeyword), this.visitSeparatedList(node.variableDeclarators)); - }; - - SyntaxRewriter.prototype.visitVariableDeclarator = function (node) { - return node.update(this.visitToken(node.propertyName), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitEqualsValueClause = function (node) { - return node.update(this.visitToken(node.equalsToken), this.visitNodeOrToken(node.value)); - }; - - SyntaxRewriter.prototype.visitPrefixUnaryExpression = function (node) { - return node.update(node.kind(), this.visitToken(node.operatorToken), this.visitNodeOrToken(node.operand)); - }; - - SyntaxRewriter.prototype.visitArrayLiteralExpression = function (node) { - return node.update(this.visitToken(node.openBracketToken), this.visitSeparatedList(node.expressions), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitOmittedExpression = function (node) { - return node; - }; - - SyntaxRewriter.prototype.visitParenthesizedExpression = function (node) { - return node.update(this.visitToken(node.openParenToken), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitSimpleArrowFunctionExpression = function (node) { - return node.update(this.visitToken(node.identifier), this.visitToken(node.equalsGreaterThanToken), node.block === null ? null : this.visitNode(node.block), node.expression === null ? null : this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - return node.update(this.visitNode(node.callSignature), this.visitToken(node.equalsGreaterThanToken), node.block === null ? null : this.visitNode(node.block), node.expression === null ? null : this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitQualifiedName = function (node) { - return node.update(this.visitNodeOrToken(node.left), this.visitToken(node.dotToken), this.visitToken(node.right)); - }; - - SyntaxRewriter.prototype.visitTypeArgumentList = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitSeparatedList(node.typeArguments), this.visitToken(node.greaterThanToken)); - }; - - SyntaxRewriter.prototype.visitConstructorType = function (node) { - return node.update(this.visitToken(node.newKeyword), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), this.visitToken(node.equalsGreaterThanToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitFunctionType = function (node) { - return node.update(node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), this.visitToken(node.equalsGreaterThanToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitObjectType = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitSeparatedList(node.typeMembers), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitArrayType = function (node) { - return node.update(this.visitNodeOrToken(node.type), this.visitToken(node.openBracketToken), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitGenericType = function (node) { - return node.update(this.visitNodeOrToken(node.name), this.visitNode(node.typeArgumentList)); - }; - - SyntaxRewriter.prototype.visitTypeQuery = function (node) { - return node.update(this.visitToken(node.typeOfKeyword), this.visitNodeOrToken(node.name)); - }; - - SyntaxRewriter.prototype.visitTypeAnnotation = function (node) { - return node.update(this.visitToken(node.colonToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitBlock = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitList(node.statements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitParameter = function (node) { - return node.update(node.dotDotDotToken === null ? null : this.visitToken(node.dotDotDotToken), this.visitList(node.modifiers), this.visitToken(node.identifier), node.questionToken === null ? null : this.visitToken(node.questionToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitMemberAccessExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.dotToken), this.visitToken(node.name)); - }; - - SyntaxRewriter.prototype.visitPostfixUnaryExpression = function (node) { - return node.update(node.kind(), this.visitNodeOrToken(node.operand), this.visitToken(node.operatorToken)); - }; - - SyntaxRewriter.prototype.visitElementAccessExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.openBracketToken), this.visitNodeOrToken(node.argumentExpression), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitInvocationExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitNode(node.argumentList)); - }; - - SyntaxRewriter.prototype.visitArgumentList = function (node) { - return node.update(node.typeArgumentList === null ? null : this.visitNode(node.typeArgumentList), this.visitToken(node.openParenToken), this.visitSeparatedList(node.arguments), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitBinaryExpression = function (node) { - return node.update(node.kind(), this.visitNodeOrToken(node.left), this.visitToken(node.operatorToken), this.visitNodeOrToken(node.right)); - }; - - SyntaxRewriter.prototype.visitConditionalExpression = function (node) { - return node.update(this.visitNodeOrToken(node.condition), this.visitToken(node.questionToken), this.visitNodeOrToken(node.whenTrue), this.visitToken(node.colonToken), this.visitNodeOrToken(node.whenFalse)); - }; - - SyntaxRewriter.prototype.visitConstructSignature = function (node) { - return node.update(this.visitToken(node.newKeyword), this.visitNode(node.callSignature)); - }; - - SyntaxRewriter.prototype.visitMethodSignature = function (node) { - return node.update(this.visitToken(node.propertyName), node.questionToken === null ? null : this.visitToken(node.questionToken), this.visitNode(node.callSignature)); - }; - - SyntaxRewriter.prototype.visitIndexSignature = function (node) { - return node.update(this.visitToken(node.openBracketToken), this.visitNode(node.parameter), this.visitToken(node.closeBracketToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitPropertySignature = function (node) { - return node.update(this.visitToken(node.propertyName), node.questionToken === null ? null : this.visitToken(node.questionToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitCallSignature = function (node) { - return node.update(node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitParameterList = function (node) { - return node.update(this.visitToken(node.openParenToken), this.visitSeparatedList(node.parameters), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitTypeParameterList = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitSeparatedList(node.typeParameters), this.visitToken(node.greaterThanToken)); - }; - - SyntaxRewriter.prototype.visitTypeParameter = function (node) { - return node.update(this.visitToken(node.identifier), node.constraint === null ? null : this.visitNode(node.constraint)); - }; - - SyntaxRewriter.prototype.visitConstraint = function (node) { - return node.update(this.visitToken(node.extendsKeyword), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitElseClause = function (node) { - return node.update(this.visitToken(node.elseKeyword), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitIfStatement = function (node) { - return node.update(this.visitToken(node.ifKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement), node.elseClause === null ? null : this.visitNode(node.elseClause)); - }; - - SyntaxRewriter.prototype.visitExpressionStatement = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitConstructorDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.constructorKeyword), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitMemberFunctionDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.propertyName), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitGetAccessor = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.getKeyword), this.visitToken(node.propertyName), this.visitNode(node.parameterList), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitSetAccessor = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.setKeyword), this.visitToken(node.propertyName), this.visitNode(node.parameterList), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitMemberVariableDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.variableDeclarator), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitIndexMemberDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.indexSignature), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitThrowStatement = function (node) { - return node.update(this.visitToken(node.throwKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitReturnStatement = function (node) { - return node.update(this.visitToken(node.returnKeyword), node.expression === null ? null : this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitObjectCreationExpression = function (node) { - return node.update(this.visitToken(node.newKeyword), this.visitNodeOrToken(node.expression), node.argumentList === null ? null : this.visitNode(node.argumentList)); - }; - - SyntaxRewriter.prototype.visitSwitchStatement = function (node) { - return node.update(this.visitToken(node.switchKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken), this.visitToken(node.openBraceToken), this.visitList(node.switchClauses), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitCaseSwitchClause = function (node) { - return node.update(this.visitToken(node.caseKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.colonToken), this.visitList(node.statements)); - }; - - SyntaxRewriter.prototype.visitDefaultSwitchClause = function (node) { - return node.update(this.visitToken(node.defaultKeyword), this.visitToken(node.colonToken), this.visitList(node.statements)); - }; - - SyntaxRewriter.prototype.visitBreakStatement = function (node) { - return node.update(this.visitToken(node.breakKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitContinueStatement = function (node) { - return node.update(this.visitToken(node.continueKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitForStatement = function (node) { - return node.update(this.visitToken(node.forKeyword), this.visitToken(node.openParenToken), node.variableDeclaration === null ? null : this.visitNode(node.variableDeclaration), node.initializer === null ? null : this.visitNodeOrToken(node.initializer), this.visitToken(node.firstSemicolonToken), node.condition === null ? null : this.visitNodeOrToken(node.condition), this.visitToken(node.secondSemicolonToken), node.incrementor === null ? null : this.visitNodeOrToken(node.incrementor), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitForInStatement = function (node) { - return node.update(this.visitToken(node.forKeyword), this.visitToken(node.openParenToken), node.variableDeclaration === null ? null : this.visitNode(node.variableDeclaration), node.left === null ? null : this.visitNodeOrToken(node.left), this.visitToken(node.inKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitWhileStatement = function (node) { - return node.update(this.visitToken(node.whileKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitWithStatement = function (node) { - return node.update(this.visitToken(node.withKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitEnumDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.enumKeyword), this.visitToken(node.identifier), this.visitToken(node.openBraceToken), this.visitSeparatedList(node.enumElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitEnumElement = function (node) { - return node.update(this.visitToken(node.propertyName), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitCastExpression = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitNodeOrToken(node.type), this.visitToken(node.greaterThanToken), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitObjectLiteralExpression = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitSeparatedList(node.propertyAssignments), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitSimplePropertyAssignment = function (node) { - return node.update(this.visitToken(node.propertyName), this.visitToken(node.colonToken), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitFunctionPropertyAssignment = function (node) { - return node.update(this.visitToken(node.propertyName), this.visitNode(node.callSignature), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitFunctionExpression = function (node) { - return node.update(this.visitToken(node.functionKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitNode(node.callSignature), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitEmptyStatement = function (node) { - return node.update(this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitTryStatement = function (node) { - return node.update(this.visitToken(node.tryKeyword), this.visitNode(node.block), node.catchClause === null ? null : this.visitNode(node.catchClause), node.finallyClause === null ? null : this.visitNode(node.finallyClause)); - }; - - SyntaxRewriter.prototype.visitCatchClause = function (node) { - return node.update(this.visitToken(node.catchKeyword), this.visitToken(node.openParenToken), this.visitToken(node.identifier), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), this.visitToken(node.closeParenToken), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitFinallyClause = function (node) { - return node.update(this.visitToken(node.finallyKeyword), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitLabeledStatement = function (node) { - return node.update(this.visitToken(node.identifier), this.visitToken(node.colonToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitDoStatement = function (node) { - return node.update(this.visitToken(node.doKeyword), this.visitNodeOrToken(node.statement), this.visitToken(node.whileKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitTypeOfExpression = function (node) { - return node.update(this.visitToken(node.typeOfKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitDeleteExpression = function (node) { - return node.update(this.visitToken(node.deleteKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitVoidExpression = function (node) { - return node.update(this.visitToken(node.voidKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitDebuggerStatement = function (node) { - return node.update(this.visitToken(node.debuggerKeyword), this.visitToken(node.semicolonToken)); - }; - return SyntaxRewriter; - })(); - TypeScript.SyntaxRewriter = SyntaxRewriter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxDedenter = (function (_super) { - __extends(SyntaxDedenter, _super); - function SyntaxDedenter(dedentFirstToken, dedentationAmount, minimumIndent, options) { - _super.call(this); - this.dedentationAmount = dedentationAmount; - this.minimumIndent = minimumIndent; - this.options = options; - this.lastTriviaWasNewLine = dedentFirstToken; - } - SyntaxDedenter.prototype.abort = function () { - this.lastTriviaWasNewLine = false; - this.dedentationAmount = 0; - }; - - SyntaxDedenter.prototype.isAborted = function () { - return this.dedentationAmount === 0; - }; - - SyntaxDedenter.prototype.visitToken = function (token) { - if (token.width() === 0) { - return token; - } - - var result = token; - if (this.lastTriviaWasNewLine) { - result = token.withLeadingTrivia(this.dedentTriviaList(token.leadingTrivia())); - } - - if (this.isAborted()) { - return token; - } - - this.lastTriviaWasNewLine = token.hasTrailingNewLine(); - return result; - }; - - SyntaxDedenter.prototype.dedentTriviaList = function (triviaList) { - var result = []; - var dedentNextWhitespace = true; - - for (var i = 0, n = triviaList.count(); i < n && !this.isAborted(); i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - var dedentThisTrivia = dedentNextWhitespace; - dedentNextWhitespace = false; - - if (dedentThisTrivia) { - if (trivia.kind() === 4 /* WhitespaceTrivia */) { - var hasFollowingNewLine = (i < triviaList.count() - 1) && triviaList.syntaxTriviaAt(i + 1).kind() === 5 /* NewLineTrivia */; - result.push(this.dedentWhitespace(trivia, hasFollowingNewLine)); - continue; - } else if (trivia.kind() !== 5 /* NewLineTrivia */) { - this.abort(); - break; - } - } - - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - result.push(this.dedentMultiLineComment(trivia)); - continue; - } - - result.push(trivia); - if (trivia.kind() === 5 /* NewLineTrivia */) { - dedentNextWhitespace = true; - } - } - - if (dedentNextWhitespace) { - this.abort(); - } - - if (this.isAborted()) { - return triviaList; - } - - return TypeScript.Syntax.triviaList(result); - }; - - SyntaxDedenter.prototype.dedentSegment = function (segment, hasFollowingNewLineTrivia) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - - if (firstNonWhitespacePosition === segment.length) { - if (hasFollowingNewLineTrivia) { - return ""; - } - } else if (TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return segment.substring(firstNonWhitespacePosition); - } - - var firstNonWhitespaceColumn = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - - var newFirstNonWhitespaceColumn = TypeScript.MathPrototype.min(firstNonWhitespaceColumn, TypeScript.MathPrototype.max(firstNonWhitespaceColumn - this.dedentationAmount, this.minimumIndent)); - - if (newFirstNonWhitespaceColumn === firstNonWhitespaceColumn) { - this.abort(); - return segment; - } - - this.dedentationAmount = firstNonWhitespaceColumn - newFirstNonWhitespaceColumn; - TypeScript.Debug.assert(this.dedentationAmount >= 0); - - var indentationString = TypeScript.Indentation.indentationString(newFirstNonWhitespaceColumn, this.options); - - return indentationString + segment.substring(firstNonWhitespacePosition); - }; - - SyntaxDedenter.prototype.dedentWhitespace = function (trivia, hasFollowingNewLineTrivia) { - var newIndentation = this.dedentSegment(trivia.fullText(), hasFollowingNewLineTrivia); - return TypeScript.Syntax.whitespace(newIndentation); - }; - - SyntaxDedenter.prototype.dedentMultiLineComment = function (trivia) { - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - if (segments.length === 1) { - return trivia; - } - - for (var i = 1; i < segments.length; i++) { - var segment = segments[i]; - segments[i] = this.dedentSegment(segment, false); - } - - var result = segments.join(""); - - return TypeScript.Syntax.multiLineComment(result); - }; - - SyntaxDedenter.dedentNode = function (node, dedentFirstToken, dedentAmount, minimumIndent, options) { - var dedenter = new SyntaxDedenter(dedentFirstToken, dedentAmount, minimumIndent, options); - var result = node.accept(dedenter); - - if (dedenter.isAborted()) { - return node; - } - - return result; - }; - return SyntaxDedenter; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxDedenter = SyntaxDedenter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxIndenter = (function (_super) { - __extends(SyntaxIndenter, _super); - function SyntaxIndenter(indentFirstToken, indentationAmount, options) { - _super.call(this); - this.indentationAmount = indentationAmount; - this.options = options; - this.lastTriviaWasNewLine = indentFirstToken; - this.indentationTrivia = TypeScript.Indentation.indentationTrivia(this.indentationAmount, this.options); - } - SyntaxIndenter.prototype.visitToken = function (token) { - if (token.width() === 0) { - return token; - } - - var result = token; - if (this.lastTriviaWasNewLine) { - result = token.withLeadingTrivia(this.indentTriviaList(token.leadingTrivia())); - } - - this.lastTriviaWasNewLine = token.hasTrailingNewLine(); - return result; - }; - - SyntaxIndenter.prototype.indentTriviaList = function (triviaList) { - var result = []; - - var indentNextTrivia = true; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - var indentThisTrivia = indentNextTrivia; - indentNextTrivia = false; - - switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: - this.indentMultiLineComment(trivia, indentThisTrivia, result); - continue; - - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: - this.indentSingleLineOrSkippedText(trivia, indentThisTrivia, result); - continue; - - case 4 /* WhitespaceTrivia */: - this.indentWhitespace(trivia, indentThisTrivia, result); - continue; - - case 5 /* NewLineTrivia */: - result.push(trivia); - indentNextTrivia = true; - continue; - - default: - throw TypeScript.Errors.invalidOperation(); - } - } - - if (indentNextTrivia) { - result.push(this.indentationTrivia); - } - - return TypeScript.Syntax.triviaList(result); - }; - - SyntaxIndenter.prototype.indentSegment = function (segment) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - - if (firstNonWhitespacePosition < segment.length && TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return segment; - } - - var firstNonWhitespaceColumn = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - - var newFirstNonWhitespaceColumn = firstNonWhitespaceColumn + this.indentationAmount; - - var indentationString = TypeScript.Indentation.indentationString(newFirstNonWhitespaceColumn, this.options); - - return indentationString + segment.substring(firstNonWhitespacePosition); - }; - - SyntaxIndenter.prototype.indentWhitespace = function (trivia, indentThisTrivia, result) { - if (!indentThisTrivia) { - result.push(trivia); - return; - } - - var newIndentation = this.indentSegment(trivia.fullText()); - result.push(TypeScript.Syntax.whitespace(newIndentation)); - }; - - SyntaxIndenter.prototype.indentSingleLineOrSkippedText = function (trivia, indentThisTrivia, result) { - if (indentThisTrivia) { - result.push(this.indentationTrivia); - } - - result.push(trivia); - }; - - SyntaxIndenter.prototype.indentMultiLineComment = function (trivia, indentThisTrivia, result) { - if (indentThisTrivia) { - result.push(this.indentationTrivia); - } - - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - - for (var i = 1; i < segments.length; i++) { - segments[i] = this.indentSegment(segments[i]); - } - - var newText = segments.join(""); - result.push(TypeScript.Syntax.multiLineComment(newText)); - }; - - SyntaxIndenter.indentNode = function (node, indentFirstToken, indentAmount, options) { - var indenter = new SyntaxIndenter(indentFirstToken, indentAmount, options); - return node.accept(indenter); - }; - - SyntaxIndenter.indentNodes = function (nodes, indentFirstToken, indentAmount, options) { - var indenter = new SyntaxIndenter(indentFirstToken, indentAmount, options); - var result = TypeScript.ArrayUtilities.select(nodes, function (n) { - return n.accept(indenter); - }); - - return result; - }; - return SyntaxIndenter; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxIndenter = SyntaxIndenter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var VariableWidthTokenWithNoTrivia = (function () { - function VariableWidthTokenWithNoTrivia(fullText, kind) { - this._fullText = fullText; - this.tokenKind = kind; - } - VariableWidthTokenWithNoTrivia.prototype.clone = function () { - return new VariableWidthTokenWithNoTrivia(this._fullText, this.tokenKind); - }; - - VariableWidthTokenWithNoTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithNoTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithNoTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithNoTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithNoTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithNoTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithNoTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithNoTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithNoTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithNoTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithNoTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithNoTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithNoTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithNoTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithNoTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithNoTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithNoTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithNoTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithNoTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithNoTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithNoTrivia; - })(); - Syntax.VariableWidthTokenWithNoTrivia = VariableWidthTokenWithNoTrivia; - - var VariableWidthTokenWithLeadingTrivia = (function () { - function VariableWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - } - VariableWidthTokenWithLeadingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithLeadingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithLeadingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithLeadingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithLeadingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingComment = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithLeadingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithLeadingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithLeadingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithLeadingTrivia; - })(); - Syntax.VariableWidthTokenWithLeadingTrivia = VariableWidthTokenWithLeadingTrivia; - - var VariableWidthTokenWithTrailingTrivia = (function () { - function VariableWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._trailingTriviaInfo = trailingTriviaInfo; - } - VariableWidthTokenWithTrailingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithTrailingTrivia(this._fullText, this.tokenKind, this._trailingTriviaInfo); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithTrailingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingComment = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithTrailingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithTrailingTrivia; - })(); - Syntax.VariableWidthTokenWithTrailingTrivia = VariableWidthTokenWithTrailingTrivia; - - var VariableWidthTokenWithLeadingAndTrailingTrivia = (function () { - function VariableWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - this._trailingTriviaInfo = trailingTriviaInfo; - } - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithLeadingAndTrailingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo, this._trailingTriviaInfo); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithLeadingAndTrailingTrivia; - })(); - Syntax.VariableWidthTokenWithLeadingAndTrailingTrivia = VariableWidthTokenWithLeadingAndTrailingTrivia; - - var FixedWidthTokenWithNoTrivia = (function () { - function FixedWidthTokenWithNoTrivia(kind) { - this.tokenKind = kind; - } - FixedWidthTokenWithNoTrivia.prototype.clone = function () { - return new FixedWidthTokenWithNoTrivia(this.tokenKind); - }; - - FixedWidthTokenWithNoTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithNoTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithNoTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithNoTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithNoTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithNoTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithNoTrivia.prototype.fullText = function () { - return this.text(); - }; - - FixedWidthTokenWithNoTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithNoTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithNoTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithNoTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithNoTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithNoTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithNoTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithNoTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithNoTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithNoTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithNoTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithNoTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithNoTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithNoTrivia; - })(); - Syntax.FixedWidthTokenWithNoTrivia = FixedWidthTokenWithNoTrivia; - - var FixedWidthTokenWithLeadingTrivia = (function () { - function FixedWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - } - FixedWidthTokenWithLeadingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithLeadingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithLeadingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithLeadingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithLeadingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithLeadingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithLeadingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithLeadingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithLeadingTrivia; - })(); - Syntax.FixedWidthTokenWithLeadingTrivia = FixedWidthTokenWithLeadingTrivia; - - var FixedWidthTokenWithTrailingTrivia = (function () { - function FixedWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._trailingTriviaInfo = trailingTriviaInfo; - } - FixedWidthTokenWithTrailingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithTrailingTrivia(this._fullText, this.tokenKind, this._trailingTriviaInfo); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithTrailingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithTrailingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithTrailingTrivia; - })(); - Syntax.FixedWidthTokenWithTrailingTrivia = FixedWidthTokenWithTrailingTrivia; - - var FixedWidthTokenWithLeadingAndTrailingTrivia = (function () { - function FixedWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - this._trailingTriviaInfo = trailingTriviaInfo; - } - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithLeadingAndTrailingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo, this._trailingTriviaInfo); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithLeadingAndTrailingTrivia; - })(); - Syntax.FixedWidthTokenWithLeadingAndTrailingTrivia = FixedWidthTokenWithLeadingAndTrailingTrivia; - - function collectTokenTextElements(token, elements) { - token.leadingTrivia().collectTextElements(elements); - elements.push(token.text()); - token.trailingTrivia().collectTextElements(elements); - } - - function getTriviaWidth(value) { - return value >>> 2 /* TriviaFullWidthShift */; - } - - function hasTriviaComment(value) { - return (value & 2 /* TriviaCommentMask */) !== 0; - } - - function hasTriviaNewLine(value) { - return (value & 1 /* TriviaNewLineMask */) !== 0; - } - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - function isExpression(token) { - switch (token.tokenKind) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - - return false; - } - Syntax.isExpression = isExpression; - - function realizeToken(token) { - return new RealizedToken(token.tokenKind, token.leadingTrivia(), token.text(), token.value(), token.valueText(), token.trailingTrivia()); - } - Syntax.realizeToken = realizeToken; - - function convertToIdentifierName(token) { - TypeScript.Debug.assert(TypeScript.SyntaxFacts.isAnyKeyword(token.tokenKind)); - return new RealizedToken(11 /* IdentifierName */, token.leadingTrivia(), token.text(), token.text(), token.text(), token.trailingTrivia()); - } - Syntax.convertToIdentifierName = convertToIdentifierName; - - function tokenToJSON(token) { - var result = {}; - - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === token.kind()) { - result.kind = name; - break; - } - } - - result.width = token.width(); - if (token.fullWidth() !== token.width()) { - result.fullWidth = token.fullWidth(); - } - - result.text = token.text(); - - var value = token.value(); - if (value !== null) { - result.value = value; - result.valueText = token.valueText(); - } - - if (token.hasLeadingTrivia()) { - result.hasLeadingTrivia = true; - } - - if (token.hasLeadingComment()) { - result.hasLeadingComment = true; - } - - if (token.hasLeadingNewLine()) { - result.hasLeadingNewLine = true; - } - - if (token.hasLeadingSkippedText()) { - result.hasLeadingSkippedText = true; - } - - if (token.hasTrailingTrivia()) { - result.hasTrailingTrivia = true; - } - - if (token.hasTrailingComment()) { - result.hasTrailingComment = true; - } - - if (token.hasTrailingNewLine()) { - result.hasTrailingNewLine = true; - } - - if (token.hasTrailingSkippedText()) { - result.hasTrailingSkippedText = true; - } - - var trivia = token.leadingTrivia(); - if (trivia.count() > 0) { - result.leadingTrivia = trivia; - } - - trivia = token.trailingTrivia(); - if (trivia.count() > 0) { - result.trailingTrivia = trivia; - } - - return result; - } - Syntax.tokenToJSON = tokenToJSON; - - function value(token) { - return value1(token.tokenKind, token.text()); - } - Syntax.value = value; - - function hexValue(text, start, length) { - var intChar = 0; - for (var i = 0; i < length; i++) { - var ch2 = text.charCodeAt(start + i); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - break; - } - - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - } - - return intChar; - } - - var characterArray = []; - - function convertEscapes(text) { - characterArray.length = 0; - var result = ""; - - for (var i = 0, n = text.length; i < n; i++) { - var ch = text.charCodeAt(i); - - if (ch === 92 /* backslash */) { - i++; - if (i < n) { - ch = text.charCodeAt(i); - switch (ch) { - case 48 /* _0 */: - characterArray.push(0 /* nullCharacter */); - continue; - - case 98 /* b */: - characterArray.push(8 /* backspace */); - continue; - - case 102 /* f */: - characterArray.push(12 /* formFeed */); - continue; - - case 110 /* n */: - characterArray.push(10 /* lineFeed */); - continue; - - case 114 /* r */: - characterArray.push(13 /* carriageReturn */); - continue; - - case 116 /* t */: - characterArray.push(9 /* tab */); - continue; - - case 118 /* v */: - characterArray.push(11 /* verticalTab */); - continue; - - case 120 /* x */: - characterArray.push(hexValue(text, i + 1, 2)); - i += 2; - continue; - - case 117 /* u */: - characterArray.push(hexValue(text, i + 1, 4)); - i += 4; - continue; - - case 13 /* carriageReturn */: - var nextIndex = i + 1; - if (nextIndex < text.length && text.charCodeAt(nextIndex) === 10 /* lineFeed */) { - i++; - } - continue; - - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - continue; - - default: - } - } - } - - characterArray.push(ch); - - if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - characterArray.length = 0; - } - } - - if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - } - - return result; - } - - function massageEscapes(text) { - return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; - } - Syntax.massageEscapes = massageEscapes; - - function value1(kind, text) { - if (kind === 11 /* IdentifierName */) { - return massageEscapes(text); - } - - switch (kind) { - case 37 /* TrueKeyword */: - return true; - case 24 /* FalseKeyword */: - return false; - case 32 /* NullKeyword */: - return null; - } - - if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { - return TypeScript.SyntaxFacts.getText(kind); - } - - if (kind === 13 /* NumericLiteral */) { - return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); - } else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } else { - return massageEscapes(text.substr(1)); - } - } else if (kind === 12 /* RegularExpressionLiteral */) { - return regularExpressionValue(text); - } else if (kind === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - - function regularExpressionValue(text) { - try { - var lastSlash = text.lastIndexOf("/"); - var body = text.substring(1, lastSlash); - var flags = text.substring(lastSlash + 1); - return new RegExp(body, flags); - } catch (e) { - return null; - } - } - - function valueText1(kind, text) { - var value = value1(kind, text); - return value === null ? "" : value.toString(); - } - - function valueText(token) { - var value = token.value(); - return value === null ? "" : value.toString(); - } - Syntax.valueText = valueText; - - var EmptyToken = (function () { - function EmptyToken(kind) { - this.tokenKind = kind; - } - EmptyToken.prototype.clone = function () { - return new EmptyToken(this.tokenKind); - }; - - EmptyToken.prototype.kind = function () { - return this.tokenKind; - }; - - EmptyToken.prototype.isToken = function () { - return true; - }; - EmptyToken.prototype.isNode = function () { - return false; - }; - EmptyToken.prototype.isList = function () { - return false; - }; - EmptyToken.prototype.isSeparatedList = function () { - return false; - }; - - EmptyToken.prototype.childCount = function () { - return 0; - }; - - EmptyToken.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptyToken.prototype.toJSON = function (key) { - return tokenToJSON(this); - }; - EmptyToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - - EmptyToken.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - EmptyToken.prototype.firstToken = function () { - return this; - }; - EmptyToken.prototype.lastToken = function () { - return this; - }; - EmptyToken.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptyToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - - EmptyToken.prototype.fullWidth = function () { - return 0; - }; - EmptyToken.prototype.width = function () { - return 0; - }; - EmptyToken.prototype.text = function () { - return ""; - }; - EmptyToken.prototype.fullText = function () { - return ""; - }; - EmptyToken.prototype.value = function () { - return null; - }; - EmptyToken.prototype.valueText = function () { - return ""; - }; - - EmptyToken.prototype.hasLeadingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasLeadingComment = function () { - return false; - }; - EmptyToken.prototype.hasLeadingNewLine = function () { - return false; - }; - EmptyToken.prototype.hasLeadingSkippedText = function () { - return false; - }; - EmptyToken.prototype.leadingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.hasTrailingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasTrailingComment = function () { - return false; - }; - EmptyToken.prototype.hasTrailingNewLine = function () { - return false; - }; - EmptyToken.prototype.hasTrailingSkippedText = function () { - return false; - }; - EmptyToken.prototype.hasSkippedToken = function () { - return false; - }; - - EmptyToken.prototype.trailingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - EmptyToken.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - EmptyToken.prototype.realize = function () { - return realizeToken(this); - }; - EmptyToken.prototype.collectTextElements = function (elements) { - }; - - EmptyToken.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - EmptyToken.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - EmptyToken.prototype.isExpression = function () { - return isExpression(this); - }; - - EmptyToken.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return EmptyToken; - })(); - - function emptyToken(kind) { - return new EmptyToken(kind); - } - Syntax.emptyToken = emptyToken; - - var RealizedToken = (function () { - function RealizedToken(tokenKind, leadingTrivia, text, value, valueText, trailingTrivia) { - this.tokenKind = tokenKind; - this._leadingTrivia = leadingTrivia; - this._text = text; - this._value = value; - this._valueText = valueText; - this._trailingTrivia = trailingTrivia; - } - RealizedToken.prototype.clone = function () { - return new RealizedToken(this.tokenKind, this._leadingTrivia, this._text, this._value, this._valueText, this._trailingTrivia); - }; - - RealizedToken.prototype.kind = function () { - return this.tokenKind; - }; - RealizedToken.prototype.toJSON = function (key) { - return tokenToJSON(this); - }; - RealizedToken.prototype.firstToken = function () { - return this; - }; - RealizedToken.prototype.lastToken = function () { - return this; - }; - RealizedToken.prototype.isTypeScriptSpecific = function () { - return false; - }; - - RealizedToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - - RealizedToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - - RealizedToken.prototype.childCount = function () { - return 0; - }; - - RealizedToken.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - RealizedToken.prototype.isToken = function () { - return true; - }; - RealizedToken.prototype.isNode = function () { - return false; - }; - RealizedToken.prototype.isList = function () { - return false; - }; - RealizedToken.prototype.isSeparatedList = function () { - return false; - }; - RealizedToken.prototype.isTrivia = function () { - return false; - }; - RealizedToken.prototype.isTriviaList = function () { - return false; - }; - - RealizedToken.prototype.fullWidth = function () { - return this._leadingTrivia.fullWidth() + this.width() + this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.width = function () { - return this.text().length; - }; - - RealizedToken.prototype.text = function () { - return this._text; - }; - RealizedToken.prototype.fullText = function () { - return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); - }; - - RealizedToken.prototype.value = function () { - return this._value; - }; - RealizedToken.prototype.valueText = function () { - return this._valueText; - }; - - RealizedToken.prototype.hasLeadingTrivia = function () { - return this._leadingTrivia.count() > 0; - }; - RealizedToken.prototype.hasLeadingComment = function () { - return this._leadingTrivia.hasComment(); - }; - RealizedToken.prototype.hasLeadingNewLine = function () { - return this._leadingTrivia.hasNewLine(); - }; - RealizedToken.prototype.hasLeadingSkippedText = function () { - return this._leadingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.leadingTriviaWidth = function () { - return this._leadingTrivia.fullWidth(); - }; - - RealizedToken.prototype.hasTrailingTrivia = function () { - return this._trailingTrivia.count() > 0; - }; - RealizedToken.prototype.hasTrailingComment = function () { - return this._trailingTrivia.hasComment(); - }; - RealizedToken.prototype.hasTrailingNewLine = function () { - return this._trailingTrivia.hasNewLine(); - }; - RealizedToken.prototype.hasTrailingSkippedText = function () { - return this._trailingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.trailingTriviaWidth = function () { - return this._trailingTrivia.fullWidth(); - }; - - RealizedToken.prototype.hasSkippedToken = function () { - return this.hasLeadingSkippedText() || this.hasTrailingSkippedText(); - }; - - RealizedToken.prototype.leadingTrivia = function () { - return this._leadingTrivia; - }; - RealizedToken.prototype.trailingTrivia = function () { - return this._trailingTrivia; - }; - - RealizedToken.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - RealizedToken.prototype.collectTextElements = function (elements) { - this.leadingTrivia().collectTextElements(elements); - elements.push(this.text()); - this.trailingTrivia().collectTextElements(elements); - }; - - RealizedToken.prototype.withLeadingTrivia = function (leadingTrivia) { - return new RealizedToken(this.tokenKind, leadingTrivia, this._text, this._value, this._valueText, this._trailingTrivia); - }; - - RealizedToken.prototype.withTrailingTrivia = function (trailingTrivia) { - return new RealizedToken(this.tokenKind, this._leadingTrivia, this._text, this._value, this._valueText, trailingTrivia); - }; - - RealizedToken.prototype.isExpression = function () { - return isExpression(this); - }; - - RealizedToken.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return RealizedToken; - })(); - - function token(kind, info) { - if (typeof info === "undefined") { info = null; } - var text = (info !== null && info.text !== undefined) ? info.text : TypeScript.SyntaxFacts.getText(kind); - - return new RealizedToken(kind, TypeScript.Syntax.triviaList(info === null ? null : info.leadingTrivia), text, value1(kind, text), valueText1(kind, text), TypeScript.Syntax.triviaList(info === null ? null : info.trailingTrivia)); - } - Syntax.token = token; - - function identifier(text, info) { - if (typeof info === "undefined") { info = null; } - info = info || {}; - info.text = text; - return token(11 /* IdentifierName */, info); - } - Syntax.identifier = identifier; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTokenReplacer = (function (_super) { - __extends(SyntaxTokenReplacer, _super); - function SyntaxTokenReplacer(token1, token2) { - _super.call(this); - this.token1 = token1; - this.token2 = token2; - } - SyntaxTokenReplacer.prototype.visitToken = function (token) { - if (token === this.token1) { - var result = this.token2; - this.token1 = null; - this.token2 = null; - - return result; - } - - return token; - }; - - SyntaxTokenReplacer.prototype.visitNode = function (node) { - if (this.token1 === null) { - return node; - } - - return _super.prototype.visitNode.call(this, node); - }; - - SyntaxTokenReplacer.prototype.visitList = function (list) { - if (this.token1 === null) { - return list; - } - - return _super.prototype.visitList.call(this, list); - }; - - SyntaxTokenReplacer.prototype.visitSeparatedList = function (list) { - if (this.token1 === null) { - return list; - } - - return _super.prototype.visitSeparatedList.call(this, list); - }; - return SyntaxTokenReplacer; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxTokenReplacer = SyntaxTokenReplacer; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var AbstractTrivia = (function () { - function AbstractTrivia(_kind) { - this._kind = _kind; - } - AbstractTrivia.prototype.fullWidth = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.fullText = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.toJSON = function (key) { - var result = {}; - - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === this._kind) { - result.kind = name; - break; - } - } - - if (this.isSkippedToken()) { - result.skippedToken = this.skippedToken(); - } else { - result.text = this.fullText(); - } - return result; - }; - - AbstractTrivia.prototype.kind = function () { - return this._kind; - }; - - AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; - }; - - AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; - }; - - AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; - }; - - AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; - }; - - AbstractTrivia.prototype.collectTextElements = function (elements) { - elements.push(this.fullText()); - }; - return AbstractTrivia; - })(); - - var NormalTrivia = (function (_super) { - __extends(NormalTrivia, _super); - function NormalTrivia(kind, _text) { - _super.call(this, kind); - this._text = _text; - } - NormalTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - - NormalTrivia.prototype.fullText = function () { - return this._text; - }; - - NormalTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return NormalTrivia; - })(AbstractTrivia); - - var SkippedTokenTrivia = (function (_super) { - __extends(SkippedTokenTrivia, _super); - function SkippedTokenTrivia(_skippedToken) { - _super.call(this, 8 /* SkippedTokenTrivia */); - this._skippedToken = _skippedToken; - } - SkippedTokenTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - - SkippedTokenTrivia.prototype.fullText = function () { - return this.skippedToken().fullText(); - }; - - SkippedTokenTrivia.prototype.skippedToken = function () { - return this._skippedToken; - }; - return SkippedTokenTrivia; - })(AbstractTrivia); - - var DeferredTrivia = (function (_super) { - __extends(DeferredTrivia, _super); - function DeferredTrivia(kind, _text, _fullStart, _fullWidth) { - _super.call(this, kind); - this._text = _text; - this._fullStart = _fullStart; - this._fullWidth = _fullWidth; - this._fullText = null; - } - DeferredTrivia.prototype.fullWidth = function () { - return this._fullWidth; - }; - - DeferredTrivia.prototype.fullText = function () { - if (!this._fullText) { - this._fullText = this._text.substr(this._fullStart, this._fullWidth, false); - this._text = null; - } - - return this._fullText; - }; - - DeferredTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return DeferredTrivia; - })(AbstractTrivia); - - function deferredTrivia(kind, text, fullStart, fullWidth) { - return new DeferredTrivia(kind, text, fullStart, fullWidth); - } - Syntax.deferredTrivia = deferredTrivia; - - function trivia(kind, text) { - return new NormalTrivia(kind, text); - } - Syntax.trivia = trivia; - - function skippedTokenTrivia(token) { - TypeScript.Debug.assert(!token.hasLeadingTrivia()); - TypeScript.Debug.assert(!token.hasTrailingTrivia()); - TypeScript.Debug.assert(token.fullWidth() > 0); - return new SkippedTokenTrivia(token); - } - Syntax.skippedTokenTrivia = skippedTokenTrivia; - - function spaces(count) { - return trivia(4 /* WhitespaceTrivia */, TypeScript.StringUtilities.repeat(" ", count)); - } - Syntax.spaces = spaces; - - function whitespace(text) { - return trivia(4 /* WhitespaceTrivia */, text); - } - Syntax.whitespace = whitespace; - - function multiLineComment(text) { - return trivia(6 /* MultiLineCommentTrivia */, text); - } - Syntax.multiLineComment = multiLineComment; - - function singleLineComment(text) { - return trivia(7 /* SingleLineCommentTrivia */, text); - } - Syntax.singleLineComment = singleLineComment; - - Syntax.spaceTrivia = spaces(1); - Syntax.lineFeedTrivia = trivia(5 /* NewLineTrivia */, "\n"); - Syntax.carriageReturnTrivia = trivia(5 /* NewLineTrivia */, "\r"); - Syntax.carriageReturnLineFeedTrivia = trivia(5 /* NewLineTrivia */, "\r\n"); - - function splitMultiLineCommentTriviaIntoMultipleLines(trivia) { - var result = []; - - var triviaText = trivia.fullText(); - var currentIndex = 0; - - for (var i = 0; i < triviaText.length; i++) { - var ch = triviaText.charCodeAt(i); - - var isCarriageReturnLineFeed = false; - switch (ch) { - case 13 /* carriageReturn */: - if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === 10 /* lineFeed */) { - i++; - } - - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - result.push(triviaText.substring(currentIndex, i + 1)); - - currentIndex = i + 1; - continue; - } - } - - result.push(triviaText.substring(currentIndex)); - return result; - } - Syntax.splitMultiLineCommentTriviaIntoMultipleLines = splitMultiLineCommentTriviaIntoMultipleLines; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - Syntax.emptyTriviaList = { - kind: function () { - return 3 /* TriviaList */; - }, - count: function () { - return 0; - }, - syntaxTriviaAt: function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }, - last: function () { - throw TypeScript.Errors.argumentOutOfRange("index"); - }, - fullWidth: function () { - return 0; - }, - fullText: function () { - return ""; - }, - hasComment: function () { - return false; - }, - hasNewLine: function () { - return false; - }, - hasSkippedToken: function () { - return false; - }, - toJSON: function (key) { - return []; - }, - collectTextElements: function (elements) { - }, - toArray: function () { - return []; - }, - concat: function (trivia) { - return trivia; - } - }; - - function concatTrivia(list1, list2) { - if (list1.count() === 0) { - return list2; - } - - if (list2.count() === 0) { - return list1; - } - - var trivia = list1.toArray(); - trivia.push.apply(trivia, list2.toArray()); - - return triviaList(trivia); - } - - function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; - } - - var SingletonSyntaxTriviaList = (function () { - function SingletonSyntaxTriviaList(item) { - this.item = item; - } - SingletonSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - - SingletonSyntaxTriviaList.prototype.count = function () { - return 1; - }; - - SingletonSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSyntaxTriviaList.prototype.last = function () { - return this.item; - }; - - SingletonSyntaxTriviaList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSyntaxTriviaList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSyntaxTriviaList.prototype.hasComment = function () { - return isComment(this.item); - }; - - SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; - }; - - SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; - }; - - SingletonSyntaxTriviaList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSyntaxTriviaList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSyntaxTriviaList.prototype.toArray = function () { - return [this.item]; - }; - - SingletonSyntaxTriviaList.prototype.concat = function (trivia) { - return concatTrivia(this, trivia); - }; - return SingletonSyntaxTriviaList; - })(); - - var NormalSyntaxTriviaList = (function () { - function NormalSyntaxTriviaList(trivia) { - this.trivia = trivia; - } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - - NormalSyntaxTriviaList.prototype.count = function () { - return this.trivia.length; - }; - - NormalSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index < 0 || index >= this.trivia.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.trivia[index]; - }; - - NormalSyntaxTriviaList.prototype.last = function () { - return this.trivia[this.trivia.length - 1]; - }; - - NormalSyntaxTriviaList.prototype.fullWidth = function () { - return TypeScript.ArrayUtilities.sum(this.trivia, function (t) { - return t.fullWidth(); - }); - }; - - NormalSyntaxTriviaList.prototype.fullText = function () { - var result = ""; - - for (var i = 0, n = this.trivia.length; i < n; i++) { - result += this.trivia[i].fullText(); - } - - return result; - }; - - NormalSyntaxTriviaList.prototype.hasComment = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (isComment(this.trivia[i])) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.hasNewLine = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.toJSON = function (key) { - return this.trivia; - }; - - NormalSyntaxTriviaList.prototype.collectTextElements = function (elements) { - for (var i = 0; i < this.trivia.length; i++) { - this.trivia[i].collectTextElements(elements); - } - }; - - NormalSyntaxTriviaList.prototype.toArray = function () { - return this.trivia.slice(0); - }; - - NormalSyntaxTriviaList.prototype.concat = function (trivia) { - return concatTrivia(this, trivia); - }; - return NormalSyntaxTriviaList; - })(); - - function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { - return Syntax.emptyTriviaList; - } - - if (trivia.length === 1) { - return new SingletonSyntaxTriviaList(trivia[0]); - } - - return new NormalSyntaxTriviaList(trivia); - } - Syntax.triviaList = triviaList; - - Syntax.spaceTriviaList = triviaList([TypeScript.Syntax.spaceTrivia]); - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxUtilities = (function () { - function SyntaxUtilities() { - } - SyntaxUtilities.isAngleBracket = function (positionedElement) { - var element = positionedElement.element(); - var parent = positionedElement.parentElement(); - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { - switch (parent.kind()) { - case 228 /* TypeArgumentList */: - case 229 /* TypeParameterList */: - case 220 /* CastExpression */: - return true; - } - } - - return false; - }; - - SyntaxUtilities.getToken = function (list, kind) { - for (var i = 0, n = list.childCount(); i < n; i++) { - var token = list.childAt(i); - if (token.tokenKind === kind) { - return token; - } - } - - return null; - }; - - SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; - }; - - SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; - }; - - SyntaxUtilities.getExportKeyword = function (moduleElement) { - switch (moduleElement.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - case 128 /* InterfaceDeclaration */: - case 133 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); - default: - return null; - } - }; - - SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { - if (!positionNode) { - return false; - } - - var node = positionNode.node(); - switch (node.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - return true; - } - - case 133 /* ImportDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - if (node.isClassElement() || node.isModuleElement()) { - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode()); - } - - case 243 /* EnumElement */: - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode().containingNode()); - - default: - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode()); - } - }; - return SyntaxUtilities; - })(); - TypeScript.SyntaxUtilities = SyntaxUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxVisitor = (function () { - function SyntaxVisitor() { - } - SyntaxVisitor.prototype.defaultVisit = function (node) { - return null; - }; - - SyntaxVisitor.prototype.visitToken = function (token) { - return this.defaultVisit(token); - }; - - SyntaxVisitor.prototype.visitSourceUnit = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExternalModuleReference = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitModuleNameModuleReference = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitImportDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExportAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitClassDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitInterfaceDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitHeritageClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitModuleDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableDeclarator = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEqualsValueClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPrefixUnaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArrayLiteralExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitOmittedExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParenthesizedExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitQualifiedName = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeArgumentList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructorType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArrayType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitGenericType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeQuery = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeAnnotation = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBlock = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParameter = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberAccessExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPostfixUnaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitElementAccessExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitInvocationExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArgumentList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBinaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConditionalExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMethodSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIndexSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPropertySignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCallSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParameterList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeParameterList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeParameter = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstraint = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitElseClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIfStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExpressionStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructorDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitGetAccessor = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSetAccessor = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberVariableDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIndexMemberDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitThrowStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitReturnStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectCreationExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSwitchStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCaseSwitchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDefaultSwitchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBreakStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitContinueStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitForStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitForInStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitWhileStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitWithStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEnumDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEnumElement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCastExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectLiteralExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSimplePropertyAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEmptyStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTryStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCatchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFinallyClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitLabeledStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDoStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeOfExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDeleteExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVoidExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDebuggerStatement = function (node) { - return this.defaultVisit(node); - }; - return SyntaxVisitor; - })(); - TypeScript.SyntaxVisitor = SyntaxVisitor; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxWalker = (function () { - function SyntaxWalker() { - } - SyntaxWalker.prototype.visitToken = function (token) { - }; - - SyntaxWalker.prototype.visitNode = function (node) { - node.accept(this); - }; - - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (nodeOrToken.isToken()) { - this.visitToken(nodeOrToken); - } else { - this.visitNode(nodeOrToken); - } - }; - - SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { - return; - } - - this.visitToken(token); - }; - - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - - this.visitNode(node); - }; - - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - - this.visitNodeOrToken(nodeOrToken); - }; - - SyntaxWalker.prototype.visitList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - this.visitNodeOrToken(list.childAt(i)); - } - }; - - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - this.visitNodeOrToken(item); - } - }; - - SyntaxWalker.prototype.visitSourceUnit = function (node) { - this.visitList(node.moduleElements); - this.visitToken(node.endOfFileToken); - }; - - SyntaxWalker.prototype.visitExternalModuleReference = function (node) { - this.visitToken(node.requireKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.stringLiteral); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); - }; - - SyntaxWalker.prototype.visitImportDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.importKeyword); - this.visitToken(node.identifier); - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitExportAssignment = function (node) { - this.visitToken(node.exportKeyword); - this.visitToken(node.equalsToken); - this.visitToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitClassDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.classKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitToken(node.openBraceToken); - this.visitList(node.classElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.interfaceKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitNode(node.body); - }; - - SyntaxWalker.prototype.visitHeritageClause = function (node) { - this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); - }; - - SyntaxWalker.prototype.visitModuleDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); - this.visitToken(node.openBraceToken); - this.visitList(node.moduleElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.functionKeyword); - this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitVariableStatement = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitVariableDeclaration = function (node) { - this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); - }; - - SyntaxWalker.prototype.visitVariableDeclarator = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitEqualsValueClause = function (node) { - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); - }; - - SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); - }; - - SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitOmittedExpression = function (node) { - }; - - SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.dotToken); - this.visitToken(node.right); - }; - - SyntaxWalker.prototype.visitTypeArgumentList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); - this.visitToken(node.greaterThanToken); - }; - - SyntaxWalker.prototype.visitConstructorType = function (node) { - this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitObjectType = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); - this.visitToken(node.openBracketToken); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); - }; - - SyntaxWalker.prototype.visitTypeQuery = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); - }; - - SyntaxWalker.prototype.visitTypeAnnotation = function (node) { - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitBlock = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.statements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitParameter = function (node) { - this.visitOptionalToken(node.dotDotDotToken); - this.visitList(node.modifiers); - this.visitToken(node.identifier); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.dotToken); - this.visitToken(node.name); - }; - - SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); - this.visitToken(node.operatorToken); - }; - - SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); - }; - - SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); - }; - - SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); - this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); - }; - - SyntaxWalker.prototype.visitConstructSignature = function (node) { - this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); - }; - - SyntaxWalker.prototype.visitMethodSignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); - }; - - SyntaxWalker.prototype.visitIndexSignature = function (node) { - this.visitToken(node.openBracketToken); - this.visitNode(node.parameter); - this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitPropertySignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitParameterList = function (node) { - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitTypeParameterList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); - this.visitToken(node.greaterThanToken); - }; - - SyntaxWalker.prototype.visitTypeParameter = function (node) { - this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); - }; - - SyntaxWalker.prototype.visitConstraint = function (node) { - this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitElseClause = function (node) { - this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitIfStatement = function (node) { - this.visitToken(node.ifKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); - }; - - SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitGetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitSetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.parameterList); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.indexSignature); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitThrowStatement = function (node) { - this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitReturnStatement = function (node) { - this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { - this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); - }; - - SyntaxWalker.prototype.visitSwitchStatement = function (node) { - this.visitToken(node.switchKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitToken(node.openBraceToken); - this.visitList(node.switchClauses); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { - this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - - SyntaxWalker.prototype.visitDefaultSwitchClause = function (node) { - this.visitToken(node.defaultKeyword); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - - SyntaxWalker.prototype.visitBreakStatement = function (node) { - this.visitToken(node.breakKeyword); - this.visitOptionalToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitContinueStatement = function (node) { - this.visitToken(node.continueKeyword); - this.visitOptionalToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitForStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); - this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); - this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitForInStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); - this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitWhileStatement = function (node) { - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitWithStatement = function (node) { - this.visitToken(node.withKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitEnumDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.enumKeyword); - this.visitToken(node.identifier); - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitEnumElement = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitCastExpression = function (node) { - this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); - this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitFunctionExpression = function (node) { - this.visitToken(node.functionKeyword); - this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitEmptyStatement = function (node) { - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitTryStatement = function (node) { - this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); - }; - - SyntaxWalker.prototype.visitCatchClause = function (node) { - this.visitToken(node.catchKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); - this.visitToken(node.closeParenToken); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitFinallyClause = function (node) { - this.visitToken(node.finallyKeyword); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitLabeledStatement = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitDoStatement = function (node) { - this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitTypeOfExpression = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitDeleteExpression = function (node) { - this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitVoidExpression = function (node) { - this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitDebuggerStatement = function (node) { - this.visitToken(node.debuggerKeyword); - this.visitToken(node.semicolonToken); - }; - return SyntaxWalker; - })(); - TypeScript.SyntaxWalker = SyntaxWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PositionTrackingWalker = (function (_super) { - __extends(PositionTrackingWalker, _super); - function PositionTrackingWalker() { - _super.apply(this, arguments); - this._position = 0; - } - PositionTrackingWalker.prototype.visitToken = function (token) { - this._position += token.fullWidth(); - }; - - PositionTrackingWalker.prototype.position = function () { - return this._position; - }; - - PositionTrackingWalker.prototype.skip = function (element) { - this._position += element.fullWidth(); - }; - return PositionTrackingWalker; - })(TypeScript.SyntaxWalker); - TypeScript.PositionTrackingWalker = PositionTrackingWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxInformationMap = (function (_super) { - __extends(SyntaxInformationMap, _super); - function SyntaxInformationMap(trackParents, trackPreviousToken) { - _super.call(this); - this.trackParents = trackParents; - this.trackPreviousToken = trackPreviousToken; - this.tokenToInformation = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this.elementToPosition = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this._previousToken = null; - this._previousTokenInformation = null; - this._currentPosition = 0; - this._elementToParent = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this._parentStack = []; - this._parentStack.push(null); - } - SyntaxInformationMap.create = function (node, trackParents, trackPreviousToken) { - var map = new SyntaxInformationMap(trackParents, trackPreviousToken); - map.visitNode(node); - return map; - }; - - SyntaxInformationMap.prototype.visitNode = function (node) { - this.trackParents && this._elementToParent.add(node, TypeScript.ArrayUtilities.last(this._parentStack)); - this.elementToPosition.add(node, this._currentPosition); - - this.trackParents && this._parentStack.push(node); - _super.prototype.visitNode.call(this, node); - this.trackParents && this._parentStack.pop(); - }; - - SyntaxInformationMap.prototype.visitToken = function (token) { - this.trackParents && this._elementToParent.add(token, TypeScript.ArrayUtilities.last(this._parentStack)); - - if (this.trackPreviousToken) { - var tokenInformation = { - previousToken: this._previousToken, - nextToken: null - }; - - if (this._previousTokenInformation !== null) { - this._previousTokenInformation.nextToken = token; - } - - this._previousToken = token; - this._previousTokenInformation = tokenInformation; - - this.tokenToInformation.add(token, tokenInformation); - } - - this.elementToPosition.add(token, this._currentPosition); - this._currentPosition += token.fullWidth(); - }; - - SyntaxInformationMap.prototype.parent = function (element) { - return this._elementToParent.get(element); - }; - - SyntaxInformationMap.prototype.fullStart = function (element) { - return this.elementToPosition.get(element); - }; - - SyntaxInformationMap.prototype.start = function (element) { - return this.fullStart(element) + element.leadingTriviaWidth(); - }; - - SyntaxInformationMap.prototype.end = function (element) { - return this.start(element) + element.width(); - }; - - SyntaxInformationMap.prototype.previousToken = function (token) { - return this.tokenInformation(token).previousToken; - }; - - SyntaxInformationMap.prototype.tokenInformation = function (token) { - return this.tokenToInformation.get(token); - }; - - SyntaxInformationMap.prototype.firstTokenInLineContainingToken = function (token) { - var current = token; - while (true) { - var information = this.tokenInformation(current); - if (this.isFirstTokenInLineWorker(information)) { - break; - } - - current = information.previousToken; - } - - return current; - }; - - SyntaxInformationMap.prototype.isFirstTokenInLine = function (token) { - var information = this.tokenInformation(token); - return this.isFirstTokenInLineWorker(information); - }; - - SyntaxInformationMap.prototype.isFirstTokenInLineWorker = function (information) { - return information.previousToken === null || information.previousToken.hasTrailingNewLine(); - }; - return SyntaxInformationMap; - })(TypeScript.SyntaxWalker); - TypeScript.SyntaxInformationMap = SyntaxInformationMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNodeInvariantsChecker = (function (_super) { - __extends(SyntaxNodeInvariantsChecker, _super); - function SyntaxNodeInvariantsChecker() { - _super.apply(this, arguments); - this.tokenTable = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - } - SyntaxNodeInvariantsChecker.checkInvariants = function (node) { - node.accept(new SyntaxNodeInvariantsChecker()); - }; - - SyntaxNodeInvariantsChecker.prototype.visitToken = function (token) { - this.tokenTable.add(token, token); - }; - return SyntaxNodeInvariantsChecker; - })(TypeScript.SyntaxWalker); - TypeScript.SyntaxNodeInvariantsChecker = SyntaxNodeInvariantsChecker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } else { - this.skip(node); - } - }; - return DepthLimitedWalker; - })(TypeScript.PositionTrackingWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Parser) { - - - var ExpressionPrecedence; - (function (ExpressionPrecedence) { - ExpressionPrecedence[ExpressionPrecedence["CommaExpressionPrecedence"] = 1] = "CommaExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["AssignmentExpressionPrecedence"] = 2] = "AssignmentExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["ConditionalExpressionPrecedence"] = 3] = "ConditionalExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["ArrowFunctionPrecedence"] = 4] = "ArrowFunctionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["LogicalOrExpressionPrecedence"] = 5] = "LogicalOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["LogicalAndExpressionPrecedence"] = 6] = "LogicalAndExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseOrExpressionPrecedence"] = 7] = "BitwiseOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseExclusiveOrExpressionPrecedence"] = 8] = "BitwiseExclusiveOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseAndExpressionPrecedence"] = 9] = "BitwiseAndExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["EqualityExpressionPrecedence"] = 10] = "EqualityExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["RelationalExpressionPrecedence"] = 11] = "RelationalExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["ShiftExpressionPrecdence"] = 12] = "ShiftExpressionPrecdence"; - ExpressionPrecedence[ExpressionPrecedence["AdditiveExpressionPrecedence"] = 13] = "AdditiveExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["MultiplicativeExpressionPrecedence"] = 14] = "MultiplicativeExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["UnaryExpressionPrecedence"] = 15] = "UnaryExpressionPrecedence"; - })(ExpressionPrecedence || (ExpressionPrecedence = {})); - - var ListParsingState; - (function (ListParsingState) { - ListParsingState[ListParsingState["SourceUnit_ModuleElements"] = 1 << 0] = "SourceUnit_ModuleElements"; - ListParsingState[ListParsingState["ClassDeclaration_ClassElements"] = 1 << 1] = "ClassDeclaration_ClassElements"; - ListParsingState[ListParsingState["ModuleDeclaration_ModuleElements"] = 1 << 2] = "ModuleDeclaration_ModuleElements"; - ListParsingState[ListParsingState["SwitchStatement_SwitchClauses"] = 1 << 3] = "SwitchStatement_SwitchClauses"; - ListParsingState[ListParsingState["SwitchClause_Statements"] = 1 << 4] = "SwitchClause_Statements"; - ListParsingState[ListParsingState["Block_Statements"] = 1 << 5] = "Block_Statements"; - ListParsingState[ListParsingState["TryBlock_Statements"] = 1 << 6] = "TryBlock_Statements"; - ListParsingState[ListParsingState["CatchBlock_Statements"] = 1 << 7] = "CatchBlock_Statements"; - ListParsingState[ListParsingState["EnumDeclaration_EnumElements"] = 1 << 8] = "EnumDeclaration_EnumElements"; - ListParsingState[ListParsingState["ObjectType_TypeMembers"] = 1 << 9] = "ObjectType_TypeMembers"; - ListParsingState[ListParsingState["ClassOrInterfaceDeclaration_HeritageClauses"] = 1 << 10] = "ClassOrInterfaceDeclaration_HeritageClauses"; - ListParsingState[ListParsingState["HeritageClause_TypeNameList"] = 1 << 11] = "HeritageClause_TypeNameList"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_AllowIn"] = 1 << 12] = "VariableDeclaration_VariableDeclarators_AllowIn"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_DisallowIn"] = 1 << 13] = "VariableDeclaration_VariableDeclarators_DisallowIn"; - ListParsingState[ListParsingState["ArgumentList_AssignmentExpressions"] = 1 << 14] = "ArgumentList_AssignmentExpressions"; - ListParsingState[ListParsingState["ObjectLiteralExpression_PropertyAssignments"] = 1 << 15] = "ObjectLiteralExpression_PropertyAssignments"; - ListParsingState[ListParsingState["ArrayLiteralExpression_AssignmentExpressions"] = 1 << 16] = "ArrayLiteralExpression_AssignmentExpressions"; - ListParsingState[ListParsingState["ParameterList_Parameters"] = 1 << 17] = "ParameterList_Parameters"; - ListParsingState[ListParsingState["TypeArgumentList_Types"] = 1 << 18] = "TypeArgumentList_Types"; - ListParsingState[ListParsingState["TypeParameterList_TypeParameters"] = 1 << 19] = "TypeParameterList_TypeParameters"; - - ListParsingState[ListParsingState["FirstListParsingState"] = ListParsingState.SourceUnit_ModuleElements] = "FirstListParsingState"; - ListParsingState[ListParsingState["LastListParsingState"] = ListParsingState.TypeParameterList_TypeParameters] = "LastListParsingState"; - })(ListParsingState || (ListParsingState = {})); - - var SyntaxCursor = (function () { - function SyntaxCursor(sourceUnit) { - this._elements = []; - this._index = 0; - this._pinCount = 0; - sourceUnit.insertChildrenInto(this._elements, 0); - } - SyntaxCursor.prototype.isFinished = function () { - return this._index === this._elements.length; - }; - - SyntaxCursor.prototype.currentElement = function () { - if (this.isFinished()) { - return null; - } - - return this._elements[this._index]; - }; - - SyntaxCursor.prototype.currentNode = function () { - var element = this.currentElement(); - return element !== null && element.isNode() ? element : null; - }; - - SyntaxCursor.prototype.moveToFirstChild = function () { - if (this.isFinished()) { - return; - } - - var element = this._elements[this._index]; - if (element.isToken()) { - return; - } - - var node = element; - - this._elements.splice(this._index, 1); - - node.insertChildrenInto(this._elements, this._index); - }; - - SyntaxCursor.prototype.moveToNextSibling = function () { - if (this.isFinished()) { - return; - } - - if (this._pinCount > 0) { - this._index++; - return; - } - - this._elements.shift(); - }; - - SyntaxCursor.prototype.getAndPinCursorIndex = function () { - this._pinCount++; - return this._index; - }; - - SyntaxCursor.prototype.releaseAndUnpinCursorIndex = function (index) { - this._pinCount--; - if (this._pinCount === 0) { - } - }; - - SyntaxCursor.prototype.rewindToPinnedCursorIndex = function (index) { - this._index = index; - }; - - SyntaxCursor.prototype.pinCount = function () { - return this._pinCount; - }; - - SyntaxCursor.prototype.moveToFirstToken = function () { - var element; - - while (!this.isFinished()) { - element = this.currentElement(); - if (element.isNode()) { - this.moveToFirstChild(); - continue; - } - - return; - } - }; - - SyntaxCursor.prototype.currentToken = function () { - this.moveToFirstToken(); - if (this.isFinished()) { - return null; - } - - var element = this.currentElement(); - - return element; - }; - - SyntaxCursor.prototype.peekToken = function (n) { - this.moveToFirstToken(); - var pin = this.getAndPinCursorIndex(); - - for (var i = 0; i < n; i++) { - this.moveToNextSibling(); - this.moveToFirstToken(); - } - - var result = this.currentToken(); - this.rewindToPinnedCursorIndex(pin); - this.releaseAndUnpinCursorIndex(pin); - - return result; - }; - return SyntaxCursor; - })(); - - - - var NormalParserSource = (function () { - function NormalParserSource(fileName, text, languageVersion) { - this._previousToken = null; - this._absolutePosition = 0; - this._tokenDiagnostics = []; - this.rewindPointPool = []; - this.rewindPointPoolCount = 0; - this.slidingWindow = new TypeScript.SlidingWindow(this, TypeScript.ArrayUtilities.createArray(32, null), null); - this.scanner = new TypeScript.Scanner(fileName, text, languageVersion); - } - NormalParserSource.prototype.currentNode = function () { - return null; - }; - - NormalParserSource.prototype.moveToNextNode = function () { - throw TypeScript.Errors.invalidOperation(); - }; - - NormalParserSource.prototype.absolutePosition = function () { - return this._absolutePosition; - }; - - NormalParserSource.prototype.previousToken = function () { - return this._previousToken; - }; - - NormalParserSource.prototype.tokenDiagnostics = function () { - return this._tokenDiagnostics; - }; - - NormalParserSource.prototype.getOrCreateRewindPoint = function () { - if (this.rewindPointPoolCount === 0) { - return {}; - } - - this.rewindPointPoolCount--; - var result = this.rewindPointPool[this.rewindPointPoolCount]; - this.rewindPointPool[this.rewindPointPoolCount] = null; - return result; - }; - - NormalParserSource.prototype.getRewindPoint = function () { - var slidingWindowIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - var rewindPoint = this.getOrCreateRewindPoint(); - - rewindPoint.slidingWindowIndex = slidingWindowIndex; - rewindPoint.previousToken = this._previousToken; - rewindPoint.absolutePosition = this._absolutePosition; - - rewindPoint.pinCount = this.slidingWindow.pinCount(); - - return rewindPoint; - }; - - NormalParserSource.prototype.isPinned = function () { - return this.slidingWindow.pinCount() > 0; - }; - - NormalParserSource.prototype.rewind = function (rewindPoint) { - this.slidingWindow.rewindToPinnedIndex(rewindPoint.slidingWindowIndex); - - this._previousToken = rewindPoint.previousToken; - this._absolutePosition = rewindPoint.absolutePosition; - }; - - NormalParserSource.prototype.releaseRewindPoint = function (rewindPoint) { - this.slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint.absoluteIndex); - - this.rewindPointPool[this.rewindPointPoolCount] = rewindPoint; - this.rewindPointPoolCount++; - }; - - NormalParserSource.prototype.fetchMoreItems = function (allowRegularExpression, sourceIndex, window, destinationIndex, spaceAvailable) { - window[destinationIndex] = this.scanner.scan(this._tokenDiagnostics, allowRegularExpression); - return 1; - }; - - NormalParserSource.prototype.peekToken = function (n) { - return this.slidingWindow.peekItemN(n); - }; - - NormalParserSource.prototype.moveToNextToken = function () { - var currentToken = this.currentToken(); - this._absolutePosition += currentToken.fullWidth(); - this._previousToken = currentToken; - - this.slidingWindow.moveToNextItem(); - }; - - NormalParserSource.prototype.currentToken = function () { - return this.slidingWindow.currentItem(false); - }; - - NormalParserSource.prototype.removeDiagnosticsOnOrAfterPosition = function (position) { - var tokenDiagnosticsLength = this._tokenDiagnostics.length; - while (tokenDiagnosticsLength > 0) { - var diagnostic = this._tokenDiagnostics[tokenDiagnosticsLength - 1]; - if (diagnostic.start() >= position) { - tokenDiagnosticsLength--; - } else { - break; - } - } - - this._tokenDiagnostics.length = tokenDiagnosticsLength; - }; - - NormalParserSource.prototype.resetToPosition = function (absolutePosition, previousToken) { - this._absolutePosition = absolutePosition; - this._previousToken = previousToken; - - this.removeDiagnosticsOnOrAfterPosition(absolutePosition); - - this.slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); - - this.scanner.setAbsoluteIndex(absolutePosition); - }; - - NormalParserSource.prototype.currentTokenAllowingRegularExpression = function () { - this.resetToPosition(this._absolutePosition, this._previousToken); - - var token = this.slidingWindow.currentItem(true); - - return token; - }; - return NormalParserSource; - })(); - - var IncrementalParserSource = (function () { - function IncrementalParserSource(oldSyntaxTree, textChangeRange, newText) { - this._changeDelta = 0; - var oldSourceUnit = oldSyntaxTree.sourceUnit(); - this._oldSourceUnitCursor = new SyntaxCursor(oldSourceUnit); - - this._changeRange = IncrementalParserSource.extendToAffectedRange(textChangeRange, oldSourceUnit); - - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert((oldSourceUnit.fullWidth() - this._changeRange.span().length() + this._changeRange.newLength()) === newText.length()); - } - - this._normalParserSource = new NormalParserSource(oldSyntaxTree.fileName(), newText, oldSyntaxTree.parseOptions().languageVersion()); - } - IncrementalParserSource.extendToAffectedRange = function (changeRange, sourceUnit) { - var maxLookahead = 1; - - var start = changeRange.span().start(); - - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var token = sourceUnit.findToken(start); - - var position = token.fullStart(); - - start = TypeScript.MathPrototype.max(0, position - 1); - } - - var finalSpan = TypeScript.TextSpan.fromBounds(start, changeRange.span().end()); - var finalLength = changeRange.newLength() + (changeRange.span().start() - start); - - return new TypeScript.TextChangeRange(finalSpan, finalLength); - }; - - IncrementalParserSource.prototype.absolutePosition = function () { - return this._normalParserSource.absolutePosition(); - }; - - IncrementalParserSource.prototype.previousToken = function () { - return this._normalParserSource.previousToken(); - }; - - IncrementalParserSource.prototype.tokenDiagnostics = function () { - return this._normalParserSource.tokenDiagnostics(); - }; - - IncrementalParserSource.prototype.getRewindPoint = function () { - var rewindPoint = this._normalParserSource.getRewindPoint(); - var oldSourceUnitCursorIndex = this._oldSourceUnitCursor.getAndPinCursorIndex(); - - rewindPoint.changeDelta = this._changeDelta; - rewindPoint.changeRange = this._changeRange; - rewindPoint.oldSourceUnitCursorIndex = oldSourceUnitCursorIndex; - - return rewindPoint; - }; - - IncrementalParserSource.prototype.rewind = function (rewindPoint) { - this._changeRange = rewindPoint.changeRange; - this._changeDelta = rewindPoint.changeDelta; - this._oldSourceUnitCursor.rewindToPinnedCursorIndex(rewindPoint.oldSourceUnitCursorIndex); - - this._normalParserSource.rewind(rewindPoint); - }; - - IncrementalParserSource.prototype.releaseRewindPoint = function (rewindPoint) { - this._oldSourceUnitCursor.releaseAndUnpinCursorIndex(rewindPoint.oldSourceUnitCursorIndex); - this._normalParserSource.releaseRewindPoint(rewindPoint); - }; - - IncrementalParserSource.prototype.canReadFromOldSourceUnit = function () { - if (this._normalParserSource.isPinned()) { - return false; - } - - if (this._changeRange !== null && this._changeRange.newSpan().intersectsWithPosition(this.absolutePosition())) { - return false; - } - - this.syncCursorToNewTextIfBehind(); - - return this._changeDelta === 0 && !this._oldSourceUnitCursor.isFinished(); - }; - - IncrementalParserSource.prototype.currentNode = function () { - if (this.canReadFromOldSourceUnit()) { - return this.tryGetNodeFromOldSourceUnit(); - } - - return null; - }; - - IncrementalParserSource.prototype.currentToken = function () { - if (this.canReadFromOldSourceUnit()) { - var token = this.tryGetTokenFromOldSourceUnit(); - if (token !== null) { - return token; - } - } - - return this._normalParserSource.currentToken(); - }; - - IncrementalParserSource.prototype.currentTokenAllowingRegularExpression = function () { - return this._normalParserSource.currentTokenAllowingRegularExpression(); - }; - - IncrementalParserSource.prototype.syncCursorToNewTextIfBehind = function () { - while (true) { - if (this._oldSourceUnitCursor.isFinished()) { - break; - } - - if (this._changeDelta >= 0) { - break; - } - - var currentElement = this._oldSourceUnitCursor.currentElement(); - - if (currentElement.isNode() && (currentElement.fullWidth() > Math.abs(this._changeDelta))) { - this._oldSourceUnitCursor.moveToFirstChild(); - } else { - this._oldSourceUnitCursor.moveToNextSibling(); - - this._changeDelta += currentElement.fullWidth(); - } - } - }; - - IncrementalParserSource.prototype.intersectsWithChangeRangeSpanInOriginalText = function (start, length) { - return this._changeRange !== null && this._changeRange.span().intersectsWith(start, length); - }; - - IncrementalParserSource.prototype.tryGetNodeFromOldSourceUnit = function () { - while (true) { - var node = this._oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; - } - - if (!this.intersectsWithChangeRangeSpanInOriginalText(this.absolutePosition(), node.fullWidth())) { - if (!node.isIncrementallyUnusable()) { - return node; - } - } - - this._oldSourceUnitCursor.moveToFirstChild(); - } - }; - - IncrementalParserSource.prototype.canReuseTokenFromOldSourceUnit = function (position, token) { - if (token !== null) { - if (!this.intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - if (!token.isIncrementallyUnusable()) { - return true; - } - } - } - - return false; - }; - - IncrementalParserSource.prototype.tryGetTokenFromOldSourceUnit = function () { - var token = this._oldSourceUnitCursor.currentToken(); - - return this.canReuseTokenFromOldSourceUnit(this.absolutePosition(), token) ? token : null; - }; - - IncrementalParserSource.prototype.peekToken = function (n) { - if (this.canReadFromOldSourceUnit()) { - var token = this.tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { - return token; - } - } - - return this._normalParserSource.peekToken(n); - }; - - IncrementalParserSource.prototype.tryPeekTokenFromOldSourceUnit = function (n) { - var currentPosition = this.absolutePosition(); - for (var i = 0; i < n; i++) { - var interimToken = this._oldSourceUnitCursor.peekToken(i); - if (!this.canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; - } - - currentPosition += interimToken.fullWidth(); - } - - var token = this._oldSourceUnitCursor.peekToken(n); - return this.canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; - }; - - IncrementalParserSource.prototype.moveToNextNode = function () { - var currentElement = this._oldSourceUnitCursor.currentElement(); - var currentNode = this._oldSourceUnitCursor.currentNode(); - - this._oldSourceUnitCursor.moveToNextSibling(); - - var absolutePosition = this.absolutePosition() + currentNode.fullWidth(); - var previousToken = currentNode.lastToken(); - this._normalParserSource.resetToPosition(absolutePosition, previousToken); - - if (this._changeRange !== null) { - } - }; - - IncrementalParserSource.prototype.moveToNextToken = function () { - var currentToken = this.currentToken(); - - if (this._oldSourceUnitCursor.currentToken() === currentToken) { - this._oldSourceUnitCursor.moveToNextSibling(); - - var absolutePosition = this.absolutePosition() + currentToken.fullWidth(); - var previousToken = currentToken; - this._normalParserSource.resetToPosition(absolutePosition, previousToken); - - if (this._changeRange !== null) { - } - } else { - this._changeDelta -= currentToken.fullWidth(); - - this._normalParserSource.moveToNextToken(); - - if (this._changeRange !== null) { - var changeRangeSpanInNewText = this._changeRange.newSpan(); - if (this.absolutePosition() >= changeRangeSpanInNewText.end()) { - this._changeDelta += this._changeRange.newLength() - this._changeRange.span().length(); - this._changeRange = null; - } - } - } - }; - return IncrementalParserSource; - })(); - - var ParserImpl = (function () { - function ParserImpl(fileName, lineMap, source, parseOptions, newText_forDebuggingPurposesOnly) { - this.newText_forDebuggingPurposesOnly = newText_forDebuggingPurposesOnly; - this.listParsingState = 0; - this.isInStrictMode = false; - this.diagnostics = []; - this.factory = TypeScript.Syntax.normalModeFactory; - this.mergeTokensStorage = []; - this.arrayPool = []; - this.fileName = fileName; - this.lineMap = lineMap; - this.source = source; - this.parseOptions = parseOptions; - } - ParserImpl.prototype.getRewindPoint = function () { - var rewindPoint = this.source.getRewindPoint(); - - rewindPoint.diagnosticsCount = this.diagnostics.length; - - rewindPoint.isInStrictMode = this.isInStrictMode; - rewindPoint.listParsingState = this.listParsingState; - - return rewindPoint; - }; - - ParserImpl.prototype.rewind = function (rewindPoint) { - this.source.rewind(rewindPoint); - - this.diagnostics.length = rewindPoint.diagnosticsCount; - }; - - ParserImpl.prototype.releaseRewindPoint = function (rewindPoint) { - this.source.releaseRewindPoint(rewindPoint); - }; - - ParserImpl.prototype.currentTokenStart = function () { - return this.source.absolutePosition() + this.currentToken().leadingTriviaWidth(); - }; - - ParserImpl.prototype.previousTokenStart = function () { - if (this.previousToken() === null) { - return 0; - } - - return this.source.absolutePosition() - this.previousToken().fullWidth() + this.previousToken().leadingTriviaWidth(); - }; - - ParserImpl.prototype.previousTokenEnd = function () { - if (this.previousToken() === null) { - return 0; - } - - return this.previousTokenStart() + this.previousToken().width(); - }; - - ParserImpl.prototype.currentNode = function () { - var node = this.source.currentNode(); - - if (node === null || node.parsedInStrictMode() !== this.isInStrictMode) { - return null; - } - - return node; - }; - - ParserImpl.prototype.currentToken = function () { - return this.source.currentToken(); - }; - - ParserImpl.prototype.currentTokenAllowingRegularExpression = function () { - return this.source.currentTokenAllowingRegularExpression(); - }; - - ParserImpl.prototype.peekToken = function (n) { - return this.source.peekToken(n); - }; - - ParserImpl.prototype.eatAnyToken = function () { - var token = this.currentToken(); - this.moveToNextToken(); - return token; - }; - - ParserImpl.prototype.moveToNextToken = function () { - this.source.moveToNextToken(); - }; - - ParserImpl.prototype.previousToken = function () { - return this.source.previousToken(); - }; - - ParserImpl.prototype.eatNode = function () { - var node = this.source.currentNode(); - this.source.moveToNextNode(); - return node; - }; - - ParserImpl.prototype.eatToken = function (kind) { - var token = this.currentToken(); - if (token.tokenKind === kind) { - this.moveToNextToken(); - return token; - } - - return this.createMissingToken(kind, token); - }; - - ParserImpl.prototype.tryEatToken = function (kind) { - if (this.currentToken().tokenKind === kind) { - return this.eatToken(kind); - } - - return null; - }; - - ParserImpl.prototype.eatKeyword = function (kind) { - var token = this.currentToken(); - if (token.tokenKind === kind) { - this.moveToNextToken(); - return token; - } - - return this.createMissingToken(kind, token); - }; - - ParserImpl.prototype.isIdentifier = function (token) { - var tokenKind = token.tokenKind; - - if (tokenKind === 11 /* IdentifierName */) { - return true; - } - - if (tokenKind >= 51 /* FirstFutureReservedStrictKeyword */) { - if (tokenKind <= 59 /* LastFutureReservedStrictKeyword */) { - return !this.isInStrictMode; - } - - return tokenKind <= 69 /* LastTypeScriptKeyword */; - } - - return false; - }; - - ParserImpl.prototype.eatIdentifierNameToken = function () { - var token = this.currentToken(); - - if (token.tokenKind === 11 /* IdentifierName */) { - this.moveToNextToken(); - return token; - } - - if (TypeScript.SyntaxFacts.isAnyKeyword(token.tokenKind)) { - this.moveToNextToken(); - return TypeScript.Syntax.convertToIdentifierName(token); - } - - return this.createMissingToken(11 /* IdentifierName */, token); - }; - - ParserImpl.prototype.eatIdentifierToken = function () { - var token = this.currentToken(); - if (this.isIdentifier(token)) { - this.moveToNextToken(); - - if (token.tokenKind === 11 /* IdentifierName */) { - return token; - } - - return TypeScript.Syntax.convertToIdentifierName(token); - } - - return this.createMissingToken(11 /* IdentifierName */, token); - }; - - ParserImpl.prototype.canEatAutomaticSemicolon = function (allowWithoutNewLine) { - var token = this.currentToken(); - - if (token.tokenKind === 10 /* EndOfFileToken */) { - return true; - } - - if (token.tokenKind === 71 /* CloseBraceToken */) { - return true; - } - - if (allowWithoutNewLine) { - return true; - } - - if (this.previousToken() !== null && this.previousToken().hasTrailingNewLine()) { - return true; - } - - return false; - }; - - ParserImpl.prototype.canEatExplicitOrAutomaticSemicolon = function (allowWithoutNewline) { - var token = this.currentToken(); - - if (token.tokenKind === 78 /* SemicolonToken */) { - return true; - } - - return this.canEatAutomaticSemicolon(allowWithoutNewline); - }; - - ParserImpl.prototype.eatExplicitOrAutomaticSemicolon = function (allowWithoutNewline) { - var token = this.currentToken(); - - if (token.tokenKind === 78 /* SemicolonToken */) { - return this.eatToken(78 /* SemicolonToken */); - } - - if (this.canEatAutomaticSemicolon(allowWithoutNewline)) { - var semicolonToken = TypeScript.Syntax.emptyToken(78 /* SemicolonToken */); - - if (!this.parseOptions.allowAutomaticSemicolonInsertion()) { - this.addDiagnostic(new TypeScript.Diagnostic(this.fileName, this.lineMap, this.previousTokenEnd(), 0, TypeScript.DiagnosticCode.Automatic_semicolon_insertion_not_allowed, null)); - } - - return semicolonToken; - } - - return this.eatToken(78 /* SemicolonToken */); - }; - - ParserImpl.prototype.isKeyword = function (kind) { - if (kind >= 15 /* FirstKeyword */) { - if (kind <= 50 /* LastFutureReservedKeyword */) { - return true; - } - - if (this.isInStrictMode) { - return kind <= 59 /* LastFutureReservedStrictKeyword */; - } - } - - return false; - }; - - ParserImpl.prototype.createMissingToken = function (expectedKind, actual) { - var diagnostic = this.getExpectedTokenDiagnostic(expectedKind, actual); - this.addDiagnostic(diagnostic); - - return TypeScript.Syntax.emptyToken(expectedKind); - }; - - ParserImpl.prototype.getExpectedTokenDiagnostic = function (expectedKind, actual) { - var token = this.currentToken(); - - if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(expectedKind)]); - } else { - if (actual !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.tokenKind)) { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword, [TypeScript.SyntaxFacts.getText(actual.tokenKind)]); - } else { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Identifier_expected, null); - } - } - }; - - ParserImpl.getPrecedence = function (expressionKind) { - switch (expressionKind) { - case 173 /* CommaExpression */: - return 1 /* CommaExpressionPrecedence */; - - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - return 2 /* AssignmentExpressionPrecedence */; - - case 186 /* ConditionalExpression */: - return 3 /* ConditionalExpressionPrecedence */; - - case 187 /* LogicalOrExpression */: - return 5 /* LogicalOrExpressionPrecedence */; - - case 188 /* LogicalAndExpression */: - return 6 /* LogicalAndExpressionPrecedence */; - - case 189 /* BitwiseOrExpression */: - return 7 /* BitwiseOrExpressionPrecedence */; - - case 190 /* BitwiseExclusiveOrExpression */: - return 8 /* BitwiseExclusiveOrExpressionPrecedence */; - - case 191 /* BitwiseAndExpression */: - return 9 /* BitwiseAndExpressionPrecedence */; - - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - return 10 /* EqualityExpressionPrecedence */; - - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - return 11 /* RelationalExpressionPrecedence */; - - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - return 12 /* ShiftExpressionPrecdence */; - - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - return 13 /* AdditiveExpressionPrecedence */; - - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - return 14 /* MultiplicativeExpressionPrecedence */; - - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 167 /* LogicalNotExpression */: - case 170 /* DeleteExpression */: - case 171 /* TypeOfExpression */: - case 172 /* VoidExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return 15 /* UnaryExpressionPrecedence */; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - ParserImpl.prototype.addSkippedTokenAfterNodeOrToken = function (nodeOrToken, skippedToken) { - if (nodeOrToken.isToken()) { - return this.addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } else if (nodeOrToken.isNode()) { - return this.addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.addSkippedTokenAfterNode = function (node, skippedToken) { - var oldToken = node.lastToken(); - var newToken = this.addSkippedTokenAfterToken(oldToken, skippedToken); - - return node.replaceToken(oldToken, newToken); - }; - - ParserImpl.prototype.addSkippedTokensBeforeNode = function (node, skippedTokens) { - if (skippedTokens.length > 0) { - var oldToken = node.firstToken(); - var newToken = this.addSkippedTokensBeforeToken(oldToken, skippedTokens); - - return node.replaceToken(oldToken, newToken); - } - - return node; - }; - - ParserImpl.prototype.addSkippedTokensBeforeToken = function (token, skippedTokens) { - var leadingTrivia = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - this.addSkippedTokenToTriviaArray(leadingTrivia, skippedTokens[i]); - } - - this.addTriviaTo(token.leadingTrivia(), leadingTrivia); - - this.returnArray(skippedTokens); - return token.withLeadingTrivia(TypeScript.Syntax.triviaList(leadingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokensAfterToken = function (token, skippedTokens) { - if (skippedTokens.length === 0) { - this.returnArray(skippedTokens); - return token; - } - - var trailingTrivia = token.trailingTrivia().toArray(); - - for (var i = 0, n = skippedTokens.length; i < n; i++) { - this.addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - - this.returnArray(skippedTokens); - return token.withTrailingTrivia(TypeScript.Syntax.triviaList(trailingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokenAfterToken = function (token, skippedToken) { - var trailingTrivia = token.trailingTrivia().toArray(); - this.addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - - return token.withTrailingTrivia(TypeScript.Syntax.triviaList(trailingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokenToTriviaArray = function (array, skippedToken) { - this.addTriviaTo(skippedToken.leadingTrivia(), array); - - var trimmedToken = skippedToken.withLeadingTrivia(TypeScript.Syntax.emptyTriviaList).withTrailingTrivia(TypeScript.Syntax.emptyTriviaList); - array.push(TypeScript.Syntax.skippedTokenTrivia(trimmedToken)); - - this.addTriviaTo(skippedToken.trailingTrivia(), array); - }; - - ParserImpl.prototype.addTriviaTo = function (list, array) { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - }; - - ParserImpl.prototype.parseSyntaxTree = function (isDeclaration) { - var sourceUnit = this.parseSourceUnit(); - - var allDiagnostics = this.source.tokenDiagnostics().concat(this.diagnostics); - allDiagnostics.sort(function (a, b) { - return a.start() - b.start(); - }); - - return new TypeScript.SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, this.fileName, this.lineMap, this.parseOptions); - }; - - ParserImpl.prototype.setStrictMode = function (isInStrictMode) { - this.isInStrictMode = isInStrictMode; - this.factory = isInStrictMode ? TypeScript.Syntax.strictModeFactory : TypeScript.Syntax.normalModeFactory; - }; - - ParserImpl.prototype.parseSourceUnit = function () { - var savedIsInStrictMode = this.isInStrictMode; - - var result = this.parseSyntaxList(1 /* SourceUnit_ModuleElements */, ParserImpl.updateStrictModeState); - var moduleElements = result.list; - - this.setStrictMode(savedIsInStrictMode); - - var sourceUnit = this.factory.sourceUnit(moduleElements, this.currentToken()); - sourceUnit = this.addSkippedTokensBeforeNode(sourceUnit, result.skippedTokens); - - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert(sourceUnit.fullWidth() === this.newText_forDebuggingPurposesOnly.length()); - - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - TypeScript.Debug.assert(sourceUnit.fullText() === this.newText_forDebuggingPurposesOnly.substr(0, this.newText_forDebuggingPurposesOnly.length(), false)); - } - } - - return sourceUnit; - }; - - ParserImpl.updateStrictModeState = function (parser, items) { - if (!parser.isInStrictMode) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!TypeScript.SyntaxFacts.isDirectivePrologueElement(item)) { - return; - } - } - - parser.setStrictMode(TypeScript.SyntaxFacts.isUseStrictDirective(items[items.length - 1])); - } - }; - - ParserImpl.prototype.isModuleElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isModuleElement()) { - return true; - } - - var modifierCount = this.modifierCount(); - return this.isImportDeclaration(modifierCount) || this.isExportAssignment() || this.isModuleDeclaration(modifierCount) || this.isInterfaceDeclaration(modifierCount) || this.isClassDeclaration(modifierCount) || this.isEnumDeclaration(modifierCount) || this.isStatement(inErrorRecovery); - }; - - ParserImpl.prototype.parseModuleElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isModuleElement()) { - return this.eatNode(); - } - - var modifierCount = this.modifierCount(); - if (this.isImportDeclaration(modifierCount)) { - return this.parseImportDeclaration(); - } else if (this.isExportAssignment()) { - return this.parseExportAssignment(); - } else if (this.isModuleDeclaration(modifierCount)) { - return this.parseModuleDeclaration(); - } else if (this.isInterfaceDeclaration(modifierCount)) { - return this.parseInterfaceDeclaration(); - } else if (this.isClassDeclaration(modifierCount)) { - return this.parseClassDeclaration(); - } else if (this.isEnumDeclaration(modifierCount)) { - return this.parseEnumDeclaration(); - } else if (this.isStatement(inErrorRecovery)) { - return this.parseStatement(inErrorRecovery); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isImportDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 49 /* ImportKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 49 /* ImportKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseImportDeclaration = function () { - var modifiers = this.parseModifiers(); - var importKeyword = this.eatKeyword(49 /* ImportKeyword */); - var identifier = this.eatIdentifierToken(); - var equalsToken = this.eatToken(107 /* EqualsToken */); - var moduleReference = this.parseModuleReference(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.importDeclaration(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken); - }; - - ParserImpl.prototype.isExportAssignment = function () { - return this.currentToken().tokenKind === 47 /* ExportKeyword */ && this.peekToken(1).tokenKind === 107 /* EqualsToken */; - }; - - ParserImpl.prototype.parseExportAssignment = function () { - var exportKeyword = this.eatKeyword(47 /* ExportKeyword */); - var equalsToken = this.eatToken(107 /* EqualsToken */); - var identifier = this.eatIdentifierToken(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.exportAssignment(exportKeyword, equalsToken, identifier, semicolonToken); - }; - - ParserImpl.prototype.parseModuleReference = function () { - if (this.isExternalModuleReference()) { - return this.parseExternalModuleReference(); - } else { - return this.parseModuleNameModuleReference(); - } - }; - - ParserImpl.prototype.isExternalModuleReference = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 66 /* RequireKeyword */) { - return this.peekToken(1).tokenKind === 72 /* OpenParenToken */; - } - - return false; - }; - - ParserImpl.prototype.parseExternalModuleReference = function () { - var requireKeyword = this.eatKeyword(66 /* RequireKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var stringLiteral = this.eatToken(14 /* StringLiteral */); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.externalModuleReference(requireKeyword, openParenToken, stringLiteral, closeParenToken); - }; - - ParserImpl.prototype.parseModuleNameModuleReference = function () { - var name = this.parseName(); - return this.factory.moduleNameModuleReference(name); - }; - - ParserImpl.prototype.parseIdentifierName = function () { - var identifierName = this.eatIdentifierNameToken(); - return identifierName; - }; - - ParserImpl.prototype.tryParseTypeArgumentList = function (inExpression) { - if (this.currentToken().kind() !== 80 /* LessThanToken */) { - return null; - } - - var lessThanToken; - var greaterThanToken; - var result; - var typeArguments; - - if (!inExpression) { - lessThanToken = this.eatToken(80 /* LessThanToken */); - - result = this.parseSeparatedSyntaxList(262144 /* TypeArgumentList_Types */); - typeArguments = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - return this.factory.typeArgumentList(lessThanToken, typeArguments, greaterThanToken); - } - - var rewindPoint = this.getRewindPoint(); - - lessThanToken = this.eatToken(80 /* LessThanToken */); - - result = this.parseSeparatedSyntaxList(262144 /* TypeArgumentList_Types */); - typeArguments = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - if (greaterThanToken.fullWidth() === 0 || !this.canFollowTypeArgumentListInExpression(this.currentToken().kind())) { - this.rewind(rewindPoint); - - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - var typeArgumentList = this.factory.typeArgumentList(lessThanToken, typeArguments, greaterThanToken); - - return typeArgumentList; - } - }; - - ParserImpl.prototype.canFollowTypeArgumentListInExpression = function (kind) { - switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.parseName = function () { - var shouldContinue = this.isIdentifier(this.currentToken()); - var current = this.eatIdentifierToken(); - - while (shouldContinue && this.currentToken().tokenKind === 76 /* DotToken */) { - var dotToken = this.eatToken(76 /* DotToken */); - - var currentToken = this.currentToken(); - var identifierName; - - if (TypeScript.SyntaxFacts.isAnyKeyword(currentToken.tokenKind) && this.previousToken().hasTrailingNewLine() && !currentToken.hasTrailingNewLine() && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(this.peekToken(1))) { - identifierName = this.createMissingToken(11 /* IdentifierName */, currentToken); - } else { - identifierName = this.eatIdentifierNameToken(); - } - - current = this.factory.qualifiedName(current, dotToken, identifierName); - - shouldContinue = identifierName.fullWidth() > 0; - } - - return current; - }; - - ParserImpl.prototype.isEnumDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 46 /* EnumKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 46 /* EnumKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseEnumDeclaration = function () { - var modifiers = this.parseModifiers(); - var enumKeyword = this.eatKeyword(46 /* EnumKeyword */); - var identifier = this.eatIdentifierToken(); - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList; - - if (openBraceToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(256 /* EnumDeclaration_EnumElements */); - enumElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.enumDeclaration(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken); - }; - - ParserImpl.prototype.isEnumElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().kind() === 243 /* EnumElement */) { - return true; - } - - return this.isPropertyName(this.currentToken(), inErrorRecovery); - }; - - ParserImpl.prototype.parseEnumElement = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 243 /* EnumElement */) { - return this.eatNode(); - } - - var propertyName = this.eatPropertyName(); - var equalsValueClause = null; - if (this.isEqualsValueClause(false)) { - equalsValueClause = this.parseEqualsValueClause(true); - } - - return this.factory.enumElement(propertyName, equalsValueClause); - }; - - ParserImpl.isModifier = function (token) { - switch (token.tokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 47 /* ExportKeyword */: - case 63 /* DeclareKeyword */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.modifierCount = function () { - var modifierCount = 0; - while (true) { - if (ParserImpl.isModifier(this.peekToken(modifierCount))) { - modifierCount++; - continue; - } - - break; - } - - return modifierCount; - }; - - ParserImpl.prototype.parseModifiers = function () { - var tokens = this.getArray(); - - while (true) { - if (ParserImpl.isModifier(this.currentToken())) { - tokens.push(this.eatAnyToken()); - continue; - } - - break; - } - - var result = TypeScript.Syntax.list(tokens); - - this.returnZeroOrOneLengthArray(tokens); - - return result; - }; - - ParserImpl.prototype.isClassDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 44 /* ClassKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 44 /* ClassKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseHeritageClauses = function () { - var heritageClauses = TypeScript.Syntax.emptyList; - - if (this.isHeritageClause()) { - var result = this.parseSyntaxList(1024 /* ClassOrInterfaceDeclaration_HeritageClauses */); - heritageClauses = result.list; - TypeScript.Debug.assert(result.skippedTokens.length === 0); - } - - return heritageClauses; - }; - - ParserImpl.prototype.parseClassDeclaration = function () { - var modifiers = this.parseModifiers(); - - var classKeyword = this.eatKeyword(44 /* ClassKeyword */); - var identifier = this.eatIdentifierToken(); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var heritageClauses = this.parseHeritageClauses(); - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList; - - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(2 /* ClassDeclaration_ClassElements */); - - classElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.classDeclaration(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken); - }; - - ParserImpl.isPublicOrPrivateKeyword = function (token) { - return token.tokenKind === 57 /* PublicKeyword */ || token.tokenKind === 55 /* PrivateKeyword */; - }; - - ParserImpl.prototype.isAccessor = function (inErrorRecovery) { - var index = this.modifierCount(); - - if (this.peekToken(index).tokenKind !== 64 /* GetKeyword */ && this.peekToken(index).tokenKind !== 68 /* SetKeyword */) { - return false; - } - - index++; - return this.isPropertyName(this.peekToken(index), inErrorRecovery); - }; - - ParserImpl.prototype.parseAccessor = function (checkForStrictMode) { - var modifiers = this.parseModifiers(); - - if (this.currentToken().tokenKind === 64 /* GetKeyword */) { - return this.parseGetMemberAccessorDeclaration(modifiers, checkForStrictMode); - } else if (this.currentToken().tokenKind === 68 /* SetKeyword */) { - return this.parseSetMemberAccessorDeclaration(modifiers, checkForStrictMode); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseGetMemberAccessorDeclaration = function (modifiers, checkForStrictMode) { - var getKeyword = this.eatKeyword(64 /* GetKeyword */); - var propertyName = this.eatPropertyName(); - var parameterList = this.parseParameterList(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - var block = this.parseBlock(false, checkForStrictMode); - - return this.factory.getAccessor(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block); - }; - - ParserImpl.prototype.parseSetMemberAccessorDeclaration = function (modifiers, checkForStrictMode) { - var setKeyword = this.eatKeyword(68 /* SetKeyword */); - var propertyName = this.eatPropertyName(); - var parameterList = this.parseParameterList(); - var block = this.parseBlock(false, checkForStrictMode); - - return this.factory.setAccessor(modifiers, setKeyword, propertyName, parameterList, block); - }; - - ParserImpl.prototype.isClassElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isClassElement()) { - return true; - } - - return this.isConstructorDeclaration() || this.isMemberFunctionDeclaration(inErrorRecovery) || this.isAccessor(inErrorRecovery) || this.isMemberVariableDeclaration(inErrorRecovery) || this.isIndexMemberDeclaration(); - }; - - ParserImpl.prototype.parseClassElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isClassElement()) { - return this.eatNode(); - } - - if (this.isConstructorDeclaration()) { - return this.parseConstructorDeclaration(); - } else if (this.isMemberFunctionDeclaration(inErrorRecovery)) { - return this.parseMemberFunctionDeclaration(); - } else if (this.isAccessor(inErrorRecovery)) { - return this.parseAccessor(false); - } else if (this.isMemberVariableDeclaration(inErrorRecovery)) { - return this.parseMemberVariableDeclaration(); - } else if (this.isIndexMemberDeclaration()) { - return this.parseIndexMemberDeclaration(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isConstructorDeclaration = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 62 /* ConstructorKeyword */; - }; - - ParserImpl.prototype.parseConstructorDeclaration = function () { - var modifiers = this.parseModifiers(); - var constructorKeyword = this.eatKeyword(62 /* ConstructorKeyword */); - var callSignature = this.parseCallSignature(false); - - var semicolonToken = null; - var block = null; - - if (this.isBlock()) { - block = this.parseBlock(false, true); - } else { - semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.constructorDeclaration(modifiers, constructorKeyword, callSignature, block, semicolonToken); - }; - - ParserImpl.prototype.isMemberFunctionDeclaration = function (inErrorRecovery) { - var index = 0; - - while (true) { - var token = this.peekToken(index); - if (this.isPropertyName(token, inErrorRecovery) && this.isCallSignature(index + 1)) { - return true; - } - - if (ParserImpl.isModifier(token)) { - index++; - continue; - } - - return false; - } - }; - - ParserImpl.prototype.parseMemberFunctionDeclaration = function () { - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (this.isPropertyName(currentToken, false) && this.isCallSignature(1)) { - break; - } - - TypeScript.Debug.assert(ParserImpl.isModifier(currentToken)); - modifierArray.push(this.eatAnyToken()); - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var propertyName = this.eatPropertyName(); - var callSignature = this.parseCallSignature(false); - - var parseBlockEvenWithNoOpenBrace = false; - var newCallSignature = this.tryAddUnexpectedEqualsGreaterThanToken(callSignature); - if (newCallSignature !== callSignature) { - parseBlockEvenWithNoOpenBrace = true; - callSignature = newCallSignature; - } - - var block = null; - var semicolon = null; - - if (parseBlockEvenWithNoOpenBrace || this.isBlock()) { - block = this.parseBlock(parseBlockEvenWithNoOpenBrace, true); - } else { - semicolon = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.memberFunctionDeclaration(modifiers, propertyName, callSignature, block, semicolon); - }; - - ParserImpl.prototype.isDefinitelyMemberVariablePropertyName = function (index) { - if (TypeScript.SyntaxFacts.isAnyKeyword(this.peekToken(index).tokenKind)) { - switch (this.peekToken(index + 1).tokenKind) { - case 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return false; - } - } else { - return true; - } - }; - - ParserImpl.prototype.isMemberVariableDeclaration = function (inErrorRecovery) { - var index = 0; - - while (true) { - var token = this.peekToken(index); - if (this.isPropertyName(token, inErrorRecovery) && this.isDefinitelyMemberVariablePropertyName(index)) { - return true; - } - - if (ParserImpl.isModifier(this.peekToken(index))) { - index++; - continue; - } - - return false; - } - }; - - ParserImpl.prototype.parseMemberVariableDeclaration = function () { - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (this.isPropertyName(currentToken, false) && this.isDefinitelyMemberVariablePropertyName(0)) { - break; - } - - TypeScript.Debug.assert(ParserImpl.isModifier(currentToken)); - modifierArray.push(this.eatAnyToken()); - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var variableDeclarator = this.parseVariableDeclarator(true, true); - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.memberVariableDeclaration(modifiers, variableDeclarator, semicolon); - }; - - ParserImpl.prototype.isIndexMemberDeclaration = function () { - var index = this.modifierCount(); - return this.isIndexSignature(index); - }; - - ParserImpl.prototype.parseIndexMemberDeclaration = function () { - var modifiers = this.parseModifiers(); - var indexSignature = this.parseIndexSignature(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.indexMemberDeclaration(modifiers, indexSignature, semicolonToken); - }; - - ParserImpl.prototype.tryAddUnexpectedEqualsGreaterThanToken = function (callSignature) { - var token0 = this.currentToken(); - - var hasEqualsGreaterThanToken = token0.tokenKind === 85 /* EqualsGreaterThanToken */; - if (hasEqualsGreaterThanToken) { - if (callSignature.lastToken()) { - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token0.width(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(70 /* OpenBraceToken */)]); - this.addDiagnostic(diagnostic); - - var token = this.eatAnyToken(); - return this.addSkippedTokenAfterNode(callSignature, token0); - } - } - - return callSignature; - }; - - ParserImpl.prototype.isFunctionDeclaration = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 27 /* FunctionKeyword */; - }; - - ParserImpl.prototype.parseFunctionDeclaration = function () { - var modifiers = this.parseModifiers(); - var functionKeyword = this.eatKeyword(27 /* FunctionKeyword */); - var identifier = this.eatIdentifierToken(); - var callSignature = this.parseCallSignature(false); - - var parseBlockEvenWithNoOpenBrace = false; - var newCallSignature = this.tryAddUnexpectedEqualsGreaterThanToken(callSignature); - if (newCallSignature !== callSignature) { - parseBlockEvenWithNoOpenBrace = true; - callSignature = newCallSignature; - } - - var semicolonToken = null; - var block = null; - - if (parseBlockEvenWithNoOpenBrace || this.isBlock()) { - block = this.parseBlock(parseBlockEvenWithNoOpenBrace, true); - } else { - semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.functionDeclaration(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); - }; - - ParserImpl.prototype.isModuleDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 65 /* ModuleKeyword */) { - return true; - } - - if (this.currentToken().tokenKind === 65 /* ModuleKeyword */) { - var token1 = this.peekToken(1); - return this.isIdentifier(token1) || token1.tokenKind === 14 /* StringLiteral */; - } - - return false; - }; - - ParserImpl.prototype.parseModuleDeclaration = function () { - var modifiers = this.parseModifiers(); - var moduleKeyword = this.eatKeyword(65 /* ModuleKeyword */); - - var moduleName = null; - var stringLiteral = null; - - if (this.currentToken().tokenKind === 14 /* StringLiteral */) { - stringLiteral = this.eatToken(14 /* StringLiteral */); - } else { - moduleName = this.parseName(); - } - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var moduleElements = TypeScript.Syntax.emptyList; - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(4 /* ModuleDeclaration_ModuleElements */); - moduleElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.moduleDeclaration(modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, closeBraceToken); - }; - - ParserImpl.prototype.isInterfaceDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 52 /* InterfaceKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 52 /* InterfaceKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseInterfaceDeclaration = function () { - var modifiers = this.parseModifiers(); - var interfaceKeyword = this.eatKeyword(52 /* InterfaceKeyword */); - var identifier = this.eatIdentifierToken(); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var heritageClauses = this.parseHeritageClauses(); - - var objectType = this.parseObjectType(); - return this.factory.interfaceDeclaration(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, objectType); - }; - - ParserImpl.prototype.parseObjectType = function () { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var typeMembers = TypeScript.Syntax.emptySeparatedList; - if (openBraceToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(512 /* ObjectType_TypeMembers */); - typeMembers = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.objectType(openBraceToken, typeMembers, closeBraceToken); - }; - - ParserImpl.prototype.isTypeMember = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isTypeMember()) { - return true; - } - - return this.isCallSignature(0) || this.isConstructSignature() || this.isIndexSignature(0) || this.isMethodSignature(inErrorRecovery) || this.isPropertySignature(inErrorRecovery); - }; - - ParserImpl.prototype.parseTypeMember = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isTypeMember()) { - return this.eatNode(); - } - - if (this.isCallSignature(0)) { - return this.parseCallSignature(false); - } else if (this.isConstructSignature()) { - return this.parseConstructSignature(); - } else if (this.isIndexSignature(0)) { - return this.parseIndexSignature(); - } else if (this.isMethodSignature(inErrorRecovery)) { - return this.parseMethodSignature(); - } else if (this.isPropertySignature(inErrorRecovery)) { - return this.parsePropertySignature(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseConstructSignature = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - var callSignature = this.parseCallSignature(false); - - return this.factory.constructSignature(newKeyword, callSignature); - }; - - ParserImpl.prototype.parseIndexSignature = function () { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var parameter = this.parseParameter(); - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.indexSignature(openBracketToken, parameter, closeBracketToken, typeAnnotation); - }; - - ParserImpl.prototype.parseMethodSignature = function () { - var propertyName = this.eatPropertyName(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var callSignature = this.parseCallSignature(false); - - return this.factory.methodSignature(propertyName, questionToken, callSignature); - }; - - ParserImpl.prototype.parsePropertySignature = function () { - var propertyName = this.eatPropertyName(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.propertySignature(propertyName, questionToken, typeAnnotation); - }; - - ParserImpl.prototype.isCallSignature = function (tokenIndex) { - var tokenKind = this.peekToken(tokenIndex).tokenKind; - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; - }; - - ParserImpl.prototype.isConstructSignature = function () { - if (this.currentToken().tokenKind !== 31 /* NewKeyword */) { - return false; - } - - var token1 = this.peekToken(1); - return token1.tokenKind === 80 /* LessThanToken */ || token1.tokenKind === 72 /* OpenParenToken */; - }; - - ParserImpl.prototype.isIndexSignature = function (tokenIndex) { - return this.peekToken(tokenIndex).tokenKind === 74 /* OpenBracketToken */; - }; - - ParserImpl.prototype.isMethodSignature = function (inErrorRecovery) { - if (this.isPropertyName(this.currentToken(), inErrorRecovery)) { - if (this.isCallSignature(1)) { - return true; - } - - if (this.peekToken(1).tokenKind === 105 /* QuestionToken */ && this.isCallSignature(2)) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.isPropertySignature = function (inErrorRecovery) { - var currentToken = this.currentToken(); - - if (ParserImpl.isModifier(currentToken) && !currentToken.hasTrailingNewLine() && this.isPropertyName(this.peekToken(1), inErrorRecovery)) { - return false; - } - - return this.isPropertyName(currentToken, inErrorRecovery); - }; - - ParserImpl.prototype.isHeritageClause = function () { - var token0 = this.currentToken(); - return token0.tokenKind === 48 /* ExtendsKeyword */ || token0.tokenKind === 51 /* ImplementsKeyword */; - }; - - ParserImpl.prototype.isNotHeritageClauseTypeName = function () { - if (this.currentToken().tokenKind === 51 /* ImplementsKeyword */ || this.currentToken().tokenKind === 48 /* ExtendsKeyword */) { - return this.isIdentifier(this.peekToken(1)); - } - - return false; - }; - - ParserImpl.prototype.isHeritageClauseTypeName = function () { - if (this.isIdentifier(this.currentToken())) { - return !this.isNotHeritageClauseTypeName(); - } - - return false; - }; - - ParserImpl.prototype.parseHeritageClause = function () { - var extendsOrImplementsKeyword = this.eatAnyToken(); - TypeScript.Debug.assert(extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ || extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - - var result = this.parseSeparatedSyntaxList(2048 /* HeritageClause_TypeNameList */); - var typeNames = result.list; - extendsOrImplementsKeyword = this.addSkippedTokensAfterToken(extendsOrImplementsKeyword, result.skippedTokens); - - return this.factory.heritageClause(extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ ? 230 /* ExtendsHeritageClause */ : 231 /* ImplementsHeritageClause */, extendsOrImplementsKeyword, typeNames); - }; - - ParserImpl.prototype.isStatement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isStatement()) { - return true; - } - - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - var token1 = this.peekToken(1); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return false; - } - - break; - - case 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: - return true; - } - - if (this.isInterfaceDeclaration(0) || this.isClassDeclaration(0) || this.isEnumDeclaration(0) || this.isModuleDeclaration(0)) { - return false; - } - - return this.isLabeledStatement(currentToken) || this.isVariableStatement() || this.isFunctionDeclaration() || this.isEmptyStatement(currentToken, inErrorRecovery) || this.isExpressionStatement(currentToken); - }; - - ParserImpl.prototype.parseStatement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isStatement()) { - return this.eatNode(); - } - - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - switch (currentTokenKind) { - case 28 /* IfKeyword */: - return this.parseIfStatement(); - case 70 /* OpenBraceToken */: - return this.parseBlock(false, false); - case 33 /* ReturnKeyword */: - return this.parseReturnStatement(); - case 34 /* SwitchKeyword */: - return this.parseSwitchStatement(); - case 36 /* ThrowKeyword */: - return this.parseThrowStatement(); - case 15 /* BreakKeyword */: - return this.parseBreakStatement(); - case 18 /* ContinueKeyword */: - return this.parseContinueStatement(); - case 26 /* ForKeyword */: - return this.parseForOrForInStatement(); - case 42 /* WhileKeyword */: - return this.parseWhileStatement(); - case 43 /* WithKeyword */: - return this.parseWithStatement(); - case 22 /* DoKeyword */: - return this.parseDoStatement(); - case 38 /* TryKeyword */: - return this.parseTryStatement(); - case 19 /* DebuggerKeyword */: - return this.parseDebuggerStatement(); - } - - if (this.isVariableStatement()) { - return this.parseVariableStatement(); - } else if (this.isLabeledStatement(currentToken)) { - return this.parseLabeledStatement(); - } else if (this.isFunctionDeclaration()) { - return this.parseFunctionDeclaration(); - } else if (this.isEmptyStatement(currentToken, inErrorRecovery)) { - return this.parseEmptyStatement(); - } else { - return this.parseExpressionStatement(); - } - }; - - ParserImpl.prototype.parseDebuggerStatement = function () { - var debuggerKeyword = this.eatKeyword(19 /* DebuggerKeyword */); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.debuggerStatement(debuggerKeyword, semicolonToken); - }; - - ParserImpl.prototype.parseDoStatement = function () { - var doKeyword = this.eatKeyword(22 /* DoKeyword */); - var statement = this.parseStatement(false); - var whileKeyword = this.eatKeyword(42 /* WhileKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(true); - - return this.factory.doStatement(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken); - }; - - ParserImpl.prototype.isLabeledStatement = function (currentToken) { - return this.isIdentifier(currentToken) && this.peekToken(1).tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.parseLabeledStatement = function () { - var identifier = this.eatIdentifierToken(); - var colonToken = this.eatToken(106 /* ColonToken */); - var statement = this.parseStatement(false); - - return this.factory.labeledStatement(identifier, colonToken, statement); - }; - - ParserImpl.prototype.parseTryStatement = function () { - var tryKeyword = this.eatKeyword(38 /* TryKeyword */); - - var savedListParsingState = this.listParsingState; - this.listParsingState |= 64 /* TryBlock_Statements */; - var block = this.parseBlock(false, false); - this.listParsingState = savedListParsingState; - - var catchClause = null; - if (this.isCatchClause()) { - catchClause = this.parseCatchClause(); - } - - var finallyClause = null; - if (catchClause === null || this.isFinallyClause()) { - finallyClause = this.parseFinallyClause(); - } - - return this.factory.tryStatement(tryKeyword, block, catchClause, finallyClause); - }; - - ParserImpl.prototype.isCatchClause = function () { - return this.currentToken().tokenKind === 17 /* CatchKeyword */; - }; - - ParserImpl.prototype.parseCatchClause = function () { - var catchKeyword = this.eatKeyword(17 /* CatchKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var identifier = this.eatIdentifierToken(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var savedListParsingState = this.listParsingState; - this.listParsingState |= 128 /* CatchBlock_Statements */; - var block = this.parseBlock(false, false); - this.listParsingState = savedListParsingState; - - return this.factory.catchClause(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block); - }; - - ParserImpl.prototype.isFinallyClause = function () { - return this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.parseFinallyClause = function () { - var finallyKeyword = this.eatKeyword(25 /* FinallyKeyword */); - var block = this.parseBlock(false, false); - - return this.factory.finallyClause(finallyKeyword, block); - }; - - ParserImpl.prototype.parseWithStatement = function () { - var withKeyword = this.eatKeyword(43 /* WithKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.withStatement(withKeyword, openParenToken, condition, closeParenToken, statement); - }; - - ParserImpl.prototype.parseWhileStatement = function () { - var whileKeyword = this.eatKeyword(42 /* WhileKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.whileStatement(whileKeyword, openParenToken, condition, closeParenToken, statement); - }; - - ParserImpl.prototype.isEmptyStatement = function (currentToken, inErrorRecovery) { - if (inErrorRecovery) { - return false; - } - - return currentToken.tokenKind === 78 /* SemicolonToken */; - }; - - ParserImpl.prototype.parseEmptyStatement = function () { - var semicolonToken = this.eatToken(78 /* SemicolonToken */); - return this.factory.emptyStatement(semicolonToken); - }; - - ParserImpl.prototype.parseForOrForInStatement = function () { - var forKeyword = this.eatKeyword(26 /* ForKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - - var currentToken = this.currentToken(); - if (currentToken.tokenKind === 40 /* VarKeyword */) { - return this.parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } else if (currentToken.tokenKind === 78 /* SemicolonToken */) { - return this.parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); - } else { - return this.parseForOrForInStatementWithInitializer(forKeyword, openParenToken); - } - }; - - ParserImpl.prototype.parseForOrForInStatementWithVariableDeclaration = function (forKeyword, openParenToken) { - var variableDeclaration = this.parseVariableDeclaration(false); - - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return this.parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - }; - - ParserImpl.prototype.parseForInStatementWithVariableDeclarationOrInitializer = function (forKeyword, openParenToken, variableDeclaration, initializer) { - var inKeyword = this.eatKeyword(29 /* InKeyword */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.forInStatement(forKeyword, openParenToken, variableDeclaration, initializer, inKeyword, expression, closeParenToken, statement); - }; - - ParserImpl.prototype.parseForOrForInStatementWithInitializer = function (forKeyword, openParenToken) { - var initializer = this.parseExpression(false); - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return this.parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } else { - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - }; - - ParserImpl.prototype.parseForStatementWithNoVariableDeclarationOrInitializer = function (forKeyword, openParenToken) { - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); - }; - - ParserImpl.prototype.parseForStatementWithVariableDeclarationOrInitializer = function (forKeyword, openParenToken, variableDeclaration, initializer) { - var firstSemicolonToken = this.eatToken(78 /* SemicolonToken */); - - var condition = null; - if (this.currentToken().tokenKind !== 78 /* SemicolonToken */ && this.currentToken().tokenKind !== 73 /* CloseParenToken */ && this.currentToken().tokenKind !== 10 /* EndOfFileToken */) { - condition = this.parseExpression(true); - } - - var secondSemicolonToken = this.eatToken(78 /* SemicolonToken */); - - var incrementor = null; - if (this.currentToken().tokenKind !== 73 /* CloseParenToken */ && this.currentToken().tokenKind !== 10 /* EndOfFileToken */) { - incrementor = this.parseExpression(true); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.forStatement(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement); - }; - - ParserImpl.prototype.parseBreakStatement = function () { - var breakKeyword = this.eatKeyword(15 /* BreakKeyword */); - - var identifier = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - } - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - return this.factory.breakStatement(breakKeyword, identifier, semicolon); - }; - - ParserImpl.prototype.parseContinueStatement = function () { - var continueKeyword = this.eatKeyword(18 /* ContinueKeyword */); - - var identifier = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - } - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - return this.factory.continueStatement(continueKeyword, identifier, semicolon); - }; - - ParserImpl.prototype.parseSwitchStatement = function () { - var switchKeyword = this.eatKeyword(34 /* SwitchKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var switchClauses = TypeScript.Syntax.emptyList; - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(8 /* SwitchStatement_SwitchClauses */); - switchClauses = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.switchStatement(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken); - }; - - ParserImpl.prototype.isCaseSwitchClause = function () { - return this.currentToken().tokenKind === 16 /* CaseKeyword */; - }; - - ParserImpl.prototype.isDefaultSwitchClause = function () { - return this.currentToken().tokenKind === 20 /* DefaultKeyword */; - }; - - ParserImpl.prototype.isSwitchClause = function () { - if (this.currentNode() !== null && this.currentNode().isSwitchClause()) { - return true; - } - - return this.isCaseSwitchClause() || this.isDefaultSwitchClause(); - }; - - ParserImpl.prototype.parseSwitchClause = function () { - if (this.currentNode() !== null && this.currentNode().isSwitchClause()) { - return this.eatNode(); - } - - if (this.isCaseSwitchClause()) { - return this.parseCaseSwitchClause(); - } else if (this.isDefaultSwitchClause()) { - return this.parseDefaultSwitchClause(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseCaseSwitchClause = function () { - var caseKeyword = this.eatKeyword(16 /* CaseKeyword */); - var expression = this.parseExpression(true); - var colonToken = this.eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList; - - if (colonToken.fullWidth() > 0) { - var result = this.parseSyntaxList(16 /* SwitchClause_Statements */); - statements = result.list; - colonToken = this.addSkippedTokensAfterToken(colonToken, result.skippedTokens); - } - - return this.factory.caseSwitchClause(caseKeyword, expression, colonToken, statements); - }; - - ParserImpl.prototype.parseDefaultSwitchClause = function () { - var defaultKeyword = this.eatKeyword(20 /* DefaultKeyword */); - var colonToken = this.eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList; - - if (colonToken.fullWidth() > 0) { - var result = this.parseSyntaxList(16 /* SwitchClause_Statements */); - statements = result.list; - colonToken = this.addSkippedTokensAfterToken(colonToken, result.skippedTokens); - } - - return this.factory.defaultSwitchClause(defaultKeyword, colonToken, statements); - }; - - ParserImpl.prototype.parseThrowStatement = function () { - var throwKeyword = this.eatKeyword(36 /* ThrowKeyword */); - - var expression = null; - if (this.canEatExplicitOrAutomaticSemicolon(false)) { - var token = this.createMissingToken(11 /* IdentifierName */, null); - expression = token; - } else { - expression = this.parseExpression(true); - } - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.throwStatement(throwKeyword, expression, semicolonToken); - }; - - ParserImpl.prototype.parseReturnStatement = function () { - var returnKeyword = this.eatKeyword(33 /* ReturnKeyword */); - - var expression = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - expression = this.parseExpression(true); - } - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.returnStatement(returnKeyword, expression, semicolonToken); - }; - - ParserImpl.prototype.isExpressionStatement = function (currentToken) { - var kind = currentToken.tokenKind; - if (kind === 70 /* OpenBraceToken */ || kind === 27 /* FunctionKeyword */) { - return false; - } - - return this.isExpression(currentToken); - }; - - ParserImpl.prototype.isAssignmentOrOmittedExpression = function () { - var currentToken = this.currentToken(); - if (currentToken.tokenKind === 79 /* CommaToken */) { - return true; - } - - return this.isExpression(currentToken); - }; - - ParserImpl.prototype.parseAssignmentOrOmittedExpression = function () { - if (this.currentToken().tokenKind === 79 /* CommaToken */) { - return this.factory.omittedExpression(); - } - - return this.parseAssignmentExpression(true); - }; - - ParserImpl.prototype.isExpression = function (currentToken) { - switch (currentToken.tokenKind) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - - case 74 /* OpenBracketToken */: - - case 72 /* OpenParenToken */: - - case 80 /* LessThanToken */: - - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - - case 70 /* OpenBraceToken */: - - case 85 /* EqualsGreaterThanToken */: - - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - - case 31 /* NewKeyword */: - - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - - case 27 /* FunctionKeyword */: - return true; - } - - return this.isIdentifier(currentToken); - }; - - ParserImpl.prototype.parseExpressionStatement = function () { - var expression = this.parseExpression(true); - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.expressionStatement(expression, semicolon); - }; - - ParserImpl.prototype.parseIfStatement = function () { - var ifKeyword = this.eatKeyword(28 /* IfKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - var elseClause = null; - if (this.isElseClause()) { - elseClause = this.parseElseClause(); - } - - return this.factory.ifStatement(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause); - }; - - ParserImpl.prototype.isElseClause = function () { - return this.currentToken().tokenKind === 23 /* ElseKeyword */; - }; - - ParserImpl.prototype.parseElseClause = function () { - var elseKeyword = this.eatKeyword(23 /* ElseKeyword */); - var statement = this.parseStatement(false); - - return this.factory.elseClause(elseKeyword, statement); - }; - - ParserImpl.prototype.isVariableStatement = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 40 /* VarKeyword */; - }; - - ParserImpl.prototype.parseVariableStatement = function () { - var modifiers = this.parseModifiers(); - var variableDeclaration = this.parseVariableDeclaration(true); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.variableStatement(modifiers, variableDeclaration, semicolonToken); - }; - - ParserImpl.prototype.parseVariableDeclaration = function (allowIn) { - var varKeyword = this.eatKeyword(40 /* VarKeyword */); - - var listParsingState = allowIn ? 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */; - - var result = this.parseSeparatedSyntaxList(listParsingState); - var variableDeclarators = result.list; - varKeyword = this.addSkippedTokensAfterToken(varKeyword, result.skippedTokens); - - return this.factory.variableDeclaration(varKeyword, variableDeclarators); - }; - - ParserImpl.prototype.isVariableDeclarator = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 225 /* VariableDeclarator */) { - return true; - } - - return this.isIdentifier(this.currentToken()); - }; - - ParserImpl.prototype.canReuseVariableDeclaratorNode = function (node) { - if (node === null || node.kind() !== 225 /* VariableDeclarator */) { - return false; - } - - var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; - }; - - ParserImpl.prototype.parseVariableDeclarator = function (allowIn, allowPropertyName) { - if (this.canReuseVariableDeclaratorNode(this.currentNode())) { - return this.eatNode(); - } - - var propertyName = allowPropertyName ? this.eatPropertyName() : this.eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; - - if (propertyName.width() > 0) { - typeAnnotation = this.parseOptionalTypeAnnotation(false); - - if (this.isEqualsValueClause(false)) { - equalsValueClause = this.parseEqualsValueClause(allowIn); - } - } - - return this.factory.variableDeclarator(propertyName, typeAnnotation, equalsValueClause); - }; - - ParserImpl.prototype.isColonValueClause = function () { - return this.currentToken().tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.isEqualsValueClause = function (inParameter) { - var token0 = this.currentToken(); - if (token0.tokenKind === 107 /* EqualsToken */) { - return true; - } - - if (!this.previousToken().hasTrailingNewLine()) { - if (token0.tokenKind === 85 /* EqualsGreaterThanToken */) { - return false; - } - - if (token0.tokenKind === 70 /* OpenBraceToken */ && inParameter) { - return false; - } - - return this.isExpression(token0); - } - - return false; - }; - - ParserImpl.prototype.parseEqualsValueClause = function (allowIn) { - var equalsToken = this.eatToken(107 /* EqualsToken */); - var value = this.parseAssignmentExpression(allowIn); - - return this.factory.equalsValueClause(equalsToken, value); - }; - - ParserImpl.prototype.parseExpression = function (allowIn) { - return this.parseSubExpression(0, allowIn); - }; - - ParserImpl.prototype.parseAssignmentExpression = function (allowIn) { - return this.parseSubExpression(2 /* AssignmentExpressionPrecedence */, allowIn); - }; - - ParserImpl.prototype.parseUnaryExpressionOrLower = function () { - var currentTokenKind = this.currentToken().tokenKind; - if (TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(currentTokenKind)) { - var operatorKind = TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(currentTokenKind); - - var operatorToken = this.eatAnyToken(); - - var operand = this.parseUnaryExpressionOrLower(); - return this.factory.prefixUnaryExpression(operatorKind, operatorToken, operand); - } else if (currentTokenKind === 39 /* TypeOfKeyword */) { - return this.parseTypeOfExpression(); - } else if (currentTokenKind === 41 /* VoidKeyword */) { - return this.parseVoidExpression(); - } else if (currentTokenKind === 21 /* DeleteKeyword */) { - return this.parseDeleteExpression(); - } else if (currentTokenKind === 80 /* LessThanToken */) { - return this.parseCastExpression(); - } else { - return this.parsePostfixExpressionOrLower(); - } - }; - - ParserImpl.prototype.parseSubExpression = function (precedence, allowIn) { - if (precedence <= 2 /* AssignmentExpressionPrecedence */) { - if (this.isSimpleArrowFunctionExpression()) { - return this.parseSimpleArrowFunctionExpression(); - } - - var parethesizedArrowFunction = this.tryParseParenthesizedArrowFunctionExpression(); - if (parethesizedArrowFunction !== null) { - return parethesizedArrowFunction; - } - } - - var leftOperand = this.parseUnaryExpressionOrLower(); - return this.parseBinaryOrConditionalExpressions(precedence, allowIn, leftOperand); - }; - - ParserImpl.prototype.parseBinaryOrConditionalExpressions = function (precedence, allowIn, leftOperand) { - while (true) { - var token0 = this.currentToken(); - var token0Kind = token0.tokenKind; - - if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(token0Kind)) { - if (token0Kind === 29 /* InKeyword */ && !allowIn) { - break; - } - - var mergedToken = this.tryMergeBinaryExpressionTokens(); - var tokenKind = mergedToken === null ? token0Kind : mergedToken.syntaxKind; - - var binaryExpressionKind = TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(tokenKind); - var newPrecedence = ParserImpl.getPrecedence(binaryExpressionKind); - - if (newPrecedence < precedence) { - break; - } - - if (newPrecedence === precedence && !this.isRightAssociative(binaryExpressionKind)) { - break; - } - - var operatorToken = mergedToken === null ? token0 : TypeScript.Syntax.token(mergedToken.syntaxKind).withLeadingTrivia(token0.leadingTrivia()).withTrailingTrivia(this.peekToken(mergedToken.tokenCount - 1).trailingTrivia()); - - var skipCount = mergedToken === null ? 1 : mergedToken.tokenCount; - for (var i = 0; i < skipCount; i++) { - this.eatAnyToken(); - } - - leftOperand = this.factory.binaryExpression(binaryExpressionKind, leftOperand, operatorToken, this.parseSubExpression(newPrecedence, allowIn)); - continue; - } - - if (token0Kind === 105 /* QuestionToken */ && precedence <= 3 /* ConditionalExpressionPrecedence */) { - var questionToken = this.eatToken(105 /* QuestionToken */); - - var whenTrueExpression = this.parseAssignmentExpression(allowIn); - var colon = this.eatToken(106 /* ColonToken */); - - var whenFalseExpression = this.parseAssignmentExpression(allowIn); - leftOperand = this.factory.conditionalExpression(leftOperand, questionToken, whenTrueExpression, colon, whenFalseExpression); - continue; - } - - break; - } - - return leftOperand; - }; - - ParserImpl.prototype.tryMergeBinaryExpressionTokens = function () { - var token0 = this.currentToken(); - - if (token0.tokenKind === 81 /* GreaterThanToken */ && !token0.hasTrailingTrivia()) { - var storage = this.mergeTokensStorage; - storage[0] = 0 /* None */; - storage[1] = 0 /* None */; - storage[2] = 0 /* None */; - - for (var i = 0; i < storage.length; i++) { - var nextToken = this.peekToken(i + 1); - - if (!nextToken.hasLeadingTrivia()) { - storage[i] = nextToken.tokenKind; - } - - if (nextToken.hasTrailingTrivia()) { - break; - } - } - - if (storage[0] === 81 /* GreaterThanToken */) { - if (storage[1] === 81 /* GreaterThanToken */) { - if (storage[2] === 107 /* EqualsToken */) { - return { tokenCount: 4, syntaxKind: 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */ }; - } else { - return { tokenCount: 3, syntaxKind: 97 /* GreaterThanGreaterThanGreaterThanToken */ }; - } - } else if (storage[1] === 107 /* EqualsToken */) { - return { tokenCount: 3, syntaxKind: 113 /* GreaterThanGreaterThanEqualsToken */ }; - } else { - return { tokenCount: 2, syntaxKind: 96 /* GreaterThanGreaterThanToken */ }; - } - } else if (storage[0] === 107 /* EqualsToken */) { - return { tokenCount: 2, syntaxKind: 83 /* GreaterThanEqualsToken */ }; - } - } - - return null; - }; - - ParserImpl.prototype.isRightAssociative = function (expressionKind) { - switch (expressionKind) { - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - return true; - default: - return false; - } - }; - - ParserImpl.prototype.parseMemberExpressionOrLower = function (inObjectCreation) { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } - - var expression = this.parsePrimaryExpression(); - if (expression === null) { - return this.eatIdentifierToken(); - } - - return this.parseMemberExpressionRest(expression, false, inObjectCreation); - }; - - ParserImpl.prototype.parseCallExpressionOrLower = function () { - var expression; - if (this.currentToken().tokenKind === 50 /* SuperKeyword */) { - expression = this.eatKeyword(50 /* SuperKeyword */); - - var currentTokenKind = this.currentToken().tokenKind; - if (currentTokenKind !== 72 /* OpenParenToken */ && currentTokenKind !== 76 /* DotToken */) { - expression = this.factory.memberAccessExpression(expression, this.eatToken(76 /* DotToken */), this.eatIdentifierNameToken()); - } - } else { - expression = this.parseMemberExpressionOrLower(false); - } - - return this.parseMemberExpressionRest(expression, true, false); - }; - - ParserImpl.prototype.parseMemberExpressionRest = function (expression, allowArguments, inObjectCreation) { - while (true) { - var currentTokenKind = this.currentToken().tokenKind; - - switch (currentTokenKind) { - case 72 /* OpenParenToken */: - if (!allowArguments) { - return expression; - } - - expression = this.factory.invocationExpression(expression, this.parseArgumentList(null)); - continue; - - case 80 /* LessThanToken */: - if (!allowArguments) { - return expression; - } - - var argumentList = this.tryParseArgumentList(); - if (argumentList !== null) { - expression = this.factory.invocationExpression(expression, argumentList); - continue; - } - - break; - - case 74 /* OpenBracketToken */: - expression = this.parseElementAccessExpression(expression, inObjectCreation); - continue; - - case 76 /* DotToken */: - expression = this.factory.memberAccessExpression(expression, this.eatToken(76 /* DotToken */), this.eatIdentifierNameToken()); - continue; - } - - return expression; - } - }; - - ParserImpl.prototype.parseLeftHandSideExpressionOrLower = function () { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } else { - return this.parseCallExpressionOrLower(); - } - }; - - ParserImpl.prototype.parsePostfixExpressionOrLower = function () { - var expression = this.parseLeftHandSideExpressionOrLower(); - if (expression === null) { - return this.eatIdentifierToken(); - } - - var currentTokenKind = this.currentToken().tokenKind; - - switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - if (this.previousToken() !== null && this.previousToken().hasTrailingNewLine()) { - break; - } - - return this.factory.postfixUnaryExpression(TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(currentTokenKind), expression, this.eatAnyToken()); - } - - return expression; - }; - - ParserImpl.prototype.tryParseGenericArgumentList = function () { - var rewindPoint = this.getRewindPoint(); - - var typeArgumentList = this.tryParseTypeArgumentList(true); - var token0 = this.currentToken(); - - var isOpenParen = token0.tokenKind === 72 /* OpenParenToken */; - var isDot = token0.tokenKind === 76 /* DotToken */; - var isOpenParenOrDot = isOpenParen || isDot; - - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { - this.rewind(rewindPoint); - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - - if (isDot) { - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token0.width(), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); - this.addDiagnostic(diagnostic); - - return this.factory.argumentList(typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); - } else { - return this.parseArgumentList(typeArgumentList); - } - } - }; - - ParserImpl.prototype.tryParseArgumentList = function () { - if (this.currentToken().tokenKind === 80 /* LessThanToken */) { - return this.tryParseGenericArgumentList(); - } - - if (this.currentToken().tokenKind === 72 /* OpenParenToken */) { - return this.parseArgumentList(null); - } - - return null; - }; - - ParserImpl.prototype.parseArgumentList = function (typeArgumentList) { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - - var _arguments = TypeScript.Syntax.emptySeparatedList; - - if (openParenToken.fullWidth() > 0) { - var result = this.parseSeparatedSyntaxList(16384 /* ArgumentList_AssignmentExpressions */); - _arguments = result.list; - openParenToken = this.addSkippedTokensAfterToken(openParenToken, result.skippedTokens); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.argumentList(typeArgumentList, openParenToken, _arguments, closeParenToken); - }; - - ParserImpl.prototype.parseElementAccessExpression = function (expression, inObjectCreation) { - var start = this.currentTokenStart(); - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var argumentExpression; - - if (this.currentToken().tokenKind === 75 /* CloseBracketToken */ && inObjectCreation) { - var end = this.currentTokenStart() + this.currentToken().width(); - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, start, end - start, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); - this.addDiagnostic(diagnostic); - - argumentExpression = TypeScript.Syntax.emptyToken(11 /* IdentifierName */); - } else { - argumentExpression = this.parseExpression(true); - } - - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - return this.factory.elementAccessExpression(expression, openBracketToken, argumentExpression, closeBracketToken); - }; - - ParserImpl.prototype.parsePrimaryExpression = function () { - var currentToken = this.currentToken(); - - if (this.isIdentifier(currentToken)) { - return this.eatIdentifierToken(); - } - - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 35 /* ThisKeyword */: - return this.parseThisExpression(); - - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return this.parseLiteralExpression(); - - case 32 /* NullKeyword */: - return this.parseLiteralExpression(); - - case 27 /* FunctionKeyword */: - return this.parseFunctionExpression(); - - case 13 /* NumericLiteral */: - return this.parseLiteralExpression(); - - case 12 /* RegularExpressionLiteral */: - return this.parseLiteralExpression(); - - case 14 /* StringLiteral */: - return this.parseLiteralExpression(); - - case 74 /* OpenBracketToken */: - return this.parseArrayLiteralExpression(); - - case 70 /* OpenBraceToken */: - return this.parseObjectLiteralExpression(); - - case 72 /* OpenParenToken */: - return this.parseParenthesizedExpression(); - - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - var result = this.tryReparseDivideAsRegularExpression(); - if (result !== null) { - return result; - } - break; - } - - return null; - }; - - ParserImpl.prototype.tryReparseDivideAsRegularExpression = function () { - var currentToken = this.currentToken(); - - if (this.previousToken() !== null) { - var previousTokenKind = this.previousToken().tokenKind; - switch (previousTokenKind) { - case 11 /* IdentifierName */: - return null; - - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return null; - - case 14 /* StringLiteral */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 75 /* CloseBracketToken */: - return null; - } - } - - currentToken = this.currentTokenAllowingRegularExpression(); - - if (currentToken.tokenKind === 118 /* SlashToken */ || currentToken.tokenKind === 119 /* SlashEqualsToken */) { - return null; - } else if (currentToken.tokenKind === 12 /* RegularExpressionLiteral */) { - return this.parseLiteralExpression(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseTypeOfExpression = function () { - var typeOfKeyword = this.eatKeyword(39 /* TypeOfKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.typeOfExpression(typeOfKeyword, expression); - }; - - ParserImpl.prototype.parseDeleteExpression = function () { - var deleteKeyword = this.eatKeyword(21 /* DeleteKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.deleteExpression(deleteKeyword, expression); - }; - - ParserImpl.prototype.parseVoidExpression = function () { - var voidKeyword = this.eatKeyword(41 /* VoidKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.voidExpression(voidKeyword, expression); - }; - - ParserImpl.prototype.parseFunctionExpression = function () { - var functionKeyword = this.eatKeyword(27 /* FunctionKeyword */); - var identifier = null; - - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - - var callSignature = this.parseCallSignature(false); - var block = this.parseBlock(false, true); - - return this.factory.functionExpression(functionKeyword, identifier, callSignature, block); - }; - - ParserImpl.prototype.parseObjectCreationExpression = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - - var expression = this.parseObjectCreationExpressionOrLower(true); - var argumentList = this.tryParseArgumentList(); - - var result = this.factory.objectCreationExpression(newKeyword, expression, argumentList); - return this.parseMemberExpressionRest(result, true, false); - }; - - ParserImpl.prototype.parseObjectCreationExpressionOrLower = function (inObjectCreation) { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } else { - return this.parseMemberExpressionOrLower(inObjectCreation); - } - }; - - ParserImpl.prototype.parseCastExpression = function () { - var lessThanToken = this.eatToken(80 /* LessThanToken */); - var type = this.parseType(); - var greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.castExpression(lessThanToken, type, greaterThanToken, expression); - }; - - ParserImpl.prototype.parseParenthesizedExpression = function () { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.parenthesizedExpression(openParenToken, expression, closeParenToken); - }; - - ParserImpl.prototype.tryParseParenthesizedArrowFunctionExpression = function () { - var tokenKind = this.currentToken().tokenKind; - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; - } - - if (this.isDefinitelyArrowFunctionExpression()) { - return this.parseParenthesizedArrowFunctionExpression(false); - } - - if (!this.isPossiblyArrowFunctionExpression()) { - return null; - } - - var rewindPoint = this.getRewindPoint(); - - var arrowFunction = this.parseParenthesizedArrowFunctionExpression(true); - if (arrowFunction === null) { - this.rewind(rewindPoint); - } - - this.releaseRewindPoint(rewindPoint); - return arrowFunction; - }; - - ParserImpl.prototype.parseParenthesizedArrowFunctionExpression = function (requireArrow) { - var currentToken = this.currentToken(); - - var callSignature = this.parseCallSignature(true); - - if (requireArrow && this.currentToken().tokenKind !== 85 /* EqualsGreaterThanToken */) { - return null; - } - - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - - var block = this.tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = this.parseAssignmentExpression(true); - } - - return this.factory.parenthesizedArrowFunctionExpression(callSignature, equalsGreaterThanToken, block, expression); - }; - - ParserImpl.prototype.tryParseArrowFunctionBlock = function () { - if (this.isBlock()) { - return this.parseBlock(false, false); - } else { - if (this.isStatement(false) && !this.isExpressionStatement(this.currentToken()) && !this.isFunctionDeclaration()) { - return this.parseBlock(true, false); - } else { - return null; - } - } - }; - - ParserImpl.prototype.isSimpleArrowFunctionExpression = function () { - if (this.currentToken().tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return this.isIdentifier(this.currentToken()) && this.peekToken(1).tokenKind === 85 /* EqualsGreaterThanToken */; - }; - - ParserImpl.prototype.parseSimpleArrowFunctionExpression = function () { - var identifier = this.eatIdentifierToken(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - - var block = this.tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = this.parseAssignmentExpression(true); - } - - return this.factory.simpleArrowFunctionExpression(identifier, equalsGreaterThanToken, block, expression); - }; - - ParserImpl.prototype.isBlock = function () { - return this.currentToken().tokenKind === 70 /* OpenBraceToken */; - }; - - ParserImpl.prototype.isDefinitelyArrowFunctionExpression = function () { - var token0 = this.currentToken(); - if (token0.tokenKind !== 72 /* OpenParenToken */) { - return false; - } - - var token1 = this.peekToken(1); - var token2; - - if (token1.tokenKind === 73 /* CloseParenToken */) { - token2 = this.peekToken(2); - return token2.tokenKind === 106 /* ColonToken */ || token2.tokenKind === 85 /* EqualsGreaterThanToken */ || token2.tokenKind === 70 /* OpenBraceToken */; - } - - if (token1.tokenKind === 77 /* DotDotDotToken */) { - return true; - } - - token2 = this.peekToken(2); - if (token1.tokenKind === 57 /* PublicKeyword */ || token1.tokenKind === 55 /* PrivateKeyword */) { - if (this.isIdentifier(token2)) { - return true; - } - } - - if (!this.isIdentifier(token1)) { - return false; - } - - if (token2.tokenKind === 106 /* ColonToken */) { - return true; - } - - var token3 = this.peekToken(3); - if (token2.tokenKind === 105 /* QuestionToken */) { - if (token3.tokenKind === 106 /* ColonToken */ || token3.tokenKind === 73 /* CloseParenToken */ || token3.tokenKind === 79 /* CommaToken */) { - return true; - } - } - - if (token2.tokenKind === 73 /* CloseParenToken */) { - if (token3.tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.isPossiblyArrowFunctionExpression = function () { - var token0 = this.currentToken(); - if (token0.tokenKind !== 72 /* OpenParenToken */) { - return true; - } - - var token1 = this.peekToken(1); - - if (!this.isIdentifier(token1)) { - return false; - } - - var token2 = this.peekToken(2); - if (token2.tokenKind === 107 /* EqualsToken */) { - return true; - } - - if (token2.tokenKind === 79 /* CommaToken */) { - return true; - } - - if (token2.tokenKind === 73 /* CloseParenToken */) { - var token3 = this.peekToken(3); - if (token3.tokenKind === 106 /* ColonToken */) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.parseObjectLiteralExpression = function () { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var result = this.parseSeparatedSyntaxList(32768 /* ObjectLiteralExpression_PropertyAssignments */); - var propertyAssignments = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.objectLiteralExpression(openBraceToken, propertyAssignments, closeBraceToken); - }; - - ParserImpl.prototype.parsePropertyAssignment = function (inErrorRecovery) { - if (this.isAccessor(inErrorRecovery)) { - return this.parseAccessor(true); - } else if (this.isFunctionPropertyAssignment(inErrorRecovery)) { - return this.parseFunctionPropertyAssignment(); - } else if (this.isSimplePropertyAssignment(inErrorRecovery)) { - return this.parseSimplePropertyAssignment(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isPropertyAssignment = function (inErrorRecovery) { - return this.isAccessor(inErrorRecovery) || this.isFunctionPropertyAssignment(inErrorRecovery) || this.isSimplePropertyAssignment(inErrorRecovery); - }; - - ParserImpl.prototype.eatPropertyName = function () { - return TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(this.currentToken()) ? this.eatIdentifierNameToken() : this.eatAnyToken(); - }; - - ParserImpl.prototype.isFunctionPropertyAssignment = function (inErrorRecovery) { - return this.isPropertyName(this.currentToken(), inErrorRecovery) && this.isCallSignature(1); - }; - - ParserImpl.prototype.parseFunctionPropertyAssignment = function () { - var propertyName = this.eatPropertyName(); - var callSignature = this.parseCallSignature(false); - var block = this.parseBlock(false, true); - - return this.factory.functionPropertyAssignment(propertyName, callSignature, block); - }; - - ParserImpl.prototype.isSimplePropertyAssignment = function (inErrorRecovery) { - return this.isPropertyName(this.currentToken(), inErrorRecovery); - }; - - ParserImpl.prototype.parseSimplePropertyAssignment = function () { - var propertyName = this.eatPropertyName(); - var colonToken = this.eatToken(106 /* ColonToken */); - var expression = this.parseAssignmentExpression(true); - - return this.factory.simplePropertyAssignment(propertyName, colonToken, expression); - }; - - ParserImpl.prototype.isPropertyName = function (token, inErrorRecovery) { - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - if (inErrorRecovery) { - return this.isIdentifier(token); - } else { - return true; - } - } - - switch (token.tokenKind) { - case 14 /* StringLiteral */: - case 13 /* NumericLiteral */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.parseArrayLiteralExpression = function () { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - - var result = this.parseSeparatedSyntaxList(65536 /* ArrayLiteralExpression_AssignmentExpressions */); - var expressions = result.list; - openBracketToken = this.addSkippedTokensAfterToken(openBracketToken, result.skippedTokens); - - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - return this.factory.arrayLiteralExpression(openBracketToken, expressions, closeBracketToken); - }; - - ParserImpl.prototype.parseLiteralExpression = function () { - return this.eatAnyToken(); - }; - - ParserImpl.prototype.parseThisExpression = function () { - return this.eatKeyword(35 /* ThisKeyword */); - }; - - ParserImpl.prototype.parseBlock = function (parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var statements = TypeScript.Syntax.emptyList; - - if (parseBlockEvenWithNoOpenBrace || openBraceToken.width() > 0) { - var savedIsInStrictMode = this.isInStrictMode; - - var processItems = checkForStrictMode ? ParserImpl.updateStrictModeState : null; - var result = this.parseSyntaxList(32 /* Block_Statements */, processItems); - statements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - - this.setStrictMode(savedIsInStrictMode); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.block(openBraceToken, statements, closeBraceToken); - }; - - ParserImpl.prototype.parseCallSignature = function (requireCompleteTypeParameterList) { - var typeParameterList = this.parseOptionalTypeParameterList(requireCompleteTypeParameterList); - var parameterList = this.parseParameterList(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.callSignature(typeParameterList, parameterList, typeAnnotation); - }; - - ParserImpl.prototype.parseOptionalTypeParameterList = function (requireCompleteTypeParameterList) { - if (this.currentToken().tokenKind !== 80 /* LessThanToken */) { - return null; - } - - var rewindPoint = this.getRewindPoint(); - - var lessThanToken = this.eatToken(80 /* LessThanToken */); - - var result = this.parseSeparatedSyntaxList(524288 /* TypeParameterList_TypeParameters */); - var typeParameters = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - var greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { - this.rewind(rewindPoint); - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - var typeParameterList = this.factory.typeParameterList(lessThanToken, typeParameters, greaterThanToken); - - return typeParameterList; - } - }; - - ParserImpl.prototype.isTypeParameter = function () { - return this.isIdentifier(this.currentToken()); - }; - - ParserImpl.prototype.parseTypeParameter = function () { - var identifier = this.eatIdentifierToken(); - var constraint = this.parseOptionalConstraint(); - - return this.factory.typeParameter(identifier, constraint); - }; - - ParserImpl.prototype.parseOptionalConstraint = function () { - if (this.currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; - } - - var extendsKeyword = this.eatKeyword(48 /* ExtendsKeyword */); - var type = this.parseType(); - - return this.factory.constraint(extendsKeyword, type); - }; - - ParserImpl.prototype.parseParameterList = function () { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList; - - if (openParenToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(131072 /* ParameterList_Parameters */); - parameters = result.list; - openParenToken = this.addSkippedTokensAfterToken(openParenToken, result.skippedTokens); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - return this.factory.parameterList(openParenToken, parameters, closeParenToken); - }; - - ParserImpl.prototype.isTypeAnnotation = function () { - return this.currentToken().tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.parseOptionalTypeAnnotation = function (allowStringLiteral) { - return this.isTypeAnnotation() ? this.parseTypeAnnotation(allowStringLiteral) : null; - }; - - ParserImpl.prototype.parseTypeAnnotation = function (allowStringLiteral) { - var colonToken = this.eatToken(106 /* ColonToken */); - var type = allowStringLiteral && this.currentToken().tokenKind === 14 /* StringLiteral */ ? this.eatToken(14 /* StringLiteral */) : this.parseType(); - - return this.factory.typeAnnotation(colonToken, type); - }; - - ParserImpl.prototype.isType = function () { - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - switch (currentTokenKind) { - case 39 /* TypeOfKeyword */: - - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - - case 70 /* OpenBraceToken */: - - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - - case 31 /* NewKeyword */: - return true; - } - - return this.isIdentifier(currentToken); - }; - - ParserImpl.prototype.parseType = function () { - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - var type = this.parseNonArrayType(currentToken); - - while (this.currentToken().tokenKind === 74 /* OpenBracketToken */) { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - type = this.factory.arrayType(type, openBracketToken, closeBracketToken); - } - - return type; - }; - - ParserImpl.prototype.isTypeQuery = function () { - return this.currentToken().tokenKind === 39 /* TypeOfKeyword */; - }; - - ParserImpl.prototype.parseTypeQuery = function () { - var typeOfKeyword = this.eatToken(39 /* TypeOfKeyword */); - var name = this.parseName(); - - return this.factory.typeQuery(typeOfKeyword, name); - }; - - ParserImpl.prototype.parseNonArrayType = function (currentToken) { - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - return this.eatAnyToken(); - - case 70 /* OpenBraceToken */: - return this.parseObjectType(); - - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return this.parseFunctionType(); - - case 31 /* NewKeyword */: - return this.parseConstructorType(); - - case 39 /* TypeOfKeyword */: - return this.parseTypeQuery(); - } - - return this.parseNameOrGenericType(); - }; - - ParserImpl.prototype.parseNameOrGenericType = function () { - var name = this.parseName(); - var typeArgumentList = this.tryParseTypeArgumentList(false); - - return typeArgumentList === null ? name : this.factory.genericType(name, typeArgumentList); - }; - - ParserImpl.prototype.parseFunctionType = function () { - var typeParameterList = this.parseOptionalTypeParameterList(false); - var parameterList = this.parseParameterList(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - var returnType = this.parseType(); - - return this.factory.functionType(typeParameterList, parameterList, equalsGreaterThanToken, returnType); - }; - - ParserImpl.prototype.parseConstructorType = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var parameterList = this.parseParameterList(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - var type = this.parseType(); - - return this.factory.constructorType(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type); - }; - - ParserImpl.prototype.isParameter = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 242 /* Parameter */) { - return true; - } - - var token = this.currentToken(); - var tokenKind = token.tokenKind; - if (tokenKind === 77 /* DotDotDotToken */) { - return true; - } - - if (ParserImpl.isModifier(token) && !this.isModifierUsedAsParameterIdentifier(token)) { - return true; - } - - return this.isIdentifier(token); - }; - - ParserImpl.prototype.isModifierUsedAsParameterIdentifier = function (token) { - if (this.isIdentifier(token)) { - var nextTokenKind = this.peekToken(1).tokenKind; - switch (nextTokenKind) { - case 73 /* CloseParenToken */: - case 106 /* ColonToken */: - case 107 /* EqualsToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - return true; - } - } - - return false; - }; - - ParserImpl.prototype.parseParameter = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 242 /* Parameter */) { - return this.eatNode(); - } - - var dotDotDotToken = this.tryEatToken(77 /* DotDotDotToken */); - - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (ParserImpl.isModifier(currentToken) && !this.isModifierUsedAsParameterIdentifier(currentToken)) { - modifierArray.push(this.eatAnyToken()); - continue; - } - - break; - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var identifier = this.eatIdentifierToken(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(true); - - var equalsValueClause = null; - if (this.isEqualsValueClause(true)) { - equalsValueClause = this.parseEqualsValueClause(true); - } - - return this.factory.parameter(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); - }; - - ParserImpl.prototype.parseSyntaxList = function (currentListType, processItems) { - if (typeof processItems === "undefined") { processItems = null; } - var savedListParsingState = this.listParsingState; - this.listParsingState |= currentListType; - - var result = this.parseSyntaxListWorker(currentListType, processItems); - - this.listParsingState = savedListParsingState; - - return result; - }; - - ParserImpl.prototype.parseSeparatedSyntaxList = function (currentListType) { - var savedListParsingState = this.listParsingState; - this.listParsingState |= currentListType; - - var result = this.parseSeparatedSyntaxListWorker(currentListType); - - this.listParsingState = savedListParsingState; - - return result; - }; - - ParserImpl.prototype.abortParsingListOrMoveToNextToken = function (currentListType, items, skippedTokens) { - this.reportUnexpectedTokenDiagnostic(currentListType); - - for (var state = 524288 /* LastListParsingState */; state >= 1 /* FirstListParsingState */; state >>= 1) { - if ((this.listParsingState & state) !== 0) { - if (this.isExpectedListTerminator(state) || this.isExpectedListItem(state, true)) { - return true; - } - } - } - - var skippedToken = this.currentToken(); - - this.moveToNextToken(); - - this.addSkippedTokenToList(items, skippedTokens, skippedToken); - - return false; - }; - - ParserImpl.prototype.addSkippedTokenToList = function (items, skippedTokens, skippedToken) { - for (var i = items.length - 1; i >= 0; i--) { - var item = items[i]; - var lastToken = item.lastToken(); - if (lastToken.fullWidth() > 0) { - items[i] = this.addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } - } - - skippedTokens.push(skippedToken); - }; - - ParserImpl.prototype.tryParseExpectedListItem = function (currentListType, inErrorRecovery, items, processItems) { - if (this.isExpectedListItem(currentListType, inErrorRecovery)) { - var item = this.parseExpectedListItem(currentListType, inErrorRecovery); - - items.push(item); - - if (processItems !== null) { - processItems(this, items); - } - } - }; - - ParserImpl.prototype.listIsTerminated = function (currentListType) { - return this.isExpectedListTerminator(currentListType) || this.currentToken().tokenKind === 10 /* EndOfFileToken */; - }; - - ParserImpl.prototype.getArray = function () { - if (this.arrayPool.length > 0) { - return this.arrayPool.pop(); - } - - return []; - }; - - ParserImpl.prototype.returnZeroOrOneLengthArray = function (array) { - if (array.length <= 1) { - this.returnArray(array); - } - }; - - ParserImpl.prototype.returnArray = function (array) { - array.length = 0; - this.arrayPool.push(array); - }; - - ParserImpl.prototype.parseSyntaxListWorker = function (currentListType, processItems) { - var items = this.getArray(); - var skippedTokens = this.getArray(); - - while (true) { - var oldItemsCount = items.length; - this.tryParseExpectedListItem(currentListType, false, items, processItems); - - var newItemsCount = items.length; - if (newItemsCount === oldItemsCount) { - if (this.listIsTerminated(currentListType)) { - break; - } - - var abort = this.abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); - if (abort) { - break; - } - } - } - - var result = TypeScript.Syntax.list(items); - - this.returnZeroOrOneLengthArray(items); - - return { skippedTokens: skippedTokens, list: result }; - }; - - ParserImpl.prototype.parseSeparatedSyntaxListWorker = function (currentListType) { - var items = this.getArray(); - var skippedTokens = this.getArray(); - TypeScript.Debug.assert(items.length === 0); - TypeScript.Debug.assert(skippedTokens.length === 0); - TypeScript.Debug.assert(skippedTokens !== items); - - var separatorKind = this.separatorKind(currentListType); - var allowAutomaticSemicolonInsertion = separatorKind === 78 /* SemicolonToken */; - - var inErrorRecovery = false; - var listWasTerminated = false; - while (true) { - var oldItemsCount = items.length; - - this.tryParseExpectedListItem(currentListType, inErrorRecovery, items, null); - - var newItemsCount = items.length; - if (newItemsCount === oldItemsCount) { - if (this.listIsTerminated(currentListType)) { - listWasTerminated = true; - break; - } - - var abort = this.abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); - if (abort) { - break; - } else { - inErrorRecovery = true; - continue; - } - } - - inErrorRecovery = false; - - var currentToken = this.currentToken(); - if (currentToken.tokenKind === separatorKind || currentToken.tokenKind === 79 /* CommaToken */) { - items.push(this.eatAnyToken()); - continue; - } - - if (this.listIsTerminated(currentListType)) { - listWasTerminated = true; - break; - } - - if (allowAutomaticSemicolonInsertion && this.canEatAutomaticSemicolon(false)) { - items.push(this.eatExplicitOrAutomaticSemicolon(false)); - - continue; - } - - items.push(this.eatToken(separatorKind)); - - inErrorRecovery = true; - } - - var result = TypeScript.Syntax.separatedList(items); - - this.returnZeroOrOneLengthArray(items); - - return { skippedTokens: skippedTokens, list: result }; - }; - - ParserImpl.prototype.separatorKind = function (currentListType) { - switch (currentListType) { - case 2048 /* HeritageClause_TypeNameList */: - case 16384 /* ArgumentList_AssignmentExpressions */: - case 256 /* EnumDeclaration_EnumElements */: - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - case 131072 /* ParameterList_Parameters */: - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - case 262144 /* TypeArgumentList_Types */: - case 524288 /* TypeParameterList_TypeParameters */: - return 79 /* CommaToken */; - - case 512 /* ObjectType_TypeMembers */: - return 78 /* SemicolonToken */; - - case 1 /* SourceUnit_ModuleElements */: - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - case 2 /* ClassDeclaration_ClassElements */: - case 4 /* ModuleDeclaration_ModuleElements */: - case 8 /* SwitchStatement_SwitchClauses */: - case 16 /* SwitchClause_Statements */: - case 32 /* Block_Statements */: - default: - throw TypeScript.Errors.notYetImplemented(); - } - }; - - ParserImpl.prototype.reportUnexpectedTokenDiagnostic = function (listType) { - var token = this.currentToken(); - - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [this.getExpectedListElementType(listType)]); - this.addDiagnostic(diagnostic); - }; - - ParserImpl.prototype.addDiagnostic = function (diagnostic) { - if (this.diagnostics.length > 0 && this.diagnostics[this.diagnostics.length - 1].start() === diagnostic.start()) { - return; - } - - this.diagnostics.push(diagnostic); - }; - - ParserImpl.prototype.isExpectedListTerminator = function (currentListType) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.isExpectedSourceUnit_ModuleElementsTerminator(); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.isExpectedClassDeclaration_ClassElementsTerminator(); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.isExpectedModuleDeclaration_ModuleElementsTerminator(); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.isExpectedSwitchStatement_SwitchClausesTerminator(); - - case 16 /* SwitchClause_Statements */: - return this.isExpectedSwitchClause_StatementsTerminator(); - - case 32 /* Block_Statements */: - return this.isExpectedBlock_StatementsTerminator(); - - case 64 /* TryBlock_Statements */: - return this.isExpectedTryBlock_StatementsTerminator(); - - case 128 /* CatchBlock_Statements */: - return this.isExpectedCatchBlock_StatementsTerminator(); - - case 256 /* EnumDeclaration_EnumElements */: - return this.isExpectedEnumDeclaration_EnumElementsTerminator(); - - case 512 /* ObjectType_TypeMembers */: - return this.isExpectedObjectType_TypeMembersTerminator(); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.isExpectedArgumentList_AssignmentExpressionsTerminator(); - - case 2048 /* HeritageClause_TypeNameList */: - return this.isExpectedHeritageClause_TypeNameListTerminator(); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return this.isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - - case 131072 /* ParameterList_Parameters */: - return this.isExpectedParameterList_ParametersTerminator(); - - case 262144 /* TypeArgumentList_Types */: - return this.isExpectedTypeArgumentList_TypesTerminator(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.isExpectedTypeParameterList_TypeParametersTerminator(); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isExpectedSourceUnit_ModuleElementsTerminator = function () { - return this.currentToken().tokenKind === 10 /* EndOfFileToken */; - }; - - ParserImpl.prototype.isExpectedEnumDeclaration_EnumElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedModuleDeclaration_ModuleElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedObjectType_TypeMembersTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedLiteralExpression_AssignmentExpressionsTerminator = function () { - return this.currentToken().tokenKind === 75 /* CloseBracketToken */; - }; - - ParserImpl.prototype.isExpectedTypeArgumentList_TypesTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 81 /* GreaterThanToken */) { - return true; - } - - if (this.canFollowTypeArgumentListInExpression(token.tokenKind)) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedTypeParameterList_TypeParametersTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 81 /* GreaterThanToken */) { - return true; - } - - if (token.tokenKind === 72 /* OpenParenToken */ || token.tokenKind === 70 /* OpenBraceToken */ || token.tokenKind === 48 /* ExtendsKeyword */ || token.tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedParameterList_ParametersTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 73 /* CloseParenToken */) { - return true; - } - - if (token.tokenKind === 70 /* OpenBraceToken */) { - return true; - } - - if (token.tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator = function () { - if (this.currentToken().tokenKind === 78 /* SemicolonToken */ || this.currentToken().tokenKind === 73 /* CloseParenToken */) { - return true; - } - - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator = function () { - if (this.previousToken().tokenKind === 79 /* CommaToken */) { - return false; - } - - if (this.currentToken().tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return this.canEatExplicitOrAutomaticSemicolon(false); - }; - - ParserImpl.prototype.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 70 /* OpenBraceToken */ || token0.tokenKind === 71 /* CloseBraceToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedHeritageClause_TypeNameListTerminator = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 48 /* ExtendsKeyword */ || token0.tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - - if (this.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedArgumentList_AssignmentExpressionsTerminator = function () { - var token0 = this.currentToken(); - return token0.tokenKind === 73 /* CloseParenToken */ || token0.tokenKind === 78 /* SemicolonToken */; - }; - - ParserImpl.prototype.isExpectedClassDeclaration_ClassElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedSwitchStatement_SwitchClausesTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedSwitchClause_StatementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */ || this.isSwitchClause(); - }; - - ParserImpl.prototype.isExpectedBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedTryBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 17 /* CatchKeyword */ || this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.isExpectedCatchBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.isExpectedListItem = function (currentListType, inErrorRecovery) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.isModuleElement(inErrorRecovery); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.isHeritageClause(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.isClassElement(inErrorRecovery); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.isModuleElement(inErrorRecovery); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.isSwitchClause(); - - case 16 /* SwitchClause_Statements */: - return this.isStatement(inErrorRecovery); - - case 32 /* Block_Statements */: - return this.isStatement(inErrorRecovery); - - case 64 /* TryBlock_Statements */: - case 128 /* CatchBlock_Statements */: - return false; - - case 256 /* EnumDeclaration_EnumElements */: - return this.isEnumElement(inErrorRecovery); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.isVariableDeclarator(); - - case 512 /* ObjectType_TypeMembers */: - return this.isTypeMember(inErrorRecovery); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.isExpectedArgumentList_AssignmentExpression(); - - case 2048 /* HeritageClause_TypeNameList */: - return this.isHeritageClauseTypeName(); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.isPropertyAssignment(inErrorRecovery); - - case 131072 /* ParameterList_Parameters */: - return this.isParameter(); - - case 262144 /* TypeArgumentList_Types */: - return this.isType(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.isTypeParameter(); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.isAssignmentOrOmittedExpression(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isExpectedArgumentList_AssignmentExpression = function () { - var currentToken = this.currentToken(); - if (this.isExpression(currentToken)) { - return true; - } - - if (currentToken.tokenKind === 79 /* CommaToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.parseExpectedListItem = function (currentListType, inErrorRecovery) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.parseModuleElement(inErrorRecovery); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.parseHeritageClause(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.parseClassElement(inErrorRecovery); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.parseModuleElement(inErrorRecovery); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.parseSwitchClause(); - - case 16 /* SwitchClause_Statements */: - return this.parseStatement(inErrorRecovery); - - case 32 /* Block_Statements */: - return this.parseStatement(inErrorRecovery); - - case 256 /* EnumDeclaration_EnumElements */: - return this.parseEnumElement(); - - case 512 /* ObjectType_TypeMembers */: - return this.parseTypeMember(inErrorRecovery); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.parseAssignmentExpression(true); - - case 2048 /* HeritageClause_TypeNameList */: - return this.parseNameOrGenericType(); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return this.parseVariableDeclarator(true, false); - - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.parseVariableDeclarator(false, false); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.parsePropertyAssignment(inErrorRecovery); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.parseAssignmentOrOmittedExpression(); - - case 131072 /* ParameterList_Parameters */: - return this.parseParameter(); - - case 262144 /* TypeArgumentList_Types */: - return this.parseType(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.parseTypeParameter(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.getExpectedListElementType = function (currentListType) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - - case 2 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - - case 4 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - - case 8 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - - case 16 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - - case 32 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - - case 256 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - - case 512 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - case 2048 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - - case 131072 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - - case 262144 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - - case 524288 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - return ParserImpl; - })(); - - function parse(fileName, text, isDeclaration, options) { - var source = new NormalParserSource(fileName, text, options.languageVersion()); - - return new ParserImpl(fileName, text.lineMap(), source, options, text).parseSyntaxTree(isDeclaration); - } - Parser.parse = parse; - - function incrementalParse(oldSyntaxTree, textChangeRange, newText) { - if (textChangeRange.isUnchanged()) { - return oldSyntaxTree; - } - - var source = new IncrementalParserSource(oldSyntaxTree, textChangeRange, newText); - - return new ParserImpl(oldSyntaxTree.fileName(), newText.lineMap(), source, oldSyntaxTree.parseOptions(), newText).parseSyntaxTree(oldSyntaxTree.isDeclaration()); - } - Parser.incrementalParse = incrementalParse; - })(TypeScript.Parser || (TypeScript.Parser = {})); - var Parser = TypeScript.Parser; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTree = (function () { - function SyntaxTree(sourceUnit, isDeclaration, diagnostics, fileName, lineMap, parseOtions) { - this._allDiagnostics = null; - this._sourceUnit = sourceUnit; - this._isDeclaration = isDeclaration; - this._parserDiagnostics = diagnostics; - this._fileName = fileName; - this._lineMap = lineMap; - this._parseOptions = parseOtions; - } - SyntaxTree.prototype.toJSON = function (key) { - var result = {}; - - result.isDeclaration = this._isDeclaration; - result.languageVersion = TypeScript.LanguageVersion[this._parseOptions.languageVersion()]; - result.parseOptions = this._parseOptions; - - if (this.diagnostics().length > 0) { - result.diagnostics = this.diagnostics(); - } - - result.sourceUnit = this._sourceUnit; - result.lineMap = this._lineMap; - - return result; - }; - - SyntaxTree.prototype.sourceUnit = function () { - return this._sourceUnit; - }; - - SyntaxTree.prototype.isDeclaration = function () { - return this._isDeclaration; - }; - - SyntaxTree.prototype.computeDiagnostics = function () { - if (this._parserDiagnostics.length > 0) { - return this._parserDiagnostics; - } - - var diagnostics = []; - this.sourceUnit().accept(new GrammarCheckerWalker(this, diagnostics)); - - return diagnostics; - }; - - SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { - this._allDiagnostics = this.computeDiagnostics(); - } - - return this._allDiagnostics; - }; - - SyntaxTree.prototype.fileName = function () { - return this._fileName; - }; - - SyntaxTree.prototype.lineMap = function () { - return this._lineMap; - }; - - SyntaxTree.prototype.parseOptions = function () { - return this._parseOptions; - }; - - SyntaxTree.prototype.structuralEquals = function (tree) { - return TypeScript.ArrayUtilities.sequenceEquals(this.diagnostics(), tree.diagnostics(), TypeScript.Diagnostic.equals) && this.sourceUnit().structuralEquals(tree.sourceUnit()); - }; - return SyntaxTree; - })(); - TypeScript.SyntaxTree = SyntaxTree; - - var GrammarCheckerWalker = (function (_super) { - __extends(GrammarCheckerWalker, _super); - function GrammarCheckerWalker(syntaxTree, diagnostics) { - _super.call(this); - this.syntaxTree = syntaxTree; - this.diagnostics = diagnostics; - this.inAmbientDeclaration = false; - this.inBlock = false; - this.inObjectLiteralExpression = false; - this.currentConstructor = null; - } - GrammarCheckerWalker.prototype.childFullStart = function (parent, child) { - return this.position() + TypeScript.Syntax.childOffset(parent, child); - }; - - GrammarCheckerWalker.prototype.childStart = function (parent, child) { - return this.childFullStart(parent, child) + child.leadingTriviaWidth(); - }; - - GrammarCheckerWalker.prototype.pushDiagnostic = function (start, length, diagnosticKey, args) { - if (typeof args === "undefined") { args = null; } - this.diagnostics.push(new TypeScript.Diagnostic(this.syntaxTree.fileName(), this.syntaxTree.lineMap(), start, length, diagnosticKey, args)); - }; - - GrammarCheckerWalker.prototype.pushDiagnostic1 = function (elementFullStart, element, diagnosticKey, args) { - if (typeof args === "undefined") { args = null; } - this.diagnostics.push(new TypeScript.Diagnostic(this.syntaxTree.fileName(), this.syntaxTree.lineMap(), elementFullStart + element.leadingTriviaWidth(), element.width(), diagnosticKey, args)); - }; - - GrammarCheckerWalker.prototype.visitCatchClause = function (node) { - if (node.typeAnnotation) { - this.pushDiagnostic(this.childStart(node, node.typeAnnotation), node.typeAnnotation.width(), TypeScript.DiagnosticCode.Catch_clause_parameter_cannot_have_a_type_annotation); - } - - _super.prototype.visitCatchClause.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkParameterListOrder = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameters); - - var seenOptionalParameter = false; - var parameterCount = node.parameters.nonSeparatorCount(); - - for (var i = 0, n = node.parameters.childCount(); i < n; i++) { - var nodeOrToken = node.parameters.childAt(i); - if (i % 2 === 0) { - var parameterIndex = i / 2; - var parameter = node.parameters.childAt(i); - - if (parameter.dotDotDotToken) { - if (parameterIndex !== (parameterCount - 1)) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_must_be_last_in_list); - return true; - } - - if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_cannot_be_optional); - return true; - } - - if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_cannot_have_an_initializer); - return true; - } - } else if (parameter.questionToken || parameter.equalsValueClause) { - seenOptionalParameter = true; - - if (parameter.questionToken && parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer); - return true; - } - } else { - if (seenOptionalParameter) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Required_parameter_cannot_follow_optional_parameter); - return true; - } - } - } - - parameterFullStart += nodeOrToken.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterListAcessibilityModifiers = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameters); - - for (var i = 0, n = node.parameters.childCount(); i < n; i++) { - var nodeOrToken = node.parameters.childAt(i); - if (i % 2 === 0) { - var parameter = node.parameters.childAt(i); - - if (this.checkParameterAccessibilityModifiers(node, parameter, parameterFullStart)) { - return true; - } - } - - parameterFullStart += nodeOrToken.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifiers = function (parameterList, parameter, parameterFullStart) { - if (parameter.modifiers.childCount() > 0) { - var modifiers = parameter.modifiers; - var modifierFullStart = parameterFullStart + TypeScript.Syntax.childOffset(parameter, modifiers); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - - if (this.checkParameterAccessibilityModifier(parameterList, modifier, modifierFullStart, i)) { - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifier = function (parameterList, modifier, modifierFullStart, modifierIndex) { - if (modifier.tokenKind !== 57 /* PublicKeyword */ && modifier.tokenKind !== 55 /* PrivateKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); - return true; - } else { - if (modifierIndex > 0) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - - if (!this.inAmbientDeclaration && this.currentConstructor && !this.currentConstructor.block && this.currentConstructor.callSignature.parameterList === parameterList) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Parameter_property_declarations_cannot_be_used_in_a_constructor_overload); - return true; - } else if (this.inAmbientDeclaration || this.currentConstructor === null || this.currentConstructor.callSignature.parameterList !== parameterList) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Parameter_property_declarations_can_only_be_used_in_a_non_ambient_constructor_declaration); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForTrailingSeparator = function (parent, list) { - if (list.childCount() === 0 || list.childCount() % 2 === 1) { - return false; - } - - var currentElementFullStart = this.childFullStart(parent, list); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var child = list.childAt(i); - if (i === n - 1) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode.Trailing_separator_not_allowed); - } - - currentElementFullStart += child.fullWidth(); - } - - return true; - }; - - GrammarCheckerWalker.prototype.checkForAtLeastOneElement = function (parent, list, expected) { - if (list.childCount() > 0) { - return false; - } - - var listFullStart = this.childFullStart(parent, list); - var tokenAtStart = this.syntaxTree.sourceUnit().findToken(listFullStart); - - this.pushDiagnostic1(listFullStart, tokenAtStart.token(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [expected]); - - return true; - }; - - GrammarCheckerWalker.prototype.visitParameterList = function (node) { - if (this.checkParameterListAcessibilityModifiers(node) || this.checkParameterListOrder(node) || this.checkForTrailingSeparator(node, node.parameters)) { - this.skip(node); - return; - } - - _super.prototype.visitParameterList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingSeparator(node, node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null))) { - this.skip(node); - return; - } - - _super.prototype.visitHeritageClause.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitArgumentList = function (node) { - if (this.checkForTrailingSeparator(node, node.arguments)) { - this.skip(node); - return; - } - - _super.prototype.visitArgumentList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForTrailingSeparator(node, node.variableDeclarators) || this.checkForAtLeastOneElement(node, node.variableDeclarators, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitVariableDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingSeparator(node, node.typeArguments) || this.checkForAtLeastOneElement(node, node.typeArguments, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitTypeArgumentList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingSeparator(node, node.typeParameters) || this.checkForAtLeastOneElement(node, node.typeParameters, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitTypeParameterList.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkIndexSignatureParameter = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameter); - var parameter = node.parameter; - - if (parameter.dotDotDotToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); - return true; - } else if (parameter.modifiers.childCount() > 0) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_accessibility_modifiers); - return true; - } else if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_a_question_mark); - return true; - } else if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_an_initializer); - return true; - } else if (!parameter.typeAnnotation) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); - return true; - } else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitIndexSignature = function (node) { - if (this.checkIndexSignatureParameter(node)) { - this.skip(node); - return; - } - - if (!node.typeAnnotation) { - this.pushDiagnostic1(this.position(), node, TypeScript.DiagnosticCode.Index_signature_must_have_a_type_annotation); - this.skip(node); - return; - } - - _super.prototype.visitIndexSignature.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkClassDeclarationHeritageClauses = function (node) { - var heritageClauseFullStart = this.childFullStart(node, node.heritageClauses); - - var seenExtendsClause = false; - var seenImplementsClause = false; - - for (var i = 0, n = node.heritageClauses.childCount(); i < n; i++) { - TypeScript.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses.childAt(i); - - if (heritageClause.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - - if (seenImplementsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); - return true; - } - - if (heritageClause.typeNames.nonSeparatorCount() > 1) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); - return true; - } - - seenExtendsClause = true; - } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - if (seenImplementsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); - return true; - } - - seenImplementsClause = true; - } - - heritageClauseFullStart += heritageClause.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { - if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - - if (declareToken) { - this.pushDiagnostic1(this.childFullStart(modifiers, declareToken), declareToken, TypeScript.DiagnosticCode.declare_modifier_not_allowed_for_code_already_in_an_ambient_context); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, typeKeyword, modifiers) { - if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic1(this.childFullStart(moduleElement, typeKeyword), typeKeyword.firstToken(), TypeScript.DiagnosticCode.declare_modifier_required_for_top_level_element); - return true; - } - } - }; - - GrammarCheckerWalker.prototype.checkFunctionOverloads = function (node, moduleElements) { - if (!this.inAmbientDeclaration && !this.syntaxTree.isDeclaration()) { - var moduleElementFullStart = this.childFullStart(node, moduleElements); - - var inFunctionOverloadChain = false; - var functionOverloadChainName = null; - - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - var lastElement = i === (n - 1); - - if (inFunctionOverloadChain) { - if (moduleElement.kind() !== 129 /* FunctionDeclaration */) { - this.pushDiagnostic1(moduleElementFullStart, moduleElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - - var functionDeclaration = moduleElement; - if (functionDeclaration.identifier.valueText() !== functionOverloadChainName) { - var identifierFullStart = moduleElementFullStart + TypeScript.Syntax.childOffset(moduleElement, functionDeclaration.identifier); - this.pushDiagnostic1(identifierFullStart, functionDeclaration.identifier, TypeScript.DiagnosticCode.Function_overload_name_must_be_0, [functionOverloadChainName]); - return true; - } - } - - if (moduleElement.kind() === 129 /* FunctionDeclaration */) { - functionDeclaration = moduleElement; - if (!TypeScript.SyntaxUtilities.containsToken(functionDeclaration.modifiers, 63 /* DeclareKeyword */)) { - inFunctionOverloadChain = functionDeclaration.block === null; - functionOverloadChainName = functionDeclaration.identifier.valueText(); - - if (inFunctionOverloadChain) { - if (lastElement) { - this.pushDiagnostic1(moduleElementFullStart, moduleElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } else { - var nextElement = moduleElements.childAt(i + 1); - if (nextElement.kind() === 129 /* FunctionDeclaration */) { - var nextFunction = nextElement; - - if (nextFunction.identifier.valueText() !== functionOverloadChainName && nextFunction.block === null) { - var identifierFullStart = moduleElementFullStart + TypeScript.Syntax.childOffset(moduleElement, functionDeclaration.identifier); - this.pushDiagnostic1(identifierFullStart, functionDeclaration.identifier, TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - } - } - } - } else { - inFunctionOverloadChain = false; - functionOverloadChainName = ""; - } - } - - moduleElementFullStart += moduleElement.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkClassOverloads = function (node) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - var classElementFullStart = this.childFullStart(node, node.classElements); - - var inFunctionOverloadChain = false; - var inConstructorOverloadChain = false; - - var functionOverloadChainName = null; - var isInStaticOverloadChain = null; - var memberFunctionDeclaration = null; - - for (var i = 0, n = node.classElements.childCount(); i < n; i++) { - var classElement = node.classElements.childAt(i); - var lastElement = i === (n - 1); - var isStaticOverload = null; - - if (inFunctionOverloadChain) { - if (classElement.kind() !== 135 /* MemberFunctionDeclaration */) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - - memberFunctionDeclaration = classElement; - if (memberFunctionDeclaration.propertyName.valueText() !== functionOverloadChainName) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, TypeScript.DiagnosticCode.Function_overload_name_must_be_0, [functionOverloadChainName]); - return true; - } - - isStaticOverload = TypeScript.SyntaxUtilities.containsToken(memberFunctionDeclaration.modifiers, 58 /* StaticKeyword */); - if (isStaticOverload !== isInStaticOverloadChain) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - var diagnostic = isInStaticOverloadChain ? TypeScript.DiagnosticCode.Function_overload_must_be_static : TypeScript.DiagnosticCode.Function_overload_must_not_be_static; - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, diagnostic, null); - return true; - } - } else if (inConstructorOverloadChain) { - if (classElement.kind() !== 137 /* ConstructorDeclaration */) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Constructor_implementation_expected); - return true; - } - } - - if (classElement.kind() === 135 /* MemberFunctionDeclaration */) { - memberFunctionDeclaration = classElement; - - inFunctionOverloadChain = memberFunctionDeclaration.block === null; - functionOverloadChainName = memberFunctionDeclaration.propertyName.valueText(); - isInStaticOverloadChain = TypeScript.SyntaxUtilities.containsToken(memberFunctionDeclaration.modifiers, 58 /* StaticKeyword */); - - if (inFunctionOverloadChain) { - if (lastElement) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } else { - var nextElement = node.classElements.childAt(i + 1); - if (nextElement.kind() === 135 /* MemberFunctionDeclaration */) { - var nextMemberFunction = nextElement; - - if (nextMemberFunction.propertyName.valueText() !== functionOverloadChainName && nextMemberFunction.block === null) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - } - } - } - } else if (classElement.kind() === 137 /* ConstructorDeclaration */) { - var constructorDeclaration = classElement; - - inConstructorOverloadChain = constructorDeclaration.block === null; - if (lastElement && inConstructorOverloadChain) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Constructor_implementation_expected); - return true; - } - } - - classElementFullStart += classElement.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForReservedName = function (parent, name, diagnosticKey) { - var nameFullStart = this.childFullStart(parent, name); - var token; - var tokenFullStart; - - var current = name; - while (current !== null) { - if (current.kind() === 121 /* QualifiedName */) { - var qualifiedName = current; - token = qualifiedName.right; - tokenFullStart = nameFullStart + this.childFullStart(qualifiedName, token); - current = qualifiedName.left; - } else { - TypeScript.Debug.assert(current.kind() === 11 /* IdentifierName */); - token = current; - tokenFullStart = nameFullStart; - current = null; - } - - switch (token.valueText()) { - case "any": - case "number": - case "boolean": - case "string": - case "void": - this.pushDiagnostic(tokenFullStart + token.leadingTriviaWidth(), token.width(), diagnosticKey, [token.valueText()]); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitClassDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Class_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.classKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkClassDeclarationHeritageClauses(node) || this.checkClassOverloads(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitClassDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkInterfaceDeclarationHeritageClauses = function (node) { - var heritageClauseFullStart = this.childFullStart(node, node.heritageClauses); - - var seenExtendsClause = false; - - for (var i = 0, n = node.heritageClauses.childCount(); i < n; i++) { - TypeScript.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses.childAt(i); - - if (heritageClause.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - - seenExtendsClause = true; - } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); - return true; - } - - heritageClauseFullStart += heritageClause.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { - var modifierFullStart = this.position(); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - if (modifier.tokenKind === 63 /* DeclareKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.declare_modifier_cannot_appear_on_an_interface_declaration); - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitInterfaceDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Interface_name_cannot_be_0) || this.checkInterfaceModifiers(node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkInterfaceDeclarationHeritageClauses(node)) { - this.skip(node); - return; - } - - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkClassElementModifiers = function (list) { - var modifierFullStart = this.position(); - - var seenAccessibilityModifier = false; - var seenStaticModifier = false; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var modifier = list.childAt(i); - if (modifier.tokenKind === 57 /* PublicKeyword */ || modifier.tokenKind === 55 /* PrivateKeyword */) { - if (seenAccessibilityModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - - if (seenStaticModifier) { - var previousToken = list.childAt(i - 1); - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [modifier.text(), previousToken.text()]); - return true; - } - - seenAccessibilityModifier = true; - } else if (modifier.tokenKind === 58 /* StaticKeyword */) { - if (seenStaticModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return true; - } - - seenStaticModifier = true; - } else { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_class_element, [modifier.text()]); - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitMemberVariableDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitMemberVariableDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkGetAccessorParameter = function (node, getKeyword, parameterList) { - var getKeywordFullStart = this.childFullStart(node, getKeyword); - if (parameterList.parameters.childCount() !== 0) { - this.pushDiagnostic1(getKeywordFullStart, getKeyword, TypeScript.DiagnosticCode.get_accessor_cannot_have_parameters); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitIndexMemberDeclaration = function (node) { - if (this.checkIndexMemberModifiers(node)) { - this.skip(node); - return; - } - - _super.prototype.visitIndexMemberDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { - if (node.modifiers.childCount() > 0) { - var modifierFullStart = this.childFullStart(node, node.modifiers); - this.pushDiagnostic1(modifierFullStart, node.modifiers.childAt(0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, node, languageVersion, diagnosticKey) { - if (this.syntaxTree.parseOptions().languageVersion() < languageVersion) { - var nodeFullStart = this.childFullStart(parent, node); - this.pushDiagnostic1(nodeFullStart, node, diagnosticKey); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - - GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.getKeyword, 1 /* EcmaScript5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkGetAccessorParameter(node, node.getKeyword, node.parameterList)) { - this.skip(node); - return; - } - - _super.prototype.visitGetAccessor.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForAccessorDeclarationInAmbientContext = function (accessor) { - if (this.inAmbientDeclaration) { - this.pushDiagnostic1(this.position(), accessor, TypeScript.DiagnosticCode.Accessors_are_not_allowed_in_ambient_contexts, null); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node, setKeyword, parameterList) { - var setKeywordFullStart = this.childFullStart(node, setKeyword); - if (parameterList.parameters.childCount() !== 1) { - this.pushDiagnostic1(setKeywordFullStart, setKeyword, TypeScript.DiagnosticCode.set_accessor_must_have_one_and_only_one_parameter); - return true; - } - - var parameterListFullStart = this.childFullStart(node, parameterList); - var parameterFullStart = parameterListFullStart + TypeScript.Syntax.childOffset(parameterList, parameterList.openParenToken); - var parameter = parameterList.parameters.childAt(0); - - if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); - return true; - } - - if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_have_an_initializer); - return true; - } - - if (parameter.dotDotDotToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_cannot_have_rest_parameter); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.setKeyword, 1 /* EcmaScript5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkSetAccessorParameter(node, node.setKeyword, node.parameterList)) { - this.skip(node); - return; - } - - _super.prototype.visitSetAccessor.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitEnumDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Enum_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.enumKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers), this.checkEnumElements(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitEnumDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkEnumElements = function (node) { - var enumElementFullStart = this.childFullStart(node, node.enumElements); - - var previousValueWasComputed = false; - for (var i = 0, n = node.enumElements.childCount(); i < n; i++) { - var child = node.enumElements.childAt(i); - - if (i % 2 === 0) { - var enumElement = child; - - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic1(enumElementFullStart, enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer, null); - return true; - } - - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } - } - - enumElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitEnumElement = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - var expression = node.equalsValueClause.value; - if (!TypeScript.Syntax.isIntegerLiteral(expression)) { - this.pushDiagnostic1(this.childFullStart(node, node.equalsValueClause), node.equalsValueClause.firstToken(), TypeScript.DiagnosticCode.Ambient_enum_elements_can_only_have_integer_literal_initializers); - this.skip(node); - return; - } - } - - _super.prototype.visitEnumElement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { - this.pushDiagnostic1(this.position(), node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); - } - - _super.prototype.visitInvocationExpression.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkModuleElementModifiers = function (modifiers) { - var modifierFullStart = this.position(); - var seenExportModifier = false; - var seenDeclareModifier = false; - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - if (modifier.tokenKind === 57 /* PublicKeyword */ || modifier.tokenKind === 55 /* PrivateKeyword */ || modifier.tokenKind === 58 /* StaticKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); - return true; - } - - if (modifier.tokenKind === 63 /* DeclareKeyword */) { - if (seenDeclareModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return; - } - - seenDeclareModifier = true; - } else if (modifier.tokenKind === 47 /* ExportKeyword */) { - if (seenExportModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return; - } - - if (seenDeclareModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); - return; - } - - seenExportModifier = true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedImportDeclaration = function (node) { - var currentElementFullStart = this.childFullStart(node, node.moduleElements); - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var child = node.moduleElements.childAt(i); - if (child.kind() === 133 /* ImportDeclaration */) { - var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 245 /* ExternalModuleReference */) { - if (node.stringLiteral === null) { - this.pushDiagnostic1(currentElementFullStart, importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module, null); - } - } - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - - if (declareToken) { - this.pushDiagnostic1(this.childFullStart(modifiers, declareToken), declareToken, TypeScript.DiagnosticCode.declare_modifier_not_allowed_on_import_declaration); - return true; - } - }; - - GrammarCheckerWalker.prototype.visitImportDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifierOnImportDeclaration(node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitImportDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitModuleDeclaration = function (node) { - if (this.checkForReservedName(node, node.name, TypeScript.DiagnosticCode.Module_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.moduleKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node) || this.checkForDisallowedExports(node, node.moduleElements) || this.checkForMultipleExportAssignments(node, node.moduleElements)) { - this.skip(node); - return; - } - - if (!TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */) && this.checkFunctionOverloads(node, node.moduleElements)) { - this.skip(node); - return; - } - - if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - var stringLiteralFullStart = this.childFullStart(node, node.stringLiteral); - this.pushDiagnostic1(stringLiteralFullStart, node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); - this.skip(node); - return; - } - } - - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitModuleDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedExports = function (node, moduleElements) { - var seenExportedElement = false; - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - - if (TypeScript.SyntaxUtilities.hasExportKeyword(child)) { - seenExportedElement = true; - break; - } - } - - var moduleElementFullStart = this.childFullStart(node, moduleElements); - if (seenExportedElement) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - - if (child.kind() === 134 /* ExportAssignment */) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Export_assignment_not_allowed_in_module_with_exported_element); - return true; - } - - moduleElementFullStart += child.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForMultipleExportAssignments = function (node, moduleElements) { - var moduleElementFullStart = this.childFullStart(node, moduleElements); - var seenExportAssignment = false; - var errorFound = false; - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - if (child.kind() === 134 /* ExportAssignment */) { - if (seenExportAssignment) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Module_cannot_have_multiple_export_assignments); - errorFound = true; - } - seenExportAssignment = true; - } - - moduleElementFullStart += child.fullWidth(); - } - - return errorFound; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { - var moduleElementFullStart = this.childFullStart(node, node.moduleElements); - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var child = node.moduleElements.childAt(i); - - if (child.kind() === 134 /* ExportAssignment */) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); - - return true; - } - - moduleElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitBlock = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic1(this.position(), node.firstToken(), TypeScript.DiagnosticCode.Implementations_are_not_allowed_in_ambient_contexts); - this.skip(node); - return; - } - - if (this.checkFunctionOverloads(node, node.statements)) { - this.skip(node); - return; - } - - var savedInBlock = this.inBlock; - this.inBlock = true; - _super.prototype.visitBlock.call(this, node); - this.inBlock = savedInBlock; - }; - - GrammarCheckerWalker.prototype.checkForStatementInAmbientContxt = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic1(this.position(), node.firstToken(), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitBreakStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitBreakStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitContinueStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitContinueStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitDebuggerStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitDebuggerStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitDoStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitDoStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitEmptyStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitEmptyStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitExpressionStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitExpressionStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitForInStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInStatementVariableDeclaration(node)) { - this.skip(node); - return; - } - - _super.prototype.visitForInStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForInStatementVariableDeclaration = function (node) { - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.nonSeparatorCount() > 1) { - var variableDeclarationFullStart = this.childFullStart(node, node.variableDeclaration); - - this.pushDiagnostic1(variableDeclarationFullStart, node.variableDeclaration, TypeScript.DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitForStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitForStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitIfStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitIfStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitLabeledStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitLabeledStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitReturnStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitReturnStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitSwitchStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitSwitchStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitThrowStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitThrowStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTryStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitTryStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitWhileStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitWhileStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitWithStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitWithStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { - if (this.inBlock || this.inObjectLiteralExpression) { - if (modifiers.childCount() > 0) { - var modifierFullStart = this.childFullStart(parent, modifiers); - this.pushDiagnostic1(modifierFullStart, modifiers.childAt(0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.functionKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitFunctionDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitVariableStatement.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkListSeparators = function (parent, list, kind) { - var currentElementFullStart = this.childFullStart(parent, list); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var child = list.childAt(i); - if (i % 2 === 1 && child.kind() !== kind) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node, node.typeMembers, 78 /* SemicolonToken */)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitObjectType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitArrayType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitArrayType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitFunctionType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitFunctionType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitConstructorType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitConstructorType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - this.pushDiagnostic1(this.childFullStart(node, node.equalsValueClause), node.equalsValueClause.firstToken(), TypeScript.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts); - this.skip(node); - return; - } - - _super.prototype.visitVariableDeclarator.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitConstructorDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkConstructorModifiers(node.modifiers) || this.checkConstructorTypeParameterList(node) || this.checkConstructorTypeAnnotation(node)) { - this.skip(node); - return; - } - - var savedCurrentConstructor = this.currentConstructor; - this.currentConstructor = node; - _super.prototype.visitConstructorDeclaration.call(this, node); - this.currentConstructor = savedCurrentConstructor; - }; - - GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { - var currentElementFullStart = this.position(); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var child = modifiers.childAt(i); - if (child.kind() !== 57 /* PublicKeyword */) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); - return true; - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkConstructorTypeParameterList = function (node) { - var currentElementFullStart = this.position(); - - if (node.callSignature.typeParameterList) { - var callSignatureFullStart = this.childFullStart(node, node.callSignature); - var typeParameterListFullStart = callSignatureFullStart + TypeScript.Syntax.childOffset(node.callSignature, node.callSignature.typeAnnotation); - this.pushDiagnostic1(callSignatureFullStart, node.callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkConstructorTypeAnnotation = function (node) { - var currentElementFullStart = this.position(); - - if (node.callSignature.typeAnnotation) { - var callSignatureFullStart = this.childFullStart(node, node.callSignature); - var typeAnnotationFullStart = callSignatureFullStart + TypeScript.Syntax.childOffset(node.callSignature, node.callSignature.typeAnnotation); - this.pushDiagnostic1(typeAnnotationFullStart, node.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitSourceUnit = function (node) { - if (this.checkFunctionOverloads(node, node.moduleElements) || this.checkForDisallowedExports(node, node.moduleElements) || this.checkForMultipleExportAssignments(node, node.moduleElements)) { - this.skip(node); - return; - } - - _super.prototype.visitSourceUnit.call(this, node); - }; - return GrammarCheckerWalker; - })(TypeScript.PositionTrackingWalker); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Unicode = (function () { - function Unicode() { - } - Unicode.lookupInUnicodeMap = function (code, map) { - if (code < map[0]) { - return false; - } - - var lo = 0; - var hi = map.length; - var mid; - - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - - if (code < map[mid]) { - hi = mid; - } else { - lo = mid + 2; - } - } - - return false; - }; - - Unicode.isIdentifierStart = function (code, languageVersion) { - if (languageVersion === 0 /* EcmaScript3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); - } else if (languageVersion === 1 /* EcmaScript5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); - } else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - - Unicode.isIdentifierPart = function (code, languageVersion) { - if (languageVersion === 0 /* EcmaScript3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); - } else if (languageVersion === 1 /* EcmaScript5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); - } else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - Unicode.unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - - Unicode.unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - Unicode.unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - return Unicode; - })(); - TypeScript.Unicode = Unicode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CompilerDiagnostics) { - CompilerDiagnostics.debug = false; - - CompilerDiagnostics.diagnosticWriter = null; - - CompilerDiagnostics.analysisPass = 0; - - function Alert(output) { - if (CompilerDiagnostics.diagnosticWriter) { - CompilerDiagnostics.diagnosticWriter.Alert(output); - } - } - CompilerDiagnostics.Alert = Alert; - - function debugPrint(s) { - if (CompilerDiagnostics.debug) { - Alert(s); - } - } - CompilerDiagnostics.debugPrint = debugPrint; - - function assert(condition, s) { - if (CompilerDiagnostics.debug) { - if (!condition) { - Alert(s); - } - } - } - CompilerDiagnostics.assert = assert; - })(TypeScript.CompilerDiagnostics || (TypeScript.CompilerDiagnostics = {})); - var CompilerDiagnostics = TypeScript.CompilerDiagnostics; - - var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.information = function () { - return false; - }; - NullLogger.prototype.debug = function () { - return false; - }; - NullLogger.prototype.warning = function () { - return false; - }; - NullLogger.prototype.error = function () { - return false; - }; - NullLogger.prototype.fatal = function () { - return false; - }; - NullLogger.prototype.log = function (s) { - }; - return NullLogger; - })(); - TypeScript.NullLogger = NullLogger; - - function timeFunction(logger, funcDescription, func) { - var start = (new Date()).getTime(); - var result = func(); - var end = (new Date()).getTime(); - if (logger.information()) { - logger.log(funcDescription + " completed in " + (end - start) + " msec"); - } - return result; - } - TypeScript.timeFunction = timeFunction; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Document = (function () { - function Document(_compiler, _semanticInfoChain, fileName, referencedFiles, _scriptSnapshot, byteOrderMark, version, isOpen, _syntaxTree, _topLevelDecl) { - this._compiler = _compiler; - this._semanticInfoChain = _semanticInfoChain; - this.fileName = fileName; - this.referencedFiles = referencedFiles; - this._scriptSnapshot = _scriptSnapshot; - this.byteOrderMark = byteOrderMark; - this.version = version; - this.isOpen = isOpen; - this._syntaxTree = _syntaxTree; - this._topLevelDecl = _topLevelDecl; - this._diagnostics = null; - this._bloomFilter = null; - this._sourceUnit = null; - this._lineMap = null; - this._declASTMap = []; - this._astDeclMap = []; - this._amdDependencies = undefined; - this._externalModuleIndicatorSpan = undefined; - } - Document.prototype.invalidate = function () { - this._declASTMap.length = 0; - this._astDeclMap.length = 0; - this._topLevelDecl = null; - - this._syntaxTree = null; - this._sourceUnit = null; - this._diagnostics = null; - this._bloomFilter = null; - }; - - Document.prototype.isDeclareFile = function () { - return TypeScript.isDTSFile(this.fileName); - }; - - Document.prototype.cacheSyntaxTreeInfo = function (syntaxTree) { - var start = new Date().getTime(); - this._diagnostics = syntaxTree.diagnostics(); - TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; - - this._lineMap = syntaxTree.lineMap(); - - var sourceUnit = syntaxTree.sourceUnit(); - var leadingTrivia = sourceUnit.leadingTrivia(); - - this._externalModuleIndicatorSpan = this.getImplicitImportSpan(leadingTrivia) || this.getTopLevelImportOrExportSpan(sourceUnit); - - var amdDependencies = []; - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var amdDependency = this.getAmdDependency(trivia.fullText()); - if (amdDependency) { - amdDependencies.push(amdDependency); - } - } - } - - this._amdDependencies = amdDependencies; - }; - - Document.prototype.getAmdDependency = function (comment) { - var amdDependencyRegEx = /^\/\/\/\s*/gim; - var match = implicitImportRegEx.exec(trivia.fullText()); - - if (match) { - return new TypeScript.TextSpan(position, trivia.fullWidth()); - } - - return null; - }; - - Document.prototype.getTopLevelImportOrExportSpan = function (node) { - var firstToken; - var position = 0; - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var moduleElement = node.moduleElements.childAt(i); - - firstToken = moduleElement.firstToken(); - if (firstToken !== null && firstToken.tokenKind === 47 /* ExportKeyword */) { - return new TypeScript.TextSpan(position + firstToken.leadingTriviaWidth(), firstToken.width()); - } - - if (moduleElement.kind() === 133 /* ImportDeclaration */) { - var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 245 /* ExternalModuleReference */) { - return new TypeScript.TextSpan(position + importDecl.leadingTriviaWidth(), importDecl.width()); - } - } - - position += moduleElement.fullWidth(); - } - - return null; - ; - }; - - Document.prototype.sourceUnit = function () { - if (!this._sourceUnit) { - var start = new Date().getTime(); - var syntaxTree = this.syntaxTree(); - this._sourceUnit = TypeScript.SyntaxTreeToAstVisitor.visit(syntaxTree, this.fileName, this._compiler.compilationSettings(), this.isOpen); - TypeScript.astTranslationTime += new Date().getTime() - start; - - if (!this.isOpen) { - this._syntaxTree = null; - } - } - - return this._sourceUnit; - }; - - Document.prototype.diagnostics = function () { - if (this._diagnostics === null) { - this.syntaxTree(); - TypeScript.Debug.assert(this._diagnostics); - } - - return this._diagnostics; - }; - - Document.prototype.lineMap = function () { - if (this._lineMap === null) { - this.syntaxTree(); - TypeScript.Debug.assert(this._lineMap); - } - - return this._lineMap; - }; - - Document.prototype.isExternalModule = function () { - return this.externalModuleIndicatorSpan() !== null; - }; - - Document.prototype.externalModuleIndicatorSpan = function () { - if (this._externalModuleIndicatorSpan === undefined) { - this.syntaxTree(); - TypeScript.Debug.assert(this._externalModuleIndicatorSpan !== undefined); - } - - return this._externalModuleIndicatorSpan; - }; - - Document.prototype.amdDependencies = function () { - if (this._amdDependencies === undefined) { - this.syntaxTree(); - TypeScript.Debug.assert(this._amdDependencies !== undefined); - } - - return this._amdDependencies; - }; - - Document.prototype.syntaxTree = function () { - var result = this._syntaxTree; - if (!result) { - var start = new Date().getTime(); - - result = TypeScript.Parser.parse(this.fileName, TypeScript.SimpleText.fromScriptSnapshot(this._scriptSnapshot), TypeScript.isDTSFile(this.fileName), TypeScript.getParseOptions(this._compiler.compilationSettings())); - - TypeScript.syntaxTreeParseTime += new Date().getTime() - start; - - if (this.isOpen || !this._sourceUnit) { - this._syntaxTree = result; - } - } - - this.cacheSyntaxTreeInfo(result); - return result; - }; - - Document.prototype.bloomFilter = function () { - if (!this._bloomFilter) { - var identifiers = TypeScript.createIntrinsicsObject(); - var pre = function (cur) { - if (TypeScript.ASTHelpers.isValidAstNode(cur)) { - if (cur.kind() === 11 /* IdentifierName */) { - var nodeText = cur.valueText(); - - identifiers[nodeText] = true; - } - } - }; - - TypeScript.getAstWalkerFactory().simpleWalk(this.sourceUnit(), pre, null, identifiers); - - var identifierCount = 0; - for (var name in identifiers) { - if (identifiers[name]) { - identifierCount++; - } - } - - this._bloomFilter = new TypeScript.BloomFilter(identifierCount); - this._bloomFilter.addKeys(identifiers); - } - return this._bloomFilter; - }; - - Document.prototype.emitToOwnOutputFile = function () { - return !this._compiler.compilationSettings().outFileOption() || this.isExternalModule(); - }; - - Document.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { - var oldSyntaxTree = this._syntaxTree; - - if (textChangeRange !== null && TypeScript.Debug.shouldAssert(1 /* Normal */)) { - var oldText = this._scriptSnapshot; - var newText = scriptSnapshot; - - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); - - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); - var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); - - var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); - var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - var newSyntaxTree = textChangeRange === null || oldSyntaxTree === null ? TypeScript.Parser.parse(this.fileName, text, TypeScript.isDTSFile(this.fileName), TypeScript.getParseOptions(this._compiler.compilationSettings())) : TypeScript.Parser.incrementalParse(oldSyntaxTree, textChangeRange, text); - - return new Document(this._compiler, this._semanticInfoChain, this.fileName, this.referencedFiles, scriptSnapshot, this.byteOrderMark, version, isOpen, newSyntaxTree, null); - }; - - Document.create = function (compiler, semanticInfoChain, fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles) { - return new Document(compiler, semanticInfoChain, fileName, referencedFiles, scriptSnapshot, byteOrderMark, version, isOpen, null, null); - }; - - Document.prototype.topLevelDecl = function () { - if (this._topLevelDecl === null) { - this._topLevelDecl = TypeScript.DeclarationCreator.create(this, this._semanticInfoChain, this._compiler.compilationSettings()); - } - - return this._topLevelDecl; - }; - - Document.prototype._getDeclForAST = function (ast) { - this.topLevelDecl(); - return this._astDeclMap[ast.syntaxID()]; - }; - - Document.prototype.getEnclosingDecl = function (ast) { - if (ast.kind() === 120 /* SourceUnit */) { - return this._getDeclForAST(ast); - } - - ast = ast.parent; - var decl = null; - while (ast) { - decl = this._getDeclForAST(ast); - - if (decl) { - break; - } - - ast = ast.parent; - } - - return decl._getEnclosingDeclFromParentDecl(); - }; - - Document.prototype._setDeclForAST = function (ast, decl) { - TypeScript.Debug.assert(decl.fileName() === this.fileName); - this._astDeclMap[ast.syntaxID()] = decl; - }; - - Document.prototype._getASTForDecl = function (decl) { - return this._declASTMap[decl.declID]; - }; - - Document.prototype._setASTForDecl = function (decl, ast) { - TypeScript.Debug.assert(decl.fileName() === this.fileName); - this._declASTMap[decl.declID] = ast; - }; - return Document; - })(); - TypeScript.Document = Document; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function hasFlag(val, flag) { - return (val & flag) !== 0; - } - TypeScript.hasFlag = hasFlag; - - (function (TypeRelationshipFlags) { - TypeRelationshipFlags[TypeRelationshipFlags["SuccessfulComparison"] = 0] = "SuccessfulComparison"; - TypeRelationshipFlags[TypeRelationshipFlags["RequiredPropertyIsMissing"] = 1 << 1] = "RequiredPropertyIsMissing"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleSignatures"] = 1 << 2] = "IncompatibleSignatures"; - TypeRelationshipFlags[TypeRelationshipFlags["SourceSignatureHasTooManyParameters"] = 3] = "SourceSignatureHasTooManyParameters"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleReturnTypes"] = 1 << 4] = "IncompatibleReturnTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatiblePropertyTypes"] = 1 << 5] = "IncompatiblePropertyTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleParameterTypes"] = 1 << 6] = "IncompatibleParameterTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["InconsistantPropertyAccesibility"] = 1 << 7] = "InconsistantPropertyAccesibility"; - })(TypeScript.TypeRelationshipFlags || (TypeScript.TypeRelationshipFlags = {})); - var TypeRelationshipFlags = TypeScript.TypeRelationshipFlags; - - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(TypeScript.ModuleGenTarget || (TypeScript.ModuleGenTarget = {})); - var ModuleGenTarget = TypeScript.ModuleGenTarget; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var proto = "__proto__"; - - var BlockIntrinsics = (function () { - function BlockIntrinsics() { - this.prototype = undefined; - this.toString = undefined; - this.toLocaleString = undefined; - this.valueOf = undefined; - this.hasOwnProperty = undefined; - this.propertyIsEnumerable = undefined; - this.isPrototypeOf = undefined; - this["constructor"] = undefined; - - this[proto] = null; - this[proto] = undefined; - } - return BlockIntrinsics; - })(); - - function createIntrinsicsObject() { - return new BlockIntrinsics(); - } - TypeScript.createIntrinsicsObject = createIntrinsicsObject; - - var StringHashTable = (function () { - function StringHashTable() { - this.itemCount = 0; - this.table = createIntrinsicsObject(); - } - StringHashTable.prototype.getAllKeys = function () { - var result = []; - - for (var k in this.table) { - if (this.table[k] !== undefined) { - result.push(k); - } - } - - return result; - }; - - StringHashTable.prototype.add = function (key, data) { - if (this.table[key] !== undefined) { - return false; - } - - this.table[key] = data; - this.itemCount++; - return true; - }; - - StringHashTable.prototype.addOrUpdate = function (key, data) { - if (this.table[key] !== undefined) { - this.table[key] = data; - return false; - } - - this.table[key] = data; - this.itemCount++; - return true; - }; - - StringHashTable.prototype.map = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - fn(k, this.table[k], context); - } - } - }; - - StringHashTable.prototype.every = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - if (!fn(k, this.table[k], context)) { - return false; - } - } - } - - return true; - }; - - StringHashTable.prototype.some = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - if (fn(k, this.table[k], context)) { - return true; - } - } - } - - return false; - }; - - StringHashTable.prototype.count = function () { - return this.itemCount; - }; - - StringHashTable.prototype.lookup = function (key) { - var data = this.table[key]; - return data === undefined ? null : data; - }; - - StringHashTable.prototype.remove = function (key) { - if (this.table[key] !== undefined) { - this.table[key] = undefined; - this.itemCount--; - } - }; - return StringHashTable; - })(); - TypeScript.StringHashTable = StringHashTable; - - var IdentiferNameHashTable = (function (_super) { - __extends(IdentiferNameHashTable, _super); - function IdentiferNameHashTable() { - _super.apply(this, arguments); - } - IdentiferNameHashTable.prototype.getAllKeys = function () { - var result = []; - - _super.prototype.map.call(this, function (k, v, c) { - if (v !== undefined) { - result.push(k.substring(1)); - } - }, null); - - return result; - }; - - IdentiferNameHashTable.prototype.add = function (key, data) { - return _super.prototype.add.call(this, "#" + key, data); - }; - - IdentiferNameHashTable.prototype.addOrUpdate = function (key, data) { - return _super.prototype.addOrUpdate.call(this, "#" + key, data); - }; - - IdentiferNameHashTable.prototype.map = function (fn, context) { - return _super.prototype.map.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.every = function (fn, context) { - return _super.prototype.every.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.some = function (fn, context) { - return _super.prototype.some.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.lookup = function (key) { - return _super.prototype.lookup.call(this, "#" + key); - }; - return IdentiferNameHashTable; - })(StringHashTable); - TypeScript.IdentiferNameHashTable = IdentiferNameHashTable; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (ASTHelpers) { - function scriptIsElided(sourceUnit) { - return TypeScript.isDTSFile(sourceUnit.fileName()) || moduleMembersAreElided(sourceUnit.moduleElements); - } - ASTHelpers.scriptIsElided = scriptIsElided; - - function moduleIsElided(declaration) { - return TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) || moduleMembersAreElided(declaration.moduleElements); - } - ASTHelpers.moduleIsElided = moduleIsElided; - - function moduleMembersAreElided(members) { - for (var i = 0, n = members.childCount(); i < n; i++) { - var member = members.childAt(i); - - if (member.kind() === 130 /* ModuleDeclaration */) { - if (!moduleIsElided(member)) { - return false; - } - } else if (member.kind() !== 128 /* InterfaceDeclaration */) { - return false; - } - } - - return true; - } - - function enumIsElided(declaration) { - if (TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */)) { - return true; - } - - return false; - } - ASTHelpers.enumIsElided = enumIsElided; - - function isValidAstNode(ast) { - if (!ast) - return false; - - if (ast.start() === -1 || ast.end() === -1) - return false; - - return true; - } - ASTHelpers.isValidAstNode = isValidAstNode; - - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (typeof useTrailingTriviaAsLimChar === "undefined") { useTrailingTriviaAsLimChar = true; } - if (typeof forceInclusive === "undefined") { forceInclusive = false; } - var top = null; - - var pre = function (cur, walker) { - if (isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 149 /* ExpressionStatement */ && cur.width() === 0; - - if (isInvalid1) { - walker.options.goChildren = false; - } else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 212 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 224 /* VariableDeclaration */ || cur.kind() === 225 /* VariableDeclarator */ || cur.kind() === 213 /* InvocationExpression */ || pos === script.end() + script.trailingTriviaWidth(); - - var minChar = cur.start(); - var limChar = cur.end() + (useTrailingTriviaAsLimChar ? cur.trailingTriviaWidth() : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || cur.end() > cur.start()) { - if (top === null) { - top = cur; - } else if (cur.start() >= top.start() && (cur.end() + (useTrailingTriviaAsLimChar ? cur.trailingTriviaWidth() : 0)) <= (top.end() + (useTrailingTriviaAsLimChar ? top.trailingTriviaWidth() : 0))) { - if (top.width() !== 0 || cur.width() !== 0) { - top = cur; - } - } - } - } - - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - - function getExtendsHeritageClause(clauses) { - if (!clauses) { - return null; - } - - return clauses.firstOrDefault(function (c) { - return c.typeNames.nonSeparatorCount() > 0 && c.kind() === 230 /* ExtendsHeritageClause */; - }); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - - function getImplementsHeritageClause(clauses) { - if (!clauses) { - return null; - } - - return clauses.firstOrDefault(function (c) { - return c.typeNames.nonSeparatorCount() > 0 && c.kind() === 231 /* ImplementsHeritageClause */; - }); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - - function isCallExpression(ast) { - return (ast && ast.kind() === 213 /* InvocationExpression */) || (ast && ast.kind() === 216 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - - function isCallExpressionTarget(ast) { - if (!ast) { - return false; - } - - var current = ast; - - while (current && current.parent) { - if (current.parent.kind() === 212 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - - break; - } - - if (current && current.parent) { - if (current.parent.kind() === 213 /* InvocationExpression */ || current.parent.kind() === 216 /* ObjectCreationExpression */) { - return current === current.parent.expression; - } - } - - return false; - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - - switch (ast.parent.kind()) { - case 131 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 128 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 132 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 130 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 225 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 129 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 135 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 242 /* Parameter */: - return ast.parent.identifier === ast; - case 238 /* TypeParameter */: - return ast.parent.identifier === ast; - case 240 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 241 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 243 /* EnumElement */: - return ast.parent.propertyName === ast; - case 133 /* ImportDeclaration */: - return ast.parent.identifier === ast; - } - - return false; - } - - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 232 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 242 /* Parameter */) { - return current.parent; - } - break; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - - function getEnclosingMemberVariableDeclaration(ast) { - var current = ast; - - while (current) { - switch (current.kind()) { - case 136 /* MemberVariableDeclaration */: - return current; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - - return null; - } - ASTHelpers.getEnclosingMemberVariableDeclaration = getEnclosingMemberVariableDeclaration; - - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 129 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 135 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 212 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - - function parametersFromIdentifier(id) { - return { - length: 1, - lastParameterIsRest: function () { - return false; - }, - ast: id, - astAt: function (index) { - return id; - }, - identifierAt: function (index) { - return id; - }, - typeAt: function (index) { - return null; - }, - initializerAt: function (index) { - return null; - }, - isOptionalAt: function (index) { - return false; - } - }; - } - ASTHelpers.parametersFromIdentifier = parametersFromIdentifier; - - function parametersFromParameter(parameter) { - return { - length: 1, - lastParameterIsRest: function () { - return parameter.dotDotDotToken !== null; - }, - ast: parameter, - astAt: function (index) { - return parameter; - }, - identifierAt: function (index) { - return parameter.identifier; - }, - typeAt: function (index) { - return getType(parameter); - }, - initializerAt: function (index) { - return parameter.equalsValueClause; - }, - isOptionalAt: function (index) { - return parameterIsOptional(parameter); - } - }; - } - ASTHelpers.parametersFromParameter = parametersFromParameter; - - function parameterIsOptional(parameter) { - return parameter.questionToken !== null || parameter.equalsValueClause !== null; - } - - function parametersFromParameterList(list) { - return { - length: list.parameters.nonSeparatorCount(), - lastParameterIsRest: function () { - return TypeScript.lastParameterIsRest(list); - }, - ast: list.parameters, - astAt: function (index) { - return list.parameters.nonSeparatorAt(index); - }, - identifierAt: function (index) { - return list.parameters.nonSeparatorAt(index).identifier; - }, - typeAt: function (index) { - return getType(list.parameters.nonSeparatorAt(index)); - }, - initializerAt: function (index) { - return list.parameters.nonSeparatorAt(index).equalsValueClause; - }, - isOptionalAt: function (index) { - return parameterIsOptional(list.parameters.nonSeparatorAt(index)); - } - }; - } - ASTHelpers.parametersFromParameterList = parametersFromParameterList; - - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 225 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - - case 133 /* ImportDeclaration */: - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 242 /* Parameter */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 144 /* IndexSignature */: - case 129 /* FunctionDeclaration */: - case 130 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 238 /* TypeParameter */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - case 138 /* IndexMemberDeclaration */: - case 132 /* EnumDeclaration */: - case 243 /* EnumElement */: - case 240 /* SimplePropertyAssignment */: - case 241 /* FunctionPropertyAssignment */: - case 222 /* FunctionExpression */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - case 145 /* MethodSignature */: - case 141 /* PropertySignature */: - return true; - default: - return false; - } - } - ASTHelpers.isDeclarationAST = isDeclarationAST; - - function docComments(ast) { - if (isDeclarationAST(ast)) { - var preComments = ast.kind() === 225 /* VariableDeclarator */ ? getVariableStatement(ast).preComments() : ast.preComments(); - - if (preComments && preComments.length > 0) { - var preCommentsLength = preComments.length; - var docComments = new Array(); - for (var i = preCommentsLength - 1; i >= 0; i--) { - if (isDocComment(preComments[i])) { - docComments.push(preComments[i]); - continue; - } - - break; - } - - return docComments.reverse(); - } - } - - return TypeScript.sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - - return false; - } - - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 137 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 129 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 143 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 222 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 145 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 142 /* CallSignature */: - return ast.parameterList; - case 139 /* GetAccessor */: - return ast.parameterList; - case 140 /* SetAccessor */: - return ast.parameterList; - } - } - - return null; - } - ASTHelpers.getParameterList = getParameterList; - - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 143 /* ConstructSignature */: - return getType(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 222 /* FunctionExpression */: - return getType(ast.callSignature); - case 145 /* MethodSignature */: - return getType(ast.callSignature); - case 142 /* CallSignature */: - return getType(ast.typeAnnotation); - case 144 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 141 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 139 /* GetAccessor */: - return getType(ast.typeAnnotation); - case 242 /* Parameter */: - return getType(ast.typeAnnotation); - case 136 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 225 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 236 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 244 /* TypeAnnotation */: - return ast.type; - } - } - - return null; - } - ASTHelpers.getType = getType; - - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 224 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 148 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - - return null; - } - - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.sentinelEmptyArray; - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - return ast; - } - - ast = ast.parent; - } - - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - var nameIndex = moduleNames.indexOf(astName); - - return nameIndex === (moduleNames.length - 1); - } - } - - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - - function isAnyNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return ast.stringLiteral === astName; - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - var nameIndex = moduleNames.indexOf(astName); - - return nameIndex >= 0; - } - } - - return false; - } - ASTHelpers.isAnyNameOfModule = isAnyNameOfModule; - - function getNameOfIdenfierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdenfierOrQualifiedName(dotExpr.left) + "." + getNameOfIdenfierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdenfierOrQualifiedName = getNameOfIdenfierOrQualifiedName; - })(TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); - var ASTHelpers = TypeScript.ASTHelpers; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.childCount(); i < n; i++) { - walker.walk(preAst.childAt(i)); - } - } - - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.nonSeparatorCount(); i < n; i++) { - walker.walk(preAst.nonSeparatorAt(i)); - } - } - - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.parameterList); - walker.walk(preAst.block); - } - - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.typeAnnotation); - } - - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.declarators); - } - - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.declaration); - } - - var childrenWalkers = new Array(246 /* Last */ + 1); - - for (var i = 9 /* FirstToken */, n = 119 /* LastToken */; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = 4 /* FirstTrivia */, n = 8 /* LastTrivia */; i <= n; i++) { - childrenWalkers[i] = null; - } - - childrenWalkers[175 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[180 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[226 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[214 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[219 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[218 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[174 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[190 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[166 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[189 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[146 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[152 /* BreakStatement */] = null; - childrenWalkers[142 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[233 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[220 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[236 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[131 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[173 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[186 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[239 /* Constraint */] = walkConstraintChildren; - childrenWalkers[137 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[143 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[153 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[162 /* DebuggerStatement */] = null; - childrenWalkers[234 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[170 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[178 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[161 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[221 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[235 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[156 /* EmptyStatement */] = null; - childrenWalkers[132 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[243 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[194 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[232 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[192 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[134 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[149 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[230 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[245 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[237 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[155 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[154 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[129 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[222 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[241 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[139 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[197 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[231 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[133 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[138 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[144 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[201 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[128 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[213 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[160 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[183 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[202 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[196 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[198 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[188 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[187 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[212 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[135 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[136 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[145 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[130 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[246 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[179 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[177 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[165 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[195 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[193 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[216 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[215 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[223 /* OmittedExpression */] = null; - childrenWalkers[182 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[242 /* Parameter */] = walkParameterChildren; - childrenWalkers[227 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[217 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[164 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[211 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[210 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[169 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[168 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[141 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[150 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[140 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[184 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[240 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[176 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[151 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[157 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[159 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[244 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[228 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[171 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[238 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[229 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[185 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[224 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[225 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[148 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[172 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[158 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[163 /* WithStatement */] = walkWithStatementChildren; - - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - if (this.options.stopWalking) { - return; - } - - this.pre(ast, this); - - if (this.options.stopWalking) { - return; - } - - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } else { - this.options.goChildren = true; - } - - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - - var globalAstWalkerFactory = new AstWalkerFactory(); - - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Base64Format = (function () { - function Base64Format() { - } - Base64Format.encode = function (inValue) { - if (inValue < 64) { - return Base64Format.encodedValues.charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - }; - - Base64Format.decodeChar = function (inChar) { - if (inChar.length === 1) { - return Base64Format.encodedValues.indexOf(inChar); - } else { - throw TypeError('"' + inChar + '" must have length 1'); - } - }; - Base64Format.encodedValues = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - return Base64Format; - })(); - - var Base64VLQFormat = (function () { - function Base64VLQFormat() { - } - Base64VLQFormat.encode = function (inValue) { - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } else { - inValue = inValue << 1; - } - - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + Base64Format.encode(currentDigit); - } while(inValue > 0); - - return encodedStr; - }; - - Base64VLQFormat.decode = function (inString) { - var result = 0; - var negative = false; - - var shift = 0; - for (var i = 0; i < inString.length; i++) { - var byte = Base64Format.decodeChar(inString[i]); - if (i === 0) { - if ((byte & 1) === 1) { - negative = true; - } - result = (byte >> 1) & 15; - } else { - result = result | ((byte & 31) << shift); - } - - shift += (i === 0) ? 4 : 5; - - if ((byte & 32) === 32) { - } else { - return { value: negative ? -(result) : result, rest: inString.substr(i + 1) }; - } - } - - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Base64_value_0_finished_with_a_continuation_bit, [inString])); - }; - return Base64VLQFormat; - })(); - TypeScript.Base64VLQFormat = Base64VLQFormat; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SourceMapPosition = (function () { - function SourceMapPosition() { - } - return SourceMapPosition; - })(); - TypeScript.SourceMapPosition = SourceMapPosition; - - var SourceMapping = (function () { - function SourceMapping() { - this.start = new SourceMapPosition(); - this.end = new SourceMapPosition(); - this.nameIndex = -1; - this.childMappings = []; - } - return SourceMapping; - })(); - TypeScript.SourceMapping = SourceMapping; - - var SourceMapEntry = (function () { - function SourceMapEntry(emittedFile, emittedLine, emittedColumn, sourceFile, sourceLine, sourceColumn, sourceName) { - this.emittedFile = emittedFile; - this.emittedLine = emittedLine; - this.emittedColumn = emittedColumn; - this.sourceFile = sourceFile; - this.sourceLine = sourceLine; - this.sourceColumn = sourceColumn; - this.sourceName = sourceName; - TypeScript.Debug.assert(isFinite(emittedLine)); - TypeScript.Debug.assert(isFinite(emittedColumn)); - TypeScript.Debug.assert(isFinite(sourceColumn)); - TypeScript.Debug.assert(isFinite(sourceLine)); - } - return SourceMapEntry; - })(); - TypeScript.SourceMapEntry = SourceMapEntry; - - var SourceMapper = (function () { - function SourceMapper(jsFile, sourceMapOut, document, jsFilePath, emitOptions, resolvePath) { - this.jsFile = jsFile; - this.sourceMapOut = sourceMapOut; - this.names = []; - this.mappingLevel = []; - this.tsFilePaths = []; - this.allSourceMappings = []; - this.sourceMapEntries = []; - this.setSourceMapOptions(document, jsFilePath, emitOptions, resolvePath); - this.setNewSourceFile(document, emitOptions); - } - SourceMapper.prototype.getOutputFile = function () { - var result = this.sourceMapOut.getOutputFile(); - result.sourceMapEntries = this.sourceMapEntries; - - return result; - }; - - SourceMapper.prototype.increaseMappingLevel = function (ast) { - this.mappingLevel.push(ast); - }; - - SourceMapper.prototype.decreaseMappingLevel = function (ast) { - TypeScript.Debug.assert(this.mappingLevel.length > 0, "Mapping level should never be less than 0. This suggests a missing start call."); - var expectedAst = this.mappingLevel.pop(); - var expectedAstInfo = expectedAst.kind ? TypeScript.SyntaxKind[expectedAst.kind()] : [expectedAst.start(), expectedAst.end()]; - var astInfo = ast.kind ? TypeScript.SyntaxKind[ast.kind()] : [ast.start(), ast.end()]; - TypeScript.Debug.assert(ast === expectedAst, "Provided ast is not the expected AST, Expected: " + expectedAstInfo + " Given: " + astInfo); - }; - - SourceMapper.prototype.setNewSourceFile = function (document, emitOptions) { - var sourceMappings = []; - this.allSourceMappings.push(sourceMappings); - this.currentMappings = [sourceMappings]; - this.currentNameIndex = []; - - this.setNewSourceFilePath(document, emitOptions); - }; - - SourceMapper.prototype.setSourceMapOptions = function (document, jsFilePath, emitOptions, resolvePath) { - var prettyJsFileName = TypeScript.getPrettyName(jsFilePath, false, true); - var prettyMapFileName = prettyJsFileName + SourceMapper.MapFileExtension; - this.jsFileName = prettyJsFileName; - - if (emitOptions.sourceMapRootDirectory()) { - this.sourceMapDirectory = emitOptions.sourceMapRootDirectory(); - if (document.emitToOwnOutputFile()) { - this.sourceMapDirectory = this.sourceMapDirectory + TypeScript.switchToForwardSlashes(TypeScript.getRootFilePath((document.fileName)).replace(emitOptions.commonDirectoryPath(), "")); - } - - if (TypeScript.isRelative(this.sourceMapDirectory)) { - this.sourceMapDirectory = emitOptions.commonDirectoryPath() + this.sourceMapDirectory; - this.sourceMapDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(resolvePath(this.sourceMapDirectory))); - this.sourceMapPath = TypeScript.getRelativePathToFixedPath(TypeScript.getRootFilePath(jsFilePath), this.sourceMapDirectory + prettyMapFileName); - } else { - this.sourceMapPath = this.sourceMapDirectory + prettyMapFileName; - } - } else { - this.sourceMapPath = prettyMapFileName; - this.sourceMapDirectory = TypeScript.getRootFilePath(jsFilePath); - } - this.sourceRoot = emitOptions.sourceRootDirectory(); - }; - - SourceMapper.prototype.setNewSourceFilePath = function (document, emitOptions) { - var tsFilePath = TypeScript.switchToForwardSlashes(document.fileName); - if (emitOptions.sourceRootDirectory()) { - tsFilePath = TypeScript.getRelativePathToFixedPath(emitOptions.commonDirectoryPath(), tsFilePath); - } else { - tsFilePath = TypeScript.getRelativePathToFixedPath(this.sourceMapDirectory, tsFilePath); - } - this.tsFilePaths.push(tsFilePath); - }; - - SourceMapper.prototype.emitSourceMapping = function () { - var _this = this; - TypeScript.Debug.assert(this.mappingLevel.length === 0, "Mapping level is not 0. This suggest a missing end call. Value: " + this.mappingLevel.map(function (item) { - return ['Node of type', TypeScript.SyntaxKind[item.kind()], 'at', item.start(), 'to', item.end()].join(' '); - }).join(', ')); - - this.jsFile.WriteLine("//# sourceMappingURL=" + this.sourceMapPath); - - var mappingsString = ""; - - var prevEmittedColumn = 0; - var prevEmittedLine = 0; - var prevSourceColumn = 0; - var prevSourceLine = 0; - var prevSourceIndex = 0; - var prevNameIndex = 0; - var emitComma = false; - - var recordedPosition = null; - for (var sourceIndex = 0; sourceIndex < this.tsFilePaths.length; sourceIndex++) { - var recordSourceMapping = function (mappedPosition, nameIndex) { - if (recordedPosition !== null && recordedPosition.emittedColumn === mappedPosition.emittedColumn && recordedPosition.emittedLine === mappedPosition.emittedLine) { - return; - } - - if (prevEmittedLine !== mappedPosition.emittedLine) { - while (prevEmittedLine < mappedPosition.emittedLine) { - prevEmittedColumn = 0; - mappingsString = mappingsString + ";"; - prevEmittedLine++; - } - emitComma = false; - } else if (emitComma) { - mappingsString = mappingsString + ","; - } - - _this.sourceMapEntries.push(new SourceMapEntry(_this.jsFileName, mappedPosition.emittedLine + 1, mappedPosition.emittedColumn + 1, _this.tsFilePaths[sourceIndex], mappedPosition.sourceLine, mappedPosition.sourceColumn + 1, nameIndex >= 0 ? _this.names[nameIndex] : undefined)); - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.emittedColumn - prevEmittedColumn); - prevEmittedColumn = mappedPosition.emittedColumn; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(sourceIndex - prevSourceIndex); - prevSourceIndex = sourceIndex; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.sourceLine - 1 - prevSourceLine); - prevSourceLine = mappedPosition.sourceLine - 1; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.sourceColumn - prevSourceColumn); - prevSourceColumn = mappedPosition.sourceColumn; - - if (nameIndex >= 0) { - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(nameIndex - prevNameIndex); - prevNameIndex = nameIndex; - } - - emitComma = true; - recordedPosition = mappedPosition; - }; - - var recordSourceMappingSiblings = function (sourceMappings) { - for (var i = 0; i < sourceMappings.length; i++) { - var sourceMapping = sourceMappings[i]; - recordSourceMapping(sourceMapping.start, sourceMapping.nameIndex); - recordSourceMappingSiblings(sourceMapping.childMappings); - recordSourceMapping(sourceMapping.end, sourceMapping.nameIndex); - } - }; - - recordSourceMappingSiblings(this.allSourceMappings[sourceIndex]); - } - - this.sourceMapOut.Write(JSON.stringify({ - version: 3, - file: this.jsFileName, - sourceRoot: this.sourceRoot, - sources: this.tsFilePaths, - names: this.names, - mappings: mappingsString - })); - - this.sourceMapOut.Close(); - }; - SourceMapper.MapFileExtension = ".map"; - return SourceMapper; - })(); - TypeScript.SourceMapper = SourceMapper; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (EmitContainer) { - EmitContainer[EmitContainer["Prog"] = 0] = "Prog"; - EmitContainer[EmitContainer["Module"] = 1] = "Module"; - EmitContainer[EmitContainer["DynamicModule"] = 2] = "DynamicModule"; - EmitContainer[EmitContainer["Class"] = 3] = "Class"; - EmitContainer[EmitContainer["Constructor"] = 4] = "Constructor"; - EmitContainer[EmitContainer["Function"] = 5] = "Function"; - EmitContainer[EmitContainer["Args"] = 6] = "Args"; - EmitContainer[EmitContainer["Interface"] = 7] = "Interface"; - })(TypeScript.EmitContainer || (TypeScript.EmitContainer = {})); - var EmitContainer = TypeScript.EmitContainer; - - var EmitState = (function () { - function EmitState() { - this.column = 0; - this.line = 0; - this.container = 0 /* Prog */; - } - return EmitState; - })(); - TypeScript.EmitState = EmitState; - - var EmitOptions = (function () { - function EmitOptions(compiler, resolvePath) { - this.resolvePath = resolvePath; - this._diagnostic = null; - this._settings = null; - this._commonDirectoryPath = ""; - this._sharedOutputFile = ""; - this._sourceRootDirectory = ""; - this._sourceMapRootDirectory = ""; - this._outputDirectory = ""; - var settings = compiler.compilationSettings(); - this._settings = settings; - - if (settings.moduleGenTarget() === 0 /* Unspecified */) { - var fileNames = compiler.fileNames(); - for (var i = 0, n = fileNames.length; i < n; i++) { - var document = compiler.getDocument(fileNames[i]); - if (!document.isDeclareFile() && document.isExternalModule()) { - var errorSpan = document.externalModuleIndicatorSpan(); - this._diagnostic = new TypeScript.Diagnostic(document.fileName, document.lineMap(), errorSpan.start(), errorSpan.length(), TypeScript.DiagnosticCode.Cannot_compile_external_modules_unless_the_module_flag_is_provided); - - return; - } - } - } - - if (!settings.mapSourceFiles()) { - if (settings.mapRoot()) { - if (settings.sourceRoot()) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } else { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } - } else if (settings.sourceRoot()) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } - } - - this._sourceMapRootDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(settings.mapRoot())); - this._sourceRootDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(settings.sourceRoot())); - - if (settings.outFileOption() || settings.outDirOption() || settings.mapRoot() || settings.sourceRoot()) { - if (settings.outFileOption()) { - this._sharedOutputFile = TypeScript.switchToForwardSlashes(resolvePath(settings.outFileOption())); - } - - if (settings.outDirOption()) { - this._outputDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(resolvePath(settings.outDirOption()))); - } - - if (this._outputDirectory || this._sourceMapRootDirectory || this.sourceRootDirectory) { - this.determineCommonDirectoryPath(compiler); - } - } - } - EmitOptions.prototype.diagnostic = function () { - return this._diagnostic; - }; - - EmitOptions.prototype.commonDirectoryPath = function () { - return this._commonDirectoryPath; - }; - EmitOptions.prototype.sharedOutputFile = function () { - return this._sharedOutputFile; - }; - EmitOptions.prototype.sourceRootDirectory = function () { - return this._sourceRootDirectory; - }; - EmitOptions.prototype.sourceMapRootDirectory = function () { - return this._sourceMapRootDirectory; - }; - EmitOptions.prototype.outputDirectory = function () { - return this._outputDirectory; - }; - - EmitOptions.prototype.compilationSettings = function () { - return this._settings; - }; - - EmitOptions.prototype.determineCommonDirectoryPath = function (compiler) { - var commonComponents = []; - var commonComponentsLength = -1; - - var fileNames = compiler.fileNames(); - for (var i = 0, len = fileNames.length; i < len; i++) { - var fileName = fileNames[i]; - var document = compiler.getDocument(fileNames[i]); - var sourceUnit = document.sourceUnit(); - - if (!document.isDeclareFile()) { - var fileComponents = TypeScript.filePathComponents(fileName); - if (commonComponentsLength === -1) { - commonComponents = fileComponents; - commonComponentsLength = commonComponents.length; - } else { - var updatedPath = false; - for (var j = 0; j < commonComponentsLength && j < fileComponents.length; j++) { - if (commonComponents[j] !== fileComponents[j]) { - commonComponentsLength = j; - updatedPath = true; - - if (j === 0) { - if (this._outputDirectory || this._sourceMapRootDirectory) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Cannot_find_the_common_subdirectory_path_for_the_input_files, null); - return; - } - - return; - } - - break; - } - } - - if (!updatedPath && fileComponents.length < commonComponentsLength) { - commonComponentsLength = fileComponents.length; - } - } - } - } - - this._commonDirectoryPath = commonComponents.slice(0, commonComponentsLength).join("/") + "/"; - }; - return EmitOptions; - })(); - TypeScript.EmitOptions = EmitOptions; - - var Indenter = (function () { - function Indenter() { - this.indentAmt = 0; - } - Indenter.prototype.increaseIndent = function () { - this.indentAmt += Indenter.indentStep; - }; - - Indenter.prototype.decreaseIndent = function () { - this.indentAmt -= Indenter.indentStep; - }; - - Indenter.prototype.getIndent = function () { - var indentString = Indenter.indentStrings[this.indentAmt]; - if (indentString === undefined) { - indentString = ""; - for (var i = 0; i < this.indentAmt; i = i + Indenter.indentStep) { - indentString += Indenter.indentStepString; - } - Indenter.indentStrings[this.indentAmt] = indentString; - } - return indentString; - }; - Indenter.indentStep = 4; - Indenter.indentStepString = " "; - Indenter.indentStrings = []; - return Indenter; - })(); - TypeScript.Indenter = Indenter; - - function lastParameterIsRest(parameterList) { - var parameters = parameterList.parameters; - return parameters.nonSeparatorCount() > 0 && parameters.nonSeparatorAt(parameters.nonSeparatorCount() - 1).dotDotDotToken !== null; - } - TypeScript.lastParameterIsRest = lastParameterIsRest; - - var Emitter = (function () { - function Emitter(emittingFileName, outfile, emitOptions, semanticInfoChain) { - this.emittingFileName = emittingFileName; - this.outfile = outfile; - this.emitOptions = emitOptions; - this.semanticInfoChain = semanticInfoChain; - this.globalThisCapturePrologueEmitted = false; - this.extendsPrologueEmitted = false; - this.thisClassNode = null; - this.inArrowFunction = false; - this.moduleName = ""; - this.emitState = new EmitState(); - this.indenter = new Indenter(); - this.sourceMapper = null; - this.captureThisStmtString = "var _this = this;"; - this.declStack = []; - this.exportAssignment = null; - this.inWithBlock = false; - this.document = null; - this.detachedCommentsElement = null; - } - Emitter.prototype.pushDecl = function (decl) { - if (decl) { - this.declStack[this.declStack.length] = decl; - } - }; - - Emitter.prototype.popDecl = function (decl) { - if (decl) { - this.declStack.length--; - } - }; - - Emitter.prototype.getEnclosingDecl = function () { - var declStackLen = this.declStack.length; - var enclosingDecl = declStackLen > 0 ? this.declStack[declStackLen - 1] : null; - return enclosingDecl; - }; - - Emitter.prototype.setExportAssignment = function (exportAssignment) { - this.exportAssignment = exportAssignment; - }; - - Emitter.prototype.getExportAssignment = function () { - return this.exportAssignment; - }; - - Emitter.prototype.setDocument = function (document) { - this.document = document; - }; - - Emitter.prototype.shouldEmitImportDeclaration = function (importDeclAST) { - var isExternalModuleReference = importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */; - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var isExported = TypeScript.hasFlag(importDecl.flags, 1 /* Exported */); - var isAmdCodeGen = this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */; - - if (isExternalModuleReference && !isExported && isAmdCodeGen) { - return false; - } - - var importSymbol = importDecl.getSymbol(); - if (importSymbol.isUsedAsValue()) { - return true; - } - - if (importDeclAST.moduleReference.kind() !== 245 /* ExternalModuleReference */) { - var canBeUsedExternally = isExported || importSymbol.typeUsedExternally() || importSymbol.isUsedInExportedAlias(); - if (!canBeUsedExternally && !this.document.isExternalModule()) { - canBeUsedExternally = TypeScript.hasFlag(importDecl.getParentDecl().kind, 1 /* Script */ | 32 /* DynamicModule */); - } - - if (canBeUsedExternally) { - if (importSymbol.getExportAssignedValueSymbol()) { - return true; - } - - var containerSymbol = importSymbol.getExportAssignedContainerSymbol(); - if (containerSymbol && containerSymbol.getInstanceSymbol()) { - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitImportDeclaration = function (importDeclAST) { - var isExternalModuleReference = importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */; - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var isExported = TypeScript.hasFlag(importDecl.flags, 1 /* Exported */); - var isAmdCodeGen = this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */; - - this.emitComments(importDeclAST, true); - - var importSymbol = importDecl.getSymbol(); - - var parentSymbol = importSymbol.getContainer(); - var parentKind = parentSymbol ? parentSymbol.kind : 0 /* None */; - var associatedParentSymbol = parentSymbol ? parentSymbol.getAssociatedContainerType() : null; - var associatedParentSymbolKind = associatedParentSymbol ? associatedParentSymbol.kind : 0 /* None */; - - var needsPropertyAssignment = false; - var usePropertyAssignmentInsteadOfVarDecl = false; - var moduleNamePrefix; - - if (isExported && (parentKind === 4 /* Container */ || parentKind === 32 /* DynamicModule */ || associatedParentSymbolKind === 4 /* Container */ || associatedParentSymbolKind === 32 /* DynamicModule */)) { - if (importSymbol.getExportAssignedTypeSymbol() || importSymbol.getExportAssignedContainerSymbol()) { - needsPropertyAssignment = true; - } else { - var valueSymbol = importSymbol.getExportAssignedValueSymbol(); - if (valueSymbol && (valueSymbol.kind === 65536 /* Method */ || valueSymbol.kind === 16384 /* Function */)) { - needsPropertyAssignment = true; - } else { - usePropertyAssignmentInsteadOfVarDecl = true; - } - } - - if (this.emitState.container === 2 /* DynamicModule */) { - moduleNamePrefix = "exports."; - } else { - moduleNamePrefix = this.moduleName + "."; - } - } - - if (isAmdCodeGen && isExternalModuleReference) { - needsPropertyAssignment = true; - } else { - this.recordSourceMappingStart(importDeclAST); - if (usePropertyAssignmentInsteadOfVarDecl) { - this.writeToOutput(moduleNamePrefix); - } else { - this.writeToOutput("var "); - } - this.writeToOutput(importDeclAST.identifier.text() + " = "); - var aliasAST = importDeclAST.moduleReference; - - if (isExternalModuleReference) { - this.writeToOutput("require(" + aliasAST.stringLiteral.text() + ")"); - } else { - this.emitJavascript(aliasAST.moduleName, false); - } - - this.recordSourceMappingEnd(importDeclAST); - this.writeToOutput(";"); - - if (needsPropertyAssignment) { - this.writeLineToOutput(""); - this.emitIndent(); - } - } - - if (needsPropertyAssignment) { - this.writeToOutputWithSourceMapRecord(moduleNamePrefix + importDeclAST.identifier.text() + " = " + importDeclAST.identifier.text(), importDeclAST); - this.writeToOutput(";"); - } - this.emitComments(importDeclAST, false); - }; - - Emitter.prototype.createSourceMapper = function (document, jsFileName, jsFile, sourceMapOut, resolvePath) { - this.sourceMapper = new TypeScript.SourceMapper(jsFile, sourceMapOut, document, jsFileName, this.emitOptions, resolvePath); - }; - - Emitter.prototype.setSourceMapperNewSourceFile = function (document) { - this.sourceMapper.setNewSourceFile(document, this.emitOptions); - }; - - Emitter.prototype.updateLineAndColumn = function (s) { - var lineNumbers = TypeScript.TextUtilities.parseLineStarts(s); - if (lineNumbers.length > 1) { - this.emitState.line += lineNumbers.length - 1; - this.emitState.column = s.length - lineNumbers[lineNumbers.length - 1]; - } else { - this.emitState.column += s.length; - } - }; - - Emitter.prototype.writeToOutputWithSourceMapRecord = function (s, astSpan) { - this.recordSourceMappingStart(astSpan); - this.writeToOutput(s); - this.recordSourceMappingEnd(astSpan); - }; - - Emitter.prototype.writeToOutput = function (s) { - this.outfile.Write(s); - this.updateLineAndColumn(s); - }; - - Emitter.prototype.writeLineToOutput = function (s, force) { - if (typeof force === "undefined") { force = false; } - if (!force && s === "" && this.emitState.column === 0) { - return; - } - - this.outfile.WriteLine(s); - this.updateLineAndColumn(s); - this.emitState.column = 0; - this.emitState.line++; - }; - - Emitter.prototype.writeCaptureThisStatement = function (ast) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord(this.captureThisStmtString, ast); - this.writeLineToOutput(""); - }; - - Emitter.prototype.setContainer = function (c) { - var temp = this.emitState.container; - this.emitState.container = c; - return temp; - }; - - Emitter.prototype.getIndentString = function () { - return this.indenter.getIndent(); - }; - - Emitter.prototype.emitIndent = function () { - this.writeToOutput(this.getIndentString()); - }; - - Emitter.prototype.emitComment = function (comment, trailing, first) { - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var text = getTrimmedTextLines(comment); - var emitColumn = this.emitState.column; - - if (emitColumn === 0) { - this.emitIndent(); - } else if (trailing && first) { - this.writeToOutput(" "); - } - - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - this.recordSourceMappingStart(comment); - this.writeToOutput(text[0]); - - if (text.length > 1 || comment.endsLine) { - for (var i = 1; i < text.length; i++) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput(text[i]); - } - this.recordSourceMappingEnd(comment); - this.writeLineToOutput(""); - } else { - this.recordSourceMappingEnd(comment); - this.writeToOutput(" "); - return; - } - } else { - this.recordSourceMappingStart(comment); - this.writeToOutput(text[0]); - this.recordSourceMappingEnd(comment); - this.writeLineToOutput(""); - } - - if (!trailing && emitColumn !== 0) { - this.emitIndent(); - } - }; - - Emitter.prototype.emitComments = function (ast, pre, onlyPinnedOrTripleSlashComments) { - var _this = this; - if (typeof onlyPinnedOrTripleSlashComments === "undefined") { onlyPinnedOrTripleSlashComments = false; } - if (ast && ast.kind() !== 146 /* Block */) { - if (ast.parent.kind() === 219 /* SimpleArrowFunctionExpression */ || ast.parent.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - return; - } - } - - if (pre) { - var preComments = ast.preComments(); - - if (preComments && ast === this.detachedCommentsElement) { - var detachedComments = this.getDetachedComments(ast); - preComments = preComments.slice(detachedComments.length); - this.detachedCommentsElement = null; - } - - if (preComments && onlyPinnedOrTripleSlashComments) { - preComments = TypeScript.ArrayUtilities.where(preComments, function (c) { - return _this.isPinnedOrTripleSlash(c); - }); - } - - this.emitCommentsArray(preComments, false); - } else { - this.emitCommentsArray(ast.postComments(), true); - } - }; - - Emitter.prototype.isPinnedOrTripleSlash = function (comment) { - var fullText = comment.fullText(); - if (fullText.match(TypeScript.tripleSlashReferenceRegExp)) { - return true; - } else { - return fullText.indexOf("/*!") === 0; - } - }; - - Emitter.prototype.emitCommentsArray = function (comments, trailing) { - if (!this.emitOptions.compilationSettings().removeComments() && comments) { - for (var i = 0, n = comments.length; i < n; i++) { - this.emitComment(comments[i], trailing, i === 0); - } - } - }; - - Emitter.prototype.emitObjectLiteralExpression = function (objectLiteral) { - this.recordSourceMappingStart(objectLiteral); - - this.writeToOutput("{"); - this.emitCommaSeparatedList(objectLiteral, objectLiteral.propertyAssignments, " ", true); - this.writeToOutput("}"); - - this.recordSourceMappingEnd(objectLiteral); - }; - - Emitter.prototype.emitArrayLiteralExpression = function (arrayLiteral) { - this.recordSourceMappingStart(arrayLiteral); - - this.writeToOutput("["); - this.emitCommaSeparatedList(arrayLiteral, arrayLiteral.expressions, "", true); - this.writeToOutput("]"); - - this.recordSourceMappingEnd(arrayLiteral); - }; - - Emitter.prototype.emitObjectCreationExpression = function (objectCreationExpression) { - this.recordSourceMappingStart(objectCreationExpression); - this.writeToOutput("new "); - var target = objectCreationExpression.expression; - - this.emit(target); - if (objectCreationExpression.argumentList) { - this.recordSourceMappingStart(objectCreationExpression.argumentList); - this.writeToOutput("("); - this.emitCommaSeparatedList(objectCreationExpression.argumentList, objectCreationExpression.argumentList.arguments, "", false); - this.writeToOutputWithSourceMapRecord(")", objectCreationExpression.argumentList.closeParenToken); - this.recordSourceMappingEnd(objectCreationExpression.argumentList); - } - - this.recordSourceMappingEnd(objectCreationExpression); - }; - - Emitter.prototype.getConstantDecl = function (dotExpr) { - var pullSymbol = this.semanticInfoChain.getSymbolForAST(dotExpr); - if (pullSymbol && pullSymbol.kind === 67108864 /* EnumMember */) { - var pullDecls = pullSymbol.getDeclarations(); - if (pullDecls.length === 1) { - var pullDecl = pullDecls[0]; - if (pullDecl.kind === 67108864 /* EnumMember */) { - return pullDecl; - } - } - } - - return null; - }; - - Emitter.prototype.tryEmitConstant = function (dotExpr) { - var propertyName = dotExpr.name; - var boundDecl = this.getConstantDecl(dotExpr); - if (boundDecl) { - var value = boundDecl.constantValue; - if (value !== null) { - this.recordSourceMappingStart(dotExpr); - this.writeToOutput(value.toString()); - var comment = " /* "; - comment += propertyName.text(); - comment += " */"; - this.writeToOutput(comment); - this.recordSourceMappingEnd(dotExpr); - return true; - } - } - - return false; - }; - - Emitter.prototype.emitInvocationExpression = function (callNode) { - this.recordSourceMappingStart(callNode); - var target = callNode.expression; - var args = callNode.argumentList.arguments; - - if (target.kind() === 212 /* MemberAccessExpression */ && target.expression.kind() === 50 /* SuperKeyword */) { - this.emit(target); - this.writeToOutput(".call"); - this.recordSourceMappingStart(args); - this.writeToOutput("("); - this.emitThis(); - if (args && args.nonSeparatorCount() > 0) { - this.writeToOutput(", "); - this.emitCommaSeparatedList(callNode.argumentList, args, "", false); - } - } else { - if (callNode.expression.kind() === 50 /* SuperKeyword */ && this.emitState.container === 4 /* Constructor */) { - this.writeToOutput("_super.call"); - } else { - this.emitJavascript(target, false); - } - this.recordSourceMappingStart(args); - this.writeToOutput("("); - if (callNode.expression.kind() === 50 /* SuperKeyword */ && this.emitState.container === 4 /* Constructor */) { - this.writeToOutput("this"); - if (args && args.nonSeparatorCount() > 0) { - this.writeToOutput(", "); - } - } - this.emitCommaSeparatedList(callNode.argumentList, args, "", false); - } - - this.writeToOutputWithSourceMapRecord(")", callNode.argumentList.closeParenToken); - this.recordSourceMappingEnd(args); - this.recordSourceMappingEnd(callNode); - }; - - Emitter.prototype.emitParameterList = function (list) { - this.writeToOutput("("); - this.emitCommentsArray(list.openParenTrailingComments, true); - this.emitFunctionParameters(TypeScript.ASTHelpers.parametersFromParameterList(list)); - this.writeToOutput(")"); - }; - - Emitter.prototype.emitFunctionParameters = function (parameters) { - var argsLen = 0; - - if (parameters) { - this.emitComments(parameters.ast, true); - - var tempContainer = this.setContainer(6 /* Args */); - argsLen = parameters.length; - var printLen = argsLen; - if (parameters.lastParameterIsRest()) { - printLen--; - } - for (var i = 0; i < printLen; i++) { - var arg = parameters.astAt(i); - this.emit(arg); - - if (i < (printLen - 1)) { - this.writeToOutput(", "); - } - } - this.setContainer(tempContainer); - - this.emitComments(parameters.ast, false); - } - }; - - Emitter.prototype.emitFunctionBodyStatements = function (name, funcDecl, parameterList, block, bodyExpression) { - this.writeLineToOutput(" {"); - if (name) { - this.recordSourceMappingNameStart(name); - } - - this.indenter.increaseIndent(); - - if (block) { - this.emitDetachedComments(block.statements); - } - - if (this.shouldCaptureThis(funcDecl)) { - this.writeCaptureThisStatement(funcDecl); - } - - if (parameterList) { - this.emitDefaultValueAssignments(parameterList); - this.emitRestParameterInitializer(parameterList); - } - - if (block) { - this.emitList(block.statements); - this.emitCommentsArray(block.closeBraceLeadingComments, false); - } else { - this.emitIndent(); - this.emitCommentsArray(bodyExpression.preComments(), false); - this.writeToOutput("return "); - this.emit(bodyExpression); - this.writeLineToOutput(";"); - this.emitCommentsArray(bodyExpression.postComments(), true); - } - - this.indenter.decreaseIndent(); - this.emitIndent(); - - if (block) { - this.writeToOutputWithSourceMapRecord("}", block.closeBraceToken); - } else { - this.writeToOutputWithSourceMapRecord("}", bodyExpression); - } - - if (name) { - this.recordSourceMappingNameEnd(); - } - }; - - Emitter.prototype.emitDefaultValueAssignments = function (parameters) { - var n = parameters.length; - if (parameters.lastParameterIsRest()) { - n--; - } - - for (var i = 0; i < n; i++) { - var arg = parameters.astAt(i); - var id = parameters.identifierAt(i); - var equalsValueClause = parameters.initializerAt(i); - if (equalsValueClause) { - this.emitIndent(); - this.recordSourceMappingStart(arg); - this.writeToOutput("if (typeof " + id.text() + " === \"undefined\") { "); - this.writeToOutputWithSourceMapRecord(id.text(), id); - this.emitJavascript(equalsValueClause, false); - this.writeLineToOutput("; }"); - this.recordSourceMappingEnd(arg); - } - } - }; - - Emitter.prototype.emitRestParameterInitializer = function (parameters) { - if (parameters.lastParameterIsRest()) { - var n = parameters.length; - var lastArg = parameters.astAt(n - 1); - var id = parameters.identifierAt(n - 1); - this.emitIndent(); - this.recordSourceMappingStart(lastArg); - this.writeToOutput("var "); - this.writeToOutputWithSourceMapRecord(id.text(), id); - this.writeLineToOutput(" = [];"); - this.recordSourceMappingEnd(lastArg); - this.emitIndent(); - this.writeToOutput("for ("); - this.writeToOutputWithSourceMapRecord("var _i = 0;", lastArg); - this.writeToOutput(" "); - this.writeToOutputWithSourceMapRecord("_i < (arguments.length - " + (n - 1) + ")", lastArg); - this.writeToOutput("; "); - this.writeToOutputWithSourceMapRecord("_i++", lastArg); - this.writeLineToOutput(") {"); - this.indenter.increaseIndent(); - this.emitIndent(); - - this.writeToOutputWithSourceMapRecord(id.text() + "[_i] = arguments[_i + " + (n - 1) + "];", lastArg); - this.writeLineToOutput(""); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeLineToOutput("}"); - } - }; - - Emitter.prototype.getImportDecls = function (fileName) { - var topLevelDecl = this.semanticInfoChain.topLevelDecl(this.document.fileName); - var result = []; - - var dynamicModuleDecl = topLevelDecl.getChildDecls()[0]; - var queue = dynamicModuleDecl.getChildDecls(); - - for (var i = 0, n = queue.length; i < n; i++) { - var decl = queue[i]; - - if (decl.kind & 128 /* TypeAlias */) { - var importStatementAST = this.semanticInfoChain.getASTForDecl(decl); - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var symbol = decl.getSymbol(); - var typeSymbol = symbol && symbol.type; - if (typeSymbol && typeSymbol !== this.semanticInfoChain.anyTypeSymbol && !typeSymbol.isError()) { - result.push(decl); - } - } - } - } - - return result; - }; - - Emitter.prototype.getModuleImportAndDependencyList = function (sourceUnit) { - var importList = ""; - var dependencyList = ""; - - var importDecls = this.getImportDecls(this.document.fileName); - - if (importDecls.length) { - for (var i = 0; i < importDecls.length; i++) { - var importStatementDecl = importDecls[i]; - var importStatementSymbol = importStatementDecl.getSymbol(); - var importStatementAST = this.semanticInfoChain.getASTForDecl(importStatementDecl); - - if (importStatementSymbol.isUsedAsValue()) { - if (i <= importDecls.length - 1) { - dependencyList += ", "; - importList += ", "; - } - - importList += importStatementDecl.name; - dependencyList += importStatementAST.moduleReference.stringLiteral.text(); - } - } - } - - var amdDependencies = this.document.amdDependencies(); - for (var i = 0; i < amdDependencies.length; i++) { - dependencyList += ", \"" + amdDependencies[i] + "\""; - } - - return { - importList: importList, - dependencyList: dependencyList - }; - }; - - Emitter.prototype.shouldCaptureThis = function (ast) { - if (ast.kind() === 120 /* SourceUnit */) { - var scriptDecl = this.semanticInfoChain.topLevelDecl(this.document.fileName); - return TypeScript.hasFlag(scriptDecl.flags, 262144 /* MustCaptureThis */); - } - - var decl = this.semanticInfoChain.getDeclForAST(ast); - if (decl) { - return TypeScript.hasFlag(decl.flags, 262144 /* MustCaptureThis */); - } - - return false; - }; - - Emitter.prototype.emitEnum = function (moduleDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.pushDecl(pullDecl); - - var svModuleName = this.moduleName; - this.moduleName = moduleDecl.identifier.text(); - - var temp = this.setContainer(1 /* Module */); - var isExported = TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */); - - if (!isExported) { - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("var "); - this.recordSourceMappingStart(moduleDecl.identifier); - this.writeToOutput(this.moduleName); - this.recordSourceMappingEnd(moduleDecl.identifier); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(moduleDecl); - this.emitIndent(); - } - - this.writeToOutput("("); - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("function ("); - this.writeToOutputWithSourceMapRecord(this.moduleName, moduleDecl.identifier); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart(this.moduleName); - - this.indenter.increaseIndent(); - - if (this.shouldCaptureThis(moduleDecl)) { - this.writeCaptureThisStatement(moduleDecl); - } - - this.emitSeparatedList(moduleDecl.enumElements); - this.indenter.decreaseIndent(); - this.emitIndent(); - - var parentIsDynamic = temp === 2 /* DynamicModule */; - if (temp === 0 /* Prog */ && isExported) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));"); - } else if (isExported || temp === 0 /* Prog */) { - var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName; - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));"); - } else if (!isExported && temp !== 0 /* Prog */) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));"); - } else { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")();"); - } - - this.recordSourceMappingEnd(moduleDecl); - if (temp !== 0 /* Prog */ && isExported) { - this.recordSourceMappingStart(moduleDecl); - if (parentIsDynamic) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = exports." + this.moduleName + ";"); - } else { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = " + svModuleName + "." + this.moduleName + ";"); - } - this.recordSourceMappingEnd(moduleDecl); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - - this.popDecl(pullDecl); - }; - - Emitter.prototype.getModuleDeclToVerifyChildNameCollision = function (moduleDecl, changeNameIfAnyDeclarationInContext) { - if (TypeScript.ArrayUtilities.contains(this.declStack, moduleDecl)) { - return moduleDecl; - } else if (changeNameIfAnyDeclarationInContext) { - var symbol = moduleDecl.getSymbol(); - if (symbol) { - var otherDecls = symbol.getDeclarations(); - for (var i = 0; i < otherDecls.length; i++) { - if (TypeScript.ArrayUtilities.contains(this.declStack, otherDecls[i])) { - return otherDecls[i]; - } - } - } - } - - return null; - }; - - Emitter.prototype.hasChildNameCollision = function (moduleName, parentDecl) { - var _this = this; - var childDecls = parentDecl.getChildDecls(); - return TypeScript.ArrayUtilities.any(childDecls, function (childDecl) { - var childAST = _this.semanticInfoChain.getASTForDecl(childDecl); - - if (childDecl.kind != 67108864 /* EnumMember */ && _this.shouldEmit(childAST)) { - if (childDecl.name === moduleName) { - if (parentDecl.kind != 8 /* Class */) { - return true; - } - - if (!(childDecl.kind == 65536 /* Method */ || childDecl.kind == 4096 /* Property */ || childDecl.kind == 524288 /* SetAccessor */ || childDecl.kind == 262144 /* GetAccessor */)) { - return true; - } - } - - if (_this.hasChildNameCollision(moduleName, childDecl)) { - return true; - } - } - return false; - }); - }; - - Emitter.prototype.getModuleName = function (moduleDecl, changeNameIfAnyDeclarationInContext) { - var moduleName = moduleDecl.name; - var moduleDisplayName = moduleDecl.getDisplayName(); - - moduleDecl = this.getModuleDeclToVerifyChildNameCollision(moduleDecl, changeNameIfAnyDeclarationInContext); - if (moduleDecl && moduleDecl.kind != 64 /* Enum */) { - while (this.hasChildNameCollision(moduleName, moduleDecl)) { - moduleName = "_" + moduleName; - moduleDisplayName = "_" + moduleDisplayName; - } - } - - return moduleDisplayName; - }; - - Emitter.prototype.emitModuleDeclarationWorker = function (moduleDecl) { - if (moduleDecl.stringLiteral) { - this.emitSingleModuleDeclaration(moduleDecl, moduleDecl.stringLiteral); - } else { - var moduleNames = TypeScript.getModuleNames(moduleDecl.name); - this.emitSingleModuleDeclaration(moduleDecl, moduleNames[0]); - } - }; - - Emitter.prototype.emitSingleModuleDeclaration = function (moduleDecl, moduleName) { - var isLastName = TypeScript.ASTHelpers.isLastNameOfModule(moduleDecl, moduleName); - - if (isLastName) { - this.emitComments(moduleDecl, true); - } - - var pullDecl = this.semanticInfoChain.getDeclForAST(moduleName); - this.pushDecl(pullDecl); - - var svModuleName = this.moduleName; - - if (moduleDecl.stringLiteral) { - this.moduleName = moduleDecl.stringLiteral.valueText(); - if (TypeScript.isTSFile(this.moduleName)) { - this.moduleName = this.moduleName.substring(0, this.moduleName.length - ".ts".length); - } - } else { - this.moduleName = moduleName.text(); - } - - var temp = this.setContainer(1 /* Module */); - var isExported = TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */); - - if (!isExported) { - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("var "); - this.recordSourceMappingStart(moduleName); - this.writeToOutput(this.moduleName); - this.recordSourceMappingEnd(moduleName); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(moduleDecl); - this.emitIndent(); - } - - this.writeToOutput("("); - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("function ("); - - this.moduleName = this.getModuleName(pullDecl); - this.writeToOutputWithSourceMapRecord(this.moduleName, moduleName); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart(moduleName.text()); - - this.indenter.increaseIndent(); - - if (this.shouldCaptureThis(moduleDecl)) { - this.writeCaptureThisStatement(moduleDecl); - } - - if (moduleName === moduleDecl.stringLiteral) { - this.emitList(moduleDecl.moduleElements); - } else { - var moduleNames = TypeScript.getModuleNames(moduleDecl.name); - var nameIndex = moduleNames.indexOf(moduleName); - TypeScript.Debug.assert(nameIndex >= 0); - - if (isLastName) { - this.emitList(moduleDecl.moduleElements); - } else { - this.emitIndent(); - this.emitSingleModuleDeclaration(moduleDecl, moduleNames[nameIndex + 1]); - this.writeLineToOutput(""); - } - } - - this.moduleName = moduleName.text(); - this.indenter.decreaseIndent(); - this.emitIndent(); - - var parentIsDynamic = temp === 2 /* DynamicModule */; - this.recordSourceMappingStart(moduleDecl.endingToken); - if (temp === 0 /* Prog */ && isExported) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));"); - } else if (isExported || temp === 0 /* Prog */) { - var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName; - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));"); - } else if (!isExported && temp !== 0 /* Prog */) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));"); - } else { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")();"); - } - - this.recordSourceMappingEnd(moduleDecl); - if (temp !== 0 /* Prog */ && isExported) { - this.recordSourceMappingStart(moduleDecl); - if (parentIsDynamic) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = exports." + this.moduleName + ";"); - } else { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = " + svModuleName + "." + this.moduleName + ";"); - } - this.recordSourceMappingEnd(moduleDecl); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - - this.popDecl(pullDecl); - - if (isLastName) { - this.emitComments(moduleDecl, false); - } - }; - - Emitter.prototype.emitEnumElement = function (varDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - TypeScript.Debug.assert(pullDecl && pullDecl.kind === 67108864 /* EnumMember */); - - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - var name = varDecl.propertyName.text(); - var quoted = TypeScript.isQuoted(name); - this.writeToOutput(this.moduleName); - this.writeToOutput('['); - this.writeToOutput(this.moduleName); - this.writeToOutput('['); - this.writeToOutput(quoted ? name : '"' + name + '"'); - this.writeToOutput(']'); - - if (varDecl.equalsValueClause) { - this.emit(varDecl.equalsValueClause); - } else if (pullDecl.constantValue !== null) { - this.writeToOutput(' = '); - this.writeToOutput(pullDecl.constantValue.toString()); - } else { - this.writeToOutput(' = null'); - } - - this.writeToOutput('] = '); - this.writeToOutput(quoted ? name : '"' + name + '"'); - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - this.writeToOutput(';'); - }; - - Emitter.prototype.emitElementAccessExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.emit(expression.expression); - this.writeToOutput("["); - this.emit(expression.argumentExpression); - this.writeToOutput("]"); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitSimpleArrowFunctionExpression = function (arrowFunction) { - this.emitAnyArrowFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromIdentifier(arrowFunction.identifier), arrowFunction.block, arrowFunction.expression); - }; - - Emitter.prototype.emitParenthesizedArrowFunctionExpression = function (arrowFunction) { - this.emitAnyArrowFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), arrowFunction.block, arrowFunction.expression); - }; - - Emitter.prototype.emitAnyArrowFunctionExpression = function (arrowFunction, funcName, parameters, block, expression) { - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = true; - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(arrowFunction); - - var pullDecl = this.semanticInfoChain.getDeclForAST(arrowFunction); - this.pushDecl(pullDecl); - - this.emitComments(arrowFunction, true); - - this.recordSourceMappingStart(arrowFunction); - this.writeToOutput("function "); - this.writeToOutput("("); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcName, arrowFunction, parameters, block, expression); - - this.recordSourceMappingEnd(arrowFunction); - - this.recordSourceMappingEnd(arrowFunction); - - this.emitComments(arrowFunction, false); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitConstructor = function (funcDecl) { - if (!funcDecl.block) { - return; - } - var temp = this.setContainer(4 /* Constructor */); - - this.recordSourceMappingStart(funcDecl); - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.emitComments(funcDecl, true); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - this.writeToOutput(this.thisClassNode.identifier.text()); - this.writeToOutput("("); - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart("constructor"); - this.indenter.increaseIndent(); - - this.emitDefaultValueAssignments(parameters); - this.emitRestParameterInitializer(parameters); - - if (this.shouldCaptureThis(funcDecl)) { - this.writeCaptureThisStatement(funcDecl); - } - - this.emitConstructorStatements(funcDecl); - this.emitCommentsArray(funcDecl.block.closeBraceLeadingComments, false); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", funcDecl.block.closeBraceToken); - - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - this.setContainer(temp); - }; - - Emitter.prototype.emitGetAccessor = function (accessor) { - this.recordSourceMappingStart(accessor); - this.writeToOutput("get "); - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(accessor); - - var pullDecl = this.semanticInfoChain.getDeclForAST(accessor); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(accessor); - - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(accessor, this.semanticInfoChain); - var container = accessorSymbol.getContainer(); - var containerKind = container.kind; - - this.recordSourceMappingNameStart(accessor.propertyName.text()); - this.writeToOutput(accessor.propertyName.text()); - this.writeToOutput("("); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, accessor, TypeScript.ASTHelpers.parametersFromParameterList(accessor.parameterList), accessor.block, null); - - this.recordSourceMappingEnd(accessor); - - this.recordSourceMappingEnd(accessor); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.recordSourceMappingEnd(accessor); - }; - - Emitter.prototype.emitSetAccessor = function (accessor) { - this.recordSourceMappingStart(accessor); - this.writeToOutput("set "); - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(accessor); - - var pullDecl = this.semanticInfoChain.getDeclForAST(accessor); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(accessor); - - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(accessor, this.semanticInfoChain); - var container = accessorSymbol.getContainer(); - var containerKind = container.kind; - - this.recordSourceMappingNameStart(accessor.propertyName.text()); - this.writeToOutput(accessor.propertyName.text()); - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(accessor.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, accessor, parameters, accessor.block, null); - - this.recordSourceMappingEnd(accessor); - - this.recordSourceMappingEnd(accessor); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.recordSourceMappingEnd(accessor); - }; - - Emitter.prototype.emitFunctionExpression = function (funcDecl) { - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - - var funcName = funcDecl.identifier ? funcDecl.identifier.text() : null; - - this.recordSourceMappingStart(funcDecl); - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - if (funcDecl.identifier) { - this.recordSourceMappingStart(funcDecl.identifier); - this.writeToOutput(funcDecl.identifier.text()); - this.recordSourceMappingEnd(funcDecl.identifier); - } - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcName, funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitFunction = function (funcDecl) { - if (funcDecl.block === null) { - return; - } - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - - var funcName = funcDecl.identifier.text(); - - this.recordSourceMappingStart(funcDecl); - - var printName = funcDecl.identifier !== null; - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.emitComments(funcDecl, true); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - if (printName) { - var id = funcDecl.identifier.text(); - if (id) { - if (funcDecl.identifier) { - this.recordSourceMappingStart(funcDecl.identifier); - } - this.writeToOutput(id); - if (funcDecl.identifier) { - this.recordSourceMappingEnd(funcDecl.identifier); - } - } - } - - this.emitParameterList(funcDecl.callSignature.parameterList); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionBodyStatements(funcDecl.identifier.text(), funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - - if (funcDecl.block) { - var pullFunctionDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - if ((this.emitState.container === 1 /* Module */ || this.emitState.container === 2 /* DynamicModule */) && pullFunctionDecl && TypeScript.hasFlag(pullFunctionDecl.flags, 1 /* Exported */)) { - this.writeLineToOutput(""); - this.emitIndent(); - var modName = this.emitState.container === 1 /* Module */ ? this.moduleName : "exports"; - this.recordSourceMappingStart(funcDecl); - this.writeToOutput(modName + "." + funcName + " = " + funcName + ";"); - this.recordSourceMappingEnd(funcDecl); - } - } - }; - - Emitter.prototype.emitAmbientVarDecl = function (varDecl) { - this.recordSourceMappingStart(this.currentVariableDeclaration); - if (varDecl.equalsValueClause) { - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - this.writeToOutputWithSourceMapRecord(varDecl.propertyName.text(), varDecl.propertyName); - this.emitJavascript(varDecl.equalsValueClause, false); - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - } - }; - - Emitter.prototype.emitVarDeclVar = function () { - if (this.currentVariableDeclaration) { - this.writeToOutput("var "); - } - }; - - Emitter.prototype.emitVariableDeclaration = function (declaration) { - var varDecl = declaration.declarators.nonSeparatorAt(0); - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentKind = parentSymbol ? parentSymbol.kind : 0 /* None */; - - this.emitComments(declaration, true); - - var pullVarDecl = this.semanticInfoChain.getDeclForAST(varDecl); - var isAmbientWithoutInit = pullVarDecl && TypeScript.hasFlag(pullVarDecl.flags, 8 /* Ambient */) && varDecl.equalsValueClause === null; - if (!isAmbientWithoutInit) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.currentVariableDeclaration = declaration; - - for (var i = 0, n = declaration.declarators.nonSeparatorCount(); i < n; i++) { - var declarator = declaration.declarators.nonSeparatorAt(i); - - if (i > 0) { - this.writeToOutput(", "); - } - - this.emit(declarator); - } - this.currentVariableDeclaration = prevVariableDeclaration; - - this.recordSourceMappingEnd(declaration); - } - - this.emitComments(declaration, false); - }; - - Emitter.prototype.emitMemberVariableDeclaration = function (varDecl) { - TypeScript.Debug.assert(!TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause); - - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - this.pushDecl(pullDecl); - - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.variableDeclarator.propertyName.text(); - var quotedOrNumber = TypeScript.isQuoted(varDeclName) || varDecl.variableDeclarator.propertyName.kind() !== 11 /* IdentifierName */; - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentDecl = pullDecl && pullDecl.getParentDecl(); - - if (quotedOrNumber) { - this.writeToOutput("this["); - } else { - this.writeToOutput("this."); - } - - this.writeToOutputWithSourceMapRecord(varDecl.variableDeclarator.propertyName.text(), varDecl.variableDeclarator.propertyName); - - if (quotedOrNumber) { - this.writeToOutput("]"); - } - - if (varDecl.variableDeclarator.equalsValueClause) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.emit(varDecl.variableDeclarator.equalsValueClause); - this.currentVariableDeclaration = prevVariableDeclaration; - } - - if (this.emitState.container !== 6 /* Args */) { - this.writeToOutput(";"); - } - - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitVariableDeclarator = function (varDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - this.pushDecl(pullDecl); - if (pullDecl && (pullDecl.flags & 8 /* Ambient */) === 8 /* Ambient */) { - this.emitAmbientVarDecl(varDecl); - } else { - this.emitComments(varDecl, true); - this.recordSourceMappingStart(this.currentVariableDeclaration); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.propertyName.text(); - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentDecl = pullDecl && pullDecl.getParentDecl(); - var parentIsModule = parentDecl && (parentDecl.flags & 102400 /* SomeInitializedModule */); - - if (parentIsModule) { - if (!TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - this.emitVarDeclVar(); - } else { - if (this.emitState.container === 2 /* DynamicModule */) { - this.writeToOutput("exports."); - } else { - this.writeToOutput(this.moduleName + "."); - } - } - } else { - this.emitVarDeclVar(); - } - - this.writeToOutputWithSourceMapRecord(varDecl.propertyName.text(), varDecl.propertyName); - - if (varDecl.equalsValueClause) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.emit(varDecl.equalsValueClause); - this.currentVariableDeclaration = prevVariableDeclaration; - } - - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - } - this.currentVariableDeclaration = undefined; - this.popDecl(pullDecl); - }; - - Emitter.prototype.symbolIsUsedInItsEnclosingContainer = function (symbol, dynamic) { - if (typeof dynamic === "undefined") { dynamic = false; } - var symDecls = symbol.getDeclarations(); - - if (symDecls.length) { - var enclosingDecl = this.getEnclosingDecl(); - if (enclosingDecl) { - var parentDecl = symDecls[0].getParentDecl(); - if (parentDecl) { - var symbolDeclarationEnclosingContainer = parentDecl; - var enclosingContainer = enclosingDecl; - - while (symbolDeclarationEnclosingContainer) { - if (symbolDeclarationEnclosingContainer.kind === (dynamic ? 32 /* DynamicModule */ : 4 /* Container */)) { - break; - } - symbolDeclarationEnclosingContainer = symbolDeclarationEnclosingContainer.getParentDecl(); - } - - if (symbolDeclarationEnclosingContainer) { - while (enclosingContainer) { - if (enclosingContainer.kind === (dynamic ? 32 /* DynamicModule */ : 4 /* Container */)) { - break; - } - - enclosingContainer = enclosingContainer.getParentDecl(); - } - } - - if (symbolDeclarationEnclosingContainer && enclosingContainer) { - var same = symbolDeclarationEnclosingContainer === enclosingContainer; - - if (!same && symbol.anyDeclHasFlag(32768 /* InitializedModule */)) { - same = symbolDeclarationEnclosingContainer === enclosingContainer.getParentDecl(); - } - - return same; - } - } - } - } - - return false; - }; - - Emitter.prototype.getPotentialDeclPathInfoForEmit = function (pullSymbol) { - var decl = pullSymbol.getDeclarations()[0]; - var parentDecl = decl.getParentDecl(); - var symbolContainerDeclPath = parentDecl ? parentDecl.getParentPath() : []; - - var enclosingContextDeclPath = this.declStack; - var commonNodeIndex = -1; - - if (enclosingContextDeclPath.length) { - for (var i = symbolContainerDeclPath.length - 1; i >= 0; i--) { - var symbolContainerDeclPathNode = symbolContainerDeclPath[i]; - for (var j = enclosingContextDeclPath.length - 1; j >= 0; j--) { - var enclosingContextDeclPathNode = enclosingContextDeclPath[j]; - if (symbolContainerDeclPathNode === enclosingContextDeclPathNode) { - commonNodeIndex = i; - break; - } - } - - if (commonNodeIndex >= 0) { - break; - } - } - } - - var startingIndex = symbolContainerDeclPath.length - 1; - for (var i = startingIndex - 1; i > commonNodeIndex; i--) { - if (symbolContainerDeclPath[i + 1].flags & 1 /* Exported */) { - startingIndex = i; - } else { - break; - } - } - return { potentialPath: symbolContainerDeclPath, startingIndex: startingIndex }; - }; - - Emitter.prototype.emitDottedNameFromDeclPath = function (declPath, startingIndex, lastIndex) { - for (var i = startingIndex; i <= lastIndex; i++) { - if (declPath[i].kind === 32 /* DynamicModule */ || declPath[i].flags & 65536 /* InitializedDynamicModule */) { - this.writeToOutput("exports."); - } else { - this.writeToOutput(this.getModuleName(declPath[i], true) + "."); - } - } - }; - - Emitter.prototype.emitSymbolContainerNameInEnclosingContext = function (pullSymbol) { - var declPathInfo = this.getPotentialDeclPathInfoForEmit(pullSymbol); - var potentialDeclPath = declPathInfo.potentialPath; - var startingIndex = declPathInfo.startingIndex; - - this.emitDottedNameFromDeclPath(potentialDeclPath, startingIndex, potentialDeclPath.length - 1); - }; - - Emitter.prototype.getSymbolForEmit = function (ast) { - var pullSymbol = this.semanticInfoChain.getSymbolForAST(ast); - var pullSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(ast); - if (pullSymbol && pullSymbolAlias) { - var symbolToCompare = TypeScript.isTypesOnlyLocation(ast) ? pullSymbolAlias.getExportAssignedTypeSymbol() : pullSymbolAlias.getExportAssignedValueSymbol(); - - if (pullSymbol === symbolToCompare) { - pullSymbol = pullSymbolAlias; - pullSymbolAlias = null; - } - } - return { symbol: pullSymbol, aliasSymbol: pullSymbolAlias }; - }; - - Emitter.prototype.emitName = function (name, addThis) { - this.emitComments(name, true); - this.recordSourceMappingStart(name); - if (name.text().length > 0) { - var symbolForEmit = this.getSymbolForEmit(name); - var pullSymbol = symbolForEmit.symbol; - if (!pullSymbol) { - pullSymbol = this.semanticInfoChain.anyTypeSymbol; - } - var pullSymbolAlias = symbolForEmit.aliasSymbol; - var pullSymbolKind = pullSymbol.kind; - var isLocalAlias = pullSymbolAlias && (pullSymbolAlias.getDeclarations()[0].getParentDecl() === this.getEnclosingDecl()); - if (addThis && (this.emitState.container !== 6 /* Args */) && pullSymbol) { - var pullSymbolContainer = pullSymbol.getContainer(); - - if (pullSymbolContainer) { - var pullSymbolContainerKind = pullSymbolContainer.kind; - - if (pullSymbolContainerKind === 8 /* Class */) { - if (pullSymbol.anyDeclHasFlag(16 /* Static */)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbolKind === 4096 /* Property */) { - this.emitThis(); - this.writeToOutput("."); - } - } else if (TypeScript.PullHelpers.symbolIsModule(pullSymbolContainer) || pullSymbolContainerKind === 64 /* Enum */ || pullSymbolContainer.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) { - if (pullSymbolKind === 4096 /* Property */ || pullSymbolKind === 67108864 /* EnumMember */) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && pullSymbolKind === 512 /* Variable */ && !pullSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && !this.symbolIsUsedInItsEnclosingContainer(pullSymbol)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } - } else if (pullSymbolContainerKind === 32 /* DynamicModule */ || pullSymbolContainer.anyDeclHasFlag(65536 /* InitializedDynamicModule */)) { - if (pullSymbolKind === 4096 /* Property */) { - this.writeToOutput("exports."); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && !isLocalAlias && !pullSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */) && pullSymbol.kind !== 32768 /* ConstructorMethod */ && pullSymbol.kind !== 8 /* Class */ && pullSymbol.kind !== 64 /* Enum */) { - this.writeToOutput("exports."); - } - } - } - } - - this.writeToOutput(name.text()); - } - - this.recordSourceMappingEnd(name); - this.emitComments(name, false); - }; - - Emitter.prototype.recordSourceMappingNameStart = function (name) { - if (this.sourceMapper) { - var nameIndex = -1; - if (name) { - if (this.sourceMapper.currentNameIndex.length > 0) { - var parentNameIndex = this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length - 1]; - if (parentNameIndex !== -1) { - name = this.sourceMapper.names[parentNameIndex] + "." + name; - } - } - - var nameIndex = this.sourceMapper.names.length - 1; - for (nameIndex; nameIndex >= 0; nameIndex--) { - if (this.sourceMapper.names[nameIndex] === name) { - break; - } - } - - if (nameIndex === -1) { - nameIndex = this.sourceMapper.names.length; - this.sourceMapper.names.push(name); - } - } - this.sourceMapper.currentNameIndex.push(nameIndex); - } - }; - - Emitter.prototype.recordSourceMappingNameEnd = function () { - if (this.sourceMapper) { - this.sourceMapper.currentNameIndex.pop(); - } - }; - - Emitter.prototype.recordSourceMappingStart = function (ast) { - if (this.sourceMapper && TypeScript.ASTHelpers.isValidAstNode(ast)) { - var lineCol = { line: -1, character: -1 }; - var sourceMapping = new TypeScript.SourceMapping(); - sourceMapping.start.emittedColumn = this.emitState.column; - sourceMapping.start.emittedLine = this.emitState.line; - - var lineMap = this.document.lineMap(); - lineMap.fillLineAndCharacterFromPosition(ast.start(), lineCol); - sourceMapping.start.sourceColumn = lineCol.character; - sourceMapping.start.sourceLine = lineCol.line + 1; - lineMap.fillLineAndCharacterFromPosition(ast.end(), lineCol); - sourceMapping.end.sourceColumn = lineCol.character; - sourceMapping.end.sourceLine = lineCol.line + 1; - - TypeScript.Debug.assert(!isNaN(sourceMapping.start.emittedColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.emittedLine)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.sourceColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.sourceLine)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.sourceColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.sourceLine)); - - if (this.sourceMapper.currentNameIndex.length > 0) { - sourceMapping.nameIndex = this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length - 1]; - } - - var siblings = this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length - 1]; - siblings.push(sourceMapping); - this.sourceMapper.currentMappings.push(sourceMapping.childMappings); - this.sourceMapper.increaseMappingLevel(ast); - } - }; - - Emitter.prototype.recordSourceMappingEnd = function (ast) { - if (this.sourceMapper && TypeScript.ASTHelpers.isValidAstNode(ast)) { - this.sourceMapper.currentMappings.pop(); - - var siblings = this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length - 1]; - var sourceMapping = siblings[siblings.length - 1]; - - sourceMapping.end.emittedColumn = this.emitState.column; - sourceMapping.end.emittedLine = this.emitState.line; - - TypeScript.Debug.assert(!isNaN(sourceMapping.end.emittedColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.emittedLine)); - - this.sourceMapper.decreaseMappingLevel(ast); - } - }; - - Emitter.prototype.getOutputFiles = function () { - var result = []; - if (this.sourceMapper !== null) { - this.sourceMapper.emitSourceMapping(); - result.push(this.sourceMapper.getOutputFile()); - } - - result.push(this.outfile.getOutputFile()); - return result; - }; - - Emitter.prototype.emitParameterPropertyAndMemberVariableAssignments = function () { - var constructorDecl = getLastConstructor(this.thisClassNode); - - if (constructorDecl) { - for (var i = 0, n = constructorDecl.callSignature.parameterList.parameters.nonSeparatorCount(); i < n; i++) { - var parameter = constructorDecl.callSignature.parameterList.parameters.nonSeparatorAt(i); - var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); - if (TypeScript.hasFlag(parameterDecl.flags, 8388608 /* PropertyParameter */)) { - this.emitIndent(); - this.recordSourceMappingStart(parameter); - this.writeToOutputWithSourceMapRecord("this." + parameter.identifier.text(), parameter.identifier); - this.writeToOutput(" = "); - this.writeToOutputWithSourceMapRecord(parameter.identifier.text(), parameter.identifier); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(parameter); - } - } - } - - for (var i = 0, n = this.thisClassNode.classElements.childCount(); i < n; i++) { - if (this.thisClassNode.classElements.childAt(i).kind() === 136 /* MemberVariableDeclaration */) { - var varDecl = this.thisClassNode.classElements.childAt(i); - if (!TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause) { - this.emitIndent(); - this.emitMemberVariableDeclaration(varDecl); - this.writeLineToOutput(""); - } - } - } - }; - - Emitter.prototype.isOnSameLine = function (pos1, pos2) { - var lineMap = this.document.lineMap(); - return lineMap.getLineNumberFromPosition(pos1) === lineMap.getLineNumberFromPosition(pos2); - }; - - Emitter.prototype.emitCommaSeparatedList = function (parent, list, buffer, preserveNewLines) { - if (list === null || list.nonSeparatorCount() === 0) { - return; - } - - var startLine = preserveNewLines && !this.isOnSameLine(parent.end(), list.nonSeparatorAt(0).end()); - - if (preserveNewLines) { - this.indenter.increaseIndent(); - } - - if (startLine) { - this.writeLineToOutput(""); - } else { - this.writeToOutput(buffer); - } - - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - var emitNode = list.nonSeparatorAt(i); - - this.emitJavascript(emitNode, startLine); - - if (i < (n - 1)) { - startLine = preserveNewLines && !this.isOnSameLine(emitNode.end(), list.nonSeparatorAt(i + 1).start()); - if (startLine) { - this.writeLineToOutput(","); - } else { - this.writeToOutput(", "); - } - } - } - - if (preserveNewLines) { - this.indenter.decreaseIndent(); - } - - if (preserveNewLines && !this.isOnSameLine(parent.end(), list.nonSeparatorAt(list.nonSeparatorCount() - 1).end())) { - this.writeLineToOutput(""); - this.emitIndent(); - } else { - this.writeToOutput(buffer); - } - }; - - Emitter.prototype.emitList = function (list, useNewLineSeparator, startInclusive, endExclusive) { - if (typeof useNewLineSeparator === "undefined") { useNewLineSeparator = true; } - if (typeof startInclusive === "undefined") { startInclusive = 0; } - if (typeof endExclusive === "undefined") { endExclusive = list.childCount(); } - if (list === null) { - return; - } - - this.emitComments(list, true); - var lastEmittedNode = null; - - for (var i = startInclusive; i < endExclusive; i++) { - var node = list.childAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - if (useNewLineSeparator) { - this.writeLineToOutput(""); - } - - lastEmittedNode = node; - } - } - - this.emitComments(list, false); - }; - - Emitter.prototype.emitSeparatedList = function (list, useNewLineSeparator, startInclusive, endExclusive) { - if (typeof useNewLineSeparator === "undefined") { useNewLineSeparator = true; } - if (typeof startInclusive === "undefined") { startInclusive = 0; } - if (typeof endExclusive === "undefined") { endExclusive = list.nonSeparatorCount(); } - if (list === null) { - return; - } - - this.emitComments(list, true); - var lastEmittedNode = null; - - for (var i = startInclusive; i < endExclusive; i++) { - var node = list.nonSeparatorAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - if (useNewLineSeparator) { - this.writeLineToOutput(""); - } - - lastEmittedNode = node; - } - } - - this.emitComments(list, false); - }; - - Emitter.prototype.isDirectivePrologueElement = function (node) { - if (node.kind() === 149 /* ExpressionStatement */) { - var exprStatement = node; - return exprStatement.expression.kind() === 14 /* StringLiteral */; - } - - return false; - }; - - Emitter.prototype.emitSpaceBetweenConstructs = function (node1, node2) { - if (node1 === null || node2 === null) { - return; - } - - if (node1.start() === -1 || node1.end() === -1 || node2.start() === -1 || node2.end() === -1) { - return; - } - - var lineMap = this.document.lineMap(); - var node1EndLine = lineMap.getLineNumberFromPosition(node1.end()); - var node2StartLine = lineMap.getLineNumberFromPosition(node2.start()); - - if ((node2StartLine - node1EndLine) > 1) { - this.writeLineToOutput("", true); - } - }; - - Emitter.prototype.getDetachedComments = function (element) { - var preComments = element.preComments(); - if (preComments) { - var lineMap = this.document.lineMap(); - - var detachedComments = []; - var lastComment = null; - - for (var i = 0, n = preComments.length; i < n; i++) { - var comment = preComments[i]; - - if (lastComment) { - var lastCommentLine = lineMap.getLineNumberFromPosition(lastComment.end()); - var commentLine = lineMap.getLineNumberFromPosition(comment.start()); - - if (commentLine >= lastCommentLine + 2) { - return detachedComments; - } - } - - detachedComments.push(comment); - lastComment = comment; - } - - var lastCommentLine = lineMap.getLineNumberFromPosition(TypeScript.ArrayUtilities.last(detachedComments).end()); - var astLine = lineMap.getLineNumberFromPosition(element.start()); - if (astLine >= lastCommentLine + 2) { - return detachedComments; - } - } - - return []; - }; - - Emitter.prototype.emitPossibleCopyrightHeaders = function (script) { - this.emitDetachedComments(script.moduleElements); - }; - - Emitter.prototype.emitDetachedComments = function (list) { - if (list.childCount() > 0) { - var firstElement = list.childAt(0); - - this.detachedCommentsElement = firstElement; - this.emitCommentsArray(this.getDetachedComments(this.detachedCommentsElement), false); - } - }; - - Emitter.prototype.emitScriptElements = function (sourceUnit) { - var list = sourceUnit.moduleElements; - - this.emitPossibleCopyrightHeaders(sourceUnit); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var node = list.childAt(i); - - if (!this.isDirectivePrologueElement(node)) { - break; - } - - this.emitJavascript(node, true); - this.writeLineToOutput(""); - } - - this.emitPrologue(sourceUnit); - - var isExternalModule = this.document.isExternalModule(); - var isNonElidedExternalModule = isExternalModule && !TypeScript.ASTHelpers.scriptIsElided(sourceUnit); - if (isNonElidedExternalModule) { - this.recordSourceMappingStart(sourceUnit); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - var dependencyList = "[\"require\", \"exports\""; - var importList = "require, exports"; - - var importAndDependencyList = this.getModuleImportAndDependencyList(sourceUnit); - importList += importAndDependencyList.importList; - dependencyList += importAndDependencyList.dependencyList + "]"; - - this.writeLineToOutput("define(" + dependencyList + "," + " function(" + importList + ") {"); - } - } - - if (isExternalModule) { - var temp = this.setContainer(2 /* DynamicModule */); - - var svModuleName = this.moduleName; - this.moduleName = sourceUnit.fileName(); - if (TypeScript.isTSFile(this.moduleName)) { - this.moduleName = this.moduleName.substring(0, this.moduleName.length - ".ts".length); - } - - this.setExportAssignment(null); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - this.indenter.increaseIndent(); - } - - var externalModule = this.semanticInfoChain.getDeclForAST(this.document.sourceUnit()); - - if (TypeScript.hasFlag(externalModule.flags, 262144 /* MustCaptureThis */)) { - this.writeCaptureThisStatement(sourceUnit); - } - - this.pushDecl(externalModule); - } - - this.emitList(list, true, i, n); - - if (isExternalModule) { - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - this.indenter.decreaseIndent(); - } - - if (isNonElidedExternalModule) { - var exportAssignment = this.getExportAssignment(); - var exportAssignmentIdentifierText = exportAssignment ? exportAssignment.identifier.text() : null; - var exportAssignmentValueSymbol = externalModule.getSymbol().getExportAssignedValueSymbol(); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - if (exportAssignmentIdentifierText && exportAssignmentValueSymbol && !(exportAssignmentValueSymbol.kind & 58720272 /* SomeTypeReference */)) { - this.indenter.increaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("return " + exportAssignmentIdentifierText, exportAssignment); - this.writeLineToOutput(";"); - this.indenter.decreaseIndent(); - } - this.writeToOutput("});"); - } else if (exportAssignmentIdentifierText && exportAssignmentValueSymbol && !(exportAssignmentValueSymbol.kind & 58720272 /* SomeTypeReference */)) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("module.exports = " + exportAssignmentIdentifierText, exportAssignment); - this.writeToOutput(";"); - } - - this.recordSourceMappingEnd(sourceUnit); - this.writeLineToOutput(""); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - this.popDecl(externalModule); - } - }; - - Emitter.prototype.emitConstructorStatements = function (funcDecl) { - var list = funcDecl.block.statements; - - if (list === null) { - return; - } - - this.emitComments(list, true); - - var emitPropertyAssignmentsAfterSuperCall = TypeScript.ASTHelpers.getExtendsHeritageClause(this.thisClassNode.heritageClauses) !== null; - var propertyAssignmentIndex = emitPropertyAssignmentsAfterSuperCall ? 1 : 0; - var lastEmittedNode = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - if (i === propertyAssignmentIndex) { - this.emitParameterPropertyAndMemberVariableAssignments(); - } - - var node = list.childAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - this.writeLineToOutput(""); - - lastEmittedNode = node; - } - } - - if (i === propertyAssignmentIndex) { - this.emitParameterPropertyAndMemberVariableAssignments(); - } - - this.emitComments(list, false); - }; - - Emitter.prototype.emitJavascript = function (ast, startLine) { - if (ast === null) { - return; - } - - if (startLine && this.indenter.indentAmt > 0) { - this.emitIndent(); - } - - this.emit(ast); - }; - - Emitter.prototype.emitAccessorMemberDeclaration = function (funcDecl, name, className, isProto) { - if (funcDecl.kind() !== 139 /* GetAccessor */) { - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(funcDecl, this.semanticInfoChain); - if (accessorSymbol.getGetter()) { - return; - } - } - - this.emitIndent(); - this.recordSourceMappingStart(funcDecl); - - this.writeToOutput("Object.defineProperty(" + className); - if (isProto) { - this.writeToOutput(".prototype, "); - } else { - this.writeToOutput(", "); - } - - var functionName = name.text(); - if (TypeScript.isQuoted(functionName)) { - this.writeToOutput(functionName); - } else { - this.writeToOutput('"' + functionName + '"'); - } - - this.writeLineToOutput(", {"); - - this.indenter.increaseIndent(); - - var accessors = TypeScript.PullHelpers.getGetterAndSetterFunction(funcDecl, this.semanticInfoChain); - if (accessors.getter) { - this.emitIndent(); - this.recordSourceMappingStart(accessors.getter); - this.emitComments(accessors.getter, true); - this.writeToOutput("get: "); - this.emitAccessorBody(accessors.getter, accessors.getter.parameterList, accessors.getter.block); - this.writeLineToOutput(","); - } - - if (accessors.setter) { - this.emitIndent(); - this.recordSourceMappingStart(accessors.setter); - this.emitComments(accessors.setter, true); - this.writeToOutput("set: "); - this.emitAccessorBody(accessors.setter, accessors.setter.parameterList, accessors.setter.block); - this.writeLineToOutput(","); - } - - this.emitIndent(); - this.writeLineToOutput("enumerable: true,"); - this.emitIndent(); - this.writeLineToOutput("configurable: true"); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeLineToOutput("});"); - this.recordSourceMappingEnd(funcDecl); - }; - - Emitter.prototype.emitAccessorBody = function (funcDecl, parameterList, block) { - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, funcDecl, parameters, block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitClass = function (classDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(classDecl); - this.pushDecl(pullDecl); - - var svClassNode = this.thisClassNode; - this.thisClassNode = classDecl; - var className = classDecl.identifier.text(); - this.emitComments(classDecl, true); - var temp = this.setContainer(3 /* Class */); - - this.recordSourceMappingStart(classDecl); - this.writeToOutput("var " + className); - - var hasBaseClass = TypeScript.ASTHelpers.getExtendsHeritageClause(classDecl.heritageClauses) !== null; - var baseTypeReference = null; - var varDecl = null; - - if (hasBaseClass) { - this.writeLineToOutput(" = (function (_super) {"); - } else { - this.writeLineToOutput(" = (function () {"); - } - - this.recordSourceMappingNameStart(className); - this.indenter.increaseIndent(); - - if (hasBaseClass) { - baseTypeReference = TypeScript.ASTHelpers.getExtendsHeritageClause(classDecl.heritageClauses).typeNames.nonSeparatorAt(0); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("__extends(" + className + ", _super)", baseTypeReference); - this.writeLineToOutput(";"); - } - - this.emitIndent(); - - var constrDecl = getLastConstructor(classDecl); - - if (constrDecl) { - this.emit(constrDecl); - this.writeLineToOutput(""); - } else { - this.recordSourceMappingStart(classDecl); - - this.indenter.increaseIndent(); - this.writeLineToOutput("function " + classDecl.identifier.text() + "() {"); - this.recordSourceMappingNameStart("constructor"); - if (hasBaseClass) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("_super.apply(this, arguments)", baseTypeReference); - this.writeLineToOutput(";"); - } - - if (this.shouldCaptureThis(classDecl)) { - this.writeCaptureThisStatement(classDecl); - } - - this.emitParameterPropertyAndMemberVariableAssignments(); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", classDecl.closeBraceToken); - this.writeLineToOutput(""); - - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(classDecl); - } - - this.emitClassMembers(classDecl); - - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("return " + className + ";", classDecl.closeBraceToken); - this.writeLineToOutput(""); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", classDecl.closeBraceToken); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingStart(classDecl); - this.writeToOutput(")("); - if (hasBaseClass) { - this.emitJavascript(baseTypeReference, false); - } - this.writeToOutput(");"); - this.recordSourceMappingEnd(classDecl); - - if ((temp === 1 /* Module */ || temp === 2 /* DynamicModule */) && TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - this.writeLineToOutput(""); - this.emitIndent(); - var modName = temp === 1 /* Module */ ? this.moduleName : "exports"; - this.writeToOutputWithSourceMapRecord(modName + "." + className + " = " + className + ";", classDecl); - } - - this.recordSourceMappingEnd(classDecl); - this.emitComments(classDecl, false); - this.setContainer(temp); - this.thisClassNode = svClassNode; - - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitClassMembers = function (classDecl) { - var lastEmittedMember = null; - - for (var i = 0, n = classDecl.classElements.childCount(); i < n; i++) { - var memberDecl = classDecl.classElements.childAt(i); - - if (memberDecl.kind() === 139 /* GetAccessor */) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - var getter = memberDecl; - this.emitAccessorMemberDeclaration(getter, getter.propertyName, classDecl.identifier.text(), !TypeScript.hasModifier(getter.modifiers, 16 /* Static */)); - lastEmittedMember = memberDecl; - } else if (memberDecl.kind() === 140 /* SetAccessor */) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - var setter = memberDecl; - this.emitAccessorMemberDeclaration(setter, setter.propertyName, classDecl.identifier.text(), !TypeScript.hasModifier(setter.modifiers, 16 /* Static */)); - lastEmittedMember = memberDecl; - } else if (memberDecl.kind() === 135 /* MemberFunctionDeclaration */) { - var memberFunction = memberDecl; - - if (memberFunction.block) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - - this.emitClassMemberFunctionDeclaration(classDecl, memberFunction); - lastEmittedMember = memberDecl; - } - } - } - - for (var i = 0, n = classDecl.classElements.childCount(); i < n; i++) { - var memberDecl = classDecl.classElements.childAt(i); - - if (memberDecl.kind() === 136 /* MemberVariableDeclaration */) { - var varDecl = memberDecl; - - if (TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause) { - this.emitSpaceBetweenConstructs(lastEmittedMember, varDecl); - - this.emitIndent(); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.variableDeclarator.propertyName.text(); - if (TypeScript.isQuoted(varDeclName) || varDecl.variableDeclarator.propertyName.kind() !== 11 /* IdentifierName */) { - this.writeToOutput(classDecl.identifier.text() + "[" + varDeclName + "]"); - } else { - this.writeToOutput(classDecl.identifier.text() + "." + varDeclName); - } - - this.emit(varDecl.variableDeclarator.equalsValueClause); - - this.recordSourceMappingEnd(varDecl); - this.writeLineToOutput(";"); - - lastEmittedMember = varDecl; - } - } - } - }; - - Emitter.prototype.emitClassMemberFunctionDeclaration = function (classDecl, funcDecl) { - this.emitIndent(); - this.recordSourceMappingStart(funcDecl); - this.emitComments(funcDecl, true); - var functionName = funcDecl.propertyName.text(); - - this.writeToOutput(classDecl.identifier.text()); - - if (!TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */)) { - this.writeToOutput(".prototype"); - } - - if (TypeScript.isQuoted(functionName) || funcDecl.propertyName.kind() !== 11 /* IdentifierName */) { - this.writeToOutput("[" + functionName + "] = "); - } else { - this.writeToOutput("." + functionName + " = "); - } - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - this.emitParameterList(funcDecl.callSignature.parameterList); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionBodyStatements(funcDecl.propertyName.text(), funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.recordSourceMappingEnd(funcDecl); - this.popDecl(pullDecl); - - this.writeLineToOutput(";"); - }; - - Emitter.prototype.requiresExtendsBlock = function (moduleElements) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - - if (moduleElement.kind() === 130 /* ModuleDeclaration */) { - var moduleAST = moduleElement; - - if (!TypeScript.hasModifier(moduleAST.modifiers, 8 /* Ambient */) && this.requiresExtendsBlock(moduleAST.moduleElements)) { - return true; - } - } else if (moduleElement.kind() === 131 /* ClassDeclaration */) { - var classDeclaration = moduleElement; - - if (!TypeScript.hasModifier(classDeclaration.modifiers, 8 /* Ambient */) && TypeScript.ASTHelpers.getExtendsHeritageClause(classDeclaration.heritageClauses) !== null) { - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitPrologue = function (sourceUnit) { - if (!this.extendsPrologueEmitted) { - if (this.requiresExtendsBlock(sourceUnit.moduleElements)) { - this.extendsPrologueEmitted = true; - this.writeLineToOutput("var __extends = this.__extends || function (d, b) {"); - this.writeLineToOutput(" for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - this.writeLineToOutput(" function __() { this.constructor = d; }"); - this.writeLineToOutput(" __.prototype = b.prototype;"); - this.writeLineToOutput(" d.prototype = new __();"); - this.writeLineToOutput("};"); - } - } - - if (!this.globalThisCapturePrologueEmitted) { - if (this.shouldCaptureThis(sourceUnit)) { - this.globalThisCapturePrologueEmitted = true; - this.writeLineToOutput(this.captureThisStmtString); - } - } - }; - - Emitter.prototype.emitThis = function () { - if (!this.inWithBlock && this.inArrowFunction) { - this.writeToOutput("_this"); - } else { - this.writeToOutput("this"); - } - }; - - Emitter.prototype.emitBlockOrStatement = function (node) { - if (node.kind() === 146 /* Block */) { - this.emit(node); - } else { - this.writeLineToOutput(""); - this.indenter.increaseIndent(); - this.emitJavascript(node, true); - this.indenter.decreaseIndent(); - } - }; - - Emitter.prototype.emitLiteralExpression = function (expression) { - switch (expression.kind()) { - case 32 /* NullKeyword */: - this.writeToOutputWithSourceMapRecord("null", expression); - break; - case 24 /* FalseKeyword */: - this.writeToOutputWithSourceMapRecord("false", expression); - break; - case 37 /* TrueKeyword */: - this.writeToOutputWithSourceMapRecord("true", expression); - break; - default: - throw TypeScript.Errors.abstract(); - } - }; - - Emitter.prototype.emitThisExpression = function (expression) { - if (!this.inWithBlock && this.inArrowFunction) { - this.writeToOutputWithSourceMapRecord("_this", expression); - } else { - this.writeToOutputWithSourceMapRecord("this", expression); - } - }; - - Emitter.prototype.emitSuperExpression = function (expression) { - this.writeToOutputWithSourceMapRecord("_super.prototype", expression); - }; - - Emitter.prototype.emitParenthesizedExpression = function (parenthesizedExpression) { - if (parenthesizedExpression.expression.kind() === 220 /* CastExpression */ && parenthesizedExpression.openParenTrailingComments === null) { - this.emit(parenthesizedExpression.expression); - } else { - this.recordSourceMappingStart(parenthesizedExpression); - this.writeToOutput("("); - this.emitCommentsArray(parenthesizedExpression.openParenTrailingComments, false); - this.emit(parenthesizedExpression.expression); - this.writeToOutput(")"); - this.recordSourceMappingEnd(parenthesizedExpression); - } - }; - - Emitter.prototype.emitCastExpression = function (expression) { - this.emit(expression.expression); - }; - - Emitter.prototype.emitPrefixUnaryExpression = function (expression) { - var nodeType = expression.kind(); - - this.recordSourceMappingStart(expression); - switch (nodeType) { - case 167 /* LogicalNotExpression */: - this.writeToOutput("!"); - this.emit(expression.operand); - break; - case 166 /* BitwiseNotExpression */: - this.writeToOutput("~"); - this.emit(expression.operand); - break; - case 165 /* NegateExpression */: - this.writeToOutput("-"); - if (expression.operand.kind() === 165 /* NegateExpression */ || expression.operand.kind() === 169 /* PreDecrementExpression */) { - this.writeToOutput(" "); - } - this.emit(expression.operand); - break; - case 164 /* PlusExpression */: - this.writeToOutput("+"); - if (expression.operand.kind() === 164 /* PlusExpression */ || expression.operand.kind() === 168 /* PreIncrementExpression */) { - this.writeToOutput(" "); - } - this.emit(expression.operand); - break; - case 168 /* PreIncrementExpression */: - this.writeToOutput("++"); - this.emit(expression.operand); - break; - case 169 /* PreDecrementExpression */: - this.writeToOutput("--"); - this.emit(expression.operand); - break; - default: - throw TypeScript.Errors.abstract(); - } - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitPostfixUnaryExpression = function (expression) { - var nodeType = expression.kind(); - - this.recordSourceMappingStart(expression); - switch (nodeType) { - case 210 /* PostIncrementExpression */: - this.emit(expression.operand); - this.writeToOutput("++"); - break; - case 211 /* PostDecrementExpression */: - this.emit(expression.operand); - this.writeToOutput("--"); - break; - default: - throw TypeScript.Errors.abstract(); - } - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitTypeOfExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("typeof "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitDeleteExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("delete "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitVoidExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("void "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.canEmitDottedNameMemberAccessExpression = function (expression) { - var memberExpressionNodeType = expression.expression.kind(); - - if (memberExpressionNodeType === 11 /* IdentifierName */ || memberExpressionNodeType == 212 /* MemberAccessExpression */) { - var memberAccessSymbol = this.getSymbolForEmit(expression).symbol; - var memberAccessExpressionSymbol = this.getSymbolForEmit(expression.expression).symbol; - if (memberAccessSymbol && memberAccessExpressionSymbol && !this.semanticInfoChain.getAliasSymbolForAST(expression.expression) && (TypeScript.PullHelpers.symbolIsModule(memberAccessExpressionSymbol) || memberAccessExpressionSymbol.kind === 64 /* Enum */ || memberAccessExpressionSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */))) { - var memberAccessSymbolKind = memberAccessSymbol.kind; - if (memberAccessSymbolKind === 4096 /* Property */ || memberAccessSymbolKind === 67108864 /* EnumMember */ || (memberAccessSymbol.anyDeclHasFlag(1 /* Exported */) && memberAccessSymbolKind === 512 /* Variable */ && !memberAccessSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) || ((memberAccessSymbol.anyDeclHasFlag(1 /* Exported */) && !this.symbolIsUsedInItsEnclosingContainer(memberAccessSymbol)))) { - if (memberExpressionNodeType === 212 /* MemberAccessExpression */) { - return this.canEmitDottedNameMemberAccessExpression(expression.expression); - } - - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitDottedNameMemberAccessExpressionWorker = function (expression, potentialPath, startingIndex, lastIndex) { - this.recordSourceMappingStart(expression); - if (expression.expression.kind() === 212 /* MemberAccessExpression */) { - this.emitDottedNameMemberAccessExpressionRecurse(expression.expression, potentialPath, startingIndex, lastIndex - 1); - } else { - this.emitComments(expression.expression, true); - this.recordSourceMappingStart(expression.expression); - - this.emitDottedNameFromDeclPath(potentialPath, startingIndex, lastIndex - 2); - - this.writeToOutput(expression.expression.text()); - - this.recordSourceMappingEnd(expression.expression); - this.emitComments(expression.expression, false); - } - - this.writeToOutput("."); - this.emitName(expression.name, false); - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitDottedNameMemberAccessExpressionRecurse = function (expression, potentialPath, startingIndex, lastIndex) { - this.emitComments(expression, true); - - if (lastIndex - startingIndex < 1) { - startingIndex = lastIndex - 1; - TypeScript.Debug.assert(startingIndex >= 0); - } - - this.emitDottedNameMemberAccessExpressionWorker(expression, potentialPath, startingIndex, lastIndex); - this.emitComments(expression, false); - }; - - Emitter.prototype.emitDottedNameMemberAccessExpression = function (expression) { - var memberAccessSymbol = this.getSymbolForEmit(expression).symbol; - - var potentialDeclInfo = this.getPotentialDeclPathInfoForEmit(memberAccessSymbol); - this.emitDottedNameMemberAccessExpressionWorker(expression, potentialDeclInfo.potentialPath, potentialDeclInfo.startingIndex, potentialDeclInfo.potentialPath.length); - }; - - Emitter.prototype.emitMemberAccessExpression = function (expression) { - if (!this.tryEmitConstant(expression)) { - if (this.canEmitDottedNameMemberAccessExpression(expression)) { - this.emitDottedNameMemberAccessExpression(expression); - } else { - this.recordSourceMappingStart(expression); - this.emit(expression.expression); - this.writeToOutput("."); - this.emitName(expression.name, false); - this.recordSourceMappingEnd(expression); - } - } - }; - - Emitter.prototype.emitQualifiedName = function (name) { - this.recordSourceMappingStart(name); - - this.emit(name.left); - this.writeToOutput("."); - this.emitName(name.right, false); - - this.recordSourceMappingEnd(name); - }; - - Emitter.prototype.emitBinaryExpression = function (expression) { - this.recordSourceMappingStart(expression); - switch (expression.kind()) { - case 173 /* CommaExpression */: - this.emit(expression.left); - this.writeToOutput(", "); - this.emit(expression.right); - break; - default: { - this.emit(expression.left); - var binOp = TypeScript.SyntaxFacts.getText(TypeScript.SyntaxFacts.getOperatorTokenFromBinaryExpression(expression.kind())); - if (binOp === "instanceof") { - this.writeToOutput(" instanceof "); - } else if (binOp === "in") { - this.writeToOutput(" in "); - } else { - this.writeToOutput(" " + binOp + " "); - } - this.emit(expression.right); - } - } - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitSimplePropertyAssignment = function (property) { - this.recordSourceMappingStart(property); - this.emit(property.propertyName); - this.writeToOutput(": "); - this.emit(property.expression); - this.recordSourceMappingEnd(property); - }; - - Emitter.prototype.emitFunctionPropertyAssignment = function (funcProp) { - this.recordSourceMappingStart(funcProp); - - this.emit(funcProp.propertyName); - this.writeToOutput(": "); - - var pullFunctionDecl = this.semanticInfoChain.getDeclForAST(funcProp); - - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - var funcName = funcProp.propertyName; - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcProp); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcProp); - this.writeToOutput("function "); - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcProp.propertyName.text(), funcProp, parameters, funcProp.block, null); - - this.recordSourceMappingEnd(funcProp); - - this.recordSourceMappingEnd(funcProp); - - this.emitComments(funcProp, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitConditionalExpression = function (expression) { - this.emit(expression.condition); - this.writeToOutput(" ? "); - this.emit(expression.whenTrue); - this.writeToOutput(" : "); - this.emit(expression.whenFalse); - }; - - Emitter.prototype.emitThrowStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("throw "); - this.emit(statement.expression); - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitExpressionStatement = function (statement) { - var isArrowExpression = statement.expression.kind() === 219 /* SimpleArrowFunctionExpression */ || statement.expression.kind() === 218 /* ParenthesizedArrowFunctionExpression */; - - this.recordSourceMappingStart(statement); - if (isArrowExpression) { - this.writeToOutput("("); - } - - this.emit(statement.expression); - - if (isArrowExpression) { - this.writeToOutput(")"); - } - - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitLabeledStatement = function (statement) { - this.writeToOutputWithSourceMapRecord(statement.identifier.text(), statement.identifier); - this.writeLineToOutput(":"); - this.emitJavascript(statement.statement, true); - }; - - Emitter.prototype.emitBlock = function (block) { - this.recordSourceMappingStart(block); - this.writeLineToOutput(" {"); - this.indenter.increaseIndent(); - if (block.statements) { - this.emitList(block.statements); - } - this.emitCommentsArray(block.closeBraceLeadingComments, false); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutput("}"); - this.recordSourceMappingEnd(block); - }; - - Emitter.prototype.emitBreakStatement = function (jump) { - this.recordSourceMappingStart(jump); - this.writeToOutput("break"); - - if (jump.identifier) { - this.writeToOutput(" " + jump.identifier.text()); - } - - this.recordSourceMappingEnd(jump); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitContinueStatement = function (jump) { - this.recordSourceMappingStart(jump); - this.writeToOutput("continue"); - - if (jump.identifier) { - this.writeToOutput(" " + jump.identifier.text()); - } - - this.recordSourceMappingEnd(jump); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitWhileStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("while ("); - this.emit(statement.condition); - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitDoStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("do"); - this.emitBlockOrStatement(statement.statement); - this.writeToOutputWithSourceMapRecord(" while", statement.whileKeyword); - this.writeToOutput('('); - this.emit(statement.condition); - this.writeToOutput(")"); - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitIfStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("if ("); - this.emit(statement.condition); - this.writeToOutput(")"); - - this.emitBlockOrStatement(statement.statement); - - if (statement.elseClause) { - if (statement.statement.kind() !== 146 /* Block */) { - this.writeLineToOutput(""); - this.emitIndent(); - } else { - this.writeToOutput(" "); - } - - this.emit(statement.elseClause); - } - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitElseClause = function (elseClause) { - if (elseClause.statement.kind() === 147 /* IfStatement */) { - this.writeToOutput("else "); - this.emit(elseClause.statement); - } else { - this.writeToOutput("else"); - this.emitBlockOrStatement(elseClause.statement); - } - }; - - Emitter.prototype.emitReturnStatement = function (statement) { - this.recordSourceMappingStart(statement); - if (statement.expression) { - this.writeToOutput("return "); - this.emit(statement.expression); - } else { - this.writeToOutput("return"); - } - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitForInStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("for ("); - if (statement.left) { - this.emit(statement.left); - } else { - this.emit(statement.variableDeclaration); - } - this.writeToOutput(" in "); - this.emit(statement.expression); - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitForStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("for ("); - if (statement.variableDeclaration) { - this.emit(statement.variableDeclaration); - } else if (statement.initializer) { - this.emit(statement.initializer); - } - - this.writeToOutput("; "); - this.emitJavascript(statement.condition, false); - this.writeToOutput(";"); - if (statement.incrementor) { - this.writeToOutput(" "); - this.emitJavascript(statement.incrementor, false); - } - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitWithStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("with ("); - if (statement.condition) { - this.emit(statement.condition); - } - - this.writeToOutput(")"); - var prevInWithBlock = this.inWithBlock; - this.inWithBlock = true; - this.emitBlockOrStatement(statement.statement); - this.inWithBlock = prevInWithBlock; - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitSwitchStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("switch ("); - this.emit(statement.expression); - this.recordSourceMappingStart(statement.closeParenToken); - this.writeToOutput(")"); - this.recordSourceMappingEnd(statement.closeParenToken); - this.writeLineToOutput(" {"); - this.indenter.increaseIndent(); - this.emitList(statement.switchClauses, false); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutput("}"); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitCaseSwitchClause = function (clause) { - this.recordSourceMappingStart(clause); - this.writeToOutput("case "); - this.emit(clause.expression); - this.writeToOutput(":"); - - this.emitSwitchClauseBody(clause.statements); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitSwitchClauseBody = function (body) { - if (body.childCount() === 1 && body.childAt(0).kind() === 146 /* Block */) { - this.emit(body.childAt(0)); - this.writeLineToOutput(""); - } else { - this.writeLineToOutput(""); - this.indenter.increaseIndent(); - this.emit(body); - this.indenter.decreaseIndent(); - } - }; - - Emitter.prototype.emitDefaultSwitchClause = function (clause) { - this.recordSourceMappingStart(clause); - this.writeToOutput("default:"); - - this.emitSwitchClauseBody(clause.statements); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitTryStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("try "); - this.emit(statement.block); - this.emitJavascript(statement.catchClause, false); - - if (statement.finallyClause) { - this.emit(statement.finallyClause); - } - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitCatchClause = function (clause) { - this.writeToOutput(" "); - this.recordSourceMappingStart(clause); - this.writeToOutput("catch ("); - this.emit(clause.identifier); - this.writeToOutput(")"); - this.emit(clause.block); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitFinallyClause = function (clause) { - this.writeToOutput(" finally"); - this.emit(clause.block); - }; - - Emitter.prototype.emitDebuggerStatement = function (statement) { - this.writeToOutputWithSourceMapRecord("debugger", statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitNumericLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitRegularExpressionLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitStringLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitEqualsValueClause = function (clause) { - this.writeToOutput(" = "); - this.emit(clause.value); - }; - - Emitter.prototype.emitParameter = function (parameter) { - this.writeToOutputWithSourceMapRecord(parameter.identifier.text(), parameter); - }; - - Emitter.prototype.emitConstructorDeclaration = function (declaration) { - if (declaration.block) { - this.emitConstructor(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitFunctionDeclaration = function (declaration) { - return declaration.preComments() !== null || (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) && declaration.block !== null); - }; - - Emitter.prototype.emitFunctionDeclaration = function (declaration) { - if (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) && declaration.block !== null) { - this.emitFunction(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.emitSourceUnit = function (sourceUnit) { - if (!this.document.isDeclareFile()) { - var pullDecl = this.semanticInfoChain.getDeclForAST(sourceUnit); - this.pushDecl(pullDecl); - this.emitScriptElements(sourceUnit); - this.popDecl(pullDecl); - - this.emitCommentsArray(sourceUnit.endOfFileTokenLeadingComments, false); - } - }; - - Emitter.prototype.shouldEmitEnumDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.ASTHelpers.enumIsElided(declaration); - }; - - Emitter.prototype.emitEnumDeclaration = function (declaration) { - if (!TypeScript.ASTHelpers.enumIsElided(declaration)) { - this.emitComments(declaration, true); - this.emitEnum(declaration); - this.emitComments(declaration, false); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitModuleDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.ASTHelpers.moduleIsElided(declaration); - }; - - Emitter.prototype.emitModuleDeclaration = function (declaration) { - if (!TypeScript.ASTHelpers.moduleIsElided(declaration)) { - this.emitModuleDeclarationWorker(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitClassDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */); - }; - - Emitter.prototype.emitClassDeclaration = function (declaration) { - if (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */)) { - this.emitClass(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitInterfaceDeclaration = function (declaration) { - return declaration.preComments() !== null; - }; - - Emitter.prototype.emitInterfaceDeclaration = function (declaration) { - this.emitComments(declaration, true, true); - }; - - Emitter.prototype.firstVariableDeclarator = function (statement) { - return statement.declaration.declarators.nonSeparatorAt(0); - }; - - Emitter.prototype.isNotAmbientOrHasInitializer = function (variableStatement) { - return !TypeScript.hasModifier(variableStatement.modifiers, 8 /* Ambient */) || this.firstVariableDeclarator(variableStatement).equalsValueClause !== null; - }; - - Emitter.prototype.shouldEmitVariableStatement = function (statement) { - return statement.preComments() !== null || this.isNotAmbientOrHasInitializer(statement); - }; - - Emitter.prototype.emitVariableStatement = function (statement) { - if (this.isNotAmbientOrHasInitializer(statement)) { - this.emitComments(statement, true); - this.emit(statement.declaration); - this.writeToOutput(";"); - this.emitComments(statement, false); - } else { - this.emitComments(statement, true, true); - } - }; - - Emitter.prototype.emitGenericType = function (type) { - this.emit(type.name); - }; - - Emitter.prototype.shouldEmit = function (ast) { - if (!ast) { - return false; - } - - switch (ast.kind()) { - case 133 /* ImportDeclaration */: - return this.shouldEmitImportDeclaration(ast); - case 131 /* ClassDeclaration */: - return this.shouldEmitClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.shouldEmitInterfaceDeclaration(ast); - case 129 /* FunctionDeclaration */: - return this.shouldEmitFunctionDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.shouldEmitModuleDeclaration(ast); - case 148 /* VariableStatement */: - return this.shouldEmitVariableStatement(ast); - case 223 /* OmittedExpression */: - return false; - case 132 /* EnumDeclaration */: - return this.shouldEmitEnumDeclaration(ast); - } - - return true; - }; - - Emitter.prototype.emit = function (ast) { - if (!ast) { - return; - } - - switch (ast.kind()) { - case 2 /* SeparatedList */: - return this.emitSeparatedList(ast); - case 1 /* List */: - return this.emitList(ast); - case 120 /* SourceUnit */: - return this.emitSourceUnit(ast); - case 133 /* ImportDeclaration */: - return this.emitImportDeclaration(ast); - case 134 /* ExportAssignment */: - return this.setExportAssignment(ast); - case 131 /* ClassDeclaration */: - return this.emitClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.emitInterfaceDeclaration(ast); - case 11 /* IdentifierName */: - return this.emitName(ast, true); - case 225 /* VariableDeclarator */: - return this.emitVariableDeclarator(ast); - case 219 /* SimpleArrowFunctionExpression */: - return this.emitSimpleArrowFunctionExpression(ast); - case 218 /* ParenthesizedArrowFunctionExpression */: - return this.emitParenthesizedArrowFunctionExpression(ast); - case 129 /* FunctionDeclaration */: - return this.emitFunctionDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.emitModuleDeclaration(ast); - case 224 /* VariableDeclaration */: - return this.emitVariableDeclaration(ast); - case 126 /* GenericType */: - return this.emitGenericType(ast); - case 137 /* ConstructorDeclaration */: - return this.emitConstructorDeclaration(ast); - case 132 /* EnumDeclaration */: - return this.emitEnumDeclaration(ast); - case 243 /* EnumElement */: - return this.emitEnumElement(ast); - case 222 /* FunctionExpression */: - return this.emitFunctionExpression(ast); - case 148 /* VariableStatement */: - return this.emitVariableStatement(ast); - } - - this.emitComments(ast, true); - this.emitWorker(ast); - this.emitComments(ast, false); - }; - - Emitter.prototype.emitWorker = function (ast) { - if (!ast) { - return; - } - - switch (ast.kind()) { - case 13 /* NumericLiteral */: - return this.emitNumericLiteral(ast); - case 12 /* RegularExpressionLiteral */: - return this.emitRegularExpressionLiteral(ast); - case 14 /* StringLiteral */: - return this.emitStringLiteral(ast); - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 37 /* TrueKeyword */: - return this.emitLiteralExpression(ast); - case 35 /* ThisKeyword */: - return this.emitThisExpression(ast); - case 50 /* SuperKeyword */: - return this.emitSuperExpression(ast); - case 217 /* ParenthesizedExpression */: - return this.emitParenthesizedExpression(ast); - case 214 /* ArrayLiteralExpression */: - return this.emitArrayLiteralExpression(ast); - case 211 /* PostDecrementExpression */: - case 210 /* PostIncrementExpression */: - return this.emitPostfixUnaryExpression(ast); - case 167 /* LogicalNotExpression */: - case 166 /* BitwiseNotExpression */: - case 165 /* NegateExpression */: - case 164 /* PlusExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return this.emitPrefixUnaryExpression(ast); - case 213 /* InvocationExpression */: - return this.emitInvocationExpression(ast); - case 221 /* ElementAccessExpression */: - return this.emitElementAccessExpression(ast); - case 212 /* MemberAccessExpression */: - return this.emitMemberAccessExpression(ast); - case 121 /* QualifiedName */: - return this.emitQualifiedName(ast); - case 173 /* CommaExpression */: - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* LogicalOrExpression */: - case 188 /* LogicalAndExpression */: - case 189 /* BitwiseOrExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 191 /* BitwiseAndExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - return this.emitBinaryExpression(ast); - case 186 /* ConditionalExpression */: - return this.emitConditionalExpression(ast); - case 232 /* EqualsValueClause */: - return this.emitEqualsValueClause(ast); - case 242 /* Parameter */: - return this.emitParameter(ast); - case 146 /* Block */: - return this.emitBlock(ast); - case 235 /* ElseClause */: - return this.emitElseClause(ast); - case 147 /* IfStatement */: - return this.emitIfStatement(ast); - case 149 /* ExpressionStatement */: - return this.emitExpressionStatement(ast); - case 139 /* GetAccessor */: - return this.emitGetAccessor(ast); - case 140 /* SetAccessor */: - return this.emitSetAccessor(ast); - case 157 /* ThrowStatement */: - return this.emitThrowStatement(ast); - case 150 /* ReturnStatement */: - return this.emitReturnStatement(ast); - case 216 /* ObjectCreationExpression */: - return this.emitObjectCreationExpression(ast); - case 151 /* SwitchStatement */: - return this.emitSwitchStatement(ast); - case 233 /* CaseSwitchClause */: - return this.emitCaseSwitchClause(ast); - case 234 /* DefaultSwitchClause */: - return this.emitDefaultSwitchClause(ast); - case 152 /* BreakStatement */: - return this.emitBreakStatement(ast); - case 153 /* ContinueStatement */: - return this.emitContinueStatement(ast); - case 154 /* ForStatement */: - return this.emitForStatement(ast); - case 155 /* ForInStatement */: - return this.emitForInStatement(ast); - case 158 /* WhileStatement */: - return this.emitWhileStatement(ast); - case 163 /* WithStatement */: - return this.emitWithStatement(ast); - case 220 /* CastExpression */: - return this.emitCastExpression(ast); - case 215 /* ObjectLiteralExpression */: - return this.emitObjectLiteralExpression(ast); - case 240 /* SimplePropertyAssignment */: - return this.emitSimplePropertyAssignment(ast); - case 241 /* FunctionPropertyAssignment */: - return this.emitFunctionPropertyAssignment(ast); - case 156 /* EmptyStatement */: - return this.writeToOutputWithSourceMapRecord(";", ast); - case 159 /* TryStatement */: - return this.emitTryStatement(ast); - case 236 /* CatchClause */: - return this.emitCatchClause(ast); - case 237 /* FinallyClause */: - return this.emitFinallyClause(ast); - case 160 /* LabeledStatement */: - return this.emitLabeledStatement(ast); - case 161 /* DoStatement */: - return this.emitDoStatement(ast); - case 171 /* TypeOfExpression */: - return this.emitTypeOfExpression(ast); - case 170 /* DeleteExpression */: - return this.emitDeleteExpression(ast); - case 172 /* VoidExpression */: - return this.emitVoidExpression(ast); - case 162 /* DebuggerStatement */: - return this.emitDebuggerStatement(ast); - } - }; - return Emitter; - })(); - TypeScript.Emitter = Emitter; - - function getLastConstructor(classDecl) { - return classDecl.classElements.lastOrDefault(function (e) { - return e.kind() === 137 /* ConstructorDeclaration */; - }); - } - TypeScript.getLastConstructor = getLastConstructor; - - function getTrimmedTextLines(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - return comment.fullText().split("\n").map(function (s) { - return s.trim(); - }); - } else { - return [comment.fullText().trim()]; - } - } - TypeScript.getTrimmedTextLines = getTrimmedTextLines; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var MemberName = (function () { - function MemberName() { - this.prefix = ""; - this.suffix = ""; - } - MemberName.prototype.isString = function () { - return false; - }; - MemberName.prototype.isArray = function () { - return false; - }; - MemberName.prototype.isMarker = function () { - return !this.isString() && !this.isArray(); - }; - - MemberName.prototype.toString = function () { - return MemberName.memberNameToString(this); - }; - - MemberName.memberNameToString = function (memberName, markerInfo, markerBaseLength) { - if (typeof markerBaseLength === "undefined") { markerBaseLength = 0; } - var result = memberName.prefix; - - if (memberName.isString()) { - result += memberName.text; - } else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - if (ar.entries[index].isMarker()) { - if (markerInfo) { - markerInfo.push(markerBaseLength + result.length); - } - continue; - } - - result += MemberName.memberNameToString(ar.entries[index], markerInfo, markerBaseLength + result.length); - result += ar.delim; - } - } - - result += memberName.suffix; - return result; - }; - - MemberName.create = function (arg1, arg2, arg3) { - if (typeof arg1 === "string") { - return new MemberNameString(arg1); - } else { - var result = new MemberNameArray(); - if (arg2) - result.prefix = arg2; - if (arg3) - result.suffix = arg3; - result.entries.push(arg1); - return result; - } - }; - return MemberName; - })(); - TypeScript.MemberName = MemberName; - - var MemberNameString = (function (_super) { - __extends(MemberNameString, _super); - function MemberNameString(text) { - _super.call(this); - this.text = text; - } - MemberNameString.prototype.isString = function () { - return true; - }; - return MemberNameString; - })(MemberName); - TypeScript.MemberNameString = MemberNameString; - - var MemberNameArray = (function (_super) { - __extends(MemberNameArray, _super); - function MemberNameArray() { - _super.call(this); - this.delim = ""; - this.entries = []; - } - MemberNameArray.prototype.isArray = function () { - return true; - }; - - MemberNameArray.prototype.add = function (entry) { - this.entries.push(entry); - }; - - MemberNameArray.prototype.addAll = function (entries) { - for (var i = 0; i < entries.length; i++) { - this.entries.push(entries[i]); - } - }; - return MemberNameArray; - })(MemberName); - TypeScript.MemberNameArray = MemberNameArray; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function stripStartAndEndQuotes(str) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return str.substring(1, str.length - 1); - } - - return str; - } - TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; - - var switchToForwardSlashesRegEx = /\\/g; - function switchToForwardSlashes(path) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - TypeScript.switchToForwardSlashes = switchToForwardSlashes; - - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - - return modName; - } - TypeScript.trimModName = trimModName; - - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; - - function isFileOfExtension(fname, ext) { - var invariantFname = fname.toLocaleUpperCase(); - var invariantExt = ext.toLocaleUpperCase(); - var extLength = invariantExt.length; - return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; - } - - function isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; - - function isDTSFile(fname) { - return isFileOfExtension(fname, ".d.ts"); - } - TypeScript.isDTSFile = isDTSFile; - - function getPrettyName(modPath, quote, treatAsFileName) { - if (typeof quote === "undefined") { quote = true; } - if (typeof treatAsFileName === "undefined") { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; - - function getPathComponents(path) { - return path.split("/"); - } - TypeScript.getPathComponents = getPathComponents; - - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (typeof isAbsoultePathURL === "undefined") { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - - return relativePath + relativePathComponents.join("/"); - } - - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; - - var normalizePathRegEx = /^\\\\[^\\]/; - function normalizePath(path) { - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts = []; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - - if (normalizedParts.length > 0 && TypeScript.ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - - normalizedParts.push(part); - } - - return normalizedParts.join("/"); - } - TypeScript.normalizePath = normalizePath; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - - - function isNoDefaultLibMatch(comment) { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - - function getFileReferenceFromReferencePath(fileName, lineMap, position, comment, diagnostics) { - var simpleReferenceRegEx = /^\/\/\/\s*= 7 && fullReference[6] === "true"; - if (isResident) { - TypeScript.CompilerDiagnostics.debugPrint(path + " is resident"); - } - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: TypeScript.switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - - return null; - } - - var scannerWindow = TypeScript.ArrayUtilities.createArray(2048, 0); - var scannerDiagnostics = []; - - function processImports(lineMap, scanner, token, importedFiles) { - var position = 0; - var lineChar = { line: -1, character: -1 }; - - var start = new Date().getTime(); - - while (token.tokenKind !== 10 /* EndOfFileToken */) { - if (token.tokenKind === 49 /* ImportKeyword */) { - var importStart = position + token.leadingTriviaWidth(); - token = scanner.scan(scannerDiagnostics, false); - - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 107 /* EqualsToken */) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 65 /* ModuleKeyword */ || token.tokenKind === 66 /* RequireKeyword */) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 72 /* OpenParenToken */) { - var afterOpenParenPosition = scanner.absoluteIndex(); - token = scanner.scan(scannerDiagnostics, false); - - lineMap.fillLineAndCharacterFromPosition(importStart, lineChar); - - if (token.tokenKind === 14 /* StringLiteral */) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: afterOpenParenPosition + token.leadingTriviaWidth(), - length: token.width(), - path: TypeScript.stripStartAndEndQuotes(TypeScript.switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - - position = scanner.absoluteIndex(); - token = scanner.scan(scannerDiagnostics, false); - } - - var totalTime = new Date().getTime() - start; - TypeScript.fileResolutionScanImportsTime += totalTime; - } - - function processTripleSlashDirectives(fileName, lineMap, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(); - - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics = []; - var referencedFiles = []; - - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, lineMap, position, triviaText, diagnostics); - - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - - referencedFiles.push(referencedCode); - } - - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - - position += trivia.fullWidth(); - } - - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - - function preProcessFile(fileName, sourceText, readImportFiles) { - if (typeof readImportFiles === "undefined") { readImportFiles = true; } - var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = new TypeScript.Scanner(fileName, text, 1 /* EcmaScript5 */, scannerWindow); - - var firstToken = scanner.scan(scannerDiagnostics, false); - - var importedFiles = []; - if (readImportFiles) { - processImports(text.lineMap(), scanner, firstToken, importedFiles); - } - - var properties = processTripleSlashDirectives(fileName, text.lineMap(), firstToken); - - scannerDiagnostics.length = 0; - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - TypeScript.preProcessFile = preProcessFile; - - function getParseOptions(settings) { - return new TypeScript.ParseOptions(settings.codeGenTarget(), settings.allowAutomaticSemicolonInsertion()); - } - TypeScript.getParseOptions = getParseOptions; - - function getReferencedFiles(fileName, sourceText) { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } - TypeScript.getReferencedFiles = getReferencedFiles; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ReferenceResolutionResult = (function () { - function ReferenceResolutionResult() { - this.resolvedFiles = []; - this.diagnostics = []; - this.seenNoDefaultLibTag = false; - } - return ReferenceResolutionResult; - })(); - TypeScript.ReferenceResolutionResult = ReferenceResolutionResult; - - var ReferenceLocation = (function () { - function ReferenceLocation(filePath, lineMap, position, length, isImported) { - this.filePath = filePath; - this.lineMap = lineMap; - this.position = position; - this.length = length; - this.isImported = isImported; - } - return ReferenceLocation; - })(); - - var ReferenceResolver = (function () { - function ReferenceResolver(inputFileNames, host, useCaseSensitiveFileResolution) { - this.useCaseSensitiveFileResolution = useCaseSensitiveFileResolution; - this.inputFileNames = inputFileNames; - this.host = host; - this.visited = {}; - } - ReferenceResolver.resolve = function (inputFileNames, host, useCaseSensitiveFileResolution) { - var resolver = new ReferenceResolver(inputFileNames, host, useCaseSensitiveFileResolution); - return resolver.resolveInputFiles(); - }; - - ReferenceResolver.prototype.resolveInputFiles = function () { - var _this = this; - var result = new ReferenceResolutionResult(); - - if (!this.inputFileNames || this.inputFileNames.length <= 0) { - return result; - } - - var referenceLocation = new ReferenceLocation(null, null, 0, 0, false); - this.inputFileNames.forEach(function (fileName) { - return _this.resolveIncludedFile(fileName, referenceLocation, result); - }); - - return result; - }; - - ReferenceResolver.prototype.resolveIncludedFile = function (path, referenceLocation, resolutionResult) { - var normalizedPath = this.getNormalizedFilePath(path, referenceLocation.filePath); - - if (this.isSameFile(normalizedPath, referenceLocation.filePath)) { - if (!referenceLocation.isImported) { - resolutionResult.diagnostics.push(new TypeScript.Diagnostic(referenceLocation.filePath, referenceLocation.lineMap, referenceLocation.position, referenceLocation.length, TypeScript.DiagnosticCode.A_file_cannot_have_a_reference_to_itself, null)); - } - - return normalizedPath; - } - - if (!TypeScript.isTSFile(normalizedPath) && !TypeScript.isDTSFile(normalizedPath)) { - var dtsFile = normalizedPath + ".d.ts"; - var tsFile = normalizedPath + ".ts"; - - if (this.host.fileExists(tsFile)) { - normalizedPath = tsFile; - } else { - normalizedPath = dtsFile; - } - } - - if (!this.host.fileExists(normalizedPath)) { - if (!referenceLocation.isImported) { - resolutionResult.diagnostics.push(new TypeScript.Diagnostic(referenceLocation.filePath, referenceLocation.lineMap, referenceLocation.position, referenceLocation.length, TypeScript.DiagnosticCode.Cannot_resolve_referenced_file_0, [path])); - } - - return normalizedPath; - } - - return this.resolveFile(normalizedPath, resolutionResult); - }; - - ReferenceResolver.prototype.resolveImportedFile = function (path, referenceLocation, resolutionResult) { - var isRelativePath = TypeScript.isRelative(path); - var isRootedPath = isRelativePath ? false : TypeScript.isRooted(path); - - if (isRelativePath || isRootedPath) { - return this.resolveIncludedFile(path, referenceLocation, resolutionResult); - } else { - var parentDirectory = this.host.getParentDirectory(referenceLocation.filePath); - var searchFilePath = null; - var dtsFileName = path + ".d.ts"; - var tsFilePath = path + ".ts"; - - var start = new Date().getTime(); - - do { - currentFilePath = this.host.resolveRelativePath(tsFilePath, parentDirectory); - if (this.host.fileExists(currentFilePath)) { - searchFilePath = currentFilePath; - break; - } - - var currentFilePath = this.host.resolveRelativePath(dtsFileName, parentDirectory); - if (this.host.fileExists(currentFilePath)) { - searchFilePath = currentFilePath; - break; - } - - parentDirectory = this.host.getParentDirectory(parentDirectory); - } while(parentDirectory); - - TypeScript.fileResolutionImportFileSearchTime += new Date().getTime() - start; - - if (!searchFilePath) { - return path; - } - - return this.resolveFile(searchFilePath, resolutionResult); - } - }; - - ReferenceResolver.prototype.resolveFile = function (normalizedPath, resolutionResult) { - var _this = this; - var visitedPath = this.isVisited(normalizedPath); - if (!visitedPath) { - this.recordVisitedFile(normalizedPath); - - var start = new Date().getTime(); - var scriptSnapshot = this.host.getScriptSnapshot(normalizedPath); - var totalTime = new Date().getTime() - start; - TypeScript.fileResolutionIOTime += totalTime; - - var lineMap = TypeScript.LineMap1.fromScriptSnapshot(scriptSnapshot); - var preprocessedFileInformation = TypeScript.preProcessFile(normalizedPath, scriptSnapshot); - resolutionResult.diagnostics.push.apply(resolutionResult.diagnostics, preprocessedFileInformation.diagnostics); - - if (preprocessedFileInformation.isLibFile) { - resolutionResult.seenNoDefaultLibTag = true; - } - - var normalizedReferencePaths = []; - preprocessedFileInformation.referencedFiles.forEach(function (fileReference) { - var currentReferenceLocation = new ReferenceLocation(normalizedPath, lineMap, fileReference.position, fileReference.length, false); - var normalizedReferencePath = _this.resolveIncludedFile(fileReference.path, currentReferenceLocation, resolutionResult); - normalizedReferencePaths.push(normalizedReferencePath); - }); - - var normalizedImportPaths = []; - for (var i = 0; i < preprocessedFileInformation.importedFiles.length; i++) { - var fileImport = preprocessedFileInformation.importedFiles[i]; - var currentReferenceLocation = new ReferenceLocation(normalizedPath, lineMap, fileImport.position, fileImport.length, true); - var normalizedImportPath = this.resolveImportedFile(fileImport.path, currentReferenceLocation, resolutionResult); - normalizedImportPaths.push(normalizedImportPath); - } - - resolutionResult.resolvedFiles.push({ - path: normalizedPath, - referencedFiles: normalizedReferencePaths, - importedFiles: normalizedImportPaths - }); - } else { - normalizedPath = visitedPath; - } - - return normalizedPath; - }; - - ReferenceResolver.prototype.getNormalizedFilePath = function (path, parentFilePath) { - var parentFileDirectory = parentFilePath ? this.host.getParentDirectory(parentFilePath) : ""; - var normalizedPath = this.host.resolveRelativePath(path, parentFileDirectory); - return normalizedPath; - }; - - ReferenceResolver.prototype.getUniqueFileId = function (filePath) { - return this.useCaseSensitiveFileResolution ? filePath : filePath.toLocaleUpperCase(); - }; - - ReferenceResolver.prototype.recordVisitedFile = function (filePath) { - this.visited[this.getUniqueFileId(filePath)] = filePath; - }; - - ReferenceResolver.prototype.isVisited = function (filePath) { - return this.visited[this.getUniqueFileId(filePath)]; - }; - - ReferenceResolver.prototype.isSameFile = function (filePath1, filePath2) { - if (!filePath1 || !filePath2) { - return false; - } - - if (this.useCaseSensitiveFileResolution) { - return filePath1 === filePath2; - } else { - return filePath1.toLocaleUpperCase() === filePath2.toLocaleUpperCase(); - } - }; - return ReferenceResolver; - })(); - TypeScript.ReferenceResolver = ReferenceResolver; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextWriter = (function () { - function TextWriter(name, writeByteOrderMark, outputFileType) { - this.name = name; - this.writeByteOrderMark = writeByteOrderMark; - this.outputFileType = outputFileType; - this.contents = ""; - this.onNewLine = true; - } - TextWriter.prototype.Write = function (s) { - this.contents += s; - this.onNewLine = false; - }; - - TextWriter.prototype.WriteLine = function (s) { - this.contents += s; - this.contents += TypeScript.newLine(); - this.onNewLine = true; - }; - - TextWriter.prototype.Close = function () { - }; - - TextWriter.prototype.getOutputFile = function () { - return new TypeScript.OutputFile(this.name, this.writeByteOrderMark, this.contents, this.outputFileType); - }; - return TextWriter; - })(); - TypeScript.TextWriter = TextWriter; - - var DeclarationEmitter = (function () { - function DeclarationEmitter(emittingFileName, document, compiler, emitOptions, semanticInfoChain) { - this.emittingFileName = emittingFileName; - this.document = document; - this.compiler = compiler; - this.emitOptions = emitOptions; - this.semanticInfoChain = semanticInfoChain; - this.declFile = null; - this.indenter = new TypeScript.Indenter(); - this.emittedReferencePaths = false; - this.declFile = new TextWriter(emittingFileName, this.document.byteOrderMark !== 0 /* None */, 2 /* Declaration */); - } - DeclarationEmitter.prototype.getOutputFile = function () { - return this.declFile.getOutputFile(); - }; - - DeclarationEmitter.prototype.emitDeclarations = function (sourceUnit) { - this.emitDeclarationsForSourceUnit(sourceUnit); - }; - - DeclarationEmitter.prototype.emitDeclarationsForList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - this.emitDeclarationsForAST(list.childAt(i)); - } - }; - - DeclarationEmitter.prototype.emitSeparatedList = function (list) { - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - this.emitDeclarationsForAST(list.nonSeparatorAt(i)); - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForAST = function (ast) { - switch (ast.kind()) { - case 148 /* VariableStatement */: - return this.emitDeclarationsForVariableStatement(ast); - case 141 /* PropertySignature */: - return this.emitPropertySignature(ast); - case 225 /* VariableDeclarator */: - return this.emitVariableDeclarator(ast, true, true); - case 136 /* MemberVariableDeclaration */: - return this.emitDeclarationsForMemberVariableDeclaration(ast); - case 137 /* ConstructorDeclaration */: - return this.emitDeclarationsForConstructorDeclaration(ast); - case 139 /* GetAccessor */: - return this.emitDeclarationsForGetAccessor(ast); - case 140 /* SetAccessor */: - return this.emitDeclarationsForSetAccessor(ast); - case 138 /* IndexMemberDeclaration */: - return this.emitIndexMemberDeclaration(ast); - case 144 /* IndexSignature */: - return this.emitIndexSignature(ast); - case 142 /* CallSignature */: - return this.emitCallSignature(ast); - case 143 /* ConstructSignature */: - return this.emitConstructSignature(ast); - case 145 /* MethodSignature */: - return this.emitMethodSignature(ast); - case 129 /* FunctionDeclaration */: - return this.emitDeclarationsForFunctionDeclaration(ast); - case 135 /* MemberFunctionDeclaration */: - return this.emitMemberFunctionDeclaration(ast); - case 131 /* ClassDeclaration */: - return this.emitDeclarationsForClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.emitDeclarationsForInterfaceDeclaration(ast); - case 133 /* ImportDeclaration */: - return this.emitDeclarationsForImportDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.emitDeclarationsForModuleDeclaration(ast); - case 132 /* EnumDeclaration */: - return this.emitDeclarationsForEnumDeclaration(ast); - case 134 /* ExportAssignment */: - return this.emitDeclarationsForExportAssignment(ast); - } - }; - - DeclarationEmitter.prototype.getIndentString = function (declIndent) { - if (typeof declIndent === "undefined") { declIndent = false; } - return this.indenter.getIndent(); - }; - - DeclarationEmitter.prototype.emitIndent = function () { - this.declFile.Write(this.getIndentString()); - }; - - DeclarationEmitter.prototype.canEmitDeclarations = function (declAST) { - var container = this.getEnclosingContainer(declAST); - if (container.kind() === 130 /* ModuleDeclaration */ || container.kind() === 120 /* SourceUnit */) { - var pullDecl = this.semanticInfoChain.getDeclForAST(declAST); - if (!TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - var start = new Date().getTime(); - var declSymbol = this.semanticInfoChain.getSymbolForAST(declAST); - var result = declSymbol && declSymbol.isExternallyVisible(); - TypeScript.declarationEmitIsExternallyVisibleTime += new Date().getTime() - start; - - return result; - } - } - - return true; - }; - - DeclarationEmitter.prototype.getDeclFlagsString = function (pullDecl, typeString) { - var result = this.getIndentString(); - var pullFlags = pullDecl.flags; - - if (TypeScript.hasFlag(pullFlags, 16 /* Static */)) { - if (TypeScript.hasFlag(pullFlags, 2 /* Private */)) { - result += "private "; - } - result += "static "; - } else { - if (TypeScript.hasFlag(pullFlags, 2 /* Private */)) { - result += "private "; - } else if (TypeScript.hasFlag(pullFlags, 4 /* Public */)) { - result += "public "; - } else { - var emitDeclare = !TypeScript.hasFlag(pullFlags, 1 /* Exported */); - - var declAST = this.semanticInfoChain.getASTForDecl(pullDecl); - var container = this.getEnclosingContainer(declAST); - - if (container.kind() === 130 /* ModuleDeclaration */ && TypeScript.ASTHelpers.isAnyNameOfModule(container, declAST)) { - container = this.getEnclosingContainer(container); - } - - var isExternalModule = container.kind() === 120 /* SourceUnit */ && this.document.isExternalModule(); - - if (isExternalModule && TypeScript.hasFlag(pullFlags, 1 /* Exported */)) { - result += "export "; - emitDeclare = true; - } - - if (isExternalModule || container.kind() === 120 /* SourceUnit */) { - if (emitDeclare && typeString !== "interface" && typeString !== "import") { - result += "declare "; - } - } - - result += typeString + " "; - } - } - - return result; - }; - - DeclarationEmitter.prototype.emitDeclFlags = function (declarationAST, typeString) { - this.declFile.Write(this.getDeclFlagsString(this.semanticInfoChain.getDeclForAST(declarationAST), typeString)); - }; - - DeclarationEmitter.prototype.emitTypeNamesMember = function (memberName, emitIndent) { - if (typeof emitIndent === "undefined") { emitIndent = false; } - if (memberName.prefix === "{ ") { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.WriteLine("{"); - this.indenter.increaseIndent(); - emitIndent = true; - } else if (memberName.prefix !== "") { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.Write(memberName.prefix); - emitIndent = false; - } - - if (memberName.isString()) { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.Write(memberName.text); - } else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - this.emitTypeNamesMember(ar.entries[index], emitIndent); - if (ar.delim === "; ") { - this.declFile.WriteLine(";"); - } - } - } - - if (memberName.suffix === "}") { - this.indenter.decreaseIndent(); - this.emitIndent(); - this.declFile.Write(memberName.suffix); - } else { - this.declFile.Write(memberName.suffix); - } - }; - - DeclarationEmitter.prototype.emitTypeSignature = function (ast, type) { - var declarationContainerAst = this.getEnclosingContainer(ast); - - var start = new Date().getTime(); - var declarationContainerDecl = this.semanticInfoChain.getDeclForAST(declarationContainerAst); - - var declarationPullSymbol = declarationContainerDecl.getSymbol(); - TypeScript.declarationEmitTypeSignatureTime += new Date().getTime() - start; - - var isNotAGenericType = ast.kind() !== 126 /* GenericType */; - - var typeNameMembers = type.getScopedNameEx(declarationPullSymbol, false, false, false, false, false, isNotAGenericType); - this.emitTypeNamesMember(typeNameMembers); - }; - - DeclarationEmitter.prototype.emitComment = function (comment) { - var text = TypeScript.getTrimmedTextLines(comment); - if (this.declFile.onNewLine) { - this.emitIndent(); - } else if (comment.kind() !== 6 /* MultiLineCommentTrivia */) { - this.declFile.WriteLine(""); - this.emitIndent(); - } - - this.declFile.Write(text[0]); - - for (var i = 1; i < text.length; i++) { - this.declFile.WriteLine(""); - this.emitIndent(); - this.declFile.Write(text[i]); - } - - if (comment.endsLine || comment.kind() !== 6 /* MultiLineCommentTrivia */) { - this.declFile.WriteLine(""); - } else { - this.declFile.Write(" "); - } - }; - - DeclarationEmitter.prototype.emitDeclarationComments = function (astOrSymbol, endLine) { - if (typeof endLine === "undefined") { endLine = true; } - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var declComments = astOrSymbol.docComments ? astOrSymbol.docComments() : TypeScript.ASTHelpers.docComments(astOrSymbol); - this.writeDeclarationComments(declComments, endLine); - }; - - DeclarationEmitter.prototype.writeDeclarationComments = function (declComments, endLine) { - if (typeof endLine === "undefined") { endLine = true; } - if (declComments.length > 0) { - for (var i = 0; i < declComments.length; i++) { - this.emitComment(declComments[i]); - } - - if (endLine) { - if (!this.declFile.onNewLine) { - this.declFile.WriteLine(""); - } - } else { - if (this.declFile.onNewLine) { - this.emitIndent(); - } - } - } - }; - - DeclarationEmitter.prototype.emitTypeOfVariableDeclaratorOrParameter = function (boundDecl) { - var start = new Date().getTime(); - var decl = this.semanticInfoChain.getDeclForAST(boundDecl); - var pullSymbol = decl.getSymbol(); - TypeScript.declarationEmitGetBoundDeclTypeTime += new Date().getTime() - start; - - var type = pullSymbol.type; - TypeScript.Debug.assert(type); - - this.declFile.Write(": "); - this.emitTypeSignature(boundDecl, type); - }; - - DeclarationEmitter.prototype.emitPropertySignature = function (varDecl) { - this.emitDeclarationComments(varDecl); - this.emitIndent(); - this.declFile.Write(varDecl.propertyName.text()); - if (varDecl.questionToken) { - this.declFile.Write("?"); - } - - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitVariableDeclarator = function (varDecl, isFirstVarInList, isLastVarInList) { - if (this.canEmitDeclarations(varDecl)) { - this.emitDeclarationComments(varDecl); - - if (isFirstVarInList) { - this.emitDeclFlags(varDecl, "var"); - } - - this.declFile.Write(varDecl.propertyName.text()); - - if (!TypeScript.hasModifier(TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - } - - if (isLastVarInList) { - this.declFile.WriteLine(";"); - } else { - this.declFile.Write(", "); - } - } - }; - - DeclarationEmitter.prototype.emitClassElementModifiers = function (modifiers) { - if (TypeScript.hasModifier(modifiers, 16 /* Static */)) { - if (TypeScript.hasModifier(modifiers, 2 /* Private */)) { - this.declFile.Write("private "); - } - this.declFile.Write("static "); - } else { - if (TypeScript.hasModifier(modifiers, 2 /* Private */)) { - this.declFile.Write("private "); - } else { - this.declFile.Write("public "); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForMemberVariableDeclaration = function (varDecl) { - if (this.canEmitDeclarations(varDecl)) { - this.emitDeclarationComments(varDecl); - - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(varDecl.modifiers); - ; - - this.declFile.Write(varDecl.variableDeclarator.propertyName.text()); - - if (!TypeScript.hasModifier(varDecl.modifiers, 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - } - - this.declFile.WriteLine(";"); - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForVariableStatement = function (variableStatement) { - this.emitDeclarationsForVariableDeclaration(variableStatement.declaration); - }; - - DeclarationEmitter.prototype.emitDeclarationsForVariableDeclaration = function (variableDeclaration) { - var varListCount = variableDeclaration.declarators.nonSeparatorCount(); - for (var i = 0; i < varListCount; i++) { - this.emitVariableDeclarator(variableDeclaration.declarators.nonSeparatorAt(i), i === 0, i === varListCount - 1); - } - }; - - DeclarationEmitter.prototype.emitArgDecl = function (argDecl, id, isOptional, isPrivate) { - this.indenter.increaseIndent(); - - this.emitDeclarationComments(argDecl, false); - this.declFile.Write(id.text()); - if (isOptional) { - this.declFile.Write("?"); - } - - this.indenter.decreaseIndent(); - - if (!isPrivate) { - this.emitTypeOfVariableDeclaratorOrParameter(argDecl); - } - }; - - DeclarationEmitter.prototype.isOverloadedCallSignature = function (funcDecl) { - var start = new Date().getTime(); - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSymbol = functionDecl.getSymbol(); - TypeScript.declarationEmitIsOverloadedCallSignatureTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - var signatures = funcTypeSymbol.getCallSignatures(); - var result = signatures && signatures.length > 1; - - return result; - }; - - DeclarationEmitter.prototype.emitDeclarationsForConstructorDeclaration = function (funcDecl) { - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - if (funcDecl.block) { - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } - } - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("constructor"); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitParameterList = function (isPrivate, parameterList) { - this.declFile.Write("("); - this.emitParameters(isPrivate, TypeScript.ASTHelpers.parametersFromParameterList(parameterList)); - this.declFile.Write(")"); - }; - - DeclarationEmitter.prototype.emitParameters = function (isPrivate, parameterList) { - var hasLastParameterRestParameter = parameterList.lastParameterIsRest(); - var argsLen = parameterList.length; - if (hasLastParameterRestParameter) { - argsLen--; - } - - for (var i = 0; i < argsLen; i++) { - this.emitArgDecl(parameterList.astAt(i), parameterList.identifierAt(i), parameterList.isOptionalAt(i), isPrivate); - if (i < (argsLen - 1)) { - this.declFile.Write(", "); - } - } - - if (hasLastParameterRestParameter) { - if (parameterList.length > 1) { - this.declFile.Write(", ..."); - } else { - this.declFile.Write("..."); - } - - var index = parameterList.length - 1; - this.emitArgDecl(parameterList.astAt(index), parameterList.identifierAt(index), parameterList.isOptionalAt(index), isPrivate); - } - }; - - DeclarationEmitter.prototype.emitMemberFunctionDeclaration = function (funcDecl) { - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - if (funcDecl.block) { - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } else if (this.isOverloadedCallSignature(funcDecl)) { - return; - } - } else if (TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */) && this.isOverloadedCallSignature(funcDecl)) { - var callSignatures = funcTypeSymbol.getCallSignatures(); - TypeScript.Debug.assert(callSignatures && callSignatures.length > 1); - var firstSignature = callSignatures[0].isDefinition() ? callSignatures[1] : callSignatures[0]; - var firstSignatureDecl = firstSignature.getDeclarations()[0]; - var firstFuncDecl = this.semanticInfoChain.getASTForDecl(firstSignatureDecl); - if (firstFuncDecl !== funcDecl) { - return; - } - } - - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitDeclarationComments(funcDecl); - - this.emitDeclFlags(funcDecl, "function"); - var id = funcDecl.propertyName.text(); - this.declFile.Write(id); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - var isPrivate = TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */); - - this.emitParameterList(isPrivate, funcDecl.callSignature.parameterList); - - if (!isPrivate) { - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - this.emitTypeSignature(funcDecl, returnType); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitCallSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - this.emitDeclarationComments(funcDecl); - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.typeParameterList, funcSignature); - - this.emitIndent(); - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitConstructSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("new"); - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitMethodSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write(funcDecl.propertyName.text()); - if (funcDecl.questionToken) { - this.declFile.Write("? "); - } - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForFunctionDeclaration = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - if (funcDecl.block) { - var funcTypeSymbol = funcSymbol.type; - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } else if (this.isOverloadedCallSignature(funcDecl)) { - return; - } - } - - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - this.emitDeclarationComments(funcDecl); - - var id = funcDecl.identifier.text(); - this.emitDeclFlags(funcDecl, "function"); - if (id !== "" || !funcDecl.identifier || funcDecl.identifier.text().length > 0) { - this.declFile.Write(id); - } else if (funcPullDecl.kind === 2097152 /* ConstructSignature */) { - this.declFile.Write("new"); - } - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitIndexMemberDeclaration = function (funcDecl) { - this.emitDeclarationsForAST(funcDecl.indexSignature); - }; - - DeclarationEmitter.prototype.emitIndexSignature = function (funcDecl) { - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("["); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameter(funcDecl.parameter)); - this.declFile.Write("]"); - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - this.emitTypeSignature(funcDecl, returnType); - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitBaseList = function (bases, useExtendsList) { - if (bases && (bases.nonSeparatorCount() > 0)) { - var qual = useExtendsList ? "extends" : "implements"; - this.declFile.Write(" " + qual + " "); - var basesLen = bases.nonSeparatorCount(); - for (var i = 0; i < basesLen; i++) { - if (i > 0) { - this.declFile.Write(", "); - } - var base = bases.nonSeparatorAt(i); - var baseType = this.semanticInfoChain.getSymbolForAST(base); - this.emitTypeSignature(base, baseType); - } - } - }; - - DeclarationEmitter.prototype.emitAccessorDeclarationComments = function (funcDecl) { - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var start = new Date().getTime(); - var accessors = TypeScript.PullHelpers.getGetterAndSetterFunction(funcDecl, this.semanticInfoChain); - TypeScript.declarationEmitGetAccessorFunctionTime += new Date().getTime(); - - var comments = []; - if (accessors.getter) { - comments = comments.concat(TypeScript.ASTHelpers.docComments(accessors.getter)); - } - if (accessors.setter) { - comments = comments.concat(TypeScript.ASTHelpers.docComments(accessors.setter)); - } - - this.writeDeclarationComments(comments); - }; - - DeclarationEmitter.prototype.emitDeclarationsForGetAccessor = function (funcDecl) { - this.emitMemberAccessorDeclaration(funcDecl, funcDecl.modifiers, funcDecl.propertyName); - }; - - DeclarationEmitter.prototype.emitDeclarationsForSetAccessor = function (funcDecl) { - this.emitMemberAccessorDeclaration(funcDecl, funcDecl.modifiers, funcDecl.propertyName); - }; - - DeclarationEmitter.prototype.emitMemberAccessorDeclaration = function (funcDecl, modifiers, name) { - var start = new Date().getTime(); - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(funcDecl, this.semanticInfoChain); - TypeScript.declarationEmitGetAccessorFunctionTime += new Date().getTime(); - - if (funcDecl.kind() === 140 /* SetAccessor */ && accessorSymbol.getGetter()) { - return; - } - - var isPrivate = TypeScript.hasModifier(modifiers, 2 /* Private */); - this.emitAccessorDeclarationComments(funcDecl); - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(modifiers); - this.declFile.Write(name.text()); - if (!isPrivate) { - this.declFile.Write(" : "); - var type = accessorSymbol.type; - this.emitTypeSignature(funcDecl, type); - } - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitClassMembersFromConstructorDefinition = function (funcDecl) { - var argsLen = funcDecl.callSignature.parameterList.parameters.nonSeparatorCount(); - if (TypeScript.lastParameterIsRest(funcDecl.callSignature.parameterList)) { - argsLen--; - } - - for (var i = 0; i < argsLen; i++) { - var parameter = funcDecl.callSignature.parameterList.parameters.nonSeparatorAt(i); - var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); - if (TypeScript.hasFlag(parameterDecl.flags, 8388608 /* PropertyParameter */)) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.emitDeclarationComments(parameter); - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(parameter.modifiers); - this.declFile.Write(parameter.identifier.text()); - - if (!TypeScript.hasModifier(parameter.modifiers, 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(parameter); - } - this.declFile.WriteLine(";"); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForClassDeclaration = function (classDecl) { - if (!this.canEmitDeclarations(classDecl)) { - return; - } - - var className = classDecl.identifier.text(); - this.emitDeclarationComments(classDecl); - var classPullDecl = this.semanticInfoChain.getDeclForAST(classDecl); - this.emitDeclFlags(classDecl, "class"); - this.declFile.Write(className); - - this.emitTypeParameters(classDecl.typeParameterList); - this.emitHeritageClauses(classDecl.heritageClauses); - this.declFile.WriteLine(" {"); - - this.indenter.increaseIndent(); - var constructorDecl = TypeScript.getLastConstructor(classDecl); - if (constructorDecl) { - this.emitClassMembersFromConstructorDefinition(constructorDecl); - } - - this.emitDeclarationsForList(classDecl.classElements); - - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitHeritageClauses = function (clauses) { - if (clauses) { - for (var i = 0, n = clauses.childCount(); i < n; i++) { - this.emitHeritageClause(clauses.childAt(i)); - } - } - }; - - DeclarationEmitter.prototype.emitHeritageClause = function (clause) { - this.emitBaseList(clause.typeNames, clause.kind() === 230 /* ExtendsHeritageClause */); - }; - - DeclarationEmitter.prototype.getEnclosingContainer = function (ast) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 131 /* ClassDeclaration */ || ast.kind() === 128 /* InterfaceDeclaration */ || ast.kind() === 130 /* ModuleDeclaration */ || ast.kind() === 120 /* SourceUnit */) { - return ast; - } - - ast = ast.parent; - } - - return null; - }; - - DeclarationEmitter.prototype.emitTypeParameters = function (typeParams, funcSignature) { - if (!typeParams || !typeParams.typeParameters.nonSeparatorCount()) { - return; - } - - this.declFile.Write("<"); - var containerAst = this.getEnclosingContainer(typeParams); - - var start = new Date().getTime(); - var containerDecl = this.semanticInfoChain.getDeclForAST(containerAst); - var containerSymbol = containerDecl.getSymbol(); - TypeScript.declarationEmitGetTypeParameterSymbolTime += new Date().getTime() - start; - - var typars; - if (funcSignature) { - typars = funcSignature.getTypeParameters(); - } else { - typars = containerSymbol.getTypeArgumentsOrTypeParameters(); - } - - for (var i = 0; i < typars.length; i++) { - if (i) { - this.declFile.Write(", "); - } - - var memberName = typars[i].getScopedNameEx(containerSymbol, false, true); - this.emitTypeNamesMember(memberName); - } - - this.declFile.Write(">"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForInterfaceDeclaration = function (interfaceDecl) { - if (!this.canEmitDeclarations(interfaceDecl)) { - return; - } - - var interfaceName = interfaceDecl.identifier.text(); - this.emitDeclarationComments(interfaceDecl); - var interfacePullDecl = this.semanticInfoChain.getDeclForAST(interfaceDecl); - this.emitDeclFlags(interfaceDecl, "interface"); - this.declFile.Write(interfaceName); - - this.emitTypeParameters(interfaceDecl.typeParameterList); - this.emitHeritageClauses(interfaceDecl.heritageClauses); - this.declFile.WriteLine(" {"); - - this.indenter.increaseIndent(); - - this.emitSeparatedList(interfaceDecl.body.typeMembers); - - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForImportDeclaration = function (importDeclAST) { - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var importSymbol = importDecl.getSymbol(); - var isExportedImportDecl = TypeScript.hasModifier(importDeclAST.modifiers, 1 /* Exported */); - - if (isExportedImportDecl || importSymbol.typeUsedExternally() || TypeScript.PullContainerSymbol.usedAsSymbol(importSymbol.getContainer(), importSymbol)) { - this.emitDeclarationComments(importDeclAST); - this.emitIndent(); - if (isExportedImportDecl) { - this.declFile.Write("export "); - } - this.declFile.Write("import "); - this.declFile.Write(importDeclAST.identifier.text() + " = "); - if (importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - this.declFile.WriteLine("require(" + importDeclAST.moduleReference.stringLiteral.text() + ");"); - } else { - this.declFile.WriteLine(TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(importDeclAST.moduleReference.moduleName) + ";"); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForEnumDeclaration = function (moduleDecl) { - if (!this.canEmitDeclarations(moduleDecl)) { - return; - } - - this.emitDeclarationComments(moduleDecl); - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.emitDeclFlags(moduleDecl, "enum"); - this.declFile.WriteLine(moduleDecl.identifier.text() + " {"); - - this.indenter.increaseIndent(); - var membersLen = moduleDecl.enumElements.nonSeparatorCount(); - for (var j = 0; j < membersLen; j++) { - var memberDecl = moduleDecl.enumElements.nonSeparatorAt(j); - var enumElement = memberDecl; - var enumElementDecl = this.semanticInfoChain.getDeclForAST(enumElement); - this.emitDeclarationComments(enumElement); - this.emitIndent(); - this.declFile.Write(enumElement.propertyName.text()); - if (enumElementDecl.constantValue !== null) { - this.declFile.Write(" = " + enumElementDecl.constantValue); - } - this.declFile.WriteLine(","); - } - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForModuleDeclaration = function (moduleDecl) { - if (!this.canEmitDeclarations(moduleDecl)) { - return; - } - - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.emitDeclarationComments(moduleDecl); - - var name = moduleDecl.stringLiteral || TypeScript.ArrayUtilities.first(TypeScript.getModuleNames(moduleDecl.name)); - this.emitDeclFlags(name, "module"); - - if (moduleDecl.stringLiteral) { - this.declFile.Write(moduleDecl.stringLiteral.text()); - } else { - this.declFile.Write(TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(moduleDecl.name)); - } - - this.declFile.WriteLine(" {"); - this.indenter.increaseIndent(); - - this.emitDeclarationsForList(moduleDecl.moduleElements); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForExportAssignment = function (ast) { - this.emitIndent(); - this.declFile.Write("export = "); - this.declFile.Write(ast.identifier.text()); - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.resolveScriptReference = function (document, reference) { - if (!this.emitOptions.compilationSettings().noResolve() || TypeScript.isRooted(reference)) { - return reference; - } - - var documentDir = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(TypeScript.getRootFilePath(document.fileName))); - var resolvedReferencePath = this.emitOptions.resolvePath(documentDir + reference); - return resolvedReferencePath; - }; - - DeclarationEmitter.prototype.emitReferencePaths = function (sourceUnit) { - if (this.emittedReferencePaths) { - return; - } - - var documents = []; - if (this.document.emitToOwnOutputFile()) { - var scriptReferences = this.document.referencedFiles; - var addedGlobalDocument = false; - for (var j = 0; j < scriptReferences.length; j++) { - var currentReference = this.resolveScriptReference(this.document, scriptReferences[j]); - var document = this.compiler.getDocument(currentReference); - - if (document && (document.emitToOwnOutputFile() || document.isDeclareFile() || !addedGlobalDocument)) { - documents = documents.concat(document); - - if (!document.isDeclareFile() && document.isExternalModule()) { - addedGlobalDocument = true; - } - } - } - } else { - var fileNames = this.compiler.fileNames(); - for (var i = 0; i < fileNames.length; i++) { - var doc = this.compiler.getDocument(fileNames[i]); - if (!doc.isDeclareFile() && !doc.isExternalModule()) { - var scriptReferences = doc.referencedFiles; - for (var j = 0; j < scriptReferences.length; j++) { - var currentReference = this.resolveScriptReference(doc, scriptReferences[j]); - var document = this.compiler.getDocument(currentReference); - - if (document && (document.isDeclareFile() || document.isExternalModule())) { - for (var k = 0; k < documents.length; k++) { - if (documents[k] === document) { - break; - } - } - - if (k === documents.length) { - documents = documents.concat(document); - } - } - } - } - } - } - - var emittingFilePath = documents.length ? TypeScript.getRootFilePath(this.emittingFileName) : null; - for (var i = 0; i < documents.length; i++) { - var document = documents[i]; - var declFileName; - if (document.isDeclareFile()) { - declFileName = document.fileName; - } else { - declFileName = this.compiler.mapOutputFileName(document, this.emitOptions, TypeScript.TypeScriptCompiler.mapToDTSFileName); - } - - declFileName = TypeScript.getRelativePathToFixedPath(emittingFilePath, declFileName, false); - this.declFile.WriteLine('/// '); - } - - this.emittedReferencePaths = true; - }; - - DeclarationEmitter.prototype.emitDeclarationsForSourceUnit = function (sourceUnit) { - this.emitReferencePaths(sourceUnit); - this.emitDeclarationsForList(sourceUnit.moduleElements); - }; - return DeclarationEmitter; - })(); - TypeScript.DeclarationEmitter = DeclarationEmitter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var BloomFilter = (function () { - function BloomFilter(expectedCount) { - var m = Math.max(1, BloomFilter.computeM(expectedCount)); - var k = Math.max(1, BloomFilter.computeK(expectedCount)); - ; - - var sizeInEvenBytes = (m + 7) & ~7; - - this.bitArray = []; - for (var i = 0, len = sizeInEvenBytes; i < len; i++) { - this.bitArray[i] = false; - } - this.hashFunctionCount = k; - } - BloomFilter.computeM = function (expectedCount) { - var p = BloomFilter.falsePositiveProbability; - var n = expectedCount; - - var numerator = n * Math.log(p); - var denominator = Math.log(1.0 / Math.pow(2.0, Math.log(2.0))); - return Math.ceil(numerator / denominator); - }; - - BloomFilter.computeK = function (expectedCount) { - var n = expectedCount; - var m = BloomFilter.computeM(expectedCount); - - var temp = Math.log(2.0) * m / n; - return Math.round(temp); - }; - - BloomFilter.prototype.computeHash = function (key, seed) { - return TypeScript.Hash.computeMurmur2StringHashCode(key, seed); - }; - - BloomFilter.prototype.addKeys = function (keys) { - for (var name in keys) { - if (keys[name]) { - this.add(name); - } - } - }; - - BloomFilter.prototype.add = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - this.bitArray[Math.abs(hash)] = true; - } - }; - - BloomFilter.prototype.probablyContains = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - if (!this.bitArray[Math.abs(hash)]) { - return false; - } - } - - return true; - }; - - BloomFilter.prototype.isEquivalent = function (filter) { - return BloomFilter.isEquivalent(this.bitArray, filter.bitArray) && this.hashFunctionCount === filter.hashFunctionCount; - }; - - BloomFilter.isEquivalent = function (array1, array2) { - if (array1.length !== array2.length) { - return false; - } - - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - - return true; - }; - BloomFilter.falsePositiveProbability = 0.0001; - return BloomFilter; - })(); - TypeScript.BloomFilter = BloomFilter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IdentifierWalker = (function (_super) { - __extends(IdentifierWalker, _super); - function IdentifierWalker(list) { - _super.call(this); - this.list = list; - } - IdentifierWalker.prototype.visitToken = function (token) { - this.list[token.text()] = true; - }; - return IdentifierWalker; - })(TypeScript.SyntaxWalker); - TypeScript.IdentifierWalker = IdentifierWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CompilationSettings = (function () { - function CompilationSettings() { - this.propagateEnumConstants = false; - this.removeComments = false; - this.watch = false; - this.noResolve = false; - this.allowAutomaticSemicolonInsertion = true; - this.noImplicitAny = false; - this.noLib = false; - this.codeGenTarget = 0 /* EcmaScript3 */; - this.moduleGenTarget = 0 /* Unspecified */; - this.outFileOption = ""; - this.outDirOption = ""; - this.mapSourceFiles = false; - this.mapRoot = ""; - this.sourceRoot = ""; - this.generateDeclarationFiles = false; - this.useCaseSensitiveFileResolution = false; - this.gatherDiagnostics = false; - this.codepage = null; - this.createFileLog = false; - } - return CompilationSettings; - })(); - TypeScript.CompilationSettings = CompilationSettings; - - var ImmutableCompilationSettings = (function () { - function ImmutableCompilationSettings(propagateEnumConstants, removeComments, watch, noResolve, allowAutomaticSemicolonInsertion, noImplicitAny, noLib, codeGenTarget, moduleGenTarget, outFileOption, outDirOption, mapSourceFiles, mapRoot, sourceRoot, generateDeclarationFiles, useCaseSensitiveFileResolution, gatherDiagnostics, codepage, createFileLog) { - this._propagateEnumConstants = propagateEnumConstants; - this._removeComments = removeComments; - this._watch = watch; - this._noResolve = noResolve; - this._allowAutomaticSemicolonInsertion = allowAutomaticSemicolonInsertion; - this._noImplicitAny = noImplicitAny; - this._noLib = noLib; - this._codeGenTarget = codeGenTarget; - this._moduleGenTarget = moduleGenTarget; - this._outFileOption = outFileOption; - this._outDirOption = outDirOption; - this._mapSourceFiles = mapSourceFiles; - this._mapRoot = mapRoot; - this._sourceRoot = sourceRoot; - this._generateDeclarationFiles = generateDeclarationFiles; - this._useCaseSensitiveFileResolution = useCaseSensitiveFileResolution; - this._gatherDiagnostics = gatherDiagnostics; - this._codepage = codepage; - this._createFileLog = createFileLog; - } - ImmutableCompilationSettings.prototype.propagateEnumConstants = function () { - return this._propagateEnumConstants; - }; - ImmutableCompilationSettings.prototype.removeComments = function () { - return this._removeComments; - }; - ImmutableCompilationSettings.prototype.watch = function () { - return this._watch; - }; - ImmutableCompilationSettings.prototype.noResolve = function () { - return this._noResolve; - }; - ImmutableCompilationSettings.prototype.allowAutomaticSemicolonInsertion = function () { - return this._allowAutomaticSemicolonInsertion; - }; - ImmutableCompilationSettings.prototype.noImplicitAny = function () { - return this._noImplicitAny; - }; - ImmutableCompilationSettings.prototype.noLib = function () { - return this._noLib; - }; - ImmutableCompilationSettings.prototype.codeGenTarget = function () { - return this._codeGenTarget; - }; - ImmutableCompilationSettings.prototype.moduleGenTarget = function () { - return this._moduleGenTarget; - }; - ImmutableCompilationSettings.prototype.outFileOption = function () { - return this._outFileOption; - }; - ImmutableCompilationSettings.prototype.outDirOption = function () { - return this._outDirOption; - }; - ImmutableCompilationSettings.prototype.mapSourceFiles = function () { - return this._mapSourceFiles; - }; - ImmutableCompilationSettings.prototype.mapRoot = function () { - return this._mapRoot; - }; - ImmutableCompilationSettings.prototype.sourceRoot = function () { - return this._sourceRoot; - }; - ImmutableCompilationSettings.prototype.generateDeclarationFiles = function () { - return this._generateDeclarationFiles; - }; - ImmutableCompilationSettings.prototype.useCaseSensitiveFileResolution = function () { - return this._useCaseSensitiveFileResolution; - }; - ImmutableCompilationSettings.prototype.gatherDiagnostics = function () { - return this._gatherDiagnostics; - }; - ImmutableCompilationSettings.prototype.codepage = function () { - return this._codepage; - }; - ImmutableCompilationSettings.prototype.createFileLog = function () { - return this._createFileLog; - }; - - ImmutableCompilationSettings.defaultSettings = function () { - if (!ImmutableCompilationSettings._defaultSettings) { - ImmutableCompilationSettings._defaultSettings = ImmutableCompilationSettings.fromCompilationSettings(new CompilationSettings()); - } - - return ImmutableCompilationSettings._defaultSettings; - }; - - ImmutableCompilationSettings.fromCompilationSettings = function (settings) { - return new ImmutableCompilationSettings(settings.propagateEnumConstants, settings.removeComments, settings.watch, settings.noResolve, settings.allowAutomaticSemicolonInsertion, settings.noImplicitAny, settings.noLib, settings.codeGenTarget, settings.moduleGenTarget, settings.outFileOption, settings.outDirOption, settings.mapSourceFiles, settings.mapRoot, settings.sourceRoot, settings.generateDeclarationFiles, settings.useCaseSensitiveFileResolution, settings.gatherDiagnostics, settings.codepage, settings.createFileLog); - }; - - ImmutableCompilationSettings.prototype.toCompilationSettings = function () { - var result = new CompilationSettings(); - - var thisAsIndexable = this; - var resultAsIndexable = result; - for (var name in this) { - if (this.hasOwnProperty(name) && TypeScript.StringUtilities.startsWith(name, "_")) { - resultAsIndexable[name.substr(1)] = thisAsIndexable[name]; - } - } - - return result; - }; - return ImmutableCompilationSettings; - })(); - TypeScript.ImmutableCompilationSettings = ImmutableCompilationSettings; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (PullElementFlags) { - PullElementFlags[PullElementFlags["None"] = 0] = "None"; - PullElementFlags[PullElementFlags["Exported"] = 1] = "Exported"; - PullElementFlags[PullElementFlags["Private"] = 1 << 1] = "Private"; - PullElementFlags[PullElementFlags["Public"] = 1 << 2] = "Public"; - PullElementFlags[PullElementFlags["Ambient"] = 1 << 3] = "Ambient"; - PullElementFlags[PullElementFlags["Static"] = 1 << 4] = "Static"; - PullElementFlags[PullElementFlags["Optional"] = 1 << 7] = "Optional"; - PullElementFlags[PullElementFlags["Signature"] = 1 << 11] = "Signature"; - PullElementFlags[PullElementFlags["Enum"] = 1 << 12] = "Enum"; - PullElementFlags[PullElementFlags["ArrowFunction"] = 1 << 13] = "ArrowFunction"; - - PullElementFlags[PullElementFlags["ClassConstructorVariable"] = 1 << 14] = "ClassConstructorVariable"; - PullElementFlags[PullElementFlags["InitializedModule"] = 1 << 15] = "InitializedModule"; - PullElementFlags[PullElementFlags["InitializedDynamicModule"] = 1 << 16] = "InitializedDynamicModule"; - - PullElementFlags[PullElementFlags["MustCaptureThis"] = 1 << 18] = "MustCaptureThis"; - - PullElementFlags[PullElementFlags["DeclaredInAWithBlock"] = 1 << 21] = "DeclaredInAWithBlock"; - - PullElementFlags[PullElementFlags["HasReturnStatement"] = 1 << 22] = "HasReturnStatement"; - - PullElementFlags[PullElementFlags["PropertyParameter"] = 1 << 23] = "PropertyParameter"; - - PullElementFlags[PullElementFlags["IsAnnotatedWithAny"] = 1 << 24] = "IsAnnotatedWithAny"; - - PullElementFlags[PullElementFlags["HasDefaultArgs"] = 1 << 25] = "HasDefaultArgs"; - - PullElementFlags[PullElementFlags["ConstructorParameter"] = 1 << 26] = "ConstructorParameter"; - - PullElementFlags[PullElementFlags["ImplicitVariable"] = PullElementFlags.ClassConstructorVariable | PullElementFlags.InitializedModule | PullElementFlags.InitializedDynamicModule | PullElementFlags.Enum] = "ImplicitVariable"; - PullElementFlags[PullElementFlags["SomeInitializedModule"] = PullElementFlags.InitializedModule | PullElementFlags.InitializedDynamicModule | PullElementFlags.Enum] = "SomeInitializedModule"; - })(TypeScript.PullElementFlags || (TypeScript.PullElementFlags = {})); - var PullElementFlags = TypeScript.PullElementFlags; - - function hasModifier(modifiers, flag) { - for (var i = 0, n = modifiers.length; i < n; i++) { - if (TypeScript.hasFlag(modifiers[i], flag)) { - return true; - } - } - - return false; - } - TypeScript.hasModifier = hasModifier; - - (function (PullElementKind) { - PullElementKind[PullElementKind["None"] = 0] = "None"; - PullElementKind[PullElementKind["Global"] = 0] = "Global"; - - PullElementKind[PullElementKind["Script"] = 1 << 0] = "Script"; - PullElementKind[PullElementKind["Primitive"] = 1 << 1] = "Primitive"; - - PullElementKind[PullElementKind["Container"] = 1 << 2] = "Container"; - PullElementKind[PullElementKind["Class"] = 1 << 3] = "Class"; - PullElementKind[PullElementKind["Interface"] = 1 << 4] = "Interface"; - PullElementKind[PullElementKind["DynamicModule"] = 1 << 5] = "DynamicModule"; - PullElementKind[PullElementKind["Enum"] = 1 << 6] = "Enum"; - PullElementKind[PullElementKind["TypeAlias"] = 1 << 7] = "TypeAlias"; - PullElementKind[PullElementKind["ObjectLiteral"] = 1 << 8] = "ObjectLiteral"; - - PullElementKind[PullElementKind["Variable"] = 1 << 9] = "Variable"; - PullElementKind[PullElementKind["CatchVariable"] = 1 << 10] = "CatchVariable"; - PullElementKind[PullElementKind["Parameter"] = 1 << 11] = "Parameter"; - PullElementKind[PullElementKind["Property"] = 1 << 12] = "Property"; - PullElementKind[PullElementKind["TypeParameter"] = 1 << 13] = "TypeParameter"; - - PullElementKind[PullElementKind["Function"] = 1 << 14] = "Function"; - PullElementKind[PullElementKind["ConstructorMethod"] = 1 << 15] = "ConstructorMethod"; - PullElementKind[PullElementKind["Method"] = 1 << 16] = "Method"; - PullElementKind[PullElementKind["FunctionExpression"] = 1 << 17] = "FunctionExpression"; - - PullElementKind[PullElementKind["GetAccessor"] = 1 << 18] = "GetAccessor"; - PullElementKind[PullElementKind["SetAccessor"] = 1 << 19] = "SetAccessor"; - - PullElementKind[PullElementKind["CallSignature"] = 1 << 20] = "CallSignature"; - PullElementKind[PullElementKind["ConstructSignature"] = 1 << 21] = "ConstructSignature"; - PullElementKind[PullElementKind["IndexSignature"] = 1 << 22] = "IndexSignature"; - - PullElementKind[PullElementKind["ObjectType"] = 1 << 23] = "ObjectType"; - PullElementKind[PullElementKind["FunctionType"] = 1 << 24] = "FunctionType"; - PullElementKind[PullElementKind["ConstructorType"] = 1 << 25] = "ConstructorType"; - - PullElementKind[PullElementKind["EnumMember"] = 1 << 26] = "EnumMember"; - - PullElementKind[PullElementKind["WithBlock"] = 1 << 27] = "WithBlock"; - PullElementKind[PullElementKind["CatchBlock"] = 1 << 28] = "CatchBlock"; - - PullElementKind[PullElementKind["All"] = PullElementKind.Script | PullElementKind.Global | PullElementKind.Primitive | PullElementKind.Container | PullElementKind.Class | PullElementKind.Interface | PullElementKind.DynamicModule | PullElementKind.Enum | PullElementKind.TypeAlias | PullElementKind.ObjectLiteral | PullElementKind.Variable | PullElementKind.Parameter | PullElementKind.Property | PullElementKind.TypeParameter | PullElementKind.Function | PullElementKind.ConstructorMethod | PullElementKind.Method | PullElementKind.FunctionExpression | PullElementKind.GetAccessor | PullElementKind.SetAccessor | PullElementKind.CallSignature | PullElementKind.ConstructSignature | PullElementKind.IndexSignature | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType | PullElementKind.EnumMember | PullElementKind.WithBlock | PullElementKind.CatchBlock] = "All"; - - PullElementKind[PullElementKind["SomeFunction"] = PullElementKind.Function | PullElementKind.ConstructorMethod | PullElementKind.Method | PullElementKind.FunctionExpression | PullElementKind.GetAccessor | PullElementKind.SetAccessor] = "SomeFunction"; - - PullElementKind[PullElementKind["SomeValue"] = PullElementKind.Variable | PullElementKind.Parameter | PullElementKind.Property | PullElementKind.EnumMember | PullElementKind.SomeFunction] = "SomeValue"; - - PullElementKind[PullElementKind["SomeType"] = PullElementKind.Script | PullElementKind.Global | PullElementKind.Primitive | PullElementKind.Class | PullElementKind.Interface | PullElementKind.Enum | PullElementKind.ObjectLiteral | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType | PullElementKind.TypeParameter] = "SomeType"; - - PullElementKind[PullElementKind["AcceptableAlias"] = PullElementKind.Variable | PullElementKind.SomeFunction | PullElementKind.Class | PullElementKind.Interface | PullElementKind.Enum | PullElementKind.Container | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType] = "AcceptableAlias"; - - PullElementKind[PullElementKind["SomeContainer"] = PullElementKind.Container | PullElementKind.DynamicModule | PullElementKind.TypeAlias] = "SomeContainer"; - - PullElementKind[PullElementKind["SomeSignature"] = PullElementKind.CallSignature | PullElementKind.ConstructSignature | PullElementKind.IndexSignature] = "SomeSignature"; - - PullElementKind[PullElementKind["SomeTypeReference"] = PullElementKind.Interface | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType] = "SomeTypeReference"; - - PullElementKind[PullElementKind["SomeInstantiatableType"] = PullElementKind.Class | PullElementKind.Interface | PullElementKind.TypeParameter] = "SomeInstantiatableType"; - })(TypeScript.PullElementKind || (TypeScript.PullElementKind = {})); - var PullElementKind = TypeScript.PullElementKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var pullDeclID = 0; - var sentinelEmptyPullDeclArray = []; - - var PullDecl = (function () { - function PullDecl(declName, displayName, kind, declFlags, semanticInfoChain) { - this.declID = pullDeclID++; - this.flags = 0 /* None */; - this.declGroups = null; - this.childDecls = null; - this.typeParameters = null; - this.synthesizedValDecl = null; - this.containerDecl = null; - this.childDeclTypeCache = null; - this.childDeclValueCache = null; - this.childDeclNamespaceCache = null; - this.childDeclTypeParameterCache = null; - this.name = declName; - this.kind = kind; - this.flags = declFlags; - this.semanticInfoChain = semanticInfoChain; - - if (displayName !== this.name) { - this.declDisplayName = displayName; - } - } - PullDecl.prototype.fileName = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getParentPath = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getParentDecl = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.isExternalModule = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getEnclosingDecl = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype._getEnclosingDeclFromParentDecl = function () { - var decl = this; - while (decl) { - switch (decl.kind) { - default: - return decl; - case 512 /* Variable */: - case 8192 /* TypeParameter */: - case 2048 /* Parameter */: - case 128 /* TypeAlias */: - case 67108864 /* EnumMember */: - } - - decl = decl.getParentDecl(); - } - - TypeScript.Debug.fail(); - }; - - PullDecl.prototype.getDisplayName = function () { - return this.declDisplayName === undefined ? this.name : this.declDisplayName; - }; - - PullDecl.prototype.setSymbol = function (symbol) { - this.semanticInfoChain.setSymbolForDecl(this, symbol); - }; - - PullDecl.prototype.ensureSymbolIsBound = function () { - if (!this.hasBeenBound() && this.kind !== 1 /* Script */) { - var binder = this.semanticInfoChain.getBinder(); - binder.bindDeclToPullSymbol(this); - } - }; - - PullDecl.prototype.getSymbol = function () { - if (this.kind === 1 /* Script */) { - return null; - } - - this.ensureSymbolIsBound(); - - return this.semanticInfoChain.getSymbolForDecl(this); - }; - - PullDecl.prototype.hasSymbol = function () { - var symbol = this.semanticInfoChain.getSymbolForDecl(this); - return !!symbol; - }; - - PullDecl.prototype.setSignatureSymbol = function (signatureSymbol) { - this.semanticInfoChain.setSignatureSymbolForDecl(this, signatureSymbol); - }; - - PullDecl.prototype.getSignatureSymbol = function () { - this.ensureSymbolIsBound(); - return this.semanticInfoChain.getSignatureSymbolForDecl(this); - }; - - PullDecl.prototype.hasSignatureSymbol = function () { - var signatureSymbol = this.semanticInfoChain.getSignatureSymbolForDecl(this); - return !!signatureSymbol; - }; - - PullDecl.prototype.setFlags = function (flags) { - this.flags = flags; - }; - - PullDecl.prototype.setFlag = function (flags) { - this.flags |= flags; - }; - - PullDecl.prototype.setValueDecl = function (valDecl) { - this.synthesizedValDecl = valDecl; - valDecl.containerDecl = this; - }; - - PullDecl.prototype.getValueDecl = function () { - return this.synthesizedValDecl; - }; - - PullDecl.prototype.getContainerDecl = function () { - return this.containerDecl; - }; - - PullDecl.prototype.getChildDeclCache = function (declKind) { - if (declKind === 8192 /* TypeParameter */) { - if (!this.childDeclTypeParameterCache) { - this.childDeclTypeParameterCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclTypeParameterCache; - } else if (TypeScript.hasFlag(declKind, 164 /* SomeContainer */)) { - if (!this.childDeclNamespaceCache) { - this.childDeclNamespaceCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclNamespaceCache; - } else if (TypeScript.hasFlag(declKind, 58728795 /* SomeType */)) { - if (!this.childDeclTypeCache) { - this.childDeclTypeCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclTypeCache; - } else { - if (!this.childDeclValueCache) { - this.childDeclValueCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclValueCache; - } - }; - - PullDecl.prototype.addChildDecl = function (childDecl) { - if (childDecl.kind === 8192 /* TypeParameter */) { - if (!this.typeParameters) { - this.typeParameters = []; - } - this.typeParameters[this.typeParameters.length] = childDecl; - } else { - if (!this.childDecls) { - this.childDecls = []; - } - this.childDecls[this.childDecls.length] = childDecl; - } - - var declName = childDecl.name; - - if (!(childDecl.kind & 7340032 /* SomeSignature */)) { - var cache = this.getChildDeclCache(childDecl.kind); - var childrenOfName = cache[declName]; - if (!childrenOfName) { - childrenOfName = []; - } - - childrenOfName.push(childDecl); - cache[declName] = childrenOfName; - } - }; - - PullDecl.prototype.searchChildDecls = function (declName, searchKind) { - var cacheVal = null; - - if (searchKind & 58728795 /* SomeType */) { - cacheVal = this.childDeclTypeCache ? this.childDeclTypeCache[declName] : null; - } else if (searchKind & 164 /* SomeContainer */) { - cacheVal = this.childDeclNamespaceCache ? this.childDeclNamespaceCache[declName] : null; - } else { - cacheVal = this.childDeclValueCache ? this.childDeclValueCache[declName] : null; - } - - if (cacheVal) { - return cacheVal; - } else { - if (searchKind & 58728795 /* SomeType */) { - cacheVal = this.childDeclTypeParameterCache ? this.childDeclTypeParameterCache[declName] : null; - - if (cacheVal) { - return cacheVal; - } - } - - return sentinelEmptyPullDeclArray; - } - }; - - PullDecl.prototype.getChildDecls = function () { - return this.childDecls || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.getTypeParameters = function () { - return this.typeParameters || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.addVariableDeclToGroup = function (decl) { - if (!this.declGroups) { - this.declGroups = TypeScript.createIntrinsicsObject(); - } - - var declGroup = this.declGroups[decl.name]; - if (declGroup) { - declGroup.addDecl(decl); - } else { - declGroup = new PullDeclGroup(decl.name); - declGroup.addDecl(decl); - this.declGroups[decl.name] = declGroup; - } - }; - - PullDecl.prototype.getVariableDeclGroups = function () { - var declGroups = null; - - if (this.declGroups) { - for (var declName in this.declGroups) { - if (this.declGroups[declName]) { - if (declGroups === null) { - declGroups = []; - } - - declGroups.push(this.declGroups[declName].getDecls()); - } - } - } - - return declGroups || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.hasBeenBound = function () { - return this.hasSymbol() || this.hasSignatureSymbol(); - }; - - PullDecl.prototype.isSynthesized = function () { - return false; - }; - - PullDecl.prototype.ast = function () { - return this.semanticInfoChain.getASTForDecl(this); - }; - - PullDecl.prototype.isRootDecl = function () { - throw TypeScript.Errors.abstract(); - }; - return PullDecl; - })(); - TypeScript.PullDecl = PullDecl; - - var RootPullDecl = (function (_super) { - __extends(RootPullDecl, _super); - function RootPullDecl(name, fileName, kind, declFlags, semanticInfoChain, isExternalModule) { - _super.call(this, name, name, kind, declFlags, semanticInfoChain); - this.semanticInfoChain = semanticInfoChain; - this._isExternalModule = isExternalModule; - this._fileName = fileName; - } - RootPullDecl.prototype.fileName = function () { - return this._fileName; - }; - - RootPullDecl.prototype.getParentPath = function () { - return [this]; - }; - - RootPullDecl.prototype.getParentDecl = function () { - return null; - }; - - RootPullDecl.prototype.isExternalModule = function () { - return this._isExternalModule; - }; - - RootPullDecl.prototype.getEnclosingDecl = function () { - return this; - }; - RootPullDecl.prototype.isRootDecl = function () { - return true; - }; - return RootPullDecl; - })(PullDecl); - TypeScript.RootPullDecl = RootPullDecl; - - var NormalPullDecl = (function (_super) { - __extends(NormalPullDecl, _super); - function NormalPullDecl(declName, displayName, kind, declFlags, parentDecl, addToParent) { - if (typeof addToParent === "undefined") { addToParent = true; } - _super.call(this, declName, displayName, kind, declFlags, parentDecl ? parentDecl.semanticInfoChain : null); - this.parentDecl = null; - this.parentPath = null; - - this.parentDecl = parentDecl; - if (addToParent) { - parentDecl.addChildDecl(this); - } - - if (this.parentDecl) { - if (this.parentDecl.isRootDecl()) { - this._rootDecl = this.parentDecl; - } else { - this._rootDecl = this.parentDecl._rootDecl; - } - } else { - TypeScript.Debug.assert(this.isSynthesized()); - this._rootDecl = null; - } - } - NormalPullDecl.prototype.fileName = function () { - return this._rootDecl.fileName(); - }; - - NormalPullDecl.prototype.getParentDecl = function () { - return this.parentDecl; - }; - - NormalPullDecl.prototype.getParentPath = function () { - if (!this.parentPath) { - var path = [this]; - var parentDecl = this.parentDecl; - - while (parentDecl) { - if (parentDecl && path[path.length - 1] !== parentDecl && !(parentDecl.kind & (256 /* ObjectLiteral */ | 8388608 /* ObjectType */))) { - path.unshift(parentDecl); - } - - parentDecl = parentDecl.getParentDecl(); - } - - this.parentPath = path; - } - - return this.parentPath; - }; - - NormalPullDecl.prototype.isExternalModule = function () { - return false; - }; - - NormalPullDecl.prototype.getEnclosingDecl = function () { - return this.parentDecl && this.parentDecl._getEnclosingDeclFromParentDecl(); - }; - - NormalPullDecl.prototype.isRootDecl = function () { - return false; - }; - return NormalPullDecl; - })(PullDecl); - TypeScript.NormalPullDecl = NormalPullDecl; - - var PullEnumElementDecl = (function (_super) { - __extends(PullEnumElementDecl, _super); - function PullEnumElementDecl(declName, displayName, parentDecl) { - _super.call(this, declName, displayName, 67108864 /* EnumMember */, 4 /* Public */, parentDecl); - this.constantValue = null; - } - return PullEnumElementDecl; - })(NormalPullDecl); - TypeScript.PullEnumElementDecl = PullEnumElementDecl; - - var PullFunctionExpressionDecl = (function (_super) { - __extends(PullFunctionExpressionDecl, _super); - function PullFunctionExpressionDecl(expressionName, declFlags, parentDecl, displayName) { - if (typeof displayName === "undefined") { displayName = ""; } - _super.call(this, "", displayName, 131072 /* FunctionExpression */, declFlags, parentDecl); - this.functionExpressionName = expressionName; - } - PullFunctionExpressionDecl.prototype.getFunctionExpressionName = function () { - return this.functionExpressionName; - }; - return PullFunctionExpressionDecl; - })(NormalPullDecl); - TypeScript.PullFunctionExpressionDecl = PullFunctionExpressionDecl; - - var PullSynthesizedDecl = (function (_super) { - __extends(PullSynthesizedDecl, _super); - function PullSynthesizedDecl(declName, displayName, kind, declFlags, parentDecl, semanticInfoChain) { - _super.call(this, declName, displayName, kind, declFlags, parentDecl, false); - this.semanticInfoChain = semanticInfoChain; - } - PullSynthesizedDecl.prototype.isSynthesized = function () { - return true; - }; - - PullSynthesizedDecl.prototype.fileName = function () { - return this._rootDecl ? this._rootDecl.fileName() : ""; - }; - return PullSynthesizedDecl; - })(NormalPullDecl); - TypeScript.PullSynthesizedDecl = PullSynthesizedDecl; - - var PullDeclGroup = (function () { - function PullDeclGroup(name) { - this.name = name; - this._decls = []; - } - PullDeclGroup.prototype.addDecl = function (decl) { - if (decl.name === this.name) { - this._decls[this._decls.length] = decl; - } - }; - - PullDeclGroup.prototype.getDecls = function () { - return this._decls; - }; - return PullDeclGroup; - })(); - TypeScript.PullDeclGroup = PullDeclGroup; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.pullSymbolID = 0; - TypeScript.sentinelEmptyArray = []; - - var PullSymbol = (function () { - function PullSymbol(name, declKind) { - this.pullSymbolID = ++TypeScript.pullSymbolID; - this._container = null; - this.type = null; - this._declarations = null; - this.isResolved = false; - this.isOptional = false; - this.inResolution = false; - this.isSynthesized = false; - this.isVarArg = false; - this.rootSymbol = null; - this._enclosingSignature = null; - this._docComments = null; - this.isPrinting = false; - this.name = name; - this.kind = declKind; - } - PullSymbol.prototype.isAny = function () { - return false; - }; - - PullSymbol.prototype.isType = function () { - return (this.kind & 58728795 /* SomeType */) !== 0; - }; - - PullSymbol.prototype.isTypeReference = function () { - return false; - }; - - PullSymbol.prototype.isSignature = function () { - return (this.kind & 7340032 /* SomeSignature */) !== 0; - }; - - PullSymbol.prototype.isArrayNamedTypeReference = function () { - return false; - }; - - PullSymbol.prototype.isPrimitive = function () { - return this.kind === 2 /* Primitive */; - }; - - PullSymbol.prototype.isAccessor = function () { - return false; - }; - - PullSymbol.prototype.isError = function () { - return false; - }; - - PullSymbol.prototype.isInterface = function () { - return this.kind === 16 /* Interface */; - }; - - PullSymbol.prototype.isMethod = function () { - return this.kind === 65536 /* Method */; - }; - - PullSymbol.prototype.isProperty = function () { - return this.kind === 4096 /* Property */; - }; - - PullSymbol.prototype.isAlias = function () { - return false; - }; - - PullSymbol.prototype.isContainer = function () { - return false; - }; - - PullSymbol.prototype.findAliasedType = function (scopeSymbol, skipScopeSymbolAliasesLookIn, lookIntoOnlyExportedAlias, aliasSymbols, visitedScopeDeclarations) { - if (typeof aliasSymbols === "undefined") { aliasSymbols = []; } - if (typeof visitedScopeDeclarations === "undefined") { visitedScopeDeclarations = []; } - var scopeDeclarations = scopeSymbol.getDeclarations(); - var scopeSymbolAliasesToLookIn = []; - - for (var i = 0; i < scopeDeclarations.length; i++) { - var scopeDecl = scopeDeclarations[i]; - if (!TypeScript.ArrayUtilities.contains(visitedScopeDeclarations, scopeDecl)) { - visitedScopeDeclarations.push(scopeDecl); - - var childDecls = scopeDecl.getChildDecls(); - for (var j = 0; j < childDecls.length; j++) { - var childDecl = childDecls[j]; - if (childDecl.kind === 128 /* TypeAlias */ && (!lookIntoOnlyExportedAlias || (childDecl.flags & 1 /* Exported */))) { - var symbol = childDecl.getSymbol(); - - if (PullContainerSymbol.usedAsSymbol(symbol, this) || (this.rootSymbol && PullContainerSymbol.usedAsSymbol(symbol, this.rootSymbol))) { - aliasSymbols.push(symbol); - return aliasSymbols; - } - - if (!skipScopeSymbolAliasesLookIn && this.isExternalModuleReferenceAlias(symbol) && (!symbol.assignedContainer().hasExportAssignment() || (symbol.assignedContainer().getExportAssignedContainerSymbol() && symbol.assignedContainer().getExportAssignedContainerSymbol().kind === 32 /* DynamicModule */))) { - scopeSymbolAliasesToLookIn.push(symbol); - } - } - } - } - } - - for (var i = 0; i < scopeSymbolAliasesToLookIn.length; i++) { - var scopeSymbolAlias = scopeSymbolAliasesToLookIn[i]; - - aliasSymbols.push(scopeSymbolAlias); - var result = this.findAliasedType(scopeSymbolAlias.assignedContainer().hasExportAssignment() ? scopeSymbolAlias.assignedContainer().getExportAssignedContainerSymbol() : scopeSymbolAlias.assignedContainer(), false, true, aliasSymbols, visitedScopeDeclarations); - if (result) { - return result; - } - - aliasSymbols.pop(); - } - - return null; - }; - - PullSymbol.prototype.getExternalAliasedSymbols = function (scopeSymbol) { - if (!scopeSymbol) { - return null; - } - - var scopePath = scopeSymbol.pathToRoot(); - if (scopePath.length && scopePath[scopePath.length - 1].kind === 32 /* DynamicModule */) { - var symbols = this.findAliasedType(scopePath[scopePath.length - 1]); - return symbols; - } - - return null; - }; - - PullSymbol.prototype.isExternalModuleReferenceAlias = function (aliasSymbol) { - if (aliasSymbol) { - if (aliasSymbol.assignedValue()) { - return false; - } - - if (aliasSymbol.assignedType() && aliasSymbol.assignedType() !== aliasSymbol.assignedContainer()) { - return false; - } - - if (aliasSymbol.assignedContainer() && aliasSymbol.assignedContainer().kind !== 32 /* DynamicModule */) { - return false; - } - - return true; - } - - return false; - }; - - PullSymbol.prototype.getExportedInternalAliasSymbol = function (scopeSymbol) { - if (scopeSymbol) { - if (this.kind !== 128 /* TypeAlias */) { - var scopePath = scopeSymbol.pathToRoot(); - for (var i = 0; i < scopePath.length; i++) { - var internalAliases = this.findAliasedType(scopeSymbol, true, true); - if (internalAliases) { - TypeScript.Debug.assert(internalAliases.length === 1); - return internalAliases[0]; - } - } - } - } - - return null; - }; - - PullSymbol.prototype.getAliasSymbolName = function (scopeSymbol, aliasNameGetter, aliasPartsNameGetter, skipInternalAlias) { - if (!skipInternalAlias) { - var internalAlias = this.getExportedInternalAliasSymbol(scopeSymbol); - if (internalAlias) { - return aliasNameGetter(internalAlias); - } - } - - var externalAliases = this.getExternalAliasedSymbols(scopeSymbol); - - if (externalAliases && this.isExternalModuleReferenceAlias(externalAliases[externalAliases.length - 1])) { - var aliasFullName = aliasNameGetter(externalAliases[0]); - if (!aliasFullName) { - return null; - } - for (var i = 1, symbolsLen = externalAliases.length; i < symbolsLen; i++) { - aliasFullName = aliasFullName + "." + aliasPartsNameGetter(externalAliases[i]); - } - return aliasFullName; - } - - return null; - }; - - PullSymbol.prototype._getResolver = function () { - TypeScript.Debug.assert(this._declarations && this._declarations.length > 0); - return this._declarations[0].semanticInfoChain.getResolver(); - }; - - PullSymbol.prototype._resolveDeclaredSymbol = function () { - return this._getResolver().resolveDeclaredSymbol(this); - }; - - PullSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - var aliasName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getName(scopeSymbol, useConstraintInName); - }, function (symbol) { - return symbol.getName(); - }); - return aliasName || this.name; - }; - - PullSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - var aliasDisplayName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getDisplayName(scopeSymbol, useConstraintInName); - }, function (symbol) { - return symbol.getDisplayName(); - }, skipInternalAliasName); - if (aliasDisplayName) { - return aliasDisplayName; - } - - var decls = this.getDeclarations(); - var name = decls.length && decls[0].getDisplayName(); - - return (name && name.length) ? name : this.name; - }; - - PullSymbol.prototype.getIsSpecialized = function () { - return false; - }; - - PullSymbol.prototype.getRootSymbol = function () { - if (!this.rootSymbol) { - return this; - } - return this.rootSymbol; - }; - PullSymbol.prototype.setRootSymbol = function (symbol) { - this.rootSymbol = symbol; - }; - - PullSymbol.prototype.setIsSynthesized = function (value) { - if (typeof value === "undefined") { value = true; } - TypeScript.Debug.assert(this.rootSymbol == null); - this.isSynthesized = value; - }; - - PullSymbol.prototype.getIsSynthesized = function () { - if (this.rootSymbol) { - return this.rootSymbol.getIsSynthesized(); - } - return this.isSynthesized; - }; - - PullSymbol.prototype.setEnclosingSignature = function (signature) { - this._enclosingSignature = signature; - }; - - PullSymbol.prototype.getEnclosingSignature = function () { - return this._enclosingSignature; - }; - - PullSymbol.prototype.addDeclaration = function (decl) { - TypeScript.Debug.assert(!!decl); - - if (this.rootSymbol) { - return; - } - - if (!this._declarations) { - this._declarations = [decl]; - } else { - this._declarations[this._declarations.length] = decl; - } - }; - - PullSymbol.prototype.getDeclarations = function () { - if (this.rootSymbol) { - return this.rootSymbol.getDeclarations(); - } - - if (!this._declarations) { - this._declarations = []; - } - - return this._declarations; - }; - - PullSymbol.prototype.hasDeclaration = function (decl) { - if (!this._declarations) { - return false; - } - - return TypeScript.ArrayUtilities.any(this._declarations, function (eachDecl) { - return eachDecl === decl; - }); - }; - - PullSymbol.prototype.setContainer = function (containerSymbol) { - if (this.rootSymbol) { - return; - } - - this._container = containerSymbol; - }; - - PullSymbol.prototype.getContainer = function () { - if (this.rootSymbol) { - return this.rootSymbol.getContainer(); - } - - return this._container; - }; - - PullSymbol.prototype.setResolved = function () { - this.isResolved = true; - this.inResolution = false; - }; - - PullSymbol.prototype.startResolving = function () { - this.inResolution = true; - }; - - PullSymbol.prototype.setUnresolved = function () { - this.isResolved = false; - this.inResolution = false; - }; - - PullSymbol.prototype.anyDeclHasFlag = function (flag) { - var declarations = this.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - if (TypeScript.hasFlag(declarations[i].flags, flag)) { - return true; - } - } - return false; - }; - - PullSymbol.prototype.allDeclsHaveFlag = function (flag) { - var declarations = this.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - if (!TypeScript.hasFlag(declarations[i].flags, flag)) { - return false; - } - } - return true; - }; - - PullSymbol.prototype.pathToRoot = function () { - var path = []; - var node = this; - while (node) { - if (node.isType()) { - var associatedContainerSymbol = node.getAssociatedContainerType(); - if (associatedContainerSymbol) { - node = associatedContainerSymbol; - } - } - path[path.length] = node; - var nodeKind = node.kind; - if (nodeKind === 2048 /* Parameter */) { - break; - } else { - node = node.getContainer(); - } - } - return path; - }; - - PullSymbol.unqualifiedNameReferencesDifferentSymbolInScope = function (symbol, scopePath, endScopePathIndex) { - var declPath = scopePath[0].getDeclarations()[0].getParentPath(); - for (var i = 0, declIndex = declPath.length - 1; i <= endScopePathIndex; i++, declIndex--) { - if (symbol.isContainer() && scopePath[i].isContainer()) { - var scopeType = scopePath[i]; - - var memberSymbol = scopeType.findContainedNonMemberContainer(symbol.name, 164 /* SomeContainer */); - if (memberSymbol && memberSymbol != symbol && memberSymbol.getDeclarations()[0].getParentDecl() == declPath[declIndex]) { - return true; - } - - var memberSymbol = scopeType.findNestedContainer(symbol.name, 164 /* SomeContainer */); - if (memberSymbol && memberSymbol != symbol) { - return true; - } - } - } - - return false; - }; - - PullSymbol.prototype.findQualifyingSymbolPathInScopeSymbol = function (scopeSymbol) { - var thisPath = this.pathToRoot(); - if (thisPath.length === 1) { - return thisPath; - } - - var scopeSymbolPath; - if (scopeSymbol) { - scopeSymbolPath = scopeSymbol.pathToRoot(); - } else { - return thisPath; - } - - var thisCommonAncestorIndex = TypeScript.ArrayUtilities.indexOf(thisPath, function (thisNode) { - return TypeScript.ArrayUtilities.contains(scopeSymbolPath, thisNode); - }); - if (thisCommonAncestorIndex > 0) { - var thisCommonAncestor = thisPath[thisCommonAncestorIndex]; - var scopeCommonAncestorIndex = TypeScript.ArrayUtilities.indexOf(scopeSymbolPath, function (scopeNode) { - return scopeNode === thisCommonAncestor; - }); - TypeScript.Debug.assert(thisPath.length - thisCommonAncestorIndex === scopeSymbolPath.length - scopeCommonAncestorIndex); - - for (; thisCommonAncestorIndex < thisPath.length; thisCommonAncestorIndex++, scopeCommonAncestorIndex++) { - if (!PullSymbol.unqualifiedNameReferencesDifferentSymbolInScope(thisPath[thisCommonAncestorIndex - 1], scopeSymbolPath, scopeCommonAncestorIndex)) { - break; - } - } - } - - if (thisCommonAncestorIndex >= 0 && thisCommonAncestorIndex < thisPath.length) { - return thisPath.slice(0, thisCommonAncestorIndex); - } else { - return thisPath; - } - }; - - PullSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var str = this.getNameAndTypeName(scopeSymbol); - return str; - }; - - PullSymbol.prototype.getNamePartForFullName = function () { - return this.getDisplayName(null, true); - }; - - PullSymbol.prototype.fullName = function (scopeSymbol) { - var _this = this; - var path = this.pathToRoot(); - var fullName = ""; - - var aliasFullName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.fullName(scopeSymbol); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }); - if (aliasFullName) { - return aliasFullName; - } - - for (var i = 1; i < path.length; i++) { - var aliasFullName = path[i].getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol === _this ? null : symbol.fullName(scopeSymbol); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }); - if (aliasFullName) { - fullName = aliasFullName + "." + fullName; - break; - } - - var scopedName = path[i].getNamePartForFullName(); - if (path[i].kind === 32 /* DynamicModule */ && !TypeScript.isQuoted(scopedName)) { - break; - } - - if (scopedName === "") { - break; - } - - fullName = scopedName + "." + fullName; - } - - fullName = fullName + this.getNamePartForFullName(); - return fullName; - }; - - PullSymbol.prototype.getScopedName = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName) { - var path = this.findQualifyingSymbolPathInScopeSymbol(scopeSymbol); - var fullName = ""; - - var aliasFullName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getScopedName(scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }, skipInternalAliasName); - if (aliasFullName) { - return aliasFullName; - } - - for (var i = 1; i < path.length; i++) { - var kind = path[i].kind; - if (kind === 4 /* Container */ || kind === 32 /* DynamicModule */) { - var aliasFullName = path[i].getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getScopedName(scopeSymbol, skipTypeParametersInName, false, skipInternalAliasName); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }, skipInternalAliasName); - if (aliasFullName) { - fullName = aliasFullName + "." + fullName; - break; - } - - if (kind === 4 /* Container */) { - fullName = path[i].getDisplayName() + "." + fullName; - } else { - var displayName = path[i].getDisplayName(); - if (TypeScript.isQuoted(displayName)) { - fullName = displayName + "." + fullName; - } - break; - } - } else { - break; - } - } - fullName = fullName + this.getDisplayName(scopeSymbol, useConstraintInName, skipInternalAliasName); - return fullName; - }; - - PullSymbol.prototype.getScopedNameEx = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName) { - var name = this.getScopedName(scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - return TypeScript.MemberName.create(name); - }; - - PullSymbol.prototype.getTypeName = function (scopeSymbol, getPrettyTypeName) { - var memberName = this.getTypeNameEx(scopeSymbol, getPrettyTypeName); - return memberName.toString(); - }; - - PullSymbol.prototype.getTypeNameEx = function (scopeSymbol, getPrettyTypeName) { - var type = this.type; - if (type) { - var memberName = getPrettyTypeName ? this.getTypeNameForFunctionSignature("", scopeSymbol, getPrettyTypeName) : null; - if (!memberName) { - memberName = type.getScopedNameEx(scopeSymbol, false, true, getPrettyTypeName); - } - - return memberName; - } - return TypeScript.MemberName.create(""); - }; - - PullSymbol.prototype.getTypeNameForFunctionSignature = function (prefix, scopeSymbol, getPrettyTypeName) { - var type = this.type; - if (type && !type.isNamedTypeSymbol() && this.kind !== 4096 /* Property */ && this.kind !== 512 /* Variable */ && this.kind !== 2048 /* Parameter */) { - var signatures = type.getCallSignatures(); - if (signatures.length === 1 || (getPrettyTypeName && signatures.length)) { - var typeName = new TypeScript.MemberNameArray(); - var signatureName = PullSignatureSymbol.getSignaturesTypeNameEx(signatures, prefix, false, false, scopeSymbol, getPrettyTypeName); - typeName.addAll(signatureName); - return typeName; - } - } - - return null; - }; - - PullSymbol.prototype.getNameAndTypeName = function (scopeSymbol) { - var nameAndTypeName = this.getNameAndTypeNameEx(scopeSymbol); - return nameAndTypeName.toString(); - }; - - PullSymbol.prototype.getNameAndTypeNameEx = function (scopeSymbol) { - var type = this.type; - var nameStr = this.getDisplayName(scopeSymbol); - if (type) { - nameStr = nameStr + (this.isOptional ? "?" : ""); - var memberName = this.getTypeNameForFunctionSignature(nameStr, scopeSymbol); - if (!memberName) { - var typeNameEx = type.getScopedNameEx(scopeSymbol); - memberName = TypeScript.MemberName.create(typeNameEx, nameStr + ": ", ""); - } - return memberName; - } - return TypeScript.MemberName.create(nameStr); - }; - - PullSymbol.getTypeParameterString = function (typars, scopeSymbol, useContraintInName) { - return PullSymbol.getTypeParameterStringEx(typars, scopeSymbol, undefined, useContraintInName).toString(); - }; - - PullSymbol.getTypeParameterStringEx = function (typeParameters, scopeSymbol, getTypeParamMarkerInfo, useContraintInName) { - var builder = new TypeScript.MemberNameArray(); - builder.prefix = ""; - - if (typeParameters && typeParameters.length) { - builder.add(TypeScript.MemberName.create("<")); - - for (var i = 0; i < typeParameters.length; i++) { - if (i) { - builder.add(TypeScript.MemberName.create(", ")); - } - - if (getTypeParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - - builder.add(typeParameters[i].getScopedNameEx(scopeSymbol, false, useContraintInName)); - - if (getTypeParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - } - - builder.add(TypeScript.MemberName.create(">")); - } - - return builder; - }; - - PullSymbol.getIsExternallyVisible = function (symbol, fromIsExternallyVisibleSymbol, inIsExternallyVisibleSymbols) { - if (inIsExternallyVisibleSymbols) { - for (var i = 0; i < inIsExternallyVisibleSymbols.length; i++) { - if (inIsExternallyVisibleSymbols[i] === symbol) { - return true; - } - } - } else { - inIsExternallyVisibleSymbols = []; - } - - if (fromIsExternallyVisibleSymbol === symbol) { - return true; - } - - inIsExternallyVisibleSymbols.push(fromIsExternallyVisibleSymbol); - - var result = symbol.isExternallyVisible(inIsExternallyVisibleSymbols); - - TypeScript.Debug.assert(TypeScript.ArrayUtilities.last(inIsExternallyVisibleSymbols) === fromIsExternallyVisibleSymbol); - inIsExternallyVisibleSymbols.pop(); - - return result; - }; - - PullSymbol.prototype.isExternallyVisible = function (inIsExternallyVisibleSymbols) { - var kind = this.kind; - if (kind === 2 /* Primitive */) { - return true; - } - - if (this.rootSymbol) { - return PullSymbol.getIsExternallyVisible(this.rootSymbol, this, inIsExternallyVisibleSymbols); - } - - if (this.isType()) { - var associatedContainerSymbol = this.getAssociatedContainerType(); - if (associatedContainerSymbol) { - return PullSymbol.getIsExternallyVisible(associatedContainerSymbol, this, inIsExternallyVisibleSymbols); - } - } - - if (this.anyDeclHasFlag(2 /* Private */)) { - return false; - } - - var container = this.getContainer(); - if (container === null) { - var decls = this.getDeclarations(); - if (decls.length) { - var parentDecl = decls[0].getParentDecl(); - if (parentDecl) { - var parentSymbol = parentDecl.getSymbol(); - if (!parentSymbol || parentDecl.kind === 1 /* Script */) { - return true; - } - - return PullSymbol.getIsExternallyVisible(parentSymbol, this, inIsExternallyVisibleSymbols); - } - } - - return true; - } - - if (container.kind === 32 /* DynamicModule */ || (container.getAssociatedContainerType() && container.getAssociatedContainerType().kind === 32 /* DynamicModule */)) { - var containerSymbol = container.kind === 32 /* DynamicModule */ ? container : container.getAssociatedContainerType(); - if (PullContainerSymbol.usedAsSymbol(containerSymbol, this)) { - return true; - } - } - - if (!this.anyDeclHasFlag(1 /* Exported */) && kind !== 4096 /* Property */ && kind !== 65536 /* Method */) { - return false; - } - - return PullSymbol.getIsExternallyVisible(container, this, inIsExternallyVisibleSymbols); - }; - - PullSymbol.prototype.getDocCommentsOfDecl = function (decl) { - var ast = decl.ast(); - - if (ast) { - var enclosingModuleDeclaration = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast); - if (TypeScript.ASTHelpers.isLastNameOfModule(enclosingModuleDeclaration, ast)) { - return TypeScript.ASTHelpers.docComments(enclosingModuleDeclaration); - } - - if (ast.kind() !== 130 /* ModuleDeclaration */ || decl.kind !== 512 /* Variable */) { - return TypeScript.ASTHelpers.docComments(ast); - } - } - - return []; - }; - - PullSymbol.prototype.getDocCommentArray = function (symbol) { - var docComments = []; - if (!symbol) { - return docComments; - } - - var isParameter = symbol.kind === 2048 /* Parameter */; - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - if (isParameter && decls[i].kind === 4096 /* Property */) { - continue; - } - docComments = docComments.concat(this.getDocCommentsOfDecl(decls[i])); - } - return docComments; - }; - - PullSymbol.getDefaultConstructorSymbolForDocComments = function (classSymbol) { - if (classSymbol.getHasDefaultConstructor()) { - var extendedTypes = classSymbol.getExtendedTypes(); - if (extendedTypes.length) { - return PullSymbol.getDefaultConstructorSymbolForDocComments(extendedTypes[0]); - } - } - - return classSymbol.type.getConstructSignatures()[0]; - }; - - PullSymbol.prototype.getDocCommentText = function (comments) { - var docCommentText = new Array(); - for (var c = 0; c < comments.length; c++) { - var commentText = this.getDocCommentTextValue(comments[c]); - if (commentText !== "") { - docCommentText.push(commentText); - } - } - return docCommentText.join("\n"); - }; - - PullSymbol.prototype.getDocCommentTextValue = function (comment) { - return this.cleanJSDocComment(comment.fullText()); - }; - - PullSymbol.prototype.docComments = function (useConstructorAsClass) { - var decls = this.getDeclarations(); - if (useConstructorAsClass && decls.length && decls[0].kind === 32768 /* ConstructorMethod */) { - var classDecl = decls[0].getParentDecl(); - return this.getDocCommentText(this.getDocCommentsOfDecl(classDecl)); - } - - if (this._docComments === null) { - var docComments = ""; - if (!useConstructorAsClass && this.kind === 2097152 /* ConstructSignature */ && decls.length && decls[0].kind === 8 /* Class */) { - var classSymbol = this.returnType; - var extendedTypes = classSymbol.getExtendedTypes(); - if (extendedTypes.length) { - docComments = extendedTypes[0].getConstructorMethod().docComments(); - } else { - docComments = ""; - } - } else if (this.kind === 2048 /* Parameter */) { - var parameterComments = []; - - var funcContainer = this.getEnclosingSignature(); - var funcDocComments = this.getDocCommentArray(funcContainer); - var paramComment = this.getParameterDocCommentText(this.getDisplayName(), funcDocComments); - if (paramComment != "") { - parameterComments.push(paramComment); - } - - var paramSelfComment = this.getDocCommentText(this.getDocCommentArray(this)); - if (paramSelfComment != "") { - parameterComments.push(paramSelfComment); - } - docComments = parameterComments.join("\n"); - } else { - var getSymbolComments = true; - if (this.kind === 16777216 /* FunctionType */) { - var functionSymbol = this.getFunctionSymbol(); - - if (functionSymbol) { - docComments = functionSymbol._docComments || ""; - getSymbolComments = false; - } else { - var declarationList = this.getDeclarations(); - if (declarationList.length > 0) { - docComments = declarationList[0].getSymbol()._docComments || ""; - getSymbolComments = false; - } - } - } - if (getSymbolComments) { - docComments = this.getDocCommentText(this.getDocCommentArray(this)); - if (docComments === "") { - if (this.kind === 1048576 /* CallSignature */) { - var callTypeSymbol = this.functionType; - if (callTypeSymbol && callTypeSymbol.getCallSignatures().length === 1) { - docComments = callTypeSymbol.docComments(); - } - } - } - } - } - - this._docComments = docComments; - } - - return this._docComments; - }; - - PullSymbol.prototype.getParameterDocCommentText = function (param, fncDocComments) { - if (fncDocComments.length === 0 || fncDocComments[0].kind() !== 6 /* MultiLineCommentTrivia */) { - return ""; - } - - for (var i = 0; i < fncDocComments.length; i++) { - var commentContents = fncDocComments[i].fullText(); - for (var j = commentContents.indexOf("@param", 0); 0 <= j; j = commentContents.indexOf("@param", j)) { - j += 6; - if (!this.isSpaceChar(commentContents, j)) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j); - if (j === -1) { - break; - } - - if (commentContents.charCodeAt(j) === 123 /* openBrace */) { - j++; - - var charCode = 0; - for (var curlies = 1; j < commentContents.length; j++) { - charCode = commentContents.charCodeAt(j); - - if (charCode === 123 /* openBrace */) { - curlies++; - continue; - } - - if (charCode === 125 /* closeBrace */) { - curlies--; - if (curlies === 0) { - break; - } else { - continue; - } - } - - if (charCode === 64 /* at */) { - break; - } - } - - if (j === commentContents.length) { - break; - } - - if (charCode === 64 /* at */) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j + 1); - if (j === -1) { - break; - } - } - - if (param !== commentContents.substr(j, param.length) || !this.isSpaceChar(commentContents, j + param.length)) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j + param.length); - if (j === -1) { - return ""; - } - - var endOfParam = commentContents.indexOf("@", j); - var paramHelpString = commentContents.substring(j, endOfParam < 0 ? commentContents.length : endOfParam); - - var paramSpacesToRemove = undefined; - var paramLineIndex = commentContents.substring(0, j).lastIndexOf("\n") + 1; - if (paramLineIndex !== 0) { - if (paramLineIndex < j && commentContents.charAt(paramLineIndex + 1) === "\r") { - paramLineIndex++; - } - } - var startSpaceRemovalIndex = this.consumeLeadingSpace(commentContents, paramLineIndex); - if (startSpaceRemovalIndex !== j && commentContents.charAt(startSpaceRemovalIndex) === "*") { - paramSpacesToRemove = j - startSpaceRemovalIndex - 1; - } - - return this.cleanJSDocComment(paramHelpString, paramSpacesToRemove); - } - } - - return ""; - }; - - PullSymbol.prototype.cleanJSDocComment = function (content, spacesToRemove) { - var docCommentLines = new Array(); - content = content.replace("/**", ""); - if (content.length >= 2 && content.charAt(content.length - 1) === "/" && content.charAt(content.length - 2) === "*") { - content = content.substring(0, content.length - 2); - } - var lines = content.split("\n"); - var inParamTag = false; - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - var cleanLinePos = this.cleanDocCommentLine(line, true, spacesToRemove); - if (!cleanLinePos) { - continue; - } - - var docCommentText = ""; - var prevPos = cleanLinePos.start; - for (var i = line.indexOf("@", cleanLinePos.start); 0 <= i && i < cleanLinePos.end; i = line.indexOf("@", i + 1)) { - var wasInParamtag = inParamTag; - - if (line.indexOf("param", i + 1) === i + 1 && this.isSpaceChar(line, i + 6)) { - if (!wasInParamtag) { - docCommentText += line.substring(prevPos, i); - } - - prevPos = i; - inParamTag = true; - } else if (wasInParamtag) { - prevPos = i; - inParamTag = false; - } - } - - if (!inParamTag) { - docCommentText += line.substring(prevPos, cleanLinePos.end); - } - - var newCleanPos = this.cleanDocCommentLine(docCommentText, false); - if (newCleanPos) { - if (spacesToRemove === undefined) { - spacesToRemove = cleanLinePos.jsDocSpacesRemoved; - } - docCommentLines.push(docCommentText); - } - } - - return docCommentLines.join("\n"); - }; - - PullSymbol.prototype.consumeLeadingSpace = function (line, startIndex, maxSpacesToRemove) { - var endIndex = line.length; - if (maxSpacesToRemove !== undefined) { - endIndex = TypeScript.MathPrototype.min(startIndex + maxSpacesToRemove, endIndex); - } - - for (; startIndex < endIndex; startIndex++) { - var charCode = line.charCodeAt(startIndex); - if (charCode !== 32 /* space */ && charCode !== 9 /* tab */) { - return startIndex; - } - } - - if (endIndex !== line.length) { - return endIndex; - } - - return -1; - }; - - PullSymbol.prototype.isSpaceChar = function (line, index) { - var length = line.length; - if (index < length) { - var charCode = line.charCodeAt(index); - - return charCode === 32 /* space */ || charCode === 9 /* tab */; - } - - return index === length; - }; - - PullSymbol.prototype.cleanDocCommentLine = function (line, jsDocStyleComment, jsDocLineSpaceToRemove) { - var nonSpaceIndex = this.consumeLeadingSpace(line, 0); - if (nonSpaceIndex !== -1) { - var jsDocSpacesRemoved = nonSpaceIndex; - if (jsDocStyleComment && line.charAt(nonSpaceIndex) === '*') { - var startIndex = nonSpaceIndex + 1; - nonSpaceIndex = this.consumeLeadingSpace(line, startIndex, jsDocLineSpaceToRemove); - - if (nonSpaceIndex !== -1) { - jsDocSpacesRemoved = nonSpaceIndex - startIndex; - } else { - return null; - } - } - - return { - start: nonSpaceIndex, - end: line.charAt(line.length - 1) === "\r" ? line.length - 1 : line.length, - jsDocSpacesRemoved: jsDocSpacesRemoved - }; - } - - return null; - }; - return PullSymbol; - })(); - TypeScript.PullSymbol = PullSymbol; - - - - var PullSignatureSymbol = (function (_super) { - __extends(PullSignatureSymbol, _super); - function PullSignatureSymbol(kind, _isDefinition) { - if (typeof _isDefinition === "undefined") { _isDefinition = false; } - _super.call(this, "", kind); - this._isDefinition = _isDefinition; - this._memberTypeParameterNameCache = null; - this._stringConstantOverload = undefined; - this.parameters = TypeScript.sentinelEmptyArray; - this._typeParameters = null; - this.returnType = null; - this.functionType = null; - this.hasOptionalParam = false; - this.nonOptionalParamCount = 0; - this.hasVarArgs = false; - this._allowedToReferenceTypeParameters = null; - this._instantiationCache = null; - this.hasBeenChecked = false; - this.inWrapCheck = false; - this.inWrapInfiniteExpandingReferenceCheck = false; - } - PullSignatureSymbol.prototype.isDefinition = function () { - return this._isDefinition; - }; - - PullSignatureSymbol.prototype.isGeneric = function () { - var typeParameters = this.getTypeParameters(); - return !!typeParameters && typeParameters.length !== 0; - }; - - PullSignatureSymbol.prototype.addParameter = function (parameter, isOptional) { - if (typeof isOptional === "undefined") { isOptional = false; } - if (this.parameters === TypeScript.sentinelEmptyArray) { - this.parameters = []; - } - - this.parameters[this.parameters.length] = parameter; - this.hasOptionalParam = isOptional; - - if (!parameter.getEnclosingSignature()) { - parameter.setEnclosingSignature(this); - } - - if (!isOptional) { - this.nonOptionalParamCount++; - } - }; - - PullSignatureSymbol.prototype.addTypeParameter = function (typeParameter) { - if (!this._typeParameters) { - this._typeParameters = []; - } - - if (!this._memberTypeParameterNameCache) { - this._memberTypeParameterNameCache = TypeScript.createIntrinsicsObject(); - } - - this._typeParameters[this._typeParameters.length] = typeParameter; - - this._memberTypeParameterNameCache[typeParameter.getName()] = typeParameter; - }; - - PullSignatureSymbol.prototype.addTypeParametersFromReturnType = function () { - var typeParameters = this.returnType.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - this.addTypeParameter(typeParameters[i]); - } - }; - - PullSignatureSymbol.prototype.getTypeParameters = function () { - if (!this._typeParameters) { - this._typeParameters = []; - } - - return this._typeParameters; - }; - - PullSignatureSymbol.prototype.findTypeParameter = function (name) { - var memberSymbol; - - if (!this._memberTypeParameterNameCache) { - this._memberTypeParameterNameCache = TypeScript.createIntrinsicsObject(); - - for (var i = 0; i < this.getTypeParameters().length; i++) { - this._memberTypeParameterNameCache[this._typeParameters[i].getName()] = this._typeParameters[i]; - } - } - - memberSymbol = this._memberTypeParameterNameCache[name]; - - return memberSymbol; - }; - - PullSignatureSymbol.prototype.getTypeParameterArgumentMap = function () { - return null; - }; - - PullSignatureSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._allowedToReferenceTypeParameters) { - this._allowedToReferenceTypeParameters = TypeScript.PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl(this.getDeclarations()[0]); - } - - return this._allowedToReferenceTypeParameters; - }; - - PullSignatureSymbol.prototype.addSpecialization = function (specializedVersionOfThisSignature, typeArgumentMap) { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._instantiationCache) { - this._instantiationCache = TypeScript.createIntrinsicsObject(); - } - - this._instantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)] = specializedVersionOfThisSignature; - }; - - PullSignatureSymbol.prototype.getSpecialization = function (typeArgumentMap) { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._instantiationCache) { - return null; - } - - var result = this._instantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)]; - return result || null; - }; - - PullSignatureSymbol.prototype.isStringConstantOverloadSignature = function () { - if (this._stringConstantOverload === undefined) { - var params = this.parameters; - this._stringConstantOverload = false; - for (var i = 0; i < params.length; i++) { - var paramType = params[i].type; - if (paramType && paramType.isPrimitive() && paramType.isStringConstant()) { - this._stringConstantOverload = true; - } - } - } - - return this._stringConstantOverload; - }; - - PullSignatureSymbol.prototype.getParameterTypeAtIndex = function (iParam) { - if (iParam < this.parameters.length - 1 || (iParam < this.parameters.length && !this.hasVarArgs)) { - return this.parameters[iParam].type; - } else if (this.hasVarArgs) { - var paramType = this.parameters[this.parameters.length - 1].type; - if (paramType.isArrayNamedTypeReference()) { - paramType = paramType.getElementType(); - } - return paramType; - } - - return null; - }; - - PullSignatureSymbol.getSignatureTypeMemberName = function (candidateSignature, signatures, scopeSymbol) { - var allMemberNames = new TypeScript.MemberNameArray(); - var signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(signatures, "", false, false, scopeSymbol, true, candidateSignature); - allMemberNames.addAll(signatureMemberName); - return allMemberNames; - }; - - PullSignatureSymbol.getSignaturesTypeNameEx = function (signatures, prefix, shortform, brackets, scopeSymbol, getPrettyTypeName, candidateSignature) { - var result = []; - if (!signatures) { - return result; - } - - var len = signatures.length; - if (!getPrettyTypeName && len > 1) { - shortform = false; - } - - var foundDefinition = false; - if (candidateSignature && candidateSignature.isDefinition() && len > 1) { - candidateSignature = null; - } - - for (var i = 0; i < len; i++) { - if (len > 1 && signatures[i].isDefinition()) { - foundDefinition = true; - continue; - } - - var signature = signatures[i]; - if (getPrettyTypeName && candidateSignature) { - signature = candidateSignature; - } - - result.push(signature.getSignatureTypeNameEx(prefix, shortform, brackets, scopeSymbol)); - if (getPrettyTypeName) { - break; - } - } - - if (getPrettyTypeName && result.length && len > 1) { - var lastMemberName = result[result.length - 1]; - for (var i = i + 1; i < len; i++) { - if (signatures[i].isDefinition()) { - foundDefinition = true; - break; - } - } - var overloadString = TypeScript.getLocalizedText(TypeScript.DiagnosticCode._0_overload_s, [foundDefinition ? len - 2 : len - 1]); - lastMemberName.add(TypeScript.MemberName.create(overloadString)); - } - - return result; - }; - - PullSignatureSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var s = this.getSignatureTypeNameEx(this.getScopedNameEx().toString(), false, false, scopeSymbol, undefined, useConstraintInName).toString(); - return s; - }; - - PullSignatureSymbol.prototype.getSignatureTypeNameEx = function (prefix, shortform, brackets, scopeSymbol, getParamMarkerInfo, getTypeParamMarkerInfo) { - var typeParamterBuilder = new TypeScript.MemberNameArray(); - - typeParamterBuilder.add(PullSymbol.getTypeParameterStringEx(this.getTypeParameters(), scopeSymbol, getTypeParamMarkerInfo, true)); - - if (brackets) { - typeParamterBuilder.add(TypeScript.MemberName.create("[")); - } else { - typeParamterBuilder.add(TypeScript.MemberName.create("(")); - } - - var builder = new TypeScript.MemberNameArray(); - builder.prefix = prefix; - - if (getTypeParamMarkerInfo) { - builder.prefix = prefix; - builder.addAll(typeParamterBuilder.entries); - } else { - builder.prefix = prefix + typeParamterBuilder.toString(); - } - - var params = this.parameters; - var paramLen = params.length; - for (var i = 0; i < paramLen; i++) { - var paramType = params[i].type; - var typeString = paramType ? ": " : ""; - var paramIsVarArg = params[i].isVarArg; - var varArgPrefix = paramIsVarArg ? "..." : ""; - var optionalString = (!paramIsVarArg && params[i].isOptional) ? "?" : ""; - if (getParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - builder.add(TypeScript.MemberName.create(varArgPrefix + params[i].getScopedNameEx(scopeSymbol).toString() + optionalString + typeString)); - if (paramType) { - builder.add(paramType.getScopedNameEx(scopeSymbol)); - } - if (getParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - if (i < paramLen - 1) { - builder.add(TypeScript.MemberName.create(", ")); - } - } - - if (shortform) { - if (brackets) { - builder.add(TypeScript.MemberName.create("] => ")); - } else { - builder.add(TypeScript.MemberName.create(") => ")); - } - } else { - if (brackets) { - builder.add(TypeScript.MemberName.create("]: ")); - } else { - builder.add(TypeScript.MemberName.create("): ")); - } - } - - if (this.returnType) { - builder.add(this.returnType.getScopedNameEx(scopeSymbol)); - } else { - builder.add(TypeScript.MemberName.create("any")); - } - - return builder; - }; - - PullSignatureSymbol.prototype.forAllParameterTypes = function (length, predicate) { - if (this.parameters.length < length && !this.hasVarArgs) { - length = this.parameters.length; - } - - for (var i = 0; i < length; i++) { - var paramType = this.getParameterTypeAtIndex(i); - if (!predicate(paramType, i)) { - return false; - } - } - - return true; - }; - - PullSignatureSymbol.prototype.forAllCorrespondingParameterTypesInThisAndOtherSignature = function (otherSignature, predicate) { - var length; - if (this.hasVarArgs) { - length = otherSignature.hasVarArgs ? Math.max(this.parameters.length, otherSignature.parameters.length) : otherSignature.parameters.length; - } else { - length = otherSignature.hasVarArgs ? this.parameters.length : Math.min(this.parameters.length, otherSignature.parameters.length); - } - - for (var i = 0; i < length; i++) { - var thisParamType = this.getParameterTypeAtIndex(i); - var otherParamType = otherSignature.getParameterTypeAtIndex(i); - if (!predicate(thisParamType, otherParamType, i)) { - return false; - } - } - - return true; - }; - - PullSignatureSymbol.prototype.wrapsSomeTypeParameter = function (typeParameterArgumentMap) { - return this.getWrappingTypeParameterID(typeParameterArgumentMap) !== 0; - }; - - PullSignatureSymbol.prototype.getWrappingTypeParameterID = function (typeParameterArgumentMap) { - var signature = this; - if (signature.inWrapCheck) { - return 0; - } - - this._wrapsTypeParameterCache = this._wrapsTypeParameterCache || new TypeScript.WrapsTypeParameterCache(); - - var wrappingTypeParameterID = this._wrapsTypeParameterCache.getWrapsTypeParameter(typeParameterArgumentMap); - if (wrappingTypeParameterID === undefined) { - wrappingTypeParameterID = this.getWrappingTypeParameterIDWorker(typeParameterArgumentMap); - this._wrapsTypeParameterCache.setWrapsTypeParameter(typeParameterArgumentMap, wrappingTypeParameterID); - } - - return wrappingTypeParameterID; - }; - - PullSignatureSymbol.prototype.getWrappingTypeParameterIDWorker = function (typeParameterArgumentMap) { - var signature = this; - signature.inWrapCheck = true; - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(signature); - var wrappingTypeParameterID = signature.returnType ? signature.returnType.getWrappingTypeParameterID(typeParameterArgumentMap) : 0; - - var parameters = signature.parameters; - for (var i = 0; !wrappingTypeParameterID && i < parameters.length; i++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(parameters[i]); - wrappingTypeParameterID = parameters[i].type.getWrappingTypeParameterID(typeParameterArgumentMap); - } - - signature.inWrapCheck = false; - - return wrappingTypeParameterID; - }; - - PullSignatureSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference = function (enclosingType, knownWrapMap) { - var wrapsIntoInfinitelyExpandingTypeReference = knownWrapMap.valueAt(this.pullSymbolID, enclosingType.pullSymbolID); - if (wrapsIntoInfinitelyExpandingTypeReference != undefined) { - return wrapsIntoInfinitelyExpandingTypeReference; - } - - if (this.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - this.inWrapInfiniteExpandingReferenceCheck = true; - wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType, knownWrapMap); - knownWrapMap.setValueAt(this.pullSymbolID, enclosingType.pullSymbolID, wrapsIntoInfinitelyExpandingTypeReference); - this.inWrapInfiniteExpandingReferenceCheck = false; - - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullSignatureSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker = function (enclosingType, knownWrapMap) { - if (this.returnType && this.returnType._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - - var parameters = this.parameters; - - for (var i = 0; i < parameters.length; i++) { - if (parameters[i].type && parameters[i].type._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - } - - return false; - }; - return PullSignatureSymbol; - })(PullSymbol); - TypeScript.PullSignatureSymbol = PullSignatureSymbol; - - var PullTypeSymbol = (function (_super) { - __extends(PullTypeSymbol, _super); - function PullTypeSymbol(name, kind) { - _super.call(this, name, kind); - this._members = TypeScript.sentinelEmptyArray; - this._enclosedMemberTypes = null; - this._enclosedMemberContainers = null; - this._typeParameters = null; - this._allowedToReferenceTypeParameters = null; - this._specializedVersionsOfThisType = null; - this._arrayVersionOfThisType = null; - this._implementedTypes = null; - this._extendedTypes = null; - this._typesThatExplicitlyImplementThisType = null; - this._typesThatExtendThisType = null; - this._callSignatures = null; - this._allCallSignatures = null; - this._constructSignatures = null; - this._indexSignatures = null; - this._allIndexSignatures = null; - this._allIndexSignaturesOfAugmentedType = null; - this._memberNameCache = null; - this._enclosedTypeNameCache = null; - this._enclosedContainerCache = null; - this._typeParameterNameCache = null; - this._containedNonMemberNameCache = null; - this._containedNonMemberTypeNameCache = null; - this._containedNonMemberContainerCache = null; - this._simpleInstantiationCache = null; - this._complexInstantiationCache = null; - this._hasGenericSignature = false; - this._hasGenericMember = false; - this._hasBaseTypeConflict = false; - this._knownBaseTypeCount = 0; - this._associatedContainerTypeSymbol = null; - this._constructorMethod = null; - this._hasDefaultConstructor = false; - this._functionSymbol = null; - this._inMemberTypeNameEx = false; - this.inSymbolPrivacyCheck = false; - this.inWrapCheck = false; - this.inWrapInfiniteExpandingReferenceCheck = false; - this.typeReference = null; - this._widenedType = null; - this._isArrayNamedTypeReference = undefined; - this.type = this; - } - PullTypeSymbol.prototype.isArrayNamedTypeReference = function () { - if (this._isArrayNamedTypeReference === undefined) { - this._isArrayNamedTypeReference = this.computeIsArrayNamedTypeReference(); - } - - return this._isArrayNamedTypeReference; - }; - - PullTypeSymbol.prototype.computeIsArrayNamedTypeReference = function () { - var typeArgs = this.getTypeArguments(); - if (typeArgs && this.getTypeArguments().length === 1 && this.name === "Array") { - var declaration = this.getDeclarations()[0]; - - if (declaration && declaration.getParentDecl() && declaration.getParentDecl().getParentDecl() === null) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.isType = function () { - return true; - }; - PullTypeSymbol.prototype.isClass = function () { - return this.kind === 8 /* Class */ || (this._constructorMethod !== null); - }; - PullTypeSymbol.prototype.isFunction = function () { - return (this.kind & (33554432 /* ConstructorType */ | 16777216 /* FunctionType */)) !== 0; - }; - PullTypeSymbol.prototype.isConstructor = function () { - return this.kind === 33554432 /* ConstructorType */; - }; - PullTypeSymbol.prototype.isTypeParameter = function () { - return false; - }; - PullTypeSymbol.prototype.isTypeVariable = function () { - return false; - }; - PullTypeSymbol.prototype.isError = function () { - return false; - }; - PullTypeSymbol.prototype.isEnum = function () { - return this.kind === 64 /* Enum */; - }; - - PullTypeSymbol.prototype.getTypeParameterArgumentMap = function () { - return null; - }; - - PullTypeSymbol.prototype.isObject = function () { - return TypeScript.hasFlag(this.kind, 8 /* Class */ | 33554432 /* ConstructorType */ | 64 /* Enum */ | 16777216 /* FunctionType */ | 16 /* Interface */ | 8388608 /* ObjectType */ | 256 /* ObjectLiteral */); - }; - - PullTypeSymbol.prototype.isFunctionType = function () { - return this.getCallSignatures().length > 0 || this.getConstructSignatures().length > 0; - }; - - PullTypeSymbol.prototype.getKnownBaseTypeCount = function () { - return this._knownBaseTypeCount; - }; - PullTypeSymbol.prototype.resetKnownBaseTypeCount = function () { - this._knownBaseTypeCount = 0; - }; - PullTypeSymbol.prototype.incrementKnownBaseCount = function () { - this._knownBaseTypeCount++; - }; - - PullTypeSymbol.prototype.setHasBaseTypeConflict = function () { - this._hasBaseTypeConflict = true; - }; - PullTypeSymbol.prototype.hasBaseTypeConflict = function () { - return this._hasBaseTypeConflict; - }; - - PullTypeSymbol.prototype.hasMembers = function () { - if (this._members !== TypeScript.sentinelEmptyArray) { - return true; - } - - var parents = this.getExtendedTypes(); - - for (var i = 0; i < parents.length; i++) { - if (parents[i].hasMembers()) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.setHasGenericSignature = function () { - this._hasGenericSignature = true; - }; - PullTypeSymbol.prototype.getHasGenericSignature = function () { - return this._hasGenericSignature; - }; - - PullTypeSymbol.prototype.setHasGenericMember = function () { - this._hasGenericMember = true; - }; - PullTypeSymbol.prototype.getHasGenericMember = function () { - return this._hasGenericMember; - }; - - PullTypeSymbol.prototype.setAssociatedContainerType = function (type) { - this._associatedContainerTypeSymbol = type; - }; - - PullTypeSymbol.prototype.getAssociatedContainerType = function () { - return this._associatedContainerTypeSymbol; - }; - - PullTypeSymbol.prototype.getArrayType = function () { - return this._arrayVersionOfThisType; - }; - - PullTypeSymbol.prototype.getElementType = function () { - return null; - }; - - PullTypeSymbol.prototype.setArrayType = function (arrayType) { - this._arrayVersionOfThisType = arrayType; - }; - - PullTypeSymbol.prototype.getFunctionSymbol = function () { - return this._functionSymbol; - }; - - PullTypeSymbol.prototype.setFunctionSymbol = function (symbol) { - if (symbol) { - this._functionSymbol = symbol; - } - }; - - PullTypeSymbol.prototype.findContainedNonMember = function (name) { - if (!this._containedNonMemberNameCache) { - return null; - } - - return this._containedNonMemberNameCache[name]; - }; - - PullTypeSymbol.prototype.findContainedNonMemberType = function (typeName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - if (!this._containedNonMemberTypeNameCache) { - return null; - } - - var nonMemberSymbol = this._containedNonMemberTypeNameCache[typeName]; - - if (nonMemberSymbol && kind !== 0 /* None */) { - nonMemberSymbol = TypeScript.hasFlag(nonMemberSymbol.kind, kind) ? nonMemberSymbol : null; - } - - return nonMemberSymbol; - }; - - PullTypeSymbol.prototype.findContainedNonMemberContainer = function (containerName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - if (!this._containedNonMemberContainerCache) { - return null; - } - - var nonMemberSymbol = this._containedNonMemberContainerCache[containerName]; - - if (nonMemberSymbol && kind !== 0 /* None */) { - nonMemberSymbol = TypeScript.hasFlag(nonMemberSymbol.kind, kind) ? nonMemberSymbol : null; - } - - return nonMemberSymbol; - }; - - PullTypeSymbol.prototype.addMember = function (memberSymbol) { - if (!memberSymbol) { - return; - } - - memberSymbol.setContainer(this); - - if (!this._memberNameCache) { - this._memberNameCache = TypeScript.createIntrinsicsObject(); - } - - if (this._members === TypeScript.sentinelEmptyArray) { - this._members = []; - } - - this._members.push(memberSymbol); - this._memberNameCache[memberSymbol.name] = memberSymbol; - }; - - PullTypeSymbol.prototype.addEnclosedMemberType = function (enclosedType) { - if (!enclosedType) { - return; - } - - enclosedType.setContainer(this); - - if (!this._enclosedTypeNameCache) { - this._enclosedTypeNameCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._enclosedMemberTypes) { - this._enclosedMemberTypes = []; - } - - this._enclosedMemberTypes[this._enclosedMemberTypes.length] = enclosedType; - this._enclosedTypeNameCache[enclosedType.name] = enclosedType; - }; - - PullTypeSymbol.prototype.addEnclosedMemberContainer = function (enclosedContainer) { - if (!enclosedContainer) { - return; - } - - enclosedContainer.setContainer(this); - - if (!this._enclosedContainerCache) { - this._enclosedContainerCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._enclosedMemberContainers) { - this._enclosedMemberContainers = []; - } - - this._enclosedMemberContainers[this._enclosedMemberContainers.length] = enclosedContainer; - this._enclosedContainerCache[enclosedContainer.name] = enclosedContainer; - }; - - PullTypeSymbol.prototype.addEnclosedNonMember = function (enclosedNonMember) { - if (!enclosedNonMember) { - return; - } - - enclosedNonMember.setContainer(this); - - if (!this._containedNonMemberNameCache) { - this._containedNonMemberNameCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberNameCache[enclosedNonMember.name] = enclosedNonMember; - }; - - PullTypeSymbol.prototype.addEnclosedNonMemberType = function (enclosedNonMemberType) { - if (!enclosedNonMemberType) { - return; - } - - enclosedNonMemberType.setContainer(this); - - if (!this._containedNonMemberTypeNameCache) { - this._containedNonMemberTypeNameCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberTypeNameCache[enclosedNonMemberType.name] = enclosedNonMemberType; - }; - - PullTypeSymbol.prototype.addEnclosedNonMemberContainer = function (enclosedNonMemberContainer) { - if (!enclosedNonMemberContainer) { - return; - } - - enclosedNonMemberContainer.setContainer(this); - - if (!this._containedNonMemberContainerCache) { - this._containedNonMemberContainerCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberContainerCache[enclosedNonMemberContainer.name] = enclosedNonMemberContainer; - }; - - PullTypeSymbol.prototype.addTypeParameter = function (typeParameter) { - if (!typeParameter) { - return; - } - - if (!typeParameter.getContainer()) { - typeParameter.setContainer(this); - } - - if (!this._typeParameterNameCache) { - this._typeParameterNameCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._typeParameters) { - this._typeParameters = []; - } - - this._typeParameters[this._typeParameters.length] = typeParameter; - this._typeParameterNameCache[typeParameter.getName()] = typeParameter; - }; - - PullTypeSymbol.prototype.getMembers = function () { - return this._members; - }; - - PullTypeSymbol.prototype.setHasDefaultConstructor = function (hasOne) { - if (typeof hasOne === "undefined") { hasOne = true; } - this._hasDefaultConstructor = hasOne; - }; - - PullTypeSymbol.prototype.getHasDefaultConstructor = function () { - return this._hasDefaultConstructor; - }; - - PullTypeSymbol.prototype.getConstructorMethod = function () { - return this._constructorMethod; - }; - - PullTypeSymbol.prototype.setConstructorMethod = function (constructorMethod) { - this._constructorMethod = constructorMethod; - }; - - PullTypeSymbol.prototype.getTypeParameters = function () { - if (!this._typeParameters) { - return TypeScript.sentinelEmptyArray; - } - - return this._typeParameters; - }; - - PullTypeSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - if (!!(this.kind && 8216 /* SomeInstantiatableType */) && this.isNamedTypeSymbol() && !this.isTypeParameter()) { - return this.getTypeParameters(); - } - - if (!this._allowedToReferenceTypeParameters) { - this._allowedToReferenceTypeParameters = TypeScript.PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl(this.getDeclarations()[0]); - } - - return this._allowedToReferenceTypeParameters; - }; - - PullTypeSymbol.prototype.isGeneric = function () { - return (this._typeParameters && this._typeParameters.length > 0) || this._hasGenericSignature || this._hasGenericMember || this.isArrayNamedTypeReference(); - }; - - PullTypeSymbol.prototype.canUseSimpleInstantiationCache = function (typeArgumentMap) { - if (this.isTypeParameter()) { - return true; - } - - var typeParameters = this.getTypeParameters(); - return typeArgumentMap && this.isNamedTypeSymbol() && typeParameters.length === 1 && typeArgumentMap[typeParameters[0].pullSymbolID].kind !== 8388608 /* ObjectType */; - }; - - PullTypeSymbol.prototype.getSimpleInstantiationCacheId = function (typeArgumentMap) { - if (this.isTypeParameter()) { - return typeArgumentMap[0].pullSymbolID; - } - - return typeArgumentMap[this.getTypeParameters()[0].pullSymbolID].pullSymbolID; - }; - - PullTypeSymbol.prototype.addSpecialization = function (specializedVersionOfThisType, typeArgumentMap) { - if (this.canUseSimpleInstantiationCache(typeArgumentMap)) { - if (!this._simpleInstantiationCache) { - this._simpleInstantiationCache = []; - } - - this._simpleInstantiationCache[this.getSimpleInstantiationCacheId(typeArgumentMap)] = specializedVersionOfThisType; - } else { - if (!this._complexInstantiationCache) { - this._complexInstantiationCache = TypeScript.createIntrinsicsObject(); - } - - this._complexInstantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)] = specializedVersionOfThisType; - } - - if (!this._specializedVersionsOfThisType) { - this._specializedVersionsOfThisType = []; - } - - this._specializedVersionsOfThisType.push(specializedVersionOfThisType); - }; - - PullTypeSymbol.prototype.getSpecialization = function (typeArgumentMap) { - if (this.canUseSimpleInstantiationCache(typeArgumentMap)) { - if (!this._simpleInstantiationCache) { - return null; - } - - var result = this._simpleInstantiationCache[this.getSimpleInstantiationCacheId(typeArgumentMap)]; - return result || null; - } else { - if (!this._complexInstantiationCache) { - return null; - } - - if (this.getAllowedToReferenceTypeParameters().length == 0) { - return this; - } - - var result = this._complexInstantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)]; - return result || null; - } - }; - - PullTypeSymbol.prototype.getKnownSpecializations = function () { - if (!this._specializedVersionsOfThisType) { - return TypeScript.sentinelEmptyArray; - } - - return this._specializedVersionsOfThisType; - }; - - PullTypeSymbol.prototype.getTypeArguments = function () { - return null; - }; - - PullTypeSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - return this.getTypeParameters(); - }; - - PullTypeSymbol.prototype.addCallSignaturePrerequisite = function (callSignature) { - if (!this._callSignatures) { - this._callSignatures = []; - } - - if (callSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - callSignature.functionType = this; - }; - - PullTypeSymbol.prototype.appendCallSignature = function (callSignature) { - this.addCallSignaturePrerequisite(callSignature); - this._callSignatures.push(callSignature); - }; - - PullTypeSymbol.prototype.insertCallSignatureAtIndex = function (callSignature, index) { - this.addCallSignaturePrerequisite(callSignature); - TypeScript.Debug.assert(index <= this._callSignatures.length); - if (index === this._callSignatures.length) { - this._callSignatures.push(callSignature); - } else { - this._callSignatures.splice(index, 0, callSignature); - } - }; - - PullTypeSymbol.prototype.addConstructSignaturePrerequisite = function (constructSignature) { - if (!this._constructSignatures) { - this._constructSignatures = []; - } - - if (constructSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - constructSignature.functionType = this; - }; - - PullTypeSymbol.prototype.appendConstructSignature = function (constructSignature) { - this.addConstructSignaturePrerequisite(constructSignature); - this._constructSignatures.push(constructSignature); - }; - - PullTypeSymbol.prototype.insertConstructSignatureAtIndex = function (constructSignature, index) { - this.addConstructSignaturePrerequisite(constructSignature); - TypeScript.Debug.assert(index <= this._constructSignatures.length); - if (index === this._constructSignatures.length) { - this._constructSignatures.push(constructSignature); - } else { - this._constructSignatures.splice(index, 0, constructSignature); - } - }; - - PullTypeSymbol.prototype.addIndexSignature = function (indexSignature) { - if (!this._indexSignatures) { - this._indexSignatures = []; - } - - this._indexSignatures[this._indexSignatures.length] = indexSignature; - - if (indexSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - indexSignature.functionType = this; - }; - - PullTypeSymbol.prototype.hasOwnCallSignatures = function () { - return this._callSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnCallSignatures = function () { - return this._callSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getCallSignatures = function () { - if (this._allCallSignatures) { - return this._allCallSignatures; - } - - var signatures = []; - - if (this._callSignatures) { - signatures = signatures.concat(this._callSignatures); - } - - if (this._extendedTypes && this.kind === 16 /* Interface */) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._callSignatures, this._extendedTypes[i].getCallSignatures(), signatures); - } - } - - this._allCallSignatures = signatures; - - return signatures; - }; - - PullTypeSymbol.prototype.hasOwnConstructSignatures = function () { - return this._constructSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnConstructSignatures = function () { - return this._constructSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getConstructSignatures = function () { - var signatures = []; - - if (this._constructSignatures) { - signatures = signatures.concat(this._constructSignatures); - } - - if (this._extendedTypes && this.kind === 16 /* Interface */) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._constructSignatures, this._extendedTypes[i].getConstructSignatures(), signatures); - } - } - - return signatures; - }; - - PullTypeSymbol.prototype.hasOwnIndexSignatures = function () { - return this._indexSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnIndexSignatures = function () { - return this._indexSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getIndexSignatures = function () { - if (this._allIndexSignatures) { - return this._allIndexSignatures; - } - - var signatures = []; - - if (this._indexSignatures) { - signatures = signatures.concat(this._indexSignatures); - } - - if (this._extendedTypes) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._indexSignatures, this._extendedTypes[i].getIndexSignatures(), signatures); - } - } - - this._allIndexSignatures = signatures; - - return signatures; - }; - - PullTypeSymbol.prototype.getIndexSignaturesOfAugmentedType = function (resolver, globalFunctionInterface, globalObjectInterface) { - if (!this._allIndexSignaturesOfAugmentedType) { - var initialIndexSignatures = this.getIndexSignatures(); - var shouldAddFunctionSignatures = false; - var shouldAddObjectSignatures = false; - - if (globalFunctionInterface && this.isFunctionType() && this !== globalFunctionInterface) { - var functionIndexSignatures = globalFunctionInterface.getIndexSignatures(); - if (functionIndexSignatures.length) { - shouldAddFunctionSignatures = true; - } - } - - if (globalObjectInterface && this !== globalObjectInterface) { - var objectIndexSignatures = globalObjectInterface.getIndexSignatures(); - if (objectIndexSignatures.length) { - shouldAddObjectSignatures = true; - } - } - - if (shouldAddFunctionSignatures || shouldAddObjectSignatures) { - this._allIndexSignaturesOfAugmentedType = initialIndexSignatures.slice(0); - if (shouldAddFunctionSignatures) { - resolver._addUnhiddenSignaturesFromBaseType(initialIndexSignatures, functionIndexSignatures, this._allIndexSignaturesOfAugmentedType); - } - if (shouldAddObjectSignatures) { - if (shouldAddFunctionSignatures) { - initialIndexSignatures = initialIndexSignatures.concat(functionIndexSignatures); - } - resolver._addUnhiddenSignaturesFromBaseType(initialIndexSignatures, objectIndexSignatures, this._allIndexSignaturesOfAugmentedType); - } - } else { - this._allIndexSignaturesOfAugmentedType = initialIndexSignatures; - } - } - - return this._allIndexSignaturesOfAugmentedType; - }; - - PullTypeSymbol.prototype.addImplementedType = function (implementedType) { - if (!implementedType) { - return; - } - - if (!this._implementedTypes) { - this._implementedTypes = []; - } - - this._implementedTypes[this._implementedTypes.length] = implementedType; - - implementedType.addTypeThatExplicitlyImplementsThisType(this); - }; - - PullTypeSymbol.prototype.getImplementedTypes = function () { - if (!this._implementedTypes) { - return TypeScript.sentinelEmptyArray; - } - - return this._implementedTypes; - }; - - PullTypeSymbol.prototype.addExtendedType = function (extendedType) { - if (!extendedType) { - return; - } - - if (!this._extendedTypes) { - this._extendedTypes = []; - } - - this._extendedTypes[this._extendedTypes.length] = extendedType; - - extendedType.addTypeThatExtendsThisType(this); - }; - - PullTypeSymbol.prototype.getExtendedTypes = function () { - if (!this._extendedTypes) { - return TypeScript.sentinelEmptyArray; - } - - return this._extendedTypes; - }; - - PullTypeSymbol.prototype.addTypeThatExtendsThisType = function (type) { - if (!type) { - return; - } - - if (!this._typesThatExtendThisType) { - this._typesThatExtendThisType = []; - } - - this._typesThatExtendThisType[this._typesThatExtendThisType.length] = type; - }; - - PullTypeSymbol.prototype.getTypesThatExtendThisType = function () { - if (!this._typesThatExtendThisType) { - this._typesThatExtendThisType = []; - } - - return this._typesThatExtendThisType; - }; - - PullTypeSymbol.prototype.addTypeThatExplicitlyImplementsThisType = function (type) { - if (!type) { - return; - } - - if (!this._typesThatExplicitlyImplementThisType) { - this._typesThatExplicitlyImplementThisType = []; - } - - this._typesThatExplicitlyImplementThisType[this._typesThatExplicitlyImplementThisType.length] = type; - }; - - PullTypeSymbol.prototype.getTypesThatExplicitlyImplementThisType = function () { - if (!this._typesThatExplicitlyImplementThisType) { - this._typesThatExplicitlyImplementThisType = []; - } - - return this._typesThatExplicitlyImplementThisType; - }; - - PullTypeSymbol.prototype.hasBase = function (potentialBase, visited) { - if (typeof visited === "undefined") { visited = []; } - if (this === potentialBase || this.getRootSymbol() === potentialBase || this === potentialBase.getRootSymbol()) { - return true; - } - - if (TypeScript.ArrayUtilities.contains(visited, this)) { - return true; - } - - visited.push(this); - - var extendedTypes = this.getExtendedTypes(); - - for (var i = 0; i < extendedTypes.length; i++) { - if (extendedTypes[i].hasBase(potentialBase, visited)) { - return true; - } - } - - var implementedTypes = this.getImplementedTypes(); - - for (var i = 0; i < implementedTypes.length; i++) { - if (implementedTypes[i].hasBase(potentialBase, visited)) { - return true; - } - } - - visited.pop(); - - return false; - }; - - PullTypeSymbol.prototype.isValidBaseKind = function (baseType, isExtendedType) { - if (baseType.isError()) { - return false; - } - - var thisIsClass = this.isClass(); - if (isExtendedType) { - if (thisIsClass) { - return baseType.kind === 8 /* Class */; - } - } else { - if (!thisIsClass) { - return false; - } - } - - return !!(baseType.kind & (16 /* Interface */ | 8 /* Class */)); - }; - - PullTypeSymbol.prototype.findMember = function (name, lookInParent) { - var memberSymbol = null; - - if (this._memberNameCache) { - memberSymbol = this._memberNameCache[name]; - } - - if (memberSymbol || !lookInParent) { - return memberSymbol; - } - - if (this._extendedTypes) { - for (var i = 0; i < this._extendedTypes.length; i++) { - memberSymbol = this._extendedTypes[i].findMember(name, lookInParent); - - if (memberSymbol) { - return memberSymbol; - } - } - } - - return null; - }; - - PullTypeSymbol.prototype.findNestedType = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - var memberSymbol; - - if (!this._enclosedTypeNameCache) { - return null; - } - - memberSymbol = this._enclosedTypeNameCache[name]; - - if (memberSymbol && kind !== 0 /* None */) { - memberSymbol = TypeScript.hasFlag(memberSymbol.kind, kind) ? memberSymbol : null; - } - - return memberSymbol; - }; - - PullTypeSymbol.prototype.findNestedContainer = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - var memberSymbol; - - if (!this._enclosedContainerCache) { - return null; - } - - memberSymbol = this._enclosedContainerCache[name]; - - if (memberSymbol && kind !== 0 /* None */) { - memberSymbol = TypeScript.hasFlag(memberSymbol.kind, kind) ? memberSymbol : null; - } - - return memberSymbol; - }; - - PullTypeSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - var allMembers = []; - - if (this._members !== TypeScript.sentinelEmptyArray) { - for (var i = 0, n = this._members.length; i < n; i++) { - var member = this._members[i]; - if ((member.kind & searchDeclKind) && (memberVisiblity !== 2 /* externallyVisible */ || !member.anyDeclHasFlag(2 /* Private */))) { - allMembers[allMembers.length] = member; - } - } - } - - if (this._extendedTypes) { - var extenedMembersVisibility = memberVisiblity !== 0 /* all */ ? 2 /* externallyVisible */ : 0 /* all */; - - for (var i = 0, n = this._extendedTypes.length; i < n; i++) { - var extendedMembers = this._extendedTypes[i].getAllMembers(searchDeclKind, extenedMembersVisibility); - - for (var j = 0, m = extendedMembers.length; j < m; j++) { - var extendedMember = extendedMembers[j]; - if (!(this._memberNameCache && this._memberNameCache[extendedMember.name])) { - allMembers[allMembers.length] = extendedMember; - } - } - } - } - - if (this.isContainer()) { - if (this._enclosedMemberTypes) { - for (var i = 0; i < this._enclosedMemberTypes.length; i++) { - allMembers[allMembers.length] = this._enclosedMemberTypes[i]; - } - } - if (this._enclosedMemberContainers) { - for (var i = 0; i < this._enclosedMemberContainers.length; i++) { - allMembers[allMembers.length] = this._enclosedMemberContainers[i]; - } - } - } - - return allMembers; - }; - - PullTypeSymbol.prototype.findTypeParameter = function (name) { - if (!this._typeParameterNameCache) { - return null; - } - - return this._typeParameterNameCache[name]; - }; - - PullTypeSymbol.prototype.setResolved = function () { - _super.prototype.setResolved.call(this); - }; - - PullTypeSymbol.prototype.getNamePartForFullName = function () { - var name = _super.prototype.getNamePartForFullName.call(this); - - var typars = this.getTypeArgumentsOrTypeParameters(); - var typarString = PullSymbol.getTypeParameterString(typars, this, true); - return name + typarString; - }; - - PullTypeSymbol.prototype.getScopedName = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName) { - return this.getScopedNameEx(scopeSymbol, skipTypeParametersInName, useConstraintInName, false, false, skipInternalAliasName).toString(); - }; - - PullTypeSymbol.prototype.isNamedTypeSymbol = function () { - var kind = this.kind; - if (kind === 2 /* Primitive */ || kind === 8 /* Class */ || kind === 4 /* Container */ || kind === 32 /* DynamicModule */ || kind === 128 /* TypeAlias */ || kind === 64 /* Enum */ || kind === 8192 /* TypeParameter */ || ((kind === 16 /* Interface */ || kind === 8388608 /* ObjectType */) && this.name !== "")) { - return true; - } - - return false; - }; - - PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var s = this.getScopedNameEx(scopeSymbol, false, useConstraintInName).toString(); - return s; - }; - - PullTypeSymbol.prototype.getScopedNameEx = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName, shouldAllowArrayType) { - if (typeof shouldAllowArrayType === "undefined") { shouldAllowArrayType = true; } - if (this.isArrayNamedTypeReference() && shouldAllowArrayType) { - var elementType = this.getElementType(); - var elementMemberName = elementType ? (elementType.isArrayNamedTypeReference() || elementType.isNamedTypeSymbol() ? elementType.getScopedNameEx(scopeSymbol, false, false, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName) : elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : TypeScript.MemberName.create("any"); - return TypeScript.MemberName.create(elementMemberName, "", "[]"); - } - - if (!this.isNamedTypeSymbol()) { - return this.getMemberTypeNameEx(true, scopeSymbol, getPrettyTypeName); - } - - if (skipTypeParametersInName) { - return TypeScript.MemberName.create(_super.prototype.getScopedName.call(this, scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName)); - } else { - var builder = new TypeScript.MemberNameArray(); - builder.prefix = _super.prototype.getScopedName.call(this, scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - - var typars = this.getTypeArgumentsOrTypeParameters(); - builder.add(PullSymbol.getTypeParameterStringEx(typars, scopeSymbol, getTypeParamMarkerInfo, useConstraintInName)); - - return builder; - } - }; - - PullTypeSymbol.prototype.hasOnlyOverloadCallSignatures = function () { - var members = this.getMembers(); - var callSignatures = this.getCallSignatures(); - var constructSignatures = this.getConstructSignatures(); - return members.length === 0 && constructSignatures.length === 0 && callSignatures.length > 1; - }; - - PullTypeSymbol.prototype.getTypeOfSymbol = function () { - var associatedContainerType = this.getAssociatedContainerType(); - if (associatedContainerType && associatedContainerType.isNamedTypeSymbol()) { - return associatedContainerType; - } - - var functionSymbol = this.getFunctionSymbol(); - if (functionSymbol && functionSymbol.kind === 16384 /* Function */ && !TypeScript.PullHelpers.isSymbolLocal(functionSymbol)) { - return TypeScript.PullHelpers.isExportedSymbolInClodule(functionSymbol) ? null : functionSymbol; - } - - return null; - }; - - PullTypeSymbol.prototype.getMemberTypeNameEx = function (topLevel, scopeSymbol, getPrettyTypeName) { - var members = this.getMembers(); - var callSignatures = this.getCallSignatures(); - var constructSignatures = this.getConstructSignatures(); - var indexSignatures = this.getIndexSignatures(); - - if (members.length > 0 || callSignatures.length > 0 || constructSignatures.length > 0 || indexSignatures.length > 0) { - var typeOfSymbol = this.getTypeOfSymbol(); - if (typeOfSymbol) { - var nameForTypeOf = typeOfSymbol.getScopedNameEx(scopeSymbol, true); - return TypeScript.MemberName.create(nameForTypeOf, "typeof ", ""); - } - - if (this._inMemberTypeNameEx) { - return TypeScript.MemberName.create("any"); - } - - this._inMemberTypeNameEx = true; - - var allMemberNames = new TypeScript.MemberNameArray(); - var curlies = !topLevel || indexSignatures.length !== 0; - var delim = "; "; - for (var i = 0; i < members.length; i++) { - if (members[i].kind === 65536 /* Method */ && members[i].type.hasOnlyOverloadCallSignatures()) { - var methodCallSignatures = members[i].type.getCallSignatures(); - var nameStr = members[i].getDisplayName(scopeSymbol) + (members[i].isOptional ? "?" : ""); - ; - var methodMemberNames = PullSignatureSymbol.getSignaturesTypeNameEx(methodCallSignatures, nameStr, false, false, scopeSymbol); - allMemberNames.addAll(methodMemberNames); - } else { - var memberTypeName = members[i].getNameAndTypeNameEx(scopeSymbol); - if (memberTypeName.isArray() && memberTypeName.delim === delim) { - allMemberNames.addAll(memberTypeName.entries); - } else { - allMemberNames.add(memberTypeName); - } - } - curlies = true; - } - - var getPrettyFunctionOverload = getPrettyTypeName && !curlies && this.hasOnlyOverloadCallSignatures(); - - var signatureCount = callSignatures.length + constructSignatures.length + indexSignatures.length; - var useShortFormSignature = !curlies && (signatureCount === 1); - var signatureMemberName; - - if (callSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(callSignatures, "", useShortFormSignature, false, scopeSymbol, getPrettyFunctionOverload); - allMemberNames.addAll(signatureMemberName); - } - - if (constructSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(constructSignatures, "new", useShortFormSignature, false, scopeSymbol); - allMemberNames.addAll(signatureMemberName); - } - - if (indexSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(indexSignatures, "", useShortFormSignature, true, scopeSymbol); - allMemberNames.addAll(signatureMemberName); - } - - if ((curlies) || (!getPrettyFunctionOverload && (signatureCount > 1) && topLevel)) { - allMemberNames.prefix = "{ "; - allMemberNames.suffix = "}"; - allMemberNames.delim = delim; - } else if (allMemberNames.entries.length > 1) { - allMemberNames.delim = delim; - } - - this._inMemberTypeNameEx = false; - - return allMemberNames; - } - - return TypeScript.MemberName.create("{}"); - }; - - PullTypeSymbol.prototype.getGenerativeTypeClassification = function (enclosingType) { - return 2 /* Closed */; - }; - - PullTypeSymbol.prototype.wrapsSomeTypeParameter = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - return this.getWrappingTypeParameterID(typeParameterArgumentMap, skipTypeArgumentCheck) != 0; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterID = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - var type = this; - - if (type.isTypeParameter()) { - if (typeParameterArgumentMap[type.pullSymbolID] || typeParameterArgumentMap[type.getRootSymbol().pullSymbolID]) { - return type.pullSymbolID; - } - - var constraint = type.getConstraint(); - var wrappingTypeParameterID = constraint ? constraint.getWrappingTypeParameterID(typeParameterArgumentMap) : 0; - return wrappingTypeParameterID; - } - - if (type.inWrapCheck) { - return 0; - } - - this._wrapsTypeParameterCache = this._wrapsTypeParameterCache || new TypeScript.WrapsTypeParameterCache(); - var wrappingTypeParameterID = this._wrapsTypeParameterCache.getWrapsTypeParameter(typeParameterArgumentMap); - if (wrappingTypeParameterID === undefined) { - wrappingTypeParameterID = this.getWrappingTypeParameterIDWorker(typeParameterArgumentMap, skipTypeArgumentCheck); - - this._wrapsTypeParameterCache.setWrapsTypeParameter(typeParameterArgumentMap, wrappingTypeParameterID); - } - return wrappingTypeParameterID; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterIDFromSignatures = function (signatures, typeParameterArgumentMap) { - for (var i = 0; i < signatures.length; i++) { - var wrappingTypeParameterID = signatures[i].getWrappingTypeParameterID(typeParameterArgumentMap); - if (wrappingTypeParameterID !== 0) { - return wrappingTypeParameterID; - } - } - - return 0; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterIDWorker = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - var type = this; - var wrappingTypeParameterID = 0; - - if (!skipTypeArgumentCheck) { - type.inWrapCheck = true; - - var typeArguments = type.getTypeArguments(); - - if (type.isGeneric() && !typeArguments) { - typeArguments = type.getTypeParameters(); - } - - if (typeArguments) { - for (var i = 0; !wrappingTypeParameterID && i < typeArguments.length; i++) { - wrappingTypeParameterID = typeArguments[i].getWrappingTypeParameterID(typeParameterArgumentMap); - } - } - } - - if (skipTypeArgumentCheck || !(type.kind & 8216 /* SomeInstantiatableType */) || !type.name) { - var members = type.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - for (var i = 0; !wrappingTypeParameterID && i < members.length; i++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(members[i]); - wrappingTypeParameterID = members[i].type.getWrappingTypeParameterID(typeParameterArgumentMap); - } - - wrappingTypeParameterID = wrappingTypeParameterID || this.getWrappingTypeParameterIDFromSignatures(type.getCallSignatures(), typeParameterArgumentMap) || this.getWrappingTypeParameterIDFromSignatures(type.getConstructSignatures(), typeParameterArgumentMap) || this.getWrappingTypeParameterIDFromSignatures(type.getIndexSignatures(), typeParameterArgumentMap); - } - - if (!skipTypeArgumentCheck) { - type.inWrapCheck = false; - } - - return wrappingTypeParameterID; - }; - - PullTypeSymbol.prototype.wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference = function (enclosingType) { - TypeScript.Debug.assert(this.isNamedTypeSymbol()); - TypeScript.Debug.assert(TypeScript.PullHelpers.getRootType(enclosingType) == enclosingType); - var knownWrapMap = TypeScript.BitMatrix.getBitMatrix(true); - var wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap); - knownWrapMap.release(); - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse = function (enclosingType, knownWrapMap) { - var wrapsIntoInfinitelyExpandingTypeReference = knownWrapMap.valueAt(this.pullSymbolID, enclosingType.pullSymbolID); - if (wrapsIntoInfinitelyExpandingTypeReference != undefined) { - return wrapsIntoInfinitelyExpandingTypeReference; - } - - if (this.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - this.inWrapInfiniteExpandingReferenceCheck = true; - wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType, knownWrapMap); - knownWrapMap.setValueAt(this.pullSymbolID, enclosingType.pullSymbolID, wrapsIntoInfinitelyExpandingTypeReference); - this.inWrapInfiniteExpandingReferenceCheck = false; - - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker = function (enclosingType, knownWrapMap) { - var thisRootType = TypeScript.PullHelpers.getRootType(this); - - if (thisRootType != enclosingType) { - var thisIsNamedType = this.isNamedTypeSymbol(); - - if (thisIsNamedType) { - if (thisRootType.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - thisRootType.inWrapInfiniteExpandingReferenceCheck = true; - } - - var wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceStructure(enclosingType, knownWrapMap); - - if (thisIsNamedType) { - thisRootType.inWrapInfiniteExpandingReferenceCheck = false; - } - - return wrapsIntoInfinitelyExpandingTypeReference; - } - - var enclosingTypeParameters = enclosingType.getTypeParameters(); - var typeArguments = this.getTypeArguments(); - for (var i = 0; i < typeArguments.length; i++) { - if (TypeScript.ArrayUtilities.contains(enclosingTypeParameters, typeArguments[i])) { - continue; - } - - if (typeArguments[i].wrapsSomeTypeParameter(this.getTypeParameterArgumentMap())) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceStructure = function (enclosingType, knownWrapMap) { - var members = this.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - for (var i = 0; i < members.length; i++) { - if (members[i].type && members[i].type._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - } - - var sigs = this.getCallSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - sigs = this.getConstructSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - sigs = this.getIndexSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.widenedType = function (resolver, ast, context) { - if (!this._widenedType) { - this._widenedType = resolver.widenType(this, ast, context); - } - return this._widenedType; - }; - return PullTypeSymbol; - })(PullSymbol); - TypeScript.PullTypeSymbol = PullTypeSymbol; - - var PullPrimitiveTypeSymbol = (function (_super) { - __extends(PullPrimitiveTypeSymbol, _super); - function PullPrimitiveTypeSymbol(name) { - _super.call(this, name, 2 /* Primitive */); - - this.isResolved = true; - } - PullPrimitiveTypeSymbol.prototype.isAny = function () { - return !this.isStringConstant() && this.name === "any"; - }; - - PullPrimitiveTypeSymbol.prototype.isNull = function () { - return !this.isStringConstant() && this.name === "null"; - }; - - PullPrimitiveTypeSymbol.prototype.isUndefined = function () { - return !this.isStringConstant() && this.name === "undefined"; - }; - - PullPrimitiveTypeSymbol.prototype.isStringConstant = function () { - return false; - }; - - PullPrimitiveTypeSymbol.prototype.setUnresolved = function () { - }; - - PullPrimitiveTypeSymbol.prototype.getDisplayName = function () { - if (this.isNull() || this.isUndefined()) { - return "any"; - } else { - return _super.prototype.getDisplayName.call(this); - } - }; - return PullPrimitiveTypeSymbol; - })(PullTypeSymbol); - TypeScript.PullPrimitiveTypeSymbol = PullPrimitiveTypeSymbol; - - var PullStringConstantTypeSymbol = (function (_super) { - __extends(PullStringConstantTypeSymbol, _super); - function PullStringConstantTypeSymbol(name) { - _super.call(this, name); - } - PullStringConstantTypeSymbol.prototype.isStringConstant = function () { - return true; - }; - return PullStringConstantTypeSymbol; - })(PullPrimitiveTypeSymbol); - TypeScript.PullStringConstantTypeSymbol = PullStringConstantTypeSymbol; - - var PullErrorTypeSymbol = (function (_super) { - __extends(PullErrorTypeSymbol, _super); - function PullErrorTypeSymbol(_anyType, name) { - _super.call(this, name); - this._anyType = _anyType; - - TypeScript.Debug.assert(this._anyType); - this.isResolved = true; - } - PullErrorTypeSymbol.prototype.isError = function () { - return true; - }; - - PullErrorTypeSymbol.prototype._getResolver = function () { - return this._anyType._getResolver(); - }; - - PullErrorTypeSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - - PullErrorTypeSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - - PullErrorTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - return PullErrorTypeSymbol; - })(PullPrimitiveTypeSymbol); - TypeScript.PullErrorTypeSymbol = PullErrorTypeSymbol; - - var PullContainerSymbol = (function (_super) { - __extends(PullContainerSymbol, _super); - function PullContainerSymbol(name, kind) { - _super.call(this, name, kind); - this.instanceSymbol = null; - this.assignedValue = null; - this.assignedType = null; - this.assignedContainer = null; - } - PullContainerSymbol.prototype.isContainer = function () { - return true; - }; - - PullContainerSymbol.prototype.setInstanceSymbol = function (symbol) { - this.instanceSymbol = symbol; - }; - - PullContainerSymbol.prototype.getInstanceSymbol = function () { - return this.instanceSymbol; - }; - - PullContainerSymbol.prototype.setExportAssignedValueSymbol = function (symbol) { - this.assignedValue = symbol; - }; - - PullContainerSymbol.prototype.getExportAssignedValueSymbol = function () { - return this.assignedValue; - }; - - PullContainerSymbol.prototype.setExportAssignedTypeSymbol = function (type) { - this.assignedType = type; - }; - - PullContainerSymbol.prototype.getExportAssignedTypeSymbol = function () { - return this.assignedType; - }; - - PullContainerSymbol.prototype.setExportAssignedContainerSymbol = function (container) { - this.assignedContainer = container; - }; - - PullContainerSymbol.prototype.getExportAssignedContainerSymbol = function () { - return this.assignedContainer; - }; - - PullContainerSymbol.prototype.hasExportAssignment = function () { - return !!this.assignedValue || !!this.assignedType || !!this.assignedContainer; - }; - - PullContainerSymbol.usedAsSymbol = function (containerSymbol, symbol) { - if (!containerSymbol || !containerSymbol.isContainer()) { - return false; - } - - if (!containerSymbol.isAlias() && containerSymbol.type === symbol) { - return true; - } - - var moduleSymbol = containerSymbol; - var valueExportSymbol = moduleSymbol.getExportAssignedValueSymbol(); - var typeExportSymbol = moduleSymbol.getExportAssignedTypeSymbol(); - var containerExportSymbol = moduleSymbol.getExportAssignedContainerSymbol(); - if (valueExportSymbol || typeExportSymbol || containerExportSymbol) { - return valueExportSymbol === symbol || typeExportSymbol == symbol || containerExportSymbol == symbol || PullContainerSymbol.usedAsSymbol(containerExportSymbol, symbol); - } - - return false; - }; - - PullContainerSymbol.prototype.getInstanceType = function () { - return this.instanceSymbol ? this.instanceSymbol.type : null; - }; - return PullContainerSymbol; - })(PullTypeSymbol); - TypeScript.PullContainerSymbol = PullContainerSymbol; - - var PullTypeAliasSymbol = (function (_super) { - __extends(PullTypeAliasSymbol, _super); - function PullTypeAliasSymbol(name) { - _super.call(this, name, 128 /* TypeAlias */); - this._assignedValue = null; - this._assignedType = null; - this._assignedContainer = null; - this._isUsedAsValue = false; - this._typeUsedExternally = false; - this._isUsedInExportAlias = false; - this.retrievingExportAssignment = false; - this.linkedAliasSymbols = null; - } - PullTypeAliasSymbol.prototype.isUsedInExportedAlias = function () { - this._resolveDeclaredSymbol(); - return this._isUsedInExportAlias; - }; - - PullTypeAliasSymbol.prototype.typeUsedExternally = function () { - this._resolveDeclaredSymbol(); - return this._typeUsedExternally; - }; - - PullTypeAliasSymbol.prototype.isUsedAsValue = function () { - this._resolveDeclaredSymbol(); - return this._isUsedAsValue; - }; - - PullTypeAliasSymbol.prototype.setTypeUsedExternally = function () { - this._typeUsedExternally = true; - }; - - PullTypeAliasSymbol.prototype.setIsUsedInExportedAlias = function () { - this._isUsedInExportAlias = true; - if (this.linkedAliasSymbols) { - this.linkedAliasSymbols.forEach(function (s) { - return s.setIsUsedInExportedAlias(); - }); - } - }; - - PullTypeAliasSymbol.prototype.addLinkedAliasSymbol = function (contingentValueSymbol) { - if (!this.linkedAliasSymbols) { - this.linkedAliasSymbols = [contingentValueSymbol]; - } else { - this.linkedAliasSymbols.push(contingentValueSymbol); - } - }; - - PullTypeAliasSymbol.prototype.setIsUsedAsValue = function () { - this._isUsedAsValue = true; - if (this.linkedAliasSymbols) { - this.linkedAliasSymbols.forEach(function (s) { - return s.setIsUsedAsValue(); - }); - } - }; - - PullTypeAliasSymbol.prototype.assignedValue = function () { - this._resolveDeclaredSymbol(); - return this._assignedValue; - }; - - PullTypeAliasSymbol.prototype.assignedType = function () { - this._resolveDeclaredSymbol(); - return this._assignedType; - }; - - PullTypeAliasSymbol.prototype.assignedContainer = function () { - this._resolveDeclaredSymbol(); - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.isAlias = function () { - return true; - }; - PullTypeAliasSymbol.prototype.isContainer = function () { - return true; - }; - - PullTypeAliasSymbol.prototype.setAssignedValueSymbol = function (symbol) { - this._assignedValue = symbol; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedValueSymbol = function () { - if (this._assignedValue) { - return this._assignedValue; - } - - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedValueSymbol(); - this.retrievingExportAssignment = false; - return sym; - } - - return null; - }; - - PullTypeAliasSymbol.prototype.setAssignedTypeSymbol = function (type) { - this._assignedType = type; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedTypeSymbol = function () { - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedType) { - if (this._assignedType.isAlias()) { - this.retrievingExportAssignment = true; - var sym = this._assignedType.getExportAssignedTypeSymbol(); - this.retrievingExportAssignment = false; - } else if (this._assignedType !== this._assignedContainer) { - return this._assignedType; - } - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedTypeSymbol(); - this.retrievingExportAssignment = false; - if (sym) { - return sym; - } - } - - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.setAssignedContainerSymbol = function (container) { - this._assignedContainer = container; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedContainerSymbol = function () { - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedContainerSymbol(); - this.retrievingExportAssignment = false; - if (sym) { - return sym; - } - } - - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.getMembers = function () { - if (this._assignedType) { - return this._assignedType.getMembers(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getCallSignatures = function () { - if (this._assignedType) { - return this._assignedType.getCallSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getConstructSignatures = function () { - if (this._assignedType) { - return this._assignedType.getConstructSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getIndexSignatures = function () { - if (this._assignedType) { - return this._assignedType.getIndexSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.findMember = function (name) { - if (this._assignedType) { - return this._assignedType.findMember(name, true); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.findNestedType = function (name) { - if (this._assignedType) { - return this._assignedType.findNestedType(name); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.findNestedContainer = function (name) { - if (this._assignedType) { - return this._assignedType.findNestedContainer(name); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisibility) { - if (this._assignedType) { - return this._assignedType.getAllMembers(searchDeclKind, memberVisibility); - } - - return TypeScript.sentinelEmptyArray; - }; - return PullTypeAliasSymbol; - })(PullTypeSymbol); - TypeScript.PullTypeAliasSymbol = PullTypeAliasSymbol; - - var PullTypeParameterSymbol = (function (_super) { - __extends(PullTypeParameterSymbol, _super); - function PullTypeParameterSymbol(name) { - _super.call(this, name, 8192 /* TypeParameter */); - this._constraint = null; - } - PullTypeParameterSymbol.prototype.isTypeParameter = function () { - return true; - }; - - PullTypeParameterSymbol.prototype.setConstraint = function (constraintType) { - this._constraint = constraintType; - }; - - PullTypeParameterSymbol.prototype.getConstraint = function () { - return this._constraint; - }; - - PullTypeParameterSymbol.prototype.getBaseConstraint = function (semanticInfoChain) { - var preBaseConstraint = this.getConstraintRecursively({}); - TypeScript.Debug.assert(preBaseConstraint === null || !preBaseConstraint.isTypeParameter()); - return preBaseConstraint || semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeParameterSymbol.prototype.getConstraintRecursively = function (visitedTypeParameters) { - var constraint = this.getConstraint(); - - if (constraint) { - if (constraint.isTypeParameter()) { - var constraintAsTypeParameter = constraint; - if (!visitedTypeParameters[constraintAsTypeParameter.pullSymbolID]) { - visitedTypeParameters[constraintAsTypeParameter.pullSymbolID] = constraintAsTypeParameter; - return constraintAsTypeParameter.getConstraintRecursively(visitedTypeParameters); - } - } else { - return constraint; - } - } - - return null; - }; - - PullTypeParameterSymbol.prototype.getDefaultConstraint = function (semanticInfoChain) { - return this._constraint || semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeParameterSymbol.prototype.getCallSignatures = function () { - if (this._constraint) { - return this._constraint.getCallSignatures(); - } - - return _super.prototype.getCallSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.getConstructSignatures = function () { - if (this._constraint) { - return this._constraint.getConstructSignatures(); - } - - return _super.prototype.getConstructSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.getIndexSignatures = function () { - if (this._constraint) { - return this._constraint.getIndexSignatures(); - } - - return _super.prototype.getIndexSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.isGeneric = function () { - return true; - }; - - PullTypeParameterSymbol.prototype.fullName = function (scopeSymbol) { - var name = this.getDisplayName(scopeSymbol); - var container = this.getContainer(); - if (container) { - var containerName = container.fullName(scopeSymbol); - name = name + " in " + containerName; - } - - return name; - }; - - PullTypeParameterSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - var name = _super.prototype.getName.call(this, scopeSymbol); - - if (this.isPrinting) { - return name; - } - - this.isPrinting = true; - - if (useConstraintInName && this._constraint) { - name += " extends " + this._constraint.toString(scopeSymbol); - } - - this.isPrinting = false; - - return name; - }; - - PullTypeParameterSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - var name = _super.prototype.getDisplayName.call(this, scopeSymbol, useConstraintInName, skipInternalAliasName); - - if (this.isPrinting) { - return name; - } - - this.isPrinting = true; - - if (useConstraintInName && this._constraint) { - name += " extends " + this._constraint.toString(scopeSymbol); - } - - this.isPrinting = false; - - return name; - }; - - PullTypeParameterSymbol.prototype.isExternallyVisible = function (inIsExternallyVisibleSymbols) { - return true; - }; - return PullTypeParameterSymbol; - })(PullTypeSymbol); - TypeScript.PullTypeParameterSymbol = PullTypeParameterSymbol; - - var PullAccessorSymbol = (function (_super) { - __extends(PullAccessorSymbol, _super); - function PullAccessorSymbol(name) { - _super.call(this, name, 4096 /* Property */); - this._getterSymbol = null; - this._setterSymbol = null; - } - PullAccessorSymbol.prototype.isAccessor = function () { - return true; - }; - - PullAccessorSymbol.prototype.setSetter = function (setter) { - if (!setter) { - return; - } - - this._setterSymbol = setter; - }; - - PullAccessorSymbol.prototype.getSetter = function () { - return this._setterSymbol; - }; - - PullAccessorSymbol.prototype.setGetter = function (getter) { - if (!getter) { - return; - } - - this._getterSymbol = getter; - }; - - PullAccessorSymbol.prototype.getGetter = function () { - return this._getterSymbol; - }; - return PullAccessorSymbol; - })(PullSymbol); - TypeScript.PullAccessorSymbol = PullAccessorSymbol; - - function getIDForTypeSubstitutions(instantiatingTypeOrSignature, typeArgumentMap) { - var substitution = ""; - var members = null; - - var allowedToReferenceTypeParameters = instantiatingTypeOrSignature.getAllowedToReferenceTypeParameters(); - for (var i = 0; i < allowedToReferenceTypeParameters.length; i++) { - var typeParameter = allowedToReferenceTypeParameters[i]; - var typeParameterID = typeParameter.pullSymbolID; - var typeArg = typeArgumentMap[typeParameterID]; - if (!typeArg) { - typeArg = typeParameter; - } - substitution += typeParameterID + ":" + getIDForTypeSubstitutionsOfType(typeArg); - } - - return substitution; - } - TypeScript.getIDForTypeSubstitutions = getIDForTypeSubstitutions; - - function getIDForTypeSubstitutionsOfType(type) { - var structure; - if (type.isError()) { - structure = "E" + getIDForTypeSubstitutionsOfType(type._anyType); - } else if (!type.isNamedTypeSymbol()) { - structure = getIDForTypeSubstitutionsFromObjectType(type); - } - - if (!structure) { - structure = type.pullSymbolID + "#"; - } - - return structure; - } - - function getIDForTypeSubstitutionsFromObjectType(type) { - if (type.isResolved) { - var getIDForTypeSubStitutionWalker = new GetIDForTypeSubStitutionWalker(); - TypeScript.PullHelpers.walkPullTypeSymbolStructure(type, getIDForTypeSubStitutionWalker); - } - - return null; - } - - var GetIDForTypeSubStitutionWalker = (function () { - function GetIDForTypeSubStitutionWalker() { - this.structure = ""; - } - GetIDForTypeSubStitutionWalker.prototype.memberSymbolWalk = function (memberSymbol) { - this.structure += memberSymbol.name + "@" + getIDForTypeSubstitutionsOfType(memberSymbol.type); - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.callSignatureWalk = function (signatureSymbol) { - this.structure += "("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.constructSignatureWalk = function (signatureSymbol) { - this.structure += "new("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.indexSignatureWalk = function (signatureSymbol) { - this.structure += "[]("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.signatureParameterWalk = function (parameterSymbol) { - this.structure += parameterSymbol.name + "@" + getIDForTypeSubstitutionsOfType(parameterSymbol.type); - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.signatureReturnTypeWalk = function (returnType) { - this.structure += ")" + getIDForTypeSubstitutionsOfType(returnType); - return true; - }; - return GetIDForTypeSubStitutionWalker; - })(); - - (function (GetAllMembersVisiblity) { - GetAllMembersVisiblity[GetAllMembersVisiblity["all"] = 0] = "all"; - - GetAllMembersVisiblity[GetAllMembersVisiblity["internallyVisible"] = 1] = "internallyVisible"; - - GetAllMembersVisiblity[GetAllMembersVisiblity["externallyVisible"] = 2] = "externallyVisible"; - })(TypeScript.GetAllMembersVisiblity || (TypeScript.GetAllMembersVisiblity = {})); - var GetAllMembersVisiblity = TypeScript.GetAllMembersVisiblity; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PullTypeEnclosingTypeWalker = (function () { - function PullTypeEnclosingTypeWalker() { - this.currentSymbols = null; - } - PullTypeEnclosingTypeWalker.prototype.getEnclosingType = function () { - if (this.currentSymbols && this.currentSymbols.length > 0) { - return this.currentSymbols[0]; - } - - return null; - }; - - PullTypeEnclosingTypeWalker.prototype._canWalkStructure = function () { - var enclosingType = this.getEnclosingType(); - return !!enclosingType && enclosingType.isGeneric(); - }; - - PullTypeEnclosingTypeWalker.prototype._getCurrentSymbol = function () { - if (this.currentSymbols && this.currentSymbols.length) { - return this.currentSymbols[this.currentSymbols.length - 1]; - } - - return null; - }; - - PullTypeEnclosingTypeWalker.prototype.getGenerativeClassification = function () { - if (this._canWalkStructure()) { - var currentType = this.currentSymbols[this.currentSymbols.length - 1]; - if (!currentType) { - return 0 /* Unknown */; - } - - var variableNeededToFixNodeJitterBug = this.getEnclosingType(); - - return currentType.getGenerativeTypeClassification(variableNeededToFixNodeJitterBug); - } - - return 2 /* Closed */; - }; - - PullTypeEnclosingTypeWalker.prototype._pushSymbol = function (symbol) { - return this.currentSymbols.push(symbol); - }; - - PullTypeEnclosingTypeWalker.prototype._popSymbol = function () { - return this.currentSymbols.pop(); - }; - - PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeOfParentDecl = function (decl, setSignature) { - var parentDecl = decl.getParentDecl(); - if (parentDecl) { - if (parentDecl.kind & 8216 /* SomeInstantiatableType */) { - this._setEnclosingTypeWorker(parentDecl.getSymbol(), true); - } else { - this._setEnclosingTypeOfParentDecl(parentDecl, true); - } - - if (this._canWalkStructure()) { - var symbol = decl.getSymbol(); - if (symbol) { - if (symbol.kind == 2048 /* Parameter */ || symbol.kind == 4096 /* Property */ || symbol.kind == 65536 /* Method */ || symbol.kind == 32768 /* ConstructorMethod */ || symbol.kind == 131072 /* FunctionExpression */) { - symbol = symbol.type; - } - - this._pushSymbol(symbol); - } - - if (setSignature) { - var signature = decl.getSignatureSymbol(); - if (signature) { - this._pushSymbol(signature); - } - } - } - } - }; - - PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeWorker = function (symbol, setSignature) { - if (symbol.isType() && symbol.isNamedTypeSymbol()) { - this.currentSymbols = [TypeScript.PullHelpers.getRootType(symbol)]; - return; - } - - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - var decl = decls[i]; - this._setEnclosingTypeOfParentDecl(decl, setSignature); - if (this._canWalkStructure()) { - return; - } - } - }; - - PullTypeEnclosingTypeWalker.prototype.setCurrentSymbol = function (symbol) { - TypeScript.Debug.assert(this._canWalkStructure()); - this.currentSymbols[this.currentSymbols.length - 1] = symbol; - }; - - PullTypeEnclosingTypeWalker.prototype.startWalkingType = function (symbol) { - var currentSymbols = this.currentSymbols; - - var setEnclosingType = !this.getEnclosingType() || symbol.isNamedTypeSymbol(); - if (setEnclosingType) { - this.currentSymbols = null; - this.setEnclosingType(symbol); - } - return currentSymbols; - }; - - PullTypeEnclosingTypeWalker.prototype.endWalkingType = function (currentSymbolsWhenStartedWalkingTypes) { - this.currentSymbols = currentSymbolsWhenStartedWalkingTypes; - }; - - PullTypeEnclosingTypeWalker.prototype.setEnclosingType = function (symbol) { - TypeScript.Debug.assert(!this.getEnclosingType()); - this._setEnclosingTypeWorker(symbol, symbol.isSignature()); - }; - - PullTypeEnclosingTypeWalker.prototype.walkMemberType = function (memberName, resolver) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - var memberSymbol = currentType ? resolver._getNamedPropertySymbolOfAugmentedType(memberName, currentType) : null; - this._pushSymbol(memberSymbol ? memberSymbol.type : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkMemberType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkSignature = function (kind, index) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - var signatures; - if (currentType) { - if (kind == 1048576 /* CallSignature */) { - signatures = currentType.getCallSignatures(); - } else if (kind == 2097152 /* ConstructSignature */) { - signatures = currentType.getConstructSignatures(); - } else { - signatures = currentType.getIndexSignatures(); - } - } - - this._pushSymbol(signatures ? signatures[index] : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkSignature = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkTypeArgument = function (index) { - if (this._canWalkStructure()) { - var typeArgument = null; - var currentType = this._getCurrentSymbol(); - if (currentType) { - var typeArguments = currentType.getTypeArguments(); - typeArgument = typeArguments ? typeArguments[index] : null; - } - this._pushSymbol(typeArgument); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkTypeArgument = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkTypeParameterConstraint = function (index) { - if (this._canWalkStructure()) { - var typeParameters; - var currentSymbol = this._getCurrentSymbol(); - if (currentSymbol) { - if (currentSymbol.isSignature()) { - typeParameters = currentSymbol.getTypeParameters(); - } else { - TypeScript.Debug.assert(currentSymbol.isType()); - typeParameters = currentSymbol.getTypeParameters(); - } - } - this._pushSymbol(typeParameters ? typeParameters[index].getConstraint() : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkTypeParameterConstraint = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkReturnType = function () { - if (this._canWalkStructure()) { - var currentSignature = this._getCurrentSymbol(); - this._pushSymbol(currentSignature ? currentSignature.returnType : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkReturnType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkParameterType = function (iParam) { - if (this._canWalkStructure()) { - var currentSignature = this._getCurrentSymbol(); - this._pushSymbol(currentSignature ? currentSignature.getParameterTypeAtIndex(iParam) : null); - } - }; - PullTypeEnclosingTypeWalker.prototype.postWalkParameterType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.getBothKindOfIndexSignatures = function (resolver, context, includeAugmentedType) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - if (currentType) { - return resolver._getBothKindsOfIndexSignatures(currentType, context, includeAugmentedType); - } - } - return null; - }; - - PullTypeEnclosingTypeWalker.prototype.walkIndexSignatureReturnType = function (indexSigInfo, useStringIndexSignature, onlySignature) { - if (this._canWalkStructure()) { - var indexSig = indexSigInfo ? (useStringIndexSignature ? indexSigInfo.stringSignature : indexSigInfo.numericSignature) : null; - this._pushSymbol(indexSig); - if (!onlySignature) { - this._pushSymbol(indexSig ? indexSig.returnType : null); - } - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkIndexSignatureReturnType = function (onlySignature) { - if (this._canWalkStructure()) { - if (!onlySignature) { - this._popSymbol(); - } - this._popSymbol(); - } - }; - return PullTypeEnclosingTypeWalker; - })(); - TypeScript.PullTypeEnclosingTypeWalker = PullTypeEnclosingTypeWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CandidateInferenceInfo = (function () { - function CandidateInferenceInfo() { - this.typeParameter = null; - this._inferredTypeAfterFixing = null; - this.inferenceCandidates = []; - } - CandidateInferenceInfo.prototype.addCandidate = function (candidate) { - if (!this._inferredTypeAfterFixing) { - this.inferenceCandidates[this.inferenceCandidates.length] = candidate; - } - }; - - CandidateInferenceInfo.prototype.isFixed = function () { - return !!this._inferredTypeAfterFixing; - }; - - CandidateInferenceInfo.prototype.fixTypeParameter = function (resolver, context) { - var _this = this; - if (!this._inferredTypeAfterFixing) { - var collection = { - getLength: function () { - return _this.inferenceCandidates.length; - }, - getTypeAtIndex: function (index) { - return _this.inferenceCandidates[index].type; - } - }; - - var bestCommonType = resolver.findBestCommonType(collection, context, new TypeScript.TypeComparisonInfo()); - this._inferredTypeAfterFixing = bestCommonType.widenedType(resolver, null, context); - } - }; - return CandidateInferenceInfo; - })(); - TypeScript.CandidateInferenceInfo = CandidateInferenceInfo; - - var TypeArgumentInferenceContext = (function () { - function TypeArgumentInferenceContext(resolver, context, signatureBeingInferred) { - this.resolver = resolver; - this.context = context; - this.signatureBeingInferred = signatureBeingInferred; - this.inferenceCache = TypeScript.BitMatrix.getBitMatrix(false); - this.candidateCache = []; - var typeParameters = signatureBeingInferred.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - this.addInferenceRoot(typeParameters[i]); - } - } - TypeArgumentInferenceContext.prototype.alreadyRelatingTypes = function (objectType, parameterType) { - if (this.inferenceCache.valueAt(objectType.pullSymbolID, parameterType.pullSymbolID)) { - return true; - } else { - this.inferenceCache.setValueAt(objectType.pullSymbolID, parameterType.pullSymbolID, true); - return false; - } - }; - - TypeArgumentInferenceContext.prototype.resetRelationshipCache = function () { - this.inferenceCache.release(); - this.inferenceCache = TypeScript.BitMatrix.getBitMatrix(false); - }; - - TypeArgumentInferenceContext.prototype.addInferenceRoot = function (param) { - var info = this.candidateCache[param.pullSymbolID]; - - if (!info) { - info = new CandidateInferenceInfo(); - info.typeParameter = param; - this.candidateCache[param.pullSymbolID] = info; - } - }; - - TypeArgumentInferenceContext.prototype.getInferenceInfo = function (param) { - return this.candidateCache[param.pullSymbolID]; - }; - - TypeArgumentInferenceContext.prototype.addCandidateForInference = function (param, candidate) { - var info = this.getInferenceInfo(param); - - if (info && candidate && info.inferenceCandidates.indexOf(candidate) < 0) { - info.addCandidate(candidate); - } - }; - - TypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - throw TypeScript.Errors.abstract(); - }; - - TypeArgumentInferenceContext.prototype.fixTypeParameter = function (typeParameter) { - var candidateInfo = this.candidateCache[typeParameter.pullSymbolID]; - if (candidateInfo) { - candidateInfo.fixTypeParameter(this.resolver, this.context); - } - }; - - TypeArgumentInferenceContext.prototype._finalizeInferredTypeArguments = function () { - var results = []; - var typeParameters = this.signatureBeingInferred.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - var info = this.candidateCache[typeParameters[i].pullSymbolID]; - - info.fixTypeParameter(this.resolver, this.context); - - for (var i = 0; i < results.length; i++) { - if (results[i].type === info.typeParameter) { - results[i].type = info._inferredTypeAfterFixing; - } - } - - results.push(info._inferredTypeAfterFixing); - } - - return results; - }; - - TypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - throw TypeScript.Errors.abstract(); - }; - return TypeArgumentInferenceContext; - })(); - TypeScript.TypeArgumentInferenceContext = TypeArgumentInferenceContext; - - var InvocationTypeArgumentInferenceContext = (function (_super) { - __extends(InvocationTypeArgumentInferenceContext, _super); - function InvocationTypeArgumentInferenceContext(resolver, context, signatureBeingInferred, argumentASTs) { - _super.call(this, resolver, context, signatureBeingInferred); - this.argumentASTs = argumentASTs; - } - InvocationTypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - return true; - }; - - InvocationTypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - var _this = this; - this.signatureBeingInferred.forAllParameterTypes(this.argumentASTs.nonSeparatorCount(), function (parameterType, argumentIndex) { - var argumentAST = _this.argumentASTs.nonSeparatorAt(argumentIndex); - - _this.context.pushInferentialType(parameterType, _this); - var argumentType = _this.resolver.resolveAST(argumentAST, true, _this.context).type; - _this.resolver.relateTypeToTypeParametersWithNewEnclosingTypes(argumentType, parameterType, _this, _this.context); - _this.context.popAnyContextualType(); - - return true; - }); - - return this._finalizeInferredTypeArguments(); - }; - return InvocationTypeArgumentInferenceContext; - })(TypeArgumentInferenceContext); - TypeScript.InvocationTypeArgumentInferenceContext = InvocationTypeArgumentInferenceContext; - - var ContextualSignatureInstantiationTypeArgumentInferenceContext = (function (_super) { - __extends(ContextualSignatureInstantiationTypeArgumentInferenceContext, _super); - function ContextualSignatureInstantiationTypeArgumentInferenceContext(resolver, context, signatureBeingInferred, contextualSignature, shouldFixContextualSignatureParameterTypes) { - _super.call(this, resolver, context, signatureBeingInferred); - this.contextualSignature = contextualSignature; - this.shouldFixContextualSignatureParameterTypes = shouldFixContextualSignatureParameterTypes; - } - ContextualSignatureInstantiationTypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - return false; - }; - - ContextualSignatureInstantiationTypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - var _this = this; - var relateTypesCallback = function (parameterTypeBeingInferred, contextualParameterType) { - if (_this.shouldFixContextualSignatureParameterTypes) { - contextualParameterType = _this.context.fixAllTypeParametersReferencedByType(contextualParameterType, _this.resolver, _this); - } - _this.resolver.relateTypeToTypeParametersWithNewEnclosingTypes(contextualParameterType, parameterTypeBeingInferred, _this, _this.context); - - return true; - }; - - this.signatureBeingInferred.forAllCorrespondingParameterTypesInThisAndOtherSignature(this.contextualSignature, relateTypesCallback); - - return this._finalizeInferredTypeArguments(); - }; - return ContextualSignatureInstantiationTypeArgumentInferenceContext; - })(TypeArgumentInferenceContext); - TypeScript.ContextualSignatureInstantiationTypeArgumentInferenceContext = ContextualSignatureInstantiationTypeArgumentInferenceContext; - - var PullContextualTypeContext = (function () { - function PullContextualTypeContext(contextualType, provisional, isInferentiallyTyping, typeArgumentInferenceContext) { - this.contextualType = contextualType; - this.provisional = provisional; - this.isInferentiallyTyping = isInferentiallyTyping; - this.typeArgumentInferenceContext = typeArgumentInferenceContext; - this.provisionallyTypedSymbols = []; - this.hasProvisionalErrors = false; - this.astSymbolMap = []; - } - PullContextualTypeContext.prototype.recordProvisionallyTypedSymbol = function (symbol) { - this.provisionallyTypedSymbols[this.provisionallyTypedSymbols.length] = symbol; - }; - - PullContextualTypeContext.prototype.invalidateProvisionallyTypedSymbols = function () { - for (var i = 0; i < this.provisionallyTypedSymbols.length; i++) { - this.provisionallyTypedSymbols[i].setUnresolved(); - } - }; - - PullContextualTypeContext.prototype.setSymbolForAST = function (ast, symbol) { - this.astSymbolMap[ast.syntaxID()] = symbol; - }; - - PullContextualTypeContext.prototype.getSymbolForAST = function (ast) { - return this.astSymbolMap[ast.syntaxID()]; - }; - return PullContextualTypeContext; - })(); - TypeScript.PullContextualTypeContext = PullContextualTypeContext; - - var PullTypeResolutionContext = (function () { - function PullTypeResolutionContext(resolver, inTypeCheck, fileName) { - if (typeof inTypeCheck === "undefined") { inTypeCheck = false; } - if (typeof fileName === "undefined") { fileName = null; } - this.resolver = resolver; - this.inTypeCheck = inTypeCheck; - this.fileName = fileName; - this.contextStack = []; - this.typeCheckedNodes = null; - this.enclosingTypeWalker1 = null; - this.enclosingTypeWalker2 = null; - this.inBaseTypeResolution = false; - if (inTypeCheck) { - TypeScript.Debug.assert(fileName, "A file name must be provided if you are typechecking"); - this.typeCheckedNodes = TypeScript.BitVector.getBitVector(false); - } - } - PullTypeResolutionContext.prototype.setTypeChecked = function (ast) { - if (!this.inProvisionalResolution()) { - this.typeCheckedNodes.setValueAt(ast.syntaxID(), true); - } - }; - - PullTypeResolutionContext.prototype.canTypeCheckAST = function (ast) { - return this.typeCheck() && !this.typeCheckedNodes.valueAt(ast.syntaxID()) && this.fileName === ast.fileName(); - }; - - PullTypeResolutionContext.prototype._pushAnyContextualType = function (type, provisional, isInferentiallyTyping, argContext) { - this.contextStack.push(new PullContextualTypeContext(type, provisional, isInferentiallyTyping, argContext)); - }; - - PullTypeResolutionContext.prototype.pushNewContextualType = function (type) { - this._pushAnyContextualType(type, this.inProvisionalResolution(), false, null); - }; - - PullTypeResolutionContext.prototype.propagateContextualType = function (type) { - this._pushAnyContextualType(type, this.inProvisionalResolution(), this.isInferentiallyTyping(), this.getCurrentTypeArgumentInferenceContext()); - }; - - PullTypeResolutionContext.prototype.pushInferentialType = function (type, typeArgumentInferenceContext) { - this._pushAnyContextualType(type, true, true, typeArgumentInferenceContext); - }; - - PullTypeResolutionContext.prototype.pushProvisionalType = function (type) { - this._pushAnyContextualType(type, true, false, null); - }; - - PullTypeResolutionContext.prototype.popAnyContextualType = function () { - var tc = this.contextStack.pop(); - - tc.invalidateProvisionallyTypedSymbols(); - - if (tc.hasProvisionalErrors && this.inProvisionalResolution()) { - this.contextStack[this.contextStack.length - 1].hasProvisionalErrors = true; - } - - return tc; - }; - - PullTypeResolutionContext.prototype.hasProvisionalErrors = function () { - return this.contextStack.length ? this.contextStack[this.contextStack.length - 1].hasProvisionalErrors : false; - }; - - PullTypeResolutionContext.prototype.getContextualType = function () { - var context = !this.contextStack.length ? null : this.contextStack[this.contextStack.length - 1]; - - if (context) { - var type = context.contextualType; - - if (!type) { - return null; - } - - return type; - } - - return null; - }; - - PullTypeResolutionContext.prototype.fixAllTypeParametersReferencedByType = function (type, resolver, argContext) { - var argContext = this.getCurrentTypeArgumentInferenceContext(); - if (type.wrapsSomeTypeParameter(argContext.candidateCache)) { - var typeParameterArgumentMap = []; - - for (var n in argContext.candidateCache) { - var typeParameter = argContext.candidateCache[n] && argContext.candidateCache[n].typeParameter; - if (typeParameter) { - var dummyMap = []; - dummyMap[typeParameter.pullSymbolID] = typeParameter; - if (type.wrapsSomeTypeParameter(dummyMap)) { - argContext.fixTypeParameter(typeParameter); - TypeScript.Debug.assert(argContext.candidateCache[n]._inferredTypeAfterFixing); - typeParameterArgumentMap[typeParameter.pullSymbolID] = argContext.candidateCache[n]._inferredTypeAfterFixing; - } - } - } - - return resolver.instantiateType(type, typeParameterArgumentMap); - } - - return type; - }; - - PullTypeResolutionContext.prototype.getCurrentTypeArgumentInferenceContext = function () { - return this.contextStack.length ? this.contextStack[this.contextStack.length - 1].typeArgumentInferenceContext : null; - }; - - PullTypeResolutionContext.prototype.isInferentiallyTyping = function () { - return this.contextStack.length > 0 && this.contextStack[this.contextStack.length - 1].isInferentiallyTyping; - }; - - PullTypeResolutionContext.prototype.inProvisionalResolution = function () { - return (!this.contextStack.length ? false : this.contextStack[this.contextStack.length - 1].provisional); - }; - - PullTypeResolutionContext.prototype.isInBaseTypeResolution = function () { - return this.inBaseTypeResolution; - }; - - PullTypeResolutionContext.prototype.startBaseTypeResolution = function () { - var wasInBaseTypeResoltion = this.inBaseTypeResolution; - this.inBaseTypeResolution = true; - return wasInBaseTypeResoltion; - }; - - PullTypeResolutionContext.prototype.doneBaseTypeResolution = function (wasInBaseTypeResolution) { - this.inBaseTypeResolution = wasInBaseTypeResolution; - }; - - PullTypeResolutionContext.prototype.setTypeInContext = function (symbol, type) { - if (symbol.type && symbol.type.isError() && !type.isError()) { - return; - } - symbol.type = type; - - if (this.contextStack.length && this.inProvisionalResolution()) { - this.contextStack[this.contextStack.length - 1].recordProvisionallyTypedSymbol(symbol); - } - }; - - PullTypeResolutionContext.prototype.postDiagnostic = function (diagnostic) { - if (diagnostic) { - if (this.inProvisionalResolution()) { - (this.contextStack[this.contextStack.length - 1]).hasProvisionalErrors = true; - } else if (this.inTypeCheck && this.resolver) { - this.resolver.semanticInfoChain.addDiagnostic(diagnostic); - } - } - }; - - PullTypeResolutionContext.prototype.typeCheck = function () { - return this.inTypeCheck && !this.inProvisionalResolution(); - }; - - PullTypeResolutionContext.prototype.setSymbolForAST = function (ast, symbol) { - this.contextStack[this.contextStack.length - 1].setSymbolForAST(ast, symbol); - }; - - PullTypeResolutionContext.prototype.getSymbolForAST = function (ast) { - for (var i = this.contextStack.length - 1; i >= 0; i--) { - var typeContext = this.contextStack[i]; - if (!typeContext.provisional) { - break; - } - - var symbol = typeContext.getSymbolForAST(ast); - if (symbol) { - return symbol; - } - } - - return null; - }; - - PullTypeResolutionContext.prototype.startWalkingTypes = function (symbol1, symbol2) { - if (!this.enclosingTypeWalker1) { - this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - var symbolsWhenStartedWalkingTypes1 = this.enclosingTypeWalker1.startWalkingType(symbol1); - if (!this.enclosingTypeWalker2) { - this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - var symbolsWhenStartedWalkingTypes2 = this.enclosingTypeWalker2.startWalkingType(symbol2); - return { symbolsWhenStartedWalkingTypes1: symbolsWhenStartedWalkingTypes1, symbolsWhenStartedWalkingTypes2: symbolsWhenStartedWalkingTypes2 }; - }; - - PullTypeResolutionContext.prototype.endWalkingTypes = function (symbolsWhenStartedWalkingTypes) { - this.enclosingTypeWalker1.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes1); - this.enclosingTypeWalker2.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes2); - }; - - PullTypeResolutionContext.prototype.setEnclosingTypes = function (symbol1, symbol2) { - if (!this.enclosingTypeWalker1) { - this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - this.enclosingTypeWalker1.setEnclosingType(symbol1); - if (!this.enclosingTypeWalker2) { - this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - this.enclosingTypeWalker2.setEnclosingType(symbol2); - }; - - PullTypeResolutionContext.prototype.walkMemberTypes = function (memberName) { - this.enclosingTypeWalker1.walkMemberType(memberName, this.resolver); - this.enclosingTypeWalker2.walkMemberType(memberName, this.resolver); - }; - - PullTypeResolutionContext.prototype.postWalkMemberTypes = function () { - this.enclosingTypeWalker1.postWalkMemberType(); - this.enclosingTypeWalker2.postWalkMemberType(); - }; - - PullTypeResolutionContext.prototype.walkSignatures = function (kind, index, index2) { - this.enclosingTypeWalker1.walkSignature(kind, index); - this.enclosingTypeWalker2.walkSignature(kind, index2 == undefined ? index : index2); - }; - - PullTypeResolutionContext.prototype.postWalkSignatures = function () { - this.enclosingTypeWalker1.postWalkSignature(); - this.enclosingTypeWalker2.postWalkSignature(); - }; - - PullTypeResolutionContext.prototype.walkTypeParameterConstraints = function (index) { - this.enclosingTypeWalker1.walkTypeParameterConstraint(index); - this.enclosingTypeWalker2.walkTypeParameterConstraint(index); - }; - - PullTypeResolutionContext.prototype.postWalkTypeParameterConstraints = function () { - this.enclosingTypeWalker1.postWalkTypeParameterConstraint(); - this.enclosingTypeWalker2.postWalkTypeParameterConstraint(); - }; - - PullTypeResolutionContext.prototype.walkTypeArgument = function (index) { - this.enclosingTypeWalker1.walkTypeArgument(index); - this.enclosingTypeWalker2.walkTypeArgument(index); - }; - - PullTypeResolutionContext.prototype.postWalkTypeArgument = function () { - this.enclosingTypeWalker1.postWalkTypeArgument(); - this.enclosingTypeWalker2.postWalkTypeArgument(); - }; - - PullTypeResolutionContext.prototype.walkReturnTypes = function () { - this.enclosingTypeWalker1.walkReturnType(); - this.enclosingTypeWalker2.walkReturnType(); - }; - - PullTypeResolutionContext.prototype.postWalkReturnTypes = function () { - this.enclosingTypeWalker1.postWalkReturnType(); - this.enclosingTypeWalker2.postWalkReturnType(); - }; - - PullTypeResolutionContext.prototype.walkParameterTypes = function (iParam) { - this.enclosingTypeWalker1.walkParameterType(iParam); - this.enclosingTypeWalker2.walkParameterType(iParam); - }; - - PullTypeResolutionContext.prototype.postWalkParameterTypes = function () { - this.enclosingTypeWalker1.postWalkParameterType(); - this.enclosingTypeWalker2.postWalkParameterType(); - }; - - PullTypeResolutionContext.prototype.getBothKindOfIndexSignatures = function (includeAugmentedType1, includeAugmentedType2) { - var indexSigs1 = this.enclosingTypeWalker1.getBothKindOfIndexSignatures(this.resolver, this, includeAugmentedType1); - var indexSigs2 = this.enclosingTypeWalker2.getBothKindOfIndexSignatures(this.resolver, this, includeAugmentedType2); - return { indexSigs1: indexSigs1, indexSigs2: indexSigs2 }; - }; - - PullTypeResolutionContext.prototype.walkIndexSignatureReturnTypes = function (indexSigs, useStringIndexSignature1, useStringIndexSignature2, onlySignature) { - this.enclosingTypeWalker1.walkIndexSignatureReturnType(indexSigs.indexSigs1, useStringIndexSignature1, onlySignature); - this.enclosingTypeWalker2.walkIndexSignatureReturnType(indexSigs.indexSigs2, useStringIndexSignature2, onlySignature); - }; - - PullTypeResolutionContext.prototype.postWalkIndexSignatureReturnTypes = function (onlySignature) { - this.enclosingTypeWalker1.postWalkIndexSignatureReturnType(onlySignature); - this.enclosingTypeWalker2.postWalkIndexSignatureReturnType(onlySignature); - }; - - PullTypeResolutionContext.prototype.swapEnclosingTypeWalkers = function () { - var tempEnclosingWalker1 = this.enclosingTypeWalker1; - this.enclosingTypeWalker1 = this.enclosingTypeWalker2; - this.enclosingTypeWalker2 = tempEnclosingWalker1; - }; - - PullTypeResolutionContext.prototype.oneOfClassificationsIsInfinitelyExpanding = function () { - var generativeClassification1 = this.enclosingTypeWalker1.getGenerativeClassification(); - if (generativeClassification1 === 3 /* InfinitelyExpanding */) { - return true; - } - var generativeClassification2 = this.enclosingTypeWalker2.getGenerativeClassification(); - if (generativeClassification2 === 3 /* InfinitelyExpanding */) { - return true; - } - - return false; - }; - - PullTypeResolutionContext.prototype.resetEnclosingTypeWalkers = function () { - var enclosingTypeWalker1 = this.enclosingTypeWalker1; - var enclosingTypeWalker2 = this.enclosingTypeWalker2; - this.enclosingTypeWalker1 = null; - this.enclosingTypeWalker2 = null; - return { - enclosingTypeWalker1: enclosingTypeWalker1, - enclosingTypeWalker2: enclosingTypeWalker2 - }; - }; - - PullTypeResolutionContext.prototype.setEnclosingTypeWalkers = function (enclosingTypeWalkers) { - this.enclosingTypeWalker1 = enclosingTypeWalkers.enclosingTypeWalker1; - this.enclosingTypeWalker2 = enclosingTypeWalkers.enclosingTypeWalker2; - }; - return PullTypeResolutionContext; - })(); - TypeScript.PullTypeResolutionContext = PullTypeResolutionContext; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var OverloadApplicabilityStatus; - (function (OverloadApplicabilityStatus) { - OverloadApplicabilityStatus[OverloadApplicabilityStatus["NotAssignable"] = 0] = "NotAssignable"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["AssignableButWithProvisionalErrors"] = 1] = "AssignableButWithProvisionalErrors"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["AssignableWithNoProvisionalErrors"] = 2] = "AssignableWithNoProvisionalErrors"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["Subtype"] = 3] = "Subtype"; - })(OverloadApplicabilityStatus || (OverloadApplicabilityStatus = {})); - - var PullAdditionalCallResolutionData = (function () { - function PullAdditionalCallResolutionData() { - this.targetSymbol = null; - this.resolvedSignatures = null; - this.candidateSignature = null; - this.actualParametersContextTypeSymbols = null; - this.diagnosticsFromOverloadResolution = []; - } - return PullAdditionalCallResolutionData; - })(); - TypeScript.PullAdditionalCallResolutionData = PullAdditionalCallResolutionData; - - var PullAdditionalObjectLiteralResolutionData = (function () { - function PullAdditionalObjectLiteralResolutionData() { - this.membersContextTypeSymbols = null; - } - return PullAdditionalObjectLiteralResolutionData; - })(); - TypeScript.PullAdditionalObjectLiteralResolutionData = PullAdditionalObjectLiteralResolutionData; - - var MemberWithBaseOrigin = (function () { - function MemberWithBaseOrigin(memberSymbol, baseOrigin) { - this.memberSymbol = memberSymbol; - this.baseOrigin = baseOrigin; - } - return MemberWithBaseOrigin; - })(); - - var SignatureWithBaseOrigin = (function () { - function SignatureWithBaseOrigin(signature, baseOrigin) { - this.signature = signature; - this.baseOrigin = baseOrigin; - } - return SignatureWithBaseOrigin; - })(); - - var InheritedIndexSignatureInfo = (function () { - function InheritedIndexSignatureInfo() { - } - return InheritedIndexSignatureInfo; - })(); - - var CompilerReservedName; - (function (CompilerReservedName) { - CompilerReservedName[CompilerReservedName["_this"] = 1] = "_this"; - CompilerReservedName[CompilerReservedName["_super"] = 2] = "_super"; - CompilerReservedName[CompilerReservedName["arguments"] = 3] = "arguments"; - CompilerReservedName[CompilerReservedName["_i"] = 4] = "_i"; - CompilerReservedName[CompilerReservedName["require"] = 5] = "require"; - CompilerReservedName[CompilerReservedName["exports"] = 6] = "exports"; - })(CompilerReservedName || (CompilerReservedName = {})); - - function getCompilerReservedName(name) { - var nameText = name.valueText(); - return CompilerReservedName[nameText]; - } - - var PullTypeResolver = (function () { - function PullTypeResolver(compilationSettings, semanticInfoChain) { - this.compilationSettings = compilationSettings; - this.semanticInfoChain = semanticInfoChain; - this._cachedArrayInterfaceType = null; - this._cachedNumberInterfaceType = null; - this._cachedStringInterfaceType = null; - this._cachedBooleanInterfaceType = null; - this._cachedObjectInterfaceType = null; - this._cachedFunctionInterfaceType = null; - this._cachedIArgumentsInterfaceType = null; - this._cachedRegExpInterfaceType = null; - this._cachedAnyTypeArgs = null; - this.typeCheckCallBacks = []; - this.postTypeCheckWorkitems = []; - this._cachedFunctionArgumentsSymbol = null; - this.assignableCache = TypeScript.BitMatrix.getBitMatrix(true); - this.subtypeCache = TypeScript.BitMatrix.getBitMatrix(true); - this.identicalCache = TypeScript.BitMatrix.getBitMatrix(true); - this.inResolvingOtherDeclsWalker = new TypeScript.PullHelpers.OtherPullDeclsWalker(); - } - PullTypeResolver.prototype.cachedArrayInterfaceType = function () { - if (!this._cachedArrayInterfaceType) { - this._cachedArrayInterfaceType = this.getSymbolFromDeclPath("Array", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (!this._cachedArrayInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedArrayInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedArrayInterfaceType; - }; - - PullTypeResolver.prototype.getArrayNamedType = function () { - return this.cachedArrayInterfaceType(); - }; - - PullTypeResolver.prototype.cachedNumberInterfaceType = function () { - if (!this._cachedNumberInterfaceType) { - this._cachedNumberInterfaceType = this.getSymbolFromDeclPath("Number", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedNumberInterfaceType && !this._cachedNumberInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedNumberInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedNumberInterfaceType; - }; - - PullTypeResolver.prototype.cachedStringInterfaceType = function () { - if (!this._cachedStringInterfaceType) { - this._cachedStringInterfaceType = this.getSymbolFromDeclPath("String", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedStringInterfaceType && !this._cachedStringInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedStringInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedStringInterfaceType; - }; - - PullTypeResolver.prototype.cachedBooleanInterfaceType = function () { - if (!this._cachedBooleanInterfaceType) { - this._cachedBooleanInterfaceType = this.getSymbolFromDeclPath("Boolean", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedBooleanInterfaceType && !this._cachedBooleanInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedBooleanInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedBooleanInterfaceType; - }; - - PullTypeResolver.prototype.cachedObjectInterfaceType = function () { - if (!this._cachedObjectInterfaceType) { - this._cachedObjectInterfaceType = this.getSymbolFromDeclPath("Object", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (!this._cachedObjectInterfaceType) { - this._cachedObjectInterfaceType = this.semanticInfoChain.anyTypeSymbol; - } - - if (!this._cachedObjectInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedObjectInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedObjectInterfaceType; - }; - - PullTypeResolver.prototype.cachedFunctionInterfaceType = function () { - if (!this._cachedFunctionInterfaceType) { - this._cachedFunctionInterfaceType = this.getSymbolFromDeclPath("Function", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedFunctionInterfaceType && !this._cachedFunctionInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedFunctionInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedFunctionInterfaceType; - }; - - PullTypeResolver.prototype.cachedIArgumentsInterfaceType = function () { - if (!this._cachedIArgumentsInterfaceType) { - this._cachedIArgumentsInterfaceType = this.getSymbolFromDeclPath("IArguments", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedIArgumentsInterfaceType && !this._cachedIArgumentsInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedIArgumentsInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedIArgumentsInterfaceType; - }; - - PullTypeResolver.prototype.cachedRegExpInterfaceType = function () { - if (!this._cachedRegExpInterfaceType) { - this._cachedRegExpInterfaceType = this.getSymbolFromDeclPath("RegExp", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedRegExpInterfaceType && !this._cachedRegExpInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedRegExpInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedRegExpInterfaceType; - }; - - PullTypeResolver.prototype.cachedFunctionArgumentsSymbol = function () { - if (!this._cachedFunctionArgumentsSymbol) { - this._cachedFunctionArgumentsSymbol = new TypeScript.PullSymbol("arguments", 512 /* Variable */); - this._cachedFunctionArgumentsSymbol.type = this.cachedIArgumentsInterfaceType() || this.semanticInfoChain.anyTypeSymbol; - this._cachedFunctionArgumentsSymbol.setResolved(); - - var functionArgumentsDecl = new TypeScript.PullSynthesizedDecl("arguments", "arguments", 2048 /* Parameter */, 0 /* None */, null, this.semanticInfoChain); - functionArgumentsDecl.setSymbol(this._cachedFunctionArgumentsSymbol); - this._cachedFunctionArgumentsSymbol.addDeclaration(functionArgumentsDecl); - } - - return this._cachedFunctionArgumentsSymbol; - }; - - PullTypeResolver.prototype.getApparentType = function (type) { - if (type.isTypeParameter()) { - var baseConstraint = type.getBaseConstraint(this.semanticInfoChain); - if (baseConstraint === this.semanticInfoChain.anyTypeSymbol) { - return this.semanticInfoChain.emptyTypeSymbol; - } else { - type = baseConstraint; - } - } - if (type.isPrimitive()) { - if (type === this.semanticInfoChain.numberTypeSymbol) { - return this.cachedNumberInterfaceType(); - } - if (type === this.semanticInfoChain.booleanTypeSymbol) { - return this.cachedBooleanInterfaceType(); - } - if (type === this.semanticInfoChain.stringTypeSymbol) { - return this.cachedStringInterfaceType(); - } - return type; - } - if (type.isEnum()) { - return this.cachedNumberInterfaceType(); - } - return type; - }; - - PullTypeResolver.prototype.setTypeChecked = function (ast, context) { - context.setTypeChecked(ast); - }; - - PullTypeResolver.prototype.canTypeCheckAST = function (ast, context) { - return context.canTypeCheckAST(ast); - }; - - PullTypeResolver.prototype.setSymbolForAST = function (ast, symbol, context) { - if (context && context.inProvisionalResolution()) { - context.setSymbolForAST(ast, symbol); - } else { - this.semanticInfoChain.setSymbolForAST(ast, symbol); - } - }; - - PullTypeResolver.prototype.getSymbolForAST = function (ast, context) { - var symbol = this.semanticInfoChain.getSymbolForAST(ast); - - if (!symbol) { - if (context && context.inProvisionalResolution()) { - symbol = context.getSymbolForAST(ast); - } - } - - return symbol; - }; - - PullTypeResolver.prototype.getASTForDecl = function (decl) { - return this.semanticInfoChain.getASTForDecl(decl); - }; - - PullTypeResolver.prototype.getNewErrorTypeSymbol = function (name) { - if (typeof name === "undefined") { name = null; } - return new TypeScript.PullErrorTypeSymbol(this.semanticInfoChain.anyTypeSymbol, name); - }; - - PullTypeResolver.prototype.getEnclosingDecl = function (decl) { - var declPath = decl.getParentPath(); - - if (declPath.length > 1 && declPath[declPath.length - 1] === decl) { - return declPath[declPath.length - 2]; - } else { - return declPath[declPath.length - 1]; - } - }; - - PullTypeResolver.prototype.getExportedMemberSymbol = function (symbol, parent) { - if (!(symbol.kind & (65536 /* Method */ | 4096 /* Property */))) { - var isContainer = (parent.kind & (4 /* Container */ | 32 /* DynamicModule */)) !== 0; - var containerType = !isContainer ? parent.getAssociatedContainerType() : parent; - - if (isContainer && containerType) { - if (symbol.anyDeclHasFlag(1 /* Exported */)) { - return symbol; - } - - return null; - } - } - - return symbol; - }; - - PullTypeResolver.prototype._getNamedPropertySymbolOfAugmentedType = function (symbolName, parent) { - var memberSymbol = this.getNamedPropertySymbol(symbolName, 68147712 /* SomeValue */, parent); - if (memberSymbol) { - return memberSymbol; - } - - if (this.cachedFunctionInterfaceType() && parent.isFunctionType()) { - memberSymbol = this.cachedFunctionInterfaceType().findMember(symbolName, true); - if (memberSymbol) { - return memberSymbol; - } - } - - if (this.cachedObjectInterfaceType()) { - return this.cachedObjectInterfaceType().findMember(symbolName, true); - } - - return null; - }; - - PullTypeResolver.prototype.getNamedPropertySymbol = function (symbolName, declSearchKind, parent) { - var member = null; - - if (declSearchKind & 68147712 /* SomeValue */) { - member = parent.findMember(symbolName, true); - } else if (declSearchKind & 58728795 /* SomeType */) { - member = parent.findNestedType(symbolName); - } else if (declSearchKind & 164 /* SomeContainer */) { - member = parent.findNestedContainer(symbolName); - } - - if (member) { - return this.getExportedMemberSymbol(member, parent); - } - - var containerType = parent.getAssociatedContainerType(); - - if (containerType) { - if (containerType.isClass()) { - return null; - } - - parent = containerType; - - if (declSearchKind & 68147712 /* SomeValue */) { - member = parent.findMember(symbolName, true); - } else if (declSearchKind & 58728795 /* SomeType */) { - member = parent.findNestedType(symbolName); - } else if (declSearchKind & 164 /* SomeContainer */) { - member = parent.findNestedContainer(symbolName); - } - - if (member) { - return this.getExportedMemberSymbol(member, parent); - } - } - - if (parent.kind & 164 /* SomeContainer */) { - var typeDeclarations = parent.getDeclarations(); - var childDecls = null; - - for (var j = 0; j < typeDeclarations.length; j++) { - childDecls = typeDeclarations[j].searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - member = childDecls[0].getSymbol(); - - if (!member) { - member = childDecls[0].getSignatureSymbol(); - } - return this.getExportedMemberSymbol(member, parent); - } - - if ((declSearchKind & 58728795 /* SomeType */) !== 0 || (declSearchKind & 68147712 /* SomeValue */) !== 0) { - childDecls = typeDeclarations[j].searchChildDecls(symbolName, 128 /* TypeAlias */); - if (childDecls.length && childDecls[0].kind === 128 /* TypeAlias */) { - var aliasSymbol = this.getExportedMemberSymbol(childDecls[0].getSymbol(), parent); - if (aliasSymbol) { - if ((declSearchKind & 58728795 /* SomeType */) !== 0) { - var typeSymbol = aliasSymbol.getExportAssignedTypeSymbol(); - if (typeSymbol) { - return typeSymbol; - } - } else { - var valueSymbol = aliasSymbol.getExportAssignedValueSymbol(); - if (valueSymbol) { - aliasSymbol.setIsUsedAsValue(); - return valueSymbol; - } - } - - return aliasSymbol; - } - } - } - } - } - }; - - PullTypeResolver.prototype.getSymbolFromDeclPath = function (symbolName, declPath, declSearchKind) { - var _this = this; - var symbol = null; - - var decl = null; - var childDecls; - var declSymbol = null; - var declMembers; - var pathDeclKind; - var valDecl = null; - var kind; - var instanceSymbol = null; - var instanceType = null; - var childSymbol = null; - - var allowedContainerDeclKind = 4 /* Container */ | 32 /* DynamicModule */; - if (TypeScript.hasFlag(declSearchKind, 67108864 /* EnumMember */)) { - allowedContainerDeclKind |= 64 /* Enum */; - } - - var isAcceptableAlias = function (symbol) { - if (symbol.isAlias()) { - _this.resolveDeclaredSymbol(symbol); - if (TypeScript.hasFlag(declSearchKind, 164 /* SomeContainer */)) { - if (symbol.assignedContainer() || symbol.getExportAssignedContainerSymbol()) { - return true; - } - } else if (TypeScript.hasFlag(declSearchKind, 58728795 /* SomeType */)) { - var type = symbol.getExportAssignedTypeSymbol(); - if (type && type.kind !== 32 /* DynamicModule */) { - return true; - } - - var type = symbol.assignedType(); - if (type && type.kind !== 32 /* DynamicModule */) { - return true; - } - } else if (TypeScript.hasFlag(declSearchKind, 68147712 /* SomeValue */ & ~67108864 /* EnumMember */)) { - if (symbol.assignedType() && symbol.assignedType().isError()) { - return true; - } else if (symbol.assignedValue() || symbol.getExportAssignedValueSymbol()) { - return true; - } else { - var assignedType = symbol.assignedType(); - if (assignedType && assignedType.isContainer() && assignedType.getInstanceType()) { - return true; - } - - var decls = symbol.getDeclarations(); - var ast = decls[0].ast(); - return ast.moduleReference.kind() === 245 /* ExternalModuleReference */; - } - } - } - - return false; - }; - - var tryFindAlias = function (decl) { - var childDecls = decl.searchChildDecls(symbolName, 128 /* TypeAlias */); - - if (childDecls.length) { - var sym = childDecls[0].getSymbol(); - if (isAcceptableAlias(sym)) { - return sym; - } - } - return null; - }; - - for (var i = declPath.length - 1; i >= 0; i--) { - decl = declPath[i]; - pathDeclKind = decl.kind; - - if (decl.flags & 2097152 /* DeclaredInAWithBlock */) { - return this.semanticInfoChain.anyTypeSymbol; - } - - if (pathDeclKind & allowedContainerDeclKind) { - childDecls = decl.searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - return childDecls[0].getSymbol(); - } - - var alias = tryFindAlias(decl); - if (alias) { - return alias; - } - - if (declSearchKind & 68147712 /* SomeValue */) { - instanceSymbol = decl.getSymbol().getInstanceSymbol(); - - if (instanceSymbol) { - instanceType = instanceSymbol.type; - - childSymbol = this.getNamedPropertySymbol(symbolName, declSearchKind, instanceType); - - if (childSymbol && (childSymbol.kind & declSearchKind) && !childSymbol.anyDeclHasFlag(16 /* Static */)) { - return childSymbol; - } - } - - valDecl = decl.getValueDecl(); - - if (valDecl) { - decl = valDecl; - } - } - - declSymbol = decl.getSymbol().type; - - var childSymbol = this.getNamedPropertySymbol(symbolName, declSearchKind, declSymbol); - - if (childSymbol && (childSymbol.kind & declSearchKind) && !childSymbol.anyDeclHasFlag(16 /* Static */)) { - return childSymbol; - } - } else if ((declSearchKind & (58728795 /* SomeType */ | 164 /* SomeContainer */)) || !(pathDeclKind & 8 /* Class */)) { - var candidateSymbol = null; - - if (pathDeclKind === 131072 /* FunctionExpression */ && symbolName === decl.getFunctionExpressionName()) { - candidateSymbol = decl.getSymbol(); - } - - childDecls = decl.searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - if (decl.kind & 1032192 /* SomeFunction */) { - decl.ensureSymbolIsBound(); - } - return childDecls[0].getSymbol(); - } - - if (candidateSymbol) { - return candidateSymbol; - } - - var alias = tryFindAlias(decl); - if (alias) { - return alias; - } - } - } - - symbol = this.semanticInfoChain.findSymbol([symbolName], declSearchKind); - if (symbol) { - return symbol; - } - - if (!TypeScript.hasFlag(declSearchKind, 128 /* TypeAlias */)) { - symbol = this.semanticInfoChain.findSymbol([symbolName], 128 /* TypeAlias */); - if (symbol && isAcceptableAlias(symbol)) { - return symbol; - } - } - - return null; - }; - - PullTypeResolver.prototype.getVisibleDeclsFromDeclPath = function (declPath, declSearchKind) { - var result = []; - var decl = null; - var childDecls; - var pathDeclKind; - - for (var i = declPath.length - 1; i >= 0; i--) { - decl = declPath[i]; - pathDeclKind = decl.kind; - - var declKind = decl.kind; - - if (declKind !== 8 /* Class */ && declKind !== 16 /* Interface */) { - this.addFilteredDecls(decl.getChildDecls(), declSearchKind, result); - } - - switch (declKind) { - case 4 /* Container */: - case 32 /* DynamicModule */: - var otherDecls = this.semanticInfoChain.findDeclsFromPath(declPath.slice(0, i + 1), 164 /* SomeContainer */); - for (var j = 0, m = otherDecls.length; j < m; j++) { - var otherDecl = otherDecls[j]; - if (otherDecl === decl) { - continue; - } - - var otherDeclChildren = otherDecl.getChildDecls(); - for (var k = 0, s = otherDeclChildren.length; k < s; k++) { - var otherDeclChild = otherDeclChildren[k]; - if ((otherDeclChild.flags & 1 /* Exported */) && (otherDeclChild.kind & declSearchKind)) { - result.push(otherDeclChild); - } - } - } - - break; - - case 8 /* Class */: - case 16 /* Interface */: - var parameters = decl.getTypeParameters(); - if (parameters && parameters.length) { - this.addFilteredDecls(parameters, declSearchKind, result); - } - - break; - - case 131072 /* FunctionExpression */: - var functionExpressionName = decl.getFunctionExpressionName(); - if (functionExpressionName) { - result.push(decl); - } - - case 16384 /* Function */: - case 32768 /* ConstructorMethod */: - case 65536 /* Method */: - var parameters = decl.getTypeParameters(); - if (parameters && parameters.length) { - this.addFilteredDecls(parameters, declSearchKind, result); - } - - break; - } - } - - var topLevelDecls = this.semanticInfoChain.topLevelDecls(); - for (var i = 0, n = topLevelDecls.length; i < n; i++) { - var topLevelDecl = topLevelDecls[i]; - if (declPath.length > 0 && topLevelDecl.fileName() === declPath[0].fileName()) { - continue; - } - - if (!topLevelDecl.isExternalModule()) { - this.addFilteredDecls(topLevelDecl.getChildDecls(), declSearchKind, result); - } - } - - return result; - }; - - PullTypeResolver.prototype.addFilteredDecls = function (decls, declSearchKind, result) { - if (decls.length) { - for (var i = 0, n = decls.length; i < n; i++) { - var decl = decls[i]; - if (decl.kind & declSearchKind) { - result.push(decl); - } - } - } - }; - - PullTypeResolver.prototype.getVisibleDecls = function (enclosingDecl) { - var declPath = enclosingDecl.getParentPath(); - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - - return this.getVisibleDeclsFromDeclPath(declPath, declSearchKind); - }; - - PullTypeResolver.prototype.getVisibleContextSymbols = function (enclosingDecl, context) { - var contextualTypeSymbol = context.getContextualType(); - if (!contextualTypeSymbol || this.isAnyOrEquivalent(contextualTypeSymbol)) { - return null; - } - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - var members = contextualTypeSymbol.getAllMembers(declSearchKind, 2 /* externallyVisible */); - - for (var i = 0; i < members.length; i++) { - members[i].setUnresolved(); - } - - return members; - }; - - PullTypeResolver.prototype.getVisibleMembersFromExpression = function (expression, enclosingDecl, context) { - var lhs = this.resolveAST(expression, false, context); - - if (isTypesOnlyLocation(expression) && (lhs.kind === 8 /* Class */ || lhs.kind === 16 /* Interface */ || lhs.kind === 64 /* Enum */)) { - return null; - } - - var lhsType = lhs.type; - if (!lhsType) { - return null; - } - - this.resolveDeclaredSymbol(lhsType, context); - - if (lhsType.isContainer() && lhsType.isAlias()) { - lhsType = lhsType.getExportAssignedTypeSymbol(); - } - - if (this.isAnyOrEquivalent(lhsType)) { - return null; - } - - var memberVisibilty = 2 /* externallyVisible */; - var containerSymbol = lhsType; - if (containerSymbol.kind === 33554432 /* ConstructorType */) { - containerSymbol = containerSymbol.getConstructSignatures()[0].returnType; - } - - if (containerSymbol && containerSymbol.isClass()) { - var declPath = enclosingDecl.getParentPath(); - if (declPath && declPath.length) { - var declarations = containerSymbol.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; - if (TypeScript.ArrayUtilities.contains(declPath, declaration)) { - memberVisibilty = 1 /* internallyVisible */; - break; - } - } - } - } - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - - var members = []; - - if (lhsType.isContainer()) { - var exportedAssignedContainerSymbol = lhsType.getExportAssignedContainerSymbol(); - if (exportedAssignedContainerSymbol) { - lhsType = exportedAssignedContainerSymbol; - } - } - - lhsType = this.getApparentType(lhsType); - - if (!lhsType.isResolved) { - var potentiallySpecializedType = this.resolveDeclaredSymbol(lhsType, context); - - if (potentiallySpecializedType !== lhsType) { - if (!lhs.isType()) { - context.setTypeInContext(lhs, potentiallySpecializedType); - } - - lhsType = potentiallySpecializedType; - } - } - - members = lhsType.getAllMembers(declSearchKind, memberVisibilty); - - if (lhsType.isContainer()) { - var associatedInstance = lhsType.getInstanceSymbol(); - if (associatedInstance) { - var instanceType = associatedInstance.type; - this.resolveDeclaredSymbol(instanceType, context); - var instanceMembers = instanceType.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(instanceMembers); - } - - var exportedContainer = lhsType.getExportAssignedContainerSymbol(); - if (exportedContainer) { - var exportedContainerMembers = exportedContainer.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(exportedContainerMembers); - } - } else if (!lhsType.isConstructor() && !lhsType.isEnum()) { - var associatedContainerSymbol = lhsType.getAssociatedContainerType(); - if (associatedContainerSymbol) { - var containerType = associatedContainerSymbol.type; - this.resolveDeclaredSymbol(containerType, context); - var containerMembers = containerType.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(containerMembers); - } - } - - if (lhsType.isFunctionType() && this.cachedFunctionInterfaceType()) { - members = members.concat(this.cachedFunctionInterfaceType().getAllMembers(declSearchKind, 2 /* externallyVisible */)); - } - - return members; - }; - - PullTypeResolver.prototype.isAnyOrEquivalent = function (type) { - return (type === this.semanticInfoChain.anyTypeSymbol) || type.isError(); - }; - - PullTypeResolver.prototype.resolveExternalModuleReference = function (idText, currentFileName) { - var originalIdText = idText; - var symbol = null; - - if (TypeScript.isRelative(originalIdText)) { - var path = TypeScript.getRootFilePath(TypeScript.switchToForwardSlashes(currentFileName)); - symbol = this.semanticInfoChain.findExternalModule(path + idText); - } else { - idText = originalIdText; - - symbol = this.semanticInfoChain.findAmbientExternalModuleInGlobalContext(TypeScript.quoteStr(originalIdText)); - - if (!symbol) { - var path = TypeScript.getRootFilePath(TypeScript.switchToForwardSlashes(currentFileName)); - - while (symbol === null && path != "") { - symbol = this.semanticInfoChain.findExternalModule(path + idText); - if (symbol === null) { - if (path === '/') { - path = ''; - } else { - path = TypeScript.normalizePath(path + ".."); - path = path && path != '/' ? path + '/' : path; - } - } - } - } - } - - return symbol; - }; - - PullTypeResolver.prototype.resolveDeclaredSymbol = function (symbol, context) { - if (!symbol || symbol.isResolved || symbol.isTypeReference()) { - return symbol; - } - - if (!context) { - context = new TypeScript.PullTypeResolutionContext(this); - } - - return this.resolveDeclaredSymbolWorker(symbol, context); - }; - - PullTypeResolver.prototype.resolveDeclaredSymbolWorker = function (symbol, context) { - if (!symbol || symbol.isResolved) { - return symbol; - } - - if (symbol.inResolution) { - if (!symbol.type && !symbol.isType()) { - symbol.type = this.semanticInfoChain.anyTypeSymbol; - } - - return symbol; - } - - var decls = symbol.getDeclarations(); - - for (var i = 0; i < decls.length; i++) { - var decl = decls[i]; - - var ast = this.semanticInfoChain.getASTForDecl(decl); - - if (!ast || (ast.kind() === 139 /* GetAccessor */ && ast.parent.parent.kind() === 215 /* ObjectLiteralExpression */) || (ast.kind() === 140 /* SetAccessor */ && ast.parent.parent.kind() === 215 /* ObjectLiteralExpression */)) { - return symbol; - } - - if (ast.parent && ast.parent.kind() === 236 /* CatchClause */ && ast.parent.identifier === ast) { - return symbol; - } - - if (ast.parent && ast.parent.kind() === 219 /* SimpleArrowFunctionExpression */ && ast.parent.identifier === ast) { - return symbol; - } - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast); - var resolvedSymbol; - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, ast)) { - resolvedSymbol = this.resolveSingleModuleDeclaration(enclosingModule, ast, context); - } else if (ast.kind() === 120 /* SourceUnit */ && decl.kind === 32 /* DynamicModule */) { - resolvedSymbol = this.resolveModuleSymbol(decl.getSymbol(), context, null, null, ast); - } else { - TypeScript.Debug.assert(ast.kind() !== 11 /* IdentifierName */ && ast.kind() !== 212 /* MemberAccessExpression */); - resolvedSymbol = this.resolveAST(ast, false, context); - } - - if (decl.kind === 2048 /* Parameter */ && !symbol.isResolved && !symbol.type && resolvedSymbol && symbol.anyDeclHasFlag(8388608 /* PropertyParameter */ | 67108864 /* ConstructorParameter */)) { - symbol.type = resolvedSymbol.type; - symbol.setResolved(); - } - } - - return symbol; - }; - - PullTypeResolver.prototype.resolveOtherDecl = function (otherDecl, context) { - var astForOtherDecl = this.getASTForDecl(otherDecl); - var moduleDecl = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(astForOtherDecl); - if (TypeScript.ASTHelpers.isAnyNameOfModule(moduleDecl, astForOtherDecl)) { - this.resolveSingleModuleDeclaration(moduleDecl, astForOtherDecl, context); - } else { - this.resolveAST(astForOtherDecl, false, context); - } - }; - - PullTypeResolver.prototype.resolveOtherDeclarations = function (astName, context) { - var _this = this; - var resolvedDecl = this.semanticInfoChain.getDeclForAST(astName); - var symbol = resolvedDecl.getSymbol(); - - var allDecls = symbol.getDeclarations(); - this.inResolvingOtherDeclsWalker.walkOtherPullDecls(resolvedDecl, symbol.getDeclarations(), function (otherDecl) { - return _this.resolveOtherDecl(otherDecl, context); - }); - }; - - PullTypeResolver.prototype.resolveSourceUnit = function (sourceUnit, context) { - var enclosingDecl = this.getEnclosingDeclForAST(sourceUnit); - var moduleSymbol = enclosingDecl.getSymbol(); - this.ensureAllSymbolsAreBound(moduleSymbol); - - this.resolveFirstExportAssignmentStatement(sourceUnit.moduleElements, context); - this.resolveAST(sourceUnit.moduleElements, false, context); - - if (this.canTypeCheckAST(sourceUnit, context)) { - this.typeCheckSourceUnit(sourceUnit, context); - } - - return moduleSymbol; - }; - - PullTypeResolver.prototype.typeCheckSourceUnit = function (sourceUnit, context) { - var _this = this; - this.setTypeChecked(sourceUnit, context); - - this.resolveAST(sourceUnit.moduleElements, false, context); - - this.typeCheckCallBacks.push(function (context) { - return _this.verifyUniquenessOfImportNamesInSourceUnit(sourceUnit); - }); - }; - - PullTypeResolver.prototype.verifyUniquenessOfImportNamesInSourceUnit = function (sourceUnit) { - var _this = this; - var enclosingDecl = this.semanticInfoChain.getDeclForAST(sourceUnit); - - var doesImportNameExistInOtherFiles = function (name) { - var importSymbol = _this.semanticInfoChain.findTopLevelSymbol(name, 128 /* TypeAlias */, null); - return importSymbol && importSymbol.isAlias(); - }; - - this.checkUniquenessOfImportNames([enclosingDecl], doesImportNameExistInOtherFiles); - }; - - PullTypeResolver.prototype.resolveEnumDeclaration = function (ast, context) { - var containerDecl = this.semanticInfoChain.getDeclForAST(ast); - var containerSymbol = containerDecl.getSymbol(); - - if (containerSymbol.isResolved || containerSymbol.inResolution) { - return containerSymbol; - } - - containerSymbol.inResolution = true; - - var containerDecls = containerSymbol.getDeclarations(); - - for (var i = 0; i < containerDecls.length; i++) { - var childDecls = containerDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - - containerSymbol.setResolved(); - - this.resolveOtherDeclarations(ast, context); - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckEnumDeclaration(ast, context); - } - - return containerSymbol; - }; - - PullTypeResolver.prototype.typeCheckEnumDeclaration = function (ast, context) { - var _this = this; - this.setTypeChecked(ast, context); - - this.resolveAST(ast.enumElements, false, context); - var containerDecl = this.semanticInfoChain.getDeclForAST(ast); - this.validateVariableDeclarationGroups(containerDecl, context); - - this.typeCheckCallBacks.push(function (context) { - return _this.checkInitializersInEnumDeclarations(containerDecl, context); - }); - - if (!TypeScript.ASTHelpers.enumIsElided(ast)) { - this.checkNameForCompilerGeneratedDeclarationCollision(ast, true, ast.identifier, context); - } - }; - - PullTypeResolver.prototype.postTypeCheckEnumDeclaration = function (ast, context) { - this.checkThisCaptureVariableCollides(ast, true, context); - }; - - PullTypeResolver.prototype.checkInitializersInEnumDeclarations = function (decl, context) { - var symbol = decl.getSymbol(); - - var declarations = symbol.getDeclarations(); - if (decl !== declarations[0]) { - return; - } - - var seenEnumDeclWithNoFirstMember = false; - for (var i = 0; i < declarations.length; ++i) { - var currentDecl = declarations[i]; - - var ast = currentDecl.ast(); - if (ast.enumElements.nonSeparatorCount() === 0) { - continue; - } - - var firstVariable = ast.enumElements.nonSeparatorAt(0); - if (!firstVariable.equalsValueClause) { - if (!seenEnumDeclWithNoFirstMember) { - seenEnumDeclWithNoFirstMember = true; - } else { - this.semanticInfoChain.addDiagnosticFromAST(firstVariable, TypeScript.DiagnosticCode.In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element); - } - } - } - }; - - PullTypeResolver.prototype.resolveModuleDeclaration = function (ast, context) { - var result; - - if (ast.stringLiteral) { - result = this.resolveSingleModuleDeclaration(ast, ast.stringLiteral, context); - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - result = this.resolveSingleModuleDeclaration(ast, moduleNames[i], context); - } - } - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckModuleDeclaration(ast, context); - } - - return result; - }; - - PullTypeResolver.prototype.ensureAllSymbolsAreBound = function (containerSymbol) { - if (containerSymbol) { - var containerDecls = containerSymbol.getDeclarations(); - - for (var i = 0; i < containerDecls.length; i++) { - var childDecls = containerDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - } - }; - - PullTypeResolver.prototype.resolveModuleSymbol = function (containerSymbol, context, moduleDeclAST, moduleDeclNameAST, sourceUnitAST) { - if (containerSymbol.isResolved || containerSymbol.inResolution) { - return containerSymbol; - } - - containerSymbol.inResolution = true; - this.ensureAllSymbolsAreBound(containerSymbol); - - var instanceSymbol = containerSymbol.getInstanceSymbol(); - - if (instanceSymbol) { - this.resolveDeclaredSymbol(instanceSymbol, context); - } - - var isLastName = TypeScript.ASTHelpers.isLastNameOfModule(moduleDeclAST, moduleDeclNameAST); - if (isLastName) { - this.resolveFirstExportAssignmentStatement(moduleDeclAST.moduleElements, context); - } else if (sourceUnitAST) { - this.resolveFirstExportAssignmentStatement(sourceUnitAST.moduleElements, context); - } - - containerSymbol.setResolved(); - - if (moduleDeclNameAST) { - this.resolveOtherDeclarations(moduleDeclNameAST, context); - } - - return containerSymbol; - }; - - PullTypeResolver.prototype.resolveFirstExportAssignmentStatement = function (moduleElements, context) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - if (moduleElement.kind() === 134 /* ExportAssignment */) { - this.resolveExportAssignmentStatement(moduleElement, context); - return; - } - } - }; - - PullTypeResolver.prototype.resolveSingleModuleDeclaration = function (ast, astName, context) { - var containerDecl = this.semanticInfoChain.getDeclForAST(astName); - var containerSymbol = containerDecl.getSymbol(); - - return this.resolveModuleSymbol(containerSymbol, context, ast, astName, null); - }; - - PullTypeResolver.prototype.typeCheckModuleDeclaration = function (ast, context) { - if (ast.stringLiteral) { - this.typeCheckSingleModuleDeclaration(ast, ast.stringLiteral, context); - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - this.typeCheckSingleModuleDeclaration(ast, moduleNames[i], context); - } - } - }; - - PullTypeResolver.prototype.typeCheckSingleModuleDeclaration = function (ast, astName, context) { - var _this = this; - this.setTypeChecked(ast, context); - - if (TypeScript.ASTHelpers.isLastNameOfModule(ast, astName)) { - this.resolveAST(ast.moduleElements, false, context); - } - - var containerDecl = this.semanticInfoChain.getDeclForAST(astName); - this.validateVariableDeclarationGroups(containerDecl, context); - - if (ast.stringLiteral) { - if (TypeScript.isRelative(ast.stringLiteral.valueText())) { - this.semanticInfoChain.addDiagnosticFromAST(ast.stringLiteral, TypeScript.DiagnosticCode.Ambient_external_module_declaration_cannot_specify_relative_module_name); - } - } - - if (!TypeScript.ASTHelpers.moduleIsElided(ast) && !ast.stringLiteral) { - this.checkNameForCompilerGeneratedDeclarationCollision(astName, true, astName, context); - } - - this.typeCheckCallBacks.push(function (context) { - return _this.verifyUniquenessOfImportNamesInModule(containerDecl); - }); - }; - - PullTypeResolver.prototype.verifyUniquenessOfImportNamesInModule = function (decl) { - var symbol = decl.getSymbol(); - if (!symbol) { - return; - } - - var decls = symbol.getDeclarations(); - - if (decls[0] !== decl) { - return; - } - - this.checkUniquenessOfImportNames(decls); - }; - - PullTypeResolver.prototype.checkUniquenessOfImportNames = function (decls, doesNameExistOutside) { - var _this = this; - var importDeclarationNames; - - for (var i = 0; i < decls.length; ++i) { - var childDecls = decls[i].getChildDecls(); - for (var j = 0; j < childDecls.length; ++j) { - var childDecl = childDecls[j]; - if (childDecl.kind === 128 /* TypeAlias */) { - importDeclarationNames = importDeclarationNames || TypeScript.createIntrinsicsObject(); - importDeclarationNames[childDecl.name] = true; - } - } - } - - if (!importDeclarationNames && !doesNameExistOutside) { - return; - } - - for (var i = 0; i < decls.length; ++i) { - this.scanVariableDeclarationGroups(decls[i], function (firstDeclInGroup) { - var nameConflict = importDeclarationNames && importDeclarationNames[firstDeclInGroup.name]; - if (!nameConflict) { - nameConflict = doesNameExistOutside && doesNameExistOutside(firstDeclInGroup.name); - if (nameConflict) { - importDeclarationNames = importDeclarationNames || TypeScript.createIntrinsicsObject(); - importDeclarationNames[firstDeclInGroup.name] = true; - } - } - - if (nameConflict) { - _this.semanticInfoChain.addDiagnosticFromAST(firstDeclInGroup.ast(), TypeScript.DiagnosticCode.Variable_declaration_cannot_have_the_same_name_as_an_import_declaration); - } - }); - } - }; - - PullTypeResolver.prototype.scanVariableDeclarationGroups = function (enclosingDecl, firstDeclHandler, subsequentDeclHandler) { - var declGroups = enclosingDecl.getVariableDeclGroups(); - - for (var i = 0; i < declGroups.length; i++) { - var firstSymbol = null; - var enclosingDeclForFirstSymbol = null; - - if (enclosingDecl.kind === 1 /* Script */ && declGroups[i].length) { - var name = declGroups[i][0].name; - var candidateSymbol = this.semanticInfoChain.findTopLevelSymbol(name, 512 /* Variable */, enclosingDecl); - if (candidateSymbol && candidateSymbol.isResolved) { - if (!candidateSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */)) { - firstSymbol = candidateSymbol; - } - } - } - - for (var j = 0; j < declGroups[i].length; j++) { - var decl = declGroups[i][j]; - - var name = decl.name; - - var symbol = decl.getSymbol(); - - if (j === 0) { - firstDeclHandler(decl); - if (!subsequentDeclHandler) { - break; - } - - if (!firstSymbol || !firstSymbol.type) { - firstSymbol = symbol; - continue; - } - } - - subsequentDeclHandler(decl, firstSymbol); - } - } - }; - - PullTypeResolver.prototype.postTypeCheckModuleDeclaration = function (ast, context) { - this.checkThisCaptureVariableCollides(ast, true, context); - }; - - PullTypeResolver.prototype.isTypeRefWithoutTypeArgs = function (term) { - if (term.kind() === 11 /* IdentifierName */) { - return true; - } else if (term.kind() === 121 /* QualifiedName */) { - var binex = term; - - if (binex.right.kind() === 11 /* IdentifierName */) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.createInstantiatedType = function (type, typeArguments) { - if (!type.isGeneric()) { - return type; - } - - var typeParameters = type.getTypeArgumentsOrTypeParameters(); - - var typeParameterArgumentMap = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameterArgumentMap[typeParameters[i].pullSymbolID] = typeArguments[i] || new TypeScript.PullErrorTypeSymbol(this.semanticInfoChain.anyTypeSymbol, typeParameters[i].name); - } - - return TypeScript.PullInstantiatedTypeReferenceSymbol.create(this, type, typeParameterArgumentMap); - }; - - PullTypeResolver.prototype.resolveReferenceTypeDeclaration = function (classOrInterface, name, heritageClauses, context) { - var _this = this; - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(typeDecl); - var typeDeclSymbol = typeDecl.getSymbol(); - var typeDeclIsClass = classOrInterface.kind() === 131 /* ClassDeclaration */; - var hasVisited = this.getSymbolForAST(classOrInterface, context) !== null; - - if ((typeDeclSymbol.isResolved && hasVisited) || (typeDeclSymbol.inResolution && !context.isInBaseTypeResolution())) { - return typeDeclSymbol; - } - - var wasResolving = typeDeclSymbol.inResolution; - typeDeclSymbol.startResolving(); - - var typeRefDecls = typeDeclSymbol.getDeclarations(); - - for (var i = 0; i < typeRefDecls.length; i++) { - var childDecls = typeRefDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - - if (!typeDeclSymbol.isResolved) { - var typeDeclTypeParameters = typeDeclSymbol.getTypeParameters(); - for (var i = 0; i < typeDeclTypeParameters.length; i++) { - this.resolveDeclaredSymbol(typeDeclTypeParameters[i], context); - } - } - - var wasInBaseTypeResolution = context.startBaseTypeResolution(); - - if (!typeDeclIsClass && !hasVisited) { - typeDeclSymbol.resetKnownBaseTypeCount(); - } - - var extendsClause = TypeScript.ASTHelpers.getExtendsHeritageClause(heritageClauses); - if (extendsClause) { - for (var i = typeDeclSymbol.getKnownBaseTypeCount(); i < extendsClause.typeNames.nonSeparatorCount(); i = typeDeclSymbol.getKnownBaseTypeCount()) { - typeDeclSymbol.incrementKnownBaseCount(); - var parentType = this.resolveTypeReference(extendsClause.typeNames.nonSeparatorAt(i), context); - - if (typeDeclSymbol.isValidBaseKind(parentType, true)) { - this.setSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), parentType, null); - - if (!typeDeclSymbol.hasBase(parentType) && !parentType.hasBase(typeDeclSymbol)) { - typeDeclSymbol.addExtendedType(parentType); - - var specializations = typeDeclSymbol.getKnownSpecializations(); - - for (var j = 0; j < specializations.length; j++) { - specializations[j].addExtendedType(parentType); - } - } - } else if (parentType && !this.getSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), context)) { - this.setSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), parentType, null); - } - } - } - - var implementsClause = TypeScript.ASTHelpers.getImplementsHeritageClause(heritageClauses); - if (implementsClause && typeDeclIsClass) { - var extendsCount = extendsClause ? extendsClause.typeNames.nonSeparatorCount() : 0; - for (var i = typeDeclSymbol.getKnownBaseTypeCount(); ((i - extendsCount) >= 0) && ((i - extendsCount) < implementsClause.typeNames.nonSeparatorCount()); i = typeDeclSymbol.getKnownBaseTypeCount()) { - typeDeclSymbol.incrementKnownBaseCount(); - var implementedTypeAST = implementsClause.typeNames.nonSeparatorAt(i - extendsCount); - var implementedType = this.resolveTypeReference(implementedTypeAST, context); - - if (typeDeclSymbol.isValidBaseKind(implementedType, false)) { - this.setSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), implementedType, null); - - if (!typeDeclSymbol.hasBase(implementedType) && !implementedType.hasBase(typeDeclSymbol)) { - typeDeclSymbol.addImplementedType(implementedType); - } - } else if (implementedType && !this.getSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), context)) { - this.setSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), implementedType, null); - } - } - } - - context.doneBaseTypeResolution(wasInBaseTypeResolution); - - if (wasInBaseTypeResolution) { - typeDeclSymbol.inResolution = false; - - this.typeCheckCallBacks.push(function (context) { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - _this.resolveClassDeclaration(classOrInterface, context); - } else { - _this.resolveInterfaceDeclaration(classOrInterface, context); - } - }); - - return typeDeclSymbol; - } - - this.setSymbolForAST(name, typeDeclSymbol, context); - this.setSymbolForAST(classOrInterface, typeDeclSymbol, context); - - typeDeclSymbol.setResolved(); - - return typeDeclSymbol; - }; - - PullTypeResolver.prototype.resolveClassDeclaration = function (classDeclAST, context) { - var classDecl = this.semanticInfoChain.getDeclForAST(classDeclAST); - var classDeclSymbol = classDecl.getSymbol(); - - if (!classDeclSymbol.isResolved) { - this.resolveReferenceTypeDeclaration(classDeclAST, classDeclAST.identifier, classDeclAST.heritageClauses, context); - - var constructorMethod = classDeclSymbol.getConstructorMethod(); - var extendedTypes = classDeclSymbol.getExtendedTypes(); - var parentType = extendedTypes.length ? extendedTypes[0] : null; - - if (constructorMethod) { - var constructorTypeSymbol = constructorMethod.type; - - var constructSignatures = constructorTypeSymbol.getConstructSignatures(); - - if (!constructSignatures.length) { - var constructorSignature; - - var parentConstructor = parentType ? parentType.getConstructorMethod() : null; - - if (parentConstructor) { - this.resolveDeclaredSymbol(parentConstructor, context); - var parentConstructorType = parentConstructor.type; - var parentConstructSignatures = parentConstructorType.getConstructSignatures(); - - var parentConstructSignature; - var parentParameters; - - if (!parentConstructSignatures.length) { - parentConstructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - parentConstructSignature.returnType = parentType; - parentConstructSignature.addTypeParametersFromReturnType(); - parentConstructorType.appendConstructSignature(parentConstructSignature); - parentConstructSignature.addDeclaration(parentType.getDeclarations()[0]); - parentConstructSignatures = [parentConstructSignature]; - } - - for (var i = 0; i < parentConstructSignatures.length; i++) { - parentConstructSignature = parentConstructSignatures[i]; - parentParameters = parentConstructSignature.parameters; - - constructorSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */, parentConstructSignature.isDefinition()); - constructorSignature.returnType = classDeclSymbol; - constructorSignature.addTypeParametersFromReturnType(); - - for (var j = 0; j < parentParameters.length; j++) { - constructorSignature.addParameter(parentParameters[j], parentParameters[j].isOptional); - } - - constructorTypeSymbol.appendConstructSignature(constructorSignature); - constructorSignature.addDeclaration(classDecl); - } - } else { - constructorSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - constructorSignature.returnType = classDeclSymbol; - constructorSignature.addTypeParametersFromReturnType(); - constructorTypeSymbol.appendConstructSignature(constructorSignature); - constructorSignature.addDeclaration(classDecl); - } - } - - if (!classDeclSymbol.isResolved) { - return classDeclSymbol; - } - - if (parentType) { - var parentConstructorSymbol = parentType.getConstructorMethod(); - - if (parentConstructorSymbol) { - var parentConstructorTypeSymbol = parentConstructorSymbol.type; - - if (!constructorTypeSymbol.hasBase(parentConstructorTypeSymbol)) { - constructorTypeSymbol.addExtendedType(parentConstructorTypeSymbol); - } - } - } - } - - this.resolveOtherDeclarations(classDeclAST, context); - } - - if (this.canTypeCheckAST(classDeclAST, context)) { - this.typeCheckClassDeclaration(classDeclAST, context); - } - - return classDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckTypeParametersOfTypeDeclaration = function (classOrInterface, context) { - var _this = this; - var typeParametersList = classOrInterface.kind() == 131 /* ClassDeclaration */ ? classOrInterface.typeParameterList : classOrInterface.typeParameterList; - - if (typeParametersList) { - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var typeDeclSymbol = typeDecl.getSymbol(); - - for (var i = 0; i < typeParametersList.typeParameters.nonSeparatorCount(); i++) { - var typeParameterAST = typeParametersList.typeParameters.nonSeparatorAt(i); - this.resolveTypeParameterDeclaration(typeParameterAST, context); - - var typeParameterDecl = this.semanticInfoChain.getDeclForAST(typeParameterAST); - var typeParameterSymbol = typeParameterDecl.getSymbol(); - - this.checkSymbolPrivacy(typeDeclSymbol, typeParameterSymbol, function (symbol) { - return _this.typeParameterOfTypeDeclarationPrivacyErrorReporter(classOrInterface, typeParameterAST, typeParameterSymbol, symbol, context); - }); - } - } - }; - - PullTypeResolver.prototype.typeCheckClassDeclaration = function (classDeclAST, context) { - this.setTypeChecked(classDeclAST, context); - - var classDecl = this.semanticInfoChain.getDeclForAST(classDeclAST); - var classDeclSymbol = classDecl.getSymbol(); - - this.checkNameForCompilerGeneratedDeclarationCollision(classDeclAST, true, classDeclAST.identifier, context); - this.resolveAST(classDeclAST.classElements, false, context); - - this.typeCheckTypeParametersOfTypeDeclaration(classDeclAST, context); - this.typeCheckBases(classDeclAST, classDeclAST.identifier, classDeclAST.heritageClauses, classDeclSymbol, this.getEnclosingDecl(classDecl), context); - - if (!classDeclSymbol.hasBaseTypeConflict()) { - this.typeCheckMembersAgainstIndexer(classDeclSymbol, classDecl, context); - } - - this.checkTypeForDuplicateIndexSignatures(classDeclSymbol); - }; - - PullTypeResolver.prototype.postTypeCheckClassDeclaration = function (classDeclAST, context) { - this.checkThisCaptureVariableCollides(classDeclAST, true, context); - }; - - PullTypeResolver.prototype.resolveTypeSymbolSignatures = function (typeSymbol, context) { - var callSignatures = typeSymbol.getCallSignatures(); - for (var i = 0; i < callSignatures.length; i++) { - this.resolveDeclaredSymbol(callSignatures[i], context); - } - - var constructSignatures = typeSymbol.getConstructSignatures(); - for (var i = 0; i < constructSignatures.length; i++) { - this.resolveDeclaredSymbol(constructSignatures[i], context); - } - - var indexSignatures = typeSymbol.getIndexSignatures(); - for (var i = 0; i < indexSignatures.length; i++) { - this.resolveDeclaredSymbol(indexSignatures[i], context); - } - }; - - PullTypeResolver.prototype.resolveInterfaceDeclaration = function (interfaceDeclAST, context) { - this.resolveReferenceTypeDeclaration(interfaceDeclAST, interfaceDeclAST.identifier, interfaceDeclAST.heritageClauses, context); - - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - this.resolveTypeSymbolSignatures(interfaceDeclSymbol, context); - - if (interfaceDeclSymbol.isResolved) { - this.resolveOtherDeclarations(interfaceDeclAST, context); - - if (this.canTypeCheckAST(interfaceDeclAST, context)) { - this.typeCheckInterfaceDeclaration(interfaceDeclAST, context); - } - } - - return interfaceDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckInterfaceDeclaration = function (interfaceDeclAST, context) { - this.setTypeChecked(interfaceDeclAST, context); - - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - this.resolveAST(interfaceDeclAST.body.typeMembers, false, context); - - this.typeCheckTypeParametersOfTypeDeclaration(interfaceDeclAST, context); - this.typeCheckBases(interfaceDeclAST, interfaceDeclAST.identifier, interfaceDeclAST.heritageClauses, interfaceDeclSymbol, this.getEnclosingDecl(interfaceDecl), context); - - if (!interfaceDeclSymbol.hasBaseTypeConflict()) { - this.typeCheckMembersAgainstIndexer(interfaceDeclSymbol, interfaceDecl, context); - } - - var allInterfaceDecls = interfaceDeclSymbol.getDeclarations(); - if (interfaceDecl === allInterfaceDecls[allInterfaceDecls.length - 1]) { - this.checkTypeForDuplicateIndexSignatures(interfaceDeclSymbol); - } - - if (!this.checkInterfaceDeclForIdenticalTypeParameters(interfaceDeclAST, context)) { - this.semanticInfoChain.addDiagnosticFromAST(interfaceDeclAST.identifier, TypeScript.DiagnosticCode.All_declarations_of_an_interface_must_have_identical_type_parameters); - } - }; - - PullTypeResolver.prototype.checkInterfaceDeclForIdenticalTypeParameters = function (interfaceDeclAST, context) { - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - if (!interfaceDeclSymbol.isGeneric()) { - return true; - } - - var firstInterfaceDecl = interfaceDeclSymbol.getDeclarations()[0]; - if (firstInterfaceDecl == interfaceDecl) { - return true; - } - - var typeParameters = interfaceDecl.getTypeParameters(); - var firstInterfaceDeclTypeParameters = firstInterfaceDecl.getTypeParameters(); - - if (typeParameters.length != firstInterfaceDeclTypeParameters.length) { - return false; - } - - for (var i = 0; i < typeParameters.length; i++) { - var typeParameter = typeParameters[i]; - var firstInterfaceDeclTypeParameter = firstInterfaceDeclTypeParameters[i]; - - if (typeParameter.name != firstInterfaceDeclTypeParameter.name) { - return false; - } - - var typeParameterSymbol = typeParameter.getSymbol(); - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter); - var firstInterfaceDeclTypeParameterAST = this.semanticInfoChain.getASTForDecl(firstInterfaceDeclTypeParameter); - - if (!!typeParameterAST.constraint != !!firstInterfaceDeclTypeParameterAST.constraint) { - return false; - } - - if (typeParameterAST.constraint) { - var typeParameterConstraint = this.resolveAST(typeParameterAST.constraint, false, context); - if (!this.typesAreIdenticalWithNewEnclosingTypes(typeParameterConstraint, typeParameterSymbol.getConstraint(), context)) { - return false; - } - } - } - - return true; - }; - - PullTypeResolver.prototype.checkTypeForDuplicateIndexSignatures = function (enclosingTypeSymbol) { - var indexSignatures = enclosingTypeSymbol.getOwnIndexSignatures(); - var firstStringIndexer = null; - var firstNumberIndexer = null; - for (var i = 0; i < indexSignatures.length; i++) { - var currentIndexer = indexSignatures[i]; - var currentParameterType = currentIndexer.parameters[0].type; - TypeScript.Debug.assert(currentParameterType); - if (currentParameterType === this.semanticInfoChain.stringTypeSymbol) { - if (firstStringIndexer) { - this.semanticInfoChain.addDiagnosticFromAST(currentIndexer.getDeclarations()[0].ast(), TypeScript.DiagnosticCode.Duplicate_string_index_signature, null, [this.semanticInfoChain.locationFromAST(firstStringIndexer.getDeclarations()[0].ast())]); - return; - } else { - firstStringIndexer = currentIndexer; - } - } else if (currentParameterType === this.semanticInfoChain.numberTypeSymbol) { - if (firstNumberIndexer) { - this.semanticInfoChain.addDiagnosticFromAST(currentIndexer.getDeclarations()[0].ast(), TypeScript.DiagnosticCode.Duplicate_number_index_signature, null, [this.semanticInfoChain.locationFromAST(firstNumberIndexer.getDeclarations()[0].ast())]); - return; - } else { - firstNumberIndexer = currentIndexer; - } - } - } - }; - - PullTypeResolver.prototype.filterSymbol = function (symbol, kind, enclosingDecl, context) { - if (symbol) { - if (symbol.kind & kind) { - return symbol; - } - - if (symbol.isAlias()) { - this.resolveDeclaredSymbol(symbol, context); - - var alias = symbol; - if (kind & 164 /* SomeContainer */) { - return alias.getExportAssignedContainerSymbol(); - } else if (kind & 58728795 /* SomeType */) { - return alias.getExportAssignedTypeSymbol(); - } else if (kind & 68147712 /* SomeValue */) { - return alias.getExportAssignedValueSymbol(); - } - } - } - return null; - }; - - PullTypeResolver.prototype.getMemberSymbolOfKind = function (symbolName, kind, pullTypeSymbol, enclosingDecl, context) { - var memberSymbol = this.getNamedPropertySymbol(symbolName, kind, pullTypeSymbol); - - return { - symbol: this.filterSymbol(memberSymbol, kind, enclosingDecl, context), - aliasSymbol: memberSymbol && memberSymbol.isAlias() ? memberSymbol : null - }; - }; - - PullTypeResolver.prototype.resolveIdentifierOfInternalModuleReference = function (importDecl, identifier, moduleSymbol, enclosingDecl, context) { - var rhsName = identifier.valueText(); - if (rhsName.length === 0) { - return null; - } - - var moduleTypeSymbol = moduleSymbol.type; - var memberSymbol = this.getMemberSymbolOfKind(rhsName, 164 /* SomeContainer */, moduleTypeSymbol, enclosingDecl, context); - var containerSymbol = memberSymbol.symbol; - var valueSymbol = null; - var typeSymbol = null; - var aliasSymbol = null; - - var acceptableAlias = true; - - if (containerSymbol) { - acceptableAlias = (containerSymbol.kind & 59753052 /* AcceptableAlias */) !== 0; - aliasSymbol = memberSymbol.aliasSymbol; - } - - if (!acceptableAlias && containerSymbol && containerSymbol.kind === 128 /* TypeAlias */) { - this.resolveDeclaredSymbol(containerSymbol, context); - var aliasedAssignedValue = containerSymbol.getExportAssignedValueSymbol(); - var aliasedAssignedType = containerSymbol.getExportAssignedTypeSymbol(); - var aliasedAssignedContainer = containerSymbol.getExportAssignedContainerSymbol(); - - if (aliasedAssignedValue || aliasedAssignedType || aliasedAssignedContainer) { - aliasSymbol = containerSymbol; - valueSymbol = aliasedAssignedValue; - typeSymbol = aliasedAssignedType; - containerSymbol = aliasedAssignedContainer; - acceptableAlias = true; - } - } - - if (!acceptableAlias) { - this.semanticInfoChain.addDiagnosticFromAST(identifier, TypeScript.DiagnosticCode.Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules); - return null; - } - - if (!valueSymbol) { - if (moduleTypeSymbol.getInstanceSymbol()) { - memberSymbol = this.getMemberSymbolOfKind(rhsName, 68147712 /* SomeValue */, moduleTypeSymbol.getInstanceSymbol().type, enclosingDecl, context); - valueSymbol = memberSymbol.symbol; - if (valueSymbol && memberSymbol.aliasSymbol) { - aliasSymbol = memberSymbol.aliasSymbol; - } - } - } - - if (!typeSymbol) { - memberSymbol = this.getMemberSymbolOfKind(rhsName, 58728795 /* SomeType */, moduleTypeSymbol, enclosingDecl, context); - typeSymbol = memberSymbol.symbol; - if (typeSymbol && memberSymbol.aliasSymbol) { - aliasSymbol = memberSymbol.aliasSymbol; - } - } - - if (!valueSymbol && !typeSymbol && !containerSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(identifier, TypeScript.DiagnosticCode.Could_not_find_symbol_0_in_module_1, [rhsName, moduleSymbol.toString()]); - return null; - } - - if (!typeSymbol && containerSymbol) { - typeSymbol = containerSymbol; - } - - return { - valueSymbol: valueSymbol, - typeSymbol: typeSymbol, - containerSymbol: containerSymbol, - aliasSymbol: aliasSymbol - }; - }; - - PullTypeResolver.prototype.resolveModuleReference = function (importDecl, moduleNameExpr, enclosingDecl, context, declPath) { - TypeScript.Debug.assert(moduleNameExpr.kind() === 121 /* QualifiedName */ || moduleNameExpr.kind() === 11 /* IdentifierName */ || moduleNameExpr.kind() === 14 /* StringLiteral */, "resolving module reference should always be either name or member reference"); - - var moduleSymbol = null; - var moduleName; - - if (moduleNameExpr.kind() === 121 /* QualifiedName */) { - var dottedNameAST = moduleNameExpr; - var moduleContainer = this.resolveModuleReference(importDecl, dottedNameAST.left, enclosingDecl, context, declPath); - if (moduleContainer) { - moduleName = dottedNameAST.right.valueText(); - - moduleSymbol = this.getMemberSymbolOfKind(moduleName, 4 /* Container */, moduleContainer.type, enclosingDecl, context).symbol; - if (!moduleSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(dottedNameAST.right, TypeScript.DiagnosticCode.Could_not_find_module_0_in_module_1, [moduleName, moduleContainer.toString()]); - } - } - } else { - var valueText = moduleNameExpr.kind() === 11 /* IdentifierName */ ? moduleNameExpr.valueText() : moduleNameExpr.valueText(); - var text = moduleNameExpr.kind() === 11 /* IdentifierName */ ? moduleNameExpr.text() : moduleNameExpr.text(); - - if (text.length > 0) { - var resolvedModuleNameSymbol = this.getSymbolFromDeclPath(valueText, declPath, 4 /* Container */); - moduleSymbol = this.filterSymbol(resolvedModuleNameSymbol, 4 /* Container */, enclosingDecl, context); - if (moduleSymbol) { - this.semanticInfoChain.setSymbolForAST(moduleNameExpr, moduleSymbol); - if (resolvedModuleNameSymbol.isAlias()) { - this.semanticInfoChain.setAliasSymbolForAST(moduleNameExpr, resolvedModuleNameSymbol); - var importDeclSymbol = importDecl.getSymbol(); - importDeclSymbol.addLinkedAliasSymbol(resolvedModuleNameSymbol); - } - } else { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameExpr, TypeScript.DiagnosticCode.Unable_to_resolve_module_reference_0, [valueText]); - } - } - } - - return moduleSymbol; - }; - - PullTypeResolver.prototype.resolveInternalModuleReference = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - - var moduleReference = importStatementAST.moduleReference; - - var aliasExpr = moduleReference.kind() === 245 /* ExternalModuleReference */ ? moduleReference.stringLiteral : moduleReference.moduleName; - - var declPath = enclosingDecl.getParentPath(); - var aliasedType = null; - var importDeclSymbol = importDecl.getSymbol(); - - if (aliasExpr.kind() === 11 /* IdentifierName */ || aliasExpr.kind() === 14 /* StringLiteral */) { - var moduleSymbol = this.resolveModuleReference(importDecl, aliasExpr, enclosingDecl, context, declPath); - if (moduleSymbol) { - aliasedType = moduleSymbol.type; - this.semanticInfoChain.setAliasSymbolForAST(moduleReference, this.semanticInfoChain.getAliasSymbolForAST(aliasExpr)); - if (aliasedType.anyDeclHasFlag(32768 /* InitializedModule */)) { - var moduleName = aliasExpr.kind() === 11 /* IdentifierName */ ? aliasExpr.valueText() : aliasExpr.valueText(); - var valueSymbol = this.getSymbolFromDeclPath(moduleName, declPath, 68147712 /* SomeValue */); - var instanceSymbol = aliasedType.getInstanceSymbol(); - - if (valueSymbol && (instanceSymbol != valueSymbol || valueSymbol.type === aliasedType)) { - var text = aliasExpr.kind() === 11 /* IdentifierName */ ? aliasExpr.text() : aliasExpr.text(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(aliasExpr, TypeScript.DiagnosticCode.Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1, [text, moduleSymbol.type.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - } else { - importDeclSymbol.setAssignedValueSymbol(valueSymbol); - } - } - } else { - aliasedType = this.getNewErrorTypeSymbol(); - } - } else if (aliasExpr.kind() === 121 /* QualifiedName */) { - var dottedNameAST = aliasExpr; - var moduleSymbol = this.resolveModuleReference(importDecl, dottedNameAST.left, enclosingDecl, context, declPath); - if (moduleSymbol) { - var identifierResolution = this.resolveIdentifierOfInternalModuleReference(importDecl, dottedNameAST.right, moduleSymbol, enclosingDecl, context); - if (identifierResolution) { - importDeclSymbol.setAssignedValueSymbol(identifierResolution.valueSymbol); - importDeclSymbol.setAssignedTypeSymbol(identifierResolution.typeSymbol); - importDeclSymbol.setAssignedContainerSymbol(identifierResolution.containerSymbol); - this.semanticInfoChain.setAliasSymbolForAST(moduleReference, identifierResolution.aliasSymbol); - return null; - } - } - } - - if (!aliasedType) { - importDeclSymbol.setAssignedTypeSymbol(this.getNewErrorTypeSymbol()); - } - - return aliasedType; - }; - - PullTypeResolver.prototype.resolveImportDeclaration = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - var importDeclSymbol = importDecl.getSymbol(); - - var aliasedType = null; - - if (importDeclSymbol.isResolved) { - return importDeclSymbol; - } - - importDeclSymbol.startResolving(); - - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var modPath = importStatementAST.moduleReference.stringLiteral.valueText(); - var declPath = enclosingDecl.getParentPath(); - - aliasedType = this.resolveExternalModuleReference(modPath, importDecl.fileName()); - - if (!aliasedType) { - var path = importStatementAST.moduleReference.stringLiteral.text(); - this.semanticInfoChain.addDiagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Unable_to_resolve_external_module_0, [path]); - aliasedType = this.getNewErrorTypeSymbol(); - } - } else { - aliasedType = this.resolveInternalModuleReference(importStatementAST, context); - } - - if (aliasedType) { - if (!aliasedType.isContainer()) { - this.semanticInfoChain.addDiagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Module_cannot_be_aliased_to_a_non_module_type); - if (!aliasedType.isError()) { - aliasedType = this.getNewErrorTypeSymbol(); - } - } - - if (aliasedType.isContainer()) { - importDeclSymbol.setAssignedContainerSymbol(aliasedType); - } - importDeclSymbol.setAssignedTypeSymbol(aliasedType); - - this.setSymbolForAST(importStatementAST.moduleReference, aliasedType, null); - } - - importDeclSymbol.setResolved(); - - this.resolveDeclaredSymbol(importDeclSymbol.assignedValue(), context); - this.resolveDeclaredSymbol(importDeclSymbol.assignedType(), context); - this.resolveDeclaredSymbol(importDeclSymbol.assignedContainer(), context); - - if (aliasedType && importDeclSymbol.anyDeclHasFlag(1 /* Exported */)) { - importDeclSymbol.setIsUsedInExportedAlias(); - - if (aliasedType.isContainer() && aliasedType.getExportAssignedValueSymbol()) { - importDeclSymbol.setIsUsedAsValue(); - } - } - - if (this.canTypeCheckAST(importStatementAST, context)) { - this.typeCheckImportDeclaration(importStatementAST, context); - } - - return importDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckImportDeclaration = function (importStatementAST, context) { - var _this = this; - this.setTypeChecked(importStatementAST, context); - - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - var importDeclSymbol = importDecl.getSymbol(); - - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - if (this.compilationSettings.noResolve()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set, null)); - } - - var modPath = importStatementAST.moduleReference.stringLiteral.valueText(); - if (enclosingDecl.kind === 32 /* DynamicModule */) { - var ast = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(this.getASTForDecl(enclosingDecl)); - if (ast && ast.kind() === 130 /* ModuleDeclaration */) { - if (TypeScript.isRelative(modPath)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name)); - } - } - } - } - - var checkPrivacy; - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var containerSymbol = importDeclSymbol.getExportAssignedContainerSymbol(); - var container = containerSymbol ? containerSymbol.getContainer() : null; - if (container && container.kind === 32 /* DynamicModule */) { - checkPrivacy = true; - } - } else { - checkPrivacy = true; - } - - if (checkPrivacy) { - var typeSymbol = importDeclSymbol.getExportAssignedTypeSymbol(); - var containerSymbol = importDeclSymbol.getExportAssignedContainerSymbol(); - var valueSymbol = importDeclSymbol.getExportAssignedValueSymbol(); - - this.checkSymbolPrivacy(importDeclSymbol, containerSymbol, function (symbol) { - var messageCode = TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1; - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - - if (typeSymbol !== containerSymbol) { - this.checkSymbolPrivacy(importDeclSymbol, typeSymbol, function (symbol) { - var messageCode = symbol.isContainer() && !symbol.isEnum() ? TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1 : TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1; - - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - } - - if (valueSymbol) { - this.checkSymbolPrivacy(importDeclSymbol, valueSymbol.type, function (symbol) { - var messageCode = symbol.isContainer() && !symbol.isEnum() ? TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1 : TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1; - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - } - } - - this.checkNameForCompilerGeneratedDeclarationCollision(importStatementAST, true, importStatementAST.identifier, context); - }; - - PullTypeResolver.prototype.postTypeCheckImportDeclaration = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var importSymbol = importDecl.getSymbol(); - - var isUsedAsValue = importSymbol.isUsedAsValue(); - var hasAssignedValue = importStatementAST.moduleReference.kind() !== 245 /* ExternalModuleReference */ && importSymbol.getExportAssignedValueSymbol() !== null; - - if (isUsedAsValue || hasAssignedValue) { - this.checkThisCaptureVariableCollides(importStatementAST, true, context); - } - }; - - PullTypeResolver.prototype.resolveExportAssignmentStatement = function (exportAssignmentAST, context) { - var id = exportAssignmentAST.identifier.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var valueSymbol = null; - var typeSymbol = null; - var containerSymbol = null; - - var enclosingDecl = this.getEnclosingDeclForAST(exportAssignmentAST); - var parentSymbol = enclosingDecl.getSymbol(); - - if (!parentSymbol.isType() && parentSymbol.isContainer()) { - this.semanticInfoChain.addDiagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Export_assignments_may_only_be_used_at_the_top_level_of_external_modules); - return this.semanticInfoChain.anyTypeSymbol; - } - - var declPath = enclosingDecl !== null ? [enclosingDecl] : []; - - containerSymbol = this.getSymbolFromDeclPath(id, declPath, 164 /* SomeContainer */); - - var acceptableAlias = true; - - if (containerSymbol) { - acceptableAlias = (containerSymbol.kind & 59753052 /* AcceptableAlias */) !== 0; - } - - if (!acceptableAlias && containerSymbol && containerSymbol.kind === 128 /* TypeAlias */) { - this.resolveDeclaredSymbol(containerSymbol, context); - - var aliasSymbol = containerSymbol; - var aliasedAssignedValue = aliasSymbol.getExportAssignedValueSymbol(); - var aliasedAssignedType = aliasSymbol.getExportAssignedTypeSymbol(); - var aliasedAssignedContainer = aliasSymbol.getExportAssignedContainerSymbol(); - - if (aliasedAssignedValue || aliasedAssignedType || aliasedAssignedContainer) { - valueSymbol = aliasedAssignedValue; - typeSymbol = aliasedAssignedType; - containerSymbol = aliasedAssignedContainer; - aliasSymbol.setTypeUsedExternally(); - if (valueSymbol) { - aliasSymbol.setIsUsedAsValue(); - } - acceptableAlias = true; - } - } - - if (!acceptableAlias) { - this.semanticInfoChain.addDiagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules); - return this.semanticInfoChain.voidTypeSymbol; - } - - if (!valueSymbol) { - valueSymbol = this.getSymbolFromDeclPath(id, declPath, 68147712 /* SomeValue */); - } - if (!typeSymbol) { - typeSymbol = this.getSymbolFromDeclPath(id, declPath, 58728795 /* SomeType */); - } - - if (!valueSymbol && !typeSymbol && !containerSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [id])); - return this.semanticInfoChain.voidTypeSymbol; - } - - if (valueSymbol) { - parentSymbol.setExportAssignedValueSymbol(valueSymbol); - } - if (typeSymbol) { - parentSymbol.setExportAssignedTypeSymbol(typeSymbol); - } - if (containerSymbol) { - parentSymbol.setExportAssignedContainerSymbol(containerSymbol); - } - - this.resolveDeclaredSymbol(valueSymbol, context); - this.resolveDeclaredSymbol(typeSymbol, context); - this.resolveDeclaredSymbol(containerSymbol, context); - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveAnyFunctionTypeSignature = function (funcDeclAST, typeParameters, parameterList, returnTypeAnnotation, context) { - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - TypeScript.Debug.assert(functionDecl); - - var funcDeclSymbol = functionDecl.getSymbol(); - - var signature = funcDeclSymbol.kind === 33554432 /* ConstructorType */ ? funcDeclSymbol.getConstructSignatures()[0] : funcDeclSymbol.getCallSignatures()[0]; - - if (returnTypeAnnotation) { - signature.returnType = this.resolveTypeReference(returnTypeAnnotation, context); - } - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - if (parameterList) { - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveFunctionTypeSignatureParameter(parameterList.parameters.nonSeparatorAt(i), signature, functionDecl, context); - } - } - - funcDeclSymbol.setResolved(); - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.setTypeChecked(funcDeclAST, context); - this.typeCheckFunctionOverloads(funcDeclAST, context); - } - - return funcDeclSymbol; - }; - - PullTypeResolver.prototype.resolveFunctionTypeSignatureParameter = function (argDeclAST, signature, enclosingDecl, context) { - var paramDecl = this.semanticInfoChain.getDeclForAST(argDeclAST); - var paramSymbol = paramDecl.getSymbol(); - - if (argDeclAST.typeAnnotation) { - var typeRef = this.resolveTypeReference(TypeScript.ASTHelpers.getType(argDeclAST), context); - - if (paramSymbol.isVarArg && !typeRef.isArrayNamedTypeReference()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeRef = this.getNewErrorTypeSymbol(); - } - - context.setTypeInContext(paramSymbol, typeRef); - } else { - if (paramSymbol.isVarArg) { - if (this.cachedArrayInterfaceType()) { - context.setTypeInContext(paramSymbol, this.createInstantiatedType(this.cachedArrayInterfaceType(), [this.semanticInfoChain.anyTypeSymbol])); - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_function_type_implicitly_has_an_any_type, [argDeclAST.identifier.text()])); - } - } - - if (TypeScript.hasFlag(paramDecl.flags, 128 /* Optional */) && argDeclAST.equalsValueClause && isTypesOnlyLocation(argDeclAST)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Default_arguments_are_only_allowed_in_implementation)); - } - - paramSymbol.setResolved(); - }; - - PullTypeResolver.prototype.resolveFunctionExpressionParameter = function (argDeclAST, id, typeExpr, equalsValueClause, contextParam, enclosingDecl, context) { - var paramDecl = this.semanticInfoChain.getDeclForAST(argDeclAST); - var paramSymbol = paramDecl.getSymbol(); - var contextualType = contextParam && contextParam.type; - var isImplicitAny = false; - - if (typeExpr) { - var typeRef = this.resolveTypeReference(typeExpr, context); - - if (paramSymbol.isVarArg && !typeRef.isArrayNamedTypeReference()) { - var diagnostic = context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeRef = this.getNewErrorTypeSymbol(); - } - - contextualType = typeRef || contextualType; - } - if (contextualType) { - if (context.isInferentiallyTyping()) { - contextualType = context.fixAllTypeParametersReferencedByType(contextualType, this); - } - context.setTypeInContext(paramSymbol, contextualType); - } else if (paramSymbol.isVarArg) { - if (this.cachedArrayInterfaceType()) { - context.setTypeInContext(paramSymbol, this.createInstantiatedType(this.cachedArrayInterfaceType(), [this.semanticInfoChain.anyTypeSymbol])); - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - isImplicitAny = true; - } - - var canTypeCheckAST = this.canTypeCheckAST(argDeclAST, context); - if (equalsValueClause && (canTypeCheckAST || !contextualType)) { - if (contextualType) { - context.propagateContextualType(contextualType); - } - - var initExprSymbol = this.resolveAST(equalsValueClause, contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - } - - if (!initExprSymbol || !initExprSymbol.type) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [id.text()])); - - if (!contextualType) { - context.setTypeInContext(paramSymbol, this.getNewErrorTypeSymbol(paramSymbol.name)); - } - } else { - var initTypeSymbol = this.getInstanceTypeForAssignment(argDeclAST, initExprSymbol.type, context); - if (!contextualType) { - context.setTypeInContext(paramSymbol, initTypeSymbol.widenedType(this, equalsValueClause, context)); - isImplicitAny = initTypeSymbol !== paramSymbol.type; - } else { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(initTypeSymbol, contextualType, argDeclAST, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(argDeclAST); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [initTypeSymbol.toString(enclosingSymbol), contextualType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [initTypeSymbol.toString(enclosingSymbol), contextualType.toString(enclosingSymbol)])); - } - } - } - } - } - - if (!contextualType && !paramSymbol.isVarArg && !initTypeSymbol) { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - isImplicitAny = true; - } - - if (isImplicitAny && this.compilationSettings.noImplicitAny()) { - var functionExpressionName = paramDecl.getParentDecl().getFunctionExpressionName(); - if (functionExpressionName) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [id.text(), functionExpressionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_lambda_function_implicitly_has_an_any_type, [id.text()])); - } - } - - if (canTypeCheckAST) { - this.checkNameForCompilerGeneratedDeclarationCollision(argDeclAST, true, id, context); - } - - paramSymbol.setResolved(); - }; - - PullTypeResolver.prototype.checkNameForCompilerGeneratedDeclarationCollision = function (astWithName, isDeclaration, name, context) { - var compilerReservedName = getCompilerReservedName(name); - switch (compilerReservedName) { - case 1 /* _this */: - this.postTypeCheckWorkitems.push(astWithName); - return; - - case 2 /* _super */: - this.checkSuperCaptureVariableCollides(astWithName, isDeclaration, context); - return; - - case 3 /* arguments */: - this.checkArgumentsCollides(astWithName, context); - return; - - case 4 /* _i */: - this.checkIndexOfRestArgumentInitializationCollides(astWithName, isDeclaration, context); - return; - - case 5 /* require */: - case 6 /* exports */: - if (isDeclaration) { - this.checkExternalModuleRequireExportsCollides(astWithName, name, context); - } - return; - } - }; - - PullTypeResolver.prototype.hasRestParameterCodeGen = function (someFunctionDecl) { - var enclosingAST = this.getASTForDecl(someFunctionDecl); - var nodeType = enclosingAST.kind(); - - if (nodeType === 129 /* FunctionDeclaration */) { - var functionDeclaration = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.kind === 65536 /* Method */ ? someFunctionDecl.getParentDecl().flags : someFunctionDecl.flags, 8 /* Ambient */) && functionDeclaration.block && TypeScript.lastParameterIsRest(functionDeclaration.callSignature.parameterList); - } else if (nodeType === 135 /* MemberFunctionDeclaration */) { - var memberFunction = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.kind === 65536 /* Method */ ? someFunctionDecl.getParentDecl().flags : someFunctionDecl.flags, 8 /* Ambient */) && memberFunction.block && TypeScript.lastParameterIsRest(memberFunction.callSignature.parameterList); - } else if (nodeType === 137 /* ConstructorDeclaration */) { - var constructorDeclaration = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.getParentDecl().flags, 8 /* Ambient */) && constructorDeclaration.block && TypeScript.lastParameterIsRest(constructorDeclaration.callSignature.parameterList); - } else if (nodeType === 218 /* ParenthesizedArrowFunctionExpression */) { - var arrowFunctionExpression = enclosingAST; - return TypeScript.lastParameterIsRest(arrowFunctionExpression.callSignature.parameterList); - } else if (nodeType === 222 /* FunctionExpression */) { - var functionExpression = enclosingAST; - return TypeScript.lastParameterIsRest(functionExpression.callSignature.parameterList); - } - - return false; - }; - - PullTypeResolver.prototype.checkArgumentsCollides = function (ast, context) { - if (ast.kind() === 242 /* Parameter */) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - if (TypeScript.hasFlag(enclosingDecl.kind, 1032192 /* SomeFunction */)) { - if (this.hasRestParameterCodeGen(enclosingDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)); - } - } - } - }; - - PullTypeResolver.prototype.checkIndexOfRestArgumentInitializationCollides = function (ast, isDeclaration, context) { - if (!isDeclaration || ast.kind() === 242 /* Parameter */) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - var declPath = isDeclaration ? [enclosingDecl] : (enclosingDecl ? enclosingDecl.getParentPath() : []); - var resolvedSymbol = null; - var resolvedSymbolContainer; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - if (!isDeclaration) { - if (!resolvedSymbol) { - resolvedSymbol = this.resolveNameExpression(ast, context); - if (resolvedSymbol.isError()) { - return; - } - - resolvedSymbolContainer = resolvedSymbol.getContainer(); - } - - if (resolvedSymbolContainer && TypeScript.ArrayUtilities.contains(resolvedSymbolContainer.getDeclarations(), decl)) { - break; - } - } - - if (TypeScript.hasFlag(decl.kind, 1032192 /* SomeFunction */)) { - if (this.hasRestParameterCodeGen(decl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter : TypeScript.DiagnosticCode.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter)); - } - } - } - } - }; - - PullTypeResolver.prototype.checkExternalModuleRequireExportsCollides = function (ast, name, context) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(name); - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, name)) { - enclosingDecl = this.getEnclosingDeclForAST(enclosingModule); - } - - if (enclosingDecl && enclosingDecl.kind === 32 /* DynamicModule */) { - var decl = this.semanticInfoChain.getDeclForAST(ast); - - if (!TypeScript.hasFlag(decl.flags, 8 /* Ambient */)) { - var nameText = name.valueText(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, [nameText, nameText])); - } - } - }; - - PullTypeResolver.prototype.resolveObjectTypeTypeReference = function (objectType, context) { - var interfaceDecl = this.semanticInfoChain.getDeclForAST(objectType); - TypeScript.Debug.assert(interfaceDecl); - - var interfaceSymbol = interfaceDecl.getSymbol(); - TypeScript.Debug.assert(interfaceSymbol); - - if (objectType.typeMembers) { - var memberDecl = null; - var memberSymbol = null; - var memberType = null; - var typeMembers = objectType.typeMembers; - - for (var i = 0; i < typeMembers.nonSeparatorCount(); i++) { - memberDecl = this.semanticInfoChain.getDeclForAST(typeMembers.nonSeparatorAt(i)); - memberSymbol = (memberDecl.kind & 7340032 /* SomeSignature */) ? memberDecl.getSignatureSymbol() : memberDecl.getSymbol(); - - this.resolveAST(typeMembers.nonSeparatorAt(i), false, context); - - memberType = memberSymbol.type; - - if ((memberType && memberType.isGeneric()) || (memberSymbol.isSignature() && memberSymbol.isGeneric())) { - interfaceSymbol.setHasGenericMember(); - } - } - } - - interfaceSymbol.setResolved(); - - if (this.canTypeCheckAST(objectType, context)) { - this.typeCheckObjectTypeTypeReference(objectType, context); - } - - return interfaceSymbol; - }; - - PullTypeResolver.prototype.typeCheckObjectTypeTypeReference = function (objectType, context) { - this.setTypeChecked(objectType, context); - var objectTypeDecl = this.semanticInfoChain.getDeclForAST(objectType); - var objectTypeSymbol = objectTypeDecl.getSymbol(); - - this.typeCheckMembersAgainstIndexer(objectTypeSymbol, objectTypeDecl, context); - this.checkTypeForDuplicateIndexSignatures(objectTypeSymbol); - }; - - PullTypeResolver.prototype.resolveTypeAnnotation = function (typeAnnotation, context) { - return this.resolveTypeReference(typeAnnotation.type, context); - }; - - PullTypeResolver.prototype.resolveTypeReference = function (typeRef, context) { - if (typeRef === null) { - return null; - } - - TypeScript.Debug.assert(typeRef.kind() !== 244 /* TypeAnnotation */); - - var aliasType = null; - var type = this.computeTypeReferenceSymbol(typeRef, context); - - if (type.kind === 4 /* Container */) { - var container = type; - var instanceSymbol = container.getInstanceSymbol(); - - if (instanceSymbol && (instanceSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */) || instanceSymbol.kind === 32768 /* ConstructorMethod */)) { - type = instanceSymbol.type.getAssociatedContainerType(); - } - } - - if (type && type.isAlias()) { - aliasType = type; - type = aliasType.getExportAssignedTypeSymbol(); - } - - if (type && !type.isGeneric()) { - if (aliasType) { - this.semanticInfoChain.setAliasSymbolForAST(typeRef, aliasType); - } - } - - if (type && !type.isError()) { - if ((type.kind & 58728795 /* SomeType */) === 0) { - if (type.kind & 164 /* SomeContainer */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeRef, TypeScript.DiagnosticCode.Type_reference_cannot_refer_to_container_0, [aliasType ? aliasType.toString() : type.toString()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeRef, TypeScript.DiagnosticCode.Type_reference_must_refer_to_type)); - } - } - } - - if (this.canTypeCheckAST(typeRef, context)) { - this.setTypeChecked(typeRef, context); - } - - return type; - }; - - PullTypeResolver.prototype.getArrayType = function (elementType) { - var arraySymbol = elementType.getArrayType(); - - if (!arraySymbol) { - arraySymbol = this.createInstantiatedType(this.cachedArrayInterfaceType(), [elementType]); - - if (!arraySymbol) { - arraySymbol = this.semanticInfoChain.anyTypeSymbol; - } - - elementType.setArrayType(arraySymbol); - } - - return arraySymbol; - }; - - PullTypeResolver.prototype.computeTypeReferenceSymbol = function (term, context) { - switch (term.kind()) { - case 60 /* AnyKeyword */: - return this.semanticInfoChain.anyTypeSymbol; - case 61 /* BooleanKeyword */: - return this.semanticInfoChain.booleanTypeSymbol; - case 67 /* NumberKeyword */: - return this.semanticInfoChain.numberTypeSymbol; - case 69 /* StringKeyword */: - return this.semanticInfoChain.stringTypeSymbol; - case 41 /* VoidKeyword */: - return this.semanticInfoChain.voidTypeSymbol; - } - - var typeDeclSymbol = null; - - if (term.kind() === 11 /* IdentifierName */) { - typeDeclSymbol = this.resolveTypeNameExpression(term, context); - } else if (term.kind() === 123 /* FunctionType */) { - var functionType = term; - typeDeclSymbol = this.resolveAnyFunctionTypeSignature(functionType, functionType.typeParameterList, functionType.parameterList, functionType.type, context); - } else if (term.kind() === 125 /* ConstructorType */) { - var constructorType = term; - typeDeclSymbol = this.resolveAnyFunctionTypeSignature(constructorType, constructorType.typeParameterList, constructorType.parameterList, constructorType.type, context); - } else if (term.kind() === 122 /* ObjectType */) { - typeDeclSymbol = this.resolveObjectTypeTypeReference(term, context); - } else if (term.kind() === 126 /* GenericType */) { - typeDeclSymbol = this.resolveGenericTypeReference(term, context); - } else if (term.kind() === 121 /* QualifiedName */) { - typeDeclSymbol = this.resolveQualifiedName(term, context); - } else if (term.kind() === 14 /* StringLiteral */) { - var stringConstantAST = term; - var enclosingDecl = this.getEnclosingDeclForAST(term); - typeDeclSymbol = new TypeScript.PullStringConstantTypeSymbol(stringConstantAST.text()); - var decl = new TypeScript.PullSynthesizedDecl(stringConstantAST.text(), stringConstantAST.text(), typeDeclSymbol.kind, null, enclosingDecl, enclosingDecl.semanticInfoChain); - typeDeclSymbol.addDeclaration(decl); - } else if (term.kind() === 127 /* TypeQuery */) { - var typeQuery = term; - - var typeQueryTerm = typeQuery.name; - - var valueSymbol = this.resolveAST(typeQueryTerm, false, context); - - if (valueSymbol && valueSymbol.isAlias()) { - if (valueSymbol.assignedValue()) { - valueSymbol = valueSymbol.assignedValue(); - } else { - var containerSymbol = valueSymbol.getExportAssignedContainerSymbol(); - valueSymbol = (containerSymbol && containerSymbol.isContainer() && !containerSymbol.isEnum()) ? containerSymbol.getInstanceSymbol() : null; - } - } - - if (valueSymbol) { - typeDeclSymbol = valueSymbol.type.widenedType(this, typeQueryTerm, context); - } else { - typeDeclSymbol = this.getNewErrorTypeSymbol(); - } - } else if (term.kind() === 124 /* ArrayType */) { - var arrayType = term; - var underlying = this.resolveTypeReference(arrayType.type, context); - typeDeclSymbol = this.getArrayType(underlying); - } else { - throw TypeScript.Errors.invalidOperation("unknown type"); - } - - if (!typeDeclSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(term, TypeScript.DiagnosticCode.Unable_to_resolve_type)); - return this.getNewErrorTypeSymbol(); - } - - if (typeDeclSymbol.isError()) { - return typeDeclSymbol; - } - - if (this.genericTypeIsUsedWithoutRequiredTypeArguments(typeDeclSymbol, term, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(term, TypeScript.DiagnosticCode.Generic_type_references_must_include_all_type_arguments)); - typeDeclSymbol = this.instantiateTypeToAny(typeDeclSymbol, context); - } - - return typeDeclSymbol; - }; - - PullTypeResolver.prototype.genericTypeIsUsedWithoutRequiredTypeArguments = function (typeSymbol, term, context) { - if (!typeSymbol) { - return false; - } - - if (typeSymbol.isAlias()) { - return this.genericTypeIsUsedWithoutRequiredTypeArguments(typeSymbol.getExportAssignedTypeSymbol(), term, context); - } - - return typeSymbol.isNamedTypeSymbol() && typeSymbol.isGeneric() && !typeSymbol.isTypeParameter() && (typeSymbol.isResolved || typeSymbol.inResolution) && !typeSymbol.getIsSpecialized() && typeSymbol.getTypeParameters().length && typeSymbol.getTypeArguments() === null && this.isTypeRefWithoutTypeArgs(term); - }; - - PullTypeResolver.prototype.resolveMemberVariableDeclaration = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, varDecl.modifiers, varDecl.variableDeclarator.propertyName, TypeScript.ASTHelpers.getType(varDecl.variableDeclarator), varDecl.variableDeclarator.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolvePropertySignature = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.sentinelEmptyArray, varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), null, context); - }; - - PullTypeResolver.prototype.resolveVariableDeclarator = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolveParameterList = function (list, context) { - return this.resolveSeparatedList(list.parameters, context); - }; - - PullTypeResolver.prototype.resolveParameter = function (parameter, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(parameter, parameter.modifiers, parameter.identifier, TypeScript.ASTHelpers.getType(parameter), parameter.equalsValueClause, context); - }; - - PullTypeResolver.prototype.getEnumTypeSymbol = function (enumElement, context) { - var enumDeclaration = enumElement.parent.parent; - var decl = this.semanticInfoChain.getDeclForAST(enumDeclaration); - var symbol = decl.getSymbol(); - this.resolveDeclaredSymbol(symbol, context); - - return symbol; - }; - - PullTypeResolver.prototype.resolveEnumElement = function (enumElement, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(enumElement, TypeScript.sentinelEmptyArray, enumElement.propertyName, null, enumElement.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckEnumElement = function (enumElement, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(enumElement, TypeScript.sentinelEmptyArray, enumElement.propertyName, null, enumElement.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolveEqualsValueClause = function (clause, isContextuallyTyped, context) { - if (this.canTypeCheckAST(clause, context)) { - this.setTypeChecked(clause, context); - } - - return this.resolveAST(clause.value, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveVariableDeclaratorOrParameterOrEnumElement = function (varDeclOrParameter, modifiers, name, typeExpr, init, context) { - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - - if (enclosingDecl && decl.kind === 2048 /* Parameter */) { - enclosingDecl.ensureSymbolIsBound(); - } - - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - if (declSymbol.isResolved) { - var declType = declSymbol.type; - var valDecl = decl.getValueDecl(); - - if (valDecl) { - var valSymbol = valDecl.getSymbol(); - - if (valSymbol && !valSymbol.isResolved) { - valSymbol.type = declType; - valSymbol.setResolved(); - } - } - } else { - if (declSymbol.inResolution) { - declSymbol.type = this.semanticInfoChain.anyTypeSymbol; - declSymbol.setResolved(); - return declSymbol; - } - - if (!declSymbol.type || !declSymbol.type.isError()) { - declSymbol.startResolving(); - - var typeExprSymbol = this.resolveAndTypeCheckVariableDeclarationTypeExpr(varDeclOrParameter, name, typeExpr, context); - - if (!hasTypeExpr) { - this.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr(varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol); - } - - if (!(hasTypeExpr || init)) { - var defaultType = this.semanticInfoChain.anyTypeSymbol; - - if (declSymbol.isVarArg && this.cachedArrayInterfaceType()) { - defaultType = this.createInstantiatedType(this.cachedArrayInterfaceType(), [defaultType]); - } - - context.setTypeInContext(declSymbol, defaultType); - - if (declParameterSymbol) { - declParameterSymbol.type = defaultType; - } - } - declSymbol.setResolved(); - - if (declParameterSymbol) { - declParameterSymbol.setResolved(); - } - } - } - - if (this.canTypeCheckAST(varDeclOrParameter, context)) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDeclOrParameter, modifiers, name, typeExpr, init, context); - } - - return declSymbol; - }; - - PullTypeResolver.prototype.resolveAndTypeCheckVariableDeclarationTypeExpr = function (varDeclOrParameter, name, typeExpr, context) { - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - if (varDeclOrParameter.kind() === 243 /* EnumElement */) { - var result = this.getEnumTypeSymbol(varDeclOrParameter, context); - declSymbol.type = result; - return result; - } - - if (!typeExpr) { - return null; - } - - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - var typeExprSymbol = this.resolveTypeReference(typeExpr, context); - - if (!typeExprSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [name.text()])); - declSymbol.type = this.getNewErrorTypeSymbol(); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } else if (typeExprSymbol.isError()) { - context.setTypeInContext(declSymbol, typeExprSymbol); - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, typeExprSymbol); - } - } else { - if (typeExprSymbol === this.semanticInfoChain.anyTypeSymbol) { - decl.setFlag(16777216 /* IsAnnotatedWithAny */); - } - - if (typeExprSymbol.isContainer()) { - var exportedTypeSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - - if (exportedTypeSymbol) { - typeExprSymbol = exportedTypeSymbol; - } else { - typeExprSymbol = typeExprSymbol.type; - - if (typeExprSymbol.isAlias()) { - typeExprSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - } - - if (typeExprSymbol && typeExprSymbol.isContainer() && !typeExprSymbol.isEnum()) { - var instanceSymbol = typeExprSymbol.getInstanceSymbol(); - - if (!instanceSymbol || !TypeScript.PullHelpers.symbolIsEnum(instanceSymbol)) { - typeExprSymbol = this.getNewErrorTypeSymbol(); - } else { - typeExprSymbol = instanceSymbol.type; - } - } - } - } else if (declSymbol.isVarArg && !(typeExprSymbol.isArrayNamedTypeReference() || typeExprSymbol === this.cachedArrayInterfaceType())) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeExprSymbol = this.getNewErrorTypeSymbol(); - } - - context.setTypeInContext(declSymbol, typeExprSymbol); - - if (declParameterSymbol) { - declParameterSymbol.type = typeExprSymbol; - } - - if (typeExprSymbol.kind === 16777216 /* FunctionType */ && !typeExprSymbol.getFunctionSymbol()) { - typeExprSymbol.setFunctionSymbol(declSymbol); - } - } - - return typeExprSymbol; - }; - - PullTypeResolver.prototype.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr = function (varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol) { - if (!init) { - return null; - } - - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - if (typeExprSymbol) { - context.pushNewContextualType(typeExprSymbol); - } - - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - var initExprSymbol = this.resolveAST(init, typeExprSymbol !== null, context); - - if (typeExprSymbol) { - context.popAnyContextualType(); - } - - if (!initExprSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [name.text()])); - - if (!hasTypeExpr) { - context.setTypeInContext(declSymbol, this.getNewErrorTypeSymbol()); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } - } else { - var initTypeSymbol = initExprSymbol.type; - - if (!hasTypeExpr) { - var widenedInitTypeSymbol = initTypeSymbol.widenedType(this, init.value, context); - context.setTypeInContext(declSymbol, widenedInitTypeSymbol); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, widenedInitTypeSymbol); - } - - if (this.compilationSettings.noImplicitAny()) { - if ((widenedInitTypeSymbol !== initTypeSymbol) && (widenedInitTypeSymbol === this.semanticInfoChain.anyTypeSymbol)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } - } - - return widenedInitTypeSymbol; - } - } - - return initTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckPropertySignature = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.sentinelEmptyArray, varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMemberVariableDeclaration = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, varDecl.modifiers, varDecl.variableDeclarator.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.variableDeclarator.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckVariableDeclarator = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckParameter = function (parameter, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(parameter, parameter.modifiers, parameter.identifier, TypeScript.ASTHelpers.getType(parameter), parameter.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckVariableDeclaratorOrParameterOrEnumElement = function (varDeclOrParameter, modifiers, name, typeExpr, init, context) { - var _this = this; - this.setTypeChecked(varDeclOrParameter, context); - - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - - var typeExprSymbol = this.resolveAndTypeCheckVariableDeclarationTypeExpr(varDeclOrParameter, name, typeExpr, context); - - var initTypeSymbol = this.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr(varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol); - - if (hasTypeExpr || init) { - if (typeExprSymbol && typeExprSymbol.isAlias()) { - typeExprSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - } - - if (typeExprSymbol && typeExprSymbol.kind === 32 /* DynamicModule */) { - var exportedTypeSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - - if (exportedTypeSymbol) { - typeExprSymbol = exportedTypeSymbol; - } else { - var instanceTypeSymbol = typeExprSymbol.getInstanceType(); - - if (!instanceTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Tried_to_set_variable_type_to_uninitialized_module_type_0, [typeExprSymbol.toString()])); - typeExprSymbol = null; - } else { - typeExprSymbol = instanceTypeSymbol; - } - } - } - - initTypeSymbol = this.getInstanceTypeForAssignment(varDeclOrParameter, initTypeSymbol, context); - - if (initTypeSymbol && typeExprSymbol) { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(initTypeSymbol, typeExprSymbol, varDeclOrParameter, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(varDeclOrParameter); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [initTypeSymbol.toString(enclosingSymbol), typeExprSymbol.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [initTypeSymbol.toString(enclosingSymbol), typeExprSymbol.toString(enclosingSymbol)])); - } - } - } - } else if (varDeclOrParameter.kind() !== 243 /* EnumElement */ && this.compilationSettings.noImplicitAny() && !this.isForInVariableDeclarator(varDeclOrParameter)) { - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - if ((wrapperDecl.kind === 16384 /* Function */ || wrapperDecl.kind === 32768 /* ConstructorMethod */ || wrapperDecl.kind === 2097152 /* ConstructSignature */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } else if (wrapperDecl.kind === 65536 /* Method */) { - var parentDecl = wrapperDecl.getParentDecl(); - - if (!TypeScript.hasFlag(parentDecl.flags, 8 /* Ambient */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } else if (TypeScript.hasFlag(parentDecl.flags, 8 /* Ambient */) && !TypeScript.hasFlag(wrapperDecl.flags, 2 /* Private */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } - } else if (decl.kind === 4096 /* Property */ && !declSymbol.getContainer().isNamedTypeSymbol()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Member_0_of_object_type_implicitly_has_an_any_type, [name.text()])); - } else if (wrapperDecl.kind !== 268435456 /* CatchBlock */) { - if (!TypeScript.hasFlag(wrapperDecl.flags, 8 /* Ambient */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } else if (TypeScript.hasFlag(wrapperDecl.flags, 8 /* Ambient */) && !TypeScript.hasModifier(modifiers, 2 /* Private */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } - } - } - - if (init && varDeclOrParameter.kind() === 242 /* Parameter */) { - var containerSignature = enclosingDecl.getSignatureSymbol(); - if (containerSignature && !containerSignature.isDefinition()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Default_arguments_are_only_allowed_in_implementation)); - } - } - if (declSymbol.kind !== 2048 /* Parameter */ && (declSymbol.kind !== 4096 /* Property */ || declSymbol.getContainer().isNamedTypeSymbol())) { - this.checkSymbolPrivacy(declSymbol, declSymbol.type, function (symbol) { - return _this.variablePrivacyErrorReporter(varDeclOrParameter, declSymbol, symbol, context); - }); - } - - if ((declSymbol.kind !== 4096 /* Property */ && declSymbol.kind !== 67108864 /* EnumMember */) || declSymbol.anyDeclHasFlag(8388608 /* PropertyParameter */)) { - this.checkNameForCompilerGeneratedDeclarationCollision(varDeclOrParameter, true, name, context); - } - }; - - PullTypeResolver.prototype.isForInVariableDeclarator = function (ast) { - return ast.kind() === 225 /* VariableDeclarator */ && ast.parent && ast.parent.parent && ast.parent.parent.parent && ast.parent.kind() === 2 /* SeparatedList */ && ast.parent.parent.kind() === 224 /* VariableDeclaration */ && ast.parent.parent.parent.kind() === 155 /* ForInStatement */ && ast.parent.parent.parent.variableDeclaration === ast.parent.parent; - }; - - PullTypeResolver.prototype.checkSuperCaptureVariableCollides = function (superAST, isDeclaration, context) { - var enclosingDecl = this.getEnclosingDeclForAST(superAST); - - var classSymbol = this.getContextualClassSymbolForEnclosingDecl(superAST, enclosingDecl); - - if (classSymbol && !classSymbol.anyDeclHasFlag(8 /* Ambient */)) { - if (superAST.kind() === 242 /* Parameter */) { - var enclosingAST = this.getASTForDecl(enclosingDecl); - if (enclosingAST.kind() !== 218 /* ParenthesizedArrowFunctionExpression */ && enclosingAST.kind() !== 219 /* SimpleArrowFunctionExpression */) { - var block = enclosingDecl.kind === 65536 /* Method */ ? enclosingAST.block : enclosingAST.block; - if (!block) { - return; - } - } - } - - this.resolveDeclaredSymbol(classSymbol, context); - - var parents = classSymbol.getExtendedTypes(); - if (parents.length) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(superAST, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference : TypeScript.DiagnosticCode.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference)); - } - } - }; - - PullTypeResolver.prototype.checkThisCaptureVariableCollides = function (_thisAST, isDeclaration, context) { - if (isDeclaration) { - var decl = this.semanticInfoChain.getDeclForAST(_thisAST); - if (TypeScript.hasFlag(decl.flags, 8 /* Ambient */)) { - return; - } - } - - var enclosingDecl = this.getEnclosingDeclForAST(_thisAST); - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(_thisAST); - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, _thisAST)) { - enclosingDecl = this.getEnclosingDeclForAST(enclosingModule); - } - - var declPath = enclosingDecl.getParentPath(); - - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - if (declKind === 131072 /* FunctionExpression */ && TypeScript.hasFlag(decl.flags, 8192 /* ArrowFunction */)) { - continue; - } - - if (declKind === 16384 /* Function */ || declKind === 65536 /* Method */ || declKind === 32768 /* ConstructorMethod */ || declKind === 262144 /* GetAccessor */ || declKind === 524288 /* SetAccessor */ || declKind === 131072 /* FunctionExpression */ || declKind === 8 /* Class */ || declKind === 4 /* Container */ || declKind === 32 /* DynamicModule */ || declKind === 1 /* Script */) { - if (TypeScript.hasFlag(decl.flags, 262144 /* MustCaptureThis */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(_thisAST, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference : TypeScript.DiagnosticCode.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference)); - } - break; - } - } - }; - - PullTypeResolver.prototype.postTypeCheckVariableDeclaratorOrParameter = function (varDeclOrParameter, context) { - this.checkThisCaptureVariableCollides(varDeclOrParameter, true, context); - }; - - PullTypeResolver.prototype.resolveTypeParameterDeclaration = function (typeParameterAST, context) { - var typeParameterDecl = this.semanticInfoChain.getDeclForAST(typeParameterAST); - var typeParameterSymbol = typeParameterDecl.getSymbol(); - - this.resolveFirstTypeParameterDeclaration(typeParameterSymbol, context); - - if (typeParameterSymbol.isResolved && this.canTypeCheckAST(typeParameterAST, context)) { - this.typeCheckTypeParameterDeclaration(typeParameterAST, context); - } - - return typeParameterSymbol; - }; - - PullTypeResolver.prototype.resolveFirstTypeParameterDeclaration = function (typeParameterSymbol, context) { - var typeParameterDecl = typeParameterSymbol.getDeclarations()[0]; - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterDecl); - - if (typeParameterSymbol.isResolved || typeParameterSymbol.inResolution) { - return; - } - - typeParameterSymbol.startResolving(); - - if (typeParameterAST.constraint) { - var constraintTypeSymbol = this.resolveTypeReference(typeParameterAST.constraint.type, context); - - if (constraintTypeSymbol) { - typeParameterSymbol.setConstraint(constraintTypeSymbol); - } - } - - typeParameterSymbol.setResolved(); - }; - - PullTypeResolver.prototype.typeCheckTypeParameterDeclaration = function (typeParameterAST, context) { - this.setTypeChecked(typeParameterAST, context); - - var constraint = this.resolveAST(typeParameterAST.constraint, false, context); - - if (constraint) { - var typeParametersAST = typeParameterAST.parent; - var typeParameters = []; - for (var i = 0; i < typeParametersAST.nonSeparatorCount(); i++) { - var currentTypeParameterAST = typeParametersAST.nonSeparatorAt(i); - var currentTypeParameterDecl = this.semanticInfoChain.getDeclForAST(currentTypeParameterAST); - var currentTypeParameter = this.semanticInfoChain.getSymbolForDecl(currentTypeParameterDecl); - typeParameters[currentTypeParameter.pullSymbolID] = currentTypeParameter; - } - - if (constraint.wrapsSomeTypeParameter(typeParameters)) { - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - }; - - PullTypeResolver.prototype.resolveConstraint = function (constraint, context) { - if (this.canTypeCheckAST(constraint, context)) { - this.setTypeChecked(constraint, context); - } - - return this.resolveTypeReference(constraint.type, context); - }; - - PullTypeResolver.prototype.resolveFunctionBodyReturnTypes = function (funcDeclAST, block, bodyExpression, signature, useContextualType, enclosingDecl, context) { - var _this = this; - var returnStatementsExpressions = []; - - var enclosingDeclStack = [enclosingDecl]; - - var preFindReturnExpressionTypes = function (ast, walker) { - var go = true; - - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 215 /* ObjectLiteralExpression */: - go = false; - break; - - case 150 /* ReturnStatement */: - var returnStatement = ast; - enclosingDecl.setFlag(4194304 /* HasReturnStatement */); - returnStatementsExpressions.push({ expression: returnStatement.expression, enclosingDecl: enclosingDeclStack[enclosingDeclStack.length - 1] }); - go = false; - break; - - case 236 /* CatchClause */: - case 163 /* WithStatement */: - enclosingDeclStack[enclosingDeclStack.length] = _this.semanticInfoChain.getDeclForAST(ast); - break; - - default: - break; - } - - walker.options.goChildren = go; - - return ast; - }; - - var postFindReturnExpressionEnclosingDecls = function (ast, walker) { - switch (ast.kind()) { - case 236 /* CatchClause */: - case 163 /* WithStatement */: - enclosingDeclStack.length--; - break; - default: - break; - } - - walker.options.goChildren = true; - - return ast; - }; - - if (block) { - TypeScript.getAstWalkerFactory().walk(block, preFindReturnExpressionTypes, postFindReturnExpressionEnclosingDecls); - } else { - returnStatementsExpressions.push({ expression: bodyExpression, enclosingDecl: enclosingDecl }); - enclosingDecl.setFlag(4194304 /* HasReturnStatement */); - } - - if (!returnStatementsExpressions.length) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - } else { - var returnExpressionSymbols = []; - var returnExpressions = []; - - for (var i = 0; i < returnStatementsExpressions.length; i++) { - var returnExpression = returnStatementsExpressions[i].expression; - if (returnExpression) { - var returnType = this.resolveAST(returnExpression, useContextualType, context).type; - - if (returnType.isError()) { - signature.returnType = returnType; - return; - } else { - if (returnExpression.parent.kind() === 150 /* ReturnStatement */) { - this.setSymbolForAST(returnExpression.parent, returnType, context); - } - } - - returnExpressionSymbols.push(returnType); - returnExpressions.push(returnExpression); - } - } - - if (!returnExpressionSymbols.length) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - } else { - var collection = { - getLength: function () { - return returnExpressionSymbols.length; - }, - getTypeAtIndex: function (index) { - return returnExpressionSymbols[index].type; - } - }; - - var bestCommonReturnType = this.findBestCommonType(collection, context, new TypeComparisonInfo()); - var returnType = bestCommonReturnType; - var returnExpression = returnExpressions[returnExpressionSymbols.indexOf(returnType)]; - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var functionSymbol = functionDecl.getSymbol(); - - if (returnType) { - var previousReturnType = returnType; - var newReturnType = returnType.widenedType(this, returnExpression, context); - signature.returnType = newReturnType; - - if (!TypeScript.ArrayUtilities.contains(returnExpressionSymbols, bestCommonReturnType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Could_not_find_the_best_common_type_of_types_of_all_return_statement_expressions)); - } - - if (this.compilationSettings.noImplicitAny()) { - if (previousReturnType !== newReturnType && newReturnType === this.semanticInfoChain.anyTypeSymbol) { - var functionName = enclosingDecl.name; - if (functionName === "") { - functionName = enclosingDecl.getFunctionExpressionName(); - } - - if (functionName != "") { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [functionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } - } - - if (!functionSymbol.type && functionSymbol.isAccessor()) { - functionSymbol.type = signature.returnType; - } - } - } - }; - - PullTypeResolver.prototype.typeCheckConstructorDeclaration = function (funcDeclAST, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - for (var i = 0; i < funcDeclAST.callSignature.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveAST(funcDeclAST.callSignature.parameterList.parameters.nonSeparatorAt(i), false, context); - } - - this.resolveAST(funcDeclAST.block, false, context); - - if (funcDecl.getSignatureSymbol() && funcDecl.getSignatureSymbol().isDefinition() && this.enclosingClassIsDerived(funcDecl.getParentDecl())) { - if (!this.constructorHasSuperCall(funcDeclAST)) { - context.postDiagnostic(new TypeScript.Diagnostic(funcDeclAST.fileName(), this.semanticInfoChain.lineMap(funcDeclAST.fileName()), funcDeclAST.start(), "constructor".length, TypeScript.DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call)); - } else if (this.superCallMustBeFirstStatementInConstructor(funcDecl)) { - var firstStatement = this.getFirstStatementOfBlockOrNull(funcDeclAST.block); - if (!firstStatement || !this.isSuperInvocationExpressionStatement(firstStatement)) { - context.postDiagnostic(new TypeScript.Diagnostic(funcDeclAST.fileName(), this.semanticInfoChain.lineMap(funcDeclAST.fileName()), funcDeclAST.start(), "constructor".length, TypeScript.DiagnosticCode.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties)); - } - } - } - - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, false, null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.callSignature.parameterList), null, funcDeclAST.block, context); - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.constructorHasSuperCall = function (constructorDecl) { - var _this = this; - if (constructorDecl.block) { - var foundSuperCall = false; - var pre = function (ast, walker) { - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 215 /* ObjectLiteralExpression */: - walker.options.goChildren = false; - default: - if (_this.isSuperInvocationExpression(ast)) { - foundSuperCall = true; - walker.options.stopWalking = true; - } - } - }; - - TypeScript.getAstWalkerFactory().walk(constructorDecl.block, pre); - return foundSuperCall; - } - - return false; - }; - - PullTypeResolver.prototype.typeCheckFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - this.typeCheckAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), funcDecl.callSignature.typeAnnotation, funcDecl.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckCallSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, null, funcDecl.typeParameterList, funcDecl.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckConstructSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, null, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMethodSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMemberFunctionDeclaration = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.containsSingleThrowStatement = function (block) { - return block !== null && block.statements.childCount() === 1 && block.statements.childAt(0).kind() === 157 /* ThrowStatement */; - }; - - PullTypeResolver.prototype.typeCheckAnyFunctionDeclaration = function (funcDeclAST, isStatic, name, typeParameters, parameters, returnTypeAnnotation, block, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - this.resolveAST(parameters, false, context); - - this.resolveAST(block, false, context); - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, isStatic, typeParameters, TypeScript.ASTHelpers.parametersFromParameterList(parameters), returnTypeAnnotation, block, context); - - this.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement(funcDecl, returnTypeAnnotation, funcDecl.getSignatureSymbol().returnType, block, context); - - if (funcDecl.kind === 16384 /* Function */) { - this.checkNameForCompilerGeneratedDeclarationCollision(funcDeclAST, true, name, context); - } - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement = function (functionDecl, returnTypeAnnotation, returnTypeSymbol, block, context) { - var hasReturn = TypeScript.hasFlag(functionDecl.flags, 4194304 /* HasReturnStatement */); - - if (block !== null && returnTypeAnnotation !== null && !hasReturn) { - var isVoidOrAny = this.isAnyOrEquivalent(returnTypeSymbol) || returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol; - - if (!isVoidOrAny && !this.containsSingleThrowStatement(block)) { - var funcName = functionDecl.getDisplayName() || TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Function_declared_a_non_void_return_type_but_has_no_return_expression)); - } - } - }; - - PullTypeResolver.prototype.typeCheckIndexSignature = function (funcDeclAST, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - this.resolveAST(funcDeclAST.parameter, false, context); - - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, false, null, TypeScript.ASTHelpers.parametersFromParameter(funcDeclAST.parameter), TypeScript.ASTHelpers.getType(funcDeclAST), null, context); - - var signature = funcDecl.getSignatureSymbol(); - - this.typeCheckCallBacks.push(function (context) { - var parentSymbol = funcDecl.getSignatureSymbol().getContainer(); - var allIndexSignatures = _this.getBothKindsOfIndexSignaturesExcludingAugmentedType(parentSymbol, context); - var stringIndexSignature = allIndexSignatures.stringSignature; - var numberIndexSignature = allIndexSignatures.numericSignature; - var isNumericIndexer = numberIndexSignature === signature; - - if (numberIndexSignature && stringIndexSignature && (isNumericIndexer || stringIndexSignature.getDeclarations()[0].getParentDecl() !== numberIndexSignature.getDeclarations()[0].getParentDecl())) { - var comparisonInfo = new TypeComparisonInfo(); - - if (!_this.sourceIsAssignableToTarget(numberIndexSignature.returnType, stringIndexSignature.returnType, funcDeclAST, context, comparisonInfo)) { - var enclosingSymbol = _this.getEnclosingSymbolForAST(funcDeclAST); - if (comparisonInfo.message) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2, [numberIndexSignature.returnType.toString(enclosingSymbol), stringIndexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1, [numberIndexSignature.returnType.toString(enclosingSymbol), stringIndexSignature.returnType.toString(enclosingSymbol)])); - } - } - } - - var allMembers = parentSymbol.type.getAllMembers(536869887 /* All */, 0 /* all */); - for (var i = 0; i < allMembers.length; i++) { - var member = allMembers[i]; - var name = member.name; - if (name || (member.kind === 4096 /* Property */ && name === "")) { - if (!allMembers[i].isResolved) { - _this.resolveDeclaredSymbol(allMembers[i], context); - } - - if (parentSymbol !== allMembers[i].getContainer()) { - var isMemberNumeric = TypeScript.PullHelpers.isNameNumeric(name); - var indexerKindMatchesMemberNameKind = isNumericIndexer === isMemberNumeric; - var onlyStringIndexerIsPresent = !numberIndexSignature; - - if (indexerKindMatchesMemberNameKind || onlyStringIndexerIsPresent) { - var comparisonInfo = new TypeComparisonInfo(); - if (!_this.sourceIsAssignableToTarget(allMembers[i].type, signature.returnType, funcDeclAST, context, comparisonInfo, false)) { - _this.reportErrorThatMemberIsNotSubtypeOfIndexer(allMembers[i], signature, funcDeclAST, context, comparisonInfo); - } - } - } - } - } - }); - }; - - PullTypeResolver.prototype.postTypeCheckFunctionDeclaration = function (funcDeclAST, context) { - this.checkThisCaptureVariableCollides(funcDeclAST, true, context); - }; - - PullTypeResolver.prototype.resolveReturnTypeAnnotationOfFunctionDeclaration = function (funcDeclAST, returnTypeAnnotation, context) { - var returnTypeSymbol = null; - - if (returnTypeAnnotation) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - returnTypeSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - } else { - var isConstructor = funcDeclAST.kind() === 137 /* ConstructorDeclaration */ || funcDeclAST.kind() === 143 /* ConstructSignature */; - if (isConstructor && returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructors_cannot_have_a_return_type_of_void)); - } - } - } - - return returnTypeSymbol; - }; - - PullTypeResolver.prototype.resolveMemberFunctionDeclaration = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.resolveCallSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, null, funcDecl.typeParameterList, funcDecl.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveConstructSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, null, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveMethodSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveAnyFunctionDeclaration = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.identifier, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.resolveFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveSimpleArrowFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, null, TypeScript.ASTHelpers.parametersFromIdentifier(funcDecl.identifier), null, funcDecl.block, funcDecl.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveParenthesizedArrowFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, funcDecl.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.getEnclosingClassDeclaration = function (ast) { - while (ast) { - if (ast.kind() === 131 /* ClassDeclaration */) { - return ast; - } - - ast = ast.parent; - } - - return null; - }; - - PullTypeResolver.prototype.resolveConstructorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckConstructorDeclaration(funcDeclAST, context); - } - return funcSymbol; - } - - if (!signature.inResolution) { - var classAST = this.getEnclosingClassDeclaration(funcDeclAST); - - if (classAST) { - var classDecl = this.semanticInfoChain.getDeclForAST(classAST); - var classSymbol = classDecl.getSymbol(); - - if (!classSymbol.isResolved && !classSymbol.inResolution) { - this.resolveDeclaredSymbol(classSymbol, context); - } - } - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - - for (var i = 0; i < funcDeclAST.callSignature.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(funcDeclAST.callSignature.parameterList.parameters.nonSeparatorAt(i), context); - } - - context.inTypeCheck = prevInTypeCheck; - - if (signature.isGeneric()) { - if (funcSymbol) { - funcSymbol.type.setHasGenericSignature(); - } - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckConstructorDeclaration(funcDeclAST, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveIndexMemberDeclaration = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - } - - return this.resolveIndexSignature(ast.indexSignature, context); - }; - - PullTypeResolver.prototype.resolveIndexSignature = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckIndexSignature(funcDeclAST, context); - } - return funcSymbol; - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - if (funcDeclAST.typeAnnotation) { - var returnTypeSymbol = this.resolveTypeReference(TypeScript.ASTHelpers.getType(funcDeclAST), context); - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(TypeScript.ASTHelpers.getType(funcDeclAST), TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - if (funcDeclAST.parameter) { - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - this.resolveParameter(funcDeclAST.parameter, context); - context.inTypeCheck = prevInTypeCheck; - } - - if (funcDeclAST.typeAnnotation) { - returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckIndexSignature(funcDeclAST, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveFunctionDeclaration = function (funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - var isConstructor = funcDeclAST.kind() === 143 /* ConstructSignature */; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context); - } - return funcSymbol; - } - - if (isConstructor && !signature.inResolution) { - var classAST = this.getEnclosingClassDeclaration(funcDeclAST); - - if (classAST) { - var classDecl = this.semanticInfoChain.getDeclForAST(classAST); - var classSymbol = classDecl.getSymbol(); - - if (!classSymbol.isResolved && !classSymbol.inResolution) { - this.resolveDeclaredSymbol(classSymbol, context); - } - } - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - if (returnTypeAnnotation) { - var returnTypeSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - - if (isConstructor && returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructors_cannot_have_a_return_type_of_void)); - } - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - if (parameterList) { - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(parameterList.parameters.nonSeparatorAt(i), context); - } - - context.inTypeCheck = prevInTypeCheck; - } - - if (returnTypeAnnotation) { - returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else if (funcDecl.kind !== 2097152 /* ConstructSignature */) { - if (TypeScript.hasFlag(funcDecl.flags, 2048 /* Signature */)) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - var parentDeclFlags = 0 /* None */; - if (TypeScript.hasFlag(funcDecl.kind, 65536 /* Method */) || TypeScript.hasFlag(funcDecl.kind, 32768 /* ConstructorMethod */)) { - var parentDecl = funcDecl.getParentDecl(); - parentDeclFlags = parentDecl.flags; - } - - if (this.compilationSettings.noImplicitAny() && (!TypeScript.hasFlag(parentDeclFlags, 8 /* Ambient */) || (TypeScript.hasFlag(parentDeclFlags, 8 /* Ambient */) && !TypeScript.hasFlag(funcDecl.flags, 2 /* Private */)))) { - var funcDeclASTName = name; - if (funcDeclASTName) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [funcDeclASTName.text()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } else { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, null, signature, false, funcDecl, context); - } - } else if (funcDecl.kind === 2097152 /* ConstructSignature */) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveGetterReturnTypeAnnotation = function (getterFunctionDeclarationAst, enclosingDecl, context) { - if (getterFunctionDeclarationAst && getterFunctionDeclarationAst.typeAnnotation) { - return this.resolveTypeReference(TypeScript.ASTHelpers.getType(getterFunctionDeclarationAst), context); - } - - return null; - }; - - PullTypeResolver.prototype.resolveSetterArgumentTypeAnnotation = function (setterFunctionDeclarationAst, enclosingDecl, context) { - if (setterFunctionDeclarationAst && setterFunctionDeclarationAst.parameterList && setterFunctionDeclarationAst.parameterList.parameters.nonSeparatorCount() > 0) { - var parameter = setterFunctionDeclarationAst.parameterList.parameters.nonSeparatorAt(0); - return this.resolveTypeReference(TypeScript.ASTHelpers.getType(parameter), context); - } - - return null; - }; - - PullTypeResolver.prototype.resolveAccessorDeclaration = function (funcDeclAst, context) { - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDeclAst); - var accessorSymbol = functionDeclaration.getSymbol(); - - if (accessorSymbol.inResolution) { - accessorSymbol.type = this.semanticInfoChain.anyTypeSymbol; - accessorSymbol.setResolved(); - - return accessorSymbol; - } - - if (accessorSymbol.isResolved) { - if (!accessorSymbol.type) { - accessorSymbol.type = this.semanticInfoChain.anyTypeSymbol; - } - } else { - var getterSymbol = accessorSymbol.getGetter(); - var getterFunctionDeclarationAst = getterSymbol ? getterSymbol.getDeclarations()[0].ast() : null; - var hasGetter = getterSymbol !== null; - - var setterSymbol = accessorSymbol.getSetter(); - var setterFunctionDeclarationAst = setterSymbol ? setterSymbol.getDeclarations()[0].ast() : null; - var hasSetter = setterSymbol !== null; - - var getterAnnotatedType = this.resolveGetterReturnTypeAnnotation(getterFunctionDeclarationAst, functionDeclaration, context); - var getterHasTypeAnnotation = getterAnnotatedType !== null; - - var setterAnnotatedType = this.resolveSetterArgumentTypeAnnotation(setterFunctionDeclarationAst, functionDeclaration, context); - var setterHasTypeAnnotation = setterAnnotatedType !== null; - - accessorSymbol.startResolving(); - - if (hasGetter) { - getterSymbol = this.resolveGetAccessorDeclaration(getterFunctionDeclarationAst, getterFunctionDeclarationAst.parameterList, TypeScript.ASTHelpers.getType(getterFunctionDeclarationAst), getterFunctionDeclarationAst.block, setterAnnotatedType, context); - } - - if (hasSetter) { - setterSymbol = this.resolveSetAccessorDeclaration(setterFunctionDeclarationAst, setterFunctionDeclarationAst.parameterList, context); - } - - if (hasGetter && hasSetter) { - var setterSig = setterSymbol.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - var setterHasParameters = setterParameters.length > 0; - var getterSig = getterSymbol.type.getCallSignatures()[0]; - - var setterSuppliedTypeSymbol = setterHasParameters ? setterParameters[0].type : null; - var getterSuppliedTypeSymbol = getterSig.returnType; - - if (setterHasTypeAnnotation && !getterHasTypeAnnotation) { - getterSuppliedTypeSymbol = setterSuppliedTypeSymbol; - getterSig.returnType = setterSuppliedTypeSymbol; - } else if ((getterHasTypeAnnotation && !setterHasTypeAnnotation) || (!getterHasTypeAnnotation && !setterHasTypeAnnotation)) { - setterSuppliedTypeSymbol = getterSuppliedTypeSymbol; - - if (setterHasParameters) { - setterParameters[0].type = getterSuppliedTypeSymbol; - } - } - - if (!this.typesAreIdentical(setterSuppliedTypeSymbol, getterSuppliedTypeSymbol, context)) { - accessorSymbol.type = this.getNewErrorTypeSymbol(); - } else { - accessorSymbol.type = getterSuppliedTypeSymbol; - } - } else if (hasSetter) { - var setterSig = setterSymbol.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - var setterHasParameters = setterParameters.length > 0; - - accessorSymbol.type = setterHasParameters ? setterParameters[0].type : this.semanticInfoChain.anyTypeSymbol; - } else { - var getterSig = getterSymbol.type.getCallSignatures()[0]; - accessorSymbol.type = getterSig.returnType; - } - - accessorSymbol.setResolved(); - } - - if (this.canTypeCheckAST(funcDeclAst, context)) { - this.typeCheckAccessorDeclaration(funcDeclAst, context); - } - - return accessorSymbol; - }; - - PullTypeResolver.prototype.typeCheckAccessorDeclaration = function (funcDeclAst, context) { - this.setTypeChecked(funcDeclAst, context); - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDeclAst); - var accessorSymbol = functionDeclaration.getSymbol(); - var getterSymbol = accessorSymbol.getGetter(); - var setterSymbol = accessorSymbol.getSetter(); - - var isGetter = funcDeclAst.kind() === 139 /* GetAccessor */; - if (isGetter) { - var getterFunctionDeclarationAst = funcDeclAst; - context.pushNewContextualType(getterSymbol.type); - this.typeCheckGetAccessorDeclaration(getterFunctionDeclarationAst, context); - context.popAnyContextualType(); - } else { - var setterFunctionDeclarationAst = funcDeclAst; - this.typeCheckSetAccessorDeclaration(setterFunctionDeclarationAst, context); - } - }; - - PullTypeResolver.prototype.resolveGetAccessorDeclaration = function (funcDeclAST, parameters, returnTypeAnnotation, block, setterAnnotatedType, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - var getterSymbol = accessorSymbol.getGetter(); - var getterTypeSymbol = getterSymbol.type; - - var signature = getterTypeSymbol.getCallSignatures()[0]; - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - return getterSymbol; - } - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - signature.setResolved(); - - return getterSymbol; - } - - signature.startResolving(); - - if (returnTypeAnnotation) { - var returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - if (!setterAnnotatedType) { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, null, signature, false, funcDecl, context); - } else { - signature.returnType = setterAnnotatedType; - } - } - - if (!hadError) { - signature.setResolved(); - } - } - - return getterSymbol; - }; - - PullTypeResolver.prototype.checkIfGetterAndSetterTypeMatch = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - var getter = accessorSymbol.getGetter(); - var setter = accessorSymbol.getSetter(); - - if (getter && setter) { - var getterAST = getter.getDeclarations()[0].ast(); - var setterAST = setter.getDeclarations()[0].ast(); - - if (getterAST.typeAnnotation && PullTypeResolver.hasSetAccessorParameterTypeAnnotation(setterAST)) { - var setterSig = setter.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - - var getter = accessorSymbol.getGetter(); - var getterSig = getter.type.getCallSignatures()[0]; - - var setterSuppliedTypeSymbol = setterParameters[0].type; - var getterSuppliedTypeSymbol = getterSig.returnType; - - if (!this.typesAreIdentical(setterSuppliedTypeSymbol, getterSuppliedTypeSymbol, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.get_and_set_accessor_must_have_the_same_type)); - } - } - } - }; - - PullTypeResolver.prototype.typeCheckGetAccessorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - - this.resolveAST(funcDeclAST.block, false, context); - - this.validateVariableDeclarationGroups(funcDecl, context); - - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - var hasReturn = (funcDecl.flags & (2048 /* Signature */ | 4194304 /* HasReturnStatement */)) !== 0; - var funcNameAST = funcDeclAST.propertyName; - - if (!hasReturn && !this.containsSingleThrowStatement(funcDeclAST.block)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getters_must_return_a_value)); - } - - var setter = accessorSymbol.getSetter(); - if (setter) { - var setterDecl = setter.getDeclarations()[0]; - var setterIsPrivate = TypeScript.hasFlag(setterDecl.flags, 2 /* Private */); - var getterIsPrivate = TypeScript.hasModifier(funcDeclAST.modifiers, 2 /* Private */); - - if (getterIsPrivate !== setterIsPrivate) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getter_and_setter_accessors_do_not_agree_in_visibility)); - } - - this.checkIfGetterAndSetterTypeMatch(funcDeclAST, context); - } - - this.checkFunctionTypePrivacy(funcDeclAST, TypeScript.hasModifier(funcDeclAST.modifiers, 16 /* Static */), null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), TypeScript.ASTHelpers.getType(funcDeclAST), funcDeclAST.block, context); - }; - - PullTypeResolver.hasSetAccessorParameterTypeAnnotation = function (setAccessor) { - return setAccessor.parameterList && setAccessor.parameterList.parameters.nonSeparatorCount() > 0 && setAccessor.parameterList.parameters.nonSeparatorAt(0).typeAnnotation !== null; - }; - - PullTypeResolver.prototype.resolveSetAccessorDeclaration = function (funcDeclAST, parameterList, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - var setterSymbol = accessorSymbol.getSetter(); - var setterTypeSymbol = setterSymbol.type; - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - return setterSymbol; - } - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - signature.setResolved(); - return setterSymbol; - } - - signature.startResolving(); - - if (parameterList) { - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(parameterList.parameters.nonSeparatorAt(i), context); - } - } - - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - - if (!hadError) { - signature.setResolved(); - } - } - - return setterSymbol; - }; - - PullTypeResolver.prototype.typeCheckSetAccessorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - if (funcDeclAST.parameterList) { - for (var i = 0; i < funcDeclAST.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(funcDeclAST.parameterList.parameters.nonSeparatorAt(i), context); - } - } - - this.resolveAST(funcDeclAST.block, false, context); - - this.validateVariableDeclarationGroups(funcDecl, context); - - var hasReturn = (funcDecl.flags & (2048 /* Signature */ | 4194304 /* HasReturnStatement */)) !== 0; - - var getter = accessorSymbol.getGetter(); - - var funcNameAST = funcDeclAST.propertyName; - - if (getter) { - var getterDecl = getter.getDeclarations()[0]; - var getterIsPrivate = TypeScript.hasFlag(getterDecl.flags, 2 /* Private */); - var setterIsPrivate = TypeScript.hasModifier(funcDeclAST.modifiers, 2 /* Private */); - - if (getterIsPrivate !== setterIsPrivate) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getter_and_setter_accessors_do_not_agree_in_visibility)); - } - - this.checkIfGetterAndSetterTypeMatch(funcDeclAST, context); - } else { - if (this.compilationSettings.noImplicitAny()) { - var setterFunctionDeclarationAst = funcDeclAST; - if (!PullTypeResolver.hasSetAccessorParameterTypeAnnotation(setterFunctionDeclarationAst) && accessorSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type, [setterFunctionDeclarationAst.propertyName.text()])); - } - } - } - - this.checkFunctionTypePrivacy(funcDeclAST, TypeScript.hasModifier(funcDeclAST.modifiers, 16 /* Static */), null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), null, funcDeclAST.block, context); - }; - - PullTypeResolver.prototype.resolveList = function (list, context) { - if (this.canTypeCheckAST(list, context)) { - this.setTypeChecked(list, context); - - for (var i = 0, n = list.childCount(); i < n; i++) { - this.resolveAST(list.childAt(i), false, context); - } - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveSeparatedList = function (list, context) { - if (this.canTypeCheckAST(list, context)) { - this.setTypeChecked(list, context); - - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - this.resolveAST(list.nonSeparatorAt(i), false, context); - } - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVoidExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.undefinedTypeSymbol; - }; - - PullTypeResolver.prototype.resolveLogicalOperation = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckLogicalOperation(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckLogicalOperation = function (binex, context) { - this.setTypeChecked(binex, context); - - var leftType = this.resolveAST(binex.left, false, context).type; - var rightType = this.resolveAST(binex.right, false, context).type; - - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(leftType, rightType, binex, context, comparisonInfo) && !this.sourceIsAssignableToTarget(rightType, leftType, binex, context, comparisonInfo)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(binex); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binex, TypeScript.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2, [ - TypeScript.SyntaxFacts.getText(TypeScript.SyntaxFacts.getOperatorTokenFromBinaryExpression(binex.kind())), - leftType.toString(enclosingSymbol), rightType.toString(enclosingSymbol)])); - } - }; - - PullTypeResolver.prototype.resolveLogicalNotExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.operand, false, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.resolveUnaryArithmeticOperation = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckUnaryArithmeticOperation(ast, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.resolvePostfixUnaryExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckPostfixUnaryExpression(ast, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.isAnyOrNumberOrEnum = function (type) { - return this.isAnyOrEquivalent(type) || type === this.semanticInfoChain.numberTypeSymbol || TypeScript.PullHelpers.symbolIsEnum(type); - }; - - PullTypeResolver.prototype.typeCheckUnaryArithmeticOperation = function (unaryExpression, context) { - this.setTypeChecked(unaryExpression, context); - - var nodeType = unaryExpression.kind(); - var expression = this.resolveAST(unaryExpression.operand, false, context); - - if (nodeType === 164 /* PlusExpression */ || nodeType == 165 /* NegateExpression */ || nodeType == 166 /* BitwiseNotExpression */) { - return; - } - - TypeScript.Debug.assert(nodeType === 168 /* PreIncrementExpression */ || nodeType === 169 /* PreDecrementExpression */); - - var operandType = expression.type; - if (!this.isAnyOrNumberOrEnum(operandType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!this.isReference(unaryExpression.operand, expression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer)); - } - }; - - PullTypeResolver.prototype.typeCheckPostfixUnaryExpression = function (unaryExpression, context) { - this.setTypeChecked(unaryExpression, context); - - var nodeType = unaryExpression.kind(); - var expression = this.resolveAST(unaryExpression.operand, false, context); - - TypeScript.Debug.assert(nodeType === 210 /* PostIncrementExpression */ || nodeType === 211 /* PostDecrementExpression */); - - var operandType = expression.type; - if (!this.isAnyOrNumberOrEnum(operandType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!this.isReference(unaryExpression.operand, expression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer)); - } - }; - - PullTypeResolver.prototype.resolveBinaryArithmeticExpression = function (binaryExpression, context) { - if (this.canTypeCheckAST(binaryExpression, context)) { - this.typeCheckBinaryArithmeticExpression(binaryExpression, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckBinaryArithmeticExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsSymbol = this.resolveAST(binaryExpression.left, false, context); - - var lhsType = lhsSymbol.type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - if (lhsType === this.semanticInfoChain.nullTypeSymbol || lhsType === this.semanticInfoChain.undefinedTypeSymbol) { - lhsType = rhsType; - } - - if (rhsType === this.semanticInfoChain.nullTypeSymbol || rhsType === this.semanticInfoChain.undefinedTypeSymbol) { - rhsType = lhsType; - } - - var lhsIsFit = this.isAnyOrNumberOrEnum(lhsType); - var rhsIsFit = this.isAnyOrNumberOrEnum(rhsType); - - if (!rhsIsFit) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!lhsIsFit) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type)); - } - - if (lhsIsFit && rhsIsFit) { - switch (binaryExpression.kind()) { - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - if (!this.isReference(binaryExpression.left, lhsSymbol)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } - - this.checkAssignability(binaryExpression.left, rhsType, lhsType, context); - } - } - }; - - PullTypeResolver.prototype.resolveTypeOfExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.stringTypeSymbol; - }; - - PullTypeResolver.prototype.resolveThrowStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveDeleteExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.resolveInstanceOfExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckInstanceOfExpression(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckInstanceOfExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsType = this.resolveAST(binaryExpression.left, false, context).type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - var enclosingSymbol = this.getEnclosingSymbolForAST(binaryExpression); - var isValidLHS = this.isAnyOrEquivalent(lhsType) || lhsType.isObject() || lhsType.isTypeParameter(); - var isValidRHS = this.isAnyOrEquivalent(rhsType) || this.typeIsAssignableToFunction(rhsType, binaryExpression, context); - - if (!isValidLHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type)); - } - }; - - PullTypeResolver.prototype.resolveCommaExpression = function (commaExpression, context) { - if (this.canTypeCheckAST(commaExpression, context)) { - this.setTypeChecked(commaExpression, context); - - this.resolveAST(commaExpression.left, false, context); - } - - return this.resolveAST(commaExpression.right, false, context).type; - }; - - PullTypeResolver.prototype.resolveInExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckInExpression(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckInExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsType = this.resolveAST(binaryExpression.left, false, context).type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - var isValidLHS = this.isAnyOrEquivalent(lhsType.type) || lhsType.type === this.semanticInfoChain.stringTypeSymbol || lhsType.type === this.semanticInfoChain.numberTypeSymbol; - - var isValidRHS = this.isAnyOrEquivalent(rhsType) || rhsType.isObject() || rhsType.isTypeParameter(); - - if (!isValidLHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number)); - } - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - }; - - PullTypeResolver.prototype.resolveForStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.variableDeclaration, false, context); - this.resolveAST(ast.initializer, false, context); - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.incrementor, false, context); - this.resolveAST(ast.statement, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveForInStatement = function (forInStatement, context) { - if (this.canTypeCheckAST(forInStatement, context)) { - this.typeCheckForInStatement(forInStatement, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckForInStatement = function (forInStatement, context) { - this.setTypeChecked(forInStatement, context); - - if (forInStatement.variableDeclaration) { - var declaration = forInStatement.variableDeclaration; - - if (declaration.declarators.nonSeparatorCount() === 1) { - var varDecl = declaration.declarators.nonSeparatorAt(0); - - if (varDecl.typeAnnotation) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declaration, TypeScript.DiagnosticCode.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation)); - } - } - } else { - var varSym = this.resolveAST(forInStatement.left, false, context); - var isStringOrNumber = varSym.type === this.semanticInfoChain.stringTypeSymbol || this.isAnyOrEquivalent(varSym.type); - - if (!isStringOrNumber) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(forInStatement.left, TypeScript.DiagnosticCode.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any)); - } - } - - var rhsType = this.resolveAST(forInStatement.expression, false, context).type; - var isValidRHS = rhsType && (this.isAnyOrEquivalent(rhsType) || rhsType.isObject() || rhsType.isTypeParameter()); - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(forInStatement.expression, TypeScript.DiagnosticCode.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - - this.resolveAST(forInStatement.statement, false, context); - }; - - PullTypeResolver.prototype.resolveWhileStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckWhileStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckWhileStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveDoStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckDoStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckDoStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveIfStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckIfStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckIfStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - this.resolveAST(ast.elseClause, false, context); - }; - - PullTypeResolver.prototype.resolveElseClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckElseClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckElseClause = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveBlock = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.statements, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVariableStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.declaration, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVariableDeclarationList = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.declarators, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveWithStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckWithStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckWithStatement = function (ast, context) { - this.setTypeChecked(ast, context); - var withStatement = ast; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(withStatement.condition, TypeScript.DiagnosticCode.All_symbols_within_a_with_block_will_be_resolved_to_any)); - }; - - PullTypeResolver.prototype.resolveTryStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckTryStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckTryStatement = function (ast, context) { - this.setTypeChecked(ast, context); - var tryStatement = ast; - - this.resolveAST(tryStatement.block, false, context); - this.resolveAST(tryStatement.catchClause, false, context); - this.resolveAST(tryStatement.finallyClause, false, context); - }; - - PullTypeResolver.prototype.resolveCatchClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckCatchClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckCatchClause = function (ast, context) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.block, false, context); - - var catchDecl = this.semanticInfoChain.getDeclForAST(ast); - this.validateVariableDeclarationGroups(catchDecl, context); - }; - - PullTypeResolver.prototype.resolveFinallyClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckFinallyClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckFinallyClause = function (ast, context) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.block, false, context); - }; - - PullTypeResolver.prototype.getEnclosingFunctionDeclaration = function (ast) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - - while (enclosingDecl) { - if (enclosingDecl.kind & 1032192 /* SomeFunction */) { - return enclosingDecl; - } - - enclosingDecl = enclosingDecl.getParentDecl(); - } - - return null; - }; - - PullTypeResolver.prototype.resolveReturnExpression = function (expression, enclosingFunction, context) { - if (enclosingFunction) { - enclosingFunction.setFlag(4194304 /* HasReturnStatement */); - } - - var isContextuallyTyped = false; - - if (enclosingFunction) { - var enclosingDeclAST = this.getASTForDecl(enclosingFunction); - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation) { - var returnTypeAnnotationSymbol = this.resolveTypeReference(typeAnnotation, context); - if (returnTypeAnnotationSymbol) { - isContextuallyTyped = true; - context.pushNewContextualType(returnTypeAnnotationSymbol); - } - } else { - var currentContextualType = context.getContextualType(); - if (currentContextualType && currentContextualType.isFunction()) { - var contextualSignatures = currentContextualType.kind == 33554432 /* ConstructorType */ ? currentContextualType.getConstructSignatures() : currentContextualType.getCallSignatures(); - var currentContextualTypeSignatureSymbol = contextualSignatures[0]; - - var currentContextualTypeReturnTypeSymbol = currentContextualTypeSignatureSymbol.returnType; - if (currentContextualTypeReturnTypeSymbol) { - isContextuallyTyped = true; - context.propagateContextualType(currentContextualTypeReturnTypeSymbol); - } - } - } - } - - var result = this.resolveAST(expression, isContextuallyTyped, context).type; - if (isContextuallyTyped) { - context.popAnyContextualType(); - } - - return result; - }; - - PullTypeResolver.prototype.typeCheckReturnExpression = function (expression, expressionType, enclosingFunction, context) { - if (enclosingFunction && enclosingFunction.kind === 32768 /* ConstructorMethod */) { - var classDecl = enclosingFunction.getParentDecl(); - if (classDecl) { - var classSymbol = classDecl.getSymbol(); - this.resolveDeclaredSymbol(classSymbol, context); - - var comparisonInfo = new TypeComparisonInfo(); - var isAssignable = this.sourceIsAssignableToTarget(expressionType, classSymbol.type, expression, context, comparisonInfo); - if (!isAssignable) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class)); - } - } - } - - if (enclosingFunction && enclosingFunction.kind === 524288 /* SetAccessor */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Setters_cannot_return_a_value)); - } - - if (enclosingFunction) { - var enclosingDeclAST = this.getASTForDecl(enclosingFunction); - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation || enclosingFunction.kind === 262144 /* GetAccessor */) { - var signatureSymbol = enclosingFunction.getSignatureSymbol(); - var sigReturnType = signatureSymbol.returnType; - - if (expressionType && sigReturnType) { - var comparisonInfo = new TypeComparisonInfo(); - var upperBound = null; - - this.resolveDeclaredSymbol(expressionType, context); - this.resolveDeclaredSymbol(sigReturnType, context); - - var isAssignable = this.sourceIsAssignableToTarget(expressionType, sigReturnType, expression, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(expression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [expressionType.toString(enclosingSymbol), sigReturnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [expressionType.toString(enclosingSymbol), sigReturnType.toString(enclosingSymbol)])); - } - } - } - } - } - }; - - PullTypeResolver.prototype.resolveReturnStatement = function (returnAST, context) { - var enclosingFunction = this.getEnclosingFunctionDeclaration(returnAST); - if (enclosingFunction) { - enclosingFunction.setFlag(4194304 /* HasReturnStatement */); - } - - var returnType = this.getSymbolForAST(returnAST, context); - var canTypeCheckAST = this.canTypeCheckAST(returnAST, context); - if (!returnType || canTypeCheckAST) { - var returnExpr = returnAST.expression; - - var resolvedReturnType = returnExpr === null ? this.semanticInfoChain.voidTypeSymbol : this.resolveReturnExpression(returnExpr, enclosingFunction, context); - - if (!returnType) { - returnType = resolvedReturnType; - this.setSymbolForAST(returnAST, resolvedReturnType, context); - } - - if (returnExpr && canTypeCheckAST) { - this.setTypeChecked(returnExpr, context); - this.typeCheckReturnExpression(returnExpr, resolvedReturnType, enclosingFunction, context); - } - } - - return returnType; - }; - - PullTypeResolver.prototype.resolveSwitchStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckSwitchStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckSwitchStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - var expressionType = this.resolveAST(ast.expression, false, context).type; - - for (var i = 0, n = ast.switchClauses.childCount(); i < n; i++) { - var switchClause = ast.switchClauses.childAt(i); - if (switchClause.kind() === 233 /* CaseSwitchClause */) { - var caseSwitchClause = switchClause; - - var caseClauseExpressionType = this.resolveAST(caseSwitchClause.expression, false, context).type; - this.resolveAST(caseSwitchClause.statements, false, context); - - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(expressionType, caseClauseExpressionType, caseSwitchClause.expression, context, comparisonInfo) && !this.sourceIsAssignableToTarget(caseClauseExpressionType, expressionType, caseSwitchClause.expression, context, comparisonInfo)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(caseSwitchClause.expression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(caseSwitchClause.expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [caseClauseExpressionType.toString(enclosingSymbol), expressionType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(caseSwitchClause.expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [caseClauseExpressionType.toString(enclosingSymbol), expressionType.toString(enclosingSymbol)])); - } - } - } else { - var defaultSwitchClause = switchClause; - this.resolveAST(defaultSwitchClause.statements, false, context); - } - } - }; - - PullTypeResolver.prototype.resolveLabeledStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckLabeledStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckLabeledStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - var labelIdentifier = ast.identifier.valueText(); - - var breakableLabels = this.getEnclosingLabels(ast, true, false); - - var matchingLabel = TypeScript.ArrayUtilities.firstOrDefault(breakableLabels, function (s) { - return s.identifier.valueText() === labelIdentifier; - }); - if (matchingLabel) { - context.postDiagnostic(this.semanticInfoChain.duplicateIdentifierDiagnosticFromAST(ast.identifier, labelIdentifier, matchingLabel)); - } - - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.labelIsOnContinuableConstruct = function (statement) { - switch (statement.kind()) { - case 160 /* LabeledStatement */: - return this.labelIsOnContinuableConstruct(statement.statement); - - case 158 /* WhileStatement */: - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 161 /* DoStatement */: - return true; - - default: - return false; - } - }; - - PullTypeResolver.prototype.resolveContinueStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckContinueStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.isIterationStatement = function (ast) { - switch (ast.kind()) { - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - return true; - } - - return false; - }; - - PullTypeResolver.prototype.isAnyFunctionExpressionOrDeclaration = function (ast) { - switch (ast.kind()) { - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 129 /* FunctionDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 241 /* FunctionPropertyAssignment */: - case 137 /* ConstructorDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return true; - } - - return false; - }; - - PullTypeResolver.prototype.inSwitchStatement = function (ast) { - while (ast) { - if (ast.kind() === 151 /* SwitchStatement */) { - return true; - } - - if (this.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inIterationStatement = function (ast, crossFunctions) { - while (ast) { - if (this.isIterationStatement(ast)) { - return true; - } - - if (!crossFunctions && this.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.getEnclosingLabels = function (ast, breakable, crossFunctions) { - var result = []; - - ast = ast.parent; - while (ast) { - if (ast.kind() === 160 /* LabeledStatement */) { - var labeledStatement = ast; - if (breakable) { - result.push(labeledStatement); - } else { - if (this.labelIsOnContinuableConstruct(labeledStatement.statement)) { - result.push(labeledStatement); - } - } - } - - if (!crossFunctions && this.isAnyFunctionExpressionOrDeclaration(ast)) { - break; - } - - ast = ast.parent; - } - - return result; - }; - - PullTypeResolver.prototype.typeCheckContinueStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - if (!this.inIterationStatement(ast, false)) { - if (this.inIterationStatement(ast, true)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.continue_statement_can_only_be_used_within_an_enclosing_iteration_statement)); - } - } else if (ast.identifier) { - var continuableLabels = this.getEnclosingLabels(ast, false, false); - - if (!TypeScript.ArrayUtilities.any(continuableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - var continuableLabels = this.getEnclosingLabels(ast, false, true); - - if (TypeScript.ArrayUtilities.any(continuableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_not_found)); - } - } - } - }; - - PullTypeResolver.prototype.resolveBreakStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckBreakStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckBreakStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - if (ast.identifier) { - var breakableLabels = this.getEnclosingLabels(ast, true, false); - - if (!TypeScript.ArrayUtilities.any(breakableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - var breakableLabels = this.getEnclosingLabels(ast, true, true); - if (TypeScript.ArrayUtilities.any(breakableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_not_found)); - } - } - } else if (!this.inIterationStatement(ast, false) && !this.inSwitchStatement(ast)) { - if (this.inIterationStatement(ast, true)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement)); - } - } - }; - - PullTypeResolver.prototype.resolveAST = function (ast, isContextuallyTyped, context) { - if (!ast) { - return; - } - - var symbol = this.getSymbolForAST(ast, context); - if (symbol && symbol.isResolved) { - this.typeCheckAST(ast, isContextuallyTyped, context); - return symbol; - } - - if (ast.isExpression() && !isTypesOnlyLocation(ast)) { - return this.resolveExpressionAST(ast, isContextuallyTyped, context); - } - - var nodeType = ast.kind(); - - switch (nodeType) { - case 124 /* ArrayType */: - case 126 /* GenericType */: - case 122 /* ObjectType */: - case 127 /* TypeQuery */: - case 125 /* ConstructorType */: - case 123 /* FunctionType */: - return this.resolveTypeReference(ast, context); - - case 1 /* List */: - return this.resolveList(ast, context); - - case 2 /* SeparatedList */: - return this.resolveSeparatedList(ast, context); - - case 120 /* SourceUnit */: - return this.resolveSourceUnit(ast, context); - - case 132 /* EnumDeclaration */: - return this.resolveEnumDeclaration(ast, context); - - case 130 /* ModuleDeclaration */: - return this.resolveModuleDeclaration(ast, context); - - case 128 /* InterfaceDeclaration */: - return this.resolveInterfaceDeclaration(ast, context); - - case 131 /* ClassDeclaration */: - return this.resolveClassDeclaration(ast, context); - - case 224 /* VariableDeclaration */: - return this.resolveVariableDeclarationList(ast, context); - - case 136 /* MemberVariableDeclaration */: - return this.resolveMemberVariableDeclaration(ast, context); - - case 225 /* VariableDeclarator */: - return this.resolveVariableDeclarator(ast, context); - - case 141 /* PropertySignature */: - return this.resolvePropertySignature(ast, context); - - case 227 /* ParameterList */: - return this.resolveParameterList(ast, context); - - case 242 /* Parameter */: - return this.resolveParameter(ast, context); - - case 243 /* EnumElement */: - return this.resolveEnumElement(ast, context); - - case 232 /* EqualsValueClause */: - return this.resolveEqualsValueClause(ast, isContextuallyTyped, context); - - case 238 /* TypeParameter */: - return this.resolveTypeParameterDeclaration(ast, context); - - case 239 /* Constraint */: - return this.resolveConstraint(ast, context); - - case 133 /* ImportDeclaration */: - return this.resolveImportDeclaration(ast, context); - - case 240 /* SimplePropertyAssignment */: - return this.resolveSimplePropertyAssignment(ast, isContextuallyTyped, context); - - case 241 /* FunctionPropertyAssignment */: - return this.resolveFunctionPropertyAssignment(ast, isContextuallyTyped, context); - - case 11 /* IdentifierName */: - TypeScript.Debug.assert(isTypesOnlyLocation(ast)); - return this.resolveTypeNameExpression(ast, context); - - case 121 /* QualifiedName */: - return this.resolveQualifiedName(ast, context); - - case 137 /* ConstructorDeclaration */: - return this.resolveConstructorDeclaration(ast, context); - - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return this.resolveAccessorDeclaration(ast, context); - - case 138 /* IndexMemberDeclaration */: - return this.resolveIndexMemberDeclaration(ast, context); - - case 144 /* IndexSignature */: - return this.resolveIndexSignature(ast, context); - - case 135 /* MemberFunctionDeclaration */: - return this.resolveMemberFunctionDeclaration(ast, context); - - case 142 /* CallSignature */: - return this.resolveCallSignature(ast, context); - - case 143 /* ConstructSignature */: - return this.resolveConstructSignature(ast, context); - - case 145 /* MethodSignature */: - return this.resolveMethodSignature(ast, context); - - case 129 /* FunctionDeclaration */: - return this.resolveAnyFunctionDeclaration(ast, context); - - case 244 /* TypeAnnotation */: - return this.resolveTypeAnnotation(ast, context); - - case 134 /* ExportAssignment */: - return this.resolveExportAssignmentStatement(ast, context); - - case 157 /* ThrowStatement */: - return this.resolveThrowStatement(ast, context); - - case 149 /* ExpressionStatement */: - return this.resolveExpressionStatement(ast, context); - - case 154 /* ForStatement */: - return this.resolveForStatement(ast, context); - - case 155 /* ForInStatement */: - return this.resolveForInStatement(ast, context); - - case 158 /* WhileStatement */: - return this.resolveWhileStatement(ast, context); - - case 161 /* DoStatement */: - return this.resolveDoStatement(ast, context); - - case 147 /* IfStatement */: - return this.resolveIfStatement(ast, context); - - case 235 /* ElseClause */: - return this.resolveElseClause(ast, context); - - case 146 /* Block */: - return this.resolveBlock(ast, context); - - case 148 /* VariableStatement */: - return this.resolveVariableStatement(ast, context); - - case 163 /* WithStatement */: - return this.resolveWithStatement(ast, context); - - case 159 /* TryStatement */: - return this.resolveTryStatement(ast, context); - - case 236 /* CatchClause */: - return this.resolveCatchClause(ast, context); - - case 237 /* FinallyClause */: - return this.resolveFinallyClause(ast, context); - - case 150 /* ReturnStatement */: - return this.resolveReturnStatement(ast, context); - - case 151 /* SwitchStatement */: - return this.resolveSwitchStatement(ast, context); - - case 153 /* ContinueStatement */: - return this.resolveContinueStatement(ast, context); - - case 152 /* BreakStatement */: - return this.resolveBreakStatement(ast, context); - - case 160 /* LabeledStatement */: - return this.resolveLabeledStatement(ast, context); - } - - return this.semanticInfoChain.anyTypeSymbol; - }; - - PullTypeResolver.prototype.resolveExpressionAST = function (ast, isContextuallyOrInferentiallyTyped, context) { - var expressionSymbol = this.resolveExpressionWorker(ast, isContextuallyOrInferentiallyTyped, context); - - if (isContextuallyOrInferentiallyTyped && context.isInferentiallyTyping()) { - return this.alterPotentialGenericFunctionTypeToInstantiatedFunctionTypeForTypeArgumentInference(expressionSymbol, context); - } else { - return expressionSymbol; - } - }; - - PullTypeResolver.prototype.resolveExpressionWorker = function (ast, isContextuallyTyped, context) { - switch (ast.kind()) { - case 215 /* ObjectLiteralExpression */: - return this.resolveObjectLiteralExpression(ast, isContextuallyTyped, context); - - case 11 /* IdentifierName */: - return this.resolveNameExpression(ast, context); - - case 212 /* MemberAccessExpression */: - return this.resolveMemberAccessExpression(ast, context); - - case 222 /* FunctionExpression */: - return this.resolveFunctionExpression(ast, isContextuallyTyped, context); - - case 219 /* SimpleArrowFunctionExpression */: - return this.resolveSimpleArrowFunctionExpression(ast, isContextuallyTyped, context); - - case 218 /* ParenthesizedArrowFunctionExpression */: - return this.resolveParenthesizedArrowFunctionExpression(ast, isContextuallyTyped, context); - - case 214 /* ArrayLiteralExpression */: - return this.resolveArrayLiteralExpression(ast, isContextuallyTyped, context); - - case 35 /* ThisKeyword */: - return this.resolveThisExpression(ast, context); - - case 50 /* SuperKeyword */: - return this.resolveSuperExpression(ast, context); - - case 213 /* InvocationExpression */: - return this.resolveInvocationExpression(ast, context); - - case 216 /* ObjectCreationExpression */: - return this.resolveObjectCreationExpression(ast, context); - - case 220 /* CastExpression */: - return this.resolveCastExpression(ast, context); - - case 13 /* NumericLiteral */: - return this.semanticInfoChain.numberTypeSymbol; - - case 14 /* StringLiteral */: - return this.semanticInfoChain.stringTypeSymbol; - - case 32 /* NullKeyword */: - return this.semanticInfoChain.nullTypeSymbol; - - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return this.semanticInfoChain.booleanTypeSymbol; - - case 172 /* VoidExpression */: - return this.resolveVoidExpression(ast, context); - - case 174 /* AssignmentExpression */: - return this.resolveAssignmentExpression(ast, context); - - case 167 /* LogicalNotExpression */: - return this.resolveLogicalNotExpression(ast, context); - - case 193 /* NotEqualsWithTypeConversionExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 197 /* GreaterThanExpression */: - return this.resolveLogicalOperation(ast, context); - - case 208 /* AddExpression */: - case 175 /* AddAssignmentExpression */: - return this.resolveBinaryAdditionOperation(ast, context); - - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return this.resolveUnaryArithmeticOperation(ast, context); - - case 210 /* PostIncrementExpression */: - case 211 /* PostDecrementExpression */: - return this.resolvePostfixUnaryExpression(ast, context); - - case 209 /* SubtractExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 189 /* BitwiseOrExpression */: - case 191 /* BitwiseAndExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - return this.resolveBinaryArithmeticExpression(ast, context); - - case 221 /* ElementAccessExpression */: - return this.resolveElementAccessExpression(ast, context); - - case 187 /* LogicalOrExpression */: - return this.resolveLogicalOrExpression(ast, isContextuallyTyped, context); - - case 188 /* LogicalAndExpression */: - return this.resolveLogicalAndExpression(ast, context); - - case 171 /* TypeOfExpression */: - return this.resolveTypeOfExpression(ast, context); - - case 170 /* DeleteExpression */: - return this.resolveDeleteExpression(ast, context); - - case 186 /* ConditionalExpression */: - return this.resolveConditionalExpression(ast, isContextuallyTyped, context); - - case 12 /* RegularExpressionLiteral */: - return this.resolveRegularExpressionLiteral(); - - case 217 /* ParenthesizedExpression */: - return this.resolveParenthesizedExpression(ast, context); - - case 200 /* InstanceOfExpression */: - return this.resolveInstanceOfExpression(ast, context); - - case 173 /* CommaExpression */: - return this.resolveCommaExpression(ast, context); - - case 201 /* InExpression */: - return this.resolveInExpression(ast, context); - - case 223 /* OmittedExpression */: - return this.semanticInfoChain.undefinedTypeSymbol; - } - - TypeScript.Debug.fail("resolveExpressionASTWorker: Missing expression kind: " + TypeScript.SyntaxKind[ast.kind()]); - }; - - PullTypeResolver.prototype.typeCheckAST = function (ast, isContextuallyTyped, context) { - if (!this.canTypeCheckAST(ast, context)) { - return; - } - - var nodeType = ast.kind(); - switch (nodeType) { - case 120 /* SourceUnit */: - this.typeCheckSourceUnit(ast, context); - return; - - case 132 /* EnumDeclaration */: - this.typeCheckEnumDeclaration(ast, context); - return; - - case 130 /* ModuleDeclaration */: - this.typeCheckModuleDeclaration(ast, context); - return; - - case 128 /* InterfaceDeclaration */: - this.typeCheckInterfaceDeclaration(ast, context); - return; - - case 131 /* ClassDeclaration */: - this.typeCheckClassDeclaration(ast, context); - return; - - case 243 /* EnumElement */: - this.typeCheckEnumElement(ast, context); - return; - - case 136 /* MemberVariableDeclaration */: - this.typeCheckMemberVariableDeclaration(ast, context); - return; - - case 225 /* VariableDeclarator */: - this.typeCheckVariableDeclarator(ast, context); - return; - - case 141 /* PropertySignature */: - this.typeCheckPropertySignature(ast, context); - return; - - case 242 /* Parameter */: - this.typeCheckParameter(ast, context); - return; - - case 133 /* ImportDeclaration */: - this.typeCheckImportDeclaration(ast, context); - return; - - case 215 /* ObjectLiteralExpression */: - this.resolveObjectLiteralExpression(ast, isContextuallyTyped, context); - return; - - case 241 /* FunctionPropertyAssignment */: - this.typeCheckFunctionPropertyAssignment(ast, isContextuallyTyped, context); - return; - - case 11 /* IdentifierName */: - if (isTypesOnlyLocation(ast)) { - this.resolveTypeNameExpression(ast, context); - } else { - this.resolveNameExpression(ast, context); - } - return; - - case 212 /* MemberAccessExpression */: - this.resolveMemberAccessExpression(ast, context); - return; - - case 121 /* QualifiedName */: - this.resolveQualifiedName(ast, context); - return; - - case 222 /* FunctionExpression */: - this.typeCheckFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 137 /* ConstructorDeclaration */: - this.typeCheckConstructorDeclaration(ast, context); - return; - - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - this.typeCheckAccessorDeclaration(ast, context); - return; - - case 135 /* MemberFunctionDeclaration */: - this.typeCheckMemberFunctionDeclaration(ast, context); - return; - - case 145 /* MethodSignature */: - this.typeCheckMethodSignature(ast, context); - return; - - case 144 /* IndexSignature */: - this.typeCheckIndexSignature(ast, context); - break; - - case 142 /* CallSignature */: - this.typeCheckCallSignature(ast, context); - return; - - case 143 /* ConstructSignature */: - this.typeCheckConstructSignature(ast, context); - return; - - case 129 /* FunctionDeclaration */: { - var funcDecl = ast; - this.typeCheckAnyFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.identifier, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - return; - } - - case 219 /* SimpleArrowFunctionExpression */: - this.typeCheckSimpleArrowFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 218 /* ParenthesizedArrowFunctionExpression */: - this.typeCheckParenthesizedArrowFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 214 /* ArrayLiteralExpression */: - this.resolveArrayLiteralExpression(ast, isContextuallyTyped, context); - return; - - case 213 /* InvocationExpression */: - this.typeCheckInvocationExpression(ast, context); - return; - - case 216 /* ObjectCreationExpression */: - this.typeCheckObjectCreationExpression(ast, context); - return; - - case 150 /* ReturnStatement */: - this.resolveReturnStatement(ast, context); - return; - - default: - TypeScript.Debug.assert(false, "Failure nodeType: " + TypeScript.SyntaxKind[ast.kind()] + ". Implement typeCheck when symbol is set for the ast as part of resolution."); - } - }; - - PullTypeResolver.prototype.processPostTypeCheckWorkItems = function (context) { - while (this.postTypeCheckWorkitems.length) { - var ast = this.postTypeCheckWorkitems.pop(); - this.postTypeCheck(ast, context); - } - }; - - PullTypeResolver.prototype.postTypeCheck = function (ast, context) { - var nodeType = ast.kind(); - - switch (nodeType) { - case 242 /* Parameter */: - case 225 /* VariableDeclarator */: - this.postTypeCheckVariableDeclaratorOrParameter(ast, context); - return; - - case 131 /* ClassDeclaration */: - this.postTypeCheckClassDeclaration(ast, context); - return; - - case 129 /* FunctionDeclaration */: - this.postTypeCheckFunctionDeclaration(ast, context); - return; - - case 130 /* ModuleDeclaration */: - this.postTypeCheckModuleDeclaration(ast, context); - return; - - case 132 /* EnumDeclaration */: - this.postTypeCheckEnumDeclaration(ast, context); - return; - - case 133 /* ImportDeclaration */: - this.postTypeCheckImportDeclaration(ast, context); - return; - - case 11 /* IdentifierName */: - this.postTypeCheckNameExpression(ast, context); - return; - - default: - TypeScript.Debug.assert(false, "Implement postTypeCheck clause to handle the postTypeCheck work, nodeType: " + TypeScript.SyntaxKind[ast.kind()]); - } - }; - - PullTypeResolver.prototype.resolveRegularExpressionLiteral = function () { - if (this.cachedRegExpInterfaceType()) { - return this.cachedRegExpInterfaceType(); - } else { - return this.semanticInfoChain.anyTypeSymbol; - } - }; - - PullTypeResolver.prototype.postTypeCheckNameExpression = function (nameAST, context) { - this.checkThisCaptureVariableCollides(nameAST, false, context); - }; - - PullTypeResolver.prototype.typeCheckNameExpression = function (nameAST, context) { - this.setTypeChecked(nameAST, context); - this.checkNameForCompilerGeneratedDeclarationCollision(nameAST, false, nameAST, context); - }; - - PullTypeResolver.prototype.resolveNameExpression = function (nameAST, context) { - var nameSymbol = this.getSymbolForAST(nameAST, context); - var foundCached = nameSymbol !== null; - - if (!foundCached || this.canTypeCheckAST(nameAST, context)) { - if (this.canTypeCheckAST(nameAST, context)) { - this.typeCheckNameExpression(nameAST, context); - } - nameSymbol = this.computeNameExpression(nameAST, context); - } - - this.resolveDeclaredSymbol(nameSymbol, context); - - if (nameSymbol && (nameSymbol.type !== this.semanticInfoChain.anyTypeSymbol || nameSymbol.anyDeclHasFlag(16777216 /* IsAnnotatedWithAny */ | 1 /* Exported */))) { - this.setSymbolForAST(nameAST, nameSymbol, context); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.isInEnumDecl = function (decl) { - if (decl.kind & 64 /* Enum */) { - return true; - } - - var declPath = decl.getParentPath(); - - var disallowedKinds = 164 /* SomeContainer */ | 58728795 /* SomeType */; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - - if (decl.kind & 64 /* Enum */) { - return true; - } - - if (decl.kind & disallowedKinds) { - return false; - } - } - return false; - }; - - PullTypeResolver.prototype.getSomeInnermostFunctionScopeDecl = function (declPath) { - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - if (decl.kind & 1032192 /* SomeFunction */) { - return decl; - } - } - - return null; - }; - - PullTypeResolver.prototype.isFromFunctionScope = function (nameSymbol, functionScopeDecl) { - var _this = this; - return TypeScript.ArrayUtilities.any(nameSymbol.getDeclarations(), function (nameSymbolDecl) { - return _this.getSomeInnermostFunctionScopeDecl(nameSymbolDecl.getParentPath()) === functionScopeDecl; - }); - }; - - PullTypeResolver.prototype.findConstructorDeclOfEnclosingType = function (decl) { - var current = decl; - while (current) { - if (TypeScript.hasFlag(current.kind, 4096 /* Property */)) { - var parentDecl = current.getParentDecl(); - if (TypeScript.hasFlag(parentDecl.kind, 8 /* Class */)) { - return TypeScript.ArrayUtilities.lastOrDefault(parentDecl.getChildDecls(), function (decl) { - return TypeScript.hasFlag(decl.kind, 32768 /* ConstructorMethod */); - }); - } - } - - if (TypeScript.hasFlag(current.kind, 164 /* SomeContainer */)) { - return null; - } - - current = current.getParentDecl(); - } - return null; - }; - - PullTypeResolver.prototype.checkNameAsPartOfInitializerExpressionForInstanceMemberVariable = function (nameAST) { - var id = nameAST.valueText(); - if (id.length === 0) { - return null; - } - - var memberVariableDeclarationAST = TypeScript.ASTHelpers.getEnclosingMemberVariableDeclaration(nameAST); - if (memberVariableDeclarationAST) { - var memberVariableDecl = this.semanticInfoChain.getDeclForAST(memberVariableDeclarationAST); - if (!TypeScript.hasFlag(memberVariableDecl.flags, 16 /* Static */)) { - var constructorDecl = this.findConstructorDeclOfEnclosingType(memberVariableDecl); - - if (constructorDecl) { - var childDecls = constructorDecl.searchChildDecls(id, 68147712 /* SomeValue */); - - if (childDecls.length) { - var memberVariableSymbol = memberVariableDecl.getSymbol(); - - return this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, [memberVariableSymbol.getScopedName(constructorDecl.getSymbol()), nameAST.text()]); - } - } - } - } - return null; - }; - - PullTypeResolver.prototype.computeNameExpression = function (nameAST, context) { - var id = nameAST.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var nameSymbol = null; - var enclosingDecl = this.getEnclosingDeclForAST(nameAST); - - if (TypeScript.hasFlag(enclosingDecl.flags, 8388608 /* PropertyParameter */)) { - var valueDecl = enclosingDecl.getValueDecl(); - if (valueDecl && TypeScript.hasFlag(valueDecl.kind, 2048 /* Parameter */)) { - enclosingDecl = valueDecl; - } - } - - var diagnosticForInitializer = this.checkNameAsPartOfInitializerExpressionForInstanceMemberVariable(nameAST); - - if (TypeScript.ASTHelpers.isDeclarationASTOrDeclarationNameAST(nameAST)) { - nameSymbol = this.semanticInfoChain.getDeclForAST(nameAST.parent).getSymbol(); - } - - var declPath = enclosingDecl.getParentPath(); - - if (!nameSymbol) { - var searchKind = 68147712 /* SomeValue */; - - if (!this.isInEnumDecl(enclosingDecl)) { - searchKind = searchKind & ~(67108864 /* EnumMember */); - } - - var nameSymbol = this.getSymbolFromDeclPath(id, declPath, searchKind); - } - - if (id === "arguments") { - var functionScopeDecl = this.getSomeInnermostFunctionScopeDecl(declPath); - if (functionScopeDecl) { - if (!nameSymbol || !this.isFromFunctionScope(nameSymbol, functionScopeDecl)) { - nameSymbol = this.cachedFunctionArgumentsSymbol(); - this.resolveDeclaredSymbol(this.cachedIArgumentsInterfaceType(), context); - } - } - } - - if (!nameSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } else if (diagnosticForInitializer) { - context.postDiagnostic(diagnosticForInitializer); - return this.getNewErrorTypeSymbol(id); - } - - var nameDeclaration = nameSymbol.getDeclarations()[0]; - var nameParentDecl = nameDeclaration.getParentDecl(); - if (nameParentDecl && (nameParentDecl.kind & 1032192 /* SomeFunction */) && (nameParentDecl.flags & 33554432 /* HasDefaultArgs */)) { - var enclosingFunctionAST = this.semanticInfoChain.getASTForDecl(nameParentDecl); - var currentParameterIndex = this.getCurrentParameterIndexForFunction(nameAST, enclosingFunctionAST); - - var parameterList = TypeScript.ASTHelpers.getParameterList(enclosingFunctionAST); - - if (currentParameterIndex >= 0) { - var matchingParameter; - if (parameterList) { - for (var i = 0; i <= currentParameterIndex; i++) { - var candidateParameter = parameterList.parameters.nonSeparatorAt(i); - if (candidateParameter && candidateParameter.identifier.valueText() === id) { - matchingParameter = candidateParameter; - break; - } - } - } - - if (!matchingParameter) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, [parameterList.parameters.nonSeparatorAt(currentParameterIndex).identifier.text(), nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } else if (matchingParameter === TypeScript.ASTHelpers.getEnclosingParameterForInitializer(nameAST)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Parameter_0_cannot_be_referenced_in_its_initializer, [parameterList.parameters.nonSeparatorAt(currentParameterIndex).identifier.text()])); - return this.getNewErrorTypeSymbol(id); - } - } - } - - var aliasSymbol = null; - - if (nameSymbol.isType() && nameSymbol.isAlias()) { - aliasSymbol = nameSymbol; - if (!this.inTypeQuery(nameAST)) { - aliasSymbol.setIsUsedAsValue(); - } - - this.resolveDeclaredSymbol(nameSymbol, context); - - this.resolveDeclaredSymbol(aliasSymbol.assignedValue(), context); - this.resolveDeclaredSymbol(aliasSymbol.assignedContainer(), context); - - var exportAssignmentSymbol = nameSymbol.getExportAssignedValueSymbol(); - - if (exportAssignmentSymbol) { - nameSymbol = exportAssignmentSymbol; - } else { - aliasSymbol = null; - } - } - - if (aliasSymbol) { - this.semanticInfoChain.setAliasSymbolForAST(nameAST, aliasSymbol); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.getCurrentParameterIndexForFunction = function (parameter, funcDecl) { - var parameterList = TypeScript.ASTHelpers.getParameterList(funcDecl); - if (parameterList) { - while (parameter && parameter.parent) { - if (parameter.parent.parent === parameterList) { - return parameterList.parameters.nonSeparatorIndexOf(parameter); - } - - parameter = parameter.parent; - } - } - - return -1; - }; - - PullTypeResolver.prototype.resolveMemberAccessExpression = function (dottedNameAST, context) { - return this.resolveDottedNameExpression(dottedNameAST, dottedNameAST.expression, dottedNameAST.name, context); - }; - - PullTypeResolver.prototype.resolveDottedNameExpression = function (dottedNameAST, expression, name, context) { - var symbol = this.getSymbolForAST(dottedNameAST, context); - var foundCached = symbol !== null; - - if (!foundCached || this.canTypeCheckAST(dottedNameAST, context)) { - var canTypeCheckDottedNameAST = this.canTypeCheckAST(dottedNameAST, context); - if (canTypeCheckDottedNameAST) { - this.setTypeChecked(dottedNameAST, context); - } - - symbol = this.computeDottedNameExpression(expression, name, context, canTypeCheckDottedNameAST); - } - - this.resolveDeclaredSymbol(symbol, context); - - if (symbol && (symbol.type !== this.semanticInfoChain.anyTypeSymbol || symbol.anyDeclHasFlag(16777216 /* IsAnnotatedWithAny */ | 1 /* Exported */))) { - this.setSymbolForAST(dottedNameAST, symbol, context); - this.setSymbolForAST(name, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.computeDottedNameExpression = function (expression, name, context, checkSuperPrivateAndStaticAccess) { - var rhsName = name.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var lhs = this.resolveAST(expression, false, context); - return this.computeDottedNameExpressionFromLHS(lhs, expression, name, context, checkSuperPrivateAndStaticAccess); - }; - - PullTypeResolver.prototype.computeDottedNameExpressionFromLHS = function (lhs, expression, name, context, checkSuperPrivateAndStaticAccess) { - var rhsName = name.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var lhsType = lhs.type; - - if (lhs.isAlias()) { - var lhsAlias = lhs; - if (!this.inTypeQuery(expression)) { - lhsAlias.setIsUsedAsValue(); - } - lhsType = lhsAlias.getExportAssignedTypeSymbol(); - } - - if (lhsType.isAlias()) { - lhsType = lhsType.getExportAssignedTypeSymbol(); - } - - if (!lhsType) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.Could_not_find_enclosing_symbol_for_dotted_name_0, [name.text()])); - return this.getNewErrorTypeSymbol(); - } - - if (!lhsType.isResolved) { - var potentiallySpecializedType = this.resolveDeclaredSymbol(lhsType, context); - - if (potentiallySpecializedType !== lhsType) { - if (!lhs.isType()) { - context.setTypeInContext(lhs, potentiallySpecializedType); - } - - lhsType = potentiallySpecializedType; - } - } - - if (lhsType.isContainer() && !lhsType.isAlias() && !lhsType.isEnum()) { - var instanceSymbol = lhsType.getInstanceSymbol(); - - if (instanceSymbol) { - lhsType = instanceSymbol.type; - } - } - - var originalLhsTypeForErrorReporting = lhsType; - - lhsType = this.getApparentType(lhsType).widenedType(this, expression, context); - - if (this.isAnyOrEquivalent(lhsType)) { - return lhsType; - } - - var nameSymbol = this._getNamedPropertySymbolOfAugmentedType(rhsName, lhsType); - - if (!nameSymbol) { - if (lhsType.kind === 32 /* DynamicModule */) { - var container = lhsType; - var associatedInstance = container.getInstanceSymbol(); - - if (associatedInstance) { - var instanceType = associatedInstance.type; - - nameSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, instanceType); - } - } else { - var associatedType = lhsType.getAssociatedContainerType(); - - if (associatedType && !associatedType.isClass()) { - nameSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, associatedType); - } - } - - if (!nameSymbol) { - var enclosingDecl = this.getEnclosingDeclForAST(expression); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.The_property_0_does_not_exist_on_value_of_type_1, [name.text(), originalLhsTypeForErrorReporting.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - return this.getNewErrorTypeSymbol(rhsName); - } - } - - if (checkSuperPrivateAndStaticAccess) { - this.checkForSuperMemberAccess(expression, name, nameSymbol, context) || this.checkForPrivateMemberAccess(name, lhsType, nameSymbol, context); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.resolveTypeNameExpression = function (nameAST, context) { - var typeNameSymbol = this.getSymbolForAST(nameAST, context); - - if (!typeNameSymbol || !typeNameSymbol.isType() || this.canTypeCheckAST(nameAST, context)) { - if (this.canTypeCheckAST(nameAST, context)) { - this.setTypeChecked(nameAST, context); - } - typeNameSymbol = this.computeTypeNameExpression(nameAST, context); - this.setSymbolForAST(nameAST, typeNameSymbol, context); - } - - this.resolveDeclaredSymbol(typeNameSymbol, context); - - return typeNameSymbol; - }; - - PullTypeResolver.prototype.computeTypeNameExpression = function (nameAST, context) { - var id = nameAST.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var enclosingDecl = this.getEnclosingDeclForAST(nameAST); - - var declPath = enclosingDecl.getParentPath(); - - var onLeftOfDot = this.isLeftSideOfQualifiedName(nameAST); - - var kindToCheckFirst = onLeftOfDot ? 164 /* SomeContainer */ : 58728795 /* SomeType */; - var kindToCheckSecond = onLeftOfDot ? 58728795 /* SomeType */ : 164 /* SomeContainer */; - - var typeNameSymbol = this.getSymbolFromDeclPath(id, declPath, kindToCheckFirst); - - if (!typeNameSymbol) { - typeNameSymbol = this.getSymbolFromDeclPath(id, declPath, kindToCheckSecond); - } - - if (!typeNameSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } - - var typeNameSymbolAlias = null; - if (typeNameSymbol.isAlias()) { - typeNameSymbolAlias = typeNameSymbol; - this.resolveDeclaredSymbol(typeNameSymbol, context); - - var aliasedType = typeNameSymbolAlias.getExportAssignedTypeSymbol(); - - this.resolveDeclaredSymbol(aliasedType, context); - } - - if (typeNameSymbol.isTypeParameter()) { - if (this.isInStaticMemberContext(enclosingDecl)) { - var parentDecl = typeNameSymbol.getDeclarations()[0].getParentDecl(); - - if (parentDecl.kind === 8 /* Class */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Static_members_cannot_reference_class_type_parameters)); - return this.getNewErrorTypeSymbol(); - } - } - } - - if (!typeNameSymbol.isGeneric() && (typeNameSymbol.isClass() || typeNameSymbol.isInterface())) { - typeNameSymbol = TypeScript.PullTypeReferenceSymbol.createTypeReference(typeNameSymbol); - } - - return typeNameSymbol; - }; - - PullTypeResolver.prototype.isInStaticMemberContext = function (decl) { - while (decl) { - if (TypeScript.hasFlag(decl.kind, 1032192 /* SomeFunction */ | 4096 /* Property */) && TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - return true; - } - - if (TypeScript.hasFlag(decl.kind, 164 /* SomeContainer */)) { - return false; - } - - decl = decl.getParentDecl(); - } - - return false; - }; - - PullTypeResolver.prototype.isLeftSideOfQualifiedName = function (ast) { - return ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.left === ast; - }; - - PullTypeResolver.prototype.resolveGenericTypeReference = function (genericTypeAST, context) { - var genericTypeSymbol = this.resolveAST(genericTypeAST.name, false, context).type; - - if (genericTypeSymbol.isError()) { - return genericTypeSymbol; - } - - if (!genericTypeSymbol.inResolution && !genericTypeSymbol.isResolved) { - this.resolveDeclaredSymbol(genericTypeSymbol, context); - } - - if (genericTypeSymbol.isAlias()) { - if (this.inClassExtendsHeritageClause(genericTypeAST) && !this.inTypeArgumentList(genericTypeAST)) { - genericTypeSymbol.setIsUsedAsValue(); - } - genericTypeSymbol = genericTypeSymbol.getExportAssignedTypeSymbol(); - } - - var typeParameters = genericTypeSymbol.getTypeParameters(); - if (typeParameters.length === 0) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Type_0_does_not_have_type_parameters, [genericTypeSymbol.toString()])); - return this.getNewErrorTypeSymbol(); - } - - var typeArgs = []; - - if (genericTypeAST.typeArgumentList && genericTypeAST.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < genericTypeAST.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - typeArgs[i] = this.resolveTypeReference(genericTypeAST.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - - if (typeArgs[i].isError()) { - typeArgs[i] = this.semanticInfoChain.anyTypeSymbol; - } - } - } - - if (typeArgs.length && typeArgs.length !== typeParameters.length) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Generic_type_0_requires_1_type_argument_s, [genericTypeSymbol.toString(), genericTypeSymbol.getTypeParameters().length])); - return this.getNewErrorTypeSymbol(); - } - - if (!genericTypeSymbol.isResolved) { - var typeDecls = genericTypeSymbol.getDeclarations(); - var childDecls = null; - - for (var i = 0; i < typeDecls.length; i++) { - childDecls = typeDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - } - - var specializedSymbol = this.createInstantiatedType(genericTypeSymbol, typeArgs); - - var typeConstraint = null; - var upperBound = null; - - typeParameters = specializedSymbol.getTypeParameters(); - - var typeConstraintSubstitutionMap = []; - var typeArg = null; - - var instantiatedSubstitutionMap = specializedSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < typeParameters.length; i++) { - typeConstraintSubstitutionMap[typeParameters[i].pullSymbolID] = typeParameters[i]; - } - - for (var id in instantiatedSubstitutionMap) { - typeConstraintSubstitutionMap[id] = instantiatedSubstitutionMap[id]; - } - - for (var iArg = 0; (iArg < typeArgs.length) && (iArg < typeParameters.length); iArg++) { - typeArg = typeArgs[iArg]; - typeConstraint = typeParameters[iArg].getConstraint(); - - typeConstraintSubstitutionMap[typeParameters[iArg].pullSymbolID] = typeArg; - - if (typeConstraint) { - if (typeConstraint.isTypeParameter()) { - for (var j = 0; j < typeParameters.length && j < typeArgs.length; j++) { - if (typeParameters[j] === typeConstraint) { - typeConstraint = typeArgs[j]; - } - } - } else if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeConstraintSubstitutionMap); - } - - if (typeArg.isTypeParameter()) { - upperBound = typeArg.getConstraint(); - - if (upperBound) { - typeArg = upperBound; - } - } - - if (typeArg.inResolution || (typeArg.isTypeReference() && typeArg.referencedTypeSymbol.inResolution)) { - return specializedSymbol; - } - - if (!this.sourceIsAssignableToTarget(typeArg, typeConstraint, genericTypeAST, context)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(genericTypeAST); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [typeArg.toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[iArg].toString(enclosingSymbol, true)])); - } - } - } - - return specializedSymbol; - }; - - PullTypeResolver.prototype.resolveQualifiedName = function (dottedNameAST, context) { - if (this.inTypeQuery(dottedNameAST)) { - return this.resolveDottedNameExpression(dottedNameAST, dottedNameAST.left, dottedNameAST.right, context).type; - } - - var symbol = this.getSymbolForAST(dottedNameAST, context); - if (!symbol || this.canTypeCheckAST(dottedNameAST, context)) { - var canTypeCheck = this.canTypeCheckAST(dottedNameAST, context); - if (canTypeCheck) { - this.setTypeChecked(dottedNameAST, context); - } - - symbol = this.computeQualifiedName(dottedNameAST, context); - this.setSymbolForAST(dottedNameAST, symbol, context); - } - - this.resolveDeclaredSymbol(symbol, context); - - return symbol; - }; - - PullTypeResolver.prototype.isLastNameOfModuleNameModuleReference = function (ast) { - return ast.kind() === 11 /* IdentifierName */ && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast && ast.parent.parent && ast.parent.parent.kind() === 246 /* ModuleNameModuleReference */; - }; - - PullTypeResolver.prototype.computeQualifiedName = function (dottedNameAST, context) { - var rhsName = dottedNameAST.right.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var enclosingDecl = this.getEnclosingDeclForAST(dottedNameAST); - var lhs = this.resolveAST(dottedNameAST.left, false, context); - - var lhsType = lhs.isAlias() ? lhs.getExportAssignedContainerSymbol() : lhs.type; - - if (this.inClassExtendsHeritageClause(dottedNameAST) && !this.inTypeArgumentList(dottedNameAST)) { - if (lhs.isAlias()) { - lhs.setIsUsedAsValue(); - } - } - - if (!lhsType) { - return this.getNewErrorTypeSymbol(); - } - - if (this.isAnyOrEquivalent(lhsType)) { - return lhsType; - } - - var onLeftOfDot = this.isLeftSideOfQualifiedName(dottedNameAST); - var isNameOfModule = dottedNameAST.parent.kind() === 130 /* ModuleDeclaration */ && dottedNameAST.parent.name === dottedNameAST; - - var memberKind = (onLeftOfDot || isNameOfModule) ? 164 /* SomeContainer */ : 58728795 /* SomeType */; - - var childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, lhsType); - - if (!childTypeSymbol && !isNameOfModule && this.isLastNameOfModuleNameModuleReference(dottedNameAST.right)) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, lhsType); - } - - if (!childTypeSymbol && lhsType.isContainer()) { - var exportedContainer = lhsType.getExportAssignedContainerSymbol(); - - if (exportedContainer) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, exportedContainer); - } - } - - if (!childTypeSymbol && enclosingDecl) { - var parentDecl = enclosingDecl; - - while (parentDecl) { - if (parentDecl.kind & 164 /* SomeContainer */) { - break; - } - - parentDecl = parentDecl.getParentDecl(); - } - - if (parentDecl) { - var enclosingSymbolType = parentDecl.getSymbol().type; - - if (enclosingSymbolType === lhsType) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, lhsType); - } - } - } - - if (!childTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(dottedNameAST.right, TypeScript.DiagnosticCode.The_property_0_does_not_exist_on_value_of_type_1, [dottedNameAST.right.text(), lhsType.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - return this.getNewErrorTypeSymbol(rhsName); - } - - return childTypeSymbol; - }; - - PullTypeResolver.prototype.shouldContextuallyTypeAnyFunctionExpression = function (functionExpressionAST, typeParameters, parameters, returnTypeAnnotation, context) { - if (typeParameters && typeParameters.typeParameters.nonSeparatorCount() > 0) { - return false; - } - - if (returnTypeAnnotation) { - return false; - } - - if (parameters) { - for (var i = 0, n = parameters.length; i < n; i++) { - if (parameters.typeAt(i)) { - return false; - } - } - } - - var contextualFunctionTypeSymbol = context.getContextualType(); - - if (contextualFunctionTypeSymbol) { - this.resolveDeclaredSymbol(contextualFunctionTypeSymbol, context); - var callSignatures = contextualFunctionTypeSymbol.getCallSignatures(); - var exactlyOneCallSignature = callSignatures && callSignatures.length === 1; - if (!exactlyOneCallSignature) { - return false; - } - - var callSignatureIsGeneric = callSignatures[0].getTypeParameters().length > 0; - return !callSignatureIsGeneric; - } - - return false; - }; - - PullTypeResolver.prototype.resolveAnyFunctionExpression = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context) { - var funcDeclSymbol = null; - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - TypeScript.Debug.assert(functionDecl); - - if (functionDecl && functionDecl.hasSymbol()) { - funcDeclSymbol = functionDecl.getSymbol(); - if (funcDeclSymbol.isResolved || funcDeclSymbol.inResolution) { - return funcDeclSymbol; - } - } - - funcDeclSymbol = functionDecl.getSymbol(); - TypeScript.Debug.assert(funcDeclSymbol); - - var funcDeclType = funcDeclSymbol.type; - var signature = funcDeclType.getCallSignatures()[0]; - funcDeclSymbol.startResolving(); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - var assigningFunctionSignature = null; - if (isContextuallyTyped && this.shouldContextuallyTypeAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, context)) { - assigningFunctionSignature = context.getContextualType().getCallSignatures()[0]; - } - - this.resolveAnyFunctionExpressionParameters(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context); - - if (returnTypeAnnotation) { - signature.returnType = this.resolveTypeReference(returnTypeAnnotation, context); - } else { - if (assigningFunctionSignature) { - var returnType = assigningFunctionSignature.returnType; - - if (returnType) { - context.propagateContextualType(returnType); - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, bodyExpression, signature, true, functionDecl, context); - context.popAnyContextualType(); - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (this.compilationSettings.noImplicitAny()) { - var functionExpressionName = functionDecl.getFunctionExpressionName(); - - if (functionExpressionName != "") { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [functionExpressionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } - } else { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, bodyExpression, signature, false, functionDecl, context); - } - } - - context.setTypeInContext(funcDeclSymbol, funcDeclType); - funcDeclSymbol.setResolved(); - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context); - } - - return funcDeclSymbol; - }; - - PullTypeResolver.prototype.resolveAnyFunctionExpressionParameters = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context) { - if (!parameters) { - return; - } - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var contextParams = []; - - var assigningFunctionSignature = null; - if (isContextuallyTyped && this.shouldContextuallyTypeAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, context)) { - assigningFunctionSignature = context.getContextualType().getCallSignatures()[0]; - } - - if (assigningFunctionSignature) { - contextParams = assigningFunctionSignature.parameters; - } - - var contextualParametersCount = contextParams.length; - for (var i = 0, n = parameters.length; i < n; i++) { - var actualParameterIsVarArgParameter = (i === (n - 1)) && parameters.lastParameterIsRest(); - var correspondingContextualParameter = null; - var contextualParameterType = null; - - if (i < contextualParametersCount) { - correspondingContextualParameter = contextParams[i]; - } else if (contextualParametersCount && contextParams[contextualParametersCount - 1].isVarArg) { - correspondingContextualParameter = contextParams[contextualParametersCount - 1]; - } - - if (correspondingContextualParameter) { - if (correspondingContextualParameter.isVarArg === actualParameterIsVarArgParameter) { - contextualParameterType = correspondingContextualParameter.type; - } else if (correspondingContextualParameter.isVarArg) { - contextualParameterType = correspondingContextualParameter.type.getElementType(); - } - } - - this.resolveFunctionExpressionParameter(parameters.astAt(i), parameters.identifierAt(i), parameters.typeAt(i), parameters.initializerAt(i), contextualParameterType, functionDecl, context); - } - }; - - PullTypeResolver.prototype.typeCheckSimpleArrowFunctionExpression = function (arrowFunction, isContextuallyTyped, context) { - return this.typeCheckAnyFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromIdentifier(arrowFunction.identifier), null, arrowFunction.block, arrowFunction.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckParenthesizedArrowFunctionExpression = function (arrowFunction, isContextuallyTyped, context) { - return this.typeCheckAnyFunctionExpression(arrowFunction, arrowFunction.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), TypeScript.ASTHelpers.getType(arrowFunction), arrowFunction.block, arrowFunction.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckAnyFunctionExpression = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcDeclSymbol = functionDecl.getSymbol(); - var funcDeclType = funcDeclSymbol.type; - var signature = funcDeclType.getCallSignatures()[0]; - var returnTypeSymbol = signature.returnType; - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - this.resolveAnyFunctionExpressionParameters(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context); - - context.pushNewContextualType(null); - if (block) { - this.resolveAST(block, false, context); - } else { - var bodyExpressionType = this.resolveReturnExpression(bodyExpression, functionDecl, context); - this.typeCheckReturnExpression(bodyExpression, bodyExpressionType, functionDecl, context); - } - - context.popAnyContextualType(); - - this.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement(functionDecl, returnTypeAnnotation, returnTypeSymbol, block, context); - - this.validateVariableDeclarationGroups(functionDecl, context); - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.resolveThisExpression = function (thisExpression, context) { - var enclosingDecl = this.getEnclosingDeclForAST(thisExpression); - var thisTypeSymbol = this.getContextualClassSymbolForEnclosingDecl(thisExpression, enclosingDecl) || this.semanticInfoChain.anyTypeSymbol; - - if (this.canTypeCheckAST(thisExpression, context)) { - this.typeCheckThisExpression(thisExpression, context, enclosingDecl); - } - - return thisTypeSymbol; - }; - - PullTypeResolver.prototype.inTypeArgumentList = function (ast) { - var previous = null; - var current = ast; - - while (current) { - switch (current.kind()) { - case 126 /* GenericType */: - var genericType = current; - if (genericType.typeArgumentList === previous) { - return true; - } - break; - - case 226 /* ArgumentList */: - var argumentList = current; - return argumentList.typeArgumentList === previous; - } - - previous = current; - current = current.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inClassExtendsHeritageClause = function (ast) { - while (ast) { - switch (ast.kind()) { - case 230 /* ExtendsHeritageClause */: - var heritageClause = ast; - - return heritageClause.parent.parent.kind() === 131 /* ClassDeclaration */; - - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inTypeQuery = function (ast) { - while (ast) { - switch (ast.kind()) { - case 127 /* TypeQuery */: - return true; - case 129 /* FunctionDeclaration */: - case 213 /* InvocationExpression */: - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inArgumentListOfSuperInvocation = function (ast) { - var previous = null; - var current = ast; - while (current) { - switch (current.kind()) { - case 213 /* InvocationExpression */: - var invocationExpression = current; - if (previous === invocationExpression.argumentList && invocationExpression.expression.kind() === 50 /* SuperKeyword */) { - return true; - } - break; - - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - previous = current; - current = current.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inConstructorParameterList = function (ast) { - var previous = null; - var current = ast; - while (current) { - switch (current.kind()) { - case 142 /* CallSignature */: - var callSignature = current; - if (previous === callSignature.parameterList && callSignature.parent.kind() === 137 /* ConstructorDeclaration */) { - return true; - } - - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - previous = current; - current = current.parent; - } - - return false; - }; - PullTypeResolver.prototype.isFunctionAccessorOrNonArrowFunctionExpression = function (decl) { - if (decl.kind === 262144 /* GetAccessor */ || decl.kind === 524288 /* SetAccessor */) { - return true; - } - - return this.isFunctionOrNonArrowFunctionExpression(decl); - }; - - PullTypeResolver.prototype.isFunctionOrNonArrowFunctionExpression = function (decl) { - if (decl.kind === 16384 /* Function */) { - return true; - } else if (decl.kind === 131072 /* FunctionExpression */ && !TypeScript.hasFlag(decl.flags, 8192 /* ArrowFunction */)) { - return true; - } - - return false; - }; - - PullTypeResolver.prototype.typeCheckThisExpression = function (thisExpression, context, enclosingDecl) { - this.checkForThisCaptureInArrowFunction(thisExpression); - - if (this.inConstructorParameterList(thisExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_constructor_arguments)); - return; - } - - for (var currentDecl = enclosingDecl; currentDecl !== null; currentDecl = currentDecl.getParentDecl()) { - if (this.isFunctionAccessorOrNonArrowFunctionExpression(currentDecl)) { - return; - } else if (currentDecl.kind === 4 /* Container */ || currentDecl.kind === 32 /* DynamicModule */) { - if (currentDecl.getParentDecl() === null) { - return; - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_within_module_bodies)); - return; - } - } else if (currentDecl.kind === 64 /* Enum */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_current_location)); - return; - } else if (currentDecl.kind === 32768 /* ConstructorMethod */) { - if (this.inArgumentListOfSuperInvocation(thisExpression) && this.superCallMustBeFirstStatementInConstructor(currentDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_current_location)); - } - - return; - } else if (currentDecl.kind === 8 /* Class */) { - if (this.inStaticMemberVariableDeclaration(thisExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_static_initializers_in_a_class_body)); - } - - return; - } - } - }; - - PullTypeResolver.prototype.getContextualClassSymbolForEnclosingDecl = function (ast, enclosingDecl) { - var declPath = enclosingDecl.getParentPath(); - - if (declPath.length) { - var isStaticContext = false; - - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - var declFlags = decl.flags; - - if (declFlags & 16 /* Static */) { - isStaticContext = true; - } else if (declKind === 131072 /* FunctionExpression */ && !TypeScript.hasFlag(declFlags, 8192 /* ArrowFunction */)) { - return null; - } else if (declKind === 16384 /* Function */) { - return null; - } else if (declKind === 8 /* Class */) { - if (this.inStaticMemberVariableDeclaration(ast)) { - return this.getNewErrorTypeSymbol(); - } else { - var classSymbol = decl.getSymbol(); - if (isStaticContext) { - var constructorSymbol = classSymbol.getConstructorMethod(); - return constructorSymbol.type; - } else { - return classSymbol; - } - } - } - } - } - - return null; - }; - - PullTypeResolver.prototype.inStaticMemberVariableDeclaration = function (ast) { - while (ast) { - if (ast.kind() === 136 /* MemberVariableDeclaration */ && TypeScript.hasModifier(ast.modifiers, 16 /* Static */)) { - return true; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.resolveSuperExpression = function (ast, context) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - var superType = this.semanticInfoChain.anyTypeSymbol; - - var classSymbol = this.getContextualClassSymbolForEnclosingDecl(ast, enclosingDecl); - - if (classSymbol) { - this.resolveDeclaredSymbol(classSymbol, context); - - var parents = classSymbol.getExtendedTypes(); - - if (parents.length) { - superType = parents[0]; - } - } - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckSuperExpression(ast, context, enclosingDecl); - } - - return superType; - }; - - PullTypeResolver.prototype.typeCheckSuperExpression = function (ast, context, enclosingDecl) { - this.setTypeChecked(ast, context); - - this.checkForThisCaptureInArrowFunction(ast); - - var isSuperCall = ast.parent.kind() === 213 /* InvocationExpression */; - var isSuperPropertyAccess = ast.parent.kind() === 212 /* MemberAccessExpression */; - TypeScript.Debug.assert(isSuperCall || isSuperPropertyAccess); - - if (isSuperPropertyAccess) { - for (var currentDecl = enclosingDecl; currentDecl !== null; currentDecl = currentDecl.getParentDecl()) { - if (this.isFunctionOrNonArrowFunctionExpression(currentDecl)) { - break; - } else if (currentDecl.kind === 8 /* Class */) { - if (!this.enclosingClassIsDerived(currentDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_non_derived_classes)); - return; - } else if (this.inConstructorParameterList(ast)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_constructor_arguments)); - return; - } else if (this.inStaticMemberVariableDeclaration(ast)) { - break; - } - - return; - } - } - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class)); - return; - } else { - if (enclosingDecl.kind === 32768 /* ConstructorMethod */) { - var classDecl = enclosingDecl.getParentDecl(); - - if (!this.enclosingClassIsDerived(classDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_non_derived_classes)); - return; - } else if (this.inConstructorParameterList(ast)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_constructor_arguments)); - return; - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors)); - } - } - }; - - PullTypeResolver.prototype.resolveSimplePropertyAssignment = function (propertyAssignment, isContextuallyTyped, context) { - return this.resolveAST(propertyAssignment.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveFunctionPropertyAssignment = function (funcProp, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcProp, funcProp.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcProp), funcProp.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckFunctionPropertyAssignment = function (funcProp, isContextuallyTyped, context) { - this.typeCheckAnyFunctionExpression(funcProp, funcProp.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcProp), funcProp.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveObjectLiteralExpression = function (expressionAST, isContextuallyTyped, context, additionalResults) { - var symbol = this.getSymbolForAST(expressionAST, context); - var hasResolvedSymbol = symbol && symbol.isResolved; - - if (!hasResolvedSymbol || additionalResults || this.canTypeCheckAST(expressionAST, context)) { - if (this.canTypeCheckAST(expressionAST, context)) { - this.setTypeChecked(expressionAST, context); - } - symbol = this.computeObjectLiteralExpression(expressionAST, isContextuallyTyped, context, additionalResults); - this.setSymbolForAST(expressionAST, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.bindObjectLiteralMembers = function (objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralMembers, isUsingExistingSymbol, pullTypeContext) { - var boundMemberSymbols = []; - var memberSymbol; - for (var i = 0, len = objectLiteralMembers.nonSeparatorCount(); i < len; i++) { - var propertyAssignment = objectLiteralMembers.nonSeparatorAt(i); - - var id = this.getPropertyAssignmentName(propertyAssignment); - var assignmentText = getPropertyAssignmentNameTextFromIdentifier(id); - - var isAccessor = propertyAssignment.kind() === 139 /* GetAccessor */ || propertyAssignment.kind() === 140 /* SetAccessor */; - var decl = this.semanticInfoChain.getDeclForAST(propertyAssignment); - TypeScript.Debug.assert(decl); - - if (propertyAssignment.kind() === 240 /* SimplePropertyAssignment */) { - if (!isUsingExistingSymbol) { - memberSymbol = new TypeScript.PullSymbol(assignmentText.memberName, 4096 /* Property */); - memberSymbol.addDeclaration(decl); - decl.setSymbol(memberSymbol); - } else { - memberSymbol = decl.getSymbol(); - } - } else if (propertyAssignment.kind() === 241 /* FunctionPropertyAssignment */) { - memberSymbol = decl.getSymbol(); - } else { - TypeScript.Debug.assert(isAccessor); - memberSymbol = decl.getSymbol(); - } - - if (!isUsingExistingSymbol && !isAccessor) { - var existingMember = objectLiteralTypeSymbol.findMember(memberSymbol.name, true); - if (existingMember) { - pullTypeContext.postDiagnostic(this.semanticInfoChain.duplicateIdentifierDiagnosticFromAST(propertyAssignment, assignmentText.actualText, existingMember.getDeclarations()[0].ast())); - } - - objectLiteralTypeSymbol.addMember(memberSymbol); - } - - boundMemberSymbols.push(memberSymbol); - } - - return boundMemberSymbols; - }; - - PullTypeResolver.prototype.resolveObjectLiteralMembers = function (objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralContextualType, objectLiteralMembers, stringIndexerSignature, numericIndexerSignature, allMemberTypes, allNumericMemberTypes, boundMemberSymbols, isUsingExistingSymbol, pullTypeContext, additionalResults) { - for (var i = 0, len = objectLiteralMembers.nonSeparatorCount(); i < len; i++) { - var propertyAssignment = objectLiteralMembers.nonSeparatorAt(i); - - var acceptedContextualType = false; - var assigningSymbol = null; - - var id = this.getPropertyAssignmentName(propertyAssignment); - var memberSymbol = boundMemberSymbols[i]; - var contextualMemberType = null; - - if (objectLiteralContextualType) { - assigningSymbol = this.getNamedPropertySymbol(memberSymbol.name, 68147712 /* SomeValue */, objectLiteralContextualType); - - if (!assigningSymbol) { - if (numericIndexerSignature && TypeScript.PullHelpers.isNameNumeric(memberSymbol.name)) { - assigningSymbol = numericIndexerSignature; - } else if (stringIndexerSignature) { - assigningSymbol = stringIndexerSignature; - } - } - - if (assigningSymbol) { - this.resolveDeclaredSymbol(assigningSymbol, pullTypeContext); - - contextualMemberType = assigningSymbol.kind === 4194304 /* IndexSignature */ ? assigningSymbol.returnType : assigningSymbol.type; - pullTypeContext.propagateContextualType(contextualMemberType); - - acceptedContextualType = true; - - if (additionalResults) { - additionalResults.membersContextTypeSymbols[i] = contextualMemberType; - } - } - } - - var memberSymbolType = this.resolveAST(propertyAssignment, contextualMemberType !== null, pullTypeContext).type; - - if (memberSymbolType) { - if (memberSymbolType.isGeneric()) { - objectLiteralTypeSymbol.setHasGenericMember(); - } - - if (stringIndexerSignature) { - allMemberTypes.push(memberSymbolType); - } - if (numericIndexerSignature && TypeScript.PullHelpers.isNameNumeric(memberSymbol.name)) { - allNumericMemberTypes.push(memberSymbolType); - } - } - - if (acceptedContextualType) { - pullTypeContext.popAnyContextualType(); - } - - var isAccessor = propertyAssignment.kind() === 140 /* SetAccessor */ || propertyAssignment.kind() === 139 /* GetAccessor */; - if (!memberSymbol.isResolved) { - if (isAccessor) { - this.setSymbolForAST(id, memberSymbolType, pullTypeContext); - } else { - pullTypeContext.setTypeInContext(memberSymbol, memberSymbolType); - memberSymbol.setResolved(); - - this.setSymbolForAST(id, memberSymbol, pullTypeContext); - } - } - } - }; - - PullTypeResolver.prototype.computeObjectLiteralExpression = function (objectLitAST, isContextuallyTyped, context, additionalResults) { - var objectLitDecl = this.semanticInfoChain.getDeclForAST(objectLitAST); - TypeScript.Debug.assert(objectLitDecl); - - var typeSymbol = this.getSymbolForAST(objectLitAST, context); - var isUsingExistingSymbol = !!typeSymbol; - - if (!typeSymbol) { - typeSymbol = new TypeScript.PullTypeSymbol("", 256 /* ObjectLiteral */); - typeSymbol.addDeclaration(objectLitDecl); - this.setSymbolForAST(objectLitAST, typeSymbol, context); - objectLitDecl.setSymbol(typeSymbol); - } - - var propertyAssignments = objectLitAST.propertyAssignments; - var contextualType = null; - - if (isContextuallyTyped) { - contextualType = context.getContextualType(); - this.resolveDeclaredSymbol(contextualType, context); - } - - var stringIndexerSignature = null; - var numericIndexerSignature = null; - var allMemberTypes = null; - var allNumericMemberTypes = null; - - if (contextualType) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(contextualType, context); - - stringIndexerSignature = indexSignatures.stringSignature; - numericIndexerSignature = indexSignatures.numericSignature; - - var inInferentialTyping = context.isInferentiallyTyping(); - if (stringIndexerSignature) { - allMemberTypes = inInferentialTyping ? [] : [stringIndexerSignature.returnType]; - } - - if (numericIndexerSignature) { - allNumericMemberTypes = inInferentialTyping ? [] : [numericIndexerSignature.returnType]; - } - } - - if (propertyAssignments) { - if (additionalResults) { - additionalResults.membersContextTypeSymbols = []; - } - - var boundMemberSymbols = this.bindObjectLiteralMembers(objectLitDecl, typeSymbol, propertyAssignments, isUsingExistingSymbol, context); - - this.resolveObjectLiteralMembers(objectLitDecl, typeSymbol, contextualType, propertyAssignments, stringIndexerSignature, numericIndexerSignature, allMemberTypes, allNumericMemberTypes, boundMemberSymbols, isUsingExistingSymbol, context, additionalResults); - - if (!isUsingExistingSymbol) { - this.stampObjectLiteralWithIndexSignature(typeSymbol, allMemberTypes, stringIndexerSignature, context); - this.stampObjectLiteralWithIndexSignature(typeSymbol, allNumericMemberTypes, numericIndexerSignature, context); - } - } - - typeSymbol.setResolved(); - return typeSymbol; - }; - - PullTypeResolver.prototype.getPropertyAssignmentName = function (propertyAssignment) { - if (propertyAssignment.kind() === 240 /* SimplePropertyAssignment */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 241 /* FunctionPropertyAssignment */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 139 /* GetAccessor */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 140 /* SetAccessor */) { - return propertyAssignment.propertyName; - } else { - TypeScript.Debug.assert(false); - } - }; - - PullTypeResolver.prototype.stampObjectLiteralWithIndexSignature = function (objectLiteralSymbol, indexerTypeCandidates, contextualIndexSignature, context) { - if (contextualIndexSignature) { - var typeCollection = { - getLength: function () { - return indexerTypeCandidates.length; - }, - getTypeAtIndex: function (index) { - return indexerTypeCandidates[index]; - } - }; - var decl = objectLiteralSymbol.getDeclarations()[0]; - var indexerReturnType = this.findBestCommonType(typeCollection, context).widenedType(this, null, context); - if (indexerReturnType === contextualIndexSignature.returnType) { - objectLiteralSymbol.addIndexSignature(contextualIndexSignature); - } else { - this.semanticInfoChain.addSyntheticIndexSignature(decl, objectLiteralSymbol, this.getASTForDecl(decl), contextualIndexSignature.parameters[0].name, contextualIndexSignature.parameters[0].type, indexerReturnType); - } - } - }; - - PullTypeResolver.prototype.resolveArrayLiteralExpression = function (arrayLit, isContextuallyTyped, context) { - var symbol = this.getSymbolForAST(arrayLit, context); - if (!symbol || this.canTypeCheckAST(arrayLit, context)) { - if (this.canTypeCheckAST(arrayLit, context)) { - this.setTypeChecked(arrayLit, context); - } - symbol = this.computeArrayLiteralExpressionSymbol(arrayLit, isContextuallyTyped, context); - this.setSymbolForAST(arrayLit, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.computeArrayLiteralExpressionSymbol = function (arrayLit, isContextuallyTyped, context) { - var elements = arrayLit.expressions; - var elementType = null; - var elementTypes = []; - var comparisonInfo = new TypeComparisonInfo(); - var contextualElementType = null; - comparisonInfo.onlyCaptureFirstError = true; - - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - - this.resolveDeclaredSymbol(contextualType, context); - - if (contextualType) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(contextualType, context); - if (indexSignatures.numericSignature) { - contextualElementType = indexSignatures.numericSignature.returnType; - } - } - } - - if (elements) { - if (contextualElementType) { - context.propagateContextualType(contextualElementType); - } - - for (var i = 0, n = elements.nonSeparatorCount(); i < n; i++) { - elementTypes.push(this.resolveAST(elements.nonSeparatorAt(i), contextualElementType !== null, context).type); - } - - if (contextualElementType) { - context.popAnyContextualType(); - } - } - - if (elementTypes.length) { - elementType = elementTypes[0]; - } - var collection; - - if (contextualElementType && !context.isInferentiallyTyping()) { - if (!elementType) { - elementType = contextualElementType; - } - - collection = { - getLength: function () { - return elements.nonSeparatorCount() + 1; - }, - getTypeAtIndex: function (index) { - return index === 0 ? contextualElementType : elementTypes[index - 1]; - } - }; - } else { - collection = { - getLength: function () { - return elements.nonSeparatorCount(); - }, - getTypeAtIndex: function (index) { - return elementTypes[index]; - } - }; - } - - elementType = elementType ? this.findBestCommonType(collection, context, comparisonInfo) : elementType; - - if (!elementType) { - elementType = this.semanticInfoChain.undefinedTypeSymbol; - } - - return this.getArrayType(elementType); - }; - - PullTypeResolver.prototype.resolveElementAccessExpression = function (callEx, context) { - var symbolAndDiagnostic = this.computeElementAccessExpressionSymbolAndDiagnostic(callEx, context); - - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckElementAccessExpression(callEx, context, symbolAndDiagnostic); - } - - return symbolAndDiagnostic.symbol; - }; - - PullTypeResolver.prototype.typeCheckElementAccessExpression = function (callEx, context, symbolAndDiagnostic) { - this.setTypeChecked(callEx, context); - context.postDiagnostic(symbolAndDiagnostic.diagnostic); - }; - - PullTypeResolver.prototype.computeElementAccessExpressionSymbolAndDiagnostic = function (callEx, context) { - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var indexType = this.resolveAST(callEx.argumentExpression, false, context).type; - - var targetTypeSymbol = targetSymbol.type; - - targetTypeSymbol = this.getApparentType(targetTypeSymbol); - - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - return { symbol: targetTypeSymbol }; - } - - var elementType = targetTypeSymbol.getElementType(); - - var isNumberIndex = indexType === this.semanticInfoChain.numberTypeSymbol || TypeScript.PullHelpers.symbolIsEnum(indexType); - - if (elementType && isNumberIndex) { - return { symbol: elementType }; - } - - if (callEx.argumentExpression.kind() === 14 /* StringLiteral */ || callEx.argumentExpression.kind() === 13 /* NumericLiteral */) { - var memberName = callEx.argumentExpression.kind() === 14 /* StringLiteral */ ? TypeScript.stripStartAndEndQuotes(callEx.argumentExpression.text()) : callEx.argumentExpression.valueText(); - - var member = this._getNamedPropertySymbolOfAugmentedType(memberName, targetTypeSymbol); - - if (member) { - this.resolveDeclaredSymbol(member, context); - - return { symbol: member.type }; - } - } - - var signatures = this.getBothKindsOfIndexSignaturesIncludingAugmentedType(targetTypeSymbol, context); - - var stringSignature = signatures.stringSignature; - var numberSignature = signatures.numericSignature; - - if (numberSignature && (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol)) { - return { symbol: numberSignature.returnType || this.semanticInfoChain.anyTypeSymbol }; - } else if (stringSignature && (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol || indexType === this.semanticInfoChain.stringTypeSymbol)) { - return { symbol: stringSignature.returnType || this.semanticInfoChain.anyTypeSymbol }; - } else if (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol || indexType === this.semanticInfoChain.stringTypeSymbol) { - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(callEx.argumentExpression, TypeScript.DiagnosticCode.Index_signature_of_object_type_implicitly_has_an_any_type)); - } - return { symbol: this.semanticInfoChain.anyTypeSymbol }; - } else { - return { - symbol: this.getNewErrorTypeSymbol(), - diagnostic: this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Value_of_type_0_is_not_indexable_by_type_1, [targetTypeSymbol.toString(), indexType.toString()]) - }; - } - }; - - PullTypeResolver.prototype.getBothKindsOfIndexSignaturesIncludingAugmentedType = function (enclosingType, context) { - return this._getBothKindsOfIndexSignatures(enclosingType, context, true); - }; - - PullTypeResolver.prototype.getBothKindsOfIndexSignaturesExcludingAugmentedType = function (enclosingType, context) { - return this._getBothKindsOfIndexSignatures(enclosingType, context, false); - }; - - PullTypeResolver.prototype._getBothKindsOfIndexSignatures = function (enclosingType, context, includeAugmentedType) { - var signatures = includeAugmentedType ? enclosingType.getIndexSignaturesOfAugmentedType(this, this.cachedFunctionInterfaceType(), this.cachedObjectInterfaceType()) : enclosingType.getIndexSignatures(); - - var stringSignature = null; - var numberSignature = null; - var signature = null; - var paramSymbols; - var paramType; - - for (var i = 0; i < signatures.length; i++) { - if (stringSignature && numberSignature) { - break; - } - - signature = signatures[i]; - if (!signature.isResolved) { - this.resolveDeclaredSymbol(signature, context); - } - - paramSymbols = signature.parameters; - - if (paramSymbols.length) { - paramType = paramSymbols[0].type; - - if (!stringSignature && paramType === this.semanticInfoChain.stringTypeSymbol) { - stringSignature = signature; - continue; - } else if (!numberSignature && paramType === this.semanticInfoChain.numberTypeSymbol) { - numberSignature = signature; - continue; - } - } - } - - return { - numericSignature: numberSignature, - stringSignature: stringSignature - }; - }; - - PullTypeResolver.prototype._addUnhiddenSignaturesFromBaseType = function (derivedTypeSignatures, baseTypeSignatures, signaturesBeingAggregated) { - var _this = this; - if (!derivedTypeSignatures) { - signaturesBeingAggregated.push.apply(signaturesBeingAggregated, baseTypeSignatures); - return; - } - - var context = new TypeScript.PullTypeResolutionContext(this); - for (var i = 0; i < baseTypeSignatures.length; i++) { - var baseSignature = baseTypeSignatures[i]; - - var signatureIsHidden = TypeScript.ArrayUtilities.any(derivedTypeSignatures, function (sig) { - return _this.signaturesAreIdenticalWithNewEnclosingTypes(baseSignature, sig, context, false); - }); - - if (!signatureIsHidden) { - signaturesBeingAggregated.push(baseSignature); - } - } - }; - - PullTypeResolver.prototype.resolveBinaryAdditionOperation = function (binaryExpression, context) { - var lhsExpression = this.resolveAST(binaryExpression.left, false, context); - var lhsType = lhsExpression.type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - if (TypeScript.PullHelpers.symbolIsEnum(lhsType)) { - lhsType = this.semanticInfoChain.numberTypeSymbol; - } - - if (TypeScript.PullHelpers.symbolIsEnum(rhsType)) { - rhsType = this.semanticInfoChain.numberTypeSymbol; - } - - var isLhsTypeNullOrUndefined = lhsType === this.semanticInfoChain.nullTypeSymbol || lhsType === this.semanticInfoChain.undefinedTypeSymbol; - var isRhsTypeNullOrUndefined = rhsType === this.semanticInfoChain.nullTypeSymbol || rhsType === this.semanticInfoChain.undefinedTypeSymbol; - - if (isLhsTypeNullOrUndefined) { - if (isRhsTypeNullOrUndefined) { - lhsType = rhsType = this.semanticInfoChain.anyTypeSymbol; - } else { - lhsType = rhsType; - } - } else if (isRhsTypeNullOrUndefined) { - rhsType = lhsType; - } - - var exprType = null; - - if (lhsType === this.semanticInfoChain.stringTypeSymbol || rhsType === this.semanticInfoChain.stringTypeSymbol) { - exprType = this.semanticInfoChain.stringTypeSymbol; - } else if (this.isAnyOrEquivalent(lhsType) || this.isAnyOrEquivalent(rhsType)) { - exprType = this.semanticInfoChain.anyTypeSymbol; - } else if (rhsType === this.semanticInfoChain.numberTypeSymbol && lhsType === this.semanticInfoChain.numberTypeSymbol) { - exprType = this.semanticInfoChain.numberTypeSymbol; - } - - if (this.canTypeCheckAST(binaryExpression, context)) { - this.setTypeChecked(binaryExpression, context); - - if (exprType) { - if (binaryExpression.kind() === 175 /* AddAssignmentExpression */) { - if (!this.isReference(binaryExpression.left, lhsExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } - - this.checkAssignability(binaryExpression.left, exprType, lhsType, context); - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_expression_types_not_known_to_support_the_addition_operator)); - } - } - - if (!exprType) { - exprType = this.semanticInfoChain.anyTypeSymbol; - } - - return exprType; - }; - - PullTypeResolver.prototype.bestCommonTypeOfTwoTypes = function (type1, type2, context) { - return this.findBestCommonType({ - getLength: function () { - return 2; - }, - getTypeAtIndex: function (index) { - switch (index) { - case 0: - return type1; - case 1: - return type2; - } - } - }, context); - }; - - PullTypeResolver.prototype.bestCommonTypeOfThreeTypes = function (type1, type2, type3, context) { - return this.findBestCommonType({ - getLength: function () { - return 3; - }, - getTypeAtIndex: function (index) { - switch (index) { - case 0: - return type1; - case 1: - return type2; - case 2: - return type3; - } - } - }, context); - }; - - PullTypeResolver.prototype.resolveLogicalOrExpression = function (binex, isContextuallyTyped, context) { - if (this.canTypeCheckAST(binex, context)) { - this.setTypeChecked(binex, context); - } - - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - var leftType = this.resolveAST(binex.left, isContextuallyTyped, context).type; - var rightType = this.resolveAST(binex.right, isContextuallyTyped, context).type; - - return context.isInferentiallyTyping() ? this.bestCommonTypeOfTwoTypes(leftType, rightType, context) : this.bestCommonTypeOfThreeTypes(contextualType, leftType, rightType, context); - } else { - var leftType = this.resolveAST(binex.left, false, context).type; - - context.pushNewContextualType(leftType); - var rightType = this.resolveAST(binex.right, true, context).type; - context.popAnyContextualType(); - - return this.bestCommonTypeOfTwoTypes(leftType, rightType, context); - } - }; - - PullTypeResolver.prototype.resolveLogicalAndExpression = function (binex, context) { - if (this.canTypeCheckAST(binex, context)) { - this.setTypeChecked(binex, context); - - this.resolveAST(binex.left, false, context); - } - - return this.resolveAST(binex.right, false, context).type; - }; - - PullTypeResolver.prototype.computeTypeOfConditionalExpression = function (leftType, rightType, isContextuallyTyped, context) { - if (isContextuallyTyped && !context.isInferentiallyTyping()) { - var contextualType = context.getContextualType(); - return this.bestCommonTypeOfThreeTypes(contextualType, leftType, rightType, context); - } else { - return this.bestCommonTypeOfTwoTypes(leftType, rightType, context); - } - }; - - PullTypeResolver.prototype.resolveConditionalExpression = function (trinex, isContextuallyTyped, context) { - var leftType = this.resolveAST(trinex.whenTrue, isContextuallyTyped, context).type; - var rightType = this.resolveAST(trinex.whenFalse, isContextuallyTyped, context).type; - - var expressionType = this.computeTypeOfConditionalExpression(leftType, rightType, isContextuallyTyped, context); - - var conditionalTypesAreValid = this.conditionExpressionTypesAreValid(leftType, rightType, expressionType, isContextuallyTyped, context); - - if (this.canTypeCheckAST(trinex, context)) { - this.setTypeChecked(trinex, context); - this.resolveAST(trinex.condition, false, context); - - if (!this.conditionExpressionTypesAreValid(leftType, rightType, expressionType, isContextuallyTyped, context)) { - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(trinex, TypeScript.DiagnosticCode.Type_of_conditional_0_must_be_identical_to_1_2_or_3, [expressionType.toString(), leftType.toString(), rightType.toString(), contextualType.toString()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(trinex, TypeScript.DiagnosticCode.Type_of_conditional_0_must_be_identical_to_1_or_2, [expressionType.toString(), leftType.toString(), rightType.toString()])); - } - } - } - - if (!conditionalTypesAreValid) { - return this.getNewErrorTypeSymbol(); - } - - return expressionType; - }; - - PullTypeResolver.prototype.conditionExpressionTypesAreValid = function (leftType, rightType, expressionType, isContextuallyTyped, context) { - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - if (this.typesAreIdentical(expressionType, leftType, context) || this.typesAreIdentical(expressionType, rightType, context) || this.typesAreIdentical(expressionType, contextualType, context)) { - return true; - } - } else { - if (this.typesAreIdentical(expressionType, leftType, context) || this.typesAreIdentical(expressionType, rightType, context)) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.resolveParenthesizedExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - } - - return this.resolveAST(ast.expression, false, context); - }; - - PullTypeResolver.prototype.resolveExpressionStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveInvocationExpression = function (callEx, context, additionalResults) { - var symbol = this.getSymbolForAST(callEx, context); - - if (!symbol || !symbol.isResolved) { - if (!additionalResults) { - additionalResults = new PullAdditionalCallResolutionData(); - } - symbol = this.computeInvocationExpressionSymbol(callEx, context, additionalResults); - if (this.canTypeCheckAST(callEx, context)) { - this.setTypeChecked(callEx, context); - } - if (symbol !== this.semanticInfoChain.anyTypeSymbol) { - this.setSymbolForAST(callEx, symbol, context); - } - this.semanticInfoChain.setCallResolutionDataForAST(callEx, additionalResults); - } else { - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckInvocationExpression(callEx, context); - } - - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (additionalResults && (callResolutionData !== additionalResults)) { - additionalResults.actualParametersContextTypeSymbols = callResolutionData.actualParametersContextTypeSymbols; - additionalResults.candidateSignature = callResolutionData.candidateSignature; - additionalResults.resolvedSignatures = callResolutionData.resolvedSignatures; - additionalResults.targetSymbol = callResolutionData.targetSymbol; - } - } - - return symbol; - }; - - PullTypeResolver.prototype.typeCheckInvocationExpression = function (callEx, context) { - this.setTypeChecked(callEx, context); - var targetSymbol = this.resolveAST(callEx.expression, false, context); - - if (callEx.argumentList.arguments) { - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - - var len = callEx.argumentList.arguments.nonSeparatorCount(); - for (var i = 0; i < len; i++) { - var contextualType = callResolutionData.actualParametersContextTypeSymbols ? callResolutionData.actualParametersContextTypeSymbols[i] : null; - if (contextualType) { - context.pushNewContextualType(contextualType); - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - for (var i = 0; i < callResolutionData.diagnosticsFromOverloadResolution.length; i++) { - context.postDiagnostic(callResolutionData.diagnosticsFromOverloadResolution[i]); - } - }; - - PullTypeResolver.prototype.computeInvocationExpressionSymbol = function (callEx, context, additionalResults) { - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var targetAST = this.getCallTargetErrorSpanAST(callEx); - - var targetTypeSymbol = targetSymbol.type; - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - this.resolveAST(callEx.argumentList.arguments, false, context); - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - if (targetTypeSymbol === this.semanticInfoChain.anyTypeSymbol) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Untyped_function_calls_may_not_accept_type_arguments), additionalResults, context); - return this.getNewErrorTypeSymbol(); - } - } - - return this.semanticInfoChain.anyTypeSymbol; - } - - var isSuperCall = false; - - if (callEx.expression.kind() === 50 /* SuperKeyword */) { - isSuperCall = true; - - if (targetTypeSymbol.isClass()) { - targetSymbol = targetTypeSymbol.getConstructorMethod(); - this.resolveDeclaredSymbol(targetSymbol, context); - targetTypeSymbol = targetSymbol.type; - } else { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Calls_to_super_are_only_valid_inside_a_class), additionalResults, context); - this.resolveAST(callEx.argumentList.arguments, false, context); - - return this.getNewErrorTypeSymbol(); - } - } - - var signatures = isSuperCall ? targetTypeSymbol.getConstructSignatures() : targetTypeSymbol.getCallSignatures(); - - if (!signatures.length && (targetTypeSymbol.kind === 33554432 /* ConstructorType */)) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, [targetTypeSymbol.toString()]), additionalResults, context); - } - - var explicitTypeArgs = null; - var couldNotFindGenericOverload = false; - var couldNotAssignToConstraint; - var constraintDiagnostic = null; - var typeArgumentCountDiagnostic = null; - var diagnostics = []; - - if (callEx.argumentList.typeArgumentList) { - explicitTypeArgs = []; - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - explicitTypeArgs[i] = this.resolveTypeReference(callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - } - } - } - - var triedToInferTypeArgs = false; - - var resolvedSignatures = []; - var inferredOrExplicitTypeArgs; - var specializedSignature; - var typeParameters; - var typeConstraint = null; - var beforeResolutionSignatures = signatures; - var targetTypeReplacementMap = targetTypeSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < signatures.length; i++) { - typeParameters = signatures[i].getTypeParameters(); - couldNotAssignToConstraint = false; - - if (signatures[i].isGeneric() && typeParameters.length) { - if (isSuperCall && targetTypeSymbol.isGeneric() && !callEx.argumentList.typeArgumentList) { - explicitTypeArgs = signatures[i].returnType.getTypeArguments(); - } - - if (explicitTypeArgs) { - if (explicitTypeArgs.length === typeParameters.length) { - inferredOrExplicitTypeArgs = explicitTypeArgs; - } else { - typeArgumentCountDiagnostic = typeArgumentCountDiagnostic || this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [typeParameters.length, explicitTypeArgs.length]); - continue; - } - } else { - TypeScript.Debug.assert(callEx.argumentList); - var typeArgumentInferenceContext = new TypeScript.InvocationTypeArgumentInferenceContext(this, context, signatures[i], callEx.argumentList.arguments); - inferredOrExplicitTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - triedToInferTypeArgs = true; - } - - TypeScript.Debug.assert(inferredOrExplicitTypeArgs && inferredOrExplicitTypeArgs.length == typeParameters.length); - - var mutableTypeReplacementMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(targetTypeReplacementMap ? targetTypeReplacementMap : []); - TypeScript.PullInstantiationHelpers.updateMutableTypeParameterArgumentMap(typeParameters, inferredOrExplicitTypeArgs, mutableTypeReplacementMap); - var typeReplacementMap = mutableTypeReplacementMap.typeParameterArgumentMap; - - if (explicitTypeArgs) { - for (var j = 0; j < typeParameters.length; j++) { - typeConstraint = typeParameters[j].getConstraint(); - - if (typeConstraint) { - if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeReplacementMap); - } - - if (!this.sourceIsAssignableToTarget(inferredOrExplicitTypeArgs[j], typeConstraint, targetAST, context, null, true)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(targetAST); - constraintDiagnostic = this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [inferredOrExplicitTypeArgs[j].toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[j].toString(enclosingSymbol, true)]); - couldNotAssignToConstraint = true; - } - - if (couldNotAssignToConstraint) { - break; - } - } - } - } - - if (couldNotAssignToConstraint) { - continue; - } - - specializedSignature = this.instantiateSignature(signatures[i], typeReplacementMap); - - if (specializedSignature) { - resolvedSignatures[resolvedSignatures.length] = specializedSignature; - } - } else { - if (!(callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount())) { - resolvedSignatures[resolvedSignatures.length] = signatures[i]; - } - } - } - - if (signatures.length && !resolvedSignatures.length) { - couldNotFindGenericOverload = true; - } - - signatures = resolvedSignatures; - - var errorCondition = null; - if (!signatures.length) { - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = beforeResolutionSignatures; - additionalResults.candidateSignature = beforeResolutionSignatures && beforeResolutionSignatures.length ? beforeResolutionSignatures[0] : null; - - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - this.resolveAST(callEx.argumentList.arguments, false, context); - - if (!couldNotFindGenericOverload) { - if (this.cachedFunctionInterfaceType() && this.sourceIsAssignableToTarget(targetTypeSymbol, this.cachedFunctionInterfaceType(), targetAST, context)) { - if (callEx.argumentList.typeArgumentList) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Non_generic_functions_may_not_accept_type_arguments), additionalResults, context); - } - return this.semanticInfoChain.anyTypeSymbol; - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature), additionalResults, context); - } else if (constraintDiagnostic) { - this.postOverloadResolutionDiagnostics(constraintDiagnostic, additionalResults, context); - } else if (typeArgumentCountDiagnostic) { - this.postOverloadResolutionDiagnostics(typeArgumentCountDiagnostic, additionalResults, context); - } else { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Could_not_select_overload_for_call_expression), additionalResults, context); - } - - return this.getNewErrorTypeSymbol(); - } - - var signature = this.resolveOverloads(callEx, signatures, callEx.argumentList.typeArgumentList !== null, context, diagnostics); - var useBeforeResolutionSignatures = signature == null; - - if (!signature) { - for (var i = 0; i < diagnostics.length; i++) { - this.postOverloadResolutionDiagnostics(diagnostics[i], additionalResults, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Could_not_select_overload_for_call_expression), additionalResults, context); - - errorCondition = this.getNewErrorTypeSymbol(); - - if (!signatures.length) { - return errorCondition; - } - - signature = signatures[0]; - } - - var rootSignature = signature.getRootSymbol(); - if (!rootSignature.isGeneric() && callEx.argumentList.typeArgumentList) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Non_generic_functions_may_not_accept_type_arguments), additionalResults, context); - } else if (rootSignature.isGeneric() && callEx.argumentList.typeArgumentList && rootSignature.getTypeParameters() && (callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount() !== rootSignature.getTypeParameters().length)) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [rootSignature.getTypeParameters().length, callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()]), additionalResults, context); - } - - var returnType = isSuperCall ? this.semanticInfoChain.voidTypeSymbol : signature.returnType; - - var actualParametersContextTypeSymbols = []; - if (callEx.argumentList.arguments) { - var len = callEx.argumentList.arguments.nonSeparatorCount(); - var params = signature.parameters; - var contextualType = null; - var signatureDecl = signature.getDeclarations()[0]; - - for (var i = 0; i < len; i++) { - if (params.length) { - if (i < params.length - 1 || (i < params.length && !signature.hasVarArgs)) { - this.resolveDeclaredSymbol(params[i], context); - contextualType = params[i].type; - } else if (signature.hasVarArgs) { - contextualType = params[params.length - 1].type; - if (contextualType.isArrayNamedTypeReference()) { - contextualType = contextualType.getElementType(); - } - } - } - - if (contextualType) { - context.pushNewContextualType(contextualType); - actualParametersContextTypeSymbols[i] = contextualType; - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - additionalResults.targetSymbol = targetSymbol; - if (useBeforeResolutionSignatures && beforeResolutionSignatures) { - additionalResults.resolvedSignatures = beforeResolutionSignatures; - additionalResults.candidateSignature = beforeResolutionSignatures[0]; - } else { - additionalResults.resolvedSignatures = signatures; - additionalResults.candidateSignature = signature; - } - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - if (errorCondition) { - return errorCondition; - } - - if (!returnType) { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - - return returnType; - }; - - PullTypeResolver.prototype.resolveObjectCreationExpression = function (callEx, context, additionalResults) { - var symbol = this.getSymbolForAST(callEx, context); - - if (!symbol || !symbol.isResolved) { - if (!additionalResults) { - additionalResults = new PullAdditionalCallResolutionData(); - } - symbol = this.computeObjectCreationExpressionSymbol(callEx, context, additionalResults); - if (this.canTypeCheckAST(callEx, context)) { - this.setTypeChecked(callEx, context); - } - this.setSymbolForAST(callEx, symbol, context); - this.semanticInfoChain.setCallResolutionDataForAST(callEx, additionalResults); - } else { - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckObjectCreationExpression(callEx, context); - } - - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (additionalResults && (callResolutionData !== additionalResults)) { - additionalResults.actualParametersContextTypeSymbols = callResolutionData.actualParametersContextTypeSymbols; - additionalResults.candidateSignature = callResolutionData.candidateSignature; - additionalResults.resolvedSignatures = callResolutionData.resolvedSignatures; - additionalResults.targetSymbol = callResolutionData.targetSymbol; - } - } - - return symbol; - }; - - PullTypeResolver.prototype.typeCheckObjectCreationExpression = function (callEx, context) { - this.setTypeChecked(callEx, context); - this.resolveAST(callEx.expression, false, context); - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (callEx.argumentList) { - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - var len = callEx.argumentList.arguments.nonSeparatorCount(); - - for (var i = 0; i < len; i++) { - var contextualType = callResolutionData.actualParametersContextTypeSymbols ? callResolutionData.actualParametersContextTypeSymbols[i] : null; - if (contextualType) { - context.pushNewContextualType(contextualType); - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - for (var i = 0; i < callResolutionData.diagnosticsFromOverloadResolution.length; i++) { - context.postDiagnostic(callResolutionData.diagnosticsFromOverloadResolution[i]); - } - }; - - PullTypeResolver.prototype.postOverloadResolutionDiagnostics = function (diagnostic, additionalResults, context) { - if (!context.inProvisionalResolution()) { - additionalResults.diagnosticsFromOverloadResolution.push(diagnostic); - } - context.postDiagnostic(diagnostic); - }; - - PullTypeResolver.prototype.computeObjectCreationExpressionSymbol = function (callEx, context, additionalResults) { - var _this = this; - var returnType = null; - - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var targetTypeSymbol = targetSymbol.isType() ? targetSymbol : targetSymbol.type; - - var targetAST = this.getCallTargetErrorSpanAST(callEx); - - var constructSignatures = targetTypeSymbol.getConstructSignatures(); - - var explicitTypeArgs = null; - var usedCallSignaturesInstead = false; - var couldNotAssignToConstraint; - var constraintDiagnostic = null; - var typeArgumentCountDiagnostic = null; - var diagnostics = []; - - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - if (callEx.argumentList) { - this.resolveAST(callEx.argumentList.arguments, false, context); - } - - return targetTypeSymbol; - } - - if (!constructSignatures.length) { - constructSignatures = targetTypeSymbol.getCallSignatures(); - usedCallSignaturesInstead = true; - - if (this.compilationSettings.noImplicitAny()) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type), additionalResults, context); - } - } - - if (constructSignatures.length) { - if (callEx.argumentList && callEx.argumentList.typeArgumentList) { - explicitTypeArgs = []; - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - explicitTypeArgs[i] = this.resolveTypeReference(callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - } - } - } - - if (targetTypeSymbol.isGeneric()) { - var resolvedSignatures = []; - var inferredOrExplicitTypeArgs; - var specializedSignature; - var typeParameters; - var typeConstraint = null; - var triedToInferTypeArgs; - var targetTypeReplacementMap = targetTypeSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < constructSignatures.length; i++) { - couldNotAssignToConstraint = false; - - if (constructSignatures[i].isGeneric()) { - typeParameters = constructSignatures[i].getTypeParameters(); - - if (explicitTypeArgs) { - if (explicitTypeArgs.length === typeParameters.length) { - inferredOrExplicitTypeArgs = explicitTypeArgs; - } else { - typeArgumentCountDiagnostic = typeArgumentCountDiagnostic || this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [typeParameters.length, explicitTypeArgs.length]); - continue; - } - } else if (callEx.argumentList) { - var typeArgumentInferenceContext = new TypeScript.InvocationTypeArgumentInferenceContext(this, context, constructSignatures[i], callEx.argumentList.arguments); - inferredOrExplicitTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - triedToInferTypeArgs = true; - } else { - inferredOrExplicitTypeArgs = TypeScript.ArrayUtilities.select(typeParameters, function (typeParameter) { - return typeParameter.getDefaultConstraint(_this.semanticInfoChain); - }); - } - - TypeScript.Debug.assert(inferredOrExplicitTypeArgs && inferredOrExplicitTypeArgs.length == typeParameters.length); - - var mutableTypeReplacementMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(targetTypeReplacementMap ? targetTypeReplacementMap : []); - TypeScript.PullInstantiationHelpers.updateMutableTypeParameterArgumentMap(typeParameters, inferredOrExplicitTypeArgs, mutableTypeReplacementMap); - var typeReplacementMap = mutableTypeReplacementMap.typeParameterArgumentMap; - - if (explicitTypeArgs) { - for (var j = 0; j < typeParameters.length; j++) { - typeConstraint = typeParameters[j].getConstraint(); - - if (typeConstraint) { - if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeReplacementMap); - } - - if (!this.sourceIsAssignableToTarget(inferredOrExplicitTypeArgs[j], typeConstraint, targetAST, context, null, true)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(targetAST); - constraintDiagnostic = this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [inferredOrExplicitTypeArgs[j].toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[j].toString(enclosingSymbol, true)]); - couldNotAssignToConstraint = true; - } - - if (couldNotAssignToConstraint) { - break; - } - } - } - } - - if (couldNotAssignToConstraint) { - continue; - } - - specializedSignature = this.instantiateSignature(constructSignatures[i], typeReplacementMap); - - if (specializedSignature) { - resolvedSignatures[resolvedSignatures.length] = specializedSignature; - } - } else { - if (!(callEx.argumentList && callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount())) { - resolvedSignatures[resolvedSignatures.length] = constructSignatures[i]; - } - } - } - - constructSignatures = resolvedSignatures; - } - - var signature = this.resolveOverloads(callEx, constructSignatures, callEx.argumentList && callEx.argumentList.typeArgumentList !== null, context, diagnostics); - - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = constructSignatures; - additionalResults.candidateSignature = signature; - additionalResults.actualParametersContextTypeSymbols = []; - - if (!constructSignatures.length) { - if (constraintDiagnostic) { - this.postOverloadResolutionDiagnostics(constraintDiagnostic, additionalResults, context); - } else if (typeArgumentCountDiagnostic) { - this.postOverloadResolutionDiagnostics(typeArgumentCountDiagnostic, additionalResults, context); - } - - return this.getNewErrorTypeSymbol(); - } - - var errorCondition = null; - - if (!signature) { - for (var i = 0; i < diagnostics.length; i++) { - this.postOverloadResolutionDiagnostics(diagnostics[i], additionalResults, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Could_not_select_overload_for_new_expression), additionalResults, context); - - errorCondition = this.getNewErrorTypeSymbol(); - - if (!constructSignatures.length) { - return errorCondition; - } - - signature = constructSignatures[0]; - } - - returnType = signature.returnType; - - if (returnType && !signature.isGeneric() && returnType.isGeneric() && !returnType.getIsSpecialized()) { - if (explicitTypeArgs && explicitTypeArgs.length) { - returnType = this.createInstantiatedType(returnType, explicitTypeArgs); - } else { - returnType = this.instantiateTypeToAny(returnType, context); - } - } - - if (usedCallSignaturesInstead) { - if (returnType !== this.semanticInfoChain.voidTypeSymbol) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Call_signatures_used_in_a_new_expression_must_have_a_void_return_type), additionalResults, context); - - return this.getNewErrorTypeSymbol(); - } else { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - } - - if (!returnType) { - returnType = signature.returnType; - - if (!returnType) { - returnType = targetTypeSymbol; - } - } - - var actualParametersContextTypeSymbols = []; - if (callEx.argumentList && callEx.argumentList.arguments) { - var len = callEx.argumentList.arguments.nonSeparatorCount(); - var params = signature.parameters; - var contextualType = null; - var signatureDecl = signature.getDeclarations()[0]; - - for (var i = 0; i < len; i++) { - if (params.length) { - if (i < params.length - 1 || (i < params.length && !signature.hasVarArgs)) { - this.resolveDeclaredSymbol(params[i], context); - contextualType = params[i].type; - } else if (signature.hasVarArgs) { - contextualType = params[params.length - 1].type; - if (contextualType.isArrayNamedTypeReference()) { - contextualType = contextualType.getElementType(); - } - } - } - - if (contextualType) { - context.pushNewContextualType(contextualType); - actualParametersContextTypeSymbols[i] = contextualType; - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = constructSignatures; - additionalResults.candidateSignature = signature; - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - if (errorCondition) { - return errorCondition; - } - - if (!returnType) { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - - return returnType; - } else if (callEx.argumentList) { - this.resolveAST(callEx.argumentList.arguments, false, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Invalid_new_expression), additionalResults, context); - - return this.getNewErrorTypeSymbol(); - }; - - PullTypeResolver.prototype.instantiateSignatureInContext = function (signatureAToInstantiate, contextualSignatureB, context, shouldFixContextualSignatureParameterTypes) { - var typeReplacementMap = []; - var inferredTypeArgs; - var specializedSignature; - var typeParameters = signatureAToInstantiate.getTypeParameters(); - var typeConstraint = null; - - var typeArgumentInferenceContext = new TypeScript.ContextualSignatureInstantiationTypeArgumentInferenceContext(this, context, signatureAToInstantiate, contextualSignatureB, shouldFixContextualSignatureParameterTypes); - inferredTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - - var functionTypeA = signatureAToInstantiate.functionType; - var functionTypeB = contextualSignatureB.functionType; - var enclosingTypeParameterMap; - - if (functionTypeA) { - enclosingTypeParameterMap = functionTypeA.getTypeParameterArgumentMap(); - - for (var id in enclosingTypeParameterMap) { - typeReplacementMap[id] = enclosingTypeParameterMap[id]; - } - } - - if (functionTypeB) { - enclosingTypeParameterMap = functionTypeB.getTypeParameterArgumentMap(); - - for (var id in enclosingTypeParameterMap) { - typeReplacementMap[id] = enclosingTypeParameterMap[id]; - } - } - - TypeScript.PullInstantiationHelpers.updateTypeParameterArgumentMap(typeParameters, inferredTypeArgs, typeReplacementMap); - - return this.instantiateSignature(signatureAToInstantiate, typeReplacementMap); - }; - - PullTypeResolver.prototype.resolveCastExpression = function (assertionExpression, context) { - var typeAssertionType = this.resolveTypeReference(assertionExpression.type, context).type; - - if (this.canTypeCheckAST(assertionExpression, context)) { - this.typeCheckCastExpression(assertionExpression, context, typeAssertionType); - } - - return typeAssertionType; - }; - - PullTypeResolver.prototype.typeCheckCastExpression = function (assertionExpression, context, typeAssertionType) { - this.setTypeChecked(assertionExpression, context); - - context.pushNewContextualType(typeAssertionType); - var exprType = this.resolveAST(assertionExpression.expression, true, context).type; - context.popAnyContextualType(); - - this.resolveDeclaredSymbol(typeAssertionType, context); - this.resolveDeclaredSymbol(exprType, context); - - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(exprType, typeAssertionType, assertionExpression, context, comparisonInfo); - - if (!isAssignable) { - var widenedExprType = exprType.widenedType(this, assertionExpression.expression, context); - isAssignable = this.sourceIsAssignableToTarget(typeAssertionType, widenedExprType, assertionExpression, context, comparisonInfo); - } - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(assertionExpression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(assertionExpression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [exprType.toString(enclosingSymbol), typeAssertionType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(assertionExpression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [exprType.toString(enclosingSymbol), typeAssertionType.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.resolveAssignmentExpression = function (binaryExpression, context) { - var leftExpr = this.resolveAST(binaryExpression.left, false, context); - var leftType = leftExpr.type; - - context.pushNewContextualType(leftType); - var rightType = this.resolveAST(binaryExpression.right, true, context).type; - context.popAnyContextualType(); - - rightType = this.getInstanceTypeForAssignment(binaryExpression.left, rightType, context); - - if (this.canTypeCheckAST(binaryExpression, context)) { - this.setTypeChecked(binaryExpression, context); - - if (!this.isReference(binaryExpression.left, leftExpr)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } else { - this.checkAssignability(binaryExpression.left, rightType, leftExpr.type, context); - } - } - - return rightType; - }; - - PullTypeResolver.prototype.getInstanceTypeForAssignment = function (lhs, type, context) { - var typeToReturn = type; - if (typeToReturn && typeToReturn.isAlias()) { - typeToReturn = typeToReturn.getExportAssignedTypeSymbol(); - } - - if (typeToReturn && typeToReturn.isContainer() && !typeToReturn.isEnum()) { - var instanceTypeSymbol = typeToReturn.getInstanceType(); - - if (!instanceTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(lhs, TypeScript.DiagnosticCode.Tried_to_set_variable_type_to_uninitialized_module_type_0, [type.toString()])); - typeToReturn = null; - } else { - typeToReturn = instanceTypeSymbol; - } - } - - return typeToReturn; - }; - - PullTypeResolver.prototype.widenType = function (type, ast, context) { - if (type === this.semanticInfoChain.undefinedTypeSymbol || type === this.semanticInfoChain.nullTypeSymbol || type.isError()) { - return this.semanticInfoChain.anyTypeSymbol; - } - - if (type.isArrayNamedTypeReference()) { - return this.widenArrayType(type, ast, context); - } else if (type.kind === 256 /* ObjectLiteral */) { - return this.widenObjectLiteralType(type, ast, context); - } - - return type; - }; - - PullTypeResolver.prototype.widenArrayType = function (type, ast, context) { - var elementType = type.getElementType().widenedType(this, ast, context); - - if (this.compilationSettings.noImplicitAny() && ast) { - if (elementType === this.semanticInfoChain.anyTypeSymbol && type.getElementType() !== this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Array_Literal_implicitly_has_an_any_type_from_widening)); - } - } - - return this.getArrayType(elementType); - }; - - PullTypeResolver.prototype.widenObjectLiteralType = function (type, ast, context) { - if (!this.needsToWidenObjectLiteralType(type, ast, context)) { - return type; - } - - TypeScript.Debug.assert(type.name === ""); - var newObjectTypeSymbol = new TypeScript.PullTypeSymbol(type.name, type.kind); - var declsOfObjectType = type.getDeclarations(); - TypeScript.Debug.assert(declsOfObjectType.length === 1); - newObjectTypeSymbol.addDeclaration(declsOfObjectType[0]); - var members = type.getMembers(); - - for (var i = 0; i < members.length; i++) { - var memberType = members[i].type; - - var widenedMemberType = members[i].type.widenedType(this, ast, context); - var newMember = new TypeScript.PullSymbol(members[i].name, members[i].kind); - - var declsOfMember = members[i].getDeclarations(); - - newMember.addDeclaration(declsOfMember[0]); - newMember.type = widenedMemberType; - newObjectTypeSymbol.addMember(newMember); - newMember.setResolved(); - - if (this.compilationSettings.noImplicitAny() && ast && widenedMemberType === this.semanticInfoChain.anyTypeSymbol && memberType !== this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Object_literal_s_property_0_implicitly_has_an_any_type_from_widening, [members[i].name])); - } - } - - var indexers = type.getIndexSignatures(); - for (var i = 0; i < indexers.length; i++) { - var newIndexer = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - var parameter = indexers[i].parameters[0]; - var newParameter = new TypeScript.PullSymbol(parameter.name, parameter.kind); - newParameter.type = parameter.type; - newIndexer.addParameter(newParameter); - newIndexer.returnType = indexers[i].returnType; - newObjectTypeSymbol.addIndexSignature(newIndexer); - } - - return newObjectTypeSymbol; - }; - - PullTypeResolver.prototype.needsToWidenObjectLiteralType = function (type, ast, context) { - var members = type.getMembers(); - for (var i = 0; i < members.length; i++) { - var memberType = members[i].type; - if (memberType !== memberType.widenedType(this, ast, context)) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.findBestCommonType = function (collection, context, comparisonInfo) { - var len = collection.getLength(); - - for (var i = 0; i < len; i++) { - var candidateType = collection.getTypeAtIndex(i); - if (this.typeIsBestCommonTypeCandidate(candidateType, collection, context)) { - return candidateType; - } - } - - return this.semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeResolver.prototype.typeIsBestCommonTypeCandidate = function (candidateType, collection, context) { - for (var i = 0; i < collection.getLength(); i++) { - var otherType = collection.getTypeAtIndex(i); - if (candidateType === otherType) { - continue; - } - - if (!this.sourceIsSubtypeOfTarget(otherType, candidateType, null, context)) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.typesAreIdenticalInEnclosingTypes = function (t1, t2, context) { - t1 = this.getSymbolForRelationshipCheck(t1); - t2 = this.getSymbolForRelationshipCheck(t2); - - if (t1 === t2) { - return true; - } - - if (t1 && t2) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - return this.infinitelyExpandingTypesAreIdentical(t1, t2, context); - } - } - - return this.typesAreIdentical(t1, t2, context); - }; - - PullTypeResolver.prototype.typesAreIdenticalWithNewEnclosingTypes = function (t1, t2, context) { - var enclosingTypeWalkers = context.resetEnclosingTypeWalkers(); - var areTypesIdentical = this.typesAreIdentical(t1, t2, context); - context.setEnclosingTypeWalkers(enclosingTypeWalkers); - return areTypesIdentical; - }; - - PullTypeResolver.prototype.typesAreIdentical = function (t1, t2, context) { - t1 = this.getSymbolForRelationshipCheck(t1); - t2 = this.getSymbolForRelationshipCheck(t2); - - if (t1 === t2) { - return true; - } - - if (!t1 || !t2) { - return false; - } - - if (TypeScript.hasFlag(t1.kind, 64 /* Enum */) || TypeScript.hasFlag(t2.kind, 64 /* Enum */)) { - return false; - } - - if (t1.isPrimitive() && t1.isStringConstant() && t2.isPrimitive() && t2.isStringConstant()) { - return TypeScript.stripStartAndEndQuotes(t1.name) === TypeScript.stripStartAndEndQuotes(t2.name); - } - - if (t1.isPrimitive() || t2.isPrimitive()) { - return false; - } - - if (t1.isError() && t2.isError()) { - return true; - } - - var isIdentical = this.identicalCache.valueAt(t1.pullSymbolID, t2.pullSymbolID); - if (isIdentical != undefined) { - return isIdentical; - } - - if (t1.isTypeParameter() !== t2.isTypeParameter()) { - return false; - } else if (t1.isTypeParameter()) { - var t1ParentDeclaration = t1.getDeclarations()[0].getParentDecl(); - var t2ParentDeclaration = t2.getDeclarations()[0].getParentDecl(); - - if (t1ParentDeclaration === t2ParentDeclaration) { - return this.symbolsShareDeclaration(t1, t2); - } else { - return false; - } - } - - if (t1.isPrimitive() !== t2.isPrimitive()) { - return false; - } - - this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, true); - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(t1, t2); - isIdentical = this.typesAreIdenticalWorker(t1, t2, context); - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, isIdentical); - - return isIdentical; - }; - - PullTypeResolver.prototype.typesAreIdenticalWorker = function (t1, t2, context) { - if (t1.getIsSpecialized() && t2.getIsSpecialized()) { - if (TypeScript.PullHelpers.getRootType(t1) === TypeScript.PullHelpers.getRootType(t2) && TypeScript.PullHelpers.getRootType(t1).isNamedTypeSymbol()) { - var t1TypeArguments = t1.getTypeArguments(); - var t2TypeArguments = t2.getTypeArguments(); - - if (t1TypeArguments && t2TypeArguments) { - for (var i = 0; i < t1TypeArguments.length; i++) { - if (!this.typesAreIdenticalWithNewEnclosingTypes(t1TypeArguments[i], t2TypeArguments[i], context)) { - return false; - } - } - } - - return true; - } - } - - if (t1.hasMembers() && t2.hasMembers()) { - var t1Members = t1.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - var t2Members = t2.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - - if (t1Members.length !== t2Members.length) { - return false; - } - - var t1MemberSymbol = null; - var t2MemberSymbol = null; - - var t1MemberType = null; - var t2MemberType = null; - - for (var iMember = 0; iMember < t1Members.length; iMember++) { - t1MemberSymbol = t1Members[iMember]; - t2MemberSymbol = this.getNamedPropertySymbol(t1MemberSymbol.name, 68147712 /* SomeValue */, t2); - - if (!this.propertiesAreIdentical(t1MemberSymbol, t2MemberSymbol, context)) { - return false; - } - } - } else if (t1.hasMembers() || t2.hasMembers()) { - return false; - } - - var t1CallSigs = t1.getCallSignatures(); - var t2CallSigs = t2.getCallSignatures(); - - var t1ConstructSigs = t1.getConstructSignatures(); - var t2ConstructSigs = t2.getConstructSignatures(); - - var t1IndexSigs = t1.getIndexSignatures(); - var t2IndexSigs = t2.getIndexSignatures(); - - if (!this.signatureGroupsAreIdentical(t1CallSigs, t2CallSigs, context)) { - return false; - } - - if (!this.signatureGroupsAreIdentical(t1ConstructSigs, t2ConstructSigs, context)) { - return false; - } - - if (!this.signatureGroupsAreIdentical(t1IndexSigs, t2IndexSigs, context)) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.propertiesAreIdentical = function (propertySymbol1, propertySymbol2, context) { - if (!propertySymbol2 || (propertySymbol1.isOptional !== propertySymbol2.isOptional)) { - return false; - } - - var t1MemberSymbolIsPrivate = propertySymbol1.anyDeclHasFlag(2 /* Private */); - var t2MemberSymbolIsPrivate = propertySymbol2.anyDeclHasFlag(2 /* Private */); - - if (t1MemberSymbolIsPrivate !== t2MemberSymbolIsPrivate) { - return false; - } else if (t2MemberSymbolIsPrivate && t1MemberSymbolIsPrivate) { - var t1MemberSymbolDecl = propertySymbol1.getDeclarations()[0]; - var sourceDecl = propertySymbol2.getDeclarations()[0]; - if (t1MemberSymbolDecl !== sourceDecl) { - return false; - } - } - - var t1MemberType = propertySymbol1.type; - var t2MemberType = propertySymbol2.type; - - context.walkMemberTypes(propertySymbol1.name); - var areMemberTypesIdentical = this.typesAreIdenticalInEnclosingTypes(t1MemberType, t2MemberType, context); - context.postWalkMemberTypes(); - return areMemberTypesIdentical; - }; - - PullTypeResolver.prototype.propertiesAreIdenticalWithNewEnclosingTypes = function (type1, type2, property1, property2, context) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(type1, type2); - var arePropertiesIdentical = this.propertiesAreIdentical(property1, property2, context); - context.setEnclosingTypeWalkers(enclosingWalkers); - return arePropertiesIdentical; - }; - - PullTypeResolver.prototype.signatureGroupsAreIdentical = function (sg1, sg2, context) { - if (sg1 === sg2) { - return true; - } - - if (!sg1 || !sg2) { - return false; - } - - if (sg1.length !== sg2.length) { - return false; - } - - for (var i = 0; i < sg1.length; i++) { - context.walkSignatures(sg1[i].kind, i); - var areSignaturesIdentical = this.signaturesAreIdentical(sg1[i], sg2[i], context, true); - context.postWalkSignatures(); - if (!areSignaturesIdentical) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.typeParametersAreIdentical = function (tp1, tp2, context) { - var typeParamsAreIdentical = this.typeParametersAreIdenticalWorker(tp1, tp2, context); - - this.setTypeParameterIdentity(tp1, tp2, undefined); - - return typeParamsAreIdentical; - }; - - PullTypeResolver.prototype.typeParametersAreIdenticalWorker = function (tp1, tp2, context) { - if (!!(tp1 && tp1.length) !== !!(tp2 && tp2.length)) { - return false; - } - - if (tp1 && tp2 && (tp1.length !== tp2.length)) { - return false; - } - - if (tp1 && tp2) { - for (var i = 0; i < tp1.length; i++) { - context.walkTypeParameterConstraints(i); - var areConstraintsIdentical = this.typesAreIdentical(tp1[i].getConstraint(), tp2[i].getConstraint(), context); - context.postWalkTypeParameterConstraints(); - if (!areConstraintsIdentical) { - return false; - } - } - } - - return true; - }; - - PullTypeResolver.prototype.setTypeParameterIdentity = function (tp1, tp2, val) { - if (tp1 && tp2 && tp1.length === tp2.length) { - for (var i = 0; i < tp1.length; i++) { - this.identicalCache.setValueAt(tp1[i].pullSymbolID, tp2[i].pullSymbolID, val); - } - } - }; - - PullTypeResolver.prototype.signaturesAreIdenticalWithNewEnclosingTypes = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - var areSignaturesIdentical = this.signaturesAreIdentical(s1, s2, context, includingReturnType); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSignaturesIdentical; - }; - - PullTypeResolver.prototype.signaturesAreIdentical = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - if (s1 === s2) { - return true; - } - - var signaturesIdentical = this.identicalCache.valueAt(s1.pullSymbolID, s2.pullSymbolID); - if (signaturesIdentical || (signaturesIdentical != undefined && includingReturnType)) { - return signaturesIdentical; - } - - var oldValue = signaturesIdentical; - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, true); - - signaturesIdentical = this.signaturesAreIdenticalWorker(s1, s2, context, includingReturnType); - - if (includingReturnType) { - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, signaturesIdentical); - } else { - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, oldValue); - } - - return signaturesIdentical; - }; - - PullTypeResolver.prototype.signaturesAreIdenticalWorker = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - if (s1.hasVarArgs !== s2.hasVarArgs) { - return false; - } - - if (s1.nonOptionalParamCount !== s2.nonOptionalParamCount) { - return false; - } - - if (s1.parameters.length !== s2.parameters.length) { - return false; - } - - var s1TypeParameters = s1.getTypeParameters(); - var s2TypeParameters = s2.getTypeParameters(); - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, true); - - var typeParametersParametersAndReturnTypesAreIdentical = this.signatureTypeParametersParametersAndReturnTypesAreIdentical(s1, s2, context, includingReturnType); - - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, undefined); - return typeParametersParametersAndReturnTypesAreIdentical; - }; - - PullTypeResolver.prototype.signatureTypeParametersParametersAndReturnTypesAreIdentical = function (s1, s2, context, includingReturnType) { - if (!this.typeParametersAreIdenticalWorker(s1.getTypeParameters(), s2.getTypeParameters(), context)) { - return false; - } - - if (includingReturnType) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s1); - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s2); - context.walkReturnTypes(); - var areReturnTypesIdentical = this.typesAreIdenticalInEnclosingTypes(s1.returnType, s2.returnType, context); - context.postWalkReturnTypes(); - if (!areReturnTypesIdentical) { - return false; - } - } - - var s1Params = s1.parameters; - var s2Params = s2.parameters; - - for (var iParam = 0; iParam < s1Params.length; iParam++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s1Params[iParam]); - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s2Params[iParam]); - context.walkParameterTypes(iParam); - var areParameterTypesIdentical = this.typesAreIdenticalInEnclosingTypes(s1Params[iParam].type, s2Params[iParam].type, context); - context.postWalkParameterTypes(); - - if (!areParameterTypesIdentical) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.signatureReturnTypesAreIdentical = function (s1, s2, context) { - var s1TypeParameters = s1.getTypeParameters(); - var s2TypeParameters = s2.getTypeParameters(); - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, true); - - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - context.walkReturnTypes(); - var returnTypeIsIdentical = this.typesAreIdenticalInEnclosingTypes(s1.returnType, s2.returnType, context); - - context.setEnclosingTypeWalkers(enclosingWalkers); - - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, undefined); - - return returnTypeIsIdentical; - }; - - PullTypeResolver.prototype.symbolsShareDeclaration = function (symbol1, symbol2) { - var decls1 = symbol1.getDeclarations(); - var decls2 = symbol2.getDeclarations(); - - if (decls1.length && decls2.length) { - return decls1[0] === decls2[0]; - } - - return false; - }; - - PullTypeResolver.prototype.sourceIsSubtypeOfTarget = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTarget(source, target, false, this.subtypeCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceMembersAreAssignableToTargetMembers = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceMembersAreAssignableToTargetMembers = this.sourceMembersAreRelatableToTargetMembers(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceMembersAreAssignableToTargetMembers; - }; - - PullTypeResolver.prototype.sourcePropertyIsAssignableToTargetProperty = function (source, target, sourceProp, targetProp, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var isSourcePropertyIsAssignableToTargetProperty = this.sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSourcePropertyIsAssignableToTargetProperty; - }; - - PullTypeResolver.prototype.sourceCallSignaturesAreAssignableToTargetCallSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceCallSignaturesAssignableToTargetCallSignatures = this.sourceCallSignaturesAreRelatableToTargetCallSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceCallSignaturesAssignableToTargetCallSignatures; - }; - - PullTypeResolver.prototype.sourceConstructSignaturesAreAssignableToTargetConstructSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceConstructSignaturesAssignableToTargetConstructSignatures = this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceConstructSignaturesAssignableToTargetConstructSignatures; - }; - - PullTypeResolver.prototype.sourceIndexSignaturesAreAssignableToTargetIndexSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceIndexSignaturesAssignableToTargetIndexSignatures = this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceIndexSignaturesAssignableToTargetIndexSignatures; - }; - - PullTypeResolver.prototype.typeIsAssignableToFunction = function (source, ast, context) { - if (source.isFunctionType()) { - return true; - } - - return this.cachedFunctionInterfaceType() && this.sourceIsAssignableToTarget(source, this.cachedFunctionInterfaceType(), ast, context); - }; - - PullTypeResolver.prototype.signatureIsAssignableToTarget = function (s1, s2, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - var isSignatureIsAssignableToTarget = this.signatureIsRelatableToTarget(s1, s2, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSignatureIsAssignableToTarget; - }; - - PullTypeResolver.prototype.sourceIsAssignableToTarget = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTarget(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceIsAssignableToTargetWithNewEnclosingTypes = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTargetWithNewEnclosingTypes(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.getSymbolForRelationshipCheck = function (symbol) { - if (symbol && symbol.isTypeReference()) { - return symbol.getReferencedTypeSymbol(); - } - - return symbol; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetInEnclosingTypes = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - source = this.getSymbolForRelationshipCheck(source); - target = this.getSymbolForRelationshipCheck(target); - - if (source === target) { - return true; - } - - if (source && target) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - return this.infinitelyExpandingSourceTypeIsRelatableToTargetType(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - } - } - - return this.sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetWithNewEnclosingTypes = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - var isSourceRelatable = this.sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSourceRelatable; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetInCache = function (source, target, comparisonCache, comparisonInfo) { - var isRelatable = comparisonCache.valueAt(source.pullSymbolID, target.pullSymbolID); - - if (isRelatable) { - return { isRelatable: isRelatable }; - } - - if (isRelatable != undefined && !comparisonInfo) { - return { isRelatable: isRelatable }; - } - - return null; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTarget = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - source = this.getSymbolForRelationshipCheck(source); - target = this.getSymbolForRelationshipCheck(target); - - if (source === target) { - return true; - } - - if (!(source && target)) { - return true; - } - - var sourceApparentType = this.getApparentType(source); - - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(source, target, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - if (source === this.semanticInfoChain.stringTypeSymbol && target.isPrimitive() && target.isStringConstant()) { - return comparisonInfo && comparisonInfo.stringConstantVal && (comparisonInfo.stringConstantVal.kind() === 14 /* StringLiteral */) && (TypeScript.stripStartAndEndQuotes(comparisonInfo.stringConstantVal.text()) === TypeScript.stripStartAndEndQuotes(target.name)); - } - - if (assignableTo) { - if (this.isAnyOrEquivalent(source) || this.isAnyOrEquivalent(target)) { - return true; - } - } else { - if (this.isAnyOrEquivalent(target)) { - return true; - } - } - - if (target === this.semanticInfoChain.stringTypeSymbol && source.isPrimitive() && source.isStringConstant()) { - return true; - } - - if (source.isPrimitive() && source.isStringConstant() && target.isPrimitive() && target.isStringConstant()) { - return TypeScript.stripStartAndEndQuotes(source.name) === TypeScript.stripStartAndEndQuotes(target.name); - } - - if (source === this.semanticInfoChain.undefinedTypeSymbol) { - return true; - } - - if ((source === this.semanticInfoChain.nullTypeSymbol) && (target !== this.semanticInfoChain.undefinedTypeSymbol && target != this.semanticInfoChain.voidTypeSymbol)) { - return true; - } - - if (target === this.semanticInfoChain.voidTypeSymbol) { - if (source === this.semanticInfoChain.undefinedTypeSymbol || source == this.semanticInfoChain.nullTypeSymbol) { - return true; - } - - return false; - } else if (source === this.semanticInfoChain.voidTypeSymbol) { - if (target === this.semanticInfoChain.anyTypeSymbol) { - return true; - } - - return false; - } - - if (target === this.semanticInfoChain.numberTypeSymbol && TypeScript.PullHelpers.symbolIsEnum(source)) { - return true; - } - - if (source === this.semanticInfoChain.numberTypeSymbol && TypeScript.PullHelpers.symbolIsEnum(target)) { - return assignableTo; - } - - if (TypeScript.PullHelpers.symbolIsEnum(target) && TypeScript.PullHelpers.symbolIsEnum(source)) { - return this.symbolsShareDeclaration(target, source); - } - - if ((source.kind & 64 /* Enum */) || (target.kind & 64 /* Enum */)) { - return false; - } - - if (source.getIsSpecialized() && target.getIsSpecialized()) { - if (TypeScript.PullHelpers.getRootType(source) === TypeScript.PullHelpers.getRootType(target) && TypeScript.PullHelpers.getRootType(source).isNamedTypeSymbol()) { - var sourceTypeArguments = source.getTypeArguments(); - var targetTypeArguments = target.getTypeArguments(); - - if (sourceTypeArguments && targetTypeArguments) { - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, true); - - for (var i = 0; i < sourceTypeArguments.length; i++) { - if (!this.sourceIsRelatableToTargetWithNewEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], assignableTo, comparisonCache, ast, context, null, isComparingInstantiatedSignatures)) { - break; - } - } - - if (i === sourceTypeArguments.length) { - return true; - } else { - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, undefined); - } - } - } - } - - if (target.isTypeParameter()) { - if (source.isTypeParameter()) { - if (!source.getConstraint()) { - return this.typesAreIdentical(target, source, context); - } else { - return this.isSourceTypeParameterConstrainedToTargetTypeParameter(source, target); - } - } else { - if (isComparingInstantiatedSignatures) { - target = target.getBaseConstraint(this.semanticInfoChain); - } else { - return this.typesAreIdentical(target, sourceApparentType, context); - } - } - } - - if (sourceApparentType.isPrimitive() || target.isPrimitive()) { - return false; - } - - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, true); - - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(sourceApparentType, target); - - var needsSourceSubstitutionUpdate = source != sourceApparentType && context.enclosingTypeWalker1._canWalkStructure() && context.enclosingTypeWalker1._getCurrentSymbol() != sourceApparentType; - if (needsSourceSubstitutionUpdate) { - context.enclosingTypeWalker1.setCurrentSymbol(sourceApparentType); - } - - var isRelatable = this.sourceIsRelatableToTargetWorker(source, target, sourceApparentType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - - if (needsSourceSubstitutionUpdate) { - context.enclosingTypeWalker1.setCurrentSymbol(source); - } - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.isSourceTypeParameterConstrainedToTargetTypeParameter = function (source, target) { - var current = source; - while (current && current.isTypeParameter()) { - if (current === target) { - return true; - } - - current = current.getConstraint(); - } - return false; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetWorker = function (source, target, sourceSubstitution, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - if (target.hasMembers() && !this.sourceMembersAreRelatableToTargetMembers(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceCallSignaturesAreRelatableToTargetCallSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.sourceMembersAreRelatableToTargetMembers = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetProps = target.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - - for (var itargetProp = 0; itargetProp < targetProps.length; itargetProp++) { - var targetProp = targetProps[itargetProp]; - - var sourceProp = this._getNamedPropertySymbolOfAugmentedType(targetProp.name, source); - - this.resolveDeclaredSymbol(targetProp, context); - - var targetPropType = targetProp.type; - - if (!sourceProp) { - if (!(targetProp.isOptional)) { - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.flags |= 2 /* RequiredPropertyIsMissing */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_is_missing_property_1_from_type_2, [source.toString(enclosingSymbol), targetProp.getScopedNameEx().toString(), target.toString(enclosingSymbol)])); - } - return false; - } - continue; - } - - if (!this.sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.infinitelyExpandingSourceTypeIsRelatableToTargetType = function (sourceType, targetType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var widenedTargetType = targetType.widenedType(this, null, context); - var widenedSourceType = sourceType.widenedType(this, null, context); - - if ((widenedSourceType !== this.semanticInfoChain.anyTypeSymbol) && (widenedTargetType !== this.semanticInfoChain.anyTypeSymbol)) { - var sourceTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(sourceType); - var targetTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(targetType); - - if (sourceTypeNamedTypeReference !== targetTypeNamedTypeReference) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type, [sourceType.getScopedNameEx(enclosingSymbol).toString(), targetType.toString(enclosingSymbol)])); - } - return false; - } - - var sourceTypeArguments = sourceType.getTypeArguments(); - var targetTypeArguments = targetType.getTypeArguments(); - - if (!sourceTypeArguments && !targetTypeArguments) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - } - - if (!(sourceTypeArguments && targetTypeArguments) || sourceTypeArguments.length !== targetTypeArguments.length) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol)])); - } - return false; - } - - var comparisonInfoTypeArgumentsCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoTypeArgumentsCheck = new TypeComparisonInfo(comparisonInfo); - } - var isRelatable = true; - for (var i = 0; i < sourceTypeArguments.length && isRelatable; i++) { - context.walkTypeArgument(i); - - if (!this.sourceIsRelatableToTargetInEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], assignableTo, comparisonCache, ast, context, comparisonInfoTypeArgumentsCheck, isComparingInstantiatedSignatures)) { - isRelatable = false; - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - - if (comparisonInfoTypeArgumentsCheck && comparisonInfoTypeArgumentsCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol), comparisonInfoTypeArgumentsCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol)]); - } - comparisonInfo.addMessage(message); - } - } - - context.postWalkTypeArgument(); - } - } - - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.infinitelyExpandingTypesAreIdentical = function (sourceType, targetType, context) { - var widenedTargetType = targetType.widenedType(this, null, null); - var widenedSourceType = sourceType.widenedType(this, null, null); - - if ((widenedSourceType !== this.semanticInfoChain.anyTypeSymbol) && (widenedTargetType !== this.semanticInfoChain.anyTypeSymbol)) { - var sourceTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(sourceType); - var targetTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(targetType); - if (sourceTypeNamedTypeReference !== targetTypeNamedTypeReference) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - - var sourceTypeArguments = sourceType.getTypeArguments(); - var targetTypeArguments = targetType.getTypeArguments(); - - if (!sourceTypeArguments && !targetTypeArguments) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - } - - if (!(sourceTypeArguments && targetTypeArguments) || sourceTypeArguments.length !== targetTypeArguments.length) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - - for (var i = 0; i < sourceTypeArguments.length; i++) { - context.walkTypeArgument(i); - var areIdentical = this.typesAreIdenticalInEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], context); - context.postWalkTypeArgument(); - - if (!areIdentical) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - } - } - - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - }; - - PullTypeResolver.prototype.sourcePropertyIsRelatableToTargetProperty = function (source, target, sourceProp, targetProp, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var _this = this; - var sourceAndTargetAreConstructors = source.isConstructor() && target.isConstructor(); - - var getNames = function (takeTypesFromPropertyContainers) { - var enclosingSymbol = _this.getEnclosingSymbolForAST(ast); - var sourceType = takeTypesFromPropertyContainers ? sourceProp.getContainer() : source; - var targetType = takeTypesFromPropertyContainers ? targetProp.getContainer() : target; - if (sourceAndTargetAreConstructors) { - sourceType = sourceType.getAssociatedContainerType(); - targetType = targetType.getAssociatedContainerType(); - } - return { - propertyName: targetProp.getScopedNameEx().toString(), - sourceTypeName: sourceType.toString(enclosingSymbol), - targetTypeName: targetType.toString(enclosingSymbol) - }; - }; - - var targetPropIsPrivate = targetProp.anyDeclHasFlag(2 /* Private */); - var sourcePropIsPrivate = sourceProp.anyDeclHasFlag(2 /* Private */); - - if (targetPropIsPrivate !== sourcePropIsPrivate) { - if (comparisonInfo) { - var names = getNames(true); - var code; - if (targetPropIsPrivate) { - code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2 : TypeScript.DiagnosticCode.Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2; - } else { - code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2 : TypeScript.DiagnosticCode.Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2; - } - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName])); - comparisonInfo.flags |= 128 /* InconsistantPropertyAccesibility */; - } - return false; - } else if (sourcePropIsPrivate && targetPropIsPrivate) { - var targetDecl = targetProp.getDeclarations()[0]; - var sourceDecl = sourceProp.getDeclarations()[0]; - - if (targetDecl !== sourceDecl) { - if (comparisonInfo) { - var names = getNames(true); - - comparisonInfo.flags |= 128 /* InconsistantPropertyAccesibility */; - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_0_and_1_define_static_property_2_as_private : TypeScript.DiagnosticCode.Types_0_and_1_define_property_2_as_private; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(code, [names.sourceTypeName, names.targetTypeName, names.propertyName])); - } - - return false; - } - } - - if (sourceProp.isOptional && !targetProp.isOptional) { - if (comparisonInfo) { - var names = getNames(true); - comparisonInfo.flags |= 2 /* RequiredPropertyIsMissing */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2, [names.propertyName, names.sourceTypeName, names.targetTypeName])); - } - return false; - } - - this.resolveDeclaredSymbol(sourceProp, context); - - var sourcePropType = sourceProp.type; - var targetPropType = targetProp.type; - - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(sourcePropType, targetPropType, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - var comparisonInfoPropertyTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoPropertyTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - context.walkMemberTypes(targetProp.name); - var isSourcePropertyRelatableToTargetProperty = this.sourceIsRelatableToTargetInEnclosingTypes(sourcePropType, targetPropType, assignableTo, comparisonCache, ast, context, comparisonInfoPropertyTypeCheck, isComparingInstantiatedSignatures); - context.postWalkMemberTypes(); - - if (!isSourcePropertyRelatableToTargetProperty && comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.flags |= 32 /* IncompatiblePropertyTypes */; - var message; - var names = getNames(false); - if (comparisonInfoPropertyTypeCheck && comparisonInfoPropertyTypeCheck.message) { - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3 : TypeScript.DiagnosticCode.Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3; - message = TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName, comparisonInfoPropertyTypeCheck.message]); - } else { - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_of_static_property_0_of_class_1_and_class_2_are_incompatible : TypeScript.DiagnosticCode.Types_of_property_0_of_types_1_and_2_are_incompatible; - message = TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName]); - } - comparisonInfo.addMessage(message); - } - - return isSourcePropertyRelatableToTargetProperty; - }; - - PullTypeResolver.prototype.sourceCallSignaturesAreRelatableToTargetCallSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetCallSigs = target.getCallSignatures(); - - if (targetCallSigs.length) { - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - var sourceCallSigs = source.getCallSignatures(); - if (!this.signatureGroupIsRelatableToTarget(source, target, sourceCallSigs, targetCallSigs, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures)) { - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (sourceCallSigs.length && targetCallSigs.length) { - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - } else { - var hasSig = targetCallSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - var lacksSig = !targetCallSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_requires_a_call_signature_but_type_1_lacks_one, [hasSig, lacksSig]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.sourceConstructSignaturesAreRelatableToTargetConstructSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetConstructSigs = target.getConstructSignatures(); - if (targetConstructSigs.length) { - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - var sourceConstructSigs = source.getConstructSignatures(); - if (!this.signatureGroupIsRelatableToTarget(source, target, sourceConstructSigs, targetConstructSigs, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures)) { - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - var message; - if (sourceConstructSigs.length && targetConstructSigs.length) { - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Construct_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Construct_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - } else { - var hasSig = targetConstructSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - var lacksSig = !targetConstructSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_requires_a_construct_signature_but_type_1_lacks_one, [hasSig, lacksSig]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.sourceIndexSignaturesAreRelatableToTargetIndexSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetIndexSigs = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(target, context); - var targetStringSig = targetIndexSigs.stringSignature; - var targetNumberSig = targetIndexSigs.numericSignature; - - if (targetStringSig || targetNumberSig) { - var sourceIndexSigs = this.getBothKindsOfIndexSignaturesIncludingAugmentedType(source, context); - var enclosingTypeIndexSigs = context.getBothKindOfIndexSignatures(true, false); - var sourceStringSig = sourceIndexSigs.stringSignature; - var sourceNumberSig = sourceIndexSigs.numericSignature; - - var comparable = true; - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - if (targetStringSig) { - if (sourceStringSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, true, true); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceStringSig.returnType, targetStringSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else { - comparable = false; - } - } - - if (comparable && targetNumberSig) { - if (sourceNumberSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, false, false); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceNumberSig.returnType, targetNumberSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else if (sourceStringSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, true, false); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceStringSig.returnType, targetNumberSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else { - comparable = false; - } - } - - if (!comparable) { - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Index_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Index_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.signatureGroupIsRelatableToTarget = function (source, target, sourceSG, targetSG, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - if (sourceSG === targetSG) { - return true; - } - - if (!(sourceSG.length && targetSG.length)) { - return false; - } - - var foundMatch = false; - - var targetExcludeDefinition = targetSG.length > 1; - var sourceExcludeDefinition = sourceSG.length > 1; - var sigsCompared = 0; - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo, true); - comparisonInfoSignatuesTypeCheck.message = comparisonInfo.message; - } - for (var iMSig = 0; iMSig < targetSG.length; iMSig++) { - var mSig = targetSG[iMSig]; - - if (mSig.isStringConstantOverloadSignature() || (targetExcludeDefinition && mSig.isDefinition())) { - continue; - } - - for (var iNSig = 0; iNSig < sourceSG.length; iNSig++) { - var nSig = sourceSG[iNSig]; - - if (nSig.isStringConstantOverloadSignature() || (sourceExcludeDefinition && nSig.isDefinition())) { - continue; - } - - context.walkSignatures(nSig.kind, iNSig, iMSig); - var isSignatureRelatableToTarget = this.signatureIsRelatableToTarget(nSig, mSig, assignableTo, comparisonCache, ast, context, sigsCompared == 0 ? comparisonInfoSignatuesTypeCheck : null, isComparingInstantiatedSignatures); - context.postWalkSignatures(); - - sigsCompared++; - - if (isSignatureRelatableToTarget) { - foundMatch = true; - break; - } - } - - if (foundMatch) { - foundMatch = false; - continue; - } - - if (comparisonInfo && sigsCompared == 1) { - comparisonInfo.message = comparisonInfoSignatuesTypeCheck.message; - } - - return false; - } - - return true; - }; - - PullTypeResolver.prototype.signatureIsRelatableToTarget = function (sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(sourceSig, targetSig, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - comparisonCache.setValueAt(sourceSig.pullSymbolID, targetSig.pullSymbolID, true); - var isRelatable = this.signatureIsRelatableToTargetWorker(sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - comparisonCache.setValueAt(sourceSig.pullSymbolID, targetSig.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.signatureIsRelatableToTargetWorker = function (sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var _this = this; - var sourceParameters = sourceSig.parameters; - var targetParameters = targetSig.parameters; - - if (!sourceParameters || !targetParameters) { - return false; - } - - var targetNonOptionalParamCount = targetSig.nonOptionalParamCount; - var sourceNonOptionalParamCount = sourceSig.nonOptionalParamCount; - - if (!targetSig.hasVarArgs && sourceNonOptionalParamCount > targetParameters.length) { - if (comparisonInfo) { - comparisonInfo.flags |= 3 /* SourceSignatureHasTooManyParameters */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signature_expects_0_or_fewer_parameters, [targetParameters.length])); - } - return false; - } - - if (this.signaturesAreIdentical(sourceSig, targetSig, context)) { - return true; - } - - if (targetSig.isGeneric()) { - targetSig = this.instantiateSignatureToAny(targetSig); - } - - if (sourceSig.isGeneric()) { - sourceSig = this.instantiateSignatureToAny(sourceSig); - } - - var sourceReturnType = sourceSig.returnType; - var targetReturnType = targetSig.returnType; - - if (targetReturnType !== this.semanticInfoChain.voidTypeSymbol) { - context.walkReturnTypes(); - var returnTypesAreRelatable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceReturnType, targetReturnType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.postWalkReturnTypes(); - if (!returnTypesAreRelatable) { - if (comparisonInfo) { - comparisonInfo.flags |= 16 /* IncompatibleReturnTypes */; - } - - return false; - } - } - - return targetSig.forAllCorrespondingParameterTypesInThisAndOtherSignature(sourceSig, function (targetParamType, sourceParamType, iParam) { - context.walkParameterTypes(iParam); - var areParametersRelatable = _this.sourceIsRelatableToTargetInEnclosingTypes(sourceParamType, targetParamType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - if (!areParametersRelatable) { - context.swapEnclosingTypeWalkers(); - areParametersRelatable = _this.sourceIsRelatableToTargetInEnclosingTypes(targetParamType, sourceParamType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.swapEnclosingTypeWalkers(); - } - context.postWalkParameterTypes(); - - if (!areParametersRelatable) { - if (comparisonInfo) { - comparisonInfo.flags |= 64 /* IncompatibleParameterTypes */; - } - } - - return areParametersRelatable; - }); - }; - - PullTypeResolver.prototype.resolveOverloads = function (application, group, haveTypeArgumentsAtCallSite, context, diagnostics) { - var _this = this; - var hasOverloads = group.length > 1; - var comparisonInfo = new TypeComparisonInfo(); - var args = application.argumentList ? application.argumentList.arguments : null; - - var initialCandidates = TypeScript.ArrayUtilities.where(group, function (signature) { - if (hasOverloads && signature.isDefinition()) { - return false; - } - - var rootSignature = signature.getRootSymbol(); - if (haveTypeArgumentsAtCallSite && !rootSignature.isGeneric()) { - return false; - } - - return _this.overloadHasCorrectArity(signature, args); - }); - - var firstAssignableButNotSupertypeSignature = null; - var firstAssignableWithProvisionalErrorsSignature = null; - - for (var i = 0; i < initialCandidates.length; i++) { - var applicability = this.overloadIsApplicable(initialCandidates[i], args, context, comparisonInfo); - if (applicability === 3 /* Subtype */) { - return initialCandidates[i]; - } else if (applicability === 2 /* AssignableWithNoProvisionalErrors */ && !firstAssignableButNotSupertypeSignature) { - firstAssignableButNotSupertypeSignature = initialCandidates[i]; - } else if (applicability === 1 /* AssignableButWithProvisionalErrors */ && !firstAssignableWithProvisionalErrorsSignature) { - firstAssignableWithProvisionalErrorsSignature = initialCandidates[i]; - } - } - - if (firstAssignableButNotSupertypeSignature || firstAssignableWithProvisionalErrorsSignature) { - return firstAssignableButNotSupertypeSignature || firstAssignableWithProvisionalErrorsSignature; - } else { - var target = this.getCallTargetErrorSpanAST(application); - if (comparisonInfo.message) { - diagnostics.push(this.semanticInfoChain.diagnosticFromAST(target, TypeScript.DiagnosticCode.Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0, [comparisonInfo.message])); - } else { - diagnostics.push(this.semanticInfoChain.diagnosticFromAST(target, TypeScript.DiagnosticCode.Supplied_parameters_do_not_match_any_signature_of_call_target, null)); - } - } - - return null; - }; - - PullTypeResolver.prototype.getCallTargetErrorSpanAST = function (callEx) { - return (callEx.expression.kind() === 212 /* MemberAccessExpression */) ? callEx.expression.name : callEx.expression; - }; - - PullTypeResolver.prototype.overloadHasCorrectArity = function (signature, args) { - if (args == null) { - return signature.nonOptionalParamCount === 0; - } - - var numberOfArgs = (args.nonSeparatorCount() && args.nonSeparatorCount() === args.separatorCount()) ? args.separatorCount() + 1 : args.nonSeparatorCount(); - if (numberOfArgs < signature.nonOptionalParamCount) { - return false; - } - if (!signature.hasVarArgs && numberOfArgs > signature.parameters.length) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.overloadIsApplicable = function (signature, args, context, comparisonInfo) { - if (args === null) { - return 3 /* Subtype */; - } - - var isInVarArg = false; - var parameters = signature.parameters; - var paramType = null; - - var overloadApplicability = 3 /* Subtype */; - - for (var i = 0; i < args.nonSeparatorCount(); i++) { - if (!isInVarArg) { - this.resolveDeclaredSymbol(parameters[i], context); - - if (parameters[i].isVarArg) { - paramType = parameters[i].type.getElementType() || this.getNewErrorTypeSymbol(parameters[i].type.getName()); - isInVarArg = true; - } else { - paramType = parameters[i].type; - } - } - - var statusOfCurrentArgument = this.overloadIsApplicableForArgument(paramType, args.nonSeparatorAt(i), i, context, comparisonInfo); - - if (statusOfCurrentArgument === 0 /* NotAssignable */) { - return 0 /* NotAssignable */; - } else if (statusOfCurrentArgument === 1 /* AssignableButWithProvisionalErrors */) { - overloadApplicability = 1 /* AssignableButWithProvisionalErrors */; - } else if (overloadApplicability !== 1 /* AssignableButWithProvisionalErrors */ && statusOfCurrentArgument === 2 /* AssignableWithNoProvisionalErrors */) { - overloadApplicability = 2 /* AssignableWithNoProvisionalErrors */; - } - } - - return overloadApplicability; - }; - - PullTypeResolver.prototype.overloadIsApplicableForArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (paramType.isAny()) { - return 3 /* Subtype */; - } else if (paramType.isError()) { - return 1 /* AssignableButWithProvisionalErrors */; - } else if (arg.kind() === 219 /* SimpleArrowFunctionExpression */) { - var simpleArrowFunction = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, null, TypeScript.ASTHelpers.parametersFromIdentifier(simpleArrowFunction.identifier), null, simpleArrowFunction.block, simpleArrowFunction.expression, argIndex, context, comparisonInfo); - } else if (arg.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - var arrowFunction = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, arrowFunction.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), TypeScript.ASTHelpers.getType(arrowFunction), arrowFunction.block, arrowFunction.expression, argIndex, context, comparisonInfo); - } else if (arg.kind() === 222 /* FunctionExpression */) { - var functionExpression = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, functionExpression.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(functionExpression.callSignature.parameterList), TypeScript.ASTHelpers.getType(functionExpression), functionExpression.block, null, argIndex, context, comparisonInfo); - } else if (arg.kind() === 215 /* ObjectLiteralExpression */) { - return this.overloadIsApplicableForObjectLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); - } else if (arg.kind() === 214 /* ArrayLiteralExpression */) { - return this.overloadIsApplicableForArrayLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); - } else { - return this.overloadIsApplicableForOtherArgument(paramType, arg, argIndex, context, comparisonInfo); - } - }; - - PullTypeResolver.prototype.overloadIsApplicableForAnyFunctionExpressionArgument = function (paramType, arg, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, argIndex, context, comparisonInfo) { - if (this.cachedFunctionInterfaceType() && paramType === this.cachedFunctionInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - - var argSym = this.resolveAnyFunctionExpression(arg, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForObjectLiteralArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (this.cachedObjectInterfaceType() && paramType === this.cachedObjectInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - var argSym = this.resolveObjectLiteralExpression(arg, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForArrayLiteralArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (paramType === this.cachedArrayInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - var argSym = this.resolveArrayLiteralExpression(arg, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForOtherArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - var argSym = this.resolveAST(arg, false, context); - - if (argSym.type.isAlias()) { - var aliasSym = argSym.type; - argSym = aliasSym.getExportAssignedTypeSymbol(); - } - - comparisonInfo.stringConstantVal = arg; - return this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - }; - - PullTypeResolver.prototype.overloadIsApplicableForArgumentHelper = function (paramType, argSym, argumentIndex, comparisonInfo, arg, context) { - var tempComparisonInfo = new TypeComparisonInfo(); - tempComparisonInfo.stringConstantVal = comparisonInfo.stringConstantVal; - if (!context.hasProvisionalErrors() && this.sourceIsSubtypeOfTarget(argSym.type, paramType, arg, context, tempComparisonInfo)) { - return 3 /* Subtype */; - } - - if (this.sourceIsAssignableToTarget(argSym.type, paramType, arg, context, comparisonInfo.message ? tempComparisonInfo : comparisonInfo)) { - return context.hasProvisionalErrors() ? 1 /* AssignableButWithProvisionalErrors */ : 2 /* AssignableWithNoProvisionalErrors */; - } - - if (!comparisonInfo.message) { - var enclosingSymbol = this.getEnclosingSymbolForAST(arg); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_apply_type_0_to_argument_1_which_is_of_type_2, [paramType.toString(enclosingSymbol), (argumentIndex + 1), argSym.getTypeName(enclosingSymbol)])); - } - - return 0 /* NotAssignable */; - }; - - PullTypeResolver.prototype.inferArgumentTypesForSignature = function (argContext, comparisonInfo, context) { - var inferenceResultTypes = argContext.inferTypeArguments(); - var typeParameters = argContext.signatureBeingInferred.getTypeParameters(); - TypeScript.Debug.assert(typeParameters.length == inferenceResultTypes.length); - - var typeReplacementMapForConstraints = null; - for (var i = 0; i < inferenceResultTypes.length; i++) { - if (typeParameters[i].getConstraint()) { - typeReplacementMapForConstraints = typeReplacementMapForConstraints || TypeScript.PullInstantiationHelpers.createTypeParameterArgumentMap(typeParameters, inferenceResultTypes); - var associatedConstraint = this.instantiateType(typeParameters[i].getConstraint(), typeReplacementMapForConstraints); - if (!this.sourceIsAssignableToTargetWithNewEnclosingTypes(inferenceResultTypes[i], associatedConstraint, null, context, null, false)) { - inferenceResultTypes[i] = associatedConstraint; - } - } - } - - if (argContext.isInvocationInferenceContext()) { - var invocationContext = argContext; - if (!this.typeParametersAreInScopeAtArgumentList(typeParameters, invocationContext.argumentASTs)) { - for (var i = 0; i < inferenceResultTypes.length; i++) { - if (inferenceResultTypes[i].wrapsSomeTypeParameter(argContext.candidateCache)) { - inferenceResultTypes[i] = this.semanticInfoChain.anyTypeSymbol; - } - } - } - } - - return inferenceResultTypes; - }; - - PullTypeResolver.prototype.typeParametersAreInScopeAtArgumentList = function (typeParameters, args) { - var enclosingDecl = this.getEnclosingDeclForAST(args); - var typeParameterParentDecl = typeParameters[0].getDeclarations()[0].getParentDecl(); - return enclosingDecl.getParentPath().indexOf(typeParameterParentDecl) > -1; - }; - - PullTypeResolver.prototype.relateTypeToTypeParametersInEnclosingType = function (expressionType, parameterType, argContext, context) { - if (expressionType && parameterType) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - this.relateInifinitelyExpandingTypeToTypeParameters(expressionType, parameterType, argContext, context); - return; - } - } - this.relateTypeToTypeParameters(expressionType, parameterType, argContext, context); - }; - - PullTypeResolver.prototype.relateTypeToTypeParametersWithNewEnclosingTypes = function (expressionType, parameterType, argContext, context) { - var enclosingTypeWalkers = context.resetEnclosingTypeWalkers(); - this.relateTypeToTypeParameters(expressionType, parameterType, argContext, context); - context.setEnclosingTypeWalkers(enclosingTypeWalkers); - }; - - PullTypeResolver.prototype.relateTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - if (!expressionType || !parameterType) { - return; - } - - if (expressionType.isError()) { - expressionType = this.semanticInfoChain.anyTypeSymbol; - } - - if (parameterType.isTypeParameter()) { - var typeParameter = parameterType; - argContext.addCandidateForInference(typeParameter, expressionType); - return; - } - - if (parameterType.isNamedTypeSymbol() && !parameterType.isGeneric() && !parameterType.getTypeArguments()) { - return; - } - - if (TypeScript.PullInstantiationHelpers.twoTypesAreInstantiationsOfSameNamedGenericType(expressionType, parameterType)) { - this.relateTypeArgumentsOfTypeToTypeParameters(expressionType, parameterType, argContext, context); - } else { - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(expressionType, parameterType); - this.relateObjectTypeToTypeParameters(expressionType, parameterType, argContext, context); - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - } - }; - - PullTypeResolver.prototype.relateTypeArgumentsOfTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - var parameterSideTypeArguments = parameterType.getTypeArguments(); - var argumentSideTypeArguments = expressionType.getTypeArguments(); - - TypeScript.Debug.assert(parameterSideTypeArguments && argumentSideTypeArguments && parameterSideTypeArguments.length === argumentSideTypeArguments.length); - for (var i = 0; i < parameterSideTypeArguments.length; i++) { - this.relateTypeToTypeParametersWithNewEnclosingTypes(argumentSideTypeArguments[i], parameterSideTypeArguments[i], argContext, context); - } - }; - - PullTypeResolver.prototype.relateInifinitelyExpandingTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - if (!expressionType || !parameterType) { - return; - } - - var expressionTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(expressionType); - var parameterTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(parameterType); - if (expressionTypeNamedTypeReference !== parameterTypeNamedTypeReference) { - return; - } - - var expressionTypeTypeArguments = expressionType.getTypeArguments(); - var parameterTypeArguments = parameterType.getTypeArguments(); - - if (expressionTypeTypeArguments && parameterTypeArguments && expressionTypeTypeArguments.length === parameterTypeArguments.length) { - for (var i = 0; i < expressionTypeTypeArguments.length; i++) { - this.relateTypeArgumentsOfTypeToTypeParameters(expressionType, parameterType, argContext, context); - } - } - }; - - PullTypeResolver.prototype.relateFunctionSignatureToTypeParameters = function (expressionSignature, parameterSignature, argContext, context) { - var _this = this; - var expressionReturnType = expressionSignature.returnType; - var parameterReturnType = parameterSignature.returnType; - - parameterSignature.forAllCorrespondingParameterTypesInThisAndOtherSignature(expressionSignature, function (parameterSignatureParameterType, expressionSignatureParameterType, i) { - context.walkParameterTypes(i); - _this.relateTypeToTypeParametersInEnclosingType(expressionSignatureParameterType, parameterSignatureParameterType, argContext, context); - context.postWalkParameterTypes(); - return true; - }); - - context.walkReturnTypes(); - this.relateTypeToTypeParametersInEnclosingType(expressionReturnType, parameterReturnType, argContext, context); - context.postWalkReturnTypes(); - }; - - PullTypeResolver.prototype.relateObjectTypeToTypeParameters = function (objectType, parameterType, argContext, context) { - var parameterTypeMembers = parameterType.getMembers(); - var parameterSignatures; - - var objectMember; - var objectSignatures; - - if (argContext.alreadyRelatingTypes(objectType, parameterType)) { - return; - } - - for (var i = 0; i < parameterTypeMembers.length; i++) { - objectMember = this.getNamedPropertySymbol(parameterTypeMembers[i].name, 68147712 /* SomeValue */, objectType); - if (objectMember) { - this.resolveDeclaredSymbol(objectMember); - this.resolveDeclaredSymbol(parameterTypeMembers[i]); - context.walkMemberTypes(parameterTypeMembers[i].name); - this.relateTypeToTypeParametersInEnclosingType(objectMember.type, parameterTypeMembers[i].type, argContext, context); - context.postWalkMemberTypes(); - } - } - - this.relateSignatureGroupToTypeParameters(objectType.getCallSignatures(), parameterType.getCallSignatures(), 1048576 /* CallSignature */, argContext, context); - - this.relateSignatureGroupToTypeParameters(objectType.getConstructSignatures(), parameterType.getConstructSignatures(), 2097152 /* ConstructSignature */, argContext, context); - - var parameterIndexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(parameterType, context); - var objectIndexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(objectType, context); - var indexSigInfo = context.getBothKindOfIndexSignatures(false, false); - - if (parameterIndexSignatures.stringSignature && objectIndexSignatures.stringSignature) { - context.walkIndexSignatureReturnTypes(indexSigInfo, true, true, true); - this.relateFunctionSignatureToTypeParameters(objectIndexSignatures.stringSignature, parameterIndexSignatures.stringSignature, argContext, context); - context.postWalkIndexSignatureReturnTypes(true); - } - if (parameterIndexSignatures.numericSignature && objectIndexSignatures.numericSignature) { - context.walkIndexSignatureReturnTypes(indexSigInfo, false, false, true); - this.relateFunctionSignatureToTypeParameters(objectIndexSignatures.numericSignature, parameterIndexSignatures.numericSignature, argContext, context); - context.postWalkIndexSignatureReturnTypes(true); - } - }; - - PullTypeResolver.prototype.relateSignatureGroupToTypeParameters = function (argumentSignatures, parameterSignatures, signatureKind, argContext, context) { - for (var i = 0; i < parameterSignatures.length; i++) { - var paramSignature = parameterSignatures[i]; - if (argumentSignatures.length > 0 && paramSignature.isGeneric()) { - paramSignature = this.instantiateSignatureToAny(paramSignature); - } - for (var j = 0; j < argumentSignatures.length; j++) { - var argumentSignature = argumentSignatures[j]; - if (argumentSignature.nonOptionalParamCount > paramSignature.nonOptionalParamCount) { - continue; - } - - if (argumentSignature.isGeneric()) { - argumentSignature = this.instantiateSignatureToAny(argumentSignature); - } - - context.walkSignatures(signatureKind, j, i); - this.relateFunctionSignatureToTypeParameters(argumentSignature, paramSignature, argContext, context); - context.postWalkSignatures(); - } - } - }; - - PullTypeResolver.prototype.alterPotentialGenericFunctionTypeToInstantiatedFunctionTypeForTypeArgumentInference = function (expressionSymbol, context) { - var inferentialType = context.getContextualType(); - TypeScript.Debug.assert(inferentialType); - var expressionType = expressionSymbol.type; - if (this.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers(expressionType, true) && this.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers(inferentialType, false)) { - var genericExpressionSignature = expressionType.getCallSignatures()[0]; - var contextualSignature = inferentialType.getCallSignatures()[0]; - - var instantiatedSignature = this.instantiateSignatureInContext(genericExpressionSignature, contextualSignature, context, true); - if (instantiatedSignature === null) { - return expressionSymbol; - } - - var newType = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - newType.appendCallSignature(instantiatedSignature); - return newType; - } - - return expressionSymbol; - }; - - PullTypeResolver.prototype.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers = function (type, callSignatureShouldBeGeneric) { - TypeScript.Debug.assert(type); - if (type.getCallSignatures().length !== 1) { - return false; - } - - var callSignatureIsGeneric = type.getCallSignatures()[0].isGeneric(); - if (callSignatureIsGeneric !== callSignatureShouldBeGeneric) { - return false; - } - - var typeHasOtherMembers = type.getConstructSignatures().length || type.getIndexSignatures().length || type.getAllMembers(68147712 /* SomeValue */, 0 /* all */).length; - if (typeHasOtherMembers) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.instantiateTypeToAny = function (typeToSpecialize, context) { - var typeParameters = typeToSpecialize.getTypeParameters(); - - if (!typeParameters.length) { - return typeToSpecialize; - } - - var typeArguments = null; - - if (!this._cachedAnyTypeArgs) { - this._cachedAnyTypeArgs = [ - [this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol] - ]; - } - - if (typeParameters.length < this._cachedAnyTypeArgs.length) { - typeArguments = this._cachedAnyTypeArgs[typeParameters.length - 1]; - } else { - typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArguments[typeArguments.length] = this.semanticInfoChain.anyTypeSymbol; - } - } - - var type = this.createInstantiatedType(typeToSpecialize, typeArguments); - - return type; - }; - - PullTypeResolver.prototype.instantiateSignatureToAny = function (signature) { - var typeParameters = signature.getTypeParameters(); - if (!this._cachedAnyTypeArgs) { - this._cachedAnyTypeArgs = [ - [this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol] - ]; - } - - if (typeParameters.length < this._cachedAnyTypeArgs.length) { - var typeArguments = this._cachedAnyTypeArgs[typeParameters.length - 1]; - } else { - var typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArguments[typeArguments.length] = this.semanticInfoChain.anyTypeSymbol; - } - } - - var typeParameterArgumentMap = TypeScript.PullInstantiationHelpers.createTypeParameterArgumentMap(typeParameters, typeArguments); - return this.instantiateSignature(signature, typeParameterArgumentMap); - }; - - PullTypeResolver.typeCheck = function (compilationSettings, semanticInfoChain, document) { - var sourceUnit = document.sourceUnit(); - - var resolver = semanticInfoChain.getResolver(); - var context = new TypeScript.PullTypeResolutionContext(resolver, true, sourceUnit.fileName()); - - if (resolver.canTypeCheckAST(sourceUnit, context)) { - resolver.resolveAST(sourceUnit, false, context); - resolver.validateVariableDeclarationGroups(semanticInfoChain.getDeclForAST(sourceUnit), context); - - while (resolver.typeCheckCallBacks.length) { - var callBack = resolver.typeCheckCallBacks.pop(); - callBack(context); - } - - resolver.processPostTypeCheckWorkItems(context); - } - }; - - PullTypeResolver.prototype.validateVariableDeclarationGroups = function (enclosingDecl, context) { - var _this = this; - this.scanVariableDeclarationGroups(enclosingDecl, function (_) { - }, function (subsequentDecl, firstSymbol) { - if (TypeScript.hasFlag(subsequentDecl.kind, 2048 /* Parameter */) || TypeScript.hasFlag(subsequentDecl.flags, 8388608 /* PropertyParameter */)) { - return; - } - - var boundDeclAST = _this.semanticInfoChain.getASTForDecl(subsequentDecl); - - var symbol = subsequentDecl.getSymbol(); - var symbolType = symbol.type; - var firstSymbolType = firstSymbol.type; - - if (symbolType && firstSymbolType && symbolType !== firstSymbolType && !_this.typesAreIdentical(symbolType, firstSymbolType, context)) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(boundDeclAST, TypeScript.DiagnosticCode.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, [symbol.getScopedName(), firstSymbolType.toString(firstSymbol), symbolType.toString(symbol)])); - } - }); - }; - - PullTypeResolver.prototype.typeCheckFunctionOverloads = function (funcDecl, context, signature, allSignatures) { - if (!signature) { - var functionSignatureInfo = TypeScript.PullHelpers.getSignatureForFuncDecl(this.semanticInfoChain.getDeclForAST(funcDecl)); - signature = functionSignatureInfo.signature; - allSignatures = functionSignatureInfo.allSignatures; - } - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSymbol = functionDeclaration.getSymbol(); - - var definitionSignature = null; - for (var i = allSignatures.length - 1; i >= 0; i--) { - if (allSignatures[i].isDefinition()) { - definitionSignature = allSignatures[i]; - break; - } - } - - if (!signature.isDefinition()) { - var signatureParentDecl = signature.getDeclarations()[0].getParentDecl(); - for (var i = 0; i < allSignatures.length; i++) { - if (allSignatures[i] === signature) { - break; - } - - var allSignaturesParentDecl = allSignatures[i].getDeclarations()[0].getParentDecl(); - if (allSignaturesParentDecl !== signatureParentDecl) { - continue; - } - - if (this.signaturesAreIdenticalWithNewEnclosingTypes(allSignatures[i], signature, context, false)) { - if (!this.signatureReturnTypesAreIdentical(allSignatures[i], signature, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overloads_cannot_differ_only_by_return_type)); - } else if (funcDecl.kind() === 137 /* ConstructorDeclaration */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_constructor_overload_signature)); - } else if (functionDeclaration.kind === 2097152 /* ConstructSignature */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_construct_signature)); - } else if (functionDeclaration.kind === 1048576 /* CallSignature */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_call_signature)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_signature_for_0, [funcSymbol.getScopedNameEx().toString()])); - } - - break; - } - } - } - - var isConstantOverloadSignature = signature.isStringConstantOverloadSignature(); - if (isConstantOverloadSignature) { - if (signature.isDefinition()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_implementation_cannot_use_specialized_type)); - } else { - var foundSubtypeSignature = false; - for (var i = 0; i < allSignatures.length; i++) { - if (allSignatures[i].isDefinition() || allSignatures[i] === signature) { - continue; - } - - if (!allSignatures[i].isResolved) { - this.resolveDeclaredSymbol(allSignatures[i], context); - } - - if (allSignatures[i].isStringConstantOverloadSignature()) { - continue; - } - - if (this.signatureIsAssignableToTarget(signature, allSignatures[i], null, context)) { - foundSubtypeSignature = true; - break; - } - } - - if (!foundSubtypeSignature) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature)); - } - } - } else if (definitionSignature && definitionSignature !== signature) { - var comparisonInfo = new TypeComparisonInfo(); - - if (!definitionSignature.isResolved) { - this.resolveDeclaredSymbol(definitionSignature, context); - } - - if (!this.signatureIsAssignableToTarget(definitionSignature, signature, funcDecl, context, comparisonInfo)) { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_is_not_compatible_with_function_definition_NL_0, [comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_is_not_compatible_with_function_definition)); - } - } - } - - var signatureForVisibilityCheck = definitionSignature; - if (!definitionSignature) { - if (allSignatures[0] === signature) { - return; - } - signatureForVisibilityCheck = allSignatures[0]; - } - - if (funcDecl.kind() !== 137 /* ConstructorDeclaration */ && functionDeclaration.kind !== 2097152 /* ConstructSignature */ && signatureForVisibilityCheck && signature !== signatureForVisibilityCheck) { - var errorCode; - - if (signatureForVisibilityCheck.anyDeclHasFlag(2 /* Private */) !== signature.anyDeclHasFlag(2 /* Private */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_public_or_private; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(1 /* Exported */) !== signature.anyDeclHasFlag(1 /* Exported */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_exported_or_not_exported; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(8 /* Ambient */) !== signature.anyDeclHasFlag(8 /* Ambient */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_ambient_or_non_ambient; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(128 /* Optional */) !== signature.anyDeclHasFlag(128 /* Optional */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_optional_or_required; - } - - if (errorCode) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, errorCode)); - } - } - }; - - PullTypeResolver.prototype.checkSymbolPrivacy = function (declSymbol, symbol, privacyErrorReporter) { - if (!symbol || symbol.kind === 2 /* Primitive */) { - return; - } - - if (symbol.isType()) { - var typeSymbol = symbol; - var isNamedType = typeSymbol.isNamedTypeSymbol(); - - if (typeSymbol.isArrayNamedTypeReference()) { - this.checkSymbolPrivacy(declSymbol, typeSymbol.getElementType(), privacyErrorReporter); - return; - } - - if (!isNamedType) { - var typeOfSymbol = typeSymbol.getTypeOfSymbol(); - if (typeOfSymbol) { - this.checkSymbolPrivacy(declSymbol, typeOfSymbol, privacyErrorReporter); - return; - } - } - - if (typeSymbol.inSymbolPrivacyCheck) { - return; - } - - typeSymbol.inSymbolPrivacyCheck = true; - - var typars = typeSymbol.getTypeArgumentsOrTypeParameters(); - if (typars) { - for (var i = 0; i < typars.length; i++) { - this.checkSymbolPrivacy(declSymbol, typars[i], privacyErrorReporter); - } - } - - if (!isNamedType) { - var members = typeSymbol.getMembers(); - for (var i = 0; i < members.length; i++) { - this.checkSymbolPrivacy(declSymbol, members[i].type, privacyErrorReporter); - } - - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getCallSignatures(), privacyErrorReporter); - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getConstructSignatures(), privacyErrorReporter); - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getIndexSignatures(), privacyErrorReporter); - } else if (typeSymbol.kind === 8192 /* TypeParameter */) { - this.checkSymbolPrivacy(declSymbol, typeSymbol.getConstraint(), privacyErrorReporter); - } - - typeSymbol.inSymbolPrivacyCheck = false; - - if (!isNamedType) { - return; - } - } - - if (declSymbol.isExternallyVisible()) { - var symbolIsVisible = symbol.isExternallyVisible(); - - if (symbolIsVisible && symbol.kind !== 8192 /* TypeParameter */) { - var symbolPath = symbol.pathToRoot(); - var declSymbolPath = declSymbol.pathToRoot(); - - if (symbolPath[symbolPath.length - 1].kind === 32 /* DynamicModule */ && declSymbolPath[declSymbolPath.length - 1].kind === 32 /* DynamicModule */ && declSymbolPath[declSymbolPath.length - 1] !== symbolPath[symbolPath.length - 1]) { - symbolIsVisible = false; - var declSymbolScope = declSymbolPath[declSymbolPath.length - 1]; - for (var i = symbolPath.length - 1; i >= 0; i--) { - var aliasSymbols = symbolPath[i].getExternalAliasedSymbols(declSymbolScope); - if (aliasSymbols) { - symbolIsVisible = true; - aliasSymbols[0].setTypeUsedExternally(); - break; - } - } - symbol = symbolPath[symbolPath.length - 1]; - } - } else if (symbol.kind === 128 /* TypeAlias */) { - var aliasSymbol = symbol; - symbolIsVisible = true; - aliasSymbol.setTypeUsedExternally(); - } - - if (!symbolIsVisible) { - privacyErrorReporter(symbol); - } - } - }; - - PullTypeResolver.prototype.checkTypePrivacyOfSignatures = function (declSymbol, signatures, privacyErrorReporter) { - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (signatures.length > 1 && signature.isDefinition()) { - continue; - } - - var typeParams = signature.getTypeParameters(); - for (var j = 0; j < typeParams.length; j++) { - this.checkSymbolPrivacy(declSymbol, typeParams[j], privacyErrorReporter); - } - - var params = signature.parameters; - for (var j = 0; j < params.length; j++) { - var paramType = params[j].type; - this.checkSymbolPrivacy(declSymbol, paramType, privacyErrorReporter); - } - - var returnType = signature.returnType; - this.checkSymbolPrivacy(declSymbol, returnType, privacyErrorReporter); - } - }; - - PullTypeResolver.prototype.typeParameterOfTypeDeclarationPrivacyErrorReporter = function (classOrInterface, typeParameterAST, typeParameter, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - var messageCode; - - var typeParameters = classOrInterface.kind() === 131 /* ClassDeclaration */ ? classOrInterface.typeParameterList : classOrInterface.typeParameterList; - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1; - } - } else { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1; - } - } - - var messageArguments = [typeParameter.getScopedName(enclosingSymbol, false, true), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeParameterAST, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.baseListPrivacyErrorReporter = function (classOrInterface, declSymbol, baseAst, isExtendedType, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - var messageCode; - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - if (isExtendedType) { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_extends_class_from_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_implements_interface_from_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_interface_0_extends_interface_from_inaccessible_module_1; - } - } else { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - if (isExtendedType) { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_extends_private_class_1; - } else { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_implements_private_interface_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_interface_0_extends_private_interface_1; - } - } - - var messageArguments = [declSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseAst, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.variablePrivacyErrorReporter = function (declAST, declSymbol, symbol, context) { - var typeSymbol = symbol; - var enclosingDecl = this.getEnclosingDecl(declSymbol.getDeclarations()[0]); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isProperty = declSymbol.kind === 4096 /* Property */; - var isPropertyOfClass = false; - var declParent = declSymbol.getContainer(); - if (declParent && (declParent.kind === 8 /* Class */ || declParent.kind === 32768 /* ConstructorMethod */)) { - isPropertyOfClass = true; - } - - var messageCode; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (declSymbol.anyDeclHasFlag(16 /* Static */)) { - messageCode = TypeScript.DiagnosticCode.Public_static_property_0_of_exported_class_is_using_inaccessible_module_1; - } else if (isProperty) { - if (isPropertyOfClass) { - messageCode = TypeScript.DiagnosticCode.Public_property_0_of_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Property_0_of_exported_interface_is_using_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_variable_0_is_using_inaccessible_module_1; - } - } else { - if (declSymbol.anyDeclHasFlag(16 /* Static */)) { - messageCode = TypeScript.DiagnosticCode.Public_static_property_0_of_exported_class_has_or_is_using_private_type_1; - } else if (isProperty) { - if (isPropertyOfClass) { - messageCode = TypeScript.DiagnosticCode.Public_property_0_of_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Property_0_of_exported_interface_has_or_is_using_private_type_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_variable_0_has_or_is_using_private_type_1; - } - } - - var messageArguments = [declSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declAST, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.checkFunctionTypePrivacy = function (funcDeclAST, isStatic, typeParameters, parameters, returnTypeAnnotation, block, context) { - var _this = this; - if (funcDeclAST.kind() === 222 /* FunctionExpression */ || funcDeclAST.kind() === 241 /* FunctionPropertyAssignment */ || (funcDeclAST.kind() === 139 /* GetAccessor */ && funcDeclAST.parent.parent.kind() === 215 /* ObjectLiteralExpression */) || (funcDeclAST.kind() === 140 /* SetAccessor */ && funcDeclAST.parent.parent.kind() === 215 /* ObjectLiteralExpression */)) { - return; - } - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var functionSymbol = functionDecl.getSymbol(); - ; - var functionSignature; - - var isGetter = funcDeclAST.kind() === 139 /* GetAccessor */; - var isSetter = funcDeclAST.kind() === 140 /* SetAccessor */; - var isIndexSignature = functionDecl.kind === 4194304 /* IndexSignature */; - - if (isGetter || isSetter) { - var accessorSymbol = functionSymbol; - functionSignature = (isGetter ? accessorSymbol.getGetter() : accessorSymbol.getSetter()).type.getCallSignatures()[0]; - } else { - if (!functionSymbol) { - var parentDecl = functionDecl.getParentDecl(); - functionSymbol = parentDecl.getSymbol(); - if (functionSymbol && functionSymbol.isType() && !functionSymbol.isNamedTypeSymbol()) { - return; - } - } else if (functionSymbol.kind === 65536 /* Method */ && !isStatic && !functionSymbol.getContainer().isNamedTypeSymbol()) { - return; - } - functionSignature = functionDecl.getSignatureSymbol(); - } - - if (typeParameters && !isGetter && !isSetter && !isIndexSignature && funcDeclAST.kind() !== 137 /* ConstructorDeclaration */) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - var typeParameterAST = typeParameters.typeParameters.nonSeparatorAt(i); - var typeParameter = this.resolveTypeParameterDeclaration(typeParameterAST, context); - this.checkSymbolPrivacy(functionSymbol, typeParameter, function (symbol) { - return _this.functionTypeArgumentArgumentTypePrivacyErrorReporter(funcDeclAST, isStatic, typeParameterAST, typeParameter, symbol, context); - }); - } - } - - if (!isGetter && !isIndexSignature) { - var funcParams = functionSignature.parameters; - for (var i = 0; i < funcParams.length; i++) { - this.checkSymbolPrivacy(functionSymbol, funcParams[i].type, function (symbol) { - return _this.functionArgumentTypePrivacyErrorReporter(funcDeclAST, isStatic, parameters, i, funcParams[i], symbol, context); - }); - } - } - - if (!isSetter) { - this.checkSymbolPrivacy(functionSymbol, functionSignature.returnType, function (symbol) { - return _this.functionReturnTypePrivacyErrorReporter(funcDeclAST, isStatic, returnTypeAnnotation, block, functionSignature.returnType, symbol, context); - }); - } - }; - - PullTypeResolver.prototype.functionTypeArgumentArgumentTypePrivacyErrorReporter = function (declAST, isStatic, typeParameterAST, typeParameter, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - var messageCode; - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_function_is_using_inaccessible_module_1; - } - } else { - if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_function_has_or_is_using_private_type_1; - } - } - - if (messageCode) { - var messageArgs = [typeParameter.getScopedName(enclosingSymbol, false, true), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeParameterAST, messageCode, messageArgs)); - } - }; - - PullTypeResolver.prototype.functionArgumentTypePrivacyErrorReporter = function (declAST, isStatic, parameters, argIndex, paramSymbol, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isGetter = declAST.kind() === 139 /* GetAccessor */; - var isSetter = declAST.kind() === 140 /* SetAccessor */; - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - var messageCode; - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (declAST.kind() === 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1; - } else if (isSetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1; - } - } else if (!isGetter) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_exported_function_is_using_inaccessible_module_1; - } - } else { - if (declAST.kind() === 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1; - } else if (isSetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1; - } - } else if (!isGetter && decl.kind !== 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_exported_function_has_or_is_using_private_type_1; - } - } - - if (messageCode) { - var parameter = parameters.astAt(argIndex); - - var messageArgs = [paramSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(parameter, messageCode, messageArgs)); - } - }; - - PullTypeResolver.prototype.functionReturnTypePrivacyErrorReporter = function (declAST, isStatic, returnTypeAnnotation, block, funcReturnType, symbol, context) { - var _this = this; - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - - var isGetter = declAST.kind() === 139 /* GetAccessor */; - var isSetter = declAST.kind() === 140 /* SetAccessor */; - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var messageCode = null; - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (isGetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (decl.kind === 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0; - } - } else if (!isSetter && declAST.kind() !== 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_exported_function_is_using_inaccessible_module_0; - } - } else { - if (isGetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (decl.kind === 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0; - } - } else if (!isSetter && declAST.kind() !== 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_exported_function_has_or_is_using_private_type_0; - } - } - - if (messageCode) { - var messageArguments = [typeSymbolName]; - var reportOnFuncDecl = false; - - if (returnTypeAnnotation) { - var returnExpressionSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - - if (TypeScript.PullHelpers.typeSymbolsAreIdentical(returnExpressionSymbol, funcReturnType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, messageCode, messageArguments)); - } - } - - if (block) { - var reportErrorOnReturnExpressions = function (ast, walker) { - var go = true; - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - go = false; - break; - - case 150 /* ReturnStatement */: - var returnStatement = ast; - var returnExpressionSymbol = _this.resolveAST(returnStatement.expression, false, context).type; - - if (TypeScript.PullHelpers.typeSymbolsAreIdentical(returnExpressionSymbol, funcReturnType)) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(returnStatement, messageCode, messageArguments)); - } else { - reportOnFuncDecl = true; - } - go = false; - break; - - default: - break; - } - - walker.options.goChildren = go; - return ast; - }; - - TypeScript.getAstWalkerFactory().walk(block, reportErrorOnReturnExpressions); - } - - if (reportOnFuncDecl) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declAST, messageCode, messageArguments)); - } - } - }; - - PullTypeResolver.prototype.enclosingClassIsDerived = function (classDecl) { - TypeScript.Debug.assert(classDecl.kind === 8 /* Class */); - - var classSymbol = classDecl.getSymbol(); - return classSymbol.getExtendedTypes().length > 0; - }; - - PullTypeResolver.prototype.isSuperInvocationExpression = function (ast) { - if (ast.kind() === 213 /* InvocationExpression */) { - var invocationExpression = ast; - if (invocationExpression.expression.kind() === 50 /* SuperKeyword */) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.isSuperInvocationExpressionStatement = function (node) { - if (node && node.kind() === 149 /* ExpressionStatement */) { - var expressionStatement = node; - if (this.isSuperInvocationExpression(expressionStatement.expression)) { - return true; - } - } - return false; - }; - - PullTypeResolver.prototype.getFirstStatementOfBlockOrNull = function (block) { - if (block && block.statements && block.statements.childCount() > 0) { - return block.statements.childAt(0); - } - - return null; - }; - - PullTypeResolver.prototype.superCallMustBeFirstStatementInConstructor = function (constructorDecl) { - TypeScript.Debug.assert(constructorDecl.kind === 32768 /* ConstructorMethod */); - - if (constructorDecl) { - var enclosingClass = constructorDecl.getParentDecl(); - - var classSymbol = enclosingClass.getSymbol(); - if (classSymbol.getExtendedTypes().length === 0) { - return false; - } - - var classMembers = classSymbol.getMembers(); - for (var i = 0, n1 = classMembers.length; i < n1; i++) { - var member = classMembers[i]; - - if (member.kind === 4096 /* Property */) { - var declarations = member.getDeclarations(); - for (var j = 0, n2 = declarations.length; j < n2; j++) { - var declaration = declarations[j]; - var ast = this.semanticInfoChain.getASTForDecl(declaration); - if (ast.kind() === 242 /* Parameter */) { - return true; - } - - if (ast.kind() === 136 /* MemberVariableDeclaration */) { - var variableDeclarator = ast; - if (variableDeclarator.variableDeclarator.equalsValueClause) { - return true; - } - } - } - } - } - } - - return false; - }; - - PullTypeResolver.prototype.checkForThisCaptureInArrowFunction = function (expression) { - var enclosingDecl = this.getEnclosingDeclForAST(expression); - - var declPath = enclosingDecl.getParentPath(); - - if (declPath.length) { - var inArrowFunction = false; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - var declFlags = decl.flags; - - if (declKind === 131072 /* FunctionExpression */ && TypeScript.hasFlag(declFlags, 8192 /* ArrowFunction */)) { - inArrowFunction = true; - continue; - } - - if (inArrowFunction) { - if (declKind === 16384 /* Function */ || declKind === 65536 /* Method */ || declKind === 32768 /* ConstructorMethod */ || declKind === 262144 /* GetAccessor */ || declKind === 524288 /* SetAccessor */ || declKind === 131072 /* FunctionExpression */ || declKind === 8 /* Class */ || declKind === 4 /* Container */ || declKind === 32 /* DynamicModule */ || declKind === 1 /* Script */) { - decl.setFlags(decl.flags | 262144 /* MustCaptureThis */); - - if (declKind === 8 /* Class */) { - var constructorSymbol = decl.getSymbol().getConstructorMethod(); - var constructorDecls = constructorSymbol.getDeclarations(); - for (var i = 0; i < constructorDecls.length; i++) { - constructorDecls[i].flags = constructorDecls[i].flags | 262144 /* MustCaptureThis */; - } - } - break; - } - } else if (declKind === 16384 /* Function */ || declKind === 131072 /* FunctionExpression */) { - break; - } - } - } - }; - - PullTypeResolver.prototype.typeCheckMembersAgainstIndexer = function (containerType, containerTypeDecl, context) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(containerType, context); - var stringSignature = indexSignatures.stringSignature; - var numberSignature = indexSignatures.numericSignature; - - if (stringSignature || numberSignature) { - var members = containerTypeDecl.getChildDecls(); - for (var i = 0; i < members.length; i++) { - var member = members[i]; - if ((member.name || (member.kind === 4096 /* Property */ && member.name === "")) && member.kind !== 32768 /* ConstructorMethod */ && !TypeScript.hasFlag(member.flags, 16 /* Static */)) { - var memberSymbol = member.getSymbol(); - var relevantSignature = this.determineRelevantIndexerForMember(memberSymbol, numberSignature, stringSignature); - if (relevantSignature) { - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(memberSymbol.type, relevantSignature.returnType, member.ast(), context, comparisonInfo)) { - this.reportErrorThatMemberIsNotSubtypeOfIndexer(memberSymbol, relevantSignature, member.ast(), context, comparisonInfo); - } - } - } - } - } - }; - - PullTypeResolver.prototype.determineRelevantIndexerForMember = function (member, numberIndexSignature, stringIndexSignature) { - if (numberIndexSignature && TypeScript.PullHelpers.isNameNumeric(member.name)) { - return numberIndexSignature; - } else if (stringIndexSignature) { - return stringIndexSignature; - } - - return null; - }; - - PullTypeResolver.prototype.reportErrorThatMemberIsNotSubtypeOfIndexer = function (member, indexSignature, astForError, context, comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(astForError); - if (indexSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol) { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1, [indexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0, [indexSignature.returnType.toString(enclosingSymbol)])); - } - } else { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1, [indexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_named_properties_must_be_assignable_to_string_indexer_type_0, [indexSignature.returnType.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.typeCheckIfTypeMemberPropertyOkToOverride = function (typeSymbol, extendedType, typeMember, extendedTypeMember, enclosingDecl, comparisonInfo) { - if (!typeSymbol.isClass()) { - return true; - } - - var typeMemberKind = typeMember.kind; - var extendedMemberKind = extendedTypeMember.kind; - - if (typeMemberKind === extendedMemberKind) { - return true; - } - - var errorCode; - if (typeMemberKind === 4096 /* Property */) { - if (typeMember.isAccessor()) { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } else { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - } else if (typeMemberKind === 65536 /* Method */) { - if (extendedTypeMember.isAccessor()) { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } else { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; - } - } - - var message = TypeScript.getDiagnosticMessage(errorCode, [typeSymbol.toString(), typeMember.getScopedNameEx().toString(), extendedType.toString()]); - comparisonInfo.addMessage(message); - return false; - }; - - PullTypeResolver.prototype.typeCheckIfTypeExtendsType = function (classOrInterface, name, typeSymbol, extendedType, enclosingDecl, context) { - var typeMembers = typeSymbol.getMembers(); - - var comparisonInfo = new TypeComparisonInfo(); - var foundError = false; - var foundError1 = false; - var foundError2 = false; - - for (var i = 0; i < typeMembers.length; i++) { - var propName = typeMembers[i].name; - var extendedTypeProp = extendedType.findMember(propName, true); - if (extendedTypeProp) { - this.resolveDeclaredSymbol(extendedTypeProp, context); - foundError1 = !this.typeCheckIfTypeMemberPropertyOkToOverride(typeSymbol, extendedType, typeMembers[i], extendedTypeProp, enclosingDecl, comparisonInfo); - - if (!foundError1) { - foundError2 = !this.sourcePropertyIsAssignableToTargetProperty(typeSymbol, extendedType, typeMembers[i], extendedTypeProp, classOrInterface, context, comparisonInfo); - } - - if (foundError1 || foundError2) { - foundError = true; - break; - } - } - } - - if (!foundError && typeSymbol.hasOwnCallSignatures()) { - foundError = !this.sourceCallSignaturesAreAssignableToTargetCallSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.hasOwnConstructSignatures()) { - foundError = !this.sourceConstructSignaturesAreAssignableToTargetConstructSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.hasOwnIndexSignatures()) { - foundError = !this.sourceIndexSignaturesAreAssignableToTargetIndexSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.isClass()) { - var typeConstructorType = typeSymbol.getConstructorMethod().type; - var typeConstructorTypeMembers = typeConstructorType.getMembers(); - if (typeConstructorTypeMembers.length) { - var extendedConstructorType = extendedType.getConstructorMethod().type; - var comparisonInfoForPropTypeCheck = new TypeComparisonInfo(comparisonInfo); - - for (var i = 0; i < typeConstructorTypeMembers.length; i++) { - var propName = typeConstructorTypeMembers[i].name; - var extendedConstructorTypeProp = extendedConstructorType.findMember(propName, true); - if (extendedConstructorTypeProp) { - if (!extendedConstructorTypeProp.isResolved) { - this.resolveDeclaredSymbol(extendedConstructorTypeProp, context); - } - - if (!this.sourcePropertyIsAssignableToTargetProperty(typeConstructorType, extendedConstructorType, typeConstructorTypeMembers[i], extendedConstructorTypeProp, classOrInterface, context, comparisonInfo)) { - foundError = true; - break; - } - } - } - } - } - - if (foundError) { - var errorCode; - if (typeSymbol.isClass()) { - errorCode = TypeScript.DiagnosticCode.Class_0_cannot_extend_class_1_NL_2; - } else { - if (extendedType.isClass()) { - errorCode = TypeScript.DiagnosticCode.Interface_0_cannot_extend_class_1_NL_2; - } else { - errorCode = TypeScript.DiagnosticCode.Interface_0_cannot_extend_interface_1_NL_2; - } - } - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, errorCode, [typeSymbol.getScopedName(), extendedType.getScopedName(), comparisonInfo.message])); - } - }; - - PullTypeResolver.prototype.typeCheckIfClassImplementsType = function (classDecl, classSymbol, implementedType, enclosingDecl, context) { - var comparisonInfo = new TypeComparisonInfo(); - var foundError = !this.sourceMembersAreAssignableToTargetMembers(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceCallSignaturesAreAssignableToTargetCallSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceConstructSignaturesAreAssignableToTargetConstructSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceIndexSignaturesAreAssignableToTargetIndexSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - } - } - } - - if (foundError) { - var enclosingSymbol = this.getEnclosingSymbolForAST(classDecl); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(classDecl.identifier, TypeScript.DiagnosticCode.Class_0_declares_interface_1_but_does_not_implement_it_NL_2, [classSymbol.getScopedName(enclosingSymbol), implementedType.getScopedName(enclosingSymbol), comparisonInfo.message])); - } - }; - - PullTypeResolver.prototype.computeValueSymbolFromAST = function (valueDeclAST, context) { - var prevInTypeCheck = context.inTypeCheck; - context.inTypeCheck = false; - - var typeSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(valueDeclAST); - - if (valueDeclAST.kind() == 11 /* IdentifierName */) { - var valueSymbol = this.computeNameExpression(valueDeclAST, context); - } else { - TypeScript.Debug.assert(valueDeclAST.kind() == 121 /* QualifiedName */); - var qualifiedName = valueDeclAST; - - var lhs = this.computeValueSymbolFromAST(qualifiedName.left, context); - var valueSymbol = this.computeDottedNameExpressionFromLHS(lhs.symbol, qualifiedName.left, qualifiedName.right, context, false); - } - var valueSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(valueDeclAST); - - this.semanticInfoChain.setAliasSymbolForAST(valueDeclAST, typeSymbolAlias); - context.inTypeCheck = prevInTypeCheck; - - return { symbol: valueSymbol, alias: valueSymbolAlias }; - }; - - PullTypeResolver.prototype.hasClassTypeSymbolConflictAsValue = function (baseDeclAST, typeSymbol, enclosingDecl, context) { - var typeSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(baseDeclAST); - - var valueDeclAST = baseDeclAST.kind() == 126 /* GenericType */ ? baseDeclAST.name : baseDeclAST; - var valueSymbolInfo = this.computeValueSymbolFromAST(valueDeclAST, context); - var valueSymbol = valueSymbolInfo.symbol; - var valueSymbolAlias = valueSymbolInfo.alias; - - if (typeSymbolAlias && valueSymbolAlias) { - return typeSymbolAlias !== valueSymbolAlias; - } - - if (!valueSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */)) { - return true; - } - - var associatedContainerType = valueSymbol.type ? valueSymbol.type.getAssociatedContainerType() : null; - - if (associatedContainerType) { - return associatedContainerType !== typeSymbol.getRootSymbol(); - } - - return true; - }; - - PullTypeResolver.prototype.typeCheckBase = function (classOrInterface, name, typeSymbol, baseDeclAST, isExtendedType, enclosingDecl, context) { - var _this = this; - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - - var baseType = this.resolveTypeReference(baseDeclAST, context).type; - - if (!baseType) { - return; - } - - var typeDeclIsClass = typeSymbol.isClass(); - - if (!typeSymbol.isValidBaseKind(baseType, isExtendedType)) { - if (!baseType.isError()) { - if (isExtendedType) { - if (typeDeclIsClass) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.A_class_may_only_extend_another_class)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.An_interface_may_only_extend_another_class_or_interface)); - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.A_class_may_only_implement_another_class_or_interface)); - } - } - return; - } else if (typeDeclIsClass && isExtendedType) { - if (this.hasClassTypeSymbolConflictAsValue(baseDeclAST, baseType, enclosingDecl, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1, [TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(baseDeclAST.kind() == 126 /* GenericType */ ? baseDeclAST.name : baseDeclAST), baseType.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - } - } - - if (baseType.hasBase(typeSymbol)) { - typeSymbol.setHasBaseTypeConflict(); - baseType.setHasBaseTypeConflict(); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, typeDeclIsClass ? TypeScript.DiagnosticCode.Class_0_is_recursively_referenced_as_a_base_type_of_itself : TypeScript.DiagnosticCode.Interface_0_is_recursively_referenced_as_a_base_type_of_itself, [typeSymbol.getScopedName()])); - return; - } - - if (isExtendedType) { - this.typeCheckCallBacks.push(function (context) { - return _this.typeCheckIfTypeExtendsType(classOrInterface, name, typeSymbol, baseType, enclosingDecl, context); - }); - } else { - TypeScript.Debug.assert(classOrInterface.kind() === 131 /* ClassDeclaration */); - - this.typeCheckCallBacks.push(function (context) { - return _this.typeCheckIfClassImplementsType(classOrInterface, typeSymbol, baseType, enclosingDecl, context); - }); - } - - this.checkSymbolPrivacy(typeSymbol, baseType, function (errorSymbol) { - return _this.baseListPrivacyErrorReporter(classOrInterface, typeSymbol, baseDeclAST, isExtendedType, errorSymbol, context); - }); - }; - - PullTypeResolver.prototype.typeCheckBases = function (classOrInterface, name, heritageClauses, typeSymbol, enclosingDecl, context) { - var _this = this; - var extendsClause = TypeScript.ASTHelpers.getExtendsHeritageClause(heritageClauses); - var implementsClause = TypeScript.ASTHelpers.getImplementsHeritageClause(heritageClauses); - if (!extendsClause && !implementsClause) { - return; - } - - if (extendsClause) { - for (var i = 0; i < extendsClause.typeNames.nonSeparatorCount(); i++) { - this.typeCheckBase(classOrInterface, name, typeSymbol, extendsClause.typeNames.nonSeparatorAt(i), true, enclosingDecl, context); - } - } - - if (typeSymbol.isClass()) { - if (implementsClause) { - for (var i = 0; i < implementsClause.typeNames.nonSeparatorCount(); i++) { - this.typeCheckBase(classOrInterface, name, typeSymbol, implementsClause.typeNames.nonSeparatorAt(i), false, enclosingDecl, context); - } - } - } else if (extendsClause && !typeSymbol.hasBaseTypeConflict() && typeSymbol.getExtendedTypes().length > 1) { - var firstInterfaceASTWithExtendsClause = TypeScript.ArrayUtilities.firstOrDefault(typeSymbol.getDeclarations(), function (decl) { - return decl.ast().heritageClauses !== null; - }).ast(); - if (classOrInterface === firstInterfaceASTWithExtendsClause) { - this.typeCheckCallBacks.push(function (context) { - _this.checkTypeCompatibilityBetweenBases(classOrInterface.identifier, typeSymbol, context); - }); - } - } - }; - - PullTypeResolver.prototype.checkTypeCompatibilityBetweenBases = function (name, typeSymbol, context) { - var derivedIndexSignatures = typeSymbol.getOwnIndexSignatures(); - - var inheritedMembersMap = TypeScript.createIntrinsicsObject(); - var inheritedIndexSignatures = new InheritedIndexSignatureInfo(); - - var typeHasOwnNumberIndexer = false; - var typeHasOwnStringIndexer = false; - - if (typeSymbol.hasOwnIndexSignatures()) { - var ownIndexSignatures = typeSymbol.getOwnIndexSignatures(); - for (var i = 0; i < ownIndexSignatures.length; i++) { - if (ownIndexSignatures[i].parameters[0].type === this.semanticInfoChain.numberTypeSymbol) { - typeHasOwnNumberIndexer = true; - } else { - typeHasOwnStringIndexer = true; - } - } - } - var baseTypes = typeSymbol.getExtendedTypes(); - for (var i = 0; i < baseTypes.length; i++) { - if (this.checkNamedPropertyIdentityBetweenBases(name, typeSymbol, baseTypes[i], inheritedMembersMap, context) || this.checkIndexSignatureIdentityBetweenBases(name, typeSymbol, baseTypes[i], inheritedIndexSignatures, typeHasOwnNumberIndexer, typeHasOwnStringIndexer, context)) { - return; - } - } - - if (this.checkThatInheritedNumberSignatureIsSubtypeOfInheritedStringSignature(name, typeSymbol, inheritedIndexSignatures, context)) { - return; - } - - this.checkInheritedMembersAgainstInheritedIndexSignatures(name, typeSymbol, inheritedIndexSignatures, inheritedMembersMap, context); - }; - - PullTypeResolver.prototype.checkNamedPropertyIdentityBetweenBases = function (interfaceName, interfaceSymbol, baseTypeSymbol, inheritedMembersMap, context) { - var baseMembers = baseTypeSymbol.getAllMembers(4096 /* Property */ | 65536 /* Method */, 0 /* all */); - for (var i = 0; i < baseMembers.length; i++) { - var member = baseMembers[i]; - var memberName = member.name; - - if (interfaceSymbol.findMember(memberName, false)) { - continue; - } - - this.resolveDeclaredSymbol(member, context); - - if (inheritedMembersMap[memberName]) { - var prevMember = inheritedMembersMap[memberName]; - if (prevMember.baseOrigin !== baseTypeSymbol && !this.propertiesAreIdenticalWithNewEnclosingTypes(baseTypeSymbol, prevMember.baseOrigin, member, prevMember.memberSymbol, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Named_properties_0_of_types_1_and_2_are_not_identical, [memberName, prevMember.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), prevMember.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - inheritedMembersMap[memberName] = new MemberWithBaseOrigin(member, baseTypeSymbol); - } - } - - return false; - }; - - PullTypeResolver.prototype.checkIndexSignatureIdentityBetweenBases = function (interfaceName, interfaceSymbol, baseTypeSymbol, allInheritedSignatures, derivedTypeHasOwnNumberSignature, derivedTypeHasOwnStringSignature, context) { - if (derivedTypeHasOwnNumberSignature && derivedTypeHasOwnStringSignature) { - return false; - } - - var indexSignaturesFromThisBaseType = baseTypeSymbol.getIndexSignatures(); - for (var i = 0; i < indexSignaturesFromThisBaseType.length; i++) { - var currentInheritedSignature = indexSignaturesFromThisBaseType[i]; - - var parameterTypeIsString = currentInheritedSignature.parameters[0].type === this.semanticInfoChain.stringTypeSymbol; - var parameterTypeIsNumber = currentInheritedSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol; - - if (parameterTypeIsString && derivedTypeHasOwnStringSignature || parameterTypeIsNumber && derivedTypeHasOwnNumberSignature) { - continue; - } - - if (parameterTypeIsString) { - if (allInheritedSignatures.stringSignatureWithBaseOrigin) { - if (allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin !== baseTypeSymbol && !this.typesAreIdentical(allInheritedSignatures.stringSignatureWithBaseOrigin.signature.returnType, currentInheritedSignature.returnType, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_of_string_indexer_of_types_0_and_1_are_not_identical, [allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - allInheritedSignatures.stringSignatureWithBaseOrigin = new SignatureWithBaseOrigin(currentInheritedSignature, baseTypeSymbol); - } - } else if (parameterTypeIsNumber) { - if (allInheritedSignatures.numberSignatureWithBaseOrigin) { - if (allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin !== baseTypeSymbol && !this.typesAreIdentical(allInheritedSignatures.numberSignatureWithBaseOrigin.signature.returnType, currentInheritedSignature.returnType, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_of_number_indexer_of_types_0_and_1_are_not_identical, [allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - allInheritedSignatures.numberSignatureWithBaseOrigin = new SignatureWithBaseOrigin(currentInheritedSignature, baseTypeSymbol); - } - } - } - - return false; - }; - - PullTypeResolver.prototype.checkInheritedMembersAgainstInheritedIndexSignatures = function (interfaceName, interfaceSymbol, inheritedIndexSignatures, inheritedMembers, context) { - if (!inheritedIndexSignatures.stringSignatureWithBaseOrigin && !inheritedIndexSignatures.numberSignatureWithBaseOrigin) { - return false; - } - - var comparisonInfo = new TypeComparisonInfo(); - var stringSignature = inheritedIndexSignatures.stringSignatureWithBaseOrigin && inheritedIndexSignatures.stringSignatureWithBaseOrigin.signature; - var numberSignature = inheritedIndexSignatures.numberSignatureWithBaseOrigin && inheritedIndexSignatures.numberSignatureWithBaseOrigin.signature; - for (var memberName in inheritedMembers) { - var memberWithBaseOrigin = inheritedMembers[memberName]; - if (!memberWithBaseOrigin) { - continue; - } - - var relevantSignature = this.determineRelevantIndexerForMember(memberWithBaseOrigin.memberSymbol, numberSignature, stringSignature); - if (!relevantSignature) { - continue; - } - - var relevantSignatureIsNumberSignature = relevantSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol; - var signatureBaseOrigin = relevantSignatureIsNumberSignature ? inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin : inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin; - - if (signatureBaseOrigin === memberWithBaseOrigin.baseOrigin) { - continue; - } - - var memberIsSubtype = this.sourceIsAssignableToTarget(memberWithBaseOrigin.memberSymbol.type, relevantSignature.returnType, interfaceName, context, comparisonInfo); - - if (!memberIsSubtype) { - var enclosingSymbol = this.getEnclosingSymbolForAST(interfaceName); - if (relevantSignatureIsNumberSignature) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3, [memberName, memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(enclosingSymbol), memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - } else { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3, [memberName, memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(enclosingSymbol), memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - } - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.checkThatInheritedNumberSignatureIsSubtypeOfInheritedStringSignature = function (interfaceName, interfaceSymbol, inheritedIndexSignatures, context) { - if (inheritedIndexSignatures.numberSignatureWithBaseOrigin && inheritedIndexSignatures.stringSignatureWithBaseOrigin) { - if (inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin === inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin) { - return false; - } - - var comparisonInfo = new TypeComparisonInfo(); - var signatureIsSubtype = this.sourceIsAssignableToTarget(inheritedIndexSignatures.numberSignatureWithBaseOrigin.signature.returnType, inheritedIndexSignatures.stringSignatureWithBaseOrigin.signature.returnType, interfaceName, context, comparisonInfo); - - if (!signatureIsSubtype) { - var enclosingSymbol = this.getEnclosingSymbolForAST(interfaceName); - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2, [ - inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), - inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [ - interfaceSymbol.getDisplayName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), - inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.checkAssignability = function (ast, source, target, context) { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(source, target, ast, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.isReference = function (ast, astSymbol) { - if (ast.kind() === 217 /* ParenthesizedExpression */) { - return this.isReference(ast.expression, astSymbol); - } - - if (ast.kind() !== 11 /* IdentifierName */ && ast.kind() !== 212 /* MemberAccessExpression */ && ast.kind() !== 221 /* ElementAccessExpression */) { - return false; - } - - if (ast.kind() === 11 /* IdentifierName */) { - if (astSymbol.kind === 512 /* Variable */ && astSymbol.anyDeclHasFlag(4096 /* Enum */)) { - return false; - } - - if (astSymbol.kind === 512 /* Variable */ && astSymbol.anyDeclHasFlag(102400 /* SomeInitializedModule */)) { - return false; - } - - if (astSymbol.kind === 32768 /* ConstructorMethod */ || astSymbol.kind === 16384 /* Function */) { - return false; - } - } - - if (ast.kind() === 212 /* MemberAccessExpression */ && astSymbol.kind === 67108864 /* EnumMember */) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.checkForSuperMemberAccess = function (expression, name, resolvedName, context) { - if (resolvedName) { - if (expression.kind() === 50 /* SuperKeyword */ && !resolvedName.isError() && resolvedName.kind !== 65536 /* Method */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword)); - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.getEnclosingDeclForAST = function (ast) { - return this.semanticInfoChain.getEnclosingDecl(ast); - }; - - PullTypeResolver.prototype.getEnclosingSymbolForAST = function (ast) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - return enclosingDecl ? enclosingDecl.getSymbol() : null; - }; - - PullTypeResolver.prototype.checkForPrivateMemberAccess = function (name, expressionType, resolvedName, context) { - if (resolvedName) { - if (resolvedName.anyDeclHasFlag(2 /* Private */)) { - var memberContainer = resolvedName.getContainer(); - if (memberContainer && memberContainer.kind === 33554432 /* ConstructorType */) { - memberContainer = memberContainer.getAssociatedContainerType(); - } - - if (memberContainer && memberContainer.isClass()) { - var memberClass = memberContainer.getDeclarations()[0].ast(); - TypeScript.Debug.assert(memberClass); - - var containingClass = this.getEnclosingClassDeclaration(name); - - if (!containingClass || containingClass !== memberClass) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode._0_1_is_inaccessible, [memberContainer.toString(null, false), name.text()])); - return true; - } - } - } - } - - return false; - }; - - PullTypeResolver.prototype.instantiateType = function (type, typeParameterArgumentMap) { - if (type.isPrimitive()) { - return type; - } - - if (type.isError()) { - return type; - } - - if (typeParameterArgumentMap[type.pullSymbolID]) { - return typeParameterArgumentMap[type.pullSymbolID]; - } - - type._resolveDeclaredSymbol(); - if (type.isTypeParameter()) { - return this.instantiateTypeParameter(type, typeParameterArgumentMap); - } - - if (type.wrapsSomeTypeParameter(typeParameterArgumentMap)) { - return TypeScript.PullInstantiatedTypeReferenceSymbol.create(this, type, typeParameterArgumentMap); - } - - return type; - }; - - PullTypeResolver.prototype.instantiateTypeParameter = function (typeParameter, typeParameterArgumentMap) { - var constraint = typeParameter.getConstraint(); - if (!constraint) { - return typeParameter; - } - - var instantiatedConstraint = this.instantiateType(constraint, typeParameterArgumentMap); - - if (instantiatedConstraint == constraint) { - return typeParameter; - } - - var rootTypeParameter = typeParameter.getRootSymbol(); - var instantiation = rootTypeParameter.getSpecialization([instantiatedConstraint]); - if (instantiation) { - return instantiation; - } - - instantiation = new TypeScript.PullInstantiatedTypeParameterSymbol(rootTypeParameter, instantiatedConstraint); - return instantiation; - }; - - PullTypeResolver.prototype.instantiateSignature = function (signature, typeParameterArgumentMap) { - if (!signature.wrapsSomeTypeParameter(typeParameterArgumentMap)) { - return signature; - } - - var rootSignature = signature.getRootSymbol(); - var mutableTypeParameterMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(typeParameterArgumentMap); - TypeScript.PullInstantiationHelpers.instantiateTypeArgument(this, signature, mutableTypeParameterMap); - - var instantiatedSignature = rootSignature.getSpecialization(mutableTypeParameterMap.typeParameterArgumentMap); - if (instantiatedSignature) { - return instantiatedSignature; - } - - TypeScript.PullInstantiationHelpers.cleanUpTypeArgumentMap(signature, mutableTypeParameterMap); - typeParameterArgumentMap = mutableTypeParameterMap.typeParameterArgumentMap; - - instantiatedSignature = new TypeScript.PullInstantiatedSignatureSymbol(rootSignature, typeParameterArgumentMap); - - instantiatedSignature.returnType = this.instantiateType((rootSignature.returnType || this.semanticInfoChain.anyTypeSymbol), typeParameterArgumentMap); - instantiatedSignature.functionType = this.instantiateType(rootSignature.functionType, typeParameterArgumentMap); - - var parameters = rootSignature.parameters; - var parameter = null; - - if (parameters) { - for (var j = 0; j < parameters.length; j++) { - parameter = new TypeScript.PullSymbol(parameters[j].name, 2048 /* Parameter */); - parameter.setRootSymbol(parameters[j]); - - if (parameters[j].isOptional) { - parameter.isOptional = true; - } - if (parameters[j].isVarArg) { - parameter.isVarArg = true; - instantiatedSignature.hasVarArgs = true; - } - instantiatedSignature.addParameter(parameter, parameter.isOptional); - - parameter.type = this.instantiateType(parameters[j].type, typeParameterArgumentMap); - } - } - - return instantiatedSignature; - }; - PullTypeResolver.globalTypeCheckPhase = 0; - return PullTypeResolver; - })(); - TypeScript.PullTypeResolver = PullTypeResolver; - - var TypeComparisonInfo = (function () { - function TypeComparisonInfo(sourceComparisonInfo, useSameIndent) { - this.onlyCaptureFirstError = false; - this.flags = 0 /* SuccessfulComparison */; - this.message = ""; - this.stringConstantVal = null; - this.indent = 1; - if (sourceComparisonInfo) { - this.flags = sourceComparisonInfo.flags; - this.onlyCaptureFirstError = sourceComparisonInfo.onlyCaptureFirstError; - this.stringConstantVal = sourceComparisonInfo.stringConstantVal; - this.indent = sourceComparisonInfo.indent; - if (!useSameIndent) { - this.indent++; - } - } - } - TypeComparisonInfo.prototype.indentString = function () { - var result = ""; - - for (var i = 0; i < this.indent; i++) { - result += "\t"; - } - - return result; - }; - - TypeComparisonInfo.prototype.addMessage = function (message) { - if (!this.onlyCaptureFirstError && this.message) { - this.message = this.message + TypeScript.newLine() + this.indentString() + message; - } else { - this.message = this.indentString() + message; - } - }; - return TypeComparisonInfo; - })(); - TypeScript.TypeComparisonInfo = TypeComparisonInfo; - - function getPropertyAssignmentNameTextFromIdentifier(identifier) { - if (identifier.kind() === 11 /* IdentifierName */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else if (identifier.kind() === 14 /* StringLiteral */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else if (identifier.kind() === 13 /* NumericLiteral */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - TypeScript.getPropertyAssignmentNameTextFromIdentifier = getPropertyAssignmentNameTextFromIdentifier; - - function isTypesOnlyLocation(ast) { - while (ast && ast.parent) { - switch (ast.parent.kind()) { - case 244 /* TypeAnnotation */: - return true; - case 127 /* TypeQuery */: - return false; - case 125 /* ConstructorType */: - var constructorType = ast.parent; - if (constructorType.type === ast) { - return true; - } - break; - case 123 /* FunctionType */: - var functionType = ast.parent; - if (functionType.type === ast) { - return true; - } - break; - case 239 /* Constraint */: - var constraint = ast.parent; - if (constraint.type === ast) { - return true; - } - break; - case 220 /* CastExpression */: - var castExpression = ast.parent; - return castExpression.type === ast; - case 230 /* ExtendsHeritageClause */: - case 231 /* ImplementsHeritageClause */: - return true; - case 228 /* TypeArgumentList */: - return true; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - case 129 /* FunctionDeclaration */: - case 145 /* MethodSignature */: - case 212 /* MemberAccessExpression */: - case 242 /* Parameter */: - return false; - } - - ast = ast.parent; - } - - return false; - } - TypeScript.isTypesOnlyLocation = isTypesOnlyLocation; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.declCacheHit = 0; - TypeScript.declCacheMiss = 0; - TypeScript.symbolCacheHit = 0; - TypeScript.symbolCacheMiss = 0; - - var sentinalEmptyArray = []; - - var SemanticInfoChain = (function () { - function SemanticInfoChain(compiler, logger) { - this.compiler = compiler; - this.logger = logger; - this.documents = []; - this.fileNameToDocument = TypeScript.createIntrinsicsObject(); - this.anyTypeDecl = null; - this.booleanTypeDecl = null; - this.numberTypeDecl = null; - this.stringTypeDecl = null; - this.nullTypeDecl = null; - this.undefinedTypeDecl = null; - this.voidTypeDecl = null; - this.undefinedValueDecl = null; - this.anyTypeSymbol = null; - this.booleanTypeSymbol = null; - this.numberTypeSymbol = null; - this.stringTypeSymbol = null; - this.nullTypeSymbol = null; - this.undefinedTypeSymbol = null; - this.voidTypeSymbol = null; - this.undefinedValueSymbol = null; - this.emptyTypeSymbol = null; - this.astSymbolMap = []; - this.astAliasSymbolMap = []; - this.astCallResolutionDataMap = []; - this.declSymbolMap = []; - this.declSignatureSymbolMap = []; - this.declCache = null; - this.symbolCache = null; - this.fileNameToDiagnostics = null; - this._binder = null; - this._resolver = null; - this._topLevelDecls = null; - this._fileNames = null; - var globalDecl = new TypeScript.RootPullDecl("", "", 0 /* Global */, 0 /* None */, this, false); - this.documents[0] = new TypeScript.Document(this.compiler, this, "", [], null, 0 /* None */, 0, false, null, globalDecl); - - this.anyTypeDecl = new TypeScript.NormalPullDecl("any", "any", 2 /* Primitive */, 0 /* None */, globalDecl); - this.booleanTypeDecl = new TypeScript.NormalPullDecl("boolean", "boolean", 2 /* Primitive */, 0 /* None */, globalDecl); - this.numberTypeDecl = new TypeScript.NormalPullDecl("number", "number", 2 /* Primitive */, 0 /* None */, globalDecl); - this.stringTypeDecl = new TypeScript.NormalPullDecl("string", "string", 2 /* Primitive */, 0 /* None */, globalDecl); - this.voidTypeDecl = new TypeScript.NormalPullDecl("void", "void", 2 /* Primitive */, 0 /* None */, globalDecl); - - this.nullTypeDecl = new TypeScript.RootPullDecl("null", "", 2 /* Primitive */, 0 /* None */, this, false); - this.undefinedTypeDecl = new TypeScript.RootPullDecl("undefined", "", 2 /* Primitive */, 0 /* None */, this, false); - this.undefinedValueDecl = new TypeScript.NormalPullDecl("undefined", "undefined", 512 /* Variable */, 8 /* Ambient */, globalDecl); - - this.invalidate(); - } - SemanticInfoChain.prototype.getDocument = function (fileName) { - var document = this.fileNameToDocument[fileName]; - return document || null; - }; - - SemanticInfoChain.prototype.lineMap = function (fileName) { - return this.getDocument(fileName).lineMap(); - }; - - SemanticInfoChain.prototype.fileNames = function () { - if (this._fileNames === null) { - this._fileNames = this.documents.slice(1).map(function (s) { - return s.fileName; - }); - } - - return this._fileNames; - }; - - SemanticInfoChain.prototype.bindPrimitiveSymbol = function (decl, newSymbol) { - newSymbol.addDeclaration(decl); - decl.setSymbol(newSymbol); - newSymbol.setResolved(); - - return newSymbol; - }; - - SemanticInfoChain.prototype.addPrimitiveTypeSymbol = function (decl) { - var newSymbol = new TypeScript.PullPrimitiveTypeSymbol(decl.name); - return this.bindPrimitiveSymbol(decl, newSymbol); - }; - - SemanticInfoChain.prototype.addPrimitiveValueSymbol = function (decl, type) { - var newSymbol = new TypeScript.PullSymbol(decl.name, 512 /* Variable */); - newSymbol.type = type; - return this.bindPrimitiveSymbol(decl, newSymbol); - }; - - SemanticInfoChain.prototype.resetGlobalSymbols = function () { - this.anyTypeSymbol = this.addPrimitiveTypeSymbol(this.anyTypeDecl); - this.booleanTypeSymbol = this.addPrimitiveTypeSymbol(this.booleanTypeDecl); - this.numberTypeSymbol = this.addPrimitiveTypeSymbol(this.numberTypeDecl); - this.stringTypeSymbol = this.addPrimitiveTypeSymbol(this.stringTypeDecl); - this.voidTypeSymbol = this.addPrimitiveTypeSymbol(this.voidTypeDecl); - this.nullTypeSymbol = this.addPrimitiveTypeSymbol(this.nullTypeDecl); - this.undefinedTypeSymbol = this.addPrimitiveTypeSymbol(this.undefinedTypeDecl); - this.undefinedValueSymbol = this.addPrimitiveValueSymbol(this.undefinedValueDecl, this.undefinedTypeSymbol); - - var emptyTypeDecl = new TypeScript.PullSynthesizedDecl("{}", "{}", 8388608 /* ObjectType */, 0 /* None */, null, this); - var emptyTypeSymbol = new TypeScript.PullTypeSymbol("{}", 8388608 /* ObjectType */); - emptyTypeDecl.setSymbol(emptyTypeSymbol); - emptyTypeSymbol.addDeclaration(emptyTypeDecl); - emptyTypeSymbol.setResolved(); - this.emptyTypeSymbol = emptyTypeSymbol; - }; - - SemanticInfoChain.prototype.addDocument = function (document) { - var fileName = document.fileName; - - var existingIndex = TypeScript.ArrayUtilities.indexOf(this.documents, function (u) { - return u.fileName === fileName; - }); - if (existingIndex < 0) { - this.documents.push(document); - } else { - this.documents[existingIndex] = document; - } - - this.fileNameToDocument[fileName] = document; - - this.invalidate(); - }; - - SemanticInfoChain.prototype.removeDocument = function (fileName) { - TypeScript.Debug.assert(fileName !== "", "Can't remove the semantic info for the global decl."); - var index = TypeScript.ArrayUtilities.indexOf(this.documents, function (u) { - return u.fileName === fileName; - }); - if (index > 0) { - this.fileNameToDocument[fileName] = undefined; - this.documents.splice(index, 1); - this.invalidate(); - } - }; - - SemanticInfoChain.prototype.getDeclPathCacheID = function (declPath, declKind) { - var cacheID = ""; - - for (var i = 0; i < declPath.length; i++) { - cacheID += "#" + declPath[i]; - } - - return cacheID + "#" + declKind.toString(); - }; - - SemanticInfoChain.prototype.findTopLevelSymbol = function (name, kind, doNotGoPastThisDecl) { - var cacheID = this.getDeclPathCacheID([name], kind); - - var symbol = this.symbolCache[cacheID]; - - if (!symbol) { - for (var i = 0, n = this.documents.length; i < n; i++) { - var topLevelDecl = this.documents[i].topLevelDecl(); - - var symbol = this.findTopLevelSymbolInDecl(topLevelDecl, name, kind, doNotGoPastThisDecl); - if (symbol) { - break; - } - - if (doNotGoPastThisDecl && topLevelDecl.name === doNotGoPastThisDecl.fileName()) { - return null; - } - } - - if (symbol) { - this.symbolCache[cacheID] = symbol; - } - } - - return symbol; - }; - - SemanticInfoChain.prototype.findTopLevelSymbolInDecl = function (topLevelDecl, name, kind, doNotGoPastThisDecl) { - var doNotGoPastThisPosition = doNotGoPastThisDecl && doNotGoPastThisDecl.fileName() === topLevelDecl.fileName() ? doNotGoPastThisDecl.ast().start() : -1; - - var foundDecls = topLevelDecl.searchChildDecls(name, kind); - - for (var j = 0; j < foundDecls.length; j++) { - var foundDecl = foundDecls[j]; - - if (doNotGoPastThisPosition !== -1 && foundDecl.ast() && foundDecl.ast().start() > doNotGoPastThisPosition) { - break; - } - - var symbol = foundDecls[j].getSymbol(); - if (symbol) { - return symbol; - } - } - - return null; - }; - - SemanticInfoChain.prototype.findExternalModule = function (id) { - id = TypeScript.normalizePath(id); - - var tsFile = id + ".ts"; - var tsCacheID = this.getDeclPathCacheID([tsFile], 32 /* DynamicModule */); - symbol = this.symbolCache[tsCacheID]; - if (symbol != undefined) { - return symbol; - } - - var dtsFile = id + ".d.ts"; - var dtsCacheID = this.getDeclPathCacheID([dtsFile], 32 /* DynamicModule */); - var symbol = this.symbolCache[dtsCacheID]; - if (symbol) { - return symbol; - } - - var dtsSymbol; - for (var i = 0; i < this.documents.length; i++) { - var document = this.documents[i]; - var topLevelDecl = document.topLevelDecl(); - - if (topLevelDecl.isExternalModule()) { - var isTsFile = document.fileName === tsFile; - if (isTsFile || document.fileName === dtsFile) { - var dynamicModuleDecl = topLevelDecl.getChildDecls()[0]; - symbol = dynamicModuleDecl.getSymbol(); - - if (isTsFile) { - this.symbolCache[tsCacheID] = symbol; - - return symbol; - } else { - dtsSymbol = symbol; - } - } - } - } - - if (dtsSymbol) { - this.symbolCache[dtsCacheID] = symbol; - return dtsSymbol; - } - - this.symbolCache[dtsCacheID] = null; - this.symbolCache[tsCacheID] = null; - - return null; - }; - - SemanticInfoChain.prototype.findAmbientExternalModuleInGlobalContext = function (id) { - var cacheID = this.getDeclPathCacheID([id], 32 /* DynamicModule */); - - var symbol = this.symbolCache[cacheID]; - if (symbol == undefined) { - symbol = null; - for (var i = 0; i < this.documents.length; i++) { - var document = this.documents[i]; - var topLevelDecl = document.topLevelDecl(); - - if (!topLevelDecl.isExternalModule()) { - var dynamicModules = topLevelDecl.searchChildDecls(id, 32 /* DynamicModule */); - if (dynamicModules.length) { - symbol = dynamicModules[0].getSymbol(); - break; - } - } - } - - this.symbolCache[cacheID] = symbol; - } - - return symbol; - }; - - SemanticInfoChain.prototype.findDecls = function (declPath, declKind) { - var cacheID = this.getDeclPathCacheID(declPath, declKind); - - if (declPath.length) { - var cachedDecls = this.declCache[cacheID]; - - if (cachedDecls && cachedDecls.length) { - TypeScript.declCacheHit++; - return cachedDecls; - } - } - - TypeScript.declCacheMiss++; - - var declsToSearch = this.topLevelDecls(); - - var decls = TypeScript.sentinelEmptyArray; - var path; - var foundDecls = TypeScript.sentinelEmptyArray; - - for (var i = 0; i < declPath.length; i++) { - path = declPath[i]; - decls = TypeScript.sentinelEmptyArray; - - var kind = (i === declPath.length - 1) ? declKind : 164 /* SomeContainer */; - for (var j = 0; j < declsToSearch.length; j++) { - foundDecls = declsToSearch[j].searchChildDecls(path, kind); - - for (var k = 0; k < foundDecls.length; k++) { - if (decls === TypeScript.sentinelEmptyArray) { - decls = []; - } - decls[decls.length] = foundDecls[k]; - } - } - - declsToSearch = decls; - - if (!declsToSearch) { - break; - } - } - - if (decls.length) { - this.declCache[cacheID] = decls; - } - - return decls; - }; - - SemanticInfoChain.prototype.findDeclsFromPath = function (declPath, declKind) { - var declString = []; - - for (var i = 0, n = declPath.length; i < n; i++) { - if (declPath[i].kind & 1 /* Script */) { - continue; - } - - declString.push(declPath[i].name); - } - - return this.findDecls(declString, declKind); - }; - - SemanticInfoChain.prototype.findSymbol = function (declPath, declType) { - var cacheID = this.getDeclPathCacheID(declPath, declType); - - if (declPath.length) { - var cachedSymbol = this.symbolCache[cacheID]; - - if (cachedSymbol) { - TypeScript.symbolCacheHit++; - return cachedSymbol; - } - } - - TypeScript.symbolCacheMiss++; - - var decls = this.findDecls(declPath, declType); - var symbol = null; - - if (decls.length) { - var decl = decls[0]; - if (TypeScript.hasFlag(decl.kind, 164 /* SomeContainer */)) { - var valueDecl = decl.getValueDecl(); - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - } - symbol = decl.getSymbol(); - - if (symbol) { - for (var i = 1; i < decls.length; i++) { - decls[i].ensureSymbolIsBound(); - } - - this.symbolCache[cacheID] = symbol; - } - } - - return symbol; - }; - - SemanticInfoChain.prototype.cacheGlobalSymbol = function (symbol, kind) { - var cacheID1 = this.getDeclPathCacheID([symbol.name], kind); - var cacheID2 = this.getDeclPathCacheID([symbol.name], symbol.kind); - - if (!this.symbolCache[cacheID1]) { - this.symbolCache[cacheID1] = symbol; - } - - if (!this.symbolCache[cacheID2]) { - this.symbolCache[cacheID2] = symbol; - } - }; - - SemanticInfoChain.prototype.invalidate = function (oldSettings, newSettings) { - if (typeof oldSettings === "undefined") { oldSettings = null; } - if (typeof newSettings === "undefined") { newSettings = null; } - TypeScript.PullTypeResolver.globalTypeCheckPhase++; - - var cleanStart = new Date().getTime(); - - this.astSymbolMap.length = 0; - this.astAliasSymbolMap.length = 0; - this.astCallResolutionDataMap.length = 0; - - this.declCache = TypeScript.createIntrinsicsObject(); - this.symbolCache = TypeScript.createIntrinsicsObject(); - this.fileNameToDiagnostics = TypeScript.createIntrinsicsObject(); - this._binder = null; - this._resolver = null; - this._topLevelDecls = null; - this._fileNames = null; - - this.declSymbolMap.length = 0; - this.declSignatureSymbolMap.length = 0; - - if (oldSettings && newSettings) { - if (this.settingsChangeAffectsSyntax(oldSettings, newSettings)) { - for (var i = 1, n = this.documents.length; i < n; i++) { - this.documents[i].invalidate(); - } - } - } - - TypeScript.pullSymbolID = 0; - - this.resetGlobalSymbols(); - - var cleanEnd = new Date().getTime(); - }; - - SemanticInfoChain.prototype.settingsChangeAffectsSyntax = function (before, after) { - return before.allowAutomaticSemicolonInsertion() !== after.allowAutomaticSemicolonInsertion() || before.codeGenTarget() !== after.codeGenTarget() || before.propagateEnumConstants() !== after.propagateEnumConstants(); - }; - - SemanticInfoChain.prototype.setSymbolForAST = function (ast, symbol) { - this.astSymbolMap[ast.syntaxID()] = symbol; - }; - - SemanticInfoChain.prototype.getSymbolForAST = function (ast) { - return this.astSymbolMap[ast.syntaxID()] || null; - }; - - SemanticInfoChain.prototype.setAliasSymbolForAST = function (ast, symbol) { - this.astAliasSymbolMap[ast.syntaxID()] = symbol; - }; - - SemanticInfoChain.prototype.getAliasSymbolForAST = function (ast) { - return this.astAliasSymbolMap[ast.syntaxID()]; - }; - - SemanticInfoChain.prototype.getCallResolutionDataForAST = function (ast) { - return this.astCallResolutionDataMap[ast.syntaxID()]; - }; - - SemanticInfoChain.prototype.setCallResolutionDataForAST = function (ast, callResolutionData) { - if (callResolutionData) { - this.astCallResolutionDataMap[ast.syntaxID()] = callResolutionData; - } - }; - - SemanticInfoChain.prototype.setSymbolForDecl = function (decl, symbol) { - this.declSymbolMap[decl.declID] = symbol; - }; - - SemanticInfoChain.prototype.getSymbolForDecl = function (decl) { - return this.declSymbolMap[decl.declID]; - }; - - SemanticInfoChain.prototype.setSignatureSymbolForDecl = function (decl, signatureSymbol) { - this.declSignatureSymbolMap[decl.declID] = signatureSymbol; - }; - - SemanticInfoChain.prototype.getSignatureSymbolForDecl = function (decl) { - return this.declSignatureSymbolMap[decl.declID]; - }; - - SemanticInfoChain.prototype.addDiagnostic = function (diagnostic) { - var fileName = diagnostic.fileName(); - var diagnostics = this.fileNameToDiagnostics[fileName]; - if (!diagnostics) { - diagnostics = []; - this.fileNameToDiagnostics[fileName] = diagnostics; - } - - diagnostics.push(diagnostic); - }; - - SemanticInfoChain.prototype.getDiagnostics = function (fileName) { - var diagnostics = this.fileNameToDiagnostics[fileName]; - return diagnostics || []; - }; - - SemanticInfoChain.prototype.getBinder = function () { - if (!this._binder) { - this._binder = new TypeScript.PullSymbolBinder(this); - } - - return this._binder; - }; - - SemanticInfoChain.prototype.getResolver = function () { - if (!this._resolver) { - this._resolver = new TypeScript.PullTypeResolver(this.compiler.compilationSettings(), this); - } - - return this._resolver; - }; - - SemanticInfoChain.prototype.addSyntheticIndexSignature = function (containingDecl, containingSymbol, ast, indexParamName, indexParamType, returnType) { - var indexSignature = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - var indexParameterSymbol = new TypeScript.PullSymbol(indexParamName, 2048 /* Parameter */); - indexParameterSymbol.type = indexParamType; - indexSignature.addParameter(indexParameterSymbol); - indexSignature.returnType = returnType; - indexSignature.setResolved(); - indexParameterSymbol.setResolved(); - - containingSymbol.addIndexSignature(indexSignature); - - var indexSigDecl = new TypeScript.PullSynthesizedDecl("", "", 4194304 /* IndexSignature */, 2048 /* Signature */, containingDecl, containingDecl.semanticInfoChain); - var indexParamDecl = new TypeScript.PullSynthesizedDecl(indexParamName, indexParamName, 2048 /* Parameter */, 0 /* None */, indexSigDecl, containingDecl.semanticInfoChain); - indexSigDecl.setSignatureSymbol(indexSignature); - indexParamDecl.setSymbol(indexParameterSymbol); - indexSignature.addDeclaration(indexSigDecl); - indexParameterSymbol.addDeclaration(indexParamDecl); - }; - - SemanticInfoChain.prototype.getDeclForAST = function (ast) { - var document = this.getDocument(ast.fileName()); - - if (document) { - return document._getDeclForAST(ast); - } - - return null; - }; - - SemanticInfoChain.prototype.getEnclosingDecl = function (ast) { - return this.getDocument(ast.fileName()).getEnclosingDecl(ast); - }; - - SemanticInfoChain.prototype.setDeclForAST = function (ast, decl) { - this.getDocument(decl.fileName())._setDeclForAST(ast, decl); - }; - - SemanticInfoChain.prototype.getASTForDecl = function (decl) { - var document = this.getDocument(decl.fileName()); - if (document) { - return document._getASTForDecl(decl); - } - - return null; - }; - - SemanticInfoChain.prototype.setASTForDecl = function (decl, ast) { - this.getDocument(decl.fileName())._setASTForDecl(decl, ast); - }; - - SemanticInfoChain.prototype.topLevelDecl = function (fileName) { - var document = this.getDocument(fileName); - if (document) { - return document.topLevelDecl(); - } - - return null; - }; - - SemanticInfoChain.prototype.topLevelDecls = function () { - if (!this._topLevelDecls) { - this._topLevelDecls = TypeScript.ArrayUtilities.select(this.documents, function (u) { - return u.topLevelDecl(); - }); - } - - return this._topLevelDecls; - }; - - SemanticInfoChain.prototype.addDiagnosticFromAST = function (ast, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - this.addDiagnostic(this.diagnosticFromAST(ast, diagnosticKey, _arguments, additionalLocations)); - }; - - SemanticInfoChain.prototype.diagnosticFromAST = function (ast, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - return new TypeScript.Diagnostic(ast.fileName(), this.lineMap(ast.fileName()), ast.start(), ast.width(), diagnosticKey, _arguments, additionalLocations); - }; - - SemanticInfoChain.prototype.locationFromAST = function (ast) { - return new TypeScript.Location(ast.fileName(), this.lineMap(ast.fileName()), ast.start(), ast.width()); - }; - - SemanticInfoChain.prototype.duplicateIdentifierDiagnosticFromAST = function (ast, identifier, additionalLocationAST) { - return this.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_0, [identifier], additionalLocationAST ? [this.locationFromAST(additionalLocationAST)] : null); - }; - - SemanticInfoChain.prototype.addDuplicateIdentifierDiagnosticFromAST = function (ast, identifier, additionalLocationAST) { - this.addDiagnostic(this.duplicateIdentifierDiagnosticFromAST(ast, identifier, additionalLocationAST)); - }; - return SemanticInfoChain; - })(); - TypeScript.SemanticInfoChain = SemanticInfoChain; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DeclCollectionContext = (function () { - function DeclCollectionContext(document, semanticInfoChain, propagateEnumConstants) { - this.document = document; - this.semanticInfoChain = semanticInfoChain; - this.propagateEnumConstants = propagateEnumConstants; - this.isDeclareFile = false; - this.parentChain = []; - } - DeclCollectionContext.prototype.getParent = function () { - return this.parentChain ? this.parentChain[this.parentChain.length - 1] : null; - }; - - DeclCollectionContext.prototype.pushParent = function (parentDecl) { - if (parentDecl) { - this.parentChain[this.parentChain.length] = parentDecl; - } - }; - - DeclCollectionContext.prototype.popParent = function () { - this.parentChain.length--; - }; - return DeclCollectionContext; - })(); - - function containingModuleHasExportAssignment(ast) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - var moduleDecl = ast; - return moduleDecl.moduleElements.any(function (m) { - return m.kind() === 134 /* ExportAssignment */; - }); - } else if (ast.kind() === 120 /* SourceUnit */) { - var sourceUnit = ast; - return sourceUnit.moduleElements.any(function (m) { - return m.kind() === 134 /* ExportAssignment */; - }); - } - - ast = ast.parent; - } - - return false; - } - - function isParsingAmbientModule(ast, context) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - if (TypeScript.hasModifier(ast.modifiers, 8 /* Ambient */)) { - return true; - } - } - - ast = ast.parent; - } - - return false; - } - - function preCollectImportDecls(ast, context) { - var importDecl = ast; - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (TypeScript.hasModifier(importDecl.modifiers, 1 /* Exported */) && !containingModuleHasExportAssignment(ast)) { - declFlags |= 1 /* Exported */; - } - - var decl = new TypeScript.NormalPullDecl(importDecl.identifier.valueText(), importDecl.identifier.text(), 128 /* TypeAlias */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - } - - function preCollectScriptDecls(sourceUnit, context) { - var fileName = sourceUnit.fileName(); - - var isExternalModule = context.document.isExternalModule(); - - var decl = new TypeScript.RootPullDecl(fileName, fileName, 1 /* Script */, 0 /* None */, context.semanticInfoChain, isExternalModule); - context.semanticInfoChain.setDeclForAST(sourceUnit, decl); - context.semanticInfoChain.setASTForDecl(decl, sourceUnit); - - context.isDeclareFile = context.document.isDeclareFile(); - - context.pushParent(decl); - - if (isExternalModule) { - var declFlags = 1 /* Exported */; - if (TypeScript.isDTSFile(fileName)) { - declFlags |= 8 /* Ambient */; - } - - var moduleContainsExecutableCode = containsExecutableCode(sourceUnit.moduleElements); - var kind = 32 /* DynamicModule */; - var valueText = TypeScript.quoteStr(fileName); - - var decl = new TypeScript.NormalPullDecl(valueText, fileName, kind, declFlags, context.getParent()); - - context.semanticInfoChain.setASTForDecl(decl, sourceUnit); - - context.semanticInfoChain.setDeclForAST(sourceUnit, decl); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, sourceUnit, context); - } - - context.pushParent(decl); - } - } - - function preCollectEnumDecls(enumDecl, context) { - var declFlags = 0 /* None */; - var enumName = enumDecl.identifier.valueText(); - - if ((TypeScript.hasModifier(enumDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(enumDecl, context)) && !containingModuleHasExportAssignment(enumDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(enumDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(enumDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - declFlags |= 4096 /* Enum */; - var kind = 64 /* Enum */; - - var enumDeclaration = new TypeScript.NormalPullDecl(enumName, enumDecl.identifier.text(), kind, declFlags, context.getParent()); - context.semanticInfoChain.setDeclForAST(enumDecl, enumDeclaration); - context.semanticInfoChain.setASTForDecl(enumDeclaration, enumDecl); - - var valueDecl = new TypeScript.NormalPullDecl(enumDeclaration.name, enumDeclaration.getDisplayName(), 512 /* Variable */, enumDeclaration.flags, context.getParent()); - enumDeclaration.setValueDecl(valueDecl); - context.semanticInfoChain.setASTForDecl(valueDecl, enumDecl); - - context.pushParent(enumDeclaration); - } - - function createEnumElementDecls(propertyDecl, context) { - var parent = context.getParent(); - - var decl = new TypeScript.PullEnumElementDecl(propertyDecl.propertyName.valueText(), propertyDecl.propertyName.text(), parent); - context.semanticInfoChain.setDeclForAST(propertyDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyDecl); - } - - function preCollectModuleDecls(moduleDecl, context) { - var declFlags = 0 /* None */; - - var moduleContainsExecutableCode = containsExecutableCode(moduleDecl.moduleElements); - - var isDynamic = moduleDecl.stringLiteral !== null; - - if ((TypeScript.hasModifier(moduleDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(moduleDecl, context)) && !containingModuleHasExportAssignment(moduleDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(moduleDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(moduleDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var kind = isDynamic ? 32 /* DynamicModule */ : 4 /* Container */; - - if (moduleDecl.stringLiteral) { - var valueText = TypeScript.quoteStr(moduleDecl.stringLiteral.valueText()); - var text = moduleDecl.stringLiteral.text(); - - var decl = new TypeScript.NormalPullDecl(valueText, text, kind, declFlags, context.getParent()); - - context.semanticInfoChain.setDeclForAST(moduleDecl, decl); - context.semanticInfoChain.setDeclForAST(moduleDecl.stringLiteral, decl); - context.semanticInfoChain.setASTForDecl(decl, moduleDecl.stringLiteral); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, moduleDecl.stringLiteral, context); - } - - context.pushParent(decl); - } else { - var moduleNames = getModuleNames(moduleDecl.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - var moduleName = moduleNames[i]; - - var specificFlags = declFlags; - if (i > 0) { - specificFlags |= 1 /* Exported */; - } - - var decl = new TypeScript.NormalPullDecl(moduleName.valueText(), moduleName.text(), kind, specificFlags, context.getParent()); - - context.semanticInfoChain.setDeclForAST(moduleDecl, decl); - context.semanticInfoChain.setDeclForAST(moduleName, decl); - context.semanticInfoChain.setASTForDecl(decl, moduleName); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, moduleName, context); - } - - context.pushParent(decl); - } - } - } - - function getModuleNames(name, result) { - result = result || []; - - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } else { - result.push(name); - } - - return result; - } - TypeScript.getModuleNames = getModuleNames; - - function createModuleVariableDecl(decl, moduleNameAST, context) { - decl.setFlags(decl.flags | getInitializationFlag(decl)); - - var valueDecl = new TypeScript.NormalPullDecl(decl.name, decl.getDisplayName(), 512 /* Variable */, decl.flags, context.getParent()); - decl.setValueDecl(valueDecl); - context.semanticInfoChain.setASTForDecl(valueDecl, moduleNameAST); - } - - function containsExecutableCode(members) { - for (var i = 0, n = members.childCount(); i < n; i++) { - var member = members.childAt(i); - - if (member.kind() === 130 /* ModuleDeclaration */) { - var moduleDecl = member; - - if (containsExecutableCode(moduleDecl.moduleElements)) { - return true; - } - } else if (member.kind() === 133 /* ImportDeclaration */) { - if (TypeScript.hasModifier(member.modifiers, 1 /* Exported */)) { - return true; - } - } else if (member.kind() !== 128 /* InterfaceDeclaration */) { - return true; - } - } - - return false; - } - - function preCollectClassDecls(classDecl, context) { - var declFlags = 0 /* None */; - - if ((TypeScript.hasModifier(classDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(classDecl, context)) && !containingModuleHasExportAssignment(classDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(classDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(classDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(classDecl.identifier.valueText(), classDecl.identifier.text(), 8 /* Class */, declFlags, parent); - - var constructorDecl = new TypeScript.NormalPullDecl(classDecl.identifier.valueText(), classDecl.identifier.text(), 512 /* Variable */, declFlags | 16384 /* ClassConstructorVariable */, parent); - - decl.setValueDecl(constructorDecl); - - context.semanticInfoChain.setDeclForAST(classDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, classDecl); - context.semanticInfoChain.setASTForDecl(constructorDecl, classDecl); - - context.pushParent(decl); - } - - function preCollectObjectTypeDecls(objectType, context) { - if (objectType.parent.kind() === 128 /* InterfaceDeclaration */) { - return; - } - - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", 8388608 /* ObjectType */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(objectType, decl); - context.semanticInfoChain.setASTForDecl(decl, objectType); - - context.pushParent(decl); - } - - function preCollectInterfaceDecls(interfaceDecl, context) { - var declFlags = 0 /* None */; - - if ((TypeScript.hasModifier(interfaceDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(interfaceDecl, context)) && !containingModuleHasExportAssignment(interfaceDecl)) { - declFlags |= 1 /* Exported */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(interfaceDecl.identifier.valueText(), interfaceDecl.identifier.text(), 16 /* Interface */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(interfaceDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, interfaceDecl); - - context.pushParent(decl); - } - - function preCollectParameterDecl(argDecl, context) { - var declFlags = 0 /* None */; - - if (TypeScript.hasModifier(argDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (argDecl.questionToken !== null || argDecl.equalsValueClause !== null || argDecl.dotDotDotToken !== null) { - declFlags |= 128 /* Optional */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(argDecl.identifier.valueText(), argDecl.identifier.text(), 2048 /* Parameter */, declFlags, parent); - - if (argDecl.equalsValueClause) { - parent.flags |= 33554432 /* HasDefaultArgs */; - } - - if (parent.kind === 32768 /* ConstructorMethod */) { - decl.setFlag(67108864 /* ConstructorParameter */); - } - - var isPublicOrPrivate = TypeScript.hasModifier(argDecl.modifiers, 4 /* Public */ | 2 /* Private */); - var isInConstructor = parent.kind === 32768 /* ConstructorMethod */; - if (isPublicOrPrivate && isInConstructor) { - var parentsParent = context.parentChain[context.parentChain.length - 2]; - - var propDeclFlags = declFlags & ~128 /* Optional */; - var propDecl = new TypeScript.NormalPullDecl(argDecl.identifier.valueText(), argDecl.identifier.text(), 4096 /* Property */, propDeclFlags, parentsParent); - propDecl.setValueDecl(decl); - decl.setFlag(8388608 /* PropertyParameter */); - propDecl.setFlag(8388608 /* PropertyParameter */); - - if (parent.kind === 32768 /* ConstructorMethod */) { - propDecl.setFlag(67108864 /* ConstructorParameter */); - } - - context.semanticInfoChain.setASTForDecl(decl, argDecl); - context.semanticInfoChain.setASTForDecl(propDecl, argDecl); - context.semanticInfoChain.setDeclForAST(argDecl, propDecl); - } else { - context.semanticInfoChain.setASTForDecl(decl, argDecl); - context.semanticInfoChain.setDeclForAST(argDecl, decl); - } - - parent.addVariableDeclToGroup(decl); - } - - function preCollectTypeParameterDecl(typeParameterDecl, context) { - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(typeParameterDecl.identifier.valueText(), typeParameterDecl.identifier.text(), 8192 /* TypeParameter */, declFlags, parent); - context.semanticInfoChain.setASTForDecl(decl, typeParameterDecl); - context.semanticInfoChain.setDeclForAST(typeParameterDecl, decl); - } - - function createPropertySignature(propertyDecl, context) { - var declFlags = 4 /* Public */; - var parent = context.getParent(); - var declType = 4096 /* Property */; - - if (propertyDecl.questionToken !== null) { - declFlags |= 128 /* Optional */; - } - - var decl = new TypeScript.NormalPullDecl(propertyDecl.propertyName.valueText(), propertyDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(propertyDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyDecl); - } - - function createMemberVariableDeclaration(memberDecl, context) { - var declFlags = 0 /* None */; - var declType = 4096 /* Property */; - - if (TypeScript.hasModifier(memberDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (TypeScript.hasModifier(memberDecl.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(memberDecl.variableDeclarator.propertyName.valueText(), memberDecl.variableDeclarator.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(memberDecl, decl); - context.semanticInfoChain.setDeclForAST(memberDecl.variableDeclarator, decl); - context.semanticInfoChain.setASTForDecl(decl, memberDecl); - } - - function createVariableDeclaration(varDecl, context) { - var declFlags = 0 /* None */; - var declType = 512 /* Variable */; - - var modifiers = TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl); - if ((TypeScript.hasModifier(modifiers, 1 /* Exported */) || isParsingAmbientModule(varDecl, context)) && !containingModuleHasExportAssignment(varDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(modifiers, 8 /* Ambient */) || isParsingAmbientModule(varDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(varDecl.propertyName.valueText(), varDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(varDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, varDecl); - - if (parent) { - parent.addVariableDeclToGroup(decl); - } - } - - function preCollectVarDecls(ast, context) { - if (ast.parent.kind() === 136 /* MemberVariableDeclaration */) { - return; - } - - var varDecl = ast; - createVariableDeclaration(varDecl, context); - } - - function createFunctionTypeDeclaration(functionTypeDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 16777216 /* FunctionType */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(functionTypeDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, functionTypeDeclAST); - - context.pushParent(decl); - } - - function createConstructorTypeDeclaration(constructorTypeDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 33554432 /* ConstructorType */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructorTypeDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructorTypeDeclAST); - - context.pushParent(decl); - } - - function createFunctionDeclaration(funcDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 16384 /* Function */; - - if ((TypeScript.hasModifier(funcDeclAST.modifiers, 1 /* Exported */) || isParsingAmbientModule(funcDeclAST, context)) && !containingModuleHasExportAssignment(funcDeclAST)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(funcDeclAST.modifiers, 8 /* Ambient */) || isParsingAmbientModule(funcDeclAST, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - if (!funcDeclAST.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(funcDeclAST.identifier.valueText(), funcDeclAST.identifier.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(funcDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, funcDeclAST); - - context.pushParent(decl); - } - - function createAnyFunctionExpressionDeclaration(functionExpressionDeclAST, id, context, displayName) { - if (typeof displayName === "undefined") { displayName = null; } - var declFlags = 0 /* None */; - - if (functionExpressionDeclAST.kind() === 219 /* SimpleArrowFunctionExpression */ || functionExpressionDeclAST.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - declFlags |= 8192 /* ArrowFunction */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var name = id ? id.text() : ""; - var displayNameText = displayName ? displayName.text() : ""; - var decl = new TypeScript.PullFunctionExpressionDecl(name, declFlags, parent, displayNameText); - context.semanticInfoChain.setDeclForAST(functionExpressionDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, functionExpressionDeclAST); - - context.pushParent(decl); - - if (functionExpressionDeclAST.kind() === 219 /* SimpleArrowFunctionExpression */) { - var simpleArrow = functionExpressionDeclAST; - var declFlags = 4 /* Public */; - - var parent = context.getParent(); - - if (TypeScript.hasFlag(parent.flags, 2097152 /* DeclaredInAWithBlock */)) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(simpleArrow.identifier.valueText(), simpleArrow.identifier.text(), 2048 /* Parameter */, declFlags, parent); - - context.semanticInfoChain.setASTForDecl(decl, simpleArrow.identifier); - context.semanticInfoChain.setDeclForAST(simpleArrow.identifier, decl); - - parent.addVariableDeclToGroup(decl); - } - } - - function createMemberFunctionDeclaration(funcDecl, context) { - var declFlags = 0 /* None */; - var declType = 65536 /* Method */; - - if (TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (!funcDecl.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(funcDecl.propertyName.valueText(), funcDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(funcDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, funcDecl); - - context.pushParent(decl); - } - - function createIndexSignatureDeclaration(indexSignatureDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 4194304 /* IndexSignature */; - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(indexSignatureDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, indexSignatureDeclAST); - - context.pushParent(decl); - } - - function createCallSignatureDeclaration(callSignature, context) { - var isChildOfObjectType = callSignature.parent && callSignature.parent.parent && callSignature.parent.kind() === 2 /* SeparatedList */ && callSignature.parent.parent.kind() === 122 /* ObjectType */; - - if (!isChildOfObjectType) { - return; - } - - var declFlags = 2048 /* Signature */; - var declType = 1048576 /* CallSignature */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(callSignature, decl); - context.semanticInfoChain.setASTForDecl(decl, callSignature); - - context.pushParent(decl); - } - - function createMethodSignatureDeclaration(method, context) { - var declFlags = 0 /* None */; - var declType = 65536 /* Method */; - - declFlags |= 4 /* Public */; - declFlags |= 2048 /* Signature */; - - if (method.questionToken !== null) { - declFlags |= 128 /* Optional */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(method.propertyName.valueText(), method.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(method, decl); - context.semanticInfoChain.setASTForDecl(decl, method); - - context.pushParent(decl); - } - - function createConstructSignatureDeclaration(constructSignatureDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 2097152 /* ConstructSignature */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructSignatureDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructSignatureDeclAST); - - context.pushParent(decl); - } - - function createClassConstructorDeclaration(constructorDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 32768 /* ConstructorMethod */; - - if (!constructorDeclAST.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - if (parent) { - var parentFlags = parent.flags; - - if (parentFlags & 1 /* Exported */) { - declFlags |= 1 /* Exported */; - } - } - - var decl = new TypeScript.NormalPullDecl(parent.name, parent.getDisplayName(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructorDeclAST); - - context.pushParent(decl); - } - - function createGetAccessorDeclaration(getAccessorDeclAST, context) { - var declFlags = 4 /* Public */; - var declType = 262144 /* GetAccessor */; - - if (TypeScript.hasModifier(getAccessorDeclAST.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(getAccessorDeclAST.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(getAccessorDeclAST.propertyName.valueText(), getAccessorDeclAST.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(getAccessorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, getAccessorDeclAST); - - context.pushParent(decl); - } - - function createFunctionExpressionDeclaration(expression, context) { - createAnyFunctionExpressionDeclaration(expression, expression.identifier, context); - } - - function createSetAccessorDeclaration(setAccessorDeclAST, context) { - var declFlags = 4 /* Public */; - var declType = 524288 /* SetAccessor */; - - if (TypeScript.hasModifier(setAccessorDeclAST.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(setAccessorDeclAST.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(setAccessorDeclAST.propertyName.valueText(), setAccessorDeclAST.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(setAccessorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, setAccessorDeclAST); - - context.pushParent(decl); - } - - function preCollectCatchDecls(ast, context) { - var declFlags = 0 /* None */; - var declType = 268435456 /* CatchBlock */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - - var declFlags = 0 /* None */; - var declType = 1024 /* CatchVariable */; - - var parent = context.getParent(); - - if (TypeScript.hasFlag(parent.flags, 2097152 /* DeclaredInAWithBlock */)) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(ast.identifier.valueText(), ast.identifier.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast.identifier, decl); - context.semanticInfoChain.setASTForDecl(decl, ast.identifier); - - if (parent) { - parent.addVariableDeclToGroup(decl); - } - } - - function preCollectWithDecls(ast, context) { - var declFlags = 0 /* None */; - var declType = 134217728 /* WithBlock */; - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - } - - function preCollectObjectLiteralDecls(ast, context) { - var decl = new TypeScript.NormalPullDecl("", "", 256 /* ObjectLiteral */, 0 /* None */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - } - - function preCollectSimplePropertyAssignmentDecls(propertyAssignment, context) { - var assignmentText = TypeScript.getPropertyAssignmentNameTextFromIdentifier(propertyAssignment.propertyName); - var span = TypeScript.TextSpan.fromBounds(propertyAssignment.start(), propertyAssignment.end()); - - var decl = new TypeScript.NormalPullDecl(assignmentText.memberName, assignmentText.actualText, 4096 /* Property */, 4 /* Public */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(propertyAssignment, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyAssignment); - } - - function preCollectFunctionPropertyAssignmentDecls(propertyAssignment, context) { - var assignmentText = TypeScript.getPropertyAssignmentNameTextFromIdentifier(propertyAssignment.propertyName); - - var decl = new TypeScript.NormalPullDecl(assignmentText.memberName, assignmentText.actualText, 4096 /* Property */, 4 /* Public */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(propertyAssignment, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyAssignment); - - createAnyFunctionExpressionDeclaration(propertyAssignment, propertyAssignment.propertyName, context, propertyAssignment.propertyName); - } - - function preCollectDecls(ast, context) { - switch (ast.kind()) { - case 120 /* SourceUnit */: - preCollectScriptDecls(ast, context); - break; - case 132 /* EnumDeclaration */: - preCollectEnumDecls(ast, context); - break; - case 243 /* EnumElement */: - createEnumElementDecls(ast, context); - break; - case 130 /* ModuleDeclaration */: - preCollectModuleDecls(ast, context); - break; - case 131 /* ClassDeclaration */: - preCollectClassDecls(ast, context); - break; - case 128 /* InterfaceDeclaration */: - preCollectInterfaceDecls(ast, context); - break; - case 122 /* ObjectType */: - preCollectObjectTypeDecls(ast, context); - break; - case 242 /* Parameter */: - preCollectParameterDecl(ast, context); - break; - case 136 /* MemberVariableDeclaration */: - createMemberVariableDeclaration(ast, context); - break; - case 141 /* PropertySignature */: - createPropertySignature(ast, context); - break; - case 225 /* VariableDeclarator */: - preCollectVarDecls(ast, context); - break; - case 137 /* ConstructorDeclaration */: - createClassConstructorDeclaration(ast, context); - break; - case 139 /* GetAccessor */: - createGetAccessorDeclaration(ast, context); - break; - case 140 /* SetAccessor */: - createSetAccessorDeclaration(ast, context); - break; - case 222 /* FunctionExpression */: - createFunctionExpressionDeclaration(ast, context); - break; - case 135 /* MemberFunctionDeclaration */: - createMemberFunctionDeclaration(ast, context); - break; - case 144 /* IndexSignature */: - createIndexSignatureDeclaration(ast, context); - break; - case 123 /* FunctionType */: - createFunctionTypeDeclaration(ast, context); - break; - case 125 /* ConstructorType */: - createConstructorTypeDeclaration(ast, context); - break; - case 142 /* CallSignature */: - createCallSignatureDeclaration(ast, context); - break; - case 143 /* ConstructSignature */: - createConstructSignatureDeclaration(ast, context); - break; - case 145 /* MethodSignature */: - createMethodSignatureDeclaration(ast, context); - break; - case 129 /* FunctionDeclaration */: - createFunctionDeclaration(ast, context); - break; - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - createAnyFunctionExpressionDeclaration(ast, null, context); - break; - case 133 /* ImportDeclaration */: - preCollectImportDecls(ast, context); - break; - case 238 /* TypeParameter */: - preCollectTypeParameterDecl(ast, context); - break; - case 236 /* CatchClause */: - preCollectCatchDecls(ast, context); - break; - case 163 /* WithStatement */: - preCollectWithDecls(ast, context); - break; - case 215 /* ObjectLiteralExpression */: - preCollectObjectLiteralDecls(ast, context); - break; - case 240 /* SimplePropertyAssignment */: - preCollectSimplePropertyAssignmentDecls(ast, context); - break; - case 241 /* FunctionPropertyAssignment */: - preCollectFunctionPropertyAssignmentDecls(ast, context); - break; - } - } - - function isContainer(decl) { - return decl.kind === 4 /* Container */ || decl.kind === 32 /* DynamicModule */ || decl.kind === 64 /* Enum */; - } - - function getInitializationFlag(decl) { - if (decl.kind & 4 /* Container */) { - return 32768 /* InitializedModule */; - } else if (decl.kind & 32 /* DynamicModule */) { - return 65536 /* InitializedDynamicModule */; - } - - return 0 /* None */; - } - - function hasInitializationFlag(decl) { - var kind = decl.kind; - - if (kind & 4 /* Container */) { - return (decl.flags & 32768 /* InitializedModule */) !== 0; - } else if (kind & 32 /* DynamicModule */) { - return (decl.flags & 65536 /* InitializedDynamicModule */) !== 0; - } - - return false; - } - - function postCollectDecls(ast, context) { - var currentDecl = context.getParent(); - - if (ast.kind() === 11 /* IdentifierName */ || ast.kind() === 14 /* StringLiteral */) { - if (currentDecl.kind === 4 /* Container */ || currentDecl.kind === 32 /* DynamicModule */) { - return; - } - } - - if (ast.kind() === 130 /* ModuleDeclaration */) { - var moduleDeclaration = ast; - if (moduleDeclaration.stringLiteral) { - TypeScript.Debug.assert(currentDecl.ast() === moduleDeclaration.stringLiteral); - context.popParent(); - } else { - var moduleNames = getModuleNames(moduleDeclaration.name); - for (var i = moduleNames.length - 1; i >= 0; i--) { - var moduleName = moduleNames[i]; - TypeScript.Debug.assert(currentDecl.ast() === moduleName); - context.popParent(); - currentDecl = context.getParent(); - } - } - } - - if (ast.kind() === 132 /* EnumDeclaration */) { - computeEnumElementConstantValues(ast, currentDecl, context); - } - - while (currentDecl.getParentDecl() && currentDecl.ast() === ast) { - context.popParent(); - currentDecl = context.getParent(); - } - } - - function computeEnumElementConstantValues(ast, enumDecl, context) { - TypeScript.Debug.assert(enumDecl.kind === 64 /* Enum */); - - var isAmbientEnum = TypeScript.hasFlag(enumDecl.flags, 8 /* Ambient */); - var inConstantSection = !isAmbientEnum; - var currentConstantValue = 0; - var enumMemberDecls = enumDecl.getChildDecls(); - - for (var i = 0, n = ast.enumElements.nonSeparatorCount(); i < n; i++) { - var enumElement = ast.enumElements.nonSeparatorAt(i); - var enumElementDecl = TypeScript.ArrayUtilities.first(enumMemberDecls, function (d) { - return context.semanticInfoChain.getASTForDecl(d) === enumElement; - }); - - TypeScript.Debug.assert(enumElementDecl.kind === 67108864 /* EnumMember */); - - if (enumElement.equalsValueClause === null) { - if (inConstantSection) { - enumElementDecl.constantValue = currentConstantValue; - currentConstantValue++; - } - } else { - enumElementDecl.constantValue = computeEnumElementConstantValue(enumElement.equalsValueClause.value, enumMemberDecls, context); - if (enumElementDecl.constantValue !== null && !isAmbientEnum) { - inConstantSection = true; - currentConstantValue = enumElementDecl.constantValue + 1; - } else { - inConstantSection = false; - } - } - - TypeScript.Debug.assert(enumElementDecl.constantValue !== undefined); - } - } - - function computeEnumElementConstantValue(expression, enumMemberDecls, context) { - TypeScript.Debug.assert(expression); - - if (TypeScript.ASTHelpers.isIntegerLiteralAST(expression)) { - var token; - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - token = expression.operand; - break; - default: - token = expression; - } - - var value = token.value(); - return value && expression.kind() === 165 /* NegateExpression */ ? -value : value; - } else if (context.propagateEnumConstants) { - switch (expression.kind()) { - case 11 /* IdentifierName */: - var name = expression; - var matchingEnumElement = TypeScript.ArrayUtilities.firstOrDefault(enumMemberDecls, function (d) { - return d.name === name.valueText(); - }); - - return matchingEnumElement ? matchingEnumElement.constantValue : null; - - case 202 /* LeftShiftExpression */: - var binaryExpression = expression; - var left = computeEnumElementConstantValue(binaryExpression.left, enumMemberDecls, context); - var right = computeEnumElementConstantValue(binaryExpression.right, enumMemberDecls, context); - if (left === null || right === null) { - return null; - } - - return left << right; - - case 189 /* BitwiseOrExpression */: - var binaryExpression = expression; - var left = computeEnumElementConstantValue(binaryExpression.left, enumMemberDecls, context); - var right = computeEnumElementConstantValue(binaryExpression.right, enumMemberDecls, context); - if (left === null || right === null) { - return null; - } - - return left | right; - } - - return null; - } else { - return null; - } - } - - (function (DeclarationCreator) { - function create(document, semanticInfoChain, compilationSettings) { - var declCollectionContext = new DeclCollectionContext(document, semanticInfoChain, compilationSettings.propagateEnumConstants()); - - TypeScript.getAstWalkerFactory().simpleWalk(document.sourceUnit(), preCollectDecls, postCollectDecls, declCollectionContext); - - return declCollectionContext.getParent(); - } - DeclarationCreator.create = create; - })(TypeScript.DeclarationCreator || (TypeScript.DeclarationCreator = {})); - var DeclarationCreator = TypeScript.DeclarationCreator; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PullSymbolBinder = (function () { - function PullSymbolBinder(semanticInfoChain) { - this.semanticInfoChain = semanticInfoChain; - this.declsBeingBound = []; - this.inBindingOtherDeclsWalker = new TypeScript.PullHelpers.OtherPullDeclsWalker(); - } - PullSymbolBinder.prototype.getParent = function (decl, returnInstanceType) { - if (typeof returnInstanceType === "undefined") { returnInstanceType = false; } - var parentDecl = decl.getParentDecl(); - - if (parentDecl.kind === 1 /* Script */) { - return null; - } - - var parent = parentDecl.getSymbol(); - - if (!parent && parentDecl && !parentDecl.hasBeenBound()) { - this.bindDeclToPullSymbol(parentDecl); - } - - parent = parentDecl.getSymbol(); - if (parent) { - var parentDeclKind = parentDecl.kind; - if (parentDeclKind === 262144 /* GetAccessor */) { - parent = parent.getGetter(); - } else if (parentDeclKind === 524288 /* SetAccessor */) { - parent = parent.getSetter(); - } - } - - if (parent) { - if (returnInstanceType && parent.isType() && parent.isContainer()) { - var instanceSymbol = parent.getInstanceSymbol(); - - if (instanceSymbol) { - return instanceSymbol.type; - } - } - - return parent.type; - } - - return null; - }; - - PullSymbolBinder.prototype.findDeclsInContext = function (startingDecl, declKind, searchGlobally) { - if (!searchGlobally) { - var parentDecl = startingDecl.getParentDecl(); - return parentDecl.searchChildDecls(startingDecl.name, declKind); - } - - var contextSymbolPath = startingDecl.getParentPath(); - - if (contextSymbolPath.length) { - var copyOfContextSymbolPath = []; - - for (var i = 0; i < contextSymbolPath.length; i++) { - if (contextSymbolPath[i].kind & 1 /* Script */) { - continue; - } - copyOfContextSymbolPath[copyOfContextSymbolPath.length] = contextSymbolPath[i].name; - } - - return this.semanticInfoChain.findDecls(copyOfContextSymbolPath, declKind); - } - }; - - PullSymbolBinder.prototype.getExistingSymbol = function (decl, searchKind, parent) { - var lookingForValue = (searchKind & 68147712 /* SomeValue */) !== 0; - var lookingForType = (searchKind & 58728795 /* SomeType */) !== 0; - var lookingForContainer = (searchKind & 164 /* SomeContainer */) !== 0; - var name = decl.name; - if (parent) { - var isExported = (decl.flags & 1 /* Exported */) !== 0; - - var prevSymbol = null; - if (lookingForValue) { - prevSymbol = parent.findContainedNonMember(name); - } else if (lookingForType) { - prevSymbol = parent.findContainedNonMemberType(name, searchKind); - } else if (lookingForContainer) { - prevSymbol = parent.findContainedNonMemberContainer(name, searchKind); - } - var prevIsExported = !prevSymbol; - if (!prevSymbol) { - if (lookingForValue) { - prevSymbol = parent.findMember(name, false); - } else if (lookingForType) { - prevSymbol = parent.findNestedType(name, searchKind); - } else if (lookingForContainer) { - prevSymbol = parent.findNestedContainer(name, searchKind); - } - } - - if (isExported && prevIsExported) { - return prevSymbol; - } - if (prevSymbol) { - var prevDecls = prevSymbol.getDeclarations(); - var lastPrevDecl = prevDecls[prevDecls.length - 1]; - var parentDecl = decl.getParentDecl(); - var prevParentDecl = lastPrevDecl && lastPrevDecl.getParentDecl(); - if (parentDecl !== prevParentDecl) { - return null; - } - - return prevSymbol; - } - } else { - var parentDecl = decl.getParentDecl(); - if (parentDecl && parentDecl.kind === 1 /* Script */) { - return this.semanticInfoChain.findTopLevelSymbol(name, searchKind, decl); - } else { - var prevDecls = parentDecl && parentDecl.searchChildDecls(name, searchKind); - return prevDecls[0] && prevDecls[0].getSymbol(); - } - } - - return null; - }; - - PullSymbolBinder.prototype.checkThatExportsMatch = function (decl, prevSymbol, reportError) { - if (typeof reportError === "undefined") { reportError = true; } - var isExported = (decl.flags & 1 /* Exported */) !== 0; - var prevDecls = prevSymbol.getDeclarations(); - var prevIsExported = (prevDecls[prevDecls.length - 1].flags & 1 /* Exported */) !== 0; - if ((isExported !== prevIsExported) && !prevSymbol.isSignature() && (decl.kind & 7340032 /* SomeSignature */) === 0) { - if (reportError) { - var ast = this.semanticInfoChain.getASTForDecl(decl); - this.semanticInfoChain.addDiagnosticFromAST(ast, TypeScript.DiagnosticCode.All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported, [decl.getDisplayName()]); - } - return false; - } - - return true; - }; - - PullSymbolBinder.prototype.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList = function (signature, currentSignatures) { - var signatureDecl = signature.getDeclarations()[0]; - TypeScript.Debug.assert(signatureDecl); - var enclosingDecl = signatureDecl.getParentDecl(); - var indexToInsert = TypeScript.ArrayUtilities.indexOf(currentSignatures, function (someSignature) { - return someSignature.getDeclarations()[0].getParentDecl() !== enclosingDecl; - }); - return indexToInsert < 0 ? currentSignatures.length : indexToInsert; - }; - - PullSymbolBinder.prototype.bindEnumDeclarationToPullSymbol = function (enumContainerDecl) { - var enumName = enumContainerDecl.name; - - var enumContainerSymbol = null; - var enumInstanceSymbol = null; - var moduleInstanceTypeSymbol = null; - - var enumInstanceDecl = enumContainerDecl.getValueDecl(); - - var enumDeclKind = enumContainerDecl.kind; - - var parent = this.getParent(enumContainerDecl); - var parentInstanceSymbol = this.getParent(enumContainerDecl, true); - var parentDecl = enumContainerDecl.getParentDecl(); - var enumAST = this.semanticInfoChain.getASTForDecl(enumContainerDecl); - - var isExported = enumContainerDecl.flags & 1 /* Exported */; - - var createdNewSymbol = false; - - enumContainerSymbol = this.getExistingSymbol(enumContainerDecl, 64 /* Enum */, parent); - - if (enumContainerSymbol) { - if (enumContainerSymbol.kind !== enumDeclKind) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(enumAST.identifier, enumContainerDecl.getDisplayName(), enumContainerSymbol.getDeclarations()[0].ast()); - enumContainerSymbol = null; - } else if (!this.checkThatExportsMatch(enumContainerDecl, enumContainerSymbol)) { - enumContainerSymbol = null; - } - } - - if (enumContainerSymbol) { - enumInstanceSymbol = enumContainerSymbol.getInstanceSymbol(); - } else { - enumContainerSymbol = new TypeScript.PullContainerSymbol(enumName, enumDeclKind); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(enumContainerSymbol, 64 /* Enum */); - } - } - - enumContainerSymbol.addDeclaration(enumContainerDecl); - enumContainerDecl.setSymbol(enumContainerSymbol); - - this.semanticInfoChain.setSymbolForAST(enumAST.identifier, enumContainerSymbol); - this.semanticInfoChain.setSymbolForAST(enumAST, enumContainerSymbol); - - if (!enumInstanceSymbol) { - var variableSymbol = null; - if (parentInstanceSymbol) { - if (isExported) { - variableSymbol = parentInstanceSymbol.findMember(enumName, false); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findContainedNonMember(enumName); - } - } else { - variableSymbol = parentInstanceSymbol.findContainedNonMember(enumName); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findMember(enumName, false); - } - } - - if (variableSymbol) { - var declarations = variableSymbol.getDeclarations(); - - if (declarations.length) { - var variableSymbolParentDecl = declarations[0].getParentDecl(); - - if (parentDecl !== variableSymbolParentDecl) { - variableSymbol = null; - } - } - } - } else if (!(enumContainerDecl.flags & 1 /* Exported */)) { - var siblingDecls = parentDecl.getChildDecls(); - var augmentedDecl = null; - - for (var i = 0; i < siblingDecls.length; i++) { - if (siblingDecls[i] === enumContainerDecl) { - break; - } - - if ((siblingDecls[i].name === enumName) && (siblingDecls[i].kind & 68147712 /* SomeValue */)) { - augmentedDecl = siblingDecls[i]; - break; - } - } - - if (augmentedDecl) { - variableSymbol = augmentedDecl.getSymbol(); - - if (variableSymbol) { - if (variableSymbol.isContainer()) { - variableSymbol = variableSymbol.getInstanceSymbol(); - } else if (variableSymbol && variableSymbol.isType()) { - variableSymbol = variableSymbol.getConstructorMethod(); - } - } - } - } - - if (variableSymbol) { - enumInstanceSymbol = variableSymbol; - moduleInstanceTypeSymbol = variableSymbol.type; - } else { - enumInstanceSymbol = new TypeScript.PullSymbol(enumName, 512 /* Variable */); - } - - enumContainerSymbol.setInstanceSymbol(enumInstanceSymbol); - - if (!moduleInstanceTypeSymbol) { - moduleInstanceTypeSymbol = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - enumInstanceSymbol.type = moduleInstanceTypeSymbol; - } - - moduleInstanceTypeSymbol.addDeclaration(enumContainerDecl); - - if (!moduleInstanceTypeSymbol.getAssociatedContainerType()) { - moduleInstanceTypeSymbol.setAssociatedContainerType(enumContainerSymbol); - } - } - - if (createdNewSymbol && parent) { - if (enumContainerDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(enumContainerSymbol); - } else { - parent.addEnclosedNonMemberType(enumContainerSymbol); - } - } - - if (createdNewSymbol) { - this.bindEnumIndexerDeclsToPullSymbols(enumContainerSymbol); - } - var valueDecl = enumContainerDecl.getValueDecl(); - - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - }; - - PullSymbolBinder.prototype.bindEnumIndexerDeclsToPullSymbols = function (enumContainerSymbol) { - var enumContainerInstanceTypeSymbol = enumContainerSymbol.getInstanceSymbol().type; - - var syntheticIndexerParameterSymbol = new TypeScript.PullSymbol("x", 2048 /* Parameter */); - syntheticIndexerParameterSymbol.type = this.semanticInfoChain.numberTypeSymbol; - syntheticIndexerParameterSymbol.setResolved(); - syntheticIndexerParameterSymbol.setIsSynthesized(); - - var syntheticIndexerSignatureSymbol = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - syntheticIndexerSignatureSymbol.addParameter(syntheticIndexerParameterSymbol); - syntheticIndexerSignatureSymbol.returnType = this.semanticInfoChain.stringTypeSymbol; - syntheticIndexerSignatureSymbol.setResolved(); - syntheticIndexerSignatureSymbol.setIsSynthesized(); - - enumContainerInstanceTypeSymbol.addIndexSignature(syntheticIndexerSignatureSymbol); - }; - - PullSymbolBinder.prototype.findExistingVariableSymbolForModuleValueDecl = function (decl) { - var isExported = TypeScript.hasFlag(decl.flags, 1 /* Exported */); - var modName = decl.name; - var parentInstanceSymbol = this.getParent(decl, true); - var parentDecl = decl.getParentDecl(); - - var variableSymbol = null; - - if (parentInstanceSymbol) { - if (isExported) { - variableSymbol = parentInstanceSymbol.findMember(modName, false); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findContainedNonMember(modName); - } - } else { - variableSymbol = parentInstanceSymbol.findContainedNonMember(modName); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findMember(modName, false); - } - } - - if (variableSymbol) { - var declarations = variableSymbol.getDeclarations(); - - if (declarations.length) { - var variableSymbolParentDecl = declarations[0].getParentDecl(); - var isExportedOrHasTheSameParent = isExported || (parentDecl === variableSymbolParentDecl); - - var canReuseVariableSymbol = isExportedOrHasTheSameParent && this.checkThatExportsMatch(decl, variableSymbol, false); - - if (!canReuseVariableSymbol) { - variableSymbol = null; - } - } - } - } else if (!isExported) { - var siblingDecls = parentDecl.getChildDecls(); - - for (var i = 0; i < siblingDecls.length; i++) { - var sibling = siblingDecls[i]; - - var siblingIsSomeValue = TypeScript.hasFlag(sibling.kind, 68147712 /* SomeValue */); - var siblingIsFunctionOrHasImplictVarFlag = TypeScript.hasFlag(sibling.kind, 1032192 /* SomeFunction */) || TypeScript.hasFlag(sibling.flags, 118784 /* ImplicitVariable */); - - var isSiblingAnAugmentableVariable = sibling !== decl && sibling !== decl.getValueDecl() && sibling.name === modName && siblingIsSomeValue && siblingIsFunctionOrHasImplictVarFlag; - - if (isSiblingAnAugmentableVariable) { - if (sibling.hasSymbol()) { - variableSymbol = sibling.getSymbol(); - if (variableSymbol.isContainer()) { - variableSymbol = variableSymbol.getInstanceSymbol(); - } else if (variableSymbol && variableSymbol.isType()) { - variableSymbol = variableSymbol.getConstructorMethod(); - } - - break; - } - } - } - } - return variableSymbol; - }; - - PullSymbolBinder.prototype.bindModuleDeclarationToPullSymbol = function (moduleContainerDecl) { - var modName = moduleContainerDecl.name; - - var moduleContainerTypeSymbol = null; - var moduleKind = moduleContainerDecl.kind; - - var parent = this.getParent(moduleContainerDecl); - var parentInstanceSymbol = this.getParent(moduleContainerDecl, true); - var parentDecl = moduleContainerDecl.getParentDecl(); - var moduleNameAST = this.semanticInfoChain.getASTForDecl(moduleContainerDecl); - var moduleDeclAST = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(moduleNameAST); - if (!moduleDeclAST) { - TypeScript.Debug.assert(moduleKind === 32 /* DynamicModule */); - TypeScript.Debug.assert(moduleNameAST.kind() === 120 /* SourceUnit */); - - moduleDeclAST = moduleNameAST; - } - - var isExported = TypeScript.hasFlag(moduleContainerDecl.flags, 1 /* Exported */); - var searchKind = 164 /* SomeContainer */; - var isInitializedModule = (moduleContainerDecl.flags & 102400 /* SomeInitializedModule */) !== 0; - - if (parent && moduleKind === 32 /* DynamicModule */) { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameAST, TypeScript.DiagnosticCode.Ambient_external_module_declaration_must_be_defined_in_global_context, null); - } - - var createdNewSymbol = false; - - moduleContainerTypeSymbol = this.getExistingSymbol(moduleContainerDecl, searchKind, parent); - - if (moduleContainerTypeSymbol) { - if (moduleContainerTypeSymbol.kind !== moduleKind) { - if (isInitializedModule) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(moduleNameAST, moduleContainerDecl.getDisplayName(), moduleContainerTypeSymbol.getDeclarations()[0].ast()); - } - - moduleContainerTypeSymbol = null; - } else if (moduleKind === 32 /* DynamicModule */) { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameAST, TypeScript.DiagnosticCode.Ambient_external_module_declaration_cannot_be_reopened); - } else if (!this.checkThatExportsMatch(moduleContainerDecl, moduleContainerTypeSymbol)) { - moduleContainerTypeSymbol = null; - } - } - - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = new TypeScript.PullContainerSymbol(modName, moduleKind); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(moduleContainerTypeSymbol, searchKind); - } - } - - moduleContainerTypeSymbol.addDeclaration(moduleContainerDecl); - moduleContainerDecl.setSymbol(moduleContainerTypeSymbol); - - this.semanticInfoChain.setSymbolForAST(moduleNameAST, moduleContainerTypeSymbol); - this.semanticInfoChain.setSymbolForAST(moduleDeclAST, moduleContainerTypeSymbol); - - var currentModuleValueDecl = moduleContainerDecl.getValueDecl(); - - var moduleDeclarations = moduleContainerTypeSymbol.getDeclarations(); - - if (createdNewSymbol) { - if (parent) { - if (moduleContainerDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberContainer(moduleContainerTypeSymbol); - } else { - parent.addEnclosedNonMemberContainer(moduleContainerTypeSymbol); - } - } - } - - if (currentModuleValueDecl) { - currentModuleValueDecl.ensureSymbolIsBound(); - - var instanceSymbol = null; - var instanceTypeSymbol = null; - if (currentModuleValueDecl.hasSymbol()) { - instanceSymbol = currentModuleValueDecl.getSymbol(); - } else { - instanceSymbol = new TypeScript.PullSymbol(modName, 512 /* Variable */); - currentModuleValueDecl.setSymbol(instanceSymbol); - if (!instanceSymbol.hasDeclaration(currentModuleValueDecl)) { - instanceSymbol.addDeclaration(currentModuleValueDecl); - } - } - - if (!instanceSymbol.type) { - instanceSymbol.type = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - } - - moduleContainerTypeSymbol.setInstanceSymbol(instanceSymbol); - - if (!instanceSymbol.type.getAssociatedContainerType()) { - instanceSymbol.type.setAssociatedContainerType(moduleContainerTypeSymbol); - } - } - }; - - PullSymbolBinder.prototype.bindImportDeclaration = function (importDeclaration) { - var declFlags = importDeclaration.flags; - var declKind = importDeclaration.kind; - var importDeclAST = this.semanticInfoChain.getASTForDecl(importDeclaration); - - var isExported = false; - var importSymbol = null; - var declName = importDeclaration.name; - var parentHadSymbol = false; - var parent = this.getParent(importDeclaration); - - importSymbol = this.getExistingSymbol(importDeclaration, 164 /* SomeContainer */, parent); - - if (importSymbol) { - parentHadSymbol = true; - } - - if (importSymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(importDeclAST, importDeclaration.getDisplayName(), importSymbol.getDeclarations()[0].ast()); - importSymbol = null; - } - - if (!importSymbol) { - importSymbol = new TypeScript.PullTypeAliasSymbol(declName); - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(importSymbol, 164 /* SomeContainer */); - } - } - - importSymbol.addDeclaration(importDeclaration); - importDeclaration.setSymbol(importSymbol); - - this.semanticInfoChain.setSymbolForAST(importDeclAST, importSymbol); - - if (parent && !parentHadSymbol) { - if (declFlags & 1 /* Exported */) { - parent.addEnclosedMemberContainer(importSymbol); - } else { - parent.addEnclosedNonMemberContainer(importSymbol); - } - } - }; - - PullSymbolBinder.prototype.ensurePriorDeclarationsAreBound = function (container, currentDecl) { - if (!container) { - return; - } - - var parentDecls = container.getDeclarations(); - for (var i = 0; i < parentDecls.length; ++i) { - var parentDecl = parentDecls[i]; - var childDecls = parentDecl.getChildDecls(); - for (var j = 0; j < childDecls.length; ++j) { - var childDecl = childDecls[j]; - if (childDecl === currentDecl) { - return; - } - - if (childDecl.name === currentDecl.name) { - childDecl.ensureSymbolIsBound(); - } - } - } - }; - - PullSymbolBinder.prototype.bindClassDeclarationToPullSymbol = function (classDecl) { - var className = classDecl.name; - var classSymbol = null; - - var constructorSymbol = null; - var constructorTypeSymbol = null; - - var classAST = this.semanticInfoChain.getASTForDecl(classDecl); - - var parent = this.getParent(classDecl); - - this.ensurePriorDeclarationsAreBound(parent, classDecl); - - var parentDecl = classDecl.getParentDecl(); - var isExported = classDecl.flags & 1 /* Exported */; - var isGeneric = false; - - classSymbol = this.getExistingSymbol(classDecl, 58728795 /* SomeType */, parent); - - if (classSymbol && classSymbol.kind === 16 /* Interface */) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(classAST.identifier, classDecl.getDisplayName(), classSymbol.getDeclarations()[0].ast()); - classSymbol = null; - } - - classSymbol = new TypeScript.PullTypeSymbol(className, 8 /* Class */); - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(classSymbol, 8 /* Class */); - } - - classSymbol.addDeclaration(classDecl); - - classDecl.setSymbol(classSymbol); - - this.semanticInfoChain.setSymbolForAST(classAST.identifier, classSymbol); - this.semanticInfoChain.setSymbolForAST(classAST, classSymbol); - - if (parent) { - if (classDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(classSymbol); - } else { - parent.addEnclosedNonMemberType(classSymbol); - } - } - - var typeParameterDecls = classDecl.getTypeParameters(); - - for (var i = 0; i < typeParameterDecls.length; i++) { - var typeParameterSymbol = classSymbol.findTypeParameter(typeParameterDecls[i].name); - - if (typeParameterSymbol) { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterSymbol.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameterSymbol.getName()]); - } - - typeParameterSymbol = new TypeScript.PullTypeParameterSymbol(typeParameterDecls[i].name); - - classSymbol.addTypeParameter(typeParameterSymbol); - typeParameterSymbol.addDeclaration(typeParameterDecls[i]); - typeParameterDecls[i].setSymbol(typeParameterSymbol); - } - - constructorSymbol = classSymbol.getConstructorMethod(); - constructorTypeSymbol = constructorSymbol ? constructorSymbol.type : null; - - if (!constructorSymbol) { - var siblingValueDecls = null; - if (parentDecl) { - siblingValueDecls = parentDecl.searchChildDecls(className, 68147712 /* SomeValue */); - - if (siblingValueDecls && siblingValueDecls[0] && siblingValueDecls[0].hasSymbol()) { - constructorSymbol = siblingValueDecls[0].getSymbol(); - } - } - - if (constructorSymbol) { - constructorTypeSymbol = constructorSymbol.type; - } else { - constructorSymbol = new TypeScript.PullSymbol(className, 32768 /* ConstructorMethod */); - constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - constructorSymbol.setIsSynthesized(); - constructorSymbol.type = constructorTypeSymbol; - } - - classSymbol.setConstructorMethod(constructorSymbol); - classSymbol.setHasDefaultConstructor(); - } - - if (constructorSymbol.getIsSynthesized()) { - constructorSymbol.addDeclaration(classDecl.getValueDecl()); - constructorTypeSymbol.addDeclaration(classDecl); - } else { - classSymbol.setHasDefaultConstructor(false); - } - - constructorTypeSymbol.setAssociatedContainerType(classSymbol); - - var valueDecl = classDecl.getValueDecl(); - - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - - this.bindStaticPrototypePropertyOfClass(classAST, classSymbol, constructorTypeSymbol); - }; - - PullSymbolBinder.prototype.bindInterfaceDeclarationToPullSymbol = function (interfaceDecl) { - var interfaceName = interfaceDecl.name; - var interfaceSymbol = null; - - var interfaceAST = this.semanticInfoChain.getASTForDecl(interfaceDecl); - var createdNewSymbol = false; - var parent = this.getParent(interfaceDecl); - - var acceptableSharedKind = 16 /* Interface */; - - interfaceSymbol = this.getExistingSymbol(interfaceDecl, 58728795 /* SomeType */, parent); - - if (interfaceSymbol) { - if (!(interfaceSymbol.kind & acceptableSharedKind)) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(interfaceAST.identifier, interfaceDecl.getDisplayName(), interfaceSymbol.getDeclarations()[0].ast()); - interfaceSymbol = null; - } else if (!this.checkThatExportsMatch(interfaceDecl, interfaceSymbol)) { - interfaceSymbol = null; - } - } - - if (!interfaceSymbol) { - interfaceSymbol = new TypeScript.PullTypeSymbol(interfaceName, 16 /* Interface */); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(interfaceSymbol, acceptableSharedKind); - } - } - - interfaceSymbol.addDeclaration(interfaceDecl); - interfaceDecl.setSymbol(interfaceSymbol); - - if (createdNewSymbol) { - if (parent) { - if (interfaceDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(interfaceSymbol); - } else { - parent.addEnclosedNonMemberType(interfaceSymbol); - } - } - } - - var typeParameters = interfaceDecl.getTypeParameters(); - var typeParameter; - var typeParameterDecls = null; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = interfaceSymbol.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - interfaceSymbol.addTypeParameter(typeParameter); - } else { - typeParameterDecls = typeParameter.getDeclarations(); - - for (var j = 0; j < typeParameterDecls.length; j++) { - var typeParameterDeclParent = typeParameterDecls[j].getParentDecl(); - - if (typeParameterDeclParent && typeParameterDeclParent === interfaceDecl) { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterDecls[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - - break; - } - } - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - }; - - PullSymbolBinder.prototype.bindObjectTypeDeclarationToPullSymbol = function (objectDecl) { - var objectSymbolAST = this.semanticInfoChain.getASTForDecl(objectDecl); - - var objectSymbol = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - - objectSymbol.addDeclaration(objectDecl); - objectDecl.setSymbol(objectSymbol); - - this.semanticInfoChain.setSymbolForAST(objectSymbolAST, objectSymbol); - - var childDecls = objectDecl.getChildDecls(); - - for (var i = 0; i < childDecls.length; i++) { - this.bindDeclToPullSymbol(childDecls[i]); - } - }; - - PullSymbolBinder.prototype.bindConstructorTypeDeclarationToPullSymbol = function (constructorTypeDeclaration) { - var declKind = constructorTypeDeclaration.kind; - var declFlags = constructorTypeDeclaration.flags; - var constructorTypeAST = this.semanticInfoChain.getASTForDecl(constructorTypeDeclaration); - - var constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - - constructorTypeDeclaration.setSymbol(constructorTypeSymbol); - constructorTypeSymbol.addDeclaration(constructorTypeDeclaration); - this.semanticInfoChain.setSymbolForAST(constructorTypeAST, constructorTypeSymbol); - - var signature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - - var funcDecl = this.semanticInfoChain.getASTForDecl(constructorTypeDeclaration); - if (TypeScript.lastParameterIsRest(funcDecl.parameterList)) { - signature.hasVarArgs = true; - } - - signature.addDeclaration(constructorTypeDeclaration); - constructorTypeDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList), constructorTypeSymbol, signature); - - var typeParameters = constructorTypeDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = constructorTypeSymbol.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - constructorTypeSymbol.appendConstructSignature(signature); - }; - - PullSymbolBinder.prototype.bindVariableDeclarationToPullSymbol = function (variableDeclaration) { - var declFlags = variableDeclaration.flags; - var declKind = variableDeclaration.kind; - var varDeclAST = this.semanticInfoChain.getASTForDecl(variableDeclaration); - var nameAST = varDeclAST.kind() === 131 /* ClassDeclaration */ ? varDeclAST.identifier : varDeclAST.kind() === 225 /* VariableDeclarator */ ? varDeclAST.propertyName : varDeclAST.kind() === 132 /* EnumDeclaration */ ? varDeclAST.identifier : varDeclAST; - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var variableSymbol = null; - - var declName = variableDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(variableDeclaration, true); - - var parentDecl = variableDeclaration.getParentDecl(); - - var isImplicit = (declFlags & 118784 /* ImplicitVariable */) !== 0; - var isModuleValue = (declFlags & (32768 /* InitializedModule */)) !== 0; - var isEnumValue = (declFlags & 4096 /* Enum */) !== 0; - var isClassConstructorVariable = (declFlags & 16384 /* ClassConstructorVariable */) !== 0; - variableSymbol = this.getExistingSymbol(variableDeclaration, 68147712 /* SomeValue */, parent); - - if (!variableSymbol && isModuleValue) { - variableSymbol = this.findExistingVariableSymbolForModuleValueDecl(variableDeclaration.getContainerDecl()); - } - - if (variableSymbol && !variableSymbol.isType()) { - parentHadSymbol = true; - } - - var decl; - var decls; - var ast; - var members; - - if (variableSymbol) { - var prevKind = variableSymbol.kind; - var prevIsEnum = variableSymbol.anyDeclHasFlag(4096 /* Enum */); - var prevIsClassConstructorVariable = variableSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */); - var prevIsModuleValue = variableSymbol.allDeclsHaveFlag(32768 /* InitializedModule */); - var prevIsImplicit = variableSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */); - var prevIsFunction = TypeScript.ArrayUtilities.any(variableSymbol.getDeclarations(), function (decl) { - return decl.kind === 16384 /* Function */; - }); - var prevIsAmbient = variableSymbol.allDeclsHaveFlag(8 /* Ambient */); - var isAmbientOrPrevIsAmbient = prevIsAmbient || (variableDeclaration.flags & 8 /* Ambient */) !== 0; - var prevDecl = variableSymbol.getDeclarations()[0]; - var prevParentDecl = prevDecl.getParentDecl(); - var bothAreGlobal = parentDecl && (parentDecl.kind === 1 /* Script */) && (prevParentDecl.kind === 1 /* Script */); - var shareParent = bothAreGlobal || prevDecl.getParentDecl() === variableDeclaration.getParentDecl(); - var prevIsParam = shareParent && prevKind === 2048 /* Parameter */ && declKind == 512 /* Variable */; - - var acceptableRedeclaration = prevIsParam || (isImplicit && ((!isEnumValue && !isClassConstructorVariable && prevIsFunction) || ((isModuleValue || isEnumValue) && (prevIsModuleValue || prevIsEnum)) || (isClassConstructorVariable && prevIsModuleValue && isAmbientOrPrevIsAmbient) || (isModuleValue && prevIsClassConstructorVariable))); - - if (acceptableRedeclaration && (prevIsClassConstructorVariable || prevIsFunction) && !isAmbientOrPrevIsAmbient) { - if (prevDecl.fileName() !== variableDeclaration.fileName()) { - this.semanticInfoChain.addDiagnostic(TypeScript.PullHelpers.diagnosticFromDecl(variableDeclaration, TypeScript.DiagnosticCode.Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2, [declName, declName, prevDecl.fileName()])); - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } - } - - if (!acceptableRedeclaration || prevIsParam) { - if (!prevIsParam && (isImplicit || prevIsImplicit || TypeScript.hasFlag(prevKind, 1032192 /* SomeFunction */)) || !shareParent) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(nameAST, variableDeclaration.getDisplayName(), variableSymbol.getDeclarations()[0].ast()); - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } else { - this.checkThatExportsMatch(variableDeclaration, variableSymbol); - variableSymbol = null; - parentHadSymbol = false; - } - } - - if (variableSymbol && !(variableSymbol.type && variableSymbol.type.isError()) && !this.checkThatExportsMatch(variableDeclaration, variableSymbol, !(isModuleValue && prevIsModuleValue))) { - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } - } - - if ((declFlags & 118784 /* ImplicitVariable */) === 0) { - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - if (!parent && parentDecl.kind === 1 /* Script */) { - this.semanticInfoChain.cacheGlobalSymbol(variableSymbol, declKind); - } - } - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - this.semanticInfoChain.setSymbolForAST(nameAST, variableSymbol); - this.semanticInfoChain.setSymbolForAST(varDeclAST, variableSymbol); - } else if (!parentHadSymbol) { - if (isClassConstructorVariable) { - var classTypeSymbol = variableSymbol; - - if (parent) { - members = parent.getMembers(); - - for (var i = 0; i < members.length; i++) { - if ((members[i].name === declName) && (members[i].kind === 8 /* Class */)) { - classTypeSymbol = members[i]; - break; - } - } - } - - if (!classTypeSymbol) { - var containerDecl = variableDeclaration.getContainerDecl(); - classTypeSymbol = containerDecl.getSymbol(); - if (!classTypeSymbol) { - classTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 58728795 /* SomeType */, variableDeclaration); - } - } - - if (classTypeSymbol && (classTypeSymbol.kind !== 8 /* Class */)) { - classTypeSymbol = null; - } - - if (classTypeSymbol && classTypeSymbol.isClass()) { - variableSymbol = classTypeSymbol.getConstructorMethod(); - variableDeclaration.setSymbol(variableSymbol); - - decls = classTypeSymbol.getDeclarations(); - - if (decls.length) { - decl = decls[decls.length - 1]; - ast = this.semanticInfoChain.getASTForDecl(decl); - } - } else { - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - } - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - variableSymbol.type = this.semanticInfoChain.anyTypeSymbol; - } - } else if (declFlags & 102400 /* SomeInitializedModule */) { - var moduleContainerTypeSymbol = null; - var moduleParent = this.getParent(variableDeclaration); - - if (moduleParent) { - members = moduleParent.getMembers(); - - for (var i = 0; i < members.length; i++) { - if ((members[i].name === declName) && (members[i].isContainer())) { - moduleContainerTypeSymbol = members[i]; - break; - } - } - } - - if (!moduleContainerTypeSymbol) { - var containerDecl = variableDeclaration.getContainerDecl(); - moduleContainerTypeSymbol = containerDecl.getSymbol(); - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 164 /* SomeContainer */, variableDeclaration); - - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 64 /* Enum */, variableDeclaration); - } - } - } - - if (moduleContainerTypeSymbol && (!moduleContainerTypeSymbol.isContainer())) { - moduleContainerTypeSymbol = null; - } - - if (moduleContainerTypeSymbol) { - variableSymbol = moduleContainerTypeSymbol.getInstanceSymbol(); - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - variableSymbol.type = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - } - - if (!variableSymbol.hasDeclaration(variableDeclaration)) { - variableSymbol.addDeclaration(variableDeclaration); - } - variableDeclaration.setSymbol(variableSymbol); - } else { - TypeScript.Debug.assert(false, "Attempted to bind invalid implicit variable symbol"); - } - } - } else { - if (!variableSymbol.hasDeclaration(variableDeclaration)) { - variableSymbol.addDeclaration(variableDeclaration); - } - variableDeclaration.setSymbol(variableSymbol); - } - - var containerDecl = variableDeclaration.getContainerDecl(); - if (variableSymbol && variableSymbol.type && containerDecl && !variableSymbol.type.hasDeclaration(containerDecl)) { - variableSymbol.type.addDeclaration(containerDecl); - } - - if (parent && !parentHadSymbol) { - if (declFlags & 1 /* Exported */) { - parent.addMember(variableSymbol); - } else { - parent.addEnclosedNonMember(variableSymbol); - } - } - }; - - PullSymbolBinder.prototype.bindCatchVariableToPullSymbol = function (variableDeclaration) { - var declFlags = variableDeclaration.flags; - var declKind = variableDeclaration.kind; - var identifier = this.semanticInfoChain.getASTForDecl(variableDeclaration); - - var declName = variableDeclaration.name; - - var variableSymbol = new TypeScript.PullSymbol(declName, declKind); - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - variableSymbol.type = this.semanticInfoChain.anyTypeSymbol; - - this.semanticInfoChain.setSymbolForAST(identifier, variableSymbol); - }; - - PullSymbolBinder.prototype.bindEnumMemberDeclarationToPullSymbol = function (propertyDeclaration) { - var declFlags = propertyDeclaration.flags; - var declKind = propertyDeclaration.kind; - var propDeclAST = this.semanticInfoChain.getASTForDecl(propertyDeclaration); - - var declName = propertyDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(propertyDeclaration, true); - - var propertySymbol = parent.findMember(declName, false); - - if (propertySymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(propDeclAST.propertyName, propertyDeclaration.getDisplayName(), propertySymbol.getDeclarations()[0].ast()); - } - - if (propertySymbol) { - parentHadSymbol = true; - } - - if (!parentHadSymbol) { - propertySymbol = new TypeScript.PullSymbol(declName, declKind); - } - - propertySymbol.addDeclaration(propertyDeclaration); - propertyDeclaration.setSymbol(propertySymbol); - - this.semanticInfoChain.setSymbolForAST(propDeclAST.propertyName, propertySymbol); - this.semanticInfoChain.setSymbolForAST(propDeclAST, propertySymbol); - - if (parent && !parentHadSymbol) { - parent.addMember(propertySymbol); - } - }; - - PullSymbolBinder.prototype.bindPropertyDeclarationToPullSymbol = function (propertyDeclaration) { - var declFlags = propertyDeclaration.flags; - var declKind = propertyDeclaration.kind; - - var ast = this.semanticInfoChain.getASTForDecl(propertyDeclaration); - var astName = ast.kind() === 136 /* MemberVariableDeclaration */ ? ast.variableDeclarator.propertyName : ast.kind() === 141 /* PropertySignature */ ? ast.propertyName : ast.kind() === 242 /* Parameter */ ? ast.identifier : ast.propertyName; - - var isStatic = false; - var isOptional = false; - - var propertySymbol = null; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - if (TypeScript.hasFlag(declFlags, 128 /* Optional */)) { - isOptional = true; - } - - var declName = propertyDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(propertyDeclaration, true); - - if (parent.isClass() && isStatic) { - parent = parent.getConstructorMethod().type; - } - - propertySymbol = parent.findMember(declName, false); - - if (propertySymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(astName, propertyDeclaration.getDisplayName(), propertySymbol.getDeclarations()[0].ast()); - } - - if (propertySymbol) { - parentHadSymbol = true; - } - - var classTypeSymbol; - - if (!parentHadSymbol) { - propertySymbol = new TypeScript.PullSymbol(declName, declKind); - } - - propertySymbol.addDeclaration(propertyDeclaration); - propertyDeclaration.setSymbol(propertySymbol); - - this.semanticInfoChain.setSymbolForAST(astName, propertySymbol); - this.semanticInfoChain.setSymbolForAST(ast, propertySymbol); - - if (isOptional) { - propertySymbol.isOptional = true; - } - - if (parent && !parentHadSymbol) { - parent.addMember(propertySymbol); - } - }; - - PullSymbolBinder.prototype.bindParameterSymbols = function (functionDeclaration, parameterList, funcType, signatureSymbol) { - var parameters = []; - var params = TypeScript.createIntrinsicsObject(); - var funcDecl = this.semanticInfoChain.getDeclForAST(functionDeclaration); - - if (parameterList) { - for (var i = 0, n = parameterList.length; i < n; i++) { - var argDecl = parameterList.astAt(i); - var id = parameterList.identifierAt(i); - var decl = this.semanticInfoChain.getDeclForAST(argDecl); - var isProperty = TypeScript.hasFlag(decl.flags, 8388608 /* PropertyParameter */); - var parameterSymbol = new TypeScript.PullSymbol(id.valueText(), 2048 /* Parameter */); - - if ((i === (n - 1)) && parameterList.lastParameterIsRest()) { - parameterSymbol.isVarArg = true; - } - - if (params[id.valueText()]) { - this.semanticInfoChain.addDiagnosticFromAST(argDecl, TypeScript.DiagnosticCode.Duplicate_identifier_0, [id.text()]); - } else { - params[id.valueText()] = true; - } - - if (decl) { - var isParameterOptional = false; - - if (isProperty) { - decl.ensureSymbolIsBound(); - var valDecl = decl.getValueDecl(); - - if (valDecl) { - isParameterOptional = TypeScript.hasFlag(valDecl.flags, 128 /* Optional */); - - valDecl.setSymbol(parameterSymbol); - parameterSymbol.addDeclaration(valDecl); - } - } else { - isParameterOptional = TypeScript.hasFlag(decl.flags, 128 /* Optional */); - - parameterSymbol.addDeclaration(decl); - decl.setSymbol(parameterSymbol); - } - - parameterSymbol.isOptional = isParameterOptional; - } - - signatureSymbol.addParameter(parameterSymbol, parameterSymbol.isOptional); - - if (signatureSymbol.isDefinition()) { - funcType.addEnclosedNonMember(parameterSymbol); - } - } - } - }; - - PullSymbolBinder.prototype.bindFunctionDeclarationToPullSymbol = function (functionDeclaration) { - var declKind = functionDeclaration.kind; - var declFlags = functionDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(functionDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = functionDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(functionDeclaration, true); - - var parentDecl = functionDeclaration.getParentDecl(); - var parentHadSymbol = false; - - var functionSymbol = null; - var functionTypeSymbol = null; - - functionSymbol = this.getExistingSymbol(functionDeclaration, 68147712 /* SomeValue */, parent); - - if (functionSymbol) { - var acceptableRedeclaration; - - if (functionSymbol.kind === 16384 /* Function */) { - acceptableRedeclaration = isSignature || functionSymbol.allDeclsHaveFlag(2048 /* Signature */); - } else { - var isCurrentDeclAmbient = TypeScript.hasFlag(functionDeclaration.flags, 8 /* Ambient */); - acceptableRedeclaration = TypeScript.ArrayUtilities.all(functionSymbol.getDeclarations(), function (decl) { - var isInitializedModuleOrAmbientDecl = TypeScript.hasFlag(decl.flags, 32768 /* InitializedModule */) && (isCurrentDeclAmbient || TypeScript.hasFlag(decl.flags, 8 /* Ambient */)); - var isSignature = TypeScript.hasFlag(decl.flags, 2048 /* Signature */); - return isInitializedModuleOrAmbientDecl || isSignature; - }); - } - - if (!acceptableRedeclaration) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.identifier, functionDeclaration.getDisplayName(), functionSymbol.getDeclarations()[0].ast()); - functionSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(funcName); - } - } - - if (functionSymbol) { - functionTypeSymbol = functionSymbol.type; - parentHadSymbol = true; - } - - if (!functionSymbol) { - functionSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - } - - if (!functionTypeSymbol) { - functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - functionSymbol.type = functionTypeSymbol; - functionTypeSymbol.setFunctionSymbol(functionSymbol); - } - - functionDeclaration.setSymbol(functionSymbol); - functionSymbol.addDeclaration(functionDeclaration); - functionTypeSymbol.addDeclaration(functionDeclaration); - - this.semanticInfoChain.setSymbolForAST(funcDeclAST.identifier, functionSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, functionSymbol); - - if (parent && !parentHadSymbol) { - if (isExported) { - parent.addMember(functionSymbol); - } else { - parent.addEnclosedNonMember(functionSymbol); - } - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(functionDeclaration); - functionDeclaration.setSignatureSymbol(signature); - - if (TypeScript.lastParameterIsRest(funcDeclAST.callSignature.parameterList)) { - signature.hasVarArgs = true; - } - - var funcDecl = this.semanticInfoChain.getASTForDecl(functionDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), functionTypeSymbol, signature); - - var typeParameters = functionDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindFunctionExpressionToPullSymbol = function (functionExpressionDeclaration) { - var declKind = functionExpressionDeclaration.kind; - var declFlags = functionExpressionDeclaration.flags; - var ast = this.semanticInfoChain.getASTForDecl(functionExpressionDeclaration); - - var parameters = ast.kind() === 219 /* SimpleArrowFunctionExpression */ ? TypeScript.ASTHelpers.parametersFromIdentifier(ast.identifier) : TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(ast)); - var funcExpAST = ast; - - var functionName = declKind === 131072 /* FunctionExpression */ ? functionExpressionDeclaration.getFunctionExpressionName() : functionExpressionDeclaration.name; - var functionSymbol = new TypeScript.PullSymbol(functionName, declKind); - var functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - functionTypeSymbol.setFunctionSymbol(functionSymbol); - - functionSymbol.type = functionTypeSymbol; - - functionExpressionDeclaration.setSymbol(functionSymbol); - functionSymbol.addDeclaration(functionExpressionDeclaration); - functionTypeSymbol.addDeclaration(functionExpressionDeclaration); - - var name = funcExpAST.kind() === 222 /* FunctionExpression */ ? funcExpAST.identifier : funcExpAST.kind() === 241 /* FunctionPropertyAssignment */ ? funcExpAST.propertyName : null; - if (name) { - this.semanticInfoChain.setSymbolForAST(name, functionSymbol); - } - - this.semanticInfoChain.setSymbolForAST(funcExpAST, functionSymbol); - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, true); - - if (parameters.lastParameterIsRest()) { - signature.hasVarArgs = true; - } - - var typeParameters = functionExpressionDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(functionExpressionDeclaration); - functionExpressionDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcExpAST, parameters, functionTypeSymbol, signature); - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindFunctionTypeDeclarationToPullSymbol = function (functionTypeDeclaration) { - var declKind = functionTypeDeclaration.kind; - var declFlags = functionTypeDeclaration.flags; - var funcTypeAST = this.semanticInfoChain.getASTForDecl(functionTypeDeclaration); - - var functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - - functionTypeDeclaration.setSymbol(functionTypeSymbol); - functionTypeSymbol.addDeclaration(functionTypeDeclaration); - this.semanticInfoChain.setSymbolForAST(funcTypeAST, functionTypeSymbol); - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - if (TypeScript.lastParameterIsRest(funcTypeAST.parameterList)) { - signature.hasVarArgs = true; - } - - var typeParameters = functionTypeDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(functionTypeDeclaration); - functionTypeDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcTypeAST, TypeScript.ASTHelpers.parametersFromParameterList(funcTypeAST.parameterList), functionTypeSymbol, signature); - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindMethodDeclarationToPullSymbol = function (methodDeclaration) { - var declKind = methodDeclaration.kind; - var declFlags = methodDeclaration.flags; - var methodAST = this.semanticInfoChain.getASTForDecl(methodDeclaration); - - var isPrivate = (declFlags & 2 /* Private */) !== 0; - var isStatic = (declFlags & 16 /* Static */) !== 0; - var isOptional = (declFlags & 128 /* Optional */) !== 0; - - var methodName = methodDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(methodDeclaration, true); - var parentHadSymbol = false; - - var methodSymbol = null; - var methodTypeSymbol = null; - - if (parent.isClass() && isStatic) { - parent = parent.getConstructorMethod().type; - } - - methodSymbol = parent.findMember(methodName, false); - - if (methodSymbol && (methodSymbol.kind !== 65536 /* Method */ || (!isSignature && !methodSymbol.allDeclsHaveFlag(2048 /* Signature */)))) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(methodAST, methodDeclaration.getDisplayName(), methodSymbol.getDeclarations()[0].ast()); - methodSymbol = null; - } - - if (methodSymbol) { - methodTypeSymbol = methodSymbol.type; - parentHadSymbol = true; - } - - if (!methodSymbol) { - methodSymbol = new TypeScript.PullSymbol(methodName, 65536 /* Method */); - } - - if (!methodTypeSymbol) { - methodTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - methodSymbol.type = methodTypeSymbol; - methodTypeSymbol.setFunctionSymbol(methodSymbol); - } - - methodDeclaration.setSymbol(methodSymbol); - methodSymbol.addDeclaration(methodDeclaration); - methodTypeSymbol.addDeclaration(methodDeclaration); - - var nameAST = methodAST.kind() === 135 /* MemberFunctionDeclaration */ ? methodAST.propertyName : methodAST.propertyName; - - TypeScript.Debug.assert(nameAST); - - this.semanticInfoChain.setSymbolForAST(nameAST, methodSymbol); - this.semanticInfoChain.setSymbolForAST(methodAST, methodSymbol); - - if (isOptional) { - methodSymbol.isOptional = true; - } - - if (!parentHadSymbol) { - parent.addMember(methodSymbol); - } - - var sigKind = 1048576 /* CallSignature */; - - var signature = new TypeScript.PullSignatureSymbol(sigKind, !isSignature); - - var parameterList = TypeScript.ASTHelpers.getParameterList(methodAST); - if (TypeScript.lastParameterIsRest(parameterList)) { - signature.hasVarArgs = true; - } - - var typeParameters = methodDeclaration.getTypeParameters(); - var typeParameter; - var typeParameterName; - var typeParameterAST; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameterName = typeParameters[i].name; - typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameters[i]); - - typeParameter = signature.findTypeParameter(typeParameterName); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameterName); - signature.addTypeParameter(typeParameter); - } else { - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(methodDeclaration); - methodDeclaration.setSignatureSymbol(signature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(methodDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(funcDecl)), methodTypeSymbol, signature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(signature, methodTypeSymbol.getOwnCallSignatures()); - methodTypeSymbol.insertCallSignatureAtIndex(signature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindStaticPrototypePropertyOfClass = function (classAST, classTypeSymbol, constructorTypeSymbol) { - var prototypeStr = "prototype"; - - var prototypeSymbol = constructorTypeSymbol.findMember(prototypeStr, false); - if (prototypeSymbol && !prototypeSymbol.getIsSynthesized()) { - this.semanticInfoChain.addDiagnostic(TypeScript.PullHelpers.diagnosticFromDecl(prototypeSymbol.getDeclarations()[0], TypeScript.DiagnosticCode.Duplicate_identifier_0, [prototypeSymbol.getDisplayName()])); - } - - if (!prototypeSymbol || !prototypeSymbol.getIsSynthesized()) { - var prototypeDecl = new TypeScript.PullSynthesizedDecl(prototypeStr, prototypeStr, 4096 /* Property */, 4 /* Public */ | 16 /* Static */, constructorTypeSymbol.getDeclarations()[0], this.semanticInfoChain); - - prototypeSymbol = new TypeScript.PullSymbol(prototypeStr, 4096 /* Property */); - prototypeSymbol.setIsSynthesized(); - prototypeSymbol.addDeclaration(prototypeDecl); - prototypeSymbol.type = classTypeSymbol; - constructorTypeSymbol.addMember(prototypeSymbol); - - if (prototypeSymbol.type && prototypeSymbol.type.isGeneric()) { - var resolver = this.semanticInfoChain.getResolver(); - prototypeSymbol.type = resolver.instantiateTypeToAny(prototypeSymbol.type, new TypeScript.PullTypeResolutionContext(resolver)); - } - prototypeSymbol.setResolved(); - } - }; - - PullSymbolBinder.prototype.bindConstructorDeclarationToPullSymbol = function (constructorDeclaration) { - var declKind = constructorDeclaration.kind; - var declFlags = constructorDeclaration.flags; - var constructorAST = this.semanticInfoChain.getASTForDecl(constructorDeclaration); - - var constructorName = constructorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(constructorDeclaration, true); - - var parentHadSymbol = false; - - var constructorSymbol = parent.getConstructorMethod(); - var constructorTypeSymbol = null; - - if (constructorSymbol && (constructorSymbol.kind !== 32768 /* ConstructorMethod */ || (!isSignature && constructorSymbol.type && constructorSymbol.type.hasOwnConstructSignatures()))) { - var hasDefinitionSignature = false; - var constructorSigs = constructorSymbol.type.getConstructSignatures(); - - for (var i = 0; i < constructorSigs.length; i++) { - if (!constructorSigs[i].anyDeclHasFlag(2048 /* Signature */)) { - hasDefinitionSignature = true; - break; - } - } - - if (hasDefinitionSignature) { - this.semanticInfoChain.addDiagnosticFromAST(constructorAST, TypeScript.DiagnosticCode.Multiple_constructor_implementations_are_not_allowed); - - constructorSymbol = null; - } - } - - if (constructorSymbol) { - constructorTypeSymbol = constructorSymbol.type; - } else { - constructorSymbol = new TypeScript.PullSymbol(constructorName, 32768 /* ConstructorMethod */); - constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - } - - parent.setConstructorMethod(constructorSymbol); - constructorSymbol.type = constructorTypeSymbol; - - constructorDeclaration.setSymbol(constructorSymbol); - constructorSymbol.addDeclaration(constructorDeclaration); - constructorTypeSymbol.addDeclaration(constructorDeclaration); - constructorSymbol.setIsSynthesized(false); - this.semanticInfoChain.setSymbolForAST(constructorAST, constructorSymbol); - - var constructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */, !isSignature); - constructSignature.returnType = parent; - constructSignature.addTypeParametersFromReturnType(); - - constructSignature.addDeclaration(constructorDeclaration); - constructorDeclaration.setSignatureSymbol(constructSignature); - - this.bindParameterSymbols(constructorAST, TypeScript.ASTHelpers.parametersFromParameterList(constructorAST.callSignature.parameterList), constructorTypeSymbol, constructSignature); - - if (TypeScript.lastParameterIsRest(constructorAST.callSignature.parameterList)) { - constructSignature.hasVarArgs = true; - } - - constructorTypeSymbol.appendConstructSignature(constructSignature); - }; - - PullSymbolBinder.prototype.bindConstructSignatureDeclarationToPullSymbol = function (constructSignatureDeclaration) { - var parent = this.getParent(constructSignatureDeclaration, true); - var constructorAST = this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration); - - var constructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - - if (TypeScript.lastParameterIsRest(constructorAST.callSignature.parameterList)) { - constructSignature.hasVarArgs = true; - } - - var typeParameters = constructSignatureDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = constructSignature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - constructSignature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - constructSignature.addDeclaration(constructSignatureDeclaration); - constructSignatureDeclaration.setSignatureSymbol(constructSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(funcDecl)), null, constructSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration), constructSignature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(constructSignature, parent.getOwnConstructSignatures()); - parent.insertConstructSignatureAtIndex(constructSignature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindCallSignatureDeclarationToPullSymbol = function (callSignatureDeclaration) { - var parent = this.getParent(callSignatureDeclaration, true); - var callSignatureAST = this.semanticInfoChain.getASTForDecl(callSignatureDeclaration); - - var callSignature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */); - - if (TypeScript.lastParameterIsRest(callSignatureAST.parameterList)) { - callSignature.hasVarArgs = true; - } - - var typeParameters = callSignatureDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = callSignature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - callSignature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - callSignature.addDeclaration(callSignatureDeclaration); - callSignatureDeclaration.setSignatureSymbol(callSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(callSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList), null, callSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(callSignatureDeclaration), callSignature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(callSignature, parent.getOwnCallSignatures()); - parent.insertCallSignatureAtIndex(callSignature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindIndexSignatureDeclarationToPullSymbol = function (indexSignatureDeclaration) { - var indexSignature = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - - indexSignature.addDeclaration(indexSignatureDeclaration); - indexSignatureDeclaration.setSignatureSymbol(indexSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(indexSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameter(funcDecl.parameter), null, indexSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(indexSignatureDeclaration), indexSignature); - - var parent = this.getParent(indexSignatureDeclaration); - parent.addIndexSignature(indexSignature); - indexSignature.setContainer(parent); - }; - - PullSymbolBinder.prototype.bindGetAccessorDeclarationToPullSymbol = function (getAccessorDeclaration) { - var declKind = getAccessorDeclaration.kind; - var declFlags = getAccessorDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(getAccessorDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = getAccessorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var isStatic = false; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - var parent = this.getParent(getAccessorDeclaration, true); - var parentHadSymbol = false; - - var accessorSymbol = null; - var getterSymbol = null; - var getterTypeSymbol = null; - - if (isStatic) { - parent = parent.getConstructorMethod().type; - } - - accessorSymbol = parent.findMember(funcName, false); - - if (accessorSymbol) { - if (!accessorSymbol.isAccessor()) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.propertyName, getAccessorDeclaration.getDisplayName(), accessorSymbol.getDeclarations()[0].ast()); - accessorSymbol = null; - } else { - getterSymbol = accessorSymbol.getGetter(); - - if (getterSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Getter_0_already_declared, [getAccessorDeclaration.getDisplayName()]); - accessorSymbol = null; - getterSymbol = null; - } - } - } - - if (accessorSymbol) { - parentHadSymbol = true; - } - - if (accessorSymbol && getterSymbol) { - getterTypeSymbol = getterSymbol.type; - } - - if (!accessorSymbol) { - accessorSymbol = new TypeScript.PullAccessorSymbol(funcName); - } - - if (!getterSymbol) { - getterSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - getterTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - getterTypeSymbol.setFunctionSymbol(getterSymbol); - - getterSymbol.type = getterTypeSymbol; - - accessorSymbol.setGetter(getterSymbol); - } - - getAccessorDeclaration.setSymbol(accessorSymbol); - accessorSymbol.addDeclaration(getAccessorDeclaration); - getterSymbol.addDeclaration(getAccessorDeclaration); - - var nameAST = funcDeclAST.propertyName; - this.semanticInfoChain.setSymbolForAST(nameAST, accessorSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, getterSymbol); - - if (!parentHadSymbol) { - parent.addMember(accessorSymbol); - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(getAccessorDeclaration); - getAccessorDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDeclAST, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), getterTypeSymbol, signature); - - getterTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindSetAccessorDeclarationToPullSymbol = function (setAccessorDeclaration) { - var declKind = setAccessorDeclaration.kind; - var declFlags = setAccessorDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(setAccessorDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = setAccessorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var isStatic = false; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - var parent = this.getParent(setAccessorDeclaration, true); - var parentHadSymbol = false; - - var accessorSymbol = null; - var setterSymbol = null; - var setterTypeSymbol = null; - - if (isStatic) { - parent = parent.getConstructorMethod().type; - } - - accessorSymbol = parent.findMember(funcName, false); - - if (accessorSymbol) { - if (!accessorSymbol.isAccessor()) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.propertyName, setAccessorDeclaration.getDisplayName(), accessorSymbol.getDeclarations()[0].ast()); - accessorSymbol = null; - } else { - setterSymbol = accessorSymbol.getSetter(); - - if (setterSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Setter_0_already_declared, [setAccessorDeclaration.getDisplayName()]); - accessorSymbol = null; - setterSymbol = null; - } - } - } - - if (accessorSymbol) { - parentHadSymbol = true; - - if (setterSymbol) { - setterTypeSymbol = setterSymbol.type; - } - } - - if (!accessorSymbol) { - accessorSymbol = new TypeScript.PullAccessorSymbol(funcName); - } - - if (!setterSymbol) { - setterSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - setterTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - setterTypeSymbol.setFunctionSymbol(setterSymbol); - - setterSymbol.type = setterTypeSymbol; - - accessorSymbol.setSetter(setterSymbol); - } - - setAccessorDeclaration.setSymbol(accessorSymbol); - accessorSymbol.addDeclaration(setAccessorDeclaration); - setterSymbol.addDeclaration(setAccessorDeclaration); - - var nameAST = funcDeclAST.propertyName; - this.semanticInfoChain.setSymbolForAST(nameAST, accessorSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, setterSymbol); - - if (!parentHadSymbol) { - parent.addMember(accessorSymbol); - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(setAccessorDeclaration); - setAccessorDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDeclAST, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), setterTypeSymbol, signature); - - setterTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.getDeclsToBind = function (decl) { - var decls; - switch (decl.kind) { - case 64 /* Enum */: - case 32 /* DynamicModule */: - case 4 /* Container */: - case 16 /* Interface */: - decls = this.findDeclsInContext(decl, decl.kind, true); - break; - - case 512 /* Variable */: - case 16384 /* Function */: - case 65536 /* Method */: - case 32768 /* ConstructorMethod */: - decls = this.findDeclsInContext(decl, decl.kind, false); - break; - - default: - decls = [decl]; - } - TypeScript.Debug.assert(decls && decls.length > 0); - TypeScript.Debug.assert(TypeScript.ArrayUtilities.contains(decls, decl)); - return decls; - }; - - PullSymbolBinder.prototype.shouldBindDeclaration = function (decl) { - return !decl.hasBeenBound() && this.declsBeingBound.indexOf(decl.declID) < 0; - }; - - PullSymbolBinder.prototype.bindDeclToPullSymbol = function (decl) { - if (this.shouldBindDeclaration(decl)) { - this.bindAllDeclsToPullSymbol(decl); - } - }; - - PullSymbolBinder.prototype.bindAllDeclsToPullSymbol = function (askedDecl) { - var allDecls = this.getDeclsToBind(askedDecl); - for (var i = 0; i < allDecls.length; i++) { - var decl = allDecls[i]; - - if (this.shouldBindDeclaration(decl)) { - this.bindSingleDeclToPullSymbol(decl); - } - } - }; - - PullSymbolBinder.prototype.bindSingleDeclToPullSymbol = function (decl) { - this.declsBeingBound.push(decl.declID); - - switch (decl.kind) { - case 1 /* Script */: - var childDecls = decl.getChildDecls(); - for (var i = 0; i < childDecls.length; i++) { - this.bindDeclToPullSymbol(childDecls[i]); - } - break; - - case 64 /* Enum */: - this.bindEnumDeclarationToPullSymbol(decl); - break; - - case 32 /* DynamicModule */: - case 4 /* Container */: - this.bindModuleDeclarationToPullSymbol(decl); - break; - - case 16 /* Interface */: - this.bindInterfaceDeclarationToPullSymbol(decl); - break; - - case 8 /* Class */: - this.bindClassDeclarationToPullSymbol(decl); - break; - - case 16384 /* Function */: - this.bindFunctionDeclarationToPullSymbol(decl); - break; - - case 512 /* Variable */: - this.bindVariableDeclarationToPullSymbol(decl); - break; - - case 1024 /* CatchVariable */: - this.bindCatchVariableToPullSymbol(decl); - break; - - case 67108864 /* EnumMember */: - this.bindEnumMemberDeclarationToPullSymbol(decl); - break; - - case 4096 /* Property */: - this.bindPropertyDeclarationToPullSymbol(decl); - break; - - case 65536 /* Method */: - this.bindMethodDeclarationToPullSymbol(decl); - break; - - case 32768 /* ConstructorMethod */: - this.bindConstructorDeclarationToPullSymbol(decl); - break; - - case 1048576 /* CallSignature */: - this.bindCallSignatureDeclarationToPullSymbol(decl); - break; - - case 2097152 /* ConstructSignature */: - this.bindConstructSignatureDeclarationToPullSymbol(decl); - break; - - case 4194304 /* IndexSignature */: - this.bindIndexSignatureDeclarationToPullSymbol(decl); - break; - - case 262144 /* GetAccessor */: - this.bindGetAccessorDeclarationToPullSymbol(decl); - break; - - case 524288 /* SetAccessor */: - this.bindSetAccessorDeclarationToPullSymbol(decl); - break; - - case 8388608 /* ObjectType */: - this.bindObjectTypeDeclarationToPullSymbol(decl); - break; - - case 16777216 /* FunctionType */: - this.bindFunctionTypeDeclarationToPullSymbol(decl); - break; - - case 33554432 /* ConstructorType */: - this.bindConstructorTypeDeclarationToPullSymbol(decl); - break; - - case 131072 /* FunctionExpression */: - this.bindFunctionExpressionToPullSymbol(decl); - break; - - case 128 /* TypeAlias */: - this.bindImportDeclaration(decl); - break; - - case 2048 /* Parameter */: - case 8192 /* TypeParameter */: - decl.getParentDecl().getSymbol(); - break; - - case 268435456 /* CatchBlock */: - case 134217728 /* WithBlock */: - break; - - default: - TypeScript.CompilerDiagnostics.assert(false, "Unrecognized type declaration"); - } - - TypeScript.Debug.assert(TypeScript.ArrayUtilities.last(this.declsBeingBound) === decl.declID); - this.declsBeingBound.pop(); - }; - return PullSymbolBinder; - })(); - TypeScript.PullSymbolBinder = PullSymbolBinder; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (PullHelpers) { - function diagnosticFromDecl(decl, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - var ast = decl.ast(); - return decl.semanticInfoChain.diagnosticFromAST(ast, diagnosticKey, _arguments, additionalLocations); - } - PullHelpers.diagnosticFromDecl = diagnosticFromDecl; - - function resolveDeclaredSymbolToUseType(symbol) { - if (symbol.isSignature()) { - if (!symbol.returnType) { - symbol._resolveDeclaredSymbol(); - } - } else if (!symbol.type) { - symbol._resolveDeclaredSymbol(); - } - } - PullHelpers.resolveDeclaredSymbolToUseType = resolveDeclaredSymbolToUseType; - - function getSignatureForFuncDecl(functionDecl) { - var funcDecl = functionDecl.ast(); - var funcSymbol = functionDecl.getSymbol(); - - if (!funcSymbol) { - funcSymbol = functionDecl.getSignatureSymbol(); - } - - var functionSignature = null; - var typeSymbolWithAllSignatures = null; - if (funcSymbol.isSignature()) { - functionSignature = funcSymbol; - var parent = functionDecl.getParentDecl(); - typeSymbolWithAllSignatures = parent.getSymbol().type; - } else { - functionSignature = functionDecl.getSignatureSymbol(); - typeSymbolWithAllSignatures = funcSymbol.type; - } - var signatures; - - if (funcDecl.kind() === 137 /* ConstructorDeclaration */ || functionDecl.kind === 2097152 /* ConstructSignature */) { - signatures = typeSymbolWithAllSignatures.getConstructSignatures(); - } else if (functionDecl.kind === 4194304 /* IndexSignature */) { - signatures = typeSymbolWithAllSignatures.getIndexSignatures(); - } else { - signatures = typeSymbolWithAllSignatures.getCallSignatures(); - } - - return { - signature: functionSignature, - allSignatures: signatures - }; - } - PullHelpers.getSignatureForFuncDecl = getSignatureForFuncDecl; - - function getAccessorSymbol(getterOrSetter, semanticInfoChain) { - var functionDecl = semanticInfoChain.getDeclForAST(getterOrSetter); - var getterOrSetterSymbol = functionDecl.getSymbol(); - - return getterOrSetterSymbol; - } - PullHelpers.getAccessorSymbol = getAccessorSymbol; - - function getGetterAndSetterFunction(funcDecl, semanticInfoChain) { - var accessorSymbol = PullHelpers.getAccessorSymbol(funcDecl, semanticInfoChain); - var result = { - getter: null, - setter: null - }; - var getter = accessorSymbol.getGetter(); - if (getter) { - var getterDecl = getter.getDeclarations()[0]; - result.getter = semanticInfoChain.getASTForDecl(getterDecl); - } - var setter = accessorSymbol.getSetter(); - if (setter) { - var setterDecl = setter.getDeclarations()[0]; - result.setter = semanticInfoChain.getASTForDecl(setterDecl); - } - - return result; - } - PullHelpers.getGetterAndSetterFunction = getGetterAndSetterFunction; - - function symbolIsEnum(source) { - return source && (source.kind & (64 /* Enum */ | 67108864 /* EnumMember */)) !== 0; - } - PullHelpers.symbolIsEnum = symbolIsEnum; - - function symbolIsModule(symbol) { - return symbol && (symbol.kind === 4 /* Container */ || isOneDeclarationOfKind(symbol, 4 /* Container */)); - } - PullHelpers.symbolIsModule = symbolIsModule; - - function isOneDeclarationOfKind(symbol, kind) { - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - if (decls[i].kind === kind) { - return true; - } - } - - return false; - } - - function isNameNumeric(name) { - return isFinite(+name); - } - PullHelpers.isNameNumeric = isNameNumeric; - - function typeSymbolsAreIdentical(a, b) { - if (a.isTypeReference() && !a.getIsSpecialized()) { - a = a.referencedTypeSymbol; - } - - if (b.isTypeReference() && !b.getIsSpecialized()) { - b = b.referencedTypeSymbol; - } - - return a === b; - } - PullHelpers.typeSymbolsAreIdentical = typeSymbolsAreIdentical; - - function getRootType(type) { - var rootType = type.getRootSymbol(); - - while (true) { - if (type === rootType) { - return type; - } - - type = rootType; - rootType = type.getRootSymbol(); - } - } - PullHelpers.getRootType = getRootType; - - function isSymbolLocal(symbol) { - var container = symbol.getContainer(); - if (container) { - var containerKind = container.kind; - if (containerKind & (1032192 /* SomeFunction */ | 16777216 /* FunctionType */)) { - return true; - } - - if (containerKind === 33554432 /* ConstructorType */ && !symbol.anyDeclHasFlag(16 /* Static */ | 1 /* Exported */)) { - return true; - } - } - - return false; - } - PullHelpers.isSymbolLocal = isSymbolLocal; - - function isExportedSymbolInClodule(symbol) { - var container = symbol.getContainer(); - return container && container.kind === 33554432 /* ConstructorType */ && symbolIsModule(container) && symbol.anyDeclHasFlag(1 /* Exported */); - } - PullHelpers.isExportedSymbolInClodule = isExportedSymbolInClodule; - - - - function walkSignatureSymbol(signatureSymbol, walker) { - var continueWalk = true; - var parameters = signatureSymbol.parameters; - if (parameters) { - for (var i = 0; continueWalk && i < parameters.length; i++) { - continueWalk = walker.signatureParameterWalk(parameters[i]); - } - } - - if (continueWalk) { - continueWalk = walker.signatureReturnTypeWalk(signatureSymbol.returnType); - } - - return continueWalk; - } - - function walkPullTypeSymbolStructure(typeSymbol, walker) { - var continueWalk = true; - - var members = typeSymbol.getMembers(); - for (var i = 0; continueWalk && i < members.length; i++) { - continueWalk = walker.memberSymbolWalk(members[i]); - } - - if (continueWalk) { - var callSigantures = typeSymbol.getCallSignatures(); - for (var i = 0; continueWalk && i < callSigantures.length; i++) { - continueWalk = walker.callSignatureWalk(callSigantures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(callSigantures[i], walker); - } - } - } - - if (continueWalk) { - var constructSignatures = typeSymbol.getConstructSignatures(); - for (var i = 0; continueWalk && i < constructSignatures.length; i++) { - continueWalk = walker.constructSignatureWalk(constructSignatures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(constructSignatures[i], walker); - } - } - } - - if (continueWalk) { - var indexSignatures = typeSymbol.getIndexSignatures(); - for (var i = 0; continueWalk && i < indexSignatures.length; i++) { - continueWalk = walker.indexSignatureWalk(indexSignatures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(indexSignatures[i], walker); - } - } - } - } - PullHelpers.walkPullTypeSymbolStructure = walkPullTypeSymbolStructure; - - var OtherPullDeclsWalker = (function () { - function OtherPullDeclsWalker() { - this.currentlyWalkingOtherDecls = []; - } - OtherPullDeclsWalker.prototype.walkOtherPullDecls = function (currentDecl, otherDecls, callBack) { - if (otherDecls) { - var isAlreadyWalkingOtherDecl = TypeScript.ArrayUtilities.any(this.currentlyWalkingOtherDecls, function (inWalkingOtherDecl) { - return TypeScript.ArrayUtilities.contains(otherDecls, inWalkingOtherDecl); - }); - - if (!isAlreadyWalkingOtherDecl) { - this.currentlyWalkingOtherDecls.push(currentDecl); - for (var i = 0; i < otherDecls.length; i++) { - if (otherDecls[i] !== currentDecl) { - callBack(otherDecls[i]); - } - } - var currentlyWalkingOtherDeclsDecl = this.currentlyWalkingOtherDecls.pop(); - TypeScript.Debug.assert(currentlyWalkingOtherDeclsDecl == currentDecl); - } - } - }; - return OtherPullDeclsWalker; - })(); - PullHelpers.OtherPullDeclsWalker = OtherPullDeclsWalker; - })(TypeScript.PullHelpers || (TypeScript.PullHelpers = {})); - var PullHelpers = TypeScript.PullHelpers; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var WrapsTypeParameterCache = (function () { - function WrapsTypeParameterCache() { - this._wrapsTypeParameterCache = TypeScript.BitVector.getBitVector(true); - } - WrapsTypeParameterCache.prototype.getWrapsTypeParameter = function (typeParameterArgumentMap) { - var mapHasTypeParameterNotCached = false; - for (var typeParameterID in typeParameterArgumentMap) { - if (typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - var cachedValue = this._wrapsTypeParameterCache.valueAt(typeParameterID); - if (cachedValue) { - return typeParameterID; - } - mapHasTypeParameterNotCached = mapHasTypeParameterNotCached || cachedValue === undefined; - } - } - - if (!mapHasTypeParameterNotCached) { - return 0; - } - - return undefined; - }; - - WrapsTypeParameterCache.prototype.setWrapsTypeParameter = function (typeParameterArgumentMap, wrappingTypeParameterID) { - if (wrappingTypeParameterID) { - this._wrapsTypeParameterCache.setValueAt(wrappingTypeParameterID, true); - } else { - for (var typeParameterID in typeParameterArgumentMap) { - if (typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - this._wrapsTypeParameterCache.setValueAt(typeParameterID, false); - } - } - } - }; - return WrapsTypeParameterCache; - })(); - TypeScript.WrapsTypeParameterCache = WrapsTypeParameterCache; - - (function (PullInstantiationHelpers) { - var MutableTypeArgumentMap = (function () { - function MutableTypeArgumentMap(typeParameterArgumentMap) { - this.typeParameterArgumentMap = typeParameterArgumentMap; - this.createdDuplicateTypeArgumentMap = false; - } - MutableTypeArgumentMap.prototype.ensureTypeArgumentCopy = function () { - if (!this.createdDuplicateTypeArgumentMap) { - var passedInTypeArgumentMap = this.typeParameterArgumentMap; - this.typeParameterArgumentMap = []; - for (var typeParameterID in passedInTypeArgumentMap) { - if (passedInTypeArgumentMap.hasOwnProperty(typeParameterID)) { - this.typeParameterArgumentMap[typeParameterID] = passedInTypeArgumentMap[typeParameterID]; - } - } - this.createdDuplicateTypeArgumentMap = true; - } - }; - return MutableTypeArgumentMap; - })(); - PullInstantiationHelpers.MutableTypeArgumentMap = MutableTypeArgumentMap; - - function instantiateTypeArgument(resolver, symbol, mutableTypeParameterMap) { - if (symbol.getIsSpecialized()) { - var rootTypeArgumentMap = symbol.getTypeParameterArgumentMap(); - var newTypeArgumentMap = []; - var allowedTypeParameters = symbol.getAllowedToReferenceTypeParameters(); - for (var i = 0; i < allowedTypeParameters.length; i++) { - var typeParameterID = allowedTypeParameters[i].pullSymbolID; - var typeArg = rootTypeArgumentMap[typeParameterID]; - if (typeArg) { - newTypeArgumentMap[typeParameterID] = resolver.instantiateType(typeArg, mutableTypeParameterMap.typeParameterArgumentMap); - } - } - - for (var i = 0; i < allowedTypeParameters.length; i++) { - var typeParameterID = allowedTypeParameters[i].pullSymbolID; - if (newTypeArgumentMap[typeParameterID] && mutableTypeParameterMap.typeParameterArgumentMap[typeParameterID] != newTypeArgumentMap[typeParameterID]) { - mutableTypeParameterMap.ensureTypeArgumentCopy(); - mutableTypeParameterMap.typeParameterArgumentMap[typeParameterID] = newTypeArgumentMap[typeParameterID]; - } - } - } - } - PullInstantiationHelpers.instantiateTypeArgument = instantiateTypeArgument; - - function cleanUpTypeArgumentMap(symbol, mutableTypeArgumentMap) { - var allowedToReferenceTypeParameters = symbol.getAllowedToReferenceTypeParameters(); - for (var typeParameterID in mutableTypeArgumentMap.typeParameterArgumentMap) { - if (mutableTypeArgumentMap.typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - if (!TypeScript.ArrayUtilities.any(allowedToReferenceTypeParameters, function (typeParameter) { - return typeParameter.pullSymbolID == typeParameterID; - })) { - mutableTypeArgumentMap.ensureTypeArgumentCopy(); - delete mutableTypeArgumentMap.typeParameterArgumentMap[typeParameterID]; - } - } - } - } - PullInstantiationHelpers.cleanUpTypeArgumentMap = cleanUpTypeArgumentMap; - - function getAllowedToReferenceTypeParametersFromDecl(decl) { - var allowedToReferenceTypeParameters = []; - - var allowedToUseDeclTypeParameters = false; - var getTypeParametersFromParentDecl = false; - - switch (decl.kind) { - case 65536 /* Method */: - if (TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - allowedToUseDeclTypeParameters = true; - break; - } - - case 16777216 /* FunctionType */: - case 33554432 /* ConstructorType */: - case 2097152 /* ConstructSignature */: - case 1048576 /* CallSignature */: - case 131072 /* FunctionExpression */: - case 16384 /* Function */: - allowedToUseDeclTypeParameters = true; - getTypeParametersFromParentDecl = true; - break; - - case 4096 /* Property */: - if (TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - break; - } - - case 2048 /* Parameter */: - case 262144 /* GetAccessor */: - case 524288 /* SetAccessor */: - case 32768 /* ConstructorMethod */: - case 4194304 /* IndexSignature */: - case 8388608 /* ObjectType */: - case 256 /* ObjectLiteral */: - case 8192 /* TypeParameter */: - getTypeParametersFromParentDecl = true; - break; - - case 8 /* Class */: - case 16 /* Interface */: - allowedToUseDeclTypeParameters = true; - break; - } - - if (getTypeParametersFromParentDecl) { - allowedToReferenceTypeParameters = allowedToReferenceTypeParameters.concat(getAllowedToReferenceTypeParametersFromDecl(decl.getParentDecl())); - } - - if (allowedToUseDeclTypeParameters) { - var typeParameterDecls = decl.getTypeParameters(); - for (var i = 0; i < typeParameterDecls.length; i++) { - allowedToReferenceTypeParameters.push(typeParameterDecls[i].getSymbol()); - } - } - - return allowedToReferenceTypeParameters; - } - PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl = getAllowedToReferenceTypeParametersFromDecl; - - function createTypeParameterArgumentMap(typeParameters, typeArguments) { - return updateTypeParameterArgumentMap(typeParameters, typeArguments, {}); - } - PullInstantiationHelpers.createTypeParameterArgumentMap = createTypeParameterArgumentMap; - - function updateTypeParameterArgumentMap(typeParameters, typeArguments, typeParameterArgumentMap) { - for (var i = 0; i < typeParameters.length; i++) { - typeParameterArgumentMap[typeParameters[i].getRootSymbol().pullSymbolID] = typeArguments[i]; - } - return typeParameterArgumentMap; - } - PullInstantiationHelpers.updateTypeParameterArgumentMap = updateTypeParameterArgumentMap; - - function updateMutableTypeParameterArgumentMap(typeParameters, typeArguments, mutableMap) { - for (var i = 0; i < typeParameters.length; i++) { - var typeParameterId = typeParameters[i].getRootSymbol().pullSymbolID; - if (mutableMap.typeParameterArgumentMap[typeParameterId] !== typeArguments[i]) { - mutableMap.ensureTypeArgumentCopy(); - mutableMap.typeParameterArgumentMap[typeParameterId] = typeArguments[i]; - } - } - } - PullInstantiationHelpers.updateMutableTypeParameterArgumentMap = updateMutableTypeParameterArgumentMap; - - function twoTypesAreInstantiationsOfSameNamedGenericType(type1, type2) { - var type1IsGeneric = type1.isGeneric() && type1.getTypeArguments() !== null; - var type2IsGeneric = type2.isGeneric() && type2.getTypeArguments() !== null; - - if (type1IsGeneric && type2IsGeneric) { - var type1Root = TypeScript.PullHelpers.getRootType(type1); - var type2Root = TypeScript.PullHelpers.getRootType(type2); - return type1Root === type2Root; - } - - return false; - } - PullInstantiationHelpers.twoTypesAreInstantiationsOfSameNamedGenericType = twoTypesAreInstantiationsOfSameNamedGenericType; - })(TypeScript.PullInstantiationHelpers || (TypeScript.PullInstantiationHelpers = {})); - var PullInstantiationHelpers = TypeScript.PullInstantiationHelpers; -})(TypeScript || (TypeScript = {})); -if (Error) - Error.stackTraceLimit = 1000; - -var TypeScript; -(function (TypeScript) { - TypeScript.fileResolutionTime = 0; - TypeScript.fileResolutionIOTime = 0; - TypeScript.fileResolutionScanImportsTime = 0; - TypeScript.fileResolutionImportFileSearchTime = 0; - TypeScript.fileResolutionGetDefaultLibraryTime = 0; - TypeScript.sourceCharactersCompiled = 0; - TypeScript.syntaxTreeParseTime = 0; - TypeScript.syntaxDiagnosticsTime = 0; - TypeScript.astTranslationTime = 0; - TypeScript.typeCheckTime = 0; - - TypeScript.compilerResolvePathTime = 0; - TypeScript.compilerDirectoryNameTime = 0; - TypeScript.compilerDirectoryExistsTime = 0; - TypeScript.compilerFileExistsTime = 0; - - TypeScript.emitTime = 0; - TypeScript.emitWriteFileTime = 0; - - TypeScript.declarationEmitTime = 0; - TypeScript.declarationEmitIsExternallyVisibleTime = 0; - TypeScript.declarationEmitTypeSignatureTime = 0; - TypeScript.declarationEmitGetBoundDeclTypeTime = 0; - TypeScript.declarationEmitIsOverloadedCallSignatureTime = 0; - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime = 0; - TypeScript.declarationEmitGetBaseTypeTime = 0; - TypeScript.declarationEmitGetAccessorFunctionTime = 0; - TypeScript.declarationEmitGetTypeParameterSymbolTime = 0; - TypeScript.declarationEmitGetImportDeclarationSymbolTime = 0; - - TypeScript.ioHostResolvePathTime = 0; - TypeScript.ioHostDirectoryNameTime = 0; - TypeScript.ioHostCreateDirectoryStructureTime = 0; - TypeScript.ioHostWriteFileTime = 0; - - (function (EmitOutputResult) { - EmitOutputResult[EmitOutputResult["Succeeded"] = 0] = "Succeeded"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfSyntaxErrors"] = 1] = "FailedBecauseOfSyntaxErrors"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfCompilerOptionsErrors"] = 2] = "FailedBecauseOfCompilerOptionsErrors"; - EmitOutputResult[EmitOutputResult["FailedToGenerateDeclarationsBecauseOfSemanticErrors"] = 3] = "FailedToGenerateDeclarationsBecauseOfSemanticErrors"; - })(TypeScript.EmitOutputResult || (TypeScript.EmitOutputResult = {})); - var EmitOutputResult = TypeScript.EmitOutputResult; - - var EmitOutput = (function () { - function EmitOutput(emitOutputResult) { - if (typeof emitOutputResult === "undefined") { emitOutputResult = 0 /* Succeeded */; } - this.outputFiles = []; - this.emitOutputResult = emitOutputResult; - } - return EmitOutput; - })(); - TypeScript.EmitOutput = EmitOutput; - - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(TypeScript.OutputFileType || (TypeScript.OutputFileType = {})); - var OutputFileType = TypeScript.OutputFileType; - - var OutputFile = (function () { - function OutputFile(name, writeByteOrderMark, text, fileType, sourceMapEntries) { - if (typeof sourceMapEntries === "undefined") { sourceMapEntries = []; } - this.name = name; - this.writeByteOrderMark = writeByteOrderMark; - this.text = text; - this.fileType = fileType; - this.sourceMapEntries = sourceMapEntries; - } - return OutputFile; - })(); - TypeScript.OutputFile = OutputFile; - - var CompileResult = (function () { - function CompileResult() { - this.diagnostics = []; - this.outputFiles = []; - } - CompileResult.fromDiagnostics = function (diagnostics) { - var result = new CompileResult(); - result.diagnostics = diagnostics; - return result; - }; - - CompileResult.fromOutputFiles = function (outputFiles) { - var result = new CompileResult(); - result.outputFiles = outputFiles; - return result; - }; - return CompileResult; - })(); - TypeScript.CompileResult = CompileResult; - - var TypeScriptCompiler = (function () { - function TypeScriptCompiler(logger, _settings) { - if (typeof logger === "undefined") { logger = new TypeScript.NullLogger(); } - if (typeof _settings === "undefined") { _settings = TypeScript.ImmutableCompilationSettings.defaultSettings(); } - this.logger = logger; - this._settings = _settings; - this.semanticInfoChain = null; - this.semanticInfoChain = new TypeScript.SemanticInfoChain(this, logger); - } - TypeScriptCompiler.prototype.compilationSettings = function () { - return this._settings; - }; - - TypeScriptCompiler.prototype.setCompilationSettings = function (newSettings) { - var oldSettings = this._settings; - this._settings = newSettings; - - if (!compareDataObjects(oldSettings, newSettings)) { - this.semanticInfoChain.invalidate(oldSettings, newSettings); - } - }; - - TypeScriptCompiler.prototype.getDocument = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - return this.semanticInfoChain.getDocument(fileName); - }; - - TypeScriptCompiler.prototype.cleanupSemanticCache = function () { - this.semanticInfoChain.invalidate(); - }; - - TypeScriptCompiler.prototype.addFile = function (fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles) { - if (typeof referencedFiles === "undefined") { referencedFiles = []; } - fileName = TypeScript.switchToForwardSlashes(fileName); - - TypeScript.sourceCharactersCompiled += scriptSnapshot.getLength(); - - var document = TypeScript.Document.create(this, this.semanticInfoChain, fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles); - - this.semanticInfoChain.addDocument(document); - }; - - TypeScriptCompiler.prototype.updateFile = function (fileName, scriptSnapshot, version, isOpen, textChangeRange) { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var document = this.getDocument(fileName); - var updatedDocument = document.update(scriptSnapshot, version, isOpen, textChangeRange); - - this.semanticInfoChain.addDocument(updatedDocument); - }; - - TypeScriptCompiler.prototype.removeFile = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - this.semanticInfoChain.removeDocument(fileName); - }; - - TypeScriptCompiler.prototype.mapOutputFileName = function (document, emitOptions, extensionChanger) { - if (document.emitToOwnOutputFile()) { - var updatedFileName = document.fileName; - if (emitOptions.outputDirectory() !== "") { - updatedFileName = document.fileName.replace(emitOptions.commonDirectoryPath(), ""); - updatedFileName = emitOptions.outputDirectory() + updatedFileName; - } - return extensionChanger(updatedFileName, false); - } else { - return extensionChanger(emitOptions.sharedOutputFile(), true); - } - }; - - TypeScriptCompiler.prototype.writeByteOrderMarkForDocument = function (document) { - var printReason = false; - - if (document.emitToOwnOutputFile()) { - var result = document.byteOrderMark !== 0 /* None */; - if (printReason) { - TypeScript.Environment.standardOut.WriteLine("Emitting byte order mark because of: " + document.fileName); - } - return result; - } else { - var fileNames = this.fileNames(); - - var result = false; - for (var i = 0, n = fileNames.length; i < n; i++) { - var document = this.getDocument(fileNames[i]); - - if (document.isExternalModule()) { - continue; - } - - if (document.byteOrderMark !== 0 /* None */) { - if (printReason) { - TypeScript.Environment.standardOut.WriteLine("Emitting byte order mark because of: " + document.fileName); - result = true; - } else { - return true; - } - } - } - - return result; - } - }; - - TypeScriptCompiler.mapToDTSFileName = function (fileName, wholeFileNameReplaced) { - return TypeScript.getDeclareFilePath(fileName); - }; - - TypeScriptCompiler.prototype._shouldEmit = function (document) { - return !document.isDeclareFile(); - }; - - TypeScriptCompiler.prototype._shouldEmitDeclarations = function (document) { - if (!this.compilationSettings().generateDeclarationFiles()) { - return false; - } - - return this._shouldEmit(document); - }; - - TypeScriptCompiler.prototype.emitDocumentDeclarationsWorker = function (document, emitOptions, declarationEmitter) { - var sourceUnit = document.sourceUnit(); - TypeScript.Debug.assert(this._shouldEmitDeclarations(document)); - - if (declarationEmitter) { - declarationEmitter.document = document; - } else { - var declareFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToDTSFileName); - declarationEmitter = new TypeScript.DeclarationEmitter(declareFileName, document, this, emitOptions, this.semanticInfoChain); - } - - declarationEmitter.emitDeclarations(sourceUnit); - return declarationEmitter; - }; - - TypeScriptCompiler.prototype._emitDocumentDeclarations = function (document, emitOptions, onSingleFileEmitComplete, sharedEmitter) { - if (this._shouldEmitDeclarations(document)) { - if (document.emitToOwnOutputFile()) { - var singleEmitter = this.emitDocumentDeclarationsWorker(document, emitOptions); - if (singleEmitter) { - onSingleFileEmitComplete(singleEmitter.getOutputFile()); - } - } else { - sharedEmitter = this.emitDocumentDeclarationsWorker(document, emitOptions, sharedEmitter); - } - } - - return sharedEmitter; - }; - - TypeScriptCompiler.prototype.emitAllDeclarations = function (resolvePath) { - var start = new Date().getTime(); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var sharedEmitter = null; - var fileNames = this.fileNames(); - - for (var i = 0, n = fileNames.length; i < n; i++) { - var fileName = fileNames[i]; - - var document = this.getDocument(fileNames[i]); - - sharedEmitter = this._emitDocumentDeclarations(document, emitOptions, function (file) { - return emitOutput.outputFiles.push(file); - }, sharedEmitter); - } - - if (sharedEmitter) { - emitOutput.outputFiles.push(sharedEmitter.getOutputFile()); - } - - TypeScript.declarationEmitTime += new Date().getTime() - start; - - return emitOutput; - }; - - TypeScriptCompiler.prototype.emitDeclarations = function (fileName, resolvePath) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var document = this.getDocument(fileName); - - if (document.emitToOwnOutputFile()) { - this._emitDocumentDeclarations(document, emitOptions, function (file) { - return emitOutput.outputFiles.push(file); - }, null); - return emitOutput; - } else { - return this.emitAllDeclarations(resolvePath); - } - }; - - TypeScriptCompiler.prototype.canEmitDeclarations = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var document = this.getDocument(fileName); - return this._shouldEmitDeclarations(document); - }; - - TypeScriptCompiler.mapToFileNameExtension = function (extension, fileName, wholeFileNameReplaced) { - if (wholeFileNameReplaced) { - return fileName; - } else { - var splitFname = fileName.split("."); - splitFname.pop(); - return splitFname.join(".") + extension; - } - }; - - TypeScriptCompiler.mapToJSFileName = function (fileName, wholeFileNameReplaced) { - return TypeScriptCompiler.mapToFileNameExtension(".js", fileName, wholeFileNameReplaced); - }; - - TypeScriptCompiler.prototype.emitDocumentWorker = function (document, emitOptions, emitter) { - var sourceUnit = document.sourceUnit(); - TypeScript.Debug.assert(this._shouldEmit(document)); - - var typeScriptFileName = document.fileName; - if (!emitter) { - var javaScriptFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToJSFileName); - var outFile = new TypeScript.TextWriter(javaScriptFileName, this.writeByteOrderMarkForDocument(document), 0 /* JavaScript */); - - emitter = new TypeScript.Emitter(javaScriptFileName, outFile, emitOptions, this.semanticInfoChain); - - if (this.compilationSettings().mapSourceFiles()) { - var sourceMapFile = new TypeScript.TextWriter(javaScriptFileName + TypeScript.SourceMapper.MapFileExtension, false, 1 /* SourceMap */); - emitter.createSourceMapper(document, javaScriptFileName, outFile, sourceMapFile, emitOptions.resolvePath); - } - } else if (this.compilationSettings().mapSourceFiles()) { - emitter.setSourceMapperNewSourceFile(document); - } - - emitter.setDocument(document); - emitter.emitJavascript(sourceUnit, false); - - return emitter; - }; - - TypeScriptCompiler.prototype._emitDocument = function (document, emitOptions, onSingleFileEmitComplete, sharedEmitter) { - if (this._shouldEmit(document)) { - if (document.emitToOwnOutputFile()) { - var singleEmitter = this.emitDocumentWorker(document, emitOptions); - if (singleEmitter) { - onSingleFileEmitComplete(singleEmitter.getOutputFiles()); - } - } else { - sharedEmitter = this.emitDocumentWorker(document, emitOptions, sharedEmitter); - } - } - - return sharedEmitter; - }; - - TypeScriptCompiler.prototype.emitAll = function (resolvePath) { - var start = new Date().getTime(); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var fileNames = this.fileNames(); - var sharedEmitter = null; - - for (var i = 0, n = fileNames.length; i < n; i++) { - var fileName = fileNames[i]; - - var document = this.getDocument(fileName); - - sharedEmitter = this._emitDocument(document, emitOptions, function (files) { - return emitOutput.outputFiles.push.apply(emitOutput.outputFiles, files); - }, sharedEmitter); - } - - if (sharedEmitter) { - emitOutput.outputFiles.push.apply(emitOutput.outputFiles, sharedEmitter.getOutputFiles()); - } - - TypeScript.emitTime += new Date().getTime() - start; - return emitOutput; - }; - - TypeScriptCompiler.prototype.emit = function (fileName, resolvePath) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var document = this.getDocument(fileName); - - if (document.emitToOwnOutputFile()) { - this._emitDocument(document, emitOptions, function (files) { - return emitOutput.outputFiles.push.apply(emitOutput.outputFiles, files); - }, null); - return emitOutput; - } else { - return this.emitAll(resolvePath); - } - }; - - TypeScriptCompiler.prototype.compile = function (resolvePath, continueOnDiagnostics) { - if (typeof continueOnDiagnostics === "undefined") { continueOnDiagnostics = false; } - return new CompilerIterator(this, resolvePath, continueOnDiagnostics); - }; - - TypeScriptCompiler.prototype.getSyntacticDiagnostics = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - return this.getDocument(fileName).diagnostics(); - }; - - TypeScriptCompiler.prototype.getSyntaxTree = function (fileName) { - return this.getDocument(fileName).syntaxTree(); - }; - - TypeScriptCompiler.prototype.getSourceUnit = function (fileName) { - return this.getDocument(fileName).sourceUnit(); - }; - - TypeScriptCompiler.prototype.getSemanticDiagnostics = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var document = this.getDocument(fileName); - - var startTime = (new Date()).getTime(); - TypeScript.PullTypeResolver.typeCheck(this.compilationSettings(), this.semanticInfoChain, document); - var endTime = (new Date()).getTime(); - - TypeScript.typeCheckTime += endTime - startTime; - - var errors = this.semanticInfoChain.getDiagnostics(fileName); - - errors = TypeScript.ArrayUtilities.distinct(errors, TypeScript.Diagnostic.equals); - errors.sort(function (d1, d2) { - if (d1.fileName() < d2.fileName()) { - return -1; - } else if (d1.fileName() > d2.fileName()) { - return 1; - } - - if (d1.start() < d2.start()) { - return -1; - } else if (d1.start() > d2.start()) { - return 1; - } - - var code1 = TypeScript.diagnosticInformationMap[d1.diagnosticKey()].code; - var code2 = TypeScript.diagnosticInformationMap[d2.diagnosticKey()].code; - if (code1 < code2) { - return -1; - } else if (code1 > code2) { - return 1; - } - - return 0; - }); - - return errors; - }; - - TypeScriptCompiler.prototype.getCompilerOptionsDiagnostics = function () { - var emitOptions = new TypeScript.EmitOptions(this, null); - var emitDiagnostic = emitOptions.diagnostic(); - if (emitDiagnostic) { - return [emitDiagnostic]; - } - return TypeScript.sentinelEmptyArray; - }; - - TypeScriptCompiler.prototype.resolveAllFiles = function () { - var fileNames = this.fileNames(); - for (var i = 0, n = fileNames.length; i < n; i++) { - this.getSemanticDiagnostics(fileNames[i]); - } - }; - - TypeScriptCompiler.prototype.getSymbolOfDeclaration = function (decl) { - if (!decl) { - return null; - } - - var resolver = this.semanticInfoChain.getResolver(); - var ast = this.semanticInfoChain.getASTForDecl(decl); - if (!ast) { - return null; - } - - var enclosingDecl = resolver.getEnclosingDecl(decl); - if (ast.kind() === 139 /* GetAccessor */ || ast.kind() === 140 /* SetAccessor */) { - return this.getSymbolOfDeclaration(enclosingDecl); - } - - return resolver.resolveAST(ast, false, new TypeScript.PullTypeResolutionContext(resolver)); - }; - - TypeScriptCompiler.prototype.extractResolutionContextFromAST = function (resolver, ast, document, propagateContextualTypes) { - var scriptName = document.fileName; - - var enclosingDecl = null; - var enclosingDeclAST = null; - var inContextuallyTypedAssignment = false; - var inWithBlock = false; - - var resolutionContext = new TypeScript.PullTypeResolutionContext(resolver); - - if (!ast) { - return null; - } - - var path = this.getASTPath(ast); - - for (var i = 0, n = path.length; i < n; i++) { - var current = path[i]; - - switch (current.kind()) { - case 222 /* FunctionExpression */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - if (propagateContextualTypes) { - resolver.resolveAST(current, true, resolutionContext); - } - break; - - case 136 /* MemberVariableDeclaration */: - var memberVariable = current; - inContextuallyTypedAssignment = memberVariable.variableDeclarator.typeAnnotation !== null; - - this.extractResolutionContextForVariable(inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, memberVariable, memberVariable.variableDeclarator.equalsValueClause); - break; - - case 225 /* VariableDeclarator */: - var variableDeclarator = current; - inContextuallyTypedAssignment = variableDeclarator.typeAnnotation !== null; - - this.extractResolutionContextForVariable(inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, variableDeclarator, variableDeclarator.equalsValueClause); - break; - - case 213 /* InvocationExpression */: - case 216 /* ObjectCreationExpression */: - if (propagateContextualTypes) { - var isNew = current.kind() === 216 /* ObjectCreationExpression */; - var callExpression = current; - var contextualType = null; - - if ((i + 2 < n) && callExpression.argumentList === path[i + 1] && callExpression.argumentList.arguments === path[i + 2]) { - var callResolutionResults = new TypeScript.PullAdditionalCallResolutionData(); - if (isNew) { - resolver.resolveObjectCreationExpression(callExpression, resolutionContext, callResolutionResults); - } else { - resolver.resolveInvocationExpression(callExpression, resolutionContext, callResolutionResults); - } - - if (callResolutionResults.actualParametersContextTypeSymbols) { - var argExpression = path[i + 3]; - if (argExpression) { - for (var j = 0, m = callExpression.argumentList.arguments.nonSeparatorCount(); j < m; j++) { - if (callExpression.argumentList.arguments.nonSeparatorAt(j) === argExpression) { - var callContextualType = callResolutionResults.actualParametersContextTypeSymbols[j]; - if (callContextualType) { - contextualType = callContextualType; - break; - } - } - } - } - } - } else { - if (isNew) { - resolver.resolveObjectCreationExpression(callExpression, resolutionContext); - } else { - resolver.resolveInvocationExpression(callExpression, resolutionContext); - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 214 /* ArrayLiteralExpression */: - if (propagateContextualTypes) { - var contextualType = null; - var currentContextualType = resolutionContext.getContextualType(); - if (currentContextualType && currentContextualType.isArrayNamedTypeReference()) { - contextualType = currentContextualType.getElementType(); - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 215 /* ObjectLiteralExpression */: - if (propagateContextualTypes) { - var objectLiteralExpression = current; - var objectLiteralResolutionContext = new TypeScript.PullAdditionalObjectLiteralResolutionData(); - resolver.resolveObjectLiteralExpression(objectLiteralExpression, inContextuallyTypedAssignment, resolutionContext, objectLiteralResolutionContext); - - var memeberAST = (path[i + 1] && path[i + 1].kind() === 2 /* SeparatedList */) ? path[i + 2] : path[i + 1]; - if (memeberAST) { - var contextualType = null; - var memberDecls = objectLiteralExpression.propertyAssignments; - if (memberDecls && objectLiteralResolutionContext.membersContextTypeSymbols) { - for (var j = 0, m = memberDecls.nonSeparatorCount(); j < m; j++) { - if (memberDecls.nonSeparatorAt(j) === memeberAST) { - var memberContextualType = objectLiteralResolutionContext.membersContextTypeSymbols[j]; - if (memberContextualType) { - contextualType = memberContextualType; - break; - } - } - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - } - - break; - - case 174 /* AssignmentExpression */: - if (propagateContextualTypes) { - var assignmentExpression = current; - var contextualType = null; - - if (path[i + 1] && path[i + 1] === assignmentExpression.right) { - var leftType = resolver.resolveAST(assignmentExpression.left, inContextuallyTypedAssignment, resolutionContext).type; - if (leftType) { - inContextuallyTypedAssignment = true; - contextualType = leftType; - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 220 /* CastExpression */: - var castExpression = current; - if (!(i + 1 < n && path[i + 1] === castExpression.type)) { - if (propagateContextualTypes) { - var contextualType = null; - var typeSymbol = resolver.resolveAST(castExpression, inContextuallyTypedAssignment, resolutionContext).type; - - if (typeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = typeSymbol; - } - - resolutionContext.pushNewContextualType(contextualType); - } - } - - break; - - case 150 /* ReturnStatement */: - if (propagateContextualTypes) { - var returnStatement = current; - var contextualType = null; - - if (enclosingDecl && (enclosingDecl.kind & 1032192 /* SomeFunction */)) { - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation) { - var returnTypeSymbol = resolver.resolveTypeReference(typeAnnotation, resolutionContext); - if (returnTypeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = returnTypeSymbol; - } - } else { - var currentContextualType = resolutionContext.getContextualType(); - if (currentContextualType && currentContextualType.isFunction()) { - var contextualSignatures = currentContextualType.kind == 33554432 /* ConstructorType */ ? currentContextualType.getConstructSignatures() : currentContextualType.getCallSignatures(); - var currentContextualTypeSignatureSymbol = contextualSignatures[0]; - var currentContextualTypeReturnTypeSymbol = currentContextualTypeSignatureSymbol.returnType; - if (currentContextualTypeReturnTypeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = currentContextualTypeReturnTypeSymbol; - } - } - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 122 /* ObjectType */: - if (propagateContextualTypes && TypeScript.isTypesOnlyLocation(current)) { - resolver.resolveAST(current, false, resolutionContext); - } - - break; - - case 163 /* WithStatement */: - inWithBlock = true; - break; - - case 146 /* Block */: - inContextuallyTypedAssignment = false; - break; - } - - var decl = this.semanticInfoChain.getDeclForAST(current); - if (decl) { - enclosingDecl = decl; - enclosingDeclAST = current; - } - } - - if (ast && ast.parent && ast.kind() === 11 /* IdentifierName */) { - if (ast.parent.kind() === 212 /* MemberAccessExpression */) { - if (ast.parent.name === ast) { - ast = ast.parent; - } - } else if (ast.parent.kind() === 121 /* QualifiedName */) { - if (ast.parent.right === ast) { - ast = ast.parent; - } - } - } - - return { - ast: ast, - enclosingDecl: enclosingDecl, - resolutionContext: resolutionContext, - inContextuallyTypedAssignment: inContextuallyTypedAssignment, - inWithBlock: inWithBlock - }; - }; - - TypeScriptCompiler.prototype.extractResolutionContextForVariable = function (inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, assigningAST, init) { - if (inContextuallyTypedAssignment) { - if (propagateContextualTypes) { - resolver.resolveAST(assigningAST, false, resolutionContext); - var varSymbol = this.semanticInfoChain.getSymbolForAST(assigningAST); - - var contextualType = null; - if (varSymbol && inContextuallyTypedAssignment) { - contextualType = varSymbol.type; - } - - resolutionContext.pushNewContextualType(contextualType); - - if (init) { - resolver.resolveAST(init, inContextuallyTypedAssignment, resolutionContext); - } - } - } - }; - - TypeScriptCompiler.prototype.getASTPath = function (ast) { - var result = []; - - while (ast) { - result.unshift(ast); - ast = ast.parent; - } - - return result; - }; - - TypeScriptCompiler.prototype.pullGetSymbolInformationFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - ast = context.ast; - var symbol = resolver.resolveAST(ast, context.inContextuallyTypedAssignment, context.resolutionContext); - - if (!symbol) { - TypeScript.Debug.assert(ast.kind() === 120 /* SourceUnit */, "No symbol was found for ast and ast was not source unit. Ast Kind: " + TypeScript.SyntaxKind[ast.kind()]); - return null; - } - - if (symbol.isTypeReference()) { - symbol = symbol.getReferencedTypeSymbol(); - } - - var aliasSymbol = this.semanticInfoChain.getAliasSymbolForAST(ast); - - return { - symbol: symbol, - aliasSymbol: aliasSymbol, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetCallInformationFromAST = function (ast, document) { - if (ast.kind() !== 213 /* InvocationExpression */ && ast.kind() !== 216 /* ObjectCreationExpression */) { - return null; - } - - var isNew = ast.kind() === 216 /* ObjectCreationExpression */; - - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var callResolutionResults = new TypeScript.PullAdditionalCallResolutionData(); - - if (isNew) { - resolver.resolveObjectCreationExpression(ast, context.resolutionContext, callResolutionResults); - } else { - resolver.resolveInvocationExpression(ast, context.resolutionContext, callResolutionResults); - } - - return { - targetSymbol: callResolutionResults.targetSymbol, - resolvedSignatures: callResolutionResults.resolvedSignatures, - candidateSignature: callResolutionResults.candidateSignature, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl), - isConstructorCall: isNew - }; - }; - - TypeScriptCompiler.prototype.pullGetVisibleMemberSymbolsFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var symbols = resolver.getVisibleMembersFromExpression(ast, context.enclosingDecl, context.resolutionContext); - if (!symbols) { - return null; - } - - return { - symbols: symbols, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetVisibleDeclsFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, false); - if (!context || context.inWithBlock) { - return null; - } - - return resolver.getVisibleDecls(context.enclosingDecl); - }; - - TypeScriptCompiler.prototype.pullGetContextualMembersFromAST = function (ast, document) { - if (ast.kind() !== 215 /* ObjectLiteralExpression */) { - return null; - } - - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var members = resolver.getVisibleContextSymbols(context.enclosingDecl, context.resolutionContext); - - return { - symbols: members, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetDeclInformation = function (decl, ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var astForDecl = decl.ast(); - if (!astForDecl) { - return null; - } - - var astForDeclContext = this.extractResolutionContextFromAST(resolver, astForDecl, this.getDocument(astForDecl.fileName()), true); - if (!astForDeclContext) { - return null; - } - - var symbol = decl.getSymbol(); - resolver.resolveDeclaredSymbol(symbol, context.resolutionContext); - symbol.setUnresolved(); - - return { - symbol: symbol, - aliasSymbol: null, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.topLevelDeclaration = function (fileName) { - return this.semanticInfoChain.topLevelDecl(fileName); - }; - - TypeScriptCompiler.prototype.getDeclForAST = function (ast) { - return this.semanticInfoChain.getDeclForAST(ast); - }; - - TypeScriptCompiler.prototype.fileNames = function () { - return this.semanticInfoChain.fileNames(); - }; - - TypeScriptCompiler.prototype.topLevelDecl = function (fileName) { - return this.semanticInfoChain.topLevelDecl(fileName); - }; - - TypeScriptCompiler.getLocationText = function (location) { - return location.fileName() + "(" + (location.line() + 1) + "," + (location.character() + 1) + ")"; - }; - - TypeScriptCompiler.getFullDiagnosticText = function (diagnostic) { - var result = ""; - if (diagnostic.fileName()) { - result += this.getLocationText(diagnostic) + ": "; - } - - result += diagnostic.message(); - - var additionalLocations = diagnostic.additionalLocations(); - if (additionalLocations.length > 0) { - result += " " + TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Additional_locations, null) + TypeScript.Environment.newLine; - - for (var i = 0, n = additionalLocations.length; i < n; i++) { - result += "\t" + this.getLocationText(additionalLocations[i]) + TypeScript.Environment.newLine; - } - } else { - result += TypeScript.Environment.newLine; - } - - return result; - }; - return TypeScriptCompiler; - })(); - TypeScript.TypeScriptCompiler = TypeScriptCompiler; - - var CompilerPhase; - (function (CompilerPhase) { - CompilerPhase[CompilerPhase["Syntax"] = 0] = "Syntax"; - CompilerPhase[CompilerPhase["Semantics"] = 1] = "Semantics"; - CompilerPhase[CompilerPhase["EmitOptionsValidation"] = 2] = "EmitOptionsValidation"; - CompilerPhase[CompilerPhase["Emit"] = 3] = "Emit"; - CompilerPhase[CompilerPhase["DeclarationEmit"] = 4] = "DeclarationEmit"; - })(CompilerPhase || (CompilerPhase = {})); - - var CompilerIterator = (function () { - function CompilerIterator(compiler, resolvePath, continueOnDiagnostics, startingPhase) { - if (typeof startingPhase === "undefined") { startingPhase = 0 /* Syntax */; } - this.compiler = compiler; - this.resolvePath = resolvePath; - this.continueOnDiagnostics = continueOnDiagnostics; - this.index = -1; - this.fileNames = null; - this._current = null; - this._emitOptions = null; - this._sharedEmitter = null; - this._sharedDeclarationEmitter = null; - this.hadSyntacticDiagnostics = false; - this.hadSemanticDiagnostics = false; - this.hadEmitDiagnostics = false; - this.fileNames = compiler.fileNames(); - this.compilerPhase = startingPhase; - } - CompilerIterator.prototype.current = function () { - return this._current; - }; - - CompilerIterator.prototype.moveNext = function () { - this._current = null; - - while (this.moveNextInternal()) { - if (this._current) { - return true; - } - } - - return false; - }; - - CompilerIterator.prototype.moveNextInternal = function () { - this.index++; - - while (this.shouldMoveToNextPhase()) { - this.index = 0; - this.compilerPhase++; - } - - if (this.compilerPhase > 4 /* DeclarationEmit */) { - return false; - } - - switch (this.compilerPhase) { - case 0 /* Syntax */: - return this.moveNextSyntaxPhase(); - case 1 /* Semantics */: - return this.moveNextSemanticsPhase(); - case 2 /* EmitOptionsValidation */: - return this.moveNextEmitOptionsValidationPhase(); - case 3 /* Emit */: - return this.moveNextEmitPhase(); - case 4 /* DeclarationEmit */: - return this.moveNextDeclarationEmitPhase(); - } - }; - - CompilerIterator.prototype.shouldMoveToNextPhase = function () { - switch (this.compilerPhase) { - case 2 /* EmitOptionsValidation */: - return this.index === 1; - - case 0 /* Syntax */: - case 1 /* Semantics */: - return this.index === this.fileNames.length; - - case 3 /* Emit */: - case 4 /* DeclarationEmit */: - return this.index === (this.fileNames.length + 1); - } - - return false; - }; - - CompilerIterator.prototype.moveNextSyntaxPhase = function () { - TypeScript.Debug.assert(this.index >= 0 && this.index < this.fileNames.length); - var fileName = this.fileNames[this.index]; - - var diagnostics = this.compiler.getSyntacticDiagnostics(fileName); - if (diagnostics.length) { - if (!this.continueOnDiagnostics) { - this.hadSyntacticDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics(diagnostics); - } - - return true; - }; - - CompilerIterator.prototype.moveNextSemanticsPhase = function () { - if (this.hadSyntacticDiagnostics) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index < this.fileNames.length); - var fileName = this.fileNames[this.index]; - var diagnostics = this.compiler.getSemanticDiagnostics(fileName); - if (diagnostics.length) { - if (!this.continueOnDiagnostics) { - this.hadSemanticDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics(diagnostics); - } - - return true; - }; - - CompilerIterator.prototype.moveNextEmitOptionsValidationPhase = function () { - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - - if (!this._emitOptions) { - this._emitOptions = new TypeScript.EmitOptions(this.compiler, this.resolvePath); - } - - if (this._emitOptions.diagnostic()) { - if (!this.continueOnDiagnostics) { - this.hadEmitDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics([this._emitOptions.diagnostic()]); - } - - return true; - }; - - CompilerIterator.prototype.moveNextEmitPhase = function () { - var _this = this; - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - TypeScript.Debug.assert(this._emitOptions); - - if (this.hadEmitDiagnostics) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index <= this.fileNames.length); - if (this.index < this.fileNames.length) { - var fileName = this.fileNames[this.index]; - var document = this.compiler.getDocument(fileName); - - this._sharedEmitter = this.compiler._emitDocument(document, this._emitOptions, function (outputFiles) { - _this._current = CompileResult.fromOutputFiles(outputFiles); - }, this._sharedEmitter); - return true; - } - - if (this.index === this.fileNames.length && this._sharedEmitter) { - this._current = CompileResult.fromOutputFiles(this._sharedEmitter.getOutputFiles()); - } - - return true; - }; - - CompilerIterator.prototype.moveNextDeclarationEmitPhase = function () { - var _this = this; - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - TypeScript.Debug.assert(!this.hadEmitDiagnostics); - if (this.hadSemanticDiagnostics) { - return false; - } - - if (!this.compiler.compilationSettings().generateDeclarationFiles()) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index <= this.fileNames.length); - if (this.index < this.fileNames.length) { - var fileName = this.fileNames[this.index]; - var document = this.compiler.getDocument(fileName); - - this._sharedDeclarationEmitter = this.compiler._emitDocumentDeclarations(document, this._emitOptions, function (file) { - _this._current = CompileResult.fromOutputFiles([file]); - }, this._sharedDeclarationEmitter); - return true; - } - - if (this.index === this.fileNames.length && this._sharedDeclarationEmitter) { - this._current = CompileResult.fromOutputFiles([this._sharedDeclarationEmitter.getOutputFile()]); - } - - return true; - }; - return CompilerIterator; - })(); - - function compareDataObjects(dst, src) { - for (var e in dst) { - if (typeof dst[e] === "object") { - if (!compareDataObjects(dst[e], src[e])) - return false; - } else if (typeof dst[e] !== "function") { - if (dst[e] !== src[e]) - return false; - } - } - return true; - } - TypeScript.compareDataObjects = compareDataObjects; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (GenerativeTypeClassification) { - GenerativeTypeClassification[GenerativeTypeClassification["Unknown"] = 0] = "Unknown"; - GenerativeTypeClassification[GenerativeTypeClassification["Open"] = 1] = "Open"; - GenerativeTypeClassification[GenerativeTypeClassification["Closed"] = 2] = "Closed"; - GenerativeTypeClassification[GenerativeTypeClassification["InfinitelyExpanding"] = 3] = "InfinitelyExpanding"; - })(TypeScript.GenerativeTypeClassification || (TypeScript.GenerativeTypeClassification = {})); - var GenerativeTypeClassification = TypeScript.GenerativeTypeClassification; - - var PullTypeReferenceSymbol = (function (_super) { - __extends(PullTypeReferenceSymbol, _super); - function PullTypeReferenceSymbol(referencedTypeSymbol) { - _super.call(this, referencedTypeSymbol.name, referencedTypeSymbol.kind); - this.referencedTypeSymbol = referencedTypeSymbol; - this.isResolved = true; - - TypeScript.Debug.assert(referencedTypeSymbol !== null, "Type root symbol may not be null"); - - this.setRootSymbol(referencedTypeSymbol); - - this.typeReference = this; - } - PullTypeReferenceSymbol.createTypeReference = function (type) { - if (type.isTypeReference()) { - return type; - } - - var typeReference = type.typeReference; - - if (!typeReference) { - typeReference = new PullTypeReferenceSymbol(type); - type.typeReference = typeReference; - } - - return typeReference; - }; - - PullTypeReferenceSymbol.prototype.isTypeReference = function () { - return true; - }; - - PullTypeReferenceSymbol.prototype.setResolved = function () { - }; - - PullTypeReferenceSymbol.prototype.setUnresolved = function () { - }; - PullTypeReferenceSymbol.prototype.invalidate = function () { - }; - - PullTypeReferenceSymbol.prototype.ensureReferencedTypeIsResolved = function () { - this._getResolver().resolveDeclaredSymbol(this.referencedTypeSymbol); - }; - - PullTypeReferenceSymbol.prototype.getReferencedTypeSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol; - }; - - PullTypeReferenceSymbol.prototype._getResolver = function () { - return this.referencedTypeSymbol._getResolver(); - }; - - PullTypeReferenceSymbol.prototype.hasMembers = function () { - return this.referencedTypeSymbol.hasMembers(); - }; - - PullTypeReferenceSymbol.prototype.setAssociatedContainerType = function (type) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setAssociatedContainerType"); - }; - - PullTypeReferenceSymbol.prototype.getAssociatedContainerType = function () { - return this.referencedTypeSymbol.getAssociatedContainerType(); - }; - - PullTypeReferenceSymbol.prototype.getFunctionSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getFunctionSymbol(); - }; - PullTypeReferenceSymbol.prototype.setFunctionSymbol = function (symbol) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setFunctionSymbol"); - }; - - PullTypeReferenceSymbol.prototype.addContainedNonMember = function (nonMember) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addContainedNonMember"); - }; - PullTypeReferenceSymbol.prototype.findContainedNonMemberContainer = function (containerName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.findContainedNonMemberContainer(containerName, kind); - }; - - PullTypeReferenceSymbol.prototype.addMember = function (memberSymbol) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addMember"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedMemberType = function (enclosedType) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedMemberType"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedMemberContainer = function (enclosedContainer) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedMemberContainer"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMember = function (enclosedNonMember) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMember"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMemberType = function (enclosedNonMemberType) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMemberType"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMemberContainer = function (enclosedNonMemberContainer) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMemberContainer"); - }; - PullTypeReferenceSymbol.prototype.addTypeParameter = function (typeParameter) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addTypeParameter"); - }; - PullTypeReferenceSymbol.prototype.addConstructorTypeParameter = function (typeParameter) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addConstructorTypeParameter"); - }; - - PullTypeReferenceSymbol.prototype.findContainedNonMember = function (name) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findContainedNonMember(name); - }; - - PullTypeReferenceSymbol.prototype.findContainedNonMemberType = function (typeName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findContainedNonMemberType(typeName, kind); - }; - - PullTypeReferenceSymbol.prototype.getMembers = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getMembers(); - }; - - PullTypeReferenceSymbol.prototype.setHasDefaultConstructor = function (hasOne) { - if (typeof hasOne === "undefined") { hasOne = true; } - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ":setHasDefaultConstructor"); - }; - PullTypeReferenceSymbol.prototype.getHasDefaultConstructor = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getHasDefaultConstructor(); - }; - PullTypeReferenceSymbol.prototype.getConstructorMethod = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getConstructorMethod(); - }; - PullTypeReferenceSymbol.prototype.setConstructorMethod = function (constructorMethod) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setConstructorMethod"); - }; - PullTypeReferenceSymbol.prototype.getTypeParameters = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeParameters(); - }; - - PullTypeReferenceSymbol.prototype.isGeneric = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.isGeneric(); - }; - - PullTypeReferenceSymbol.prototype.addSpecialization = function (specializedVersionOfThisType, substitutingTypes) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.addSpecialization(specializedVersionOfThisType, substitutingTypes); - }; - PullTypeReferenceSymbol.prototype.getSpecialization = function (substitutingTypes) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getSpecialization(substitutingTypes); - }; - PullTypeReferenceSymbol.prototype.getKnownSpecializations = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getKnownSpecializations(); - }; - PullTypeReferenceSymbol.prototype.getTypeArguments = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeArguments(); - }; - PullTypeReferenceSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeArgumentsOrTypeParameters(); - }; - - PullTypeReferenceSymbol.prototype.appendCallSignature = function (callSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": appendCallSignature"); - }; - PullTypeReferenceSymbol.prototype.insertCallSignatureAtIndex = function (callSignature, index) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": insertCallSignatureAtIndex"); - }; - PullTypeReferenceSymbol.prototype.appendConstructSignature = function (callSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": appendConstructSignature"); - }; - PullTypeReferenceSymbol.prototype.insertConstructSignatureAtIndex = function (callSignature, index) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": insertConstructSignatureAtIndex"); - }; - PullTypeReferenceSymbol.prototype.addIndexSignature = function (indexSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addIndexSignature"); - }; - - PullTypeReferenceSymbol.prototype.hasOwnCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnCallSignatures(); - }; - PullTypeReferenceSymbol.prototype.getCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getCallSignatures(); - }; - PullTypeReferenceSymbol.prototype.hasOwnConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnConstructSignatures(); - }; - PullTypeReferenceSymbol.prototype.getConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getConstructSignatures(); - }; - PullTypeReferenceSymbol.prototype.hasOwnIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnIndexSignatures(); - }; - PullTypeReferenceSymbol.prototype.getIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getIndexSignatures(); - }; - - PullTypeReferenceSymbol.prototype.addImplementedType = function (implementedType) { - this.referencedTypeSymbol.addImplementedType(implementedType); - }; - PullTypeReferenceSymbol.prototype.getImplementedTypes = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getImplementedTypes(); - }; - PullTypeReferenceSymbol.prototype.addExtendedType = function (extendedType) { - this.referencedTypeSymbol.addExtendedType(extendedType); - }; - PullTypeReferenceSymbol.prototype.getExtendedTypes = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getExtendedTypes(); - }; - PullTypeReferenceSymbol.prototype.addTypeThatExtendsThisType = function (type) { - this.referencedTypeSymbol.addTypeThatExtendsThisType(type); - }; - PullTypeReferenceSymbol.prototype.getTypesThatExtendThisType = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypesThatExtendThisType(); - }; - PullTypeReferenceSymbol.prototype.addTypeThatExplicitlyImplementsThisType = function (type) { - this.referencedTypeSymbol.addTypeThatExplicitlyImplementsThisType(type); - }; - PullTypeReferenceSymbol.prototype.getTypesThatExplicitlyImplementThisType = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypesThatExplicitlyImplementThisType(); - }; - - PullTypeReferenceSymbol.prototype.isValidBaseKind = function (baseType, isExtendedType) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.isValidBaseKind(baseType, isExtendedType); - }; - - PullTypeReferenceSymbol.prototype.findMember = function (name, lookInParent) { - if (typeof lookInParent === "undefined") { lookInParent = true; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findMember(name, lookInParent); - }; - PullTypeReferenceSymbol.prototype.findNestedType = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findNestedType(name, kind); - }; - PullTypeReferenceSymbol.prototype.findNestedContainer = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findNestedContainer(name, kind); - }; - PullTypeReferenceSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - }; - - PullTypeReferenceSymbol.prototype.findTypeParameter = function (name) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findTypeParameter(name); - }; - - PullTypeReferenceSymbol.prototype.hasOnlyOverloadCallSignatures = function () { - return this.referencedTypeSymbol.hasOnlyOverloadCallSignatures(); - }; - return PullTypeReferenceSymbol; - })(TypeScript.PullTypeSymbol); - TypeScript.PullTypeReferenceSymbol = PullTypeReferenceSymbol; - - TypeScript.nSpecializationsCreated = 0; - TypeScript.nSpecializedSignaturesCreated = 0; - TypeScript.nSpecializedTypeParameterCreated = 0; - - var PullInstantiatedTypeReferenceSymbol = (function (_super) { - __extends(PullInstantiatedTypeReferenceSymbol, _super); - function PullInstantiatedTypeReferenceSymbol(referencedTypeSymbol, _typeParameterArgumentMap, isInstanceReferenceType) { - _super.call(this, referencedTypeSymbol); - this.referencedTypeSymbol = referencedTypeSymbol; - this._typeParameterArgumentMap = _typeParameterArgumentMap; - this.isInstanceReferenceType = isInstanceReferenceType; - this._instantiatedMembers = null; - this._allInstantiatedMemberNameCache = null; - this._instantiatedMemberNameCache = TypeScript.createIntrinsicsObject(); - this._instantiatedCallSignatures = null; - this._instantiatedConstructSignatures = null; - this._instantiatedIndexSignatures = null; - this._typeArgumentReferences = undefined; - this._instantiatedConstructorMethod = null; - this._instantiatedAssociatedContainerType = null; - this._isArray = undefined; - this._generativeTypeClassification = []; - - TypeScript.nSpecializationsCreated++; - } - PullInstantiatedTypeReferenceSymbol.prototype.getIsSpecialized = function () { - return !this.isInstanceReferenceType; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getGenerativeTypeClassification = function (enclosingType) { - if (!this.isNamedTypeSymbol()) { - return 0 /* Unknown */; - } - - var generativeTypeClassification = this._generativeTypeClassification[enclosingType.pullSymbolID] || 0 /* Unknown */; - if (generativeTypeClassification === 0 /* Unknown */) { - var typeParameters = enclosingType.getTypeParameters(); - var enclosingTypeParameterMap = []; - for (var i = 0; i < typeParameters.length; i++) { - enclosingTypeParameterMap[typeParameters[i].pullSymbolID] = typeParameters[i]; - } - - var typeArguments = this.getTypeArguments(); - for (var i = 0; i < typeArguments.length; i++) { - if (typeArguments[i].wrapsSomeTypeParameter(enclosingTypeParameterMap, true)) { - generativeTypeClassification = 1 /* Open */; - break; - } - } - - if (generativeTypeClassification === 1 /* Open */) { - if (this.wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType)) { - generativeTypeClassification = 3 /* InfinitelyExpanding */; - } - } else { - generativeTypeClassification = 2 /* Closed */; - } - - this._generativeTypeClassification[enclosingType.pullSymbolID] = generativeTypeClassification; - } - - return generativeTypeClassification; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.isArrayNamedTypeReference = function () { - if (this._isArray === undefined) { - this._isArray = this.getRootSymbol().isArrayNamedTypeReference() || (this.getRootSymbol() === this._getResolver().getArrayNamedType()); - } - return this._isArray; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getElementType = function () { - if (!this.isArrayNamedTypeReference()) { - return null; - } - - var typeArguments = this.getTypeArguments(); - return typeArguments ? typeArguments[0] : null; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getReferencedTypeSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.getIsSpecialized()) { - return this; - } - - return this.referencedTypeSymbol; - }; - - PullInstantiatedTypeReferenceSymbol.create = function (resolver, type, typeParameterArgumentMap) { - TypeScript.Debug.assert(resolver); - - var mutableTypeParameterMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(typeParameterArgumentMap); - - TypeScript.PullInstantiationHelpers.instantiateTypeArgument(resolver, type, mutableTypeParameterMap); - - var rootType = type.getRootSymbol(); - var instantiation = rootType.getSpecialization(mutableTypeParameterMap.typeParameterArgumentMap); - if (instantiation) { - return instantiation; - } - - TypeScript.PullInstantiationHelpers.cleanUpTypeArgumentMap(type, mutableTypeParameterMap); - typeParameterArgumentMap = mutableTypeParameterMap.typeParameterArgumentMap; - - var isInstanceReferenceType = (type.kind & 8216 /* SomeInstantiatableType */) != 0; - var resolvedTypeParameterArgumentMap = typeParameterArgumentMap; - if (isInstanceReferenceType) { - var typeParameters = rootType.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - if (!TypeScript.PullHelpers.typeSymbolsAreIdentical(typeParameters[i], typeParameterArgumentMap[typeParameters[i].pullSymbolID])) { - isInstanceReferenceType = false; - break; - } - } - - if (isInstanceReferenceType) { - typeParameterArgumentMap = []; - } - } - - instantiation = new PullInstantiatedTypeReferenceSymbol(rootType, typeParameterArgumentMap, isInstanceReferenceType); - - rootType.addSpecialization(instantiation, resolvedTypeParameterArgumentMap); - - return instantiation; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.isGeneric = function () { - return this.getRootSymbol().isGeneric(); - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeParameterArgumentMap = function () { - return this._typeParameterArgumentMap; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeArguments = function () { - if (this.isInstanceReferenceType) { - return this.getTypeParameters(); - } - - if (this._typeArgumentReferences === undefined) { - var typeParameters = this.referencedTypeSymbol.getTypeParameters(); - - if (typeParameters.length) { - var typeArgument = null; - var typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArgument = this._typeParameterArgumentMap[typeParameters[i].pullSymbolID]; - - if (!typeArgument) { - TypeScript.Debug.fail("type argument count mismatch"); - } - - if (typeArgument) { - typeArguments[typeArguments.length] = typeArgument; - } - } - - this._typeArgumentReferences = typeArguments; - } else { - this._typeArgumentReferences = null; - } - } - - return this._typeArgumentReferences; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - return this.getTypeArguments(); - }; - - PullInstantiatedTypeReferenceSymbol.prototype.populateInstantiatedMemberFromReferencedMember = function (referencedMember) { - var instantiatedMember; - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(referencedMember); - - if (!referencedMember.type.wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - instantiatedMember = referencedMember; - } else { - instantiatedMember = new TypeScript.PullSymbol(referencedMember.name, referencedMember.kind); - instantiatedMember.setRootSymbol(referencedMember); - instantiatedMember.type = this._getResolver().instantiateType(referencedMember.type, this._typeParameterArgumentMap); - instantiatedMember.isOptional = referencedMember.isOptional; - } - this._instantiatedMemberNameCache[instantiatedMember.name] = instantiatedMember; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getMembers = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getMembers(); - } - - if (!this._instantiatedMembers) { - var referencedMembers = this.referencedTypeSymbol.getMembers(); - var referencedMember = null; - var instantiatedMember = null; - - this._instantiatedMembers = []; - - for (var i = 0; i < referencedMembers.length; i++) { - referencedMember = referencedMembers[i]; - - this._getResolver().resolveDeclaredSymbol(referencedMember); - - if (!this._instantiatedMemberNameCache[referencedMember.name]) { - this.populateInstantiatedMemberFromReferencedMember(referencedMember); - } - - this._instantiatedMembers[this._instantiatedMembers.length] = this._instantiatedMemberNameCache[referencedMember.name]; - } - } - - return this._instantiatedMembers; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.findMember = function (name, lookInParent) { - if (typeof lookInParent === "undefined") { lookInParent = true; } - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.findMember(name, lookInParent); - } - - var memberSymbol = this._instantiatedMemberNameCache[name]; - - if (!memberSymbol) { - var referencedMemberSymbol = this.referencedTypeSymbol.findMember(name, lookInParent); - - if (referencedMemberSymbol) { - this.populateInstantiatedMemberFromReferencedMember(referencedMemberSymbol); - memberSymbol = this._instantiatedMemberNameCache[name]; - } else { - memberSymbol = null; - } - } - - return memberSymbol; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - } - - var requestedMembers = []; - var allReferencedMembers = this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - - if (!this._allInstantiatedMemberNameCache) { - this._allInstantiatedMemberNameCache = TypeScript.createIntrinsicsObject(); - - var members = this.getMembers(); - - for (var i = 0; i < members.length; i++) { - this._allInstantiatedMemberNameCache[members[i].name] = members[i]; - } - } - - var referencedMember = null; - var requestedMember = null; - - for (var i = 0; i < allReferencedMembers.length; i++) { - referencedMember = allReferencedMembers[i]; - - this._getResolver().resolveDeclaredSymbol(referencedMember); - - if (this._allInstantiatedMemberNameCache[referencedMember.name]) { - requestedMembers[requestedMembers.length] = this._allInstantiatedMemberNameCache[referencedMember.name]; - } else { - if (!referencedMember.type.wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._allInstantiatedMemberNameCache[referencedMember.name] = referencedMember; - requestedMembers[requestedMembers.length] = referencedMember; - } else { - requestedMember = new TypeScript.PullSymbol(referencedMember.name, referencedMember.kind); - requestedMember.setRootSymbol(referencedMember); - - requestedMember.type = this._getResolver().instantiateType(referencedMember.type, this._typeParameterArgumentMap); - requestedMember.isOptional = referencedMember.isOptional; - - this._allInstantiatedMemberNameCache[requestedMember.name] = requestedMember; - requestedMembers[requestedMembers.length] = requestedMember; - } - } - } - - return requestedMembers; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getConstructorMethod = function () { - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getConstructorMethod(); - } - - if (!this._instantiatedConstructorMethod) { - var referencedConstructorMethod = this.referencedTypeSymbol.getConstructorMethod(); - this._instantiatedConstructorMethod = new TypeScript.PullSymbol(referencedConstructorMethod.name, referencedConstructorMethod.kind); - this._instantiatedConstructorMethod.setRootSymbol(referencedConstructorMethod); - this._instantiatedConstructorMethod.setResolved(); - - this._instantiatedConstructorMethod.type = PullInstantiatedTypeReferenceSymbol.create(this._getResolver(), referencedConstructorMethod.type, this._typeParameterArgumentMap); - } - - return this._instantiatedConstructorMethod; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getAssociatedContainerType = function () { - if (!this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getAssociatedContainerType(); - } - - if (!this._instantiatedAssociatedContainerType) { - var referencedAssociatedContainerType = this.referencedTypeSymbol.getAssociatedContainerType(); - - if (referencedAssociatedContainerType) { - this._instantiatedAssociatedContainerType = PullInstantiatedTypeReferenceSymbol.create(this._getResolver(), referencedAssociatedContainerType, this._typeParameterArgumentMap); - } - } - - return this._instantiatedAssociatedContainerType; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getCallSignatures(); - } - - if (this._instantiatedCallSignatures) { - return this._instantiatedCallSignatures; - } - - var referencedCallSignatures = this.referencedTypeSymbol.getCallSignatures(); - this._instantiatedCallSignatures = []; - - for (var i = 0; i < referencedCallSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedCallSignatures[i]); - - if (!referencedCallSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length] = referencedCallSignatures[i]; - } else { - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length] = this._getResolver().instantiateSignature(referencedCallSignatures[i], this._typeParameterArgumentMap); - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedCallSignatures; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getConstructSignatures(); - } - - if (this._instantiatedConstructSignatures) { - return this._instantiatedConstructSignatures; - } - - var referencedConstructSignatures = this.referencedTypeSymbol.getConstructSignatures(); - this._instantiatedConstructSignatures = []; - - for (var i = 0; i < referencedConstructSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedConstructSignatures[i]); - - if (!referencedConstructSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length] = referencedConstructSignatures[i]; - } else { - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length] = this._getResolver().instantiateSignature(referencedConstructSignatures[i], this._typeParameterArgumentMap); - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedConstructSignatures; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getIndexSignatures(); - } - - if (this._instantiatedIndexSignatures) { - return this._instantiatedIndexSignatures; - } - - var referencedIndexSignatures = this.referencedTypeSymbol.getIndexSignatures(); - this._instantiatedIndexSignatures = []; - - for (var i = 0; i < referencedIndexSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedIndexSignatures[i]); - - if (!referencedIndexSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length] = referencedIndexSignatures[i]; - } else { - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length] = this._getResolver().instantiateSignature(referencedIndexSignatures[i], this._typeParameterArgumentMap); - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedIndexSignatures; - }; - return PullInstantiatedTypeReferenceSymbol; - })(PullTypeReferenceSymbol); - TypeScript.PullInstantiatedTypeReferenceSymbol = PullInstantiatedTypeReferenceSymbol; - - var PullInstantiatedSignatureSymbol = (function (_super) { - __extends(PullInstantiatedSignatureSymbol, _super); - function PullInstantiatedSignatureSymbol(rootSignature, _typeParameterArgumentMap) { - _super.call(this, rootSignature.kind, rootSignature.isDefinition()); - this._typeParameterArgumentMap = _typeParameterArgumentMap; - this.setRootSymbol(rootSignature); - TypeScript.nSpecializedSignaturesCreated++; - - rootSignature.addSpecialization(this, _typeParameterArgumentMap); - } - PullInstantiatedSignatureSymbol.prototype.getTypeParameterArgumentMap = function () { - return this._typeParameterArgumentMap; - }; - - PullInstantiatedSignatureSymbol.prototype.getIsSpecialized = function () { - return true; - }; - - PullInstantiatedSignatureSymbol.prototype._getResolver = function () { - return this.getRootSymbol()._getResolver(); - }; - - PullInstantiatedSignatureSymbol.prototype.getTypeParameters = function () { - var _this = this; - if (!this._typeParameters) { - var rootSymbol = this.getRootSymbol(); - var typeParameters = rootSymbol.getTypeParameters(); - var hasInstantiatedTypeParametersOfThisSignature = TypeScript.ArrayUtilities.all(typeParameters, function (typeParameter) { - return _this._typeParameterArgumentMap[typeParameter.pullSymbolID] !== undefined; - }); - - if (!hasInstantiatedTypeParametersOfThisSignature && typeParameters.length) { - this._typeParameters = []; - for (var i = 0; i < typeParameters.length; i++) { - this._typeParameters[this._typeParameters.length] = this._getResolver().instantiateTypeParameter(typeParameters[i], this._typeParameterArgumentMap); - } - } else { - this._typeParameters = TypeScript.sentinelEmptyArray; - } - } - - return this._typeParameters; - }; - - PullInstantiatedSignatureSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - var rootSymbol = this.getRootSymbol(); - return rootSymbol.getAllowedToReferenceTypeParameters(); - }; - return PullInstantiatedSignatureSymbol; - })(TypeScript.PullSignatureSymbol); - TypeScript.PullInstantiatedSignatureSymbol = PullInstantiatedSignatureSymbol; - - var PullInstantiatedTypeParameterSymbol = (function (_super) { - __extends(PullInstantiatedTypeParameterSymbol, _super); - function PullInstantiatedTypeParameterSymbol(rootTypeParameter, constraintType) { - _super.call(this, rootTypeParameter.name); - TypeScript.nSpecializedTypeParameterCreated++; - - this.setRootSymbol(rootTypeParameter); - this.setConstraint(constraintType); - - rootTypeParameter.addSpecialization(this, [constraintType]); - } - PullInstantiatedTypeParameterSymbol.prototype._getResolver = function () { - return this.getRootSymbol()._getResolver(); - }; - return PullInstantiatedTypeParameterSymbol; - })(TypeScript.PullTypeParameterSymbol); - TypeScript.PullInstantiatedTypeParameterSymbol = PullInstantiatedTypeParameterSymbol; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTreeToAstVisitor = (function () { - function SyntaxTreeToAstVisitor(fileName, lineMap, compilationSettings) { - this.fileName = fileName; - this.lineMap = lineMap; - this.compilationSettings = compilationSettings; - this.position = 0; - this.previousTokenTrailingComments = null; - } - SyntaxTreeToAstVisitor.visit = function (syntaxTree, fileName, compilationSettings, incrementalAST) { - var visitor = incrementalAST ? new SyntaxTreeToIncrementalAstVisitor(fileName, syntaxTree.lineMap(), compilationSettings) : new SyntaxTreeToAstVisitor(fileName, syntaxTree.lineMap(), compilationSettings); - return syntaxTree.sourceUnit().accept(visitor); - }; - - SyntaxTreeToAstVisitor.prototype.movePast = function (element) { - if (element !== null) { - this.position += element.fullWidth(); - } - }; - - SyntaxTreeToAstVisitor.prototype.moveTo = function (element1, element2) { - if (element2 !== null) { - this.position += TypeScript.Syntax.childOffset(element1, element2); - } - }; - - SyntaxTreeToAstVisitor.prototype.setCommentsAndSpan = function (ast, fullStart, node) { - var firstToken = node.firstToken(); - var lastToken = node.lastToken(); - - this.setSpan(ast, fullStart, node, firstToken, lastToken); - ast.setPreComments(this.convertTokenLeadingComments(firstToken, fullStart)); - ast.setPostComments(this.convertNodeTrailingComments(node, lastToken, fullStart)); - }; - - SyntaxTreeToAstVisitor.prototype.createTokenSpan = function (fullStart, element) { - if (element === null) { - return null; - } - - if (element.fullWidth() === 0) { - return new TypeScript.ASTSpan(-1, -1); - } - - var leadingTriviaWidth = element.leadingTriviaWidth(); - var trailingTriviaWidth = element.trailingTriviaWidth(); - - var start = fullStart + leadingTriviaWidth; - var end = fullStart + element.fullWidth() - trailingTriviaWidth; - - return new TypeScript.ASTSpan(start, end); - }; - - SyntaxTreeToAstVisitor.prototype.setSpan = function (span, fullStart, element, firstToken, lastToken) { - if (typeof firstToken === "undefined") { firstToken = element.firstToken(); } - if (typeof lastToken === "undefined") { lastToken = element.lastToken(); } - var leadingTriviaWidth = firstToken ? firstToken.leadingTriviaWidth() : 0; - var trailingTriviaWidth = lastToken ? lastToken.trailingTriviaWidth() : 0; - - var desiredMinChar = fullStart + leadingTriviaWidth; - var desiredLimChar = fullStart + element.fullWidth() - trailingTriviaWidth; - - this.setSpanExplicit(span, desiredMinChar, desiredLimChar); - - span._trailingTriviaWidth = trailingTriviaWidth; - }; - - SyntaxTreeToAstVisitor.prototype.setSpanExplicit = function (span, start, end) { - span._start = start; - span._end = end; - }; - - SyntaxTreeToAstVisitor.prototype.visitSyntaxList = function (node) { - var start = this.position; - var array = new Array(node.childCount()); - - for (var i = 0, n = node.childCount(); i < n; i++) { - array[i] = node.childAt(i).accept(this); - } - - var result = new TypeScript.ISyntaxList2(this.fileName, array); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSeparatedSyntaxList = function (list) { - var start = this.position; - var array = new Array(list.nonSeparatorCount()); - - for (var i = 0, n = list.childCount(); i < n; i++) { - if (i % 2 === 0) { - array[i / 2] = list.childAt(i).accept(this); - this.previousTokenTrailingComments = null; - } else { - var separatorToken = list.childAt(i); - this.previousTokenTrailingComments = this.convertTokenTrailingComments(separatorToken, this.position + separatorToken.leadingTriviaWidth() + separatorToken.width()); - this.movePast(separatorToken); - } - } - - var result = new TypeScript.ISeparatedSyntaxList2(this.fileName, array, list.separatorCount()); - this.setSpan(result, start, list); - - result.setPostComments(this.previousTokenTrailingComments); - this.previousTokenTrailingComments = null; - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.convertComment = function (trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - - return comment; - }; - - SyntaxTreeToAstVisitor.prototype.convertComments = function (triviaList, commentStartPosition) { - var result = []; - - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result.push(this.convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - - commentStartPosition += trivia.fullWidth(); - } - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.mergeComments = function (comments1, comments2) { - if (comments1 === null) { - return comments2; - } - - if (comments2 === null) { - return comments1; - } - - return comments1.concat(comments2); - }; - - SyntaxTreeToAstVisitor.prototype.convertTokenLeadingComments = function (token, commentStartPosition) { - if (token === null) { - return null; - } - - var preComments = token.hasLeadingComment() ? this.convertComments(token.leadingTrivia(), commentStartPosition) : null; - - var previousTokenTrailingComments = this.previousTokenTrailingComments; - this.previousTokenTrailingComments = null; - - return this.mergeComments(previousTokenTrailingComments, preComments); - }; - - SyntaxTreeToAstVisitor.prototype.convertTokenTrailingComments = function (token, commentStartPosition) { - if (token === null || !token.hasTrailingComment() || token.hasTrailingNewLine()) { - return null; - } - - return this.convertComments(token.trailingTrivia(), commentStartPosition); - }; - - SyntaxTreeToAstVisitor.prototype.convertNodeTrailingComments = function (node, lastToken, nodeStart) { - if (lastToken === null || !lastToken.hasTrailingComment() || lastToken.hasTrailingNewLine()) { - return null; - } - - return this.convertComments(lastToken.trailingTrivia(), nodeStart + node.fullWidth() - lastToken.trailingTriviaWidth()); - }; - - SyntaxTreeToAstVisitor.prototype.visitIdentifier = function (token) { - return this.visitToken(token); - }; - - SyntaxTreeToAstVisitor.prototype.visitToken = function (token) { - var fullStart = this.position; - - var result = this.visitTokenWorker(token); - - this.movePast(token); - - var start = fullStart + token.leadingTriviaWidth(); - this.setSpanExplicit(result, start, start + token.width()); - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTokenWorker = function (token) { - switch (token.tokenKind) { - case 60 /* AnyKeyword */: - return new TypeScript.BuiltInType(60 /* AnyKeyword */, token.text(), token.valueText()); - case 61 /* BooleanKeyword */: - return new TypeScript.BuiltInType(61 /* BooleanKeyword */, token.text(), token.valueText()); - case 67 /* NumberKeyword */: - return new TypeScript.BuiltInType(67 /* NumberKeyword */, token.text(), token.valueText()); - case 69 /* StringKeyword */: - return new TypeScript.BuiltInType(69 /* StringKeyword */, token.text(), token.valueText()); - case 41 /* VoidKeyword */: - return new TypeScript.BuiltInType(41 /* VoidKeyword */, token.text(), token.valueText()); - case 35 /* ThisKeyword */: - return new TypeScript.ThisExpression(token.text(), token.valueText()); - case 50 /* SuperKeyword */: - return new TypeScript.SuperExpression(token.text(), token.valueText()); - case 37 /* TrueKeyword */: - return new TypeScript.LiteralExpression(37 /* TrueKeyword */, token.text(), token.valueText()); - case 24 /* FalseKeyword */: - return new TypeScript.LiteralExpression(24 /* FalseKeyword */, token.text(), token.valueText()); - case 32 /* NullKeyword */: - return new TypeScript.LiteralExpression(32 /* NullKeyword */, token.text(), token.valueText()); - case 14 /* StringLiteral */: - return new TypeScript.StringLiteral(token.text(), token.valueText()); - case 12 /* RegularExpressionLiteral */: - return new TypeScript.RegularExpressionLiteral(token.text(), token.valueText()); - case 13 /* NumericLiteral */: - var fullStart = this.position; - var preComments = this.convertTokenLeadingComments(token, fullStart); - - var result = new TypeScript.NumericLiteral(token.value(), token.text(), token.valueText()); - - result.setPreComments(preComments); - return result; - case 11 /* IdentifierName */: - return new TypeScript.Identifier(token.text()); - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SyntaxTreeToAstVisitor.prototype.visitSourceUnit = function (node) { - var start = this.position; - TypeScript.Debug.assert(start === 0); - - var bod = this.visitSyntaxList(node.moduleElements); - var comments = this.convertTokenLeadingComments(node.endOfFileToken, TypeScript.Syntax.childOffset(node, node.endOfFileToken)); - var result = new TypeScript.SourceUnit(bod, comments, this.fileName); - this.setSpanExplicit(result, start, start + node.fullWidth()); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExternalModuleReference = function (node) { - var start = this.position; - - this.moveTo(node, node.stringLiteral); - var stringLiteral = node.stringLiteral.accept(this); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ExternalModuleReference(stringLiteral); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModuleNameModuleReference = function (node) { - var start = this.position; - var moduleName = node.moduleName.accept(this); - - var result = new TypeScript.ModuleNameModuleReference(moduleName); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitClassDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var heritageClauses = node.heritageClauses ? this.visitSyntaxList(node.heritageClauses) : null; - - this.movePast(node.openBraceToken); - var members = this.visitSyntaxList(node.classElements); - - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.ClassDeclaration(modifiers, name, typeParameters, heritageClauses, members, closeBraceToken); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModifiers = function (modifiers) { - var result = null; - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 47 /* ExportKeyword */)) { - result = result || []; - result.push(1 /* Exported */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - result = result || []; - result.push(8 /* Ambient */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 58 /* StaticKeyword */)) { - result = result || []; - result.push(16 /* Static */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 57 /* PublicKeyword */)) { - result = result || []; - result.push(4 /* Public */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 55 /* PrivateKeyword */)) { - result = result || []; - result.push(2 /* Private */); - } - - return result || TypeScript.sentinelEmptyArray; - }; - - SyntaxTreeToAstVisitor.prototype.visitInterfaceDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var heritageClauses = node.heritageClauses ? this.visitSyntaxList(node.heritageClauses) : null; - - var body = this.visitObjectType(node.body); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.InterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, body); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitHeritageClause = function (node) { - var start = this.position; - - this.movePast(node.extendsOrImplementsKeyword); - var typeNames = this.visitSeparatedSyntaxList(node.typeNames); - - var result = new TypeScript.HeritageClause(node.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ ? 230 /* ExtendsHeritageClause */ : 231 /* ImplementsHeritageClause */, typeNames); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModuleDeclaration = function (node) { - var start = this.position; - - var modifiers = this.visitModifiers(node.modifiers); - - this.moveTo(node, node.moduleKeyword); - this.movePast(node.moduleKeyword); - - var moduleName = node.name ? node.name.accept(this) : null; - var stringLiteral = node.stringLiteral ? node.stringLiteral.accept(this) : null; - - this.movePast(node.openBraceToken); - - var moduleElements = this.visitSyntaxList(node.moduleElements); - - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ModuleDeclaration(modifiers, moduleName, stringLiteral, moduleElements, closeBraceToken); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? this.visitBlock(node.block) : null; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.FunctionDeclaration(this.visitModifiers(node.modifiers), name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEnumDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var identifier = this.visitIdentifier(node.identifier); - - this.movePast(node.openBraceToken); - - var enumElements = this.visitSeparatedSyntaxList(node.enumElements); - - this.movePast(node.closeBraceToken); - - var result = new TypeScript.EnumDeclaration(this.visitModifiers(node.modifiers), identifier, enumElements); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEnumElement = function (node) { - var start = this.position; - - var memberName = this.visitToken(node.propertyName); - - var value = node.equalsValueClause !== null ? this.visitEqualsValueClause(node.equalsValueClause) : null; - - var result = new TypeScript.EnumElement(memberName, value); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitImportDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - this.movePast(node.equalsToken); - var alias = node.moduleReference.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.ImportDeclaration(modifiers, name, alias); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExportAssignment = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ExportAssignment(name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclaration); - - var declaration = node.variableDeclaration.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - - var result = new TypeScript.VariableStatement(modifiers, declaration); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclarators); - var variableDecls = this.visitSeparatedSyntaxList(node.variableDeclarators); - - var result = new TypeScript.VariableDeclaration(variableDecls); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableDeclarator = function (node) { - var start = this.position; - var propertyName = this.visitToken(node.propertyName); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - var init = node.equalsValueClause ? this.visitEqualsValueClause(node.equalsValueClause) : null; - - var result = new TypeScript.VariableDeclarator(propertyName, typeExpr, init); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEqualsValueClause = function (node) { - var start = this.position; - var afterEqualsComments = this.convertTokenTrailingComments(node.equalsToken, this.position + node.equalsToken.leadingTriviaWidth() + node.equalsToken.width()); - - this.movePast(node.equalsToken); - var value = node.value.accept(this); - value.setPreComments(this.mergeComments(afterEqualsComments, value.preComments())); - - var result = new TypeScript.EqualsValueClause(value); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPrefixUnaryExpression = function (node) { - var start = this.position; - - this.movePast(node.operatorToken); - var operand = node.operand.accept(this); - - var result = new TypeScript.PrefixUnaryExpression(node.kind(), operand); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArrayLiteralExpression = function (node) { - var start = this.position; - var openStart = this.position + node.openBracketToken.leadingTriviaWidth(); - this.movePast(node.openBracketToken); - - var expressions = this.visitSeparatedSyntaxList(node.expressions); - - var closeStart = this.position + node.closeBracketToken.leadingTriviaWidth(); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ArrayLiteralExpression(expressions); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitOmittedExpression = function (node) { - var start = this.position; - - var result = new TypeScript.OmittedExpression(); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParenthesizedExpression = function (node) { - var start = this.position; - - var openParenToken = node.openParenToken; - var openParenTrailingComments = this.convertTokenTrailingComments(openParenToken, start + openParenToken.leadingTriviaWidth() + openParenToken.width()); - - this.movePast(openParenToken); - - var expr = node.expression.accept(this); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ParenthesizedExpression(openParenTrailingComments, expr); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - var start = this.position; - - var identifier = node.identifier.accept(this); - this.movePast(node.equalsGreaterThanToken); - - var block = node.block ? this.visitBlock(node.block) : null; - var expression = node.expression ? node.expression.accept(this) : null; - - var result = new TypeScript.SimpleArrowFunctionExpression(identifier, block, expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - var start = this.position; - - var callSignature = this.visitCallSignature(node.callSignature); - this.movePast(node.equalsGreaterThanToken); - - var block = node.block ? this.visitBlock(node.block) : null; - var expression = node.expression ? node.expression.accept(this) : null; - - var result = new TypeScript.ParenthesizedArrowFunctionExpression(callSignature, block, expression); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitType = function (type) { - return type ? type.accept(this) : null; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeQuery = function (node) { - var start = this.position; - this.movePast(node.typeOfKeyword); - var name = node.name.accept(this); - - var result = new TypeScript.TypeQuery(name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitQualifiedName = function (node) { - var start = this.position; - var left = this.visitType(node.left); - this.movePast(node.dotToken); - var right = this.visitIdentifier(node.right); - - var result = new TypeScript.QualifiedName(left, right); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeArgumentList = function (node) { - if (node === null) { - return null; - } - - var start = this.position; - this.movePast(node.lessThanToken); - var typeArguments = this.visitSeparatedSyntaxList(node.typeArguments); - this.movePast(node.greaterThanToken); - - var result = new TypeScript.TypeArgumentList(typeArguments); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructorType = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - this.movePast(node.equalsGreaterThanToken); - var returnType = this.visitType(node.type); - - var result = new TypeScript.ConstructorType(typeParameters, parameters, returnType); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionType = function (node) { - var start = this.position; - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - this.movePast(node.equalsGreaterThanToken); - var returnType = this.visitType(node.type); - - var result = new TypeScript.FunctionType(typeParameters, parameters, returnType); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectType = function (node) { - var start = this.position; - - this.movePast(node.openBraceToken); - var typeMembers = this.visitSeparatedSyntaxList(node.typeMembers); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ObjectType(typeMembers); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArrayType = function (node) { - var start = this.position; - - var underlying = this.visitType(node.type); - this.movePast(node.openBracketToken); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ArrayType(underlying); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitGenericType = function (node) { - var start = this.position; - - var underlying = this.visitType(node.name); - var typeArguments = this.visitTypeArgumentList(node.typeArgumentList); - - var result = new TypeScript.GenericType(underlying, typeArguments); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeAnnotation = function (node) { - if (!node) { - return null; - } - - var start = this.position; - this.movePast(node.colonToken); - var type = this.visitType(node.type); - - var result = new TypeScript.TypeAnnotation(type); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBlock = function (node) { - if (!node) { - return null; - } - - var start = this.position; - - this.movePast(node.openBraceToken); - var statements = this.visitSyntaxList(node.statements); - var closeBracePosition = this.position; - - var closeBraceLeadingComments = this.convertTokenLeadingComments(node.closeBraceToken, this.position); - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.Block(statements, closeBraceLeadingComments, closeBraceToken); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParameter = function (node) { - var start = this.position; - - var dotDotDotToken = this.createTokenSpan(this.position, node.dotDotDotToken); - - this.moveTo(node, node.identifier); - var identifier = this.visitIdentifier(node.identifier); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - var init = node.equalsValueClause ? node.equalsValueClause.accept(this) : null; - - var modifiers = this.visitModifiers(node.modifiers); - - var result = new TypeScript.Parameter(dotDotDotToken, modifiers, identifier, questionToken, typeExpr, init); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberAccessExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - this.movePast(node.dotToken); - var name = this.visitIdentifier(node.name); - - var result = new TypeScript.MemberAccessExpression(expression, name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPostfixUnaryExpression = function (node) { - var start = this.position; - - var operand = node.operand.accept(this); - this.movePast(node.operatorToken); - - var result = new TypeScript.PostfixUnaryExpression(node.kind() === 210 /* PostIncrementExpression */ ? 210 /* PostIncrementExpression */ : 211 /* PostDecrementExpression */, operand); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitElementAccessExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - this.movePast(node.openBracketToken); - var argumentExpression = node.argumentExpression.accept(this); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ElementAccessExpression(expression, argumentExpression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitInvocationExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - var argumentList = this.visitArgumentList(node.argumentList); - - var result = new TypeScript.InvocationExpression(expression, argumentList); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArgumentList = function (node) { - if (node === null) { - return null; - } - - var start = this.position; - - var typeArguments = this.visitTypeArgumentList(node.typeArgumentList); - - this.movePast(node.openParenToken); - - var _arguments = this.visitSeparatedSyntaxList(node.arguments); - - if (node.arguments.fullWidth() === 0 && node.closeParenToken.fullWidth() === 0) { - var openParenTokenEnd = start + node.openParenToken.leadingTriviaWidth() + node.openParenToken.width(); - this.setSpanExplicit(_arguments, openParenTokenEnd, openParenTokenEnd + node.openParenToken.trailingTriviaWidth()); - } - - var closeParenToken = this.createTokenSpan(this.position, node.closeParenToken); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ArgumentList(typeArguments, _arguments, closeParenToken); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBinaryExpression = function (node) { - var start = this.position; - - var left = node.left.accept(this); - this.movePast(node.operatorToken); - var right = node.right.accept(this); - - var result = new TypeScript.BinaryExpression(node.kind(), left, right); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConditionalExpression = function (node) { - var start = this.position; - - var condition = node.condition.accept(this); - this.movePast(node.questionToken); - var whenTrue = node.whenTrue.accept(this); - this.movePast(node.colonToken); - var whenFalse = node.whenFalse.accept(this); - - var result = new TypeScript.ConditionalExpression(condition, whenTrue, whenFalse); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructSignature = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var callSignature = this.visitCallSignature(node.callSignature); - - var result = new TypeScript.ConstructSignature(callSignature); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMethodSignature = function (node) { - var start = this.position; - - var name = this.visitToken(node.propertyName); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - - var callSignature = this.visitCallSignature(node.callSignature); - - var result = new TypeScript.MethodSignature(name, questionToken, callSignature); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIndexSignature = function (node) { - var start = this.position; - - this.movePast(node.openBracketToken); - - var parameter = node.parameter.accept(this); - - this.movePast(node.closeBracketToken); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.IndexSignature(parameter, returnType); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPropertySignature = function (node) { - var start = this.position; - - var name = this.visitToken(node.propertyName); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.PropertySignature(name, questionToken, typeExpr); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParameterList = function (node) { - if (!node) { - return null; - } - - var start = this.position; - - var openParenToken = node.openParenToken; - - this.previousTokenTrailingComments = this.convertTokenTrailingComments(openParenToken, start + openParenToken.leadingTriviaWidth() + openParenToken.width()); - var openParenTrailingComments = null; - if (node.parameters.childCount() === 0) { - openParenTrailingComments = this.previousTokenTrailingComments; - this.previousTokenTrailingComments = null; - } - - this.movePast(node.openParenToken); - var parameters = this.visitSeparatedSyntaxList(node.parameters); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ParameterList(openParenTrailingComments, parameters); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCallSignature = function (node) { - var start = this.position; - - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.CallSignature(typeParameters, parameters, returnType); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeParameterList = function (node) { - if (!node) { - return null; - } - - var start = this.position; - this.movePast(node.lessThanToken); - var typeParameters = this.visitSeparatedSyntaxList(node.typeParameters); - this.movePast(node.greaterThanToken); - - var result = new TypeScript.TypeParameterList(typeParameters); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeParameter = function (node) { - var start = this.position; - - var identifier = this.visitIdentifier(node.identifier); - var constraint = node.constraint ? node.constraint.accept(this) : null; - - var result = new TypeScript.TypeParameter(identifier, constraint); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstraint = function (node) { - var start = this.position; - this.movePast(node.extendsKeyword); - var type = this.visitType(node.type); - - var result = new TypeScript.Constraint(type); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIfStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var thenBod = node.statement.accept(this); - var elseBod = node.elseClause ? node.elseClause.accept(this) : null; - - var result = new TypeScript.IfStatement(condition, thenBod, elseBod); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitElseClause = function (node) { - var start = this.position; - - this.movePast(node.elseKeyword); - var statement = node.statement.accept(this); - - var result = new TypeScript.ElseClause(statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExpressionStatement = function (node) { - var start = this.position; - - var preComments = this.convertTokenLeadingComments(node.firstToken(), start); - var expression = node.expression.accept(this); - - var semicolonPosition = this.position; - - var postComments = this.convertComments(node.semicolonToken.trailingTrivia(), this.position + node.semicolonToken.leadingTriviaWidth() + node.semicolonToken.width()); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ExpressionStatement(expression); - this.setSpan(result, start, node); - - result.setPreComments(preComments); - result.setPostComments(postComments); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructorDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.callSignature); - var callSignature = this.visitCallSignature(node.callSignature); - - var block = node.block ? node.block.accept(this) : null; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.ConstructorDeclaration(callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIndexMemberDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.indexSignature); - var indexSignature = node.indexSignature.accept(this); - - this.movePast(node.semicolonToken); - - var result = new TypeScript.IndexMemberDeclaration(indexSignature); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? this.visitBlock(node.block) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.MemberFunctionDeclaration(this.visitModifiers(node.modifiers), name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitGetAccessor = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - var parameters = this.visitParameterList(node.parameterList); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var block = node.block ? node.block.accept(this) : null; - var result = new TypeScript.GetAccessor(this.visitModifiers(node.modifiers), name, parameters, returnType, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSetAccessor = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - var parameters = this.visitParameterList(node.parameterList); - var block = node.block ? node.block.accept(this) : null; - var result = new TypeScript.SetAccessor(this.visitModifiers(node.modifiers), name, parameters, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberVariableDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclarator); - var variableDeclarator = node.variableDeclarator.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.MemberVariableDeclaration(modifiers, variableDeclarator); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitThrowStatement = function (node) { - var start = this.position; - - this.movePast(node.throwKeyword); - var expression = node.expression.accept(this); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ThrowStatement(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitReturnStatement = function (node) { - var start = this.position; - - this.movePast(node.returnKeyword); - var expression = node.expression ? node.expression.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.ReturnStatement(expression); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectCreationExpression = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var expression = node.expression.accept(this); - var argumentList = this.visitArgumentList(node.argumentList); - - var result = new TypeScript.ObjectCreationExpression(expression, argumentList); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSwitchStatement = function (node) { - var start = this.position; - - this.movePast(node.switchKeyword); - this.movePast(node.openParenToken); - var expression = node.expression.accept(this); - - var closeParenToken = this.createTokenSpan(this.position, node.closeParenToken); - this.movePast(node.closeParenToken); - this.movePast(node.openBraceToken); - var switchClauses = this.visitSyntaxList(node.switchClauses); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.SwitchStatement(expression, closeParenToken, switchClauses); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCaseSwitchClause = function (node) { - var start = this.position; - - this.movePast(node.caseKeyword); - var expression = node.expression.accept(this); - this.movePast(node.colonToken); - var statements = this.visitSyntaxList(node.statements); - - var result = new TypeScript.CaseSwitchClause(expression, statements); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDefaultSwitchClause = function (node) { - var start = this.position; - - this.movePast(node.defaultKeyword); - this.movePast(node.colonToken); - var statements = this.visitSyntaxList(node.statements); - - var result = new TypeScript.DefaultSwitchClause(statements); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBreakStatement = function (node) { - var start = this.position; - - this.movePast(node.breakKeyword); - var identifier = node.identifier ? node.identifier.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.BreakStatement(identifier); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitContinueStatement = function (node) { - var start = this.position; - - this.movePast(node.continueKeyword); - var identifier = node.identifier ? node.identifier.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.ContinueStatement(identifier); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitForStatement = function (node) { - var start = this.position; - - this.movePast(node.forKeyword); - this.movePast(node.openParenToken); - var variableDeclaration = node.variableDeclaration ? node.variableDeclaration.accept(this) : null; - var initializer = node.initializer ? node.initializer.accept(this) : null; - - this.movePast(node.firstSemicolonToken); - var cond = node.condition ? node.condition.accept(this) : null; - this.movePast(node.secondSemicolonToken); - var incr = node.incrementor ? node.incrementor.accept(this) : null; - this.movePast(node.closeParenToken); - var body = node.statement.accept(this); - - var result = new TypeScript.ForStatement(variableDeclaration, initializer, cond, incr, body); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitForInStatement = function (node) { - var start = this.position; - - this.movePast(node.forKeyword); - this.movePast(node.openParenToken); - var variableDeclaration = node.variableDeclaration ? node.variableDeclaration.accept(this) : null; - var left = node.left ? node.left.accept(this) : null; - - this.movePast(node.inKeyword); - var expression = node.expression.accept(this); - this.movePast(node.closeParenToken); - var body = node.statement.accept(this); - - var result = new TypeScript.ForInStatement(variableDeclaration, left, expression, body); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitWhileStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.WhileStatement(condition, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitWithStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.WithStatement(condition, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCastExpression = function (node) { - var start = this.position; - - this.movePast(node.lessThanToken); - var castTerm = this.visitType(node.type); - this.movePast(node.greaterThanToken); - var expression = node.expression.accept(this); - - var result = new TypeScript.CastExpression(castTerm, expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectLiteralExpression = function (node) { - var start = this.position; - - var openStart = this.position + node.openBraceToken.leadingTriviaWidth(); - this.movePast(node.openBraceToken); - - var propertyAssignments = this.visitSeparatedSyntaxList(node.propertyAssignments); - - var closeStart = this.position + node.closeBraceToken.leadingTriviaWidth(); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ObjectLiteralExpression(propertyAssignments); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSimplePropertyAssignment = function (node) { - var start = this.position; - - var preComments = this.convertTokenLeadingComments(node.firstToken(), start); - var postComments = this.convertNodeTrailingComments(node, node.lastToken(), start); - - var propertyName = node.propertyName.accept(this); - - var afterColonComments = this.convertTokenTrailingComments(node.colonToken, this.position + node.colonToken.leadingTriviaWidth() + node.colonToken.width()); - - this.movePast(node.colonToken); - var expression = node.expression.accept(this); - expression.setPreComments(this.mergeComments(afterColonComments, expression.preComments())); - - var result = new TypeScript.SimplePropertyAssignment(propertyName, expression); - this.setSpan(result, start, node); - - result.setPreComments(preComments); - result.setPostComments(postComments); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - var start = this.position; - - var propertyName = node.propertyName.accept(this); - var callSignature = this.visitCallSignature(node.callSignature); - var block = this.visitBlock(node.block); - - var result = new TypeScript.FunctionPropertyAssignment(propertyName, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionExpression = function (node) { - var start = this.position; - - this.movePast(node.functionKeyword); - var name = node.identifier === null ? null : this.visitIdentifier(node.identifier); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? node.block.accept(this) : null; - - var result = new TypeScript.FunctionExpression(name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEmptyStatement = function (node) { - var start = this.position; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.EmptyStatement(); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTryStatement = function (node) { - var start = this.position; - - this.movePast(node.tryKeyword); - var tryBody = node.block.accept(this); - - var catchClause = null; - if (node.catchClause !== null) { - catchClause = node.catchClause.accept(this); - } - - var finallyBody = null; - if (node.finallyClause !== null) { - finallyBody = node.finallyClause.accept(this); - } - - var result = new TypeScript.TryStatement(tryBody, catchClause, finallyBody); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCatchClause = function (node) { - var start = this.position; - - this.movePast(node.catchKeyword); - this.movePast(node.openParenToken); - var identifier = this.visitIdentifier(node.identifier); - var typeAnnotation = this.visitTypeAnnotation(node.typeAnnotation); - this.movePast(node.closeParenToken); - var block = node.block.accept(this); - - var result = new TypeScript.CatchClause(identifier, typeAnnotation, block); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFinallyClause = function (node) { - var start = this.position; - this.movePast(node.finallyKeyword); - var block = node.block.accept(this); - - var result = new TypeScript.FinallyClause(block); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitLabeledStatement = function (node) { - var start = this.position; - - var identifier = this.visitIdentifier(node.identifier); - this.movePast(node.colonToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.LabeledStatement(identifier, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDoStatement = function (node) { - var start = this.position; - - this.movePast(node.doKeyword); - var statement = node.statement.accept(this); - var whileKeyword = this.createTokenSpan(this.position, node.whileKeyword); - - this.movePast(node.whileKeyword); - this.movePast(node.openParenToken); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - this.movePast(node.semicolonToken); - - var result = new TypeScript.DoStatement(statement, whileKeyword, condition); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeOfExpression = function (node) { - var start = this.position; - - this.movePast(node.typeOfKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.TypeOfExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDeleteExpression = function (node) { - var start = this.position; - - this.movePast(node.deleteKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.DeleteExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVoidExpression = function (node) { - var start = this.position; - - this.movePast(node.voidKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.VoidExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDebuggerStatement = function (node) { - var start = this.position; - - this.movePast(node.debuggerKeyword); - this.movePast(node.semicolonToken); - - var result = new TypeScript.DebuggerStatement(); - this.setSpan(result, start, node); - - return result; - }; - return SyntaxTreeToAstVisitor; - })(); - TypeScript.SyntaxTreeToAstVisitor = SyntaxTreeToAstVisitor; - - function applyDelta(ast, delta) { - if (ast) { - if (ast._start !== -1) { - ast._start += delta; - } - - if (ast._end !== -1) { - ast._end += delta; - } - } - } - - function applyDeltaToComments(comments, delta) { - if (comments && comments.length > 0) { - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - applyDelta(comment, delta); - } - } - } - - var SyntaxTreeToIncrementalAstVisitor = (function (_super) { - __extends(SyntaxTreeToIncrementalAstVisitor, _super); - function SyntaxTreeToIncrementalAstVisitor() { - _super.apply(this, arguments); - } - SyntaxTreeToIncrementalAstVisitor.prototype.applyDelta = function (ast, delta) { - if (delta === 0) { - return; - } - - var pre = function (cur) { - applyDelta(cur, delta); - applyDeltaToComments(cur.preComments(), delta); - applyDeltaToComments(cur.postComments(), delta); - - switch (cur.kind()) { - case 146 /* Block */: - applyDelta(cur.closeBraceToken, delta); - break; - - case 226 /* ArgumentList */: - applyDelta(cur.closeParenToken, delta); - break; - - case 130 /* ModuleDeclaration */: - applyDelta(cur.endingToken, delta); - break; - - case 131 /* ClassDeclaration */: - applyDelta(cur.closeBraceToken, delta); - break; - - case 161 /* DoStatement */: - applyDelta(cur.whileKeyword, delta); - break; - - case 151 /* SwitchStatement */: - applyDelta(cur.closeParenToken, delta); - break; - } - }; - - TypeScript.getAstWalkerFactory().simpleWalk(ast, pre); - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.setSpanExplicit = function (span, start, end) { - if (span._start !== -1) { - var delta = start - span._start; - this.applyDelta(span, delta); - - span._end = end; - } else { - _super.prototype.setSpanExplicit.call(this, span, start, end); - } - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.getAndMovePastAST = function (element) { - if (this.previousTokenTrailingComments !== null) { - return null; - } - - var result = element._ast; - if (!result) { - return null; - } - - var start = this.position; - this.movePast(element); - this.setSpan(result, start, element); - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.setAST = function (element, ast) { - element._ast = ast; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSyntaxList = function (list) { - var result = this.getAndMovePastAST(list); - if (!result) { - result = _super.prototype.visitSyntaxList.call(this, list); - - if (list.childCount() > 0) { - this.setAST(list, result); - } - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSeparatedSyntaxList = function (list) { - var result = this.getAndMovePastAST(list); - if (!result) { - result = _super.prototype.visitSeparatedSyntaxList.call(this, list); - - if (list.childCount() > 0) { - this.setAST(list, result); - } - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitToken = function (token) { - var result = this.getAndMovePastAST(token); - - if (!result) { - result = _super.prototype.visitToken.call(this, token); - this.setAST(token, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitClassDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitClassDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitInterfaceDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitInterfaceDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitHeritageClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitHeritageClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitModuleDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitModuleDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitImportDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitImportDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitExportAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitExportAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPrefixUnaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPrefixUnaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitArrayLiteralExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitArrayLiteralExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitOmittedExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitOmittedExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParenthesizedExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParenthesizedExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSimpleArrowFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParenthesizedArrowFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitQualifiedName = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - var result = _super.prototype.visitQualifiedName.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructorType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructorType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitArrayType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitArrayType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitGenericType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitGenericType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBlock = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBlock.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParameter = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParameter.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberAccessExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberAccessExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPostfixUnaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPostfixUnaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitElementAccessExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitElementAccessExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitInvocationExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitInvocationExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBinaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBinaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConditionalExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConditionalExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMethodSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMethodSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitIndexSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitIndexSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPropertySignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPropertySignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCallSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCallSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTypeParameter = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTypeParameter.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitIfStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitIfStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitExpressionStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitExpressionStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructorDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructorDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberFunctionDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitGetAccessor = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitGetAccessor.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSetAccessor = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSetAccessor.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberVariableDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberVariableDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitThrowStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitThrowStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitReturnStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitReturnStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectCreationExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectCreationExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSwitchStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSwitchStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCaseSwitchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCaseSwitchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDefaultSwitchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDefaultSwitchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBreakStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBreakStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitContinueStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitContinueStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitForStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitForStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitForInStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitForInStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitWhileStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitWhileStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitWithStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitWithStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCastExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCastExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectLiteralExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectLiteralExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSimplePropertyAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSimplePropertyAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionPropertyAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitEmptyStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitEmptyStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTryStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTryStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCatchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCatchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitLabeledStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitLabeledStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDoStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDoStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTypeOfExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTypeOfExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDeleteExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDeleteExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitVoidExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitVoidExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDebuggerStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDebuggerStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - return SyntaxTreeToIncrementalAstVisitor; - })(SyntaxTreeToAstVisitor); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ASTSpan = (function () { - function ASTSpan(_start, _end) { - this._start = _start; - this._end = _end; - } - ASTSpan.prototype.start = function () { - return this._start; - }; - - ASTSpan.prototype.end = function () { - return this._end; - }; - return ASTSpan; - })(); - TypeScript.ASTSpan = ASTSpan; - - var astID = 0; - - function structuralEqualsNotIncludingPosition(ast1, ast2) { - return structuralEquals(ast1, ast2, false); - } - TypeScript.structuralEqualsNotIncludingPosition = structuralEqualsNotIncludingPosition; - - function structuralEqualsIncludingPosition(ast1, ast2) { - return structuralEquals(ast1, ast2, true); - } - TypeScript.structuralEqualsIncludingPosition = structuralEqualsIncludingPosition; - - function commentStructuralEqualsNotIncludingPosition(ast1, ast2) { - return commentStructuralEquals(ast1, ast2, false); - } - - function commentStructuralEqualsIncludingPosition(ast1, ast2) { - return commentStructuralEquals(ast1, ast2, true); - } - - function structuralEquals(ast1, ast2, includingPosition) { - if (ast1 === ast2) { - return true; - } - - return ast1 !== null && ast2 !== null && ast1.kind() === ast2.kind() && ast1.structuralEquals(ast2, includingPosition); - } - - function commentStructuralEquals(ast1, ast2, includingPosition) { - if (ast1 === ast2) { - return true; - } - - return ast1 !== null && ast2 !== null && ast1.structuralEquals(ast2, includingPosition); - } - - function astArrayStructuralEquals(array1, array2, includingPosition) { - return TypeScript.ArrayUtilities.sequenceEquals(array1, array2, includingPosition ? structuralEqualsIncludingPosition : structuralEqualsNotIncludingPosition); - } - - function commentArrayStructuralEquals(array1, array2, includingPosition) { - return TypeScript.ArrayUtilities.sequenceEquals(array1, array2, includingPosition ? commentStructuralEqualsIncludingPosition : commentStructuralEqualsNotIncludingPosition); - } - - var AST = (function () { - function AST() { - this.parent = null; - this._start = -1; - this._end = -1; - this._trailingTriviaWidth = 0; - this._astID = astID++; - this._preComments = null; - this._postComments = null; - } - AST.prototype.syntaxID = function () { - return this._astID; - }; - - AST.prototype.start = function () { - return this._start; - }; - - AST.prototype.end = function () { - return this._end; - }; - - AST.prototype.trailingTriviaWidth = function () { - return this._trailingTriviaWidth; - }; - - AST.prototype.fileName = function () { - return this.parent.fileName(); - }; - - AST.prototype.kind = function () { - throw TypeScript.Errors.abstract(); - }; - - AST.prototype.preComments = function () { - return this._preComments; - }; - - AST.prototype.postComments = function () { - return this._postComments; - }; - - AST.prototype.setPreComments = function (comments) { - if (comments && comments.length) { - this._preComments = comments; - } else if (this._preComments) { - this._preComments = null; - } - }; - - AST.prototype.setPostComments = function (comments) { - if (comments && comments.length) { - this._postComments = comments; - } else if (this._postComments) { - this._postComments = null; - } - }; - - AST.prototype.width = function () { - return this.end() - this.start(); - }; - - AST.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return commentArrayStructuralEquals(this.preComments(), ast.preComments(), includingPosition) && commentArrayStructuralEquals(this.postComments(), ast.postComments(), includingPosition); - }; - - AST.prototype.isExpression = function () { - return false; - }; - return AST; - })(); - TypeScript.AST = AST; - - var ISyntaxList2 = (function (_super) { - __extends(ISyntaxList2, _super); - function ISyntaxList2(_fileName, members) { - _super.call(this); - this._fileName = _fileName; - this.members = members; - - for (var i = 0, n = members.length; i < n; i++) { - members[i].parent = this; - } - } - ISyntaxList2.prototype.childCount = function () { - return this.members.length; - }; - - ISyntaxList2.prototype.childAt = function (index) { - return this.members[index]; - }; - - ISyntaxList2.prototype.fileName = function () { - return this._fileName; - }; - - ISyntaxList2.prototype.kind = function () { - return 1 /* List */; - }; - - ISyntaxList2.prototype.firstOrDefault = function (func) { - return TypeScript.ArrayUtilities.firstOrDefault(this.members, func); - }; - - ISyntaxList2.prototype.lastOrDefault = function (func) { - return TypeScript.ArrayUtilities.lastOrDefault(this.members, func); - }; - - ISyntaxList2.prototype.any = function (func) { - return TypeScript.ArrayUtilities.any(this.members, func); - }; - - ISyntaxList2.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && astArrayStructuralEquals(this.members, ast.members, includingPosition); - }; - return ISyntaxList2; - })(AST); - TypeScript.ISyntaxList2 = ISyntaxList2; - - var ISeparatedSyntaxList2 = (function (_super) { - __extends(ISeparatedSyntaxList2, _super); - function ISeparatedSyntaxList2(_fileName, members, _separatorCount) { - _super.call(this); - this._fileName = _fileName; - this.members = members; - this._separatorCount = _separatorCount; - - for (var i = 0, n = members.length; i < n; i++) { - members[i].parent = this; - } - } - ISeparatedSyntaxList2.prototype.nonSeparatorCount = function () { - return this.members.length; - }; - - ISeparatedSyntaxList2.prototype.separatorCount = function () { - return this._separatorCount; - }; - - ISeparatedSyntaxList2.prototype.nonSeparatorAt = function (index) { - return this.members[index]; - }; - - ISeparatedSyntaxList2.prototype.nonSeparatorIndexOf = function (ast) { - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - if (this.nonSeparatorAt(i) === ast) { - return i; - } - } - - return -1; - }; - - ISeparatedSyntaxList2.prototype.fileName = function () { - return this._fileName; - }; - - ISeparatedSyntaxList2.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - ISeparatedSyntaxList2.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && astArrayStructuralEquals(this.members, ast.members, includingPosition); - }; - return ISeparatedSyntaxList2; - })(AST); - TypeScript.ISeparatedSyntaxList2 = ISeparatedSyntaxList2; - - var SourceUnit = (function (_super) { - __extends(SourceUnit, _super); - function SourceUnit(moduleElements, endOfFileTokenLeadingComments, _fileName) { - _super.call(this); - this.moduleElements = moduleElements; - this.endOfFileTokenLeadingComments = endOfFileTokenLeadingComments; - this._fileName = _fileName; - moduleElements && (moduleElements.parent = this); - } - SourceUnit.prototype.fileName = function () { - return this._fileName; - }; - - SourceUnit.prototype.kind = function () { - return 120 /* SourceUnit */; - }; - - SourceUnit.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.moduleElements, ast.moduleElements, includingPosition); - }; - return SourceUnit; - })(AST); - TypeScript.SourceUnit = SourceUnit; - - var Identifier = (function (_super) { - __extends(Identifier, _super); - function Identifier(_text) { - _super.call(this); - this._text = _text; - this._valueText = null; - } - Identifier.prototype.text = function () { - return this._text; - }; - Identifier.prototype.valueText = function () { - if (!this._valueText) { - var text = this._text; - if (text === "__proto__") { - this._valueText = "#__proto__"; - } else { - this._valueText = TypeScript.Syntax.massageEscapes(text); - } - } - - return this._valueText; - }; - - Identifier.prototype.kind = function () { - return 11 /* IdentifierName */; - }; - - Identifier.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && this._text === ast._text; - }; - - Identifier.prototype.isExpression = function () { - return true; - }; - return Identifier; - })(AST); - TypeScript.Identifier = Identifier; - - var LiteralExpression = (function (_super) { - __extends(LiteralExpression, _super); - function LiteralExpression(_nodeType, _text, _valueText) { - _super.call(this); - this._nodeType = _nodeType; - this._text = _text; - this._valueText = _valueText; - } - LiteralExpression.prototype.text = function () { - return this._text; - }; - - LiteralExpression.prototype.valueText = function () { - return this._valueText; - }; - - LiteralExpression.prototype.kind = function () { - return this._nodeType; - }; - - LiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - LiteralExpression.prototype.isExpression = function () { - return true; - }; - return LiteralExpression; - })(AST); - TypeScript.LiteralExpression = LiteralExpression; - - var ThisExpression = (function (_super) { - __extends(ThisExpression, _super); - function ThisExpression(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - ThisExpression.prototype.text = function () { - return this._text; - }; - - ThisExpression.prototype.valueText = function () { - return this._valueText; - }; - - ThisExpression.prototype.kind = function () { - return 35 /* ThisKeyword */; - }; - - ThisExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - ThisExpression.prototype.isExpression = function () { - return true; - }; - return ThisExpression; - })(AST); - TypeScript.ThisExpression = ThisExpression; - - var SuperExpression = (function (_super) { - __extends(SuperExpression, _super); - function SuperExpression(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - SuperExpression.prototype.text = function () { - return this._text; - }; - - SuperExpression.prototype.valueText = function () { - return this._valueText; - }; - - SuperExpression.prototype.kind = function () { - return 50 /* SuperKeyword */; - }; - - SuperExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - SuperExpression.prototype.isExpression = function () { - return true; - }; - return SuperExpression; - })(AST); - TypeScript.SuperExpression = SuperExpression; - - var NumericLiteral = (function (_super) { - __extends(NumericLiteral, _super); - function NumericLiteral(_value, _text, _valueText) { - _super.call(this); - this._value = _value; - this._text = _text; - this._valueText = _valueText; - } - NumericLiteral.prototype.text = function () { - return this._text; - }; - NumericLiteral.prototype.valueText = function () { - return this._valueText; - }; - NumericLiteral.prototype.value = function () { - return this._value; - }; - - NumericLiteral.prototype.kind = function () { - return 13 /* NumericLiteral */; - }; - - NumericLiteral.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && (this._value === ast._value || (isNaN(this._value) && isNaN(ast._value))) && this._text === ast._text; - }; - - NumericLiteral.prototype.isExpression = function () { - return true; - }; - return NumericLiteral; - })(AST); - TypeScript.NumericLiteral = NumericLiteral; - - var RegularExpressionLiteral = (function (_super) { - __extends(RegularExpressionLiteral, _super); - function RegularExpressionLiteral(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - RegularExpressionLiteral.prototype.text = function () { - return this._text; - }; - - RegularExpressionLiteral.prototype.valueText = function () { - return this._valueText; - }; - - RegularExpressionLiteral.prototype.kind = function () { - return 12 /* RegularExpressionLiteral */; - }; - - RegularExpressionLiteral.prototype.isExpression = function () { - return true; - }; - return RegularExpressionLiteral; - })(AST); - TypeScript.RegularExpressionLiteral = RegularExpressionLiteral; - - var StringLiteral = (function (_super) { - __extends(StringLiteral, _super); - function StringLiteral(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - this._valueText = _valueText === "__proto__" ? "#__proto__" : _valueText; - } - StringLiteral.prototype.text = function () { - return this._text; - }; - StringLiteral.prototype.valueText = function () { - return this._valueText; - }; - - StringLiteral.prototype.kind = function () { - return 14 /* StringLiteral */; - }; - - StringLiteral.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && this._text === ast._text; - }; - - StringLiteral.prototype.isExpression = function () { - return true; - }; - return StringLiteral; - })(AST); - TypeScript.StringLiteral = StringLiteral; - - var TypeAnnotation = (function (_super) { - __extends(TypeAnnotation, _super); - function TypeAnnotation(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - TypeAnnotation.prototype.kind = function () { - return 244 /* TypeAnnotation */; - }; - return TypeAnnotation; - })(AST); - TypeScript.TypeAnnotation = TypeAnnotation; - - var BuiltInType = (function (_super) { - __extends(BuiltInType, _super); - function BuiltInType(_nodeType, _text, _valueText) { - _super.call(this); - this._nodeType = _nodeType; - this._text = _text; - this._valueText = _valueText; - } - BuiltInType.prototype.text = function () { - return this._text; - }; - - BuiltInType.prototype.valueText = function () { - return this._valueText; - }; - - BuiltInType.prototype.kind = function () { - return this._nodeType; - }; - return BuiltInType; - })(AST); - TypeScript.BuiltInType = BuiltInType; - - var ExternalModuleReference = (function (_super) { - __extends(ExternalModuleReference, _super); - function ExternalModuleReference(stringLiteral) { - _super.call(this); - this.stringLiteral = stringLiteral; - stringLiteral && (stringLiteral.parent = this); - } - ExternalModuleReference.prototype.kind = function () { - return 245 /* ExternalModuleReference */; - }; - return ExternalModuleReference; - })(AST); - TypeScript.ExternalModuleReference = ExternalModuleReference; - - var ModuleNameModuleReference = (function (_super) { - __extends(ModuleNameModuleReference, _super); - function ModuleNameModuleReference(moduleName) { - _super.call(this); - this.moduleName = moduleName; - moduleName && (moduleName.parent = this); - } - ModuleNameModuleReference.prototype.kind = function () { - return 246 /* ModuleNameModuleReference */; - }; - return ModuleNameModuleReference; - })(AST); - TypeScript.ModuleNameModuleReference = ModuleNameModuleReference; - - var ImportDeclaration = (function (_super) { - __extends(ImportDeclaration, _super); - function ImportDeclaration(modifiers, identifier, moduleReference) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.moduleReference = moduleReference; - identifier && (identifier.parent = this); - moduleReference && (moduleReference.parent = this); - } - ImportDeclaration.prototype.kind = function () { - return 133 /* ImportDeclaration */; - }; - - ImportDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.moduleReference, ast.moduleReference, includingPosition); - }; - return ImportDeclaration; - })(AST); - TypeScript.ImportDeclaration = ImportDeclaration; - - var ExportAssignment = (function (_super) { - __extends(ExportAssignment, _super); - function ExportAssignment(identifier) { - _super.call(this); - this.identifier = identifier; - identifier && (identifier.parent = this); - } - ExportAssignment.prototype.kind = function () { - return 134 /* ExportAssignment */; - }; - - ExportAssignment.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition); - }; - return ExportAssignment; - })(AST); - TypeScript.ExportAssignment = ExportAssignment; - - var TypeParameterList = (function (_super) { - __extends(TypeParameterList, _super); - function TypeParameterList(typeParameters) { - _super.call(this); - this.typeParameters = typeParameters; - typeParameters && (typeParameters.parent = this); - } - TypeParameterList.prototype.kind = function () { - return 229 /* TypeParameterList */; - }; - return TypeParameterList; - })(AST); - TypeScript.TypeParameterList = TypeParameterList; - - var ClassDeclaration = (function (_super) { - __extends(ClassDeclaration, _super); - function ClassDeclaration(modifiers, identifier, typeParameterList, heritageClauses, classElements, closeBraceToken) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.classElements = classElements; - this.closeBraceToken = closeBraceToken; - identifier && (identifier.parent = this); - typeParameterList && (typeParameterList.parent = this); - heritageClauses && (heritageClauses.parent = this); - classElements && (classElements.parent = this); - } - ClassDeclaration.prototype.kind = function () { - return 131 /* ClassDeclaration */; - }; - - ClassDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.classElements, ast.classElements, includingPosition) && structuralEquals(this.typeParameterList, ast.typeParameterList, includingPosition) && structuralEquals(this.heritageClauses, ast.heritageClauses, includingPosition); - }; - return ClassDeclaration; - })(AST); - TypeScript.ClassDeclaration = ClassDeclaration; - - var InterfaceDeclaration = (function (_super) { - __extends(InterfaceDeclaration, _super); - function InterfaceDeclaration(modifiers, identifier, typeParameterList, heritageClauses, body) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.body = body; - identifier && (identifier.parent = this); - typeParameterList && (typeParameterList.parent = this); - body && (body.parent = this); - heritageClauses && (heritageClauses.parent = this); - } - InterfaceDeclaration.prototype.kind = function () { - return 128 /* InterfaceDeclaration */; - }; - - InterfaceDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.body, ast.body, includingPosition) && structuralEquals(this.typeParameterList, ast.typeParameterList, includingPosition) && structuralEquals(this.heritageClauses, ast.heritageClauses, includingPosition); - }; - return InterfaceDeclaration; - })(AST); - TypeScript.InterfaceDeclaration = InterfaceDeclaration; - - var HeritageClause = (function (_super) { - __extends(HeritageClause, _super); - function HeritageClause(_nodeType, typeNames) { - _super.call(this); - this._nodeType = _nodeType; - this.typeNames = typeNames; - typeNames && (typeNames.parent = this); - } - HeritageClause.prototype.kind = function () { - return this._nodeType; - }; - - HeritageClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.typeNames, ast.typeNames, includingPosition); - }; - return HeritageClause; - })(AST); - TypeScript.HeritageClause = HeritageClause; - - var ModuleDeclaration = (function (_super) { - __extends(ModuleDeclaration, _super); - function ModuleDeclaration(modifiers, name, stringLiteral, moduleElements, endingToken) { - _super.call(this); - this.modifiers = modifiers; - this.name = name; - this.stringLiteral = stringLiteral; - this.moduleElements = moduleElements; - this.endingToken = endingToken; - name && (name.parent = this); - stringLiteral && (stringLiteral.parent = this); - moduleElements && (moduleElements.parent = this); - } - ModuleDeclaration.prototype.kind = function () { - return 130 /* ModuleDeclaration */; - }; - - ModuleDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition) && structuralEquals(this.moduleElements, ast.moduleElements, includingPosition); - }; - return ModuleDeclaration; - })(AST); - TypeScript.ModuleDeclaration = ModuleDeclaration; - - var FunctionDeclaration = (function (_super) { - __extends(FunctionDeclaration, _super); - function FunctionDeclaration(modifiers, identifier, callSignature, block) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - identifier && (identifier.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionDeclaration.prototype.kind = function () { - return 129 /* FunctionDeclaration */; - }; - - FunctionDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.block, ast.block, includingPosition) && structuralEquals(this.callSignature, ast.callSignature, includingPosition); - }; - return FunctionDeclaration; - })(AST); - TypeScript.FunctionDeclaration = FunctionDeclaration; - - var VariableStatement = (function (_super) { - __extends(VariableStatement, _super); - function VariableStatement(modifiers, declaration) { - _super.call(this); - this.modifiers = modifiers; - this.declaration = declaration; - declaration && (declaration.parent = this); - } - VariableStatement.prototype.kind = function () { - return 148 /* VariableStatement */; - }; - - VariableStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.declaration, ast.declaration, includingPosition); - }; - return VariableStatement; - })(AST); - TypeScript.VariableStatement = VariableStatement; - - var VariableDeclaration = (function (_super) { - __extends(VariableDeclaration, _super); - function VariableDeclaration(declarators) { - _super.call(this); - this.declarators = declarators; - declarators && (declarators.parent = this); - } - VariableDeclaration.prototype.kind = function () { - return 224 /* VariableDeclaration */; - }; - - VariableDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.declarators, ast.declarators, includingPosition); - }; - return VariableDeclaration; - })(AST); - TypeScript.VariableDeclaration = VariableDeclaration; - - var VariableDeclarator = (function (_super) { - __extends(VariableDeclarator, _super); - function VariableDeclarator(propertyName, typeAnnotation, equalsValueClause) { - _super.call(this); - this.propertyName = propertyName; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - propertyName && (propertyName.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - VariableDeclarator.prototype.kind = function () { - return 225 /* VariableDeclarator */; - }; - return VariableDeclarator; - })(AST); - TypeScript.VariableDeclarator = VariableDeclarator; - - var EqualsValueClause = (function (_super) { - __extends(EqualsValueClause, _super); - function EqualsValueClause(value) { - _super.call(this); - this.value = value; - value && (value.parent = this); - } - EqualsValueClause.prototype.kind = function () { - return 232 /* EqualsValueClause */; - }; - return EqualsValueClause; - })(AST); - TypeScript.EqualsValueClause = EqualsValueClause; - - var PrefixUnaryExpression = (function (_super) { - __extends(PrefixUnaryExpression, _super); - function PrefixUnaryExpression(_nodeType, operand) { - _super.call(this); - this._nodeType = _nodeType; - this.operand = operand; - operand && (operand.parent = this); - } - PrefixUnaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - PrefixUnaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.operand, ast.operand, includingPosition); - }; - - PrefixUnaryExpression.prototype.isExpression = function () { - return true; - }; - return PrefixUnaryExpression; - })(AST); - TypeScript.PrefixUnaryExpression = PrefixUnaryExpression; - - var ArrayLiteralExpression = (function (_super) { - __extends(ArrayLiteralExpression, _super); - function ArrayLiteralExpression(expressions) { - _super.call(this); - this.expressions = expressions; - expressions && (expressions.parent = this); - } - ArrayLiteralExpression.prototype.kind = function () { - return 214 /* ArrayLiteralExpression */; - }; - - ArrayLiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expressions, ast.expressions, includingPosition); - }; - - ArrayLiteralExpression.prototype.isExpression = function () { - return true; - }; - return ArrayLiteralExpression; - })(AST); - TypeScript.ArrayLiteralExpression = ArrayLiteralExpression; - - var OmittedExpression = (function (_super) { - __extends(OmittedExpression, _super); - function OmittedExpression() { - _super.apply(this, arguments); - } - OmittedExpression.prototype.kind = function () { - return 223 /* OmittedExpression */; - }; - - OmittedExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - OmittedExpression.prototype.isExpression = function () { - return true; - }; - return OmittedExpression; - })(AST); - TypeScript.OmittedExpression = OmittedExpression; - - var ParenthesizedExpression = (function (_super) { - __extends(ParenthesizedExpression, _super); - function ParenthesizedExpression(openParenTrailingComments, expression) { - _super.call(this); - this.openParenTrailingComments = openParenTrailingComments; - this.expression = expression; - expression && (expression.parent = this); - } - ParenthesizedExpression.prototype.kind = function () { - return 217 /* ParenthesizedExpression */; - }; - - ParenthesizedExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - ParenthesizedExpression.prototype.isExpression = function () { - return true; - }; - return ParenthesizedExpression; - })(AST); - TypeScript.ParenthesizedExpression = ParenthesizedExpression; - - var SimpleArrowFunctionExpression = (function (_super) { - __extends(SimpleArrowFunctionExpression, _super); - function SimpleArrowFunctionExpression(identifier, block, expression) { - _super.call(this); - this.identifier = identifier; - this.block = block; - this.expression = expression; - identifier && (identifier.parent = this); - block && (block.parent = this); - expression && (expression.parent = this); - } - SimpleArrowFunctionExpression.prototype.kind = function () { - return 219 /* SimpleArrowFunctionExpression */; - }; - - SimpleArrowFunctionExpression.prototype.isExpression = function () { - return true; - }; - return SimpleArrowFunctionExpression; - })(AST); - TypeScript.SimpleArrowFunctionExpression = SimpleArrowFunctionExpression; - - var ParenthesizedArrowFunctionExpression = (function (_super) { - __extends(ParenthesizedArrowFunctionExpression, _super); - function ParenthesizedArrowFunctionExpression(callSignature, block, expression) { - _super.call(this); - this.callSignature = callSignature; - this.block = block; - this.expression = expression; - callSignature && (callSignature.parent = this); - block && (block.parent = this); - expression && (expression.parent = this); - } - ParenthesizedArrowFunctionExpression.prototype.kind = function () { - return 218 /* ParenthesizedArrowFunctionExpression */; - }; - - ParenthesizedArrowFunctionExpression.prototype.isExpression = function () { - return true; - }; - return ParenthesizedArrowFunctionExpression; - })(AST); - TypeScript.ParenthesizedArrowFunctionExpression = ParenthesizedArrowFunctionExpression; - - var QualifiedName = (function (_super) { - __extends(QualifiedName, _super); - function QualifiedName(left, right) { - _super.call(this); - this.left = left; - this.right = right; - left && (left.parent = this); - right && (right.parent = this); - } - QualifiedName.prototype.kind = function () { - return 121 /* QualifiedName */; - }; - - QualifiedName.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.left, ast.left, includingPosition) && structuralEquals(this.right, ast.right, includingPosition); - }; - return QualifiedName; - })(AST); - TypeScript.QualifiedName = QualifiedName; - - var ParameterList = (function (_super) { - __extends(ParameterList, _super); - function ParameterList(openParenTrailingComments, parameters) { - _super.call(this); - this.openParenTrailingComments = openParenTrailingComments; - this.parameters = parameters; - parameters && (parameters.parent = this); - } - ParameterList.prototype.kind = function () { - return 227 /* ParameterList */; - }; - return ParameterList; - })(AST); - TypeScript.ParameterList = ParameterList; - - var ConstructorType = (function (_super) { - __extends(ConstructorType, _super); - function ConstructorType(typeParameterList, parameterList, type) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.type = type; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - type && (type.parent = this); - } - ConstructorType.prototype.kind = function () { - return 125 /* ConstructorType */; - }; - return ConstructorType; - })(AST); - TypeScript.ConstructorType = ConstructorType; - - var FunctionType = (function (_super) { - __extends(FunctionType, _super); - function FunctionType(typeParameterList, parameterList, type) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.type = type; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - type && (type.parent = this); - } - FunctionType.prototype.kind = function () { - return 123 /* FunctionType */; - }; - return FunctionType; - })(AST); - TypeScript.FunctionType = FunctionType; - - var ObjectType = (function (_super) { - __extends(ObjectType, _super); - function ObjectType(typeMembers) { - _super.call(this); - this.typeMembers = typeMembers; - typeMembers && (typeMembers.parent = this); - } - ObjectType.prototype.kind = function () { - return 122 /* ObjectType */; - }; - - ObjectType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.typeMembers, ast.typeMembers, includingPosition); - }; - return ObjectType; - })(AST); - TypeScript.ObjectType = ObjectType; - - var ArrayType = (function (_super) { - __extends(ArrayType, _super); - function ArrayType(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - ArrayType.prototype.kind = function () { - return 124 /* ArrayType */; - }; - - ArrayType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.type, ast.type, includingPosition); - }; - return ArrayType; - })(AST); - TypeScript.ArrayType = ArrayType; - - var TypeArgumentList = (function (_super) { - __extends(TypeArgumentList, _super); - function TypeArgumentList(typeArguments) { - _super.call(this); - this.typeArguments = typeArguments; - typeArguments && (typeArguments.parent = this); - } - TypeArgumentList.prototype.kind = function () { - return 228 /* TypeArgumentList */; - }; - return TypeArgumentList; - })(AST); - TypeScript.TypeArgumentList = TypeArgumentList; - - var GenericType = (function (_super) { - __extends(GenericType, _super); - function GenericType(name, typeArgumentList) { - _super.call(this); - this.name = name; - this.typeArgumentList = typeArgumentList; - name && (name.parent = this); - typeArgumentList && (typeArgumentList.parent = this); - } - GenericType.prototype.kind = function () { - return 126 /* GenericType */; - }; - - GenericType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition) && structuralEquals(this.typeArgumentList, ast.typeArgumentList, includingPosition); - }; - return GenericType; - })(AST); - TypeScript.GenericType = GenericType; - - var TypeQuery = (function (_super) { - __extends(TypeQuery, _super); - function TypeQuery(name) { - _super.call(this); - this.name = name; - name && (name.parent = this); - } - TypeQuery.prototype.kind = function () { - return 127 /* TypeQuery */; - }; - - TypeQuery.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition); - }; - return TypeQuery; - })(AST); - TypeScript.TypeQuery = TypeQuery; - - var Block = (function (_super) { - __extends(Block, _super); - function Block(statements, closeBraceLeadingComments, closeBraceToken) { - _super.call(this); - this.statements = statements; - this.closeBraceLeadingComments = closeBraceLeadingComments; - this.closeBraceToken = closeBraceToken; - statements && (statements.parent = this); - } - Block.prototype.kind = function () { - return 146 /* Block */; - }; - - Block.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return Block; - })(AST); - TypeScript.Block = Block; - - var Parameter = (function (_super) { - __extends(Parameter, _super); - function Parameter(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this); - this.dotDotDotToken = dotDotDotToken; - this.modifiers = modifiers; - this.identifier = identifier; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - identifier && (identifier.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - Parameter.prototype.kind = function () { - return 242 /* Parameter */; - }; - return Parameter; - })(AST); - TypeScript.Parameter = Parameter; - - var MemberAccessExpression = (function (_super) { - __extends(MemberAccessExpression, _super); - function MemberAccessExpression(expression, name) { - _super.call(this); - this.expression = expression; - this.name = name; - expression && (expression.parent = this); - name && (name.parent = this); - } - MemberAccessExpression.prototype.kind = function () { - return 212 /* MemberAccessExpression */; - }; - - MemberAccessExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.name, ast.name, includingPosition); - }; - - MemberAccessExpression.prototype.isExpression = function () { - return true; - }; - return MemberAccessExpression; - })(AST); - TypeScript.MemberAccessExpression = MemberAccessExpression; - - var PostfixUnaryExpression = (function (_super) { - __extends(PostfixUnaryExpression, _super); - function PostfixUnaryExpression(_nodeType, operand) { - _super.call(this); - this._nodeType = _nodeType; - this.operand = operand; - operand && (operand.parent = this); - } - PostfixUnaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - PostfixUnaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.operand, ast.operand, includingPosition); - }; - - PostfixUnaryExpression.prototype.isExpression = function () { - return true; - }; - return PostfixUnaryExpression; - })(AST); - TypeScript.PostfixUnaryExpression = PostfixUnaryExpression; - - var ElementAccessExpression = (function (_super) { - __extends(ElementAccessExpression, _super); - function ElementAccessExpression(expression, argumentExpression) { - _super.call(this); - this.expression = expression; - this.argumentExpression = argumentExpression; - expression && (expression.parent = this); - argumentExpression && (argumentExpression.parent = this); - } - ElementAccessExpression.prototype.kind = function () { - return 221 /* ElementAccessExpression */; - }; - - ElementAccessExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentExpression, ast.argumentExpression, includingPosition); - }; - - ElementAccessExpression.prototype.isExpression = function () { - return true; - }; - return ElementAccessExpression; - })(AST); - TypeScript.ElementAccessExpression = ElementAccessExpression; - - var InvocationExpression = (function (_super) { - __extends(InvocationExpression, _super); - function InvocationExpression(expression, argumentList) { - _super.call(this); - this.expression = expression; - this.argumentList = argumentList; - expression && (expression.parent = this); - argumentList && (argumentList.parent = this); - } - InvocationExpression.prototype.kind = function () { - return 213 /* InvocationExpression */; - }; - - InvocationExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentList, ast.argumentList, includingPosition); - }; - - InvocationExpression.prototype.isExpression = function () { - return true; - }; - return InvocationExpression; - })(AST); - TypeScript.InvocationExpression = InvocationExpression; - - var ArgumentList = (function (_super) { - __extends(ArgumentList, _super); - function ArgumentList(typeArgumentList, _arguments, closeParenToken) { - _super.call(this); - this.typeArgumentList = typeArgumentList; - this.closeParenToken = closeParenToken; - this.arguments = _arguments; - - typeArgumentList && (typeArgumentList.parent = this); - _arguments && (_arguments.parent = this); - } - ArgumentList.prototype.kind = function () { - return 226 /* ArgumentList */; - }; - return ArgumentList; - })(AST); - TypeScript.ArgumentList = ArgumentList; - - var BinaryExpression = (function (_super) { - __extends(BinaryExpression, _super); - function BinaryExpression(_nodeType, left, right) { - _super.call(this); - this._nodeType = _nodeType; - this.left = left; - this.right = right; - left && (left.parent = this); - right && (right.parent = this); - } - BinaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - BinaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.left, ast.left, includingPosition) && structuralEquals(this.right, ast.right, includingPosition); - }; - - BinaryExpression.prototype.isExpression = function () { - return true; - }; - return BinaryExpression; - })(AST); - TypeScript.BinaryExpression = BinaryExpression; - - var ConditionalExpression = (function (_super) { - __extends(ConditionalExpression, _super); - function ConditionalExpression(condition, whenTrue, whenFalse) { - _super.call(this); - this.condition = condition; - this.whenTrue = whenTrue; - this.whenFalse = whenFalse; - condition && (condition.parent = this); - whenTrue && (whenTrue.parent = this); - whenFalse && (whenFalse.parent = this); - } - ConditionalExpression.prototype.kind = function () { - return 186 /* ConditionalExpression */; - }; - - ConditionalExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.whenTrue, ast.whenTrue, includingPosition) && structuralEquals(this.whenFalse, ast.whenFalse, includingPosition); - }; - - ConditionalExpression.prototype.isExpression = function () { - return true; - }; - return ConditionalExpression; - })(AST); - TypeScript.ConditionalExpression = ConditionalExpression; - - var ConstructSignature = (function (_super) { - __extends(ConstructSignature, _super); - function ConstructSignature(callSignature) { - _super.call(this); - this.callSignature = callSignature; - callSignature && (callSignature.parent = this); - } - ConstructSignature.prototype.kind = function () { - return 143 /* ConstructSignature */; - }; - return ConstructSignature; - })(AST); - TypeScript.ConstructSignature = ConstructSignature; - - var MethodSignature = (function (_super) { - __extends(MethodSignature, _super); - function MethodSignature(propertyName, questionToken, callSignature) { - _super.call(this); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.callSignature = callSignature; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - } - MethodSignature.prototype.kind = function () { - return 145 /* MethodSignature */; - }; - return MethodSignature; - })(AST); - TypeScript.MethodSignature = MethodSignature; - - var IndexSignature = (function (_super) { - __extends(IndexSignature, _super); - function IndexSignature(parameter, typeAnnotation) { - _super.call(this); - this.parameter = parameter; - this.typeAnnotation = typeAnnotation; - parameter && (parameter.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - IndexSignature.prototype.kind = function () { - return 144 /* IndexSignature */; - }; - return IndexSignature; - })(AST); - TypeScript.IndexSignature = IndexSignature; - - var PropertySignature = (function (_super) { - __extends(PropertySignature, _super); - function PropertySignature(propertyName, questionToken, typeAnnotation) { - _super.call(this); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - propertyName && (propertyName.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - PropertySignature.prototype.kind = function () { - return 141 /* PropertySignature */; - }; - return PropertySignature; - })(AST); - TypeScript.PropertySignature = PropertySignature; - - var CallSignature = (function (_super) { - __extends(CallSignature, _super); - function CallSignature(typeParameterList, parameterList, typeAnnotation) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - CallSignature.prototype.kind = function () { - return 142 /* CallSignature */; - }; - return CallSignature; - })(AST); - TypeScript.CallSignature = CallSignature; - - var TypeParameter = (function (_super) { - __extends(TypeParameter, _super); - function TypeParameter(identifier, constraint) { - _super.call(this); - this.identifier = identifier; - this.constraint = constraint; - identifier && (identifier.parent = this); - constraint && (constraint.parent = this); - } - TypeParameter.prototype.kind = function () { - return 238 /* TypeParameter */; - }; - - TypeParameter.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.constraint, ast.constraint, includingPosition); - }; - return TypeParameter; - })(AST); - TypeScript.TypeParameter = TypeParameter; - - var Constraint = (function (_super) { - __extends(Constraint, _super); - function Constraint(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - Constraint.prototype.kind = function () { - return 239 /* Constraint */; - }; - return Constraint; - })(AST); - TypeScript.Constraint = Constraint; - - var ElseClause = (function (_super) { - __extends(ElseClause, _super); - function ElseClause(statement) { - _super.call(this); - this.statement = statement; - statement && (statement.parent = this); - } - ElseClause.prototype.kind = function () { - return 235 /* ElseClause */; - }; - - ElseClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ElseClause; - })(AST); - TypeScript.ElseClause = ElseClause; - - var IfStatement = (function (_super) { - __extends(IfStatement, _super); - function IfStatement(condition, statement, elseClause) { - _super.call(this); - this.condition = condition; - this.statement = statement; - this.elseClause = elseClause; - condition && (condition.parent = this); - statement && (statement.parent = this); - elseClause && (elseClause.parent = this); - } - IfStatement.prototype.kind = function () { - return 147 /* IfStatement */; - }; - - IfStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition) && structuralEquals(this.elseClause, ast.elseClause, includingPosition); - }; - return IfStatement; - })(AST); - TypeScript.IfStatement = IfStatement; - - var ExpressionStatement = (function (_super) { - __extends(ExpressionStatement, _super); - function ExpressionStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ExpressionStatement.prototype.kind = function () { - return 149 /* ExpressionStatement */; - }; - - ExpressionStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ExpressionStatement; - })(AST); - TypeScript.ExpressionStatement = ExpressionStatement; - - var ConstructorDeclaration = (function (_super) { - __extends(ConstructorDeclaration, _super); - function ConstructorDeclaration(callSignature, block) { - _super.call(this); - this.callSignature = callSignature; - this.block = block; - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - ConstructorDeclaration.prototype.kind = function () { - return 137 /* ConstructorDeclaration */; - }; - return ConstructorDeclaration; - })(AST); - TypeScript.ConstructorDeclaration = ConstructorDeclaration; - - var MemberFunctionDeclaration = (function (_super) { - __extends(MemberFunctionDeclaration, _super); - function MemberFunctionDeclaration(modifiers, propertyName, callSignature, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - MemberFunctionDeclaration.prototype.kind = function () { - return 135 /* MemberFunctionDeclaration */; - }; - return MemberFunctionDeclaration; - })(AST); - TypeScript.MemberFunctionDeclaration = MemberFunctionDeclaration; - - var GetAccessor = (function (_super) { - __extends(GetAccessor, _super); - function GetAccessor(modifiers, propertyName, parameterList, typeAnnotation, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - this.block = block; - propertyName && (propertyName.parent = this); - parameterList && (parameterList.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - block && (block.parent = this); - } - GetAccessor.prototype.kind = function () { - return 139 /* GetAccessor */; - }; - return GetAccessor; - })(AST); - TypeScript.GetAccessor = GetAccessor; - - var SetAccessor = (function (_super) { - __extends(SetAccessor, _super); - function SetAccessor(modifiers, propertyName, parameterList, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.block = block; - propertyName && (propertyName.parent = this); - parameterList && (parameterList.parent = this); - block && (block.parent = this); - } - SetAccessor.prototype.kind = function () { - return 140 /* SetAccessor */; - }; - return SetAccessor; - })(AST); - TypeScript.SetAccessor = SetAccessor; - - var MemberVariableDeclaration = (function (_super) { - __extends(MemberVariableDeclaration, _super); - function MemberVariableDeclaration(modifiers, variableDeclarator) { - _super.call(this); - this.modifiers = modifiers; - this.variableDeclarator = variableDeclarator; - variableDeclarator && (variableDeclarator.parent = this); - } - MemberVariableDeclaration.prototype.kind = function () { - return 136 /* MemberVariableDeclaration */; - }; - return MemberVariableDeclaration; - })(AST); - TypeScript.MemberVariableDeclaration = MemberVariableDeclaration; - - var IndexMemberDeclaration = (function (_super) { - __extends(IndexMemberDeclaration, _super); - function IndexMemberDeclaration(indexSignature) { - _super.call(this); - this.indexSignature = indexSignature; - indexSignature && (indexSignature.parent = this); - } - IndexMemberDeclaration.prototype.kind = function () { - return 138 /* IndexMemberDeclaration */; - }; - return IndexMemberDeclaration; - })(AST); - TypeScript.IndexMemberDeclaration = IndexMemberDeclaration; - - var ThrowStatement = (function (_super) { - __extends(ThrowStatement, _super); - function ThrowStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ThrowStatement.prototype.kind = function () { - return 157 /* ThrowStatement */; - }; - - ThrowStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ThrowStatement; - })(AST); - TypeScript.ThrowStatement = ThrowStatement; - - var ReturnStatement = (function (_super) { - __extends(ReturnStatement, _super); - function ReturnStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ReturnStatement.prototype.kind = function () { - return 150 /* ReturnStatement */; - }; - - ReturnStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ReturnStatement; - })(AST); - TypeScript.ReturnStatement = ReturnStatement; - - var ObjectCreationExpression = (function (_super) { - __extends(ObjectCreationExpression, _super); - function ObjectCreationExpression(expression, argumentList) { - _super.call(this); - this.expression = expression; - this.argumentList = argumentList; - expression && (expression.parent = this); - argumentList && (argumentList.parent = this); - } - ObjectCreationExpression.prototype.kind = function () { - return 216 /* ObjectCreationExpression */; - }; - - ObjectCreationExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentList, ast.argumentList, includingPosition); - }; - - ObjectCreationExpression.prototype.isExpression = function () { - return true; - }; - return ObjectCreationExpression; - })(AST); - TypeScript.ObjectCreationExpression = ObjectCreationExpression; - - var SwitchStatement = (function (_super) { - __extends(SwitchStatement, _super); - function SwitchStatement(expression, closeParenToken, switchClauses) { - _super.call(this); - this.expression = expression; - this.closeParenToken = closeParenToken; - this.switchClauses = switchClauses; - expression && (expression.parent = this); - switchClauses && (switchClauses.parent = this); - } - SwitchStatement.prototype.kind = function () { - return 151 /* SwitchStatement */; - }; - - SwitchStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.switchClauses, ast.switchClauses, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return SwitchStatement; - })(AST); - TypeScript.SwitchStatement = SwitchStatement; - - var CaseSwitchClause = (function (_super) { - __extends(CaseSwitchClause, _super); - function CaseSwitchClause(expression, statements) { - _super.call(this); - this.expression = expression; - this.statements = statements; - expression && (expression.parent = this); - statements && (statements.parent = this); - } - CaseSwitchClause.prototype.kind = function () { - return 233 /* CaseSwitchClause */; - }; - - CaseSwitchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return CaseSwitchClause; - })(AST); - TypeScript.CaseSwitchClause = CaseSwitchClause; - - var DefaultSwitchClause = (function (_super) { - __extends(DefaultSwitchClause, _super); - function DefaultSwitchClause(statements) { - _super.call(this); - this.statements = statements; - statements && (statements.parent = this); - } - DefaultSwitchClause.prototype.kind = function () { - return 234 /* DefaultSwitchClause */; - }; - - DefaultSwitchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return DefaultSwitchClause; - })(AST); - TypeScript.DefaultSwitchClause = DefaultSwitchClause; - - var BreakStatement = (function (_super) { - __extends(BreakStatement, _super); - function BreakStatement(identifier) { - _super.call(this); - this.identifier = identifier; - } - BreakStatement.prototype.kind = function () { - return 152 /* BreakStatement */; - }; - - BreakStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return BreakStatement; - })(AST); - TypeScript.BreakStatement = BreakStatement; - - var ContinueStatement = (function (_super) { - __extends(ContinueStatement, _super); - function ContinueStatement(identifier) { - _super.call(this); - this.identifier = identifier; - } - ContinueStatement.prototype.kind = function () { - return 153 /* ContinueStatement */; - }; - - ContinueStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return ContinueStatement; - })(AST); - TypeScript.ContinueStatement = ContinueStatement; - - var ForStatement = (function (_super) { - __extends(ForStatement, _super); - function ForStatement(variableDeclaration, initializer, condition, incrementor, statement) { - _super.call(this); - this.variableDeclaration = variableDeclaration; - this.initializer = initializer; - this.condition = condition; - this.incrementor = incrementor; - this.statement = statement; - variableDeclaration && (variableDeclaration.parent = this); - initializer && (initializer.parent = this); - condition && (condition.parent = this); - incrementor && (incrementor.parent = this); - statement && (statement.parent = this); - } - ForStatement.prototype.kind = function () { - return 154 /* ForStatement */; - }; - - ForStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.initializer, ast.initializer, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.incrementor, ast.incrementor, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ForStatement; - })(AST); - TypeScript.ForStatement = ForStatement; - - var ForInStatement = (function (_super) { - __extends(ForInStatement, _super); - function ForInStatement(variableDeclaration, left, expression, statement) { - _super.call(this); - this.variableDeclaration = variableDeclaration; - this.left = left; - this.expression = expression; - this.statement = statement; - variableDeclaration && (variableDeclaration.parent = this); - left && (left.parent = this); - expression && (expression.parent = this); - statement && (statement.parent = this); - } - ForInStatement.prototype.kind = function () { - return 155 /* ForInStatement */; - }; - - ForInStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.variableDeclaration, ast.variableDeclaration, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ForInStatement; - })(AST); - TypeScript.ForInStatement = ForInStatement; - - var WhileStatement = (function (_super) { - __extends(WhileStatement, _super); - function WhileStatement(condition, statement) { - _super.call(this); - this.condition = condition; - this.statement = statement; - condition && (condition.parent = this); - statement && (statement.parent = this); - } - WhileStatement.prototype.kind = function () { - return 158 /* WhileStatement */; - }; - - WhileStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return WhileStatement; - })(AST); - TypeScript.WhileStatement = WhileStatement; - - var WithStatement = (function (_super) { - __extends(WithStatement, _super); - function WithStatement(condition, statement) { - _super.call(this); - this.condition = condition; - this.statement = statement; - condition && (condition.parent = this); - statement && (statement.parent = this); - } - WithStatement.prototype.kind = function () { - return 163 /* WithStatement */; - }; - - WithStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return WithStatement; - })(AST); - TypeScript.WithStatement = WithStatement; - - var EnumDeclaration = (function (_super) { - __extends(EnumDeclaration, _super); - function EnumDeclaration(modifiers, identifier, enumElements) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.enumElements = enumElements; - identifier && (identifier.parent = this); - enumElements && (enumElements.parent = this); - } - EnumDeclaration.prototype.kind = function () { - return 132 /* EnumDeclaration */; - }; - return EnumDeclaration; - })(AST); - TypeScript.EnumDeclaration = EnumDeclaration; - - var EnumElement = (function (_super) { - __extends(EnumElement, _super); - function EnumElement(propertyName, equalsValueClause) { - _super.call(this); - this.propertyName = propertyName; - this.equalsValueClause = equalsValueClause; - propertyName && (propertyName.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - EnumElement.prototype.kind = function () { - return 243 /* EnumElement */; - }; - return EnumElement; - })(AST); - TypeScript.EnumElement = EnumElement; - - var CastExpression = (function (_super) { - __extends(CastExpression, _super); - function CastExpression(type, expression) { - _super.call(this); - this.type = type; - this.expression = expression; - type && (type.parent = this); - expression && (expression.parent = this); - } - CastExpression.prototype.kind = function () { - return 220 /* CastExpression */; - }; - - CastExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.type, ast.type, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - CastExpression.prototype.isExpression = function () { - return true; - }; - return CastExpression; - })(AST); - TypeScript.CastExpression = CastExpression; - - var ObjectLiteralExpression = (function (_super) { - __extends(ObjectLiteralExpression, _super); - function ObjectLiteralExpression(propertyAssignments) { - _super.call(this); - this.propertyAssignments = propertyAssignments; - propertyAssignments && (propertyAssignments.parent = this); - } - ObjectLiteralExpression.prototype.kind = function () { - return 215 /* ObjectLiteralExpression */; - }; - - ObjectLiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.propertyAssignments, ast.propertyAssignments, includingPosition); - }; - - ObjectLiteralExpression.prototype.isExpression = function () { - return true; - }; - return ObjectLiteralExpression; - })(AST); - TypeScript.ObjectLiteralExpression = ObjectLiteralExpression; - - var SimplePropertyAssignment = (function (_super) { - __extends(SimplePropertyAssignment, _super); - function SimplePropertyAssignment(propertyName, expression) { - _super.call(this); - this.propertyName = propertyName; - this.expression = expression; - propertyName && (propertyName.parent = this); - expression && (expression.parent = this); - } - SimplePropertyAssignment.prototype.kind = function () { - return 240 /* SimplePropertyAssignment */; - }; - return SimplePropertyAssignment; - })(AST); - TypeScript.SimplePropertyAssignment = SimplePropertyAssignment; - - var FunctionPropertyAssignment = (function (_super) { - __extends(FunctionPropertyAssignment, _super); - function FunctionPropertyAssignment(propertyName, callSignature, block) { - _super.call(this); - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionPropertyAssignment.prototype.kind = function () { - return 241 /* FunctionPropertyAssignment */; - }; - return FunctionPropertyAssignment; - })(AST); - TypeScript.FunctionPropertyAssignment = FunctionPropertyAssignment; - - var FunctionExpression = (function (_super) { - __extends(FunctionExpression, _super); - function FunctionExpression(identifier, callSignature, block) { - _super.call(this); - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - identifier && (identifier.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionExpression.prototype.kind = function () { - return 222 /* FunctionExpression */; - }; - - FunctionExpression.prototype.isExpression = function () { - return true; - }; - return FunctionExpression; - })(AST); - TypeScript.FunctionExpression = FunctionExpression; - - var EmptyStatement = (function (_super) { - __extends(EmptyStatement, _super); - function EmptyStatement() { - _super.apply(this, arguments); - } - EmptyStatement.prototype.kind = function () { - return 156 /* EmptyStatement */; - }; - - EmptyStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return EmptyStatement; - })(AST); - TypeScript.EmptyStatement = EmptyStatement; - - var TryStatement = (function (_super) { - __extends(TryStatement, _super); - function TryStatement(block, catchClause, finallyClause) { - _super.call(this); - this.block = block; - this.catchClause = catchClause; - this.finallyClause = finallyClause; - block && (block.parent = this); - catchClause && (catchClause.parent = this); - finallyClause && (finallyClause.parent = this); - } - TryStatement.prototype.kind = function () { - return 159 /* TryStatement */; - }; - - TryStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.block, ast.block, includingPosition) && structuralEquals(this.catchClause, ast.catchClause, includingPosition) && structuralEquals(this.finallyClause, ast.finallyClause, includingPosition); - }; - return TryStatement; - })(AST); - TypeScript.TryStatement = TryStatement; - - var CatchClause = (function (_super) { - __extends(CatchClause, _super); - function CatchClause(identifier, typeAnnotation, block) { - _super.call(this); - this.identifier = identifier; - this.typeAnnotation = typeAnnotation; - this.block = block; - identifier && (identifier.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - block && (block.parent = this); - } - CatchClause.prototype.kind = function () { - return 236 /* CatchClause */; - }; - - CatchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.typeAnnotation, ast.typeAnnotation, includingPosition) && structuralEquals(this.block, ast.block, includingPosition); - }; - return CatchClause; - })(AST); - TypeScript.CatchClause = CatchClause; - - var FinallyClause = (function (_super) { - __extends(FinallyClause, _super); - function FinallyClause(block) { - _super.call(this); - this.block = block; - block && (block.parent = this); - } - FinallyClause.prototype.kind = function () { - return 237 /* FinallyClause */; - }; - - FinallyClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.block, ast.block, includingPosition); - }; - return FinallyClause; - })(AST); - TypeScript.FinallyClause = FinallyClause; - - var LabeledStatement = (function (_super) { - __extends(LabeledStatement, _super); - function LabeledStatement(identifier, statement) { - _super.call(this); - this.identifier = identifier; - this.statement = statement; - identifier && (identifier.parent = this); - statement && (statement.parent = this); - } - LabeledStatement.prototype.kind = function () { - return 160 /* LabeledStatement */; - }; - - LabeledStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return LabeledStatement; - })(AST); - TypeScript.LabeledStatement = LabeledStatement; - - var DoStatement = (function (_super) { - __extends(DoStatement, _super); - function DoStatement(statement, whileKeyword, condition) { - _super.call(this); - this.statement = statement; - this.whileKeyword = whileKeyword; - this.condition = condition; - statement && (statement.parent = this); - condition && (condition.parent = this); - } - DoStatement.prototype.kind = function () { - return 161 /* DoStatement */; - }; - - DoStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition); - }; - return DoStatement; - })(AST); - TypeScript.DoStatement = DoStatement; - - var TypeOfExpression = (function (_super) { - __extends(TypeOfExpression, _super); - function TypeOfExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - TypeOfExpression.prototype.kind = function () { - return 171 /* TypeOfExpression */; - }; - - TypeOfExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - TypeOfExpression.prototype.isExpression = function () { - return true; - }; - return TypeOfExpression; - })(AST); - TypeScript.TypeOfExpression = TypeOfExpression; - - var DeleteExpression = (function (_super) { - __extends(DeleteExpression, _super); - function DeleteExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - DeleteExpression.prototype.kind = function () { - return 170 /* DeleteExpression */; - }; - - DeleteExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - DeleteExpression.prototype.isExpression = function () { - return true; - }; - return DeleteExpression; - })(AST); - TypeScript.DeleteExpression = DeleteExpression; - - var VoidExpression = (function (_super) { - __extends(VoidExpression, _super); - function VoidExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - VoidExpression.prototype.kind = function () { - return 172 /* VoidExpression */; - }; - - VoidExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - VoidExpression.prototype.isExpression = function () { - return true; - }; - return VoidExpression; - })(AST); - TypeScript.VoidExpression = VoidExpression; - - var DebuggerStatement = (function (_super) { - __extends(DebuggerStatement, _super); - function DebuggerStatement() { - _super.apply(this, arguments); - } - DebuggerStatement.prototype.kind = function () { - return 162 /* DebuggerStatement */; - }; - return DebuggerStatement; - })(AST); - TypeScript.DebuggerStatement = DebuggerStatement; - - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - - Comment.prototype.end = function () { - return this._end; - }; - - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (IOUtils) { - function createDirectoryStructure(ioHost, dirName) { - if (ioHost.directoryExists(dirName)) { - return; - } - - var parentDirectory = ioHost.dirName(dirName); - if (parentDirectory != "") { - createDirectoryStructure(ioHost, parentDirectory); - } - ioHost.createDirectory(dirName); - } - - function writeFileAndFolderStructure(ioHost, fileName, contents, writeByteOrderMark) { - var start = new Date().getTime(); - var path = ioHost.resolvePath(fileName); - TypeScript.ioHostResolvePathTime += new Date().getTime() - start; - - var start = new Date().getTime(); - var dirName = ioHost.dirName(path); - TypeScript.ioHostDirectoryNameTime += new Date().getTime() - start; - - var start = new Date().getTime(); - createDirectoryStructure(ioHost, dirName); - TypeScript.ioHostCreateDirectoryStructureTime += new Date().getTime() - start; - - var start = new Date().getTime(); - ioHost.writeFile(path, contents, writeByteOrderMark); - TypeScript.ioHostWriteFileTime += new Date().getTime() - start; - } - IOUtils.writeFileAndFolderStructure = writeFileAndFolderStructure; - - function throwIOError(message, error) { - var errorMessage = message; - if (error && error.message) { - errorMessage += (" " + error.message); - } - throw new Error(errorMessage); - } - IOUtils.throwIOError = throwIOError; - - function combine(prefix, suffix) { - return prefix + "/" + suffix; - } - IOUtils.combine = combine; - - var BufferedTextWriter = (function () { - function BufferedTextWriter(writer, capacity) { - if (typeof capacity === "undefined") { capacity = 1024; } - this.writer = writer; - this.capacity = capacity; - this.buffer = ""; - } - BufferedTextWriter.prototype.Write = function (str) { - this.buffer += str; - if (this.buffer.length >= this.capacity) { - this.writer.Write(this.buffer); - this.buffer = ""; - } - }; - BufferedTextWriter.prototype.WriteLine = function (str) { - this.Write(str + '\r\n'); - }; - BufferedTextWriter.prototype.Close = function () { - this.writer.Write(this.buffer); - this.writer.Close(); - this.buffer = null; - }; - return BufferedTextWriter; - })(); - IOUtils.BufferedTextWriter = BufferedTextWriter; - })(TypeScript.IOUtils || (TypeScript.IOUtils = {})); - var IOUtils = TypeScript.IOUtils; - - TypeScript.IO = (function () { - function getWindowsScriptHostIO() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var streamObjectPool = []; - - function getStreamObject() { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - appendFile: function (path, content) { - var txtFile = fso.OpenTextFile(path, 8, true); - txtFile.Write(content); - txtFile.Close(); - }, - readFile: function (path, codepage) { - return TypeScript.Environment.readFile(path, codepage); - }, - writeFile: function (path, contents, writeByteOrderMark) { - TypeScript.Environment.writeFile(path, contents, writeByteOrderMark); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - dirName: function (path) { - return fso.GetParentFolderName(path); - }, - findFile: function (rootPath, partialFilePath) { - var path = fso.GetAbsolutePathName(rootPath) + "/" + partialFilePath; - - while (true) { - if (fso.FileExists(path)) { - return { fileInformation: this.readFile(path), path: path }; - } else { - rootPath = fso.GetParentFolderName(fso.GetAbsolutePathName(rootPath)); - - if (rootPath == "") { - return null; - } else { - path = fso.BuildPath(rootPath, partialFilePath); - } - } - } - }, - deleteFile: function (path) { - try { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - } catch (e) { - IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_delete_file_0, [path]), e); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - fso.CreateFolder(path); - } - } catch (e) { - IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_create_directory_0, [path]), e); - } - }, - dir: function (path, spec, options) { - options = options || {}; - function filesInFolder(folder, root) { - var paths = []; - var fc; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "/" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd(); fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "/" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - print: function (str) { - WScript.StdOut.Write(str); - }, - printLine: function (str) { - WScript.Echo(str); - }, - arguments: args, - stderr: WScript.StdErr, - stdout: WScript.StdOut, - watchFile: null, - run: function (source, fileName) { - try { - eval(source); - } catch (e) { - IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Error_while_executing_file_0, [fileName]), e); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - quit: function (exitCode) { - if (typeof exitCode === "undefined") { exitCode = 0; } - try { - WScript.Quit(exitCode); - } catch (e) { - } - } - }; - } - ; - - function getNodeIO() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - - return { - appendFile: function (path, content) { - _fs.appendFileSync(path, content); - }, - readFile: function (file, codepage) { - return TypeScript.Environment.readFile(file, codepage); - }, - writeFile: function (path, contents, writeByteOrderMark) { - TypeScript.Environment.writeFile(path, contents, writeByteOrderMark); - }, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_delete_file_0, [path]), e); - } - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - dir: function dir(path, spec, options) { - options = options || {}; - - function filesInFolder(folder) { - var paths = []; - - try { - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "/" + files[i])); - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - } catch (err) { - } - - return paths; - } - - return filesInFolder(path); - }, - createDirectory: function (path) { - try { - if (!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - } catch (e) { - IOUtils.throwIOError(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_create_directory_0, [path]), e); - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - dirName: function (path) { - var dirPath = _path.dirname(path); - - if (dirPath === path) { - dirPath = null; - } - - return dirPath; - }, - findFile: function (rootPath, partialFilePath) { - var path = rootPath + "/" + partialFilePath; - - while (true) { - if (_fs.existsSync(path)) { - return { fileInformation: this.readFile(path), path: path }; - } else { - var parentPath = _path.resolve(rootPath, ".."); - - if (rootPath === parentPath) { - return null; - } else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }, - print: function (str) { - process.stdout.write(str); - }, - printLine: function (str) { - process.stdout.write(str + '\n'); - }, - arguments: process.argv.slice(2), - stderr: { - Write: function (str) { - process.stderr.write(str); - }, - WriteLine: function (str) { - process.stderr.write(str + '\n'); - }, - Close: function () { - } - }, - stdout: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - }, - watchFile: function (fileName, callback) { - var firstRun = true; - var processingChange = false; - - var fileChanged = function (curr, prev) { - if (!firstRun) { - if (curr.mtime < prev.mtime) { - return; - } - - _fs.unwatchFile(fileName, fileChanged); - if (!processingChange) { - processingChange = true; - callback(fileName); - setTimeout(function () { - processingChange = false; - }, 100); - } - } - firstRun = false; - _fs.watchFile(fileName, { persistent: true, interval: 500 }, fileChanged); - }; - - fileChanged(); - return { - fileName: fileName, - close: function () { - _fs.unwatchFile(fileName, fileChanged); - } - }; - }, - run: function (source, fileName) { - require.main.fileName = fileName; - require.main.paths = _module._nodeModulePaths(_path.dirname(_fs.realpathSync(fileName))); - require.main._compile(source, fileName); - }, - getExecutingFilePath: function () { - return process.mainModule.filename; - }, - quit: function (code) { - var stderrFlushed = process.stderr.write(''); - var stdoutFlushed = process.stdout.write(''); - process.stderr.on('drain', function () { - stderrFlushed = true; - if (stdoutFlushed) { - process.exit(code); - } - }); - process.stdout.on('drain', function () { - stdoutFlushed = true; - if (stderrFlushed) { - process.exit(code); - } - }); - setTimeout(function () { - process.exit(code); - }, 5); - } - }; - } - ; - - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") - return getWindowsScriptHostIO(); - else if (typeof module !== 'undefined' && module.exports) - return getNodeIO(); - else - return null; - })(); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var OptionsParser = (function () { - function OptionsParser(host, version) { - this.host = host; - this.version = version; - this.DEFAULT_SHORT_FLAG = "-"; - this.DEFAULT_LONG_FLAG = "--"; - this.printedVersion = false; - this.unnamed = []; - this.options = []; - } - OptionsParser.prototype.findOption = function (arg) { - var upperCaseArg = arg && arg.toUpperCase(); - - for (var i = 0; i < this.options.length; i++) { - var current = this.options[i]; - - if (upperCaseArg === (current.short && current.short.toUpperCase()) || upperCaseArg === (current.name && current.name.toUpperCase())) { - return current; - } - } - - return null; - }; - - OptionsParser.prototype.printUsage = function () { - this.printVersion(); - - var optionsWord = TypeScript.getLocalizedText(TypeScript.DiagnosticCode.options, null); - var fileWord = TypeScript.getLocalizedText(TypeScript.DiagnosticCode.file1, null); - var tscSyntax = "tsc [" + optionsWord + "] [" + fileWord + " ..]"; - var syntaxHelp = TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Syntax_0, [tscSyntax]); - this.host.printLine(syntaxHelp); - this.host.printLine(""); - this.host.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Examples, null) + " tsc hello.ts"); - this.host.printLine(" tsc --out foo.js foo.ts"); - this.host.printLine(" tsc @args.txt"); - this.host.printLine(""); - this.host.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Options, null)); - - var output = []; - var maxLength = 0; - var i = 0; - - this.options = this.options.sort(function (a, b) { - var aName = a.name.toLowerCase(); - var bName = b.name.toLowerCase(); - - if (aName > bName) { - return 1; - } else if (aName < bName) { - return -1; - } else { - return 0; - } - }); - - for (i = 0; i < this.options.length; i++) { - var option = this.options[i]; - - if (option.experimental) { - continue; - } - - if (!option.usage) { - break; - } - - var usageString = " "; - var type = option.type ? (" " + TypeScript.getLocalizedText(option.type, null)) : ""; - - if (option.short) { - usageString += this.DEFAULT_SHORT_FLAG + option.short + type + ", "; - } - - usageString += this.DEFAULT_LONG_FLAG + option.name + type; - - output.push([usageString, TypeScript.getLocalizedText(option.usage.locCode, option.usage.args)]); - - if (usageString.length > maxLength) { - maxLength = usageString.length; - } - } - - var fileDescription = TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Insert_command_line_options_and_files_from_a_file, null); - output.push([" @<" + fileWord + ">", fileDescription]); - - for (i = 0; i < output.length; i++) { - this.host.printLine(output[i][0] + (new Array(maxLength - output[i][0].length + 3)).join(" ") + output[i][1]); - } - }; - - OptionsParser.prototype.printVersion = function () { - if (!this.printedVersion) { - this.host.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Version_0, [this.version])); - this.printedVersion = true; - } - }; - - OptionsParser.prototype.option = function (name, config, short) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = false; - - this.options.push(config); - }; - - OptionsParser.prototype.flag = function (name, config, short) { - if (!config) { - config = short; - short = null; - } - - config.name = name; - config.short = short; - config.flag = true; - - this.options.push(config); - }; - - OptionsParser.prototype.parseString = function (argString) { - var position = 0; - var tokens = argString.match(/\s+|"|[^\s"]+/g); - - function peek() { - return tokens[position]; - } - - function consume() { - return tokens[position++]; - } - - function consumeQuotedString() { - var value = ''; - consume(); - - var token = peek(); - - while (token && token !== '"') { - consume(); - - value += token; - - token = peek(); - } - - consume(); - - return value; - } - - var args = []; - var currentArg = ''; - - while (position < tokens.length) { - var token = peek(); - - if (token === '"') { - currentArg += consumeQuotedString(); - } else if (token.match(/\s/)) { - if (currentArg.length > 0) { - args.push(currentArg); - currentArg = ''; - } - - consume(); - } else { - consume(); - currentArg += token; - } - } - - if (currentArg.length > 0) { - args.push(currentArg); - } - - this.parse(args); - }; - - OptionsParser.prototype.parse = function (args) { - var position = 0; - - function consume() { - return args[position++]; - } - - while (position < args.length) { - var current = consume(); - var match = current.match(/^(--?|@)(.*)/); - var value = null; - - if (match) { - if (match[1] === '@') { - this.parseString(this.host.readFile(match[2], null).contents); - } else { - var arg = match[2]; - var option = this.findOption(arg); - - if (option === null) { - this.host.printLine(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unknown_option_0, [arg])); - this.host.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Use_the_0_flag_to_see_options, ["--help"])); - } else { - if (!option.flag) { - value = consume(); - if (value === undefined) { - this.host.printLine(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Option_0_specified_without_1, [arg, TypeScript.getLocalizedText(option.type, null)])); - this.host.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Use_the_0_flag_to_see_options, ["--help"])); - continue; - } - } - - option.set(value); - } - } - } else { - this.unnamed.push(current); - } - } - }; - return OptionsParser; - })(); - TypeScript.OptionsParser = OptionsParser; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SourceFile = (function () { - function SourceFile(scriptSnapshot, byteOrderMark) { - this.scriptSnapshot = scriptSnapshot; - this.byteOrderMark = byteOrderMark; - } - return SourceFile; - })(); - - var DiagnosticsLogger = (function () { - function DiagnosticsLogger(ioHost) { - this.ioHost = ioHost; - } - DiagnosticsLogger.prototype.information = function () { - return false; - }; - DiagnosticsLogger.prototype.debug = function () { - return false; - }; - DiagnosticsLogger.prototype.warning = function () { - return false; - }; - DiagnosticsLogger.prototype.error = function () { - return false; - }; - DiagnosticsLogger.prototype.fatal = function () { - return false; - }; - DiagnosticsLogger.prototype.log = function (s) { - this.ioHost.stdout.WriteLine(s); - }; - return DiagnosticsLogger; - })(); - - var FileLogger = (function () { - function FileLogger(ioHost) { - this.ioHost = ioHost; - var file = "tsc." + Date.now() + ".log"; - - this.fileName = this.ioHost.resolvePath(file); - } - FileLogger.prototype.information = function () { - return false; - }; - FileLogger.prototype.debug = function () { - return false; - }; - FileLogger.prototype.warning = function () { - return false; - }; - FileLogger.prototype.error = function () { - return false; - }; - FileLogger.prototype.fatal = function () { - return false; - }; - FileLogger.prototype.log = function (s) { - this.ioHost.appendFile(this.fileName, s + '\r\n'); - }; - return FileLogger; - })(); - - var BatchCompiler = (function () { - function BatchCompiler(ioHost) { - this.ioHost = ioHost; - this.compilerVersion = "0.9.7.0"; - this.inputFiles = []; - this.resolvedFiles = []; - this.fileNameToSourceFile = new TypeScript.StringHashTable(); - this.hasErrors = false; - this.logger = null; - this.fileExistsCache = TypeScript.createIntrinsicsObject(); - this.resolvePathCache = TypeScript.createIntrinsicsObject(); - } - BatchCompiler.prototype.batchCompile = function () { - var _this = this; - var start = new Date().getTime(); - - TypeScript.CompilerDiagnostics.diagnosticWriter = { Alert: function (s) { - _this.ioHost.printLine(s); - } }; - - if (this.parseOptions()) { - if (this.compilationSettings.createFileLog()) { - this.logger = new FileLogger(this.ioHost); - } else if (this.compilationSettings.gatherDiagnostics()) { - this.logger = new DiagnosticsLogger(this.ioHost); - } else { - this.logger = new TypeScript.NullLogger(); - } - - if (this.compilationSettings.watch()) { - this.watchFiles(); - return; - } - - this.resolve(); - - this.compile(); - - if (this.compilationSettings.createFileLog()) { - this.logger.log("Compilation settings:"); - this.logger.log(" propagateEnumConstants " + this.compilationSettings.propagateEnumConstants()); - this.logger.log(" removeComments " + this.compilationSettings.removeComments()); - this.logger.log(" watch " + this.compilationSettings.watch()); - this.logger.log(" noResolve " + this.compilationSettings.noResolve()); - this.logger.log(" noImplicitAny " + this.compilationSettings.noImplicitAny()); - this.logger.log(" nolib " + this.compilationSettings.noLib()); - this.logger.log(" target " + this.compilationSettings.codeGenTarget()); - this.logger.log(" module " + this.compilationSettings.moduleGenTarget()); - this.logger.log(" out " + this.compilationSettings.outFileOption()); - this.logger.log(" outDir " + this.compilationSettings.outDirOption()); - this.logger.log(" sourcemap " + this.compilationSettings.mapSourceFiles()); - this.logger.log(" mapRoot " + this.compilationSettings.mapRoot()); - this.logger.log(" sourceroot " + this.compilationSettings.sourceRoot()); - this.logger.log(" declaration " + this.compilationSettings.generateDeclarationFiles()); - this.logger.log(" useCaseSensitiveFileResolution " + this.compilationSettings.useCaseSensitiveFileResolution()); - this.logger.log(" diagnostics " + this.compilationSettings.gatherDiagnostics()); - this.logger.log(" codepage " + this.compilationSettings.codepage()); - - this.logger.log(""); - - this.logger.log("Input files:"); - this.inputFiles.forEach(function (file) { - _this.logger.log(" " + file); - }); - - this.logger.log(""); - - this.logger.log("Resolved Files:"); - this.resolvedFiles.forEach(function (file) { - file.importedFiles.forEach(function (file) { - _this.logger.log(" " + file); - }); - file.referencedFiles.forEach(function (file) { - _this.logger.log(" " + file); - }); - }); - } - - if (this.compilationSettings.gatherDiagnostics()) { - this.logger.log(""); - this.logger.log("File resolution time: " + TypeScript.fileResolutionTime); - this.logger.log(" file read: " + TypeScript.fileResolutionIOTime); - this.logger.log(" scan imports: " + TypeScript.fileResolutionScanImportsTime); - this.logger.log(" import search: " + TypeScript.fileResolutionImportFileSearchTime); - this.logger.log(" get lib.d.ts: " + TypeScript.fileResolutionGetDefaultLibraryTime); - - this.logger.log("SyntaxTree parse time: " + TypeScript.syntaxTreeParseTime); - this.logger.log("Syntax Diagnostics time: " + TypeScript.syntaxDiagnosticsTime); - this.logger.log("AST translation time: " + TypeScript.astTranslationTime); - this.logger.log(""); - this.logger.log("Type check time: " + TypeScript.typeCheckTime); - this.logger.log(""); - this.logger.log("Emit time: " + TypeScript.emitTime); - this.logger.log("Declaration emit time: " + TypeScript.declarationEmitTime); - - this.logger.log("Total number of symbols created: " + TypeScript.pullSymbolID); - this.logger.log("Specialized types created: " + TypeScript.nSpecializationsCreated); - this.logger.log("Specialized signatures created: " + TypeScript.nSpecializedSignaturesCreated); - - this.logger.log(" IsExternallyVisibleTime: " + TypeScript.declarationEmitIsExternallyVisibleTime); - this.logger.log(" TypeSignatureTime: " + TypeScript.declarationEmitTypeSignatureTime); - this.logger.log(" GetBoundDeclTypeTime: " + TypeScript.declarationEmitGetBoundDeclTypeTime); - this.logger.log(" IsOverloadedCallSignatureTime: " + TypeScript.declarationEmitIsOverloadedCallSignatureTime); - this.logger.log(" FunctionDeclarationGetSymbolTime: " + TypeScript.declarationEmitFunctionDeclarationGetSymbolTime); - this.logger.log(" GetBaseTypeTime: " + TypeScript.declarationEmitGetBaseTypeTime); - this.logger.log(" GetAccessorFunctionTime: " + TypeScript.declarationEmitGetAccessorFunctionTime); - this.logger.log(" GetTypeParameterSymbolTime: " + TypeScript.declarationEmitGetTypeParameterSymbolTime); - this.logger.log(" GetImportDeclarationSymbolTime: " + TypeScript.declarationEmitGetImportDeclarationSymbolTime); - - this.logger.log("Emit write file time: " + TypeScript.emitWriteFileTime); - - this.logger.log("Compiler resolve path time: " + TypeScript.compilerResolvePathTime); - this.logger.log("Compiler directory name time: " + TypeScript.compilerDirectoryNameTime); - this.logger.log("Compiler directory exists time: " + TypeScript.compilerDirectoryExistsTime); - this.logger.log("Compiler file exists time: " + TypeScript.compilerFileExistsTime); - - this.logger.log("IO host resolve path time: " + TypeScript.ioHostResolvePathTime); - this.logger.log("IO host directory name time: " + TypeScript.ioHostDirectoryNameTime); - this.logger.log("IO host create directory structure time: " + TypeScript.ioHostCreateDirectoryStructureTime); - this.logger.log("IO host write file time: " + TypeScript.ioHostWriteFileTime); - - this.logger.log("Node make directory time: " + TypeScript.nodeMakeDirectoryTime); - this.logger.log("Node writeFileSync time: " + TypeScript.nodeWriteFileSyncTime); - this.logger.log("Node createBuffer time: " + TypeScript.nodeCreateBufferTime); - } - } - - this.ioHost.quit(this.hasErrors ? 1 : 0); - }; - - BatchCompiler.prototype.resolve = function () { - var _this = this; - var includeDefaultLibrary = !this.compilationSettings.noLib(); - var resolvedFiles = []; - - var start = new Date().getTime(); - - if (!this.compilationSettings.noResolve()) { - var resolutionResults = TypeScript.ReferenceResolver.resolve(this.inputFiles, this, this.compilationSettings.useCaseSensitiveFileResolution()); - resolvedFiles = resolutionResults.resolvedFiles; - - includeDefaultLibrary = !this.compilationSettings.noLib() && !resolutionResults.seenNoDefaultLibTag; - - resolutionResults.diagnostics.forEach(function (d) { - return _this.addDiagnostic(d); - }); - } else { - for (var i = 0, n = this.inputFiles.length; i < n; i++) { - var inputFile = this.inputFiles[i]; - var referencedFiles = []; - var importedFiles = []; - - if (this.compilationSettings.generateDeclarationFiles()) { - var references = TypeScript.getReferencedFiles(inputFile, this.getScriptSnapshot(inputFile)); - for (var j = 0; j < references.length; j++) { - referencedFiles.push(references[j].path); - } - - inputFile = this.resolvePath(inputFile); - } - - resolvedFiles.push({ - path: inputFile, - referencedFiles: referencedFiles, - importedFiles: importedFiles - }); - } - } - - var defaultLibStart = new Date().getTime(); - if (includeDefaultLibrary) { - var libraryResolvedFile = { - path: this.getDefaultLibraryFilePath(), - referencedFiles: [], - importedFiles: [] - }; - - resolvedFiles = [libraryResolvedFile].concat(resolvedFiles); - } - TypeScript.fileResolutionGetDefaultLibraryTime += new Date().getTime() - defaultLibStart; - - this.resolvedFiles = resolvedFiles; - - TypeScript.fileResolutionTime = new Date().getTime() - start; - }; - - BatchCompiler.prototype.compile = function () { - var _this = this; - var compiler = new TypeScript.TypeScriptCompiler(this.logger, this.compilationSettings); - - this.resolvedFiles.forEach(function (resolvedFile) { - var sourceFile = _this.getSourceFile(resolvedFile.path); - compiler.addFile(resolvedFile.path, sourceFile.scriptSnapshot, sourceFile.byteOrderMark, 0, false, resolvedFile.referencedFiles); - }); - - for (var it = compiler.compile(function (path) { - return _this.resolvePath(path); - }); it.moveNext();) { - var result = it.current(); - - result.diagnostics.forEach(function (d) { - return _this.addDiagnostic(d); - }); - if (!this.tryWriteOutputFiles(result.outputFiles)) { - return; - } - } - }; - - BatchCompiler.prototype.parseOptions = function () { - var _this = this; - var opts = new TypeScript.OptionsParser(this.ioHost, this.compilerVersion); - - var mutableSettings = new TypeScript.CompilationSettings(); - opts.option('out', { - usage: { - locCode: TypeScript.DiagnosticCode.Concatenate_and_emit_output_to_single_file, - args: null - }, - type: TypeScript.DiagnosticCode.file2, - set: function (str) { - mutableSettings.outFileOption = str; - } - }); - - opts.option('outDir', { - usage: { - locCode: TypeScript.DiagnosticCode.Redirect_output_structure_to_the_directory, - args: null - }, - type: TypeScript.DiagnosticCode.DIRECTORY, - set: function (str) { - mutableSettings.outDirOption = str; - } - }); - - opts.flag('sourcemap', { - usage: { - locCode: TypeScript.DiagnosticCode.Generates_corresponding_0_file, - args: ['.map'] - }, - set: function () { - mutableSettings.mapSourceFiles = true; - } - }); - - opts.option('mapRoot', { - usage: { - locCode: TypeScript.DiagnosticCode.Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - args: null - }, - type: TypeScript.DiagnosticCode.LOCATION, - set: function (str) { - mutableSettings.mapRoot = str; - } - }); - - opts.option('sourceRoot', { - usage: { - locCode: TypeScript.DiagnosticCode.Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - args: null - }, - type: TypeScript.DiagnosticCode.LOCATION, - set: function (str) { - mutableSettings.sourceRoot = str; - } - }); - - opts.flag('declaration', { - usage: { - locCode: TypeScript.DiagnosticCode.Generates_corresponding_0_file, - args: ['.d.ts'] - }, - set: function () { - mutableSettings.generateDeclarationFiles = true; - } - }, 'd'); - - if (this.ioHost.watchFile) { - opts.flag('watch', { - usage: { - locCode: TypeScript.DiagnosticCode.Watch_input_files, - args: null - }, - set: function () { - mutableSettings.watch = true; - } - }, 'w'); - } - - opts.flag('propagateEnumConstants', { - experimental: true, - set: function () { - mutableSettings.propagateEnumConstants = true; - } - }); - - opts.flag('removeComments', { - usage: { - locCode: TypeScript.DiagnosticCode.Do_not_emit_comments_to_output, - args: null - }, - set: function () { - mutableSettings.removeComments = true; - } - }); - - opts.flag('noResolve', { - experimental: true, - usage: { - locCode: TypeScript.DiagnosticCode.Skip_resolution_and_preprocessing, - args: null - }, - set: function () { - mutableSettings.noResolve = true; - } - }); - - opts.flag('noLib', { - experimental: true, - set: function () { - mutableSettings.noLib = true; - } - }); - - opts.flag('diagnostics', { - experimental: true, - set: function () { - mutableSettings.gatherDiagnostics = true; - } - }); - - opts.flag('logFile', { - experimental: true, - set: function () { - mutableSettings.createFileLog = true; - } - }); - - opts.option('target', { - usage: { - locCode: TypeScript.DiagnosticCode.Specify_ECMAScript_target_version_0_default_or_1, - args: ['ES3', 'ES5'] - }, - type: TypeScript.DiagnosticCode.VERSION, - set: function (type) { - type = type.toLowerCase(); - - if (type === 'es3') { - mutableSettings.codeGenTarget = 0 /* EcmaScript3 */; - } else if (type === 'es5') { - mutableSettings.codeGenTarget = 1 /* EcmaScript5 */; - } else { - _this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2, [type, "ES3", "ES5"])); - } - } - }, 't'); - - opts.option('module', { - usage: { - locCode: TypeScript.DiagnosticCode.Specify_module_code_generation_0_or_1, - args: ['commonjs', 'amd'] - }, - type: TypeScript.DiagnosticCode.KIND, - set: function (type) { - type = type.toLowerCase(); - - if (type === 'commonjs') { - mutableSettings.moduleGenTarget = 1 /* Synchronous */; - } else if (type === 'amd') { - mutableSettings.moduleGenTarget = 2 /* Asynchronous */; - } else { - _this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Module_code_generation_0_not_supported, [type])); - } - } - }, 'm'); - - var needsHelp = false; - opts.flag('help', { - usage: { - locCode: TypeScript.DiagnosticCode.Print_this_message, - args: null - }, - set: function () { - needsHelp = true; - } - }, 'h'); - - opts.flag('useCaseSensitiveFileResolution', { - experimental: true, - set: function () { - mutableSettings.useCaseSensitiveFileResolution = true; - } - }); - var shouldPrintVersionOnly = false; - opts.flag('version', { - usage: { - locCode: TypeScript.DiagnosticCode.Print_the_compiler_s_version_0, - args: [this.compilerVersion] - }, - set: function () { - shouldPrintVersionOnly = true; - } - }, 'v'); - - var locale = null; - opts.option('locale', { - experimental: true, - usage: { - locCode: TypeScript.DiagnosticCode.Specify_locale_for_errors_and_messages_For_example_0_or_1, - args: ['en', 'ja-jp'] - }, - type: TypeScript.DiagnosticCode.STRING, - set: function (value) { - locale = value; - } - }); - - opts.flag('noImplicitAny', { - usage: { - locCode: TypeScript.DiagnosticCode.Warn_on_expressions_and_declarations_with_an_implied_any_type, - args: null - }, - set: function () { - mutableSettings.noImplicitAny = true; - } - }); - - if (TypeScript.Environment.supportsCodePage()) { - opts.option('codepage', { - usage: { - locCode: TypeScript.DiagnosticCode.Specify_the_codepage_to_use_when_opening_source_files, - args: null - }, - type: TypeScript.DiagnosticCode.NUMBER, - set: function (arg) { - mutableSettings.codepage = parseInt(arg, 10); - } - }); - } - - opts.parse(this.ioHost.arguments); - - this.compilationSettings = TypeScript.ImmutableCompilationSettings.fromCompilationSettings(mutableSettings); - - if (locale) { - if (!this.setLocale(locale)) { - return false; - } - } - - this.inputFiles.push.apply(this.inputFiles, opts.unnamed); - - if (shouldPrintVersionOnly) { - opts.printVersion(); - return false; - } else if (this.inputFiles.length === 0 || needsHelp) { - opts.printUsage(); - return false; - } - - return !this.hasErrors; - }; - - BatchCompiler.prototype.setLocale = function (locale) { - var matchResult = /^([a-z]+)([_\-]([a-z]+))?$/.exec(locale.toLowerCase()); - if (!matchResult) { - this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1, ['en', 'ja-jp'])); - return false; - } - - var language = matchResult[1]; - var territory = matchResult[3]; - - if (!this.setLanguageAndTerritory(language, territory) && !this.setLanguageAndTerritory(language, null)) { - this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Unsupported_locale_0, [locale])); - return false; - } - - return true; - }; - - BatchCompiler.prototype.setLanguageAndTerritory = function (language, territory) { - var compilerFilePath = this.ioHost.getExecutingFilePath(); - var containingDirectoryPath = this.ioHost.dirName(compilerFilePath); - - var filePath = TypeScript.IOUtils.combine(containingDirectoryPath, language); - if (territory) { - filePath = filePath + "-" + territory; - } - - filePath = this.resolvePath(TypeScript.IOUtils.combine(filePath, "diagnosticMessages.generated.json")); - - if (!this.fileExists(filePath)) { - return false; - } - - var fileContents = this.ioHost.readFile(filePath, this.compilationSettings.codepage()); - TypeScript.LocalizedDiagnosticMessages = JSON.parse(fileContents.contents); - return true; - }; - - BatchCompiler.prototype.watchFiles = function () { - var _this = this; - if (!this.ioHost.watchFile) { - this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Current_host_does_not_support_0_option, ['-w[atch]'])); - return; - } - - var lastResolvedFileSet = []; - var watchers = {}; - var firstTime = true; - - var addWatcher = function (fileName) { - if (!watchers[fileName]) { - var watcher = _this.ioHost.watchFile(fileName, onWatchedFileChange); - watchers[fileName] = watcher; - } else { - TypeScript.CompilerDiagnostics.debugPrint("Cannot watch file, it is already watched."); - } - }; - - var removeWatcher = function (fileName) { - if (watchers[fileName]) { - watchers[fileName].close(); - delete watchers[fileName]; - } else { - TypeScript.CompilerDiagnostics.debugPrint("Cannot stop watching file, it is not being watched."); - } - }; - - var onWatchedFileChange = function () { - _this.hasErrors = false; - - _this.fileNameToSourceFile = new TypeScript.StringHashTable(); - - _this.resolve(); - - var oldFiles = lastResolvedFileSet; - var newFiles = _this.resolvedFiles.map(function (resolvedFile) { - return resolvedFile.path; - }).sort(); - - var i = 0, j = 0; - while (i < oldFiles.length && j < newFiles.length) { - var compareResult = oldFiles[i].localeCompare(newFiles[j]); - if (compareResult === 0) { - i++; - j++; - } else if (compareResult < 0) { - removeWatcher(oldFiles[i]); - i++; - } else { - addWatcher(newFiles[j]); - j++; - } - } - - for (var k = i; k < oldFiles.length; k++) { - removeWatcher(oldFiles[k]); - } - - for (k = j; k < newFiles.length; k++) { - addWatcher(newFiles[k]); - } - - lastResolvedFileSet = newFiles; - - if (!firstTime) { - var fileNames = ""; - for (var k = 0; k < lastResolvedFileSet.length; k++) { - fileNames += TypeScript.Environment.newLine + " " + lastResolvedFileSet[k]; - } - _this.ioHost.printLine(TypeScript.getLocalizedText(TypeScript.DiagnosticCode.NL_Recompiling_0, [fileNames])); - } else { - firstTime = false; - } - - _this.compile(); - }; - - this.ioHost.stderr = this.ioHost.stdout; - - onWatchedFileChange(); - }; - - BatchCompiler.prototype.getSourceFile = function (fileName) { - var sourceFile = this.fileNameToSourceFile.lookup(fileName); - if (!sourceFile) { - var fileInformation; - - try { - fileInformation = this.ioHost.readFile(fileName, this.compilationSettings.codepage()); - } catch (e) { - this.addDiagnostic(new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Cannot_read_file_0_1, [fileName, e.message])); - fileInformation = new TypeScript.FileInformation("", 0 /* None */); - } - - var snapshot = TypeScript.ScriptSnapshot.fromString(fileInformation.contents); - var sourceFile = new SourceFile(snapshot, fileInformation.byteOrderMark); - this.fileNameToSourceFile.add(fileName, sourceFile); - } - - return sourceFile; - }; - - BatchCompiler.prototype.getDefaultLibraryFilePath = function () { - var compilerFilePath = this.ioHost.getExecutingFilePath(); - var containingDirectoryPath = this.ioHost.dirName(compilerFilePath); - var libraryFilePath = this.resolvePath(TypeScript.IOUtils.combine(containingDirectoryPath, "lib.d.ts")); - - return libraryFilePath; - }; - - BatchCompiler.prototype.getScriptSnapshot = function (fileName) { - return this.getSourceFile(fileName).scriptSnapshot; - }; - - BatchCompiler.prototype.resolveRelativePath = function (path, directory) { - var start = new Date().getTime(); - - var unQuotedPath = TypeScript.stripStartAndEndQuotes(path); - var normalizedPath; - - if (TypeScript.isRooted(unQuotedPath) || !directory) { - normalizedPath = unQuotedPath; - } else { - normalizedPath = TypeScript.IOUtils.combine(directory, unQuotedPath); - } - - normalizedPath = this.resolvePath(normalizedPath); - - normalizedPath = TypeScript.switchToForwardSlashes(normalizedPath); - - return normalizedPath; - }; - - BatchCompiler.prototype.fileExists = function (path) { - var exists = this.fileExistsCache[path]; - if (exists === undefined) { - var start = new Date().getTime(); - exists = this.ioHost.fileExists(path); - this.fileExistsCache[path] = exists; - TypeScript.compilerFileExistsTime += new Date().getTime() - start; - } - - return exists; - }; - - BatchCompiler.prototype.getParentDirectory = function (path) { - var start = new Date().getTime(); - var result = this.ioHost.dirName(path); - TypeScript.compilerDirectoryNameTime += new Date().getTime() - start; - - return result; - }; - - BatchCompiler.prototype.addDiagnostic = function (diagnostic) { - var diagnosticInfo = diagnostic.info(); - if (diagnosticInfo.category === 1 /* Error */) { - this.hasErrors = true; - } - - this.ioHost.stderr.Write(TypeScript.TypeScriptCompiler.getFullDiagnosticText(diagnostic)); - }; - - BatchCompiler.prototype.tryWriteOutputFiles = function (outputFiles) { - for (var i = 0, n = outputFiles.length; i < n; i++) { - var outputFile = outputFiles[i]; - - try { - this.writeFile(outputFile.name, outputFile.text, outputFile.writeByteOrderMark); - } catch (e) { - this.addDiagnostic(new TypeScript.Diagnostic(outputFile.name, null, 0, 0, TypeScript.DiagnosticCode.Emit_Error_0, [e.message])); - return false; - } - } - - return true; - }; - - BatchCompiler.prototype.writeFile = function (fileName, contents, writeByteOrderMark) { - var start = new Date().getTime(); - TypeScript.IOUtils.writeFileAndFolderStructure(this.ioHost, fileName, contents, writeByteOrderMark); - TypeScript.emitWriteFileTime += new Date().getTime() - start; - }; - - BatchCompiler.prototype.directoryExists = function (path) { - var start = new Date().getTime(); - var result = this.ioHost.directoryExists(path); - TypeScript.compilerDirectoryExistsTime += new Date().getTime() - start; - return result; - }; - - BatchCompiler.prototype.resolvePath = function (path) { - var cachedValue = this.resolvePathCache[path]; - if (!cachedValue) { - var start = new Date().getTime(); - cachedValue = this.ioHost.resolvePath(path); - this.resolvePathCache[path] = cachedValue; - TypeScript.compilerResolvePathTime += new Date().getTime() - start; - } - - return cachedValue; - }; - return BatchCompiler; - })(); - TypeScript.BatchCompiler = BatchCompiler; - - var batch = new TypeScript.BatchCompiler(TypeScript.IO); - batch.batchCompile(); -})(TypeScript || (TypeScript = {})); diff --git a/node_modules/grunt-typescript/node_modules/typescript/bin/typescript.js b/node_modules/grunt-typescript/node_modules/typescript/bin/typescript.js deleted file mode 100644 index 29ed806..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/bin/typescript.js +++ /dev/null @@ -1,61380 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -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 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -var TypeScript; -(function (TypeScript) { - TypeScript.DiagnosticCode = { - error_TS_0_1: "error TS{0}: {1}", - warning_TS_0_1: "warning TS{0}: {1}", - Unrecognized_escape_sequence: "Unrecognized escape sequence.", - Unexpected_character_0: "Unexpected character {0}.", - Missing_close_quote_character: "Missing close quote character.", - Identifier_expected: "Identifier expected.", - _0_keyword_expected: "'{0}' keyword expected.", - _0_expected: "'{0}' expected.", - Identifier_expected_0_is_a_keyword: "Identifier expected; '{0}' is a keyword.", - Automatic_semicolon_insertion_not_allowed: "Automatic semicolon insertion not allowed.", - Unexpected_token_0_expected: "Unexpected token; '{0}' expected.", - Trailing_separator_not_allowed: "Trailing separator not allowed.", - AsteriskSlash_expected: "'*/' expected.", - public_or_private_modifier_must_precede_static: "'public' or 'private' modifier must precede 'static'.", - Unexpected_token: "Unexpected token.", - Catch_clause_parameter_cannot_have_a_type_annotation: "Catch clause parameter cannot have a type annotation.", - Rest_parameter_must_be_last_in_list: "Rest parameter must be last in list.", - Parameter_cannot_have_question_mark_and_initializer: "Parameter cannot have question mark and initializer.", - Required_parameter_cannot_follow_optional_parameter: "Required parameter cannot follow optional parameter.", - Index_signatures_cannot_have_rest_parameters: "Index signatures cannot have rest parameters.", - Index_signature_parameter_cannot_have_accessibility_modifiers: "Index signature parameter cannot have accessibility modifiers.", - Index_signature_parameter_cannot_have_a_question_mark: "Index signature parameter cannot have a question mark.", - Index_signature_parameter_cannot_have_an_initializer: "Index signature parameter cannot have an initializer.", - Index_signature_must_have_a_type_annotation: "Index signature must have a type annotation.", - Index_signature_parameter_must_have_a_type_annotation: "Index signature parameter must have a type annotation.", - Index_signature_parameter_type_must_be_string_or_number: "Index signature parameter type must be 'string' or 'number'.", - extends_clause_already_seen: "'extends' clause already seen.", - extends_clause_must_precede_implements_clause: "'extends' clause must precede 'implements' clause.", - Classes_can_only_extend_a_single_class: "Classes can only extend a single class.", - implements_clause_already_seen: "'implements' clause already seen.", - Accessibility_modifier_already_seen: "Accessibility modifier already seen.", - _0_modifier_must_precede_1_modifier: "'{0}' modifier must precede '{1}' modifier.", - _0_modifier_already_seen: "'{0}' modifier already seen.", - _0_modifier_cannot_appear_on_a_class_element: "'{0}' modifier cannot appear on a class element.", - Interface_declaration_cannot_have_implements_clause: "Interface declaration cannot have 'implements' clause.", - super_invocation_cannot_have_type_arguments: "'super' invocation cannot have type arguments.", - Only_ambient_modules_can_use_quoted_names: "Only ambient modules can use quoted names.", - Statements_are_not_allowed_in_ambient_contexts: "Statements are not allowed in ambient contexts.", - Implementations_are_not_allowed_in_ambient_contexts: "Implementations are not allowed in ambient contexts.", - declare_modifier_not_allowed_for_code_already_in_an_ambient_context: "'declare' modifier not allowed for code already in an ambient context.", - Initializers_are_not_allowed_in_ambient_contexts: "Initializers are not allowed in ambient contexts.", - Parameter_property_declarations_can_only_be_used_in_a_non_ambient_constructor_declaration: "Parameter property declarations can only be used in a non-ambient constructor declaration.", - Function_implementation_expected: "Function implementation expected.", - Constructor_implementation_expected: "Constructor implementation expected.", - Function_overload_name_must_be_0: "Function overload name must be '{0}'.", - _0_modifier_cannot_appear_on_a_module_element: "'{0}' modifier cannot appear on a module element.", - declare_modifier_cannot_appear_on_an_interface_declaration: "'declare' modifier cannot appear on an interface declaration.", - declare_modifier_required_for_top_level_element: "'declare' modifier required for top level element.", - Rest_parameter_cannot_be_optional: "Rest parameter cannot be optional.", - Rest_parameter_cannot_have_an_initializer: "Rest parameter cannot have an initializer.", - set_accessor_must_have_one_and_only_one_parameter: "'set' accessor must have one and only one parameter.", - set_accessor_parameter_cannot_be_optional: "'set' accessor parameter cannot be optional.", - set_accessor_parameter_cannot_have_an_initializer: "'set' accessor parameter cannot have an initializer.", - set_accessor_cannot_have_rest_parameter: "'set' accessor cannot have rest parameter.", - get_accessor_cannot_have_parameters: "'get' accessor cannot have parameters.", - Modifiers_cannot_appear_here: "Modifiers cannot appear here.", - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: "Accessors are only available when targeting ECMAScript 5 and higher.", - Class_name_cannot_be_0: "Class name cannot be '{0}'.", - Interface_name_cannot_be_0: "Interface name cannot be '{0}'.", - Enum_name_cannot_be_0: "Enum name cannot be '{0}'.", - Module_name_cannot_be_0: "Module name cannot be '{0}'.", - Enum_member_must_have_initializer: "Enum member must have initializer.", - Export_assignment_cannot_be_used_in_internal_modules: "Export assignment cannot be used in internal modules.", - Export_assignment_not_allowed_in_module_with_exported_element: "Export assignment not allowed in module with exported element.", - Module_cannot_have_multiple_export_assignments: "Module cannot have multiple export assignments.", - Ambient_enum_elements_can_only_have_integer_literal_initializers: "Ambient enum elements can only have integer literal initializers.", - module_class_interface_enum_import_or_statement: "module, class, interface, enum, import or statement", - constructor_function_accessor_or_variable: "constructor, function, accessor or variable", - statement: "statement", - case_or_default_clause: "case or default clause", - identifier: "identifier", - call_construct_index_property_or_function_signature: "call, construct, index, property or function signature", - expression: "expression", - type_name: "type name", - property_or_accessor: "property or accessor", - parameter: "parameter", - type: "type", - type_parameter: "type parameter", - declare_modifier_not_allowed_on_import_declaration: "'declare' modifier not allowed on import declaration.", - Function_overload_must_be_static: "Function overload must be static.", - Function_overload_must_not_be_static: "Function overload must not be static.", - Parameter_property_declarations_cannot_be_used_in_a_constructor_overload: "Parameter property declarations cannot be used in a constructor overload.", - Invalid_reference_directive_syntax: "Invalid 'reference' directive syntax.", - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: "Octal literals are not available when targeting ECMAScript 5 and higher.", - Accessors_are_not_allowed_in_ambient_contexts: "Accessors are not allowed in ambient contexts.", - _0_modifier_cannot_appear_on_a_constructor_declaration: "'{0}' modifier cannot appear on a constructor declaration.", - _0_modifier_cannot_appear_on_a_parameter: "'{0}' modifier cannot appear on a parameter.", - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: "Only a single variable declaration is allowed in a 'for...in' statement.", - Type_parameters_cannot_appear_on_a_constructor_declaration: "Type parameters cannot appear on a constructor declaration.", - Type_annotation_cannot_appear_on_a_constructor_declaration: "Type annotation cannot appear on a constructor declaration.", - Duplicate_identifier_0: "Duplicate identifier '{0}'.", - The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.", - The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.", - super_can_only_be_used_inside_a_class_instance_method: "'super' can only be used inside a class instance method.", - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_property_or_indexer: "The left-hand side of an assignment expression must be a variable, property or indexer.", - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: "Value of type '{0}' is not callable. Did you mean to include 'new'?", - Value_of_type_0_is_not_callable: "Value of type '{0}' is not callable.", - Value_of_type_0_is_not_newable: "Value of type '{0}' is not newable.", - Value_of_type_0_is_not_indexable_by_type_1: "Value of type '{0}' is not indexable by type '{1}'.", - Operator_0_cannot_be_applied_to_types_1_and_2: "Operator '{0}' cannot be applied to types '{1}' and '{2}'.", - Operator_0_cannot_be_applied_to_types_1_and_2_3: "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}", - Cannot_convert_0_to_1: "Cannot convert '{0}' to '{1}'.", - Cannot_convert_0_to_1_NL_2: "Cannot convert '{0}' to '{1}':{NL}{2}", - Expected_var_class_interface_or_module: "Expected var, class, interface, or module.", - Operator_0_cannot_be_applied_to_type_1: "Operator '{0}' cannot be applied to type '{1}'.", - Getter_0_already_declared: "Getter '{0}' already declared.", - Setter_0_already_declared: "Setter '{0}' already declared.", - Exported_class_0_extends_private_class_1: "Exported class '{0}' extends private class '{1}'.", - Exported_class_0_implements_private_interface_1: "Exported class '{0}' implements private interface '{1}'.", - Exported_interface_0_extends_private_interface_1: "Exported interface '{0}' extends private interface '{1}'.", - Exported_class_0_extends_class_from_inaccessible_module_1: "Exported class '{0}' extends class from inaccessible module {1}.", - Exported_class_0_implements_interface_from_inaccessible_module_1: "Exported class '{0}' implements interface from inaccessible module {1}.", - Exported_interface_0_extends_interface_from_inaccessible_module_1: "Exported interface '{0}' extends interface from inaccessible module {1}.", - Public_static_property_0_of_exported_class_has_or_is_using_private_type_1: "Public static property '{0}' of exported class has or is using private type '{1}'.", - Public_property_0_of_exported_class_has_or_is_using_private_type_1: "Public property '{0}' of exported class has or is using private type '{1}'.", - Property_0_of_exported_interface_has_or_is_using_private_type_1: "Property '{0}' of exported interface has or is using private type '{1}'.", - Exported_variable_0_has_or_is_using_private_type_1: "Exported variable '{0}' has or is using private type '{1}'.", - Public_static_property_0_of_exported_class_is_using_inaccessible_module_1: "Public static property '{0}' of exported class is using inaccessible module {1}.", - Public_property_0_of_exported_class_is_using_inaccessible_module_1: "Public property '{0}' of exported class is using inaccessible module {1}.", - Property_0_of_exported_interface_is_using_inaccessible_module_1: "Property '{0}' of exported interface is using inaccessible module {1}.", - Exported_variable_0_is_using_inaccessible_module_1: "Exported variable '{0}' is using inaccessible module {1}.", - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.", - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.", - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.", - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "Parameter '{0}' of public method from exported class has or is using private type '{1}'.", - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "Parameter '{0}' of method from exported interface has or is using private type '{1}'.", - Parameter_0_of_exported_function_has_or_is_using_private_type_1: "Parameter '{0}' of exported function has or is using private type '{1}'.", - Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.", - Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.", - Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}", - Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.", - Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "Parameter '{0}' of public method from exported class is using inaccessible module {1}.", - Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "Parameter '{0}' of method from exported interface is using inaccessible module {1}.", - Parameter_0_of_exported_function_is_using_inaccessible_module_1: "Parameter '{0}' of exported function is using inaccessible module {1}.", - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public static property getter from exported class has or is using private type '{0}'.", - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0: "Return type of public property getter from exported class has or is using private type '{0}'.", - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of constructor signature from exported interface has or is using private type '{0}'.", - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of call signature from exported interface has or is using private type '{0}'.", - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0: "Return type of index signature from exported interface has or is using private type '{0}'.", - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public static method from exported class has or is using private type '{0}'.", - Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0: "Return type of public method from exported class has or is using private type '{0}'.", - Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0: "Return type of method from exported interface has or is using private type '{0}'.", - Return_type_of_exported_function_has_or_is_using_private_type_0: "Return type of exported function has or is using private type '{0}'.", - Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public static property getter from exported class is using inaccessible module {0}.", - Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0: "Return type of public property getter from exported class is using inaccessible module {0}.", - Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of constructor signature from exported interface is using inaccessible module {0}.", - Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of call signature from exported interface is using inaccessible module {0}.", - Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0: "Return type of index signature from exported interface is using inaccessible module {0}.", - Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public static method from exported class is using inaccessible module {0}.", - Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0: "Return type of public method from exported class is using inaccessible module {0}.", - Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0: "Return type of method from exported interface is using inaccessible module {0}.", - Return_type_of_exported_function_is_using_inaccessible_module_0: "Return type of exported function is using inaccessible module {0}.", - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: "'new T[]' cannot be used to create an array. Use 'new Array()' instead.", - A_parameter_list_must_follow_a_generic_type_argument_list_expected: "A parameter list must follow a generic type argument list. '(' expected.", - Multiple_constructor_implementations_are_not_allowed: "Multiple constructor implementations are not allowed.", - Unable_to_resolve_external_module_0: "Unable to resolve external module '{0}'.", - Module_cannot_be_aliased_to_a_non_module_type: "Module cannot be aliased to a non-module type.", - A_class_may_only_extend_another_class: "A class may only extend another class.", - A_class_may_only_implement_another_class_or_interface: "A class may only implement another class or interface.", - An_interface_may_only_extend_another_class_or_interface: "An interface may only extend another class or interface.", - Unable_to_resolve_type: "Unable to resolve type.", - Unable_to_resolve_type_of_0: "Unable to resolve type of '{0}'.", - Unable_to_resolve_type_parameter_constraint: "Unable to resolve type parameter constraint.", - Type_parameter_constraint_cannot_be_a_primitive_type: "Type parameter constraint cannot be a primitive type.", - Supplied_parameters_do_not_match_any_signature_of_call_target: "Supplied parameters do not match any signature of call target.", - Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0: "Supplied parameters do not match any signature of call target:{NL}{0}", - Invalid_new_expression: "Invalid 'new' expression.", - Call_signatures_used_in_a_new_expression_must_have_a_void_return_type: "Call signatures used in a 'new' expression must have a 'void' return type.", - Could_not_select_overload_for_new_expression: "Could not select overload for 'new' expression.", - Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2: "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.", - Could_not_select_overload_for_call_expression: "Could not select overload for 'call' expression.", - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: "Cannot invoke an expression whose type lacks a call signature.", - Calls_to_super_are_only_valid_inside_a_class: "Calls to 'super' are only valid inside a class.", - Generic_type_0_requires_1_type_argument_s: "Generic type '{0}' requires {1} type argument(s).", - Type_of_array_literal_cannot_be_determined_Best_common_type_could_not_be_found_for_array_elements: "Type of array literal cannot be determined. Best common type could not be found for array elements.", - Could_not_find_enclosing_symbol_for_dotted_name_0: "Could not find enclosing symbol for dotted name '{0}'.", - The_property_0_does_not_exist_on_value_of_type_1: "The property '{0}' does not exist on value of type '{1}'.", - Could_not_find_symbol_0: "Could not find symbol '{0}'.", - get_and_set_accessor_must_have_the_same_type: "'get' and 'set' accessor must have the same type.", - this_cannot_be_referenced_in_current_location: "'this' cannot be referenced in current location.", - Static_members_cannot_reference_class_type_parameters: "Static members cannot reference class type parameters.", - Class_0_is_recursively_referenced_as_a_base_type_of_itself: "Class '{0}' is recursively referenced as a base type of itself.", - Interface_0_is_recursively_referenced_as_a_base_type_of_itself: "Interface '{0}' is recursively referenced as a base type of itself.", - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.", - super_cannot_be_referenced_in_non_derived_classes: "'super' cannot be referenced in non-derived classes.", - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.", - Constructors_for_derived_classes_must_contain_a_super_call: "Constructors for derived classes must contain a 'super' call.", - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: "Super calls are not permitted outside constructors or in nested functions inside constructors.", - _0_1_is_inaccessible: "'{0}.{1}' is inaccessible.", - this_cannot_be_referenced_within_module_bodies: "'this' cannot be referenced within module bodies.", - Invalid_expression_types_not_known_to_support_the_addition_operator: "Invalid '+' expression - types not known to support the addition operator.", - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.", - The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type: "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.", - Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation: "Variable declarations of a 'for' statement cannot use a type annotation.", - Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any: "Variable declarations of a 'for' statement must be of types 'string' or 'any'.", - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number: "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.", - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.", - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.", - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.", - Setters_cannot_return_a_value: "Setters cannot return a value.", - Tried_to_query_type_of_uninitialized_module_0: "Tried to query type of uninitialized module '{0}'.", - Tried_to_set_variable_type_to_uninitialized_module_type_0: "Tried to set variable type to uninitialized module type '{0}'.", - Type_0_does_not_have_type_parameters: "Type '{0}' does not have type parameters.", - Getters_must_return_a_value: "Getters must return a value.", - Getter_and_setter_accessors_do_not_agree_in_visibility: "Getter and setter accessors do not agree in visibility.", - Invalid_left_hand_side_of_assignment_expression: "Invalid left-hand side of assignment expression.", - Function_declared_a_non_void_return_type_but_has_no_return_expression: "Function declared a non-void return type, but has no return expression.", - Cannot_resolve_return_type_reference: "Cannot resolve return type reference.", - Constructors_cannot_have_a_return_type_of_void: "Constructors cannot have a return type of 'void'.", - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.", - All_symbols_within_a_with_block_will_be_resolved_to_any: "All symbols within a with block will be resolved to 'any'.", - Import_declarations_in_an_internal_module_cannot_reference_an_external_module: "Import declarations in an internal module cannot reference an external module.", - Class_0_declares_interface_1_but_does_not_implement_it_NL_2: "Class {0} declares interface {1} but does not implement it:{NL}{2}", - Class_0_declares_class_1_as_an_interface_but_does_not_implement_it_NL_2: "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}", - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: "The operand of an increment or decrement operator must be a variable, property or indexer.", - this_cannot_be_referenced_in_static_initializers_in_a_class_body: "'this' cannot be referenced in static initializers in a class body.", - Class_0_cannot_extend_class_1_NL_2: "Class '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_class_1_NL_2: "Interface '{0}' cannot extend class '{1}':{NL}{2}", - Interface_0_cannot_extend_interface_1_NL_2: "Interface '{0}' cannot extend interface '{1}':{NL}{2}", - Duplicate_overload_signature_for_0: "Duplicate overload signature for '{0}'.", - Duplicate_constructor_overload_signature: "Duplicate constructor overload signature.", - Duplicate_overload_call_signature: "Duplicate overload call signature.", - Duplicate_overload_construct_signature: "Duplicate overload construct signature.", - Overload_signature_is_not_compatible_with_function_definition: "Overload signature is not compatible with function definition.", - Overload_signature_is_not_compatible_with_function_definition_NL_0: "Overload signature is not compatible with function definition:{NL}{0}", - Overload_signatures_must_all_be_public_or_private: "Overload signatures must all be public or private.", - Overload_signatures_must_all_be_exported_or_not_exported: "Overload signatures must all be exported or not exported.", - Overload_signatures_must_all_be_ambient_or_non_ambient: "Overload signatures must all be ambient or non-ambient.", - Overload_signatures_must_all_be_optional_or_required: "Overload signatures must all be optional or required.", - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: "Specialized overload signature is not assignable to any non-specialized signature.", - this_cannot_be_referenced_in_constructor_arguments: "'this' cannot be referenced in constructor arguments.", - Instance_member_cannot_be_accessed_off_a_class: "Instance member cannot be accessed off a class.", - Untyped_function_calls_may_not_accept_type_arguments: "Untyped function calls may not accept type arguments.", - Non_generic_functions_may_not_accept_type_arguments: "Non-generic functions may not accept type arguments.", - A_generic_type_may_not_reference_itself_with_a_wrapped_form_of_its_own_type_parameters: "A generic type may not reference itself with a wrapped form of its own type parameters.", - Rest_parameters_must_be_array_types: "Rest parameters must be array types.", - Overload_signature_implementation_cannot_use_specialized_type: "Overload signature implementation cannot use specialized type.", - Export_assignments_may_only_be_used_at_the_top_level_of_external_modules: "Export assignments may only be used at the top-level of external modules.", - Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.", - Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword: "Only public methods of the base class are accessible via the 'super' keyword.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.", - Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2: "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0: "All numerically named properties must be assignable to numeric indexer type '{0}'.", - All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1: "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}", - All_named_properties_must_be_assignable_to_string_indexer_type_0: "All named properties must be assignable to string indexer type '{0}'.", - All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1: "All named properties must be assignable to string indexer type '{0}':{NL}{1}", - Generic_type_references_must_include_all_type_arguments: "Generic type references must include all type arguments.", - Default_arguments_are_only_allowed_in_implementation: "Default arguments are only allowed in implementation.", - Overloads_cannot_differ_only_by_return_type: "Overloads cannot differ only by return type.", - Function_expression_declared_a_non_void_return_type_but_has_no_return_expression: "Function expression declared a non-void return type, but has no return expression.", - Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules: "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.", - Could_not_find_symbol_0_in_module_1: "Could not find symbol '{0}' in module '{1}'.", - Unable_to_resolve_module_reference_0: "Unable to resolve module reference '{0}'.", - Could_not_find_module_0_in_module_1: "Could not find module '{0}' in module '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1: "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.", - Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.", - Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1: "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.", - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1: "Type name '{0}' in extends clause does not reference constructor function for '{1}'.", - Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1: "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.", - Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2: "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.", - Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}", - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.", - Ambient_external_module_declaration_cannot_be_reopened: "Ambient external module declaration cannot be reopened.", - All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported: "All declarations of merged declaration '{0}' must be exported or not exported.", - super_cannot_be_referenced_in_constructor_arguments: "'super' cannot be referenced in constructor arguments.", - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: "Return type of constructor signature must be assignable to the instance type of the class.", - Ambient_external_module_declaration_must_be_defined_in_global_context: "Ambient external module declaration must be defined in global context.", - Ambient_external_module_declaration_cannot_specify_relative_module_name: "Ambient external module declaration cannot specify relative module name.", - Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name: "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.", - Could_not_find_the_best_common_type_of_types_of_all_return_statement_expressions: "Could not find the best common type of types of all return statement expressions.", - Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set: "Import declaration cannot refer to external module reference when --noResolve option is set.", - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.", - continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: "'continue' statement can only be used within an enclosing iteration statement.", - break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: "'break' statement can only be used within an enclosing iteration or switch statement.", - Jump_target_not_found: "Jump target not found.", - Jump_target_cannot_cross_function_boundary: "Jump target cannot cross function boundary.", - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.", - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.", - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: "Expression resolves to '_super' that compiler uses to capture base class reference.", - TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.", - TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_function_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported function has or is using private type '{1}'.", - TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}", - TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.", - TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.", - TypeParameter_0_of_exported_function_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported function is using inaccessible module {1}.", - TypeParameter_0_of_exported_class_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported class has or is using private type '{1}'.", - TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1: "TypeParameter '{0}' of exported interface has or is using private type '{1}'.", - TypeParameter_0_of_exported_class_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported class is using inaccessible module {1}.", - TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1: "TypeParameter '{0}' of exported interface is using inaccessible module {1}.", - Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter: "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.", - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.", - Type_of_conditional_0_must_be_identical_to_1_or_2: "Type of conditional '{0}' must be identical to '{1}' or '{2}'.", - Type_of_conditional_0_must_be_identical_to_1_2_or_3: "Type of conditional '{0}' must be identical to '{1}', '{2}' or '{3}'.", - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.", - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.", - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.", - Parameter_0_cannot_be_referenced_in_its_initializer: "Parameter '{0}' cannot be referenced in its initializer.", - Duplicate_string_index_signature: "Duplicate string index signature.", - Duplicate_number_index_signature: "Duplicate number index signature.", - All_declarations_of_an_interface_must_have_identical_type_parameters: "All declarations of an interface must have identical type parameters.", - Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter: "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.", - Type_0_is_missing_property_1_from_type_2: "Type '{0}' is missing property '{1}' from type '{2}'.", - Types_of_property_0_of_types_1_and_2_are_incompatible: "Types of property '{0}' of types '{1}' and '{2}' are incompatible.", - Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3: "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}", - Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_property_2_as_private: "Types '{0}' and '{1}' define property '{2}' as private.", - Call_signatures_of_types_0_and_1_are_incompatible: "Call signatures of types '{0}' and '{1}' are incompatible.", - Call_signatures_of_types_0_and_1_are_incompatible_NL_2: "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_call_signature_but_type_1_lacks_one: "Type '{0}' requires a call signature, but type '{1}' lacks one.", - Construct_signatures_of_types_0_and_1_are_incompatible: "Construct signatures of types '{0}' and '{1}' are incompatible.", - Construct_signatures_of_types_0_and_1_are_incompatible_NL_2: "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Type_0_requires_a_construct_signature_but_type_1_lacks_one: "Type '{0}' requires a construct signature, but type '{1}' lacks one.", - Index_signatures_of_types_0_and_1_are_incompatible: "Index signatures of types '{0}' and '{1}' are incompatible.", - Index_signatures_of_types_0_and_1_are_incompatible_NL_2: "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}", - Call_signature_expects_0_or_fewer_parameters: "Call signature expects {0} or fewer parameters.", - Could_not_apply_type_0_to_argument_1_which_is_of_type_2: "Could not apply type '{0}' to argument {1} which is of type '{2}'.", - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.", - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.", - Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3: "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}", - Type_reference_cannot_refer_to_container_0: "Type reference cannot refer to container '{0}'.", - Type_reference_must_refer_to_type: "Type reference must refer to type.", - In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element: "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.", - _0_overload_s: " (+ {0} overload(s))", - Variable_declaration_cannot_have_the_same_name_as_an_import_declaration: "Variable declaration cannot have the same name as an import declaration.", - Signature_expected_0_type_arguments_got_1_instead: "Signature expected {0} type arguments, got {1} instead.", - Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2: "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type: "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.", - Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2: "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}", - Named_properties_0_of_types_1_and_2_are_not_identical: "Named properties '{0}' of types '{1}' and '{2}' are not identical.", - Types_of_string_indexer_of_types_0_and_1_are_not_identical: "Types of string indexer of types '{0}' and '{1}' are not identical.", - Types_of_number_indexer_of_types_0_and_1_are_not_identical: "Types of number indexer of types '{0}' and '{1}' are not identical.", - Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2: "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}", - Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}", - Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3: "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}", - Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2: "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.", - Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2: "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.", - Types_0_and_1_define_static_property_2_as_private: "Types '{0}' and '{1}' define static property '{2}' as private.", - Current_host_does_not_support_0_option: "Current host does not support '{0}' option.", - ECMAScript_target_version_0_not_supported_Specify_a_valid_target_version_1_default_or_2: "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'", - Module_code_generation_0_not_supported: "Module code generation '{0}' not supported.", - Could_not_find_file_0: "Could not find file: '{0}'.", - A_file_cannot_have_a_reference_to_itself: "A file cannot have a reference to itself.", - Cannot_resolve_referenced_file_0: "Cannot resolve referenced file: '{0}'.", - Cannot_find_the_common_subdirectory_path_for_the_input_files: "Cannot find the common subdirectory path for the input files.", - Emit_Error_0: "Emit Error: {0}.", - Cannot_read_file_0_1: "Cannot read file '{0}': {1}", - Unsupported_file_encoding: "Unsupported file encoding.", - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: "Locale must be of the form or -. For example '{0}' or '{1}'.", - Unsupported_locale_0: "Unsupported locale: '{0}'.", - Execution_Failed_NL: "Execution Failed.{NL}", - Invalid_call_to_up: "Invalid call to 'up'", - Invalid_call_to_down: "Invalid call to 'down'", - Base64_value_0_finished_with_a_continuation_bit: "Base64 value '{0}' finished with a continuation bit.", - Unknown_option_0: "Unknown option '{0}'", - Expected_0_arguments_to_message_got_1_instead: "Expected {0} arguments to message, got {1} instead.", - Expected_the_message_0_to_have_1_arguments_but_it_had_2: "Expected the message '{0}' to have {1} arguments, but it had {2}", - Could_not_delete_file_0: "Could not delete file '{0}'", - Could_not_create_directory_0: "Could not create directory '{0}'", - Error_while_executing_file_0: "Error while executing file '{0}': ", - Cannot_compile_external_modules_unless_the_module_flag_is_provided: "Cannot compile external modules unless the '--module' flag is provided.", - Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option mapRoot cannot be specified without specifying sourcemap option.", - Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Option sourceRoot cannot be specified without specifying sourcemap option.", - Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option: "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.", - Option_0_specified_without_1: "Option '{0}' specified without '{1}'", - codepage_option_not_supported_on_current_platform: "'codepage' option not supported on current platform.", - Concatenate_and_emit_output_to_single_file: "Concatenate and emit output to single file.", - Generates_corresponding_0_file: "Generates corresponding {0} file.", - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: "Specifies the location where debugger should locate map files instead of generated locations.", - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: "Specifies the location where debugger should locate TypeScript files instead of source locations.", - Watch_input_files: "Watch input files.", - Redirect_output_structure_to_the_directory: "Redirect output structure to the directory.", - Do_not_emit_comments_to_output: "Do not emit comments to output.", - Skip_resolution_and_preprocessing: "Skip resolution and preprocessing.", - Specify_ECMAScript_target_version_0_default_or_1: "Specify ECMAScript target version: '{0}' (default), or '{1}'", - Specify_module_code_generation_0_or_1: "Specify module code generation: '{0}' or '{1}'", - Print_this_message: "Print this message.", - Print_the_compiler_s_version_0: "Print the compiler's version: {0}", - Allow_use_of_deprecated_0_keyword_when_referencing_an_external_module: "Allow use of deprecated '{0}' keyword when referencing an external module.", - Specify_locale_for_errors_and_messages_For_example_0_or_1: "Specify locale for errors and messages. For example '{0}' or '{1}'", - Syntax_0: "Syntax: {0}", - options: "options", - file1: "file", - Examples: "Examples:", - Options: "Options:", - Insert_command_line_options_and_files_from_a_file: "Insert command line options and files from a file.", - Version_0: "Version {0}", - Use_the_0_flag_to_see_options: "Use the '{0}' flag to see options.", - NL_Recompiling_0: "{NL}Recompiling ({0}):", - STRING: "STRING", - KIND: "KIND", - file2: "FILE", - VERSION: "VERSION", - LOCATION: "LOCATION", - DIRECTORY: "DIRECTORY", - NUMBER: "NUMBER", - Specify_the_codepage_to_use_when_opening_source_files: "Specify the codepage to use when opening source files.", - Additional_locations: "Additional locations:", - This_version_of_the_Javascript_runtime_does_not_support_the_0_function: "This version of the Javascript runtime does not support the '{0}' function.", - Unknown_rule: "Unknown rule.", - Invalid_line_number_0: "Invalid line number ({0})", - Warn_on_expressions_and_declarations_with_an_implied_any_type: "Warn on expressions and declarations with an implied 'any' type.", - Variable_0_implicitly_has_an_any_type: "Variable '{0}' implicitly has an 'any' type.", - Parameter_0_of_1_implicitly_has_an_any_type: "Parameter '{0}' of '{1}' implicitly has an 'any' type.", - Parameter_0_of_function_type_implicitly_has_an_any_type: "Parameter '{0}' of function type implicitly has an 'any' type.", - Member_0_of_object_type_implicitly_has_an_any_type: "Member '{0}' of object type implicitly has an 'any' type.", - new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type: "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.", - _0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.", - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.", - Parameter_0_of_lambda_function_implicitly_has_an_any_type: "Parameter '{0}' of lambda function implicitly has an 'any' type.", - Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.", - Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.", - Array_Literal_implicitly_has_an_any_type_from_widening: "Array Literal implicitly has an 'any' type from widening.", - _0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type: "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.", - Index_signature_of_object_type_implicitly_has_an_any_type: "Index signature of object type implicitly has an 'any' type.", - Object_literal_s_property_0_implicitly_has_an_any_type_from_widening: "Object literal's property '{0}' implicitly has an 'any' type from widening." - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ArrayUtilities = (function () { - function ArrayUtilities() { - } - ArrayUtilities.isArray = function (value) { - return Object.prototype.toString.apply(value, []) === '[object Array]'; - }; - - ArrayUtilities.sequenceEquals = function (array1, array2, equals) { - if (array1 === array2) { - return true; - } - - if (array1 === null || array2 === null) { - return false; - } - - if (array1.length !== array2.length) { - return false; - } - - for (var i = 0, n = array1.length; i < n; i++) { - if (!equals(array1[i], array2[i])) { - return false; - } - } - - return true; - }; - - ArrayUtilities.contains = function (array, value) { - for (var i = 0; i < array.length; i++) { - if (array[i] === value) { - return true; - } - } - - return false; - }; - - ArrayUtilities.groupBy = function (array, func) { - var result = {}; - - for (var i = 0, n = array.length; i < n; i++) { - var v = array[i]; - var k = func(v); - - var list = result[k] || []; - list.push(v); - result[k] = list; - } - - return result; - }; - - ArrayUtilities.distinct = function (array, equalsFn) { - var result = []; - - for (var i = 0, n = array.length; i < n; i++) { - var current = array[i]; - for (var j = 0; j < result.length; j++) { - if (equalsFn(result[j], current)) { - break; - } - } - - if (j === result.length) { - result.push(current); - } - } - - return result; - }; - - ArrayUtilities.min = function (array, func) { - var min = func(array[0]); - - for (var i = 1; i < array.length; i++) { - var next = func(array[i]); - if (next < min) { - min = next; - } - } - - return min; - }; - - ArrayUtilities.max = function (array, func) { - var max = func(array[0]); - - for (var i = 1; i < array.length; i++) { - var next = func(array[i]); - if (next > max) { - max = next; - } - } - - return max; - }; - - ArrayUtilities.last = function (array) { - if (array.length === 0) { - throw TypeScript.Errors.argumentOutOfRange('array'); - } - - return array[array.length - 1]; - }; - - ArrayUtilities.lastOrDefault = function (array, predicate) { - for (var i = array.length - 1; i >= 0; i--) { - var v = array[i]; - if (predicate(v, i)) { - return v; - } - } - - return null; - }; - - ArrayUtilities.firstOrDefault = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (func(value, i)) { - return value; - } - } - - return null; - }; - - ArrayUtilities.first = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - var value = array[i]; - if (!func || func(value, i)) { - return value; - } - } - - throw TypeScript.Errors.invalidOperation(); - }; - - ArrayUtilities.sum = function (array, func) { - var result = 0; - - for (var i = 0, n = array.length; i < n; i++) { - result += func(array[i]); - } - - return result; - }; - - ArrayUtilities.select = function (values, func) { - var result = new Array(values.length); - - for (var i = 0; i < values.length; i++) { - result[i] = func(values[i]); - } - - return result; - }; - - ArrayUtilities.where = function (values, func) { - var result = new Array(); - - for (var i = 0; i < values.length; i++) { - if (func(values[i])) { - result.push(values[i]); - } - } - - return result; - }; - - ArrayUtilities.any = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (func(array[i])) { - return true; - } - } - - return false; - }; - - ArrayUtilities.all = function (array, func) { - for (var i = 0, n = array.length; i < n; i++) { - if (!func(array[i])) { - return false; - } - } - - return true; - }; - - ArrayUtilities.binarySearch = function (array, value) { - var low = 0; - var high = array.length - 1; - - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - - if (midValue === value) { - return middle; - } else if (midValue > value) { - high = middle - 1; - } else { - low = middle + 1; - } - } - - return ~low; - }; - - ArrayUtilities.createArray = function (length, defaultValue) { - var result = new Array(length); - for (var i = 0; i < length; i++) { - result[i] = defaultValue; - } - - return result; - }; - - ArrayUtilities.grow = function (array, length, defaultValue) { - var count = length - array.length; - for (var i = 0; i < count; i++) { - array.push(defaultValue); - } - }; - - ArrayUtilities.copy = function (sourceArray, sourceIndex, destinationArray, destinationIndex, length) { - for (var i = 0; i < length; i++) { - destinationArray[destinationIndex + i] = sourceArray[sourceIndex + i]; - } - }; - - ArrayUtilities.indexOf = function (array, predicate) { - for (var i = 0, n = array.length; i < n; i++) { - if (predicate(array[i])) { - return i; - } - } - - return -1; - }; - return ArrayUtilities; - })(); - TypeScript.ArrayUtilities = ArrayUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (BitVector) { - var pool = []; - var Constants; - (function (Constants) { - Constants[Constants["MaxBitsPerEncodedNumber"] = 30] = "MaxBitsPerEncodedNumber"; - Constants[Constants["BitsPerEncodedBiStateValue"] = 1] = "BitsPerEncodedBiStateValue"; - - Constants[Constants["BitsPerEncodedTriStateValue"] = 2] = "BitsPerEncodedTriStateValue"; - - Constants[Constants["BiStateEncodedTrue"] = 1] = "BiStateEncodedTrue"; - Constants[Constants["BiStateClearBitsMask"] = 1] = "BiStateClearBitsMask"; - - Constants[Constants["TriStateEncodedFalse"] = 1] = "TriStateEncodedFalse"; - Constants[Constants["TriStateEncodedTrue"] = 2] = "TriStateEncodedTrue"; - Constants[Constants["TriStateClearBitsMask"] = 3] = "TriStateClearBitsMask"; - })(Constants || (Constants = {})); - - var BitVectorImpl = (function () { - function BitVectorImpl(allowUndefinedValues) { - this.allowUndefinedValues = allowUndefinedValues; - this.isReleased = false; - this.bits = []; - } - BitVectorImpl.prototype.computeTriStateArrayIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 2 /* BitsPerEncodedTriStateValue */; - - return (index / encodedValuesPerNumber) >>> 0; - }; - - BitVectorImpl.prototype.computeBiStateArrayIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 1 /* BitsPerEncodedBiStateValue */; - - return (index / encodedValuesPerNumber) >>> 0; - }; - - BitVectorImpl.prototype.computeTriStateEncodedValueIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 2 /* BitsPerEncodedTriStateValue */; - - return (index % encodedValuesPerNumber) * 2 /* BitsPerEncodedTriStateValue */; - }; - - BitVectorImpl.prototype.computeBiStateEncodedValueIndex = function (index) { - var encodedValuesPerNumber = 30 /* MaxBitsPerEncodedNumber */ / 1 /* BitsPerEncodedBiStateValue */; - - return (index % encodedValuesPerNumber) * 1 /* BitsPerEncodedBiStateValue */; - }; - - BitVectorImpl.prototype.valueAt = function (index) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - if (this.allowUndefinedValues) { - var arrayIndex = this.computeTriStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - return undefined; - } - - var bitIndex = this.computeTriStateEncodedValueIndex(index); - if (encoded & (2 /* TriStateEncodedTrue */ << bitIndex)) { - return true; - } else if (encoded & (1 /* TriStateEncodedFalse */ << bitIndex)) { - return false; - } else { - return undefined; - } - } else { - var arrayIndex = this.computeBiStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - return false; - } - - var bitIndex = this.computeBiStateEncodedValueIndex(index); - if (encoded & (1 /* BiStateEncodedTrue */ << bitIndex)) { - return true; - } else { - return false; - } - } - }; - - BitVectorImpl.prototype.setValueAt = function (index, value) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - if (this.allowUndefinedValues) { - TypeScript.Debug.assert(value === true || value === false || value === undefined, "value must only be true, false or undefined."); - - var arrayIndex = this.computeTriStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - if (value === undefined) { - return; - } - - encoded = 0; - } - - var bitIndex = this.computeTriStateEncodedValueIndex(index); - - var clearMask = ~(3 /* TriStateClearBitsMask */ << bitIndex); - encoded = encoded & clearMask; - - if (value === true) { - encoded = encoded | (2 /* TriStateEncodedTrue */ << bitIndex); - } else if (value === false) { - encoded = encoded | (1 /* TriStateEncodedFalse */ << bitIndex); - } - - this.bits[arrayIndex] = encoded; - } else { - TypeScript.Debug.assert(value === true || value === false, "value must only be true or false."); - - var arrayIndex = this.computeBiStateArrayIndex(index); - var encoded = this.bits[arrayIndex]; - if (encoded === undefined) { - if (value === false) { - return; - } - - encoded = 0; - } - - var bitIndex = this.computeBiStateEncodedValueIndex(index); - - encoded = encoded & ~(1 /* BiStateClearBitsMask */ << bitIndex); - - if (value) { - encoded = encoded | (1 /* BiStateEncodedTrue */ << bitIndex); - } - - this.bits[arrayIndex] = encoded; - } - }; - - BitVectorImpl.prototype.release = function () { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - this.isReleased = true; - this.bits.length = 0; - pool.push(this); - }; - return BitVectorImpl; - })(); - - function getBitVector(allowUndefinedValues) { - if (pool.length === 0) { - return new BitVectorImpl(allowUndefinedValues); - } - - var vector = pool.pop(); - vector.isReleased = false; - vector.allowUndefinedValues = allowUndefinedValues; - - return vector; - } - BitVector.getBitVector = getBitVector; - })(TypeScript.BitVector || (TypeScript.BitVector = {})); - var BitVector = TypeScript.BitVector; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (BitMatrix) { - var pool = []; - - var BitMatrixImpl = (function () { - function BitMatrixImpl(allowUndefinedValues) { - this.allowUndefinedValues = allowUndefinedValues; - this.isReleased = false; - this.vectors = []; - } - BitMatrixImpl.prototype.valueAt = function (x, y) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - var vector = this.vectors[x]; - if (!vector) { - return this.allowUndefinedValues ? undefined : false; - } - - return vector.valueAt(y); - }; - - BitMatrixImpl.prototype.setValueAt = function (x, y, value) { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - var vector = this.vectors[x]; - if (!vector) { - if (value === undefined) { - return; - } - - vector = TypeScript.BitVector.getBitVector(this.allowUndefinedValues); - this.vectors[x] = vector; - } - - vector.setValueAt(y, value); - }; - - BitMatrixImpl.prototype.release = function () { - TypeScript.Debug.assert(!this.isReleased, "Should not use a released bitvector"); - this.isReleased = true; - - for (var name in this.vectors) { - if (this.vectors.hasOwnProperty(name)) { - var vector = this.vectors[name]; - vector.release(); - } - } - - this.vectors.length = 0; - pool.push(this); - }; - return BitMatrixImpl; - })(); - - function getBitMatrix(allowUndefinedValues) { - if (pool.length === 0) { - return new BitMatrixImpl(allowUndefinedValues); - } - - var matrix = pool.pop(); - matrix.isReleased = false; - matrix.allowUndefinedValues = allowUndefinedValues; - - return matrix; - } - BitMatrix.getBitMatrix = getBitMatrix; - })(TypeScript.BitMatrix || (TypeScript.BitMatrix = {})); - var BitMatrix = TypeScript.BitMatrix; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Constants) { - Constants[Constants["Max31BitInteger"] = 1073741823] = "Max31BitInteger"; - Constants[Constants["Min31BitInteger"] = -1073741824] = "Min31BitInteger"; - })(TypeScript.Constants || (TypeScript.Constants = {})); - var Constants = TypeScript.Constants; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(TypeScript.AssertionLevel || (TypeScript.AssertionLevel = {})); - var AssertionLevel = TypeScript.AssertionLevel; - - var Debug = (function () { - function Debug() { - } - Debug.shouldAssert = function (level) { - return this.currentAssertionLevel >= level; - }; - - Debug.assert = function (expression, message, verboseDebugInfo) { - if (typeof message === "undefined") { message = ""; } - if (typeof verboseDebugInfo === "undefined") { verboseDebugInfo = null; } - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information:" + verboseDebugInfo(); - } - - throw new Error("Debug Failure. False expression: " + message + verboseDebugString); - } - }; - - Debug.fail = function (message) { - Debug.assert(false, message); - }; - Debug.currentAssertionLevel = 0 /* None */; - return Debug; - })(); - TypeScript.Debug = Debug; -})(TypeScript || (TypeScript = {})); -var __extends = this.__extends || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -var TypeScript; -(function (TypeScript) { - TypeScript.LocalizedDiagnosticMessages = null; - - var Location = (function () { - function Location(fileName, lineMap, start, length) { - this._fileName = fileName; - this._lineMap = lineMap; - this._start = start; - this._length = length; - } - Location.prototype.fileName = function () { - return this._fileName; - }; - - Location.prototype.lineMap = function () { - return this._lineMap; - }; - - Location.prototype.line = function () { - return this._lineMap ? this._lineMap.getLineNumberFromPosition(this.start()) : 0; - }; - - Location.prototype.character = function () { - return this._lineMap ? this._lineMap.getLineAndCharacterFromPosition(this.start()).character() : 0; - }; - - Location.prototype.start = function () { - return this._start; - }; - - Location.prototype.length = function () { - return this._length; - }; - - Location.equals = function (location1, location2) { - return location1._fileName === location2._fileName && location1._start === location2._start && location1._length === location2._length; - }; - return Location; - })(); - TypeScript.Location = Location; - - var Diagnostic = (function (_super) { - __extends(Diagnostic, _super); - function Diagnostic(fileName, lineMap, start, length, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - _super.call(this, fileName, lineMap, start, length); - this._diagnosticKey = diagnosticKey; - this._arguments = (_arguments && _arguments.length > 0) ? _arguments : null; - this._additionalLocations = (additionalLocations && additionalLocations.length > 0) ? additionalLocations : null; - } - Diagnostic.prototype.toJSON = function (key) { - var result = {}; - result.start = this.start(); - result.length = this.length(); - - result.diagnosticCode = this._diagnosticKey; - - var _arguments = this.arguments(); - if (_arguments && _arguments.length > 0) { - result.arguments = _arguments; - } - - return result; - }; - - Diagnostic.prototype.diagnosticKey = function () { - return this._diagnosticKey; - }; - - Diagnostic.prototype.arguments = function () { - return this._arguments; - }; - - Diagnostic.prototype.text = function () { - return TypeScript.getLocalizedText(this._diagnosticKey, this._arguments); - }; - - Diagnostic.prototype.message = function () { - return TypeScript.getDiagnosticMessage(this._diagnosticKey, this._arguments); - }; - - Diagnostic.prototype.additionalLocations = function () { - return this._additionalLocations || []; - }; - - Diagnostic.equals = function (diagnostic1, diagnostic2) { - return Location.equals(diagnostic1, diagnostic2) && diagnostic1._diagnosticKey === diagnostic2._diagnosticKey && TypeScript.ArrayUtilities.sequenceEquals(diagnostic1._arguments, diagnostic2._arguments, function (v1, v2) { - return v1 === v2; - }); - }; - - Diagnostic.prototype.info = function () { - return getDiagnosticInfoFromKey(this.diagnosticKey()); - }; - return Diagnostic; - })(Location); - TypeScript.Diagnostic = Diagnostic; - - function newLine() { - return TypeScript.Environment ? TypeScript.Environment.newLine : "\r\n"; - } - TypeScript.newLine = newLine; - - function getLargestIndex(diagnostic) { - var largest = -1; - var regex = /\{(\d+)\}/g; - - var match; - while (match = regex.exec(diagnostic)) { - var val = parseInt(match[1]); - if (!isNaN(val) && val > largest) { - largest = val; - } - } - - return largest; - } - - function getDiagnosticInfoFromKey(diagnosticKey) { - var result = TypeScript.diagnosticInformationMap[diagnosticKey]; - TypeScript.Debug.assert(result); - return result; - } - - function getLocalizedText(diagnosticKey, args) { - if (TypeScript.LocalizedDiagnosticMessages) { - } - - var diagnosticMessageText = TypeScript.LocalizedDiagnosticMessages ? TypeScript.LocalizedDiagnosticMessages[diagnosticKey] : diagnosticKey; - TypeScript.Debug.assert(diagnosticMessageText !== undefined && diagnosticMessageText !== null); - - var actualCount = args ? args.length : 0; - - var expectedCount = 1 + getLargestIndex(diagnosticKey); - - if (expectedCount !== actualCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_0_arguments_to_message_got_1_instead, [expectedCount, actualCount])); - } - - var valueCount = 1 + getLargestIndex(diagnosticMessageText); - if (valueCount !== expectedCount) { - throw new Error(getLocalizedText(TypeScript.DiagnosticCode.Expected_the_message_0_to_have_1_arguments_but_it_had_2, [diagnosticMessageText, expectedCount, valueCount])); - } - - diagnosticMessageText = diagnosticMessageText.replace(/{(\d+)}/g, function (match, num) { - return typeof args[num] !== 'undefined' ? args[num] : match; - }); - - diagnosticMessageText = diagnosticMessageText.replace(/{(NL)}/g, function (match) { - return TypeScript.newLine(); - }); - - return diagnosticMessageText; - } - TypeScript.getLocalizedText = getLocalizedText; - - function getDiagnosticMessage(diagnosticKey, args) { - var diagnostic = getDiagnosticInfoFromKey(diagnosticKey); - var diagnosticMessageText = getLocalizedText(diagnosticKey, args); - - var message; - if (diagnostic.category === 1 /* Error */) { - message = getLocalizedText(TypeScript.DiagnosticCode.error_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } else if (diagnostic.category === 0 /* Warning */) { - message = getLocalizedText(TypeScript.DiagnosticCode.warning_TS_0_1, [diagnostic.code, diagnosticMessageText]); - } else { - message = diagnosticMessageText; - } - - return message; - } - TypeScript.getDiagnosticMessage = getDiagnosticMessage; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Errors = (function () { - function Errors() { - } - Errors.argument = function (argument, message) { - return new Error("Invalid argument: " + argument + ". " + message); - }; - - Errors.argumentOutOfRange = function (argument) { - return new Error("Argument out of range: " + argument); - }; - - Errors.argumentNull = function (argument) { - return new Error("Argument null: " + argument); - }; - - Errors.abstract = function () { - return new Error("Operation not implemented properly by subclass."); - }; - - Errors.notYetImplemented = function () { - return new Error("Not yet implemented."); - }; - - Errors.invalidOperation = function (message) { - return new Error("Invalid operation: " + message); - }; - return Errors; - })(); - TypeScript.Errors = Errors; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Hash = (function () { - function Hash() { - } - Hash.computeFnv1aCharArrayHashCode = function (text, start, len) { - var hashCode = Hash.FNV_BASE; - var end = start + len; - - for (var i = start; i < end; i++) { - hashCode = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(hashCode ^ text[i], Hash.FNV_PRIME); - } - - return hashCode; - }; - - Hash.computeSimple31BitCharArrayHashCode = function (key, start, len) { - var hash = 0; - - for (var i = 0; i < len; i++) { - var ch = key[start + i]; - - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - - return hash & 0x7FFFFFFF; - }; - - Hash.computeSimple31BitStringHashCode = function (key) { - var hash = 0; - - var start = 0; - var len = key.length; - - for (var i = 0; i < len; i++) { - var ch = key.charCodeAt(start + i); - - hash = ((((hash << 5) - hash) | 0) + ch) | 0; - } - - return hash & 0x7FFFFFFF; - }; - - Hash.computeMurmur2StringHashCode = function (key, seed) { - var m = 0x5bd1e995; - var r = 24; - - var numberOfCharsLeft = key.length; - var h = Math.abs(seed ^ numberOfCharsLeft); - - var index = 0; - while (numberOfCharsLeft >= 2) { - var c1 = key.charCodeAt(index); - var c2 = key.charCodeAt(index + 1); - - var k = Math.abs(c1 | (c2 << 16)); - - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - k ^= k >> r; - k = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(k, m); - - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= k; - - index += 2; - numberOfCharsLeft -= 2; - } - - if (numberOfCharsLeft === 1) { - h ^= key.charCodeAt(index); - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - } - - h ^= h >> 13; - h = TypeScript.IntegerUtilities.integerMultiplyLow32Bits(h, m); - h ^= h >> 15; - - return h; - }; - - Hash.getPrime = function (min) { - for (var i = 0; i < Hash.primes.length; i++) { - var num = Hash.primes[i]; - if (num >= min) { - return num; - } - } - - throw TypeScript.Errors.notYetImplemented(); - }; - - Hash.expandPrime = function (oldSize) { - var num = oldSize << 1; - if (num > 2146435069 && 2146435069 > oldSize) { - return 2146435069; - } - return Hash.getPrime(num); - }; - - Hash.combine = function (value, currentHash) { - return (((currentHash << 5) + currentHash) + value) & 0x7FFFFFFF; - }; - Hash.FNV_BASE = 2166136261; - Hash.FNV_PRIME = 16777619; - - Hash.primes = [ - 3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, - 631, 761, 919, 1103, 1327, 1597, 1931, 2333, 2801, 3371, 4049, 4861, 5839, 7013, 8419, - 10103, 12143, 14591, 17519, 21023, 25229, 30293, 36353, 43627, 52361, 62851, 75431, - 90523, 108631, 130363, 156437, 187751, 225307, 270371, 324449, 389357, 467237, 560689, - 672827, 807403, 968897, 1162687, 1395263, 1674319, 2009191, 2411033, 2893249, 3471899, - 4166287, 4999559, 5999471, 7199369]; - return Hash; - })(); - TypeScript.Hash = Hash; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Collections) { - Collections.DefaultHashTableCapacity = 1024; - - var HashTableEntry = (function () { - function HashTableEntry(Key, Value, HashCode, Next) { - this.Key = Key; - this.Value = Value; - this.HashCode = HashCode; - this.Next = Next; - } - return HashTableEntry; - })(); - - var HashTable = (function () { - function HashTable(capacity, hash) { - this.hash = hash; - this.count = 0; - var size = TypeScript.Hash.getPrime(capacity); - this.entries = TypeScript.ArrayUtilities.createArray(size, null); - } - HashTable.prototype.set = function (key, value) { - this.addOrSet(key, value, false); - }; - - HashTable.prototype.add = function (key, value) { - this.addOrSet(key, value, true); - }; - - HashTable.prototype.containsKey = function (key) { - var hashCode = this.computeHashCode(key); - var entry = this.findEntry(key, hashCode); - return entry !== null; - }; - - HashTable.prototype.get = function (key) { - var hashCode = this.computeHashCode(key); - var entry = this.findEntry(key, hashCode); - - return entry === null ? null : entry.Value; - }; - - HashTable.prototype.computeHashCode = function (key) { - var hashCode = this.hash === null ? key.hashCode : this.hash(key); - - hashCode = hashCode & 0x7FFFFFFF; - TypeScript.Debug.assert(hashCode >= 0); - - return hashCode; - }; - - HashTable.prototype.addOrSet = function (key, value, throwOnExistingEntry) { - var hashCode = this.computeHashCode(key); - - var entry = this.findEntry(key, hashCode); - if (entry !== null) { - if (throwOnExistingEntry) { - throw TypeScript.Errors.argument('key', "Key was already in table."); - } - - entry.Key = key; - entry.Value = value; - return; - } - - return this.addEntry(key, value, hashCode); - }; - - HashTable.prototype.findEntry = function (key, hashCode) { - for (var e = this.entries[hashCode % this.entries.length]; e !== null; e = e.Next) { - if (e.HashCode === hashCode && key === e.Key) { - return e; - } - } - - return null; - }; - - HashTable.prototype.addEntry = function (key, value, hashCode) { - var index = hashCode % this.entries.length; - - var e = new HashTableEntry(key, value, hashCode, this.entries[index]); - - this.entries[index] = e; - - if (this.count >= (this.entries.length / 2)) { - this.grow(); - } - - this.count++; - return e.Key; - }; - - HashTable.prototype.grow = function () { - var newSize = TypeScript.Hash.expandPrime(this.entries.length); - - var oldEntries = this.entries; - var newEntries = TypeScript.ArrayUtilities.createArray(newSize, null); - - this.entries = newEntries; - - for (var i = 0; i < oldEntries.length; i++) { - var e = oldEntries[i]; - - while (e !== null) { - var newIndex = e.HashCode % newSize; - var tmp = e.Next; - e.Next = newEntries[newIndex]; - newEntries[newIndex] = e; - e = tmp; - } - } - }; - return HashTable; - })(); - Collections.HashTable = HashTable; - - function createHashTable(capacity, hash) { - if (typeof capacity === "undefined") { capacity = Collections.DefaultHashTableCapacity; } - if (typeof hash === "undefined") { hash = null; } - return new HashTable(capacity, hash); - } - Collections.createHashTable = createHashTable; - - var currentHashCode = 1; - function identityHashCode(value) { - if (value.__hash === undefined) { - value.__hash = currentHashCode; - currentHashCode++; - } - - return value.__hash; - } - Collections.identityHashCode = identityHashCode; - })(TypeScript.Collections || (TypeScript.Collections = {})); - var Collections = TypeScript.Collections; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - TypeScript.nodeMakeDirectoryTime = 0; - TypeScript.nodeCreateBufferTime = 0; - TypeScript.nodeWriteFileSyncTime = 0; - - (function (ByteOrderMark) { - ByteOrderMark[ByteOrderMark["None"] = 0] = "None"; - ByteOrderMark[ByteOrderMark["Utf8"] = 1] = "Utf8"; - ByteOrderMark[ByteOrderMark["Utf16BigEndian"] = 2] = "Utf16BigEndian"; - ByteOrderMark[ByteOrderMark["Utf16LittleEndian"] = 3] = "Utf16LittleEndian"; - })(TypeScript.ByteOrderMark || (TypeScript.ByteOrderMark = {})); - var ByteOrderMark = TypeScript.ByteOrderMark; - - var FileInformation = (function () { - function FileInformation(contents, byteOrderMark) { - this.contents = contents; - this.byteOrderMark = byteOrderMark; - } - return FileInformation; - })(); - TypeScript.FileInformation = FileInformation; - - TypeScript.Environment = (function () { - function getWindowsScriptHostEnvironment() { - try { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - } catch (e) { - return null; - } - - var streamObjectPool = []; - - function getStreamObject() { - if (streamObjectPool.length > 0) { - return streamObjectPool.pop(); - } else { - return new ActiveXObject("ADODB.Stream"); - } - } - - function releaseStreamObject(obj) { - streamObjectPool.push(obj); - } - - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - - return { - newLine: "\r\n", - currentDirectory: function () { - return WScript.CreateObject("WScript.Shell").CurrentDirectory; - }, - supportsCodePage: function () { - return WScript.ReadFile; - }, - readFile: function (path, codepage) { - try { - if (codepage !== null && this.supportsCodePage()) { - try { - var contents = WScript.ReadFile(path, codepage); - return new FileInformation(contents, 0 /* None */); - } catch (e) { - } - } - - var streamObj = getStreamObject(); - streamObj.Open(); - streamObj.Type = 2; - - streamObj.Charset = 'x-ansi'; - - streamObj.LoadFromFile(path); - var bomChar = streamObj.ReadText(2); - - streamObj.Position = 0; - - var byteOrderMark = 0 /* None */; - - if (bomChar.charCodeAt(0) === 0xFE && bomChar.charCodeAt(1) === 0xFF) { - streamObj.Charset = 'unicode'; - byteOrderMark = 2 /* Utf16BigEndian */; - } else if (bomChar.charCodeAt(0) === 0xFF && bomChar.charCodeAt(1) === 0xFE) { - streamObj.Charset = 'unicode'; - byteOrderMark = 3 /* Utf16LittleEndian */; - } else if (bomChar.charCodeAt(0) === 0xEF && bomChar.charCodeAt(1) === 0xBB) { - streamObj.Charset = 'utf-8'; - byteOrderMark = 1 /* Utf8 */; - } else { - streamObj.Charset = 'utf-8'; - } - - var contents = streamObj.ReadText(-1); - streamObj.Close(); - releaseStreamObject(streamObj); - return new FileInformation(contents, byteOrderMark); - } catch (err) { - var message; - if (err.number === -2147024809) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Unsupported_file_encoding, null); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Cannot_read_file_0_1, [path, err.message]); - } - - throw new Error(message); - } - }, - writeFile: function (path, contents, writeByteOrderMark) { - var textStream = getStreamObject(); - textStream.Charset = 'utf-8'; - textStream.Open(); - textStream.WriteText(contents, 0); - - if (!writeByteOrderMark) { - textStream.Position = 3; - } else { - textStream.Position = 0; - } - - var fileStream = getStreamObject(); - fileStream.Type = 1; - fileStream.Open(); - - textStream.CopyTo(fileStream); - - fileStream.Flush(); - fileStream.SaveToFile(path, 2); - fileStream.Close(); - - textStream.Flush(); - textStream.Close(); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - deleteFile: function (path) { - if (fso.FileExists(path)) { - fso.DeleteFile(path, true); - } - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - listFiles: function (path, spec, options) { - options = options || {}; - function filesInFolder(folder, root) { - var paths = []; - var fc; - - if (options.recursive) { - fc = new Enumerator(folder.subfolders); - - for (; !fc.atEnd(); fc.moveNext()) { - paths = paths.concat(filesInFolder(fc.item(), root + "\\" + fc.item().Name)); - } - } - - fc = new Enumerator(folder.files); - - for (; !fc.atEnd(); fc.moveNext()) { - if (!spec || fc.item().Name.match(spec)) { - paths.push(root + "\\" + fc.item().Name); - } - } - - return paths; - } - - var folder = fso.GetFolder(path); - var paths = []; - - return filesInFolder(folder, path); - }, - arguments: args, - standardOut: WScript.StdOut - }; - } - ; - - function getNodeEnvironment() { - var _fs = require('fs'); - var _path = require('path'); - var _module = require('module'); - var _os = require('os'); - - return { - newLine: _os.EOL, - currentDirectory: function () { - return process.cwd(); - }, - supportsCodePage: function () { - return false; - }, - readFile: function (file, codepage) { - if (codepage !== null) { - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.codepage_option_not_supported_on_current_platform, null)); - } - - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] === 0xFF) { - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return new FileInformation(buffer.toString("ucs2", 2), 2 /* Utf16BigEndian */); - } - break; - case 0xFF: - if (buffer[1] === 0xFE) { - return new FileInformation(buffer.toString("ucs2", 2), 3 /* Utf16LittleEndian */); - } - break; - case 0xEF: - if (buffer[1] === 0xBB) { - return new FileInformation(buffer.toString("utf8", 3), 1 /* Utf8 */); - } - } - - return new FileInformation(buffer.toString("utf8", 0), 0 /* None */); - }, - writeFile: function (path, contents, writeByteOrderMark) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - throw "\"" + path + "\" exists but isn't a directory."; - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 509); - } - } - var start = new Date().getTime(); - mkdirRecursiveSync(_path.dirname(path)); - TypeScript.nodeMakeDirectoryTime += new Date().getTime() - start; - - if (writeByteOrderMark) { - contents = '\uFEFF' + contents; - } - - var start = new Date().getTime(); - - var chunkLength = 4 * 1024; - var fileDescriptor = _fs.openSync(path, "w"); - try { - for (var index = 0; index < contents.length; index += chunkLength) { - var bufferStart = new Date().getTime(); - var buffer = new Buffer(contents.substr(index, chunkLength), "utf8"); - TypeScript.nodeCreateBufferTime += new Date().getTime() - bufferStart; - - _fs.writeSync(fileDescriptor, buffer, 0, buffer.length, null); - } - } finally { - _fs.closeSync(fileDescriptor); - } - - TypeScript.nodeWriteFileSyncTime += new Date().getTime() - start; - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - deleteFile: function (path) { - try { - _fs.unlinkSync(path); - } catch (e) { - } - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }, - listFiles: function dir(path, spec, options) { - options = options || {}; - - function filesInFolder(folder) { - var paths = []; - - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "\\" + files[i]); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "\\" + files[i])); - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "\\" + files[i]); - } - } - - return paths; - } - - return filesInFolder(path); - }, - arguments: process.argv.slice(2), - standardOut: { - Write: function (str) { - process.stdout.write(str); - }, - WriteLine: function (str) { - process.stdout.write(str + '\n'); - }, - Close: function () { - } - } - }; - } - ; - - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - return getWindowsScriptHostEnvironment(); - } else if (typeof module !== 'undefined' && module.exports) { - return getNodeEnvironment(); - } else { - return null; - } - })(); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (IntegerUtilities) { - function integerDivide(numerator, denominator) { - return (numerator / denominator) >> 0; - } - IntegerUtilities.integerDivide = integerDivide; - - function integerMultiplyLow32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - - var resultLow32 = (((n1 & 0xffff0000) * n2) >>> 0) + (((n1 & 0x0000ffff) * n2) >>> 0) >>> 0; - return resultLow32; - } - IntegerUtilities.integerMultiplyLow32Bits = integerMultiplyLow32Bits; - - function integerMultiplyHigh32Bits(n1, n2) { - var n1Low16 = n1 & 0x0000ffff; - var n1High16 = n1 >>> 16; - - var n2Low16 = n2 & 0x0000ffff; - var n2High16 = n2 >>> 16; - - var resultHigh32 = n1High16 * n2High16 + ((((n1Low16 * n2Low16) >>> 17) + n1Low16 * n2High16) >>> 15); - return resultHigh32; - } - IntegerUtilities.integerMultiplyHigh32Bits = integerMultiplyHigh32Bits; - - function isInteger(text) { - return /^[0-9]+$/.test(text); - } - IntegerUtilities.isInteger = isInteger; - - function isHexInteger(text) { - return /^0(x|X)[0-9a-fA-F]+$/.test(text); - } - IntegerUtilities.isHexInteger = isHexInteger; - })(TypeScript.IntegerUtilities || (TypeScript.IntegerUtilities = {})); - var IntegerUtilities = TypeScript.IntegerUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineMap = (function () { - function LineMap(_computeLineStarts, length) { - this._computeLineStarts = _computeLineStarts; - this.length = length; - this._lineStarts = null; - } - LineMap.prototype.toJSON = function (key) { - return { lineStarts: this.lineStarts(), length: this.length }; - }; - - LineMap.prototype.equals = function (other) { - return this.length === other.length && TypeScript.ArrayUtilities.sequenceEquals(this.lineStarts(), other.lineStarts(), function (v1, v2) { - return v1 === v2; - }); - }; - - LineMap.prototype.lineStarts = function () { - if (this._lineStarts === null) { - this._lineStarts = this._computeLineStarts(); - } - - return this._lineStarts; - }; - - LineMap.prototype.lineCount = function () { - return this.lineStarts().length; - }; - - LineMap.prototype.getPosition = function (line, character) { - return this.lineStarts()[line] + character; - }; - - LineMap.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - if (position === this.length) { - return this.lineCount() - 1; - } - - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this.lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - - return lineNumber; - }; - - LineMap.prototype.getLineStartPosition = function (lineNumber) { - return this.lineStarts()[lineNumber]; - }; - - LineMap.prototype.fillLineAndCharacterFromPosition = function (position, lineAndCharacter) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - lineAndCharacter.line = lineNumber; - lineAndCharacter.character = position - this.lineStarts()[lineNumber]; - }; - - LineMap.prototype.getLineAndCharacterFromPosition = function (position) { - if (position < 0 || position > this.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - - return new TypeScript.LineAndCharacter(lineNumber, position - this.lineStarts()[lineNumber]); - }; - LineMap.empty = new LineMap(function () { - return [0]; - }, 0); - return LineMap; - })(); - TypeScript.LineMap = LineMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var LineAndCharacter = (function () { - function LineAndCharacter(line, character) { - this._line = 0; - this._character = 0; - if (line < 0) { - throw TypeScript.Errors.argumentOutOfRange("line"); - } - - if (character < 0) { - throw TypeScript.Errors.argumentOutOfRange("character"); - } - - this._line = line; - this._character = character; - } - LineAndCharacter.prototype.line = function () { - return this._line; - }; - - LineAndCharacter.prototype.character = function () { - return this._character; - }; - return LineAndCharacter; - })(); - TypeScript.LineAndCharacter = LineAndCharacter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var MathPrototype = (function () { - function MathPrototype() { - } - MathPrototype.max = function (a, b) { - return a >= b ? a : b; - }; - - MathPrototype.min = function (a, b) { - return a <= b ? a : b; - }; - return MathPrototype; - })(); - TypeScript.MathPrototype = MathPrototype; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Collections) { - Collections.DefaultStringTableCapacity = 256; - - var StringTableEntry = (function () { - function StringTableEntry(Text, HashCode, Next) { - this.Text = Text; - this.HashCode = HashCode; - this.Next = Next; - } - return StringTableEntry; - })(); - - var StringTable = (function () { - function StringTable(capacity) { - this.count = 0; - var size = TypeScript.Hash.getPrime(capacity); - this.entries = TypeScript.ArrayUtilities.createArray(size, null); - } - StringTable.prototype.addCharArray = function (key, start, len) { - var hashCode = TypeScript.Hash.computeSimple31BitCharArrayHashCode(key, start, len) & 0x7FFFFFFF; - - var entry = this.findCharArrayEntry(key, start, len, hashCode); - if (entry !== null) { - return entry.Text; - } - - var slice = key.slice(start, start + len); - return this.addEntry(TypeScript.StringUtilities.fromCharCodeArray(slice), hashCode); - }; - - StringTable.prototype.findCharArrayEntry = function (key, start, len, hashCode) { - for (var e = this.entries[hashCode % this.entries.length]; e !== null; e = e.Next) { - if (e.HashCode === hashCode && StringTable.textCharArrayEquals(e.Text, key, start, len)) { - return e; - } - } - - return null; - }; - - StringTable.prototype.addEntry = function (text, hashCode) { - var index = hashCode % this.entries.length; - - var e = new StringTableEntry(text, hashCode, this.entries[index]); - - this.entries[index] = e; - - if (this.count === this.entries.length) { - this.grow(); - } - - this.count++; - return e.Text; - }; - - StringTable.prototype.grow = function () { - var newSize = TypeScript.Hash.expandPrime(this.entries.length); - - var oldEntries = this.entries; - var newEntries = TypeScript.ArrayUtilities.createArray(newSize, null); - - this.entries = newEntries; - - for (var i = 0; i < oldEntries.length; i++) { - var e = oldEntries[i]; - while (e !== null) { - var newIndex = e.HashCode % newSize; - var tmp = e.Next; - e.Next = newEntries[newIndex]; - newEntries[newIndex] = e; - e = tmp; - } - } - }; - - StringTable.textCharArrayEquals = function (text, array, start, length) { - if (text.length !== length) { - return false; - } - - var s = start; - for (var i = 0; i < length; i++) { - if (text.charCodeAt(i) !== array[s]) { - return false; - } - - s++; - } - - return true; - }; - return StringTable; - })(); - Collections.StringTable = StringTable; - - Collections.DefaultStringTable = new StringTable(Collections.DefaultStringTableCapacity); - })(TypeScript.Collections || (TypeScript.Collections = {})); - var Collections = TypeScript.Collections; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var StringUtilities = (function () { - function StringUtilities() { - } - StringUtilities.isString = function (value) { - return Object.prototype.toString.apply(value, []) === '[object String]'; - }; - - StringUtilities.fromCharCodeArray = function (array) { - return String.fromCharCode.apply(null, array); - }; - - StringUtilities.endsWith = function (string, value) { - return string.substring(string.length - value.length, string.length) === value; - }; - - StringUtilities.startsWith = function (string, value) { - return string.substr(0, value.length) === value; - }; - - StringUtilities.copyTo = function (source, sourceIndex, destination, destinationIndex, count) { - for (var i = 0; i < count; i++) { - destination[destinationIndex + i] = source.charCodeAt(sourceIndex + i); - } - }; - - StringUtilities.repeat = function (value, count) { - return Array(count + 1).join(value); - }; - - StringUtilities.stringEquals = function (val1, val2) { - return val1 === val2; - }; - return StringUtilities; - })(); - TypeScript.StringUtilities = StringUtilities; -})(TypeScript || (TypeScript = {})); -var global = Function("return this").call(null); - -var TypeScript; -(function (TypeScript) { - var Clock; - (function (Clock) { - Clock.now; - Clock.resolution; - - if (typeof WScript !== "undefined" && typeof global['WScript'].InitializeProjection !== "undefined") { - global['WScript'].InitializeProjection(); - - Clock.now = function () { - return TestUtilities.QueryPerformanceCounter(); - }; - - Clock.resolution = TestUtilities.QueryPerformanceFrequency(); - } else { - Clock.now = function () { - return Date.now(); - }; - - Clock.resolution = 1000; - } - })(Clock || (Clock = {})); - - var Timer = (function () { - function Timer() { - this.time = 0; - } - Timer.prototype.start = function () { - this.time = 0; - this.startTime = Clock.now(); - }; - - Timer.prototype.end = function () { - this.time = (Clock.now() - this.startTime); - }; - return Timer; - })(); - TypeScript.Timer = Timer; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - DiagnosticCategory[DiagnosticCategory["NoPrefix"] = 3] = "NoPrefix"; - })(TypeScript.DiagnosticCategory || (TypeScript.DiagnosticCategory = {})); - var DiagnosticCategory = TypeScript.DiagnosticCategory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.diagnosticInformationMap = { - "error TS{0}: {1}": { - "code": 0, - "category": 3 /* NoPrefix */ - }, - "warning TS{0}: {1}": { - "code": 1, - "category": 3 /* NoPrefix */ - }, - "Unrecognized escape sequence.": { - "code": 1000, - "category": 1 /* Error */ - }, - "Unexpected character {0}.": { - "code": 1001, - "category": 1 /* Error */ - }, - "Missing close quote character.": { - "code": 1002, - "category": 1 /* Error */ - }, - "Identifier expected.": { - "code": 1003, - "category": 1 /* Error */ - }, - "'{0}' keyword expected.": { - "code": 1004, - "category": 1 /* Error */ - }, - "'{0}' expected.": { - "code": 1005, - "category": 1 /* Error */ - }, - "Identifier expected; '{0}' is a keyword.": { - "code": 1006, - "category": 1 /* Error */ - }, - "Automatic semicolon insertion not allowed.": { - "code": 1007, - "category": 1 /* Error */ - }, - "Unexpected token; '{0}' expected.": { - "code": 1008, - "category": 1 /* Error */ - }, - "Trailing separator not allowed.": { - "code": 1009, - "category": 1 /* Error */ - }, - "'*/' expected.": { - "code": 1010, - "category": 1 /* Error */ - }, - "'public' or 'private' modifier must precede 'static'.": { - "code": 1011, - "category": 1 /* Error */ - }, - "Unexpected token.": { - "code": 1012, - "category": 1 /* Error */ - }, - "Catch clause parameter cannot have a type annotation.": { - "code": 1013, - "category": 1 /* Error */ - }, - "Rest parameter must be last in list.": { - "code": 1014, - "category": 1 /* Error */ - }, - "Parameter cannot have question mark and initializer.": { - "code": 1015, - "category": 1 /* Error */ - }, - "Required parameter cannot follow optional parameter.": { - "code": 1016, - "category": 1 /* Error */ - }, - "Index signatures cannot have rest parameters.": { - "code": 1017, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have accessibility modifiers.": { - "code": 1018, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have a question mark.": { - "code": 1019, - "category": 1 /* Error */ - }, - "Index signature parameter cannot have an initializer.": { - "code": 1020, - "category": 1 /* Error */ - }, - "Index signature must have a type annotation.": { - "code": 1021, - "category": 1 /* Error */ - }, - "Index signature parameter must have a type annotation.": { - "code": 1022, - "category": 1 /* Error */ - }, - "Index signature parameter type must be 'string' or 'number'.": { - "code": 1023, - "category": 1 /* Error */ - }, - "'extends' clause already seen.": { - "code": 1024, - "category": 1 /* Error */ - }, - "'extends' clause must precede 'implements' clause.": { - "code": 1025, - "category": 1 /* Error */ - }, - "Classes can only extend a single class.": { - "code": 1026, - "category": 1 /* Error */ - }, - "'implements' clause already seen.": { - "code": 1027, - "category": 1 /* Error */ - }, - "Accessibility modifier already seen.": { - "code": 1028, - "category": 1 /* Error */ - }, - "'{0}' modifier must precede '{1}' modifier.": { - "code": 1029, - "category": 1 /* Error */ - }, - "'{0}' modifier already seen.": { - "code": 1030, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a class element.": { - "code": 1031, - "category": 1 /* Error */ - }, - "Interface declaration cannot have 'implements' clause.": { - "code": 1032, - "category": 1 /* Error */ - }, - "'super' invocation cannot have type arguments.": { - "code": 1034, - "category": 1 /* Error */ - }, - "Only ambient modules can use quoted names.": { - "code": 1035, - "category": 1 /* Error */ - }, - "Statements are not allowed in ambient contexts.": { - "code": 1036, - "category": 1 /* Error */ - }, - "Implementations are not allowed in ambient contexts.": { - "code": 1037, - "category": 1 /* Error */ - }, - "'declare' modifier not allowed for code already in an ambient context.": { - "code": 1038, - "category": 1 /* Error */ - }, - "Initializers are not allowed in ambient contexts.": { - "code": 1039, - "category": 1 /* Error */ - }, - "Parameter property declarations can only be used in a non-ambient constructor declaration.": { - "code": 1040, - "category": 1 /* Error */ - }, - "Function implementation expected.": { - "code": 1041, - "category": 1 /* Error */ - }, - "Constructor implementation expected.": { - "code": 1042, - "category": 1 /* Error */ - }, - "Function overload name must be '{0}'.": { - "code": 1043, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a module element.": { - "code": 1044, - "category": 1 /* Error */ - }, - "'declare' modifier cannot appear on an interface declaration.": { - "code": 1045, - "category": 1 /* Error */ - }, - "'declare' modifier required for top level element.": { - "code": 1046, - "category": 1 /* Error */ - }, - "Rest parameter cannot be optional.": { - "code": 1047, - "category": 1 /* Error */ - }, - "Rest parameter cannot have an initializer.": { - "code": 1048, - "category": 1 /* Error */ - }, - "'set' accessor must have one and only one parameter.": { - "code": 1049, - "category": 1 /* Error */ - }, - "'set' accessor parameter cannot be optional.": { - "code": 1051, - "category": 1 /* Error */ - }, - "'set' accessor parameter cannot have an initializer.": { - "code": 1052, - "category": 1 /* Error */ - }, - "'set' accessor cannot have rest parameter.": { - "code": 1053, - "category": 1 /* Error */ - }, - "'get' accessor cannot have parameters.": { - "code": 1054, - "category": 1 /* Error */ - }, - "Modifiers cannot appear here.": { - "code": 1055, - "category": 1 /* Error */ - }, - "Accessors are only available when targeting ECMAScript 5 and higher.": { - "code": 1056, - "category": 1 /* Error */ - }, - "Class name cannot be '{0}'.": { - "code": 1057, - "category": 1 /* Error */ - }, - "Interface name cannot be '{0}'.": { - "code": 1058, - "category": 1 /* Error */ - }, - "Enum name cannot be '{0}'.": { - "code": 1059, - "category": 1 /* Error */ - }, - "Module name cannot be '{0}'.": { - "code": 1060, - "category": 1 /* Error */ - }, - "Enum member must have initializer.": { - "code": 1061, - "category": 1 /* Error */ - }, - "Export assignment cannot be used in internal modules.": { - "code": 1063, - "category": 1 /* Error */ - }, - "Export assignment not allowed in module with exported element.": { - "code": 1064, - "category": 1 /* Error */ - }, - "Module cannot have multiple export assignments.": { - "code": 1065, - "category": 1 /* Error */ - }, - "Ambient enum elements can only have integer literal initializers.": { - "code": 1066, - "category": 1 /* Error */ - }, - "module, class, interface, enum, import or statement": { - "code": 1067, - "category": 3 /* NoPrefix */ - }, - "constructor, function, accessor or variable": { - "code": 1068, - "category": 3 /* NoPrefix */ - }, - "statement": { - "code": 1069, - "category": 3 /* NoPrefix */ - }, - "case or default clause": { - "code": 1070, - "category": 3 /* NoPrefix */ - }, - "identifier": { - "code": 1071, - "category": 3 /* NoPrefix */ - }, - "call, construct, index, property or function signature": { - "code": 1072, - "category": 3 /* NoPrefix */ - }, - "expression": { - "code": 1073, - "category": 3 /* NoPrefix */ - }, - "type name": { - "code": 1074, - "category": 3 /* NoPrefix */ - }, - "property or accessor": { - "code": 1075, - "category": 3 /* NoPrefix */ - }, - "parameter": { - "code": 1076, - "category": 3 /* NoPrefix */ - }, - "type": { - "code": 1077, - "category": 3 /* NoPrefix */ - }, - "type parameter": { - "code": 1078, - "category": 3 /* NoPrefix */ - }, - "'declare' modifier not allowed on import declaration.": { - "code": 1079, - "category": 1 /* Error */ - }, - "Function overload must be static.": { - "code": 1080, - "category": 1 /* Error */ - }, - "Function overload must not be static.": { - "code": 1081, - "category": 1 /* Error */ - }, - "Parameter property declarations cannot be used in a constructor overload.": { - "code": 1083, - "category": 1 /* Error */ - }, - "Invalid 'reference' directive syntax.": { - "code": 1084, - "category": 1 /* Error */ - }, - "Octal literals are not available when targeting ECMAScript 5 and higher.": { - "code": 1085, - "category": 1 /* Error */ - }, - "Accessors are not allowed in ambient contexts.": { - "code": 1086, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a constructor declaration.": { - "code": 1089, - "category": 1 /* Error */ - }, - "'{0}' modifier cannot appear on a parameter.": { - "code": 1090, - "category": 1 /* Error */ - }, - "Only a single variable declaration is allowed in a 'for...in' statement.": { - "code": 1091, - "category": 1 /* Error */ - }, - "Type parameters cannot appear on a constructor declaration.": { - "code": 1091, - "category": 1 /* Error */ - }, - "Type annotation cannot appear on a constructor declaration.": { - "code": 1092, - "category": 1 /* Error */ - }, - "Duplicate identifier '{0}'.": { - "code": 2000, - "category": 1 /* Error */ - }, - "The name '{0}' does not exist in the current scope.": { - "code": 2001, - "category": 1 /* Error */ - }, - "The name '{0}' does not refer to a value.": { - "code": 2002, - "category": 1 /* Error */ - }, - "'super' can only be used inside a class instance method.": { - "code": 2003, - "category": 1 /* Error */ - }, - "The left-hand side of an assignment expression must be a variable, property or indexer.": { - "code": 2004, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not callable. Did you mean to include 'new'?": { - "code": 2161, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not callable.": { - "code": 2006, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not newable.": { - "code": 2007, - "category": 1 /* Error */ - }, - "Value of type '{0}' is not indexable by type '{1}'.": { - "code": 2008, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}'.": { - "code": 2009, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to types '{1}' and '{2}': {3}": { - "code": 2010, - "category": 1 /* Error */ - }, - "Cannot convert '{0}' to '{1}'.": { - "code": 2011, - "category": 1 /* Error */ - }, - "Cannot convert '{0}' to '{1}':{NL}{2}": { - "code": 2012, - "category": 1 /* Error */ - }, - "Expected var, class, interface, or module.": { - "code": 2013, - "category": 1 /* Error */ - }, - "Operator '{0}' cannot be applied to type '{1}'.": { - "code": 2014, - "category": 1 /* Error */ - }, - "Getter '{0}' already declared.": { - "code": 2015, - "category": 1 /* Error */ - }, - "Setter '{0}' already declared.": { - "code": 2016, - "category": 1 /* Error */ - }, - "Exported class '{0}' extends private class '{1}'.": { - "code": 2018, - "category": 1 /* Error */ - }, - "Exported class '{0}' implements private interface '{1}'.": { - "code": 2019, - "category": 1 /* Error */ - }, - "Exported interface '{0}' extends private interface '{1}'.": { - "code": 2020, - "category": 1 /* Error */ - }, - "Exported class '{0}' extends class from inaccessible module {1}.": { - "code": 2021, - "category": 1 /* Error */ - }, - "Exported class '{0}' implements interface from inaccessible module {1}.": { - "code": 2022, - "category": 1 /* Error */ - }, - "Exported interface '{0}' extends interface from inaccessible module {1}.": { - "code": 2023, - "category": 1 /* Error */ - }, - "Public static property '{0}' of exported class has or is using private type '{1}'.": { - "code": 2024, - "category": 1 /* Error */ - }, - "Public property '{0}' of exported class has or is using private type '{1}'.": { - "code": 2025, - "category": 1 /* Error */ - }, - "Property '{0}' of exported interface has or is using private type '{1}'.": { - "code": 2026, - "category": 1 /* Error */ - }, - "Exported variable '{0}' has or is using private type '{1}'.": { - "code": 2027, - "category": 1 /* Error */ - }, - "Public static property '{0}' of exported class is using inaccessible module {1}.": { - "code": 2028, - "category": 1 /* Error */ - }, - "Public property '{0}' of exported class is using inaccessible module {1}.": { - "code": 2029, - "category": 1 /* Error */ - }, - "Property '{0}' of exported interface is using inaccessible module {1}.": { - "code": 2030, - "category": 1 /* Error */ - }, - "Exported variable '{0}' is using inaccessible module {1}.": { - "code": 2031, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor from exported class has or is using private type '{1}'.": { - "code": 2032, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static property setter from exported class has or is using private type '{1}'.": { - "code": 2033, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public property setter from exported class has or is using private type '{1}'.": { - "code": 2034, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { - "code": 2035, - "category": 1 /* Error */ - }, - "Parameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { - "code": 2036, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static method from exported class has or is using private type '{1}'.": { - "code": 2037, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public method from exported class has or is using private type '{1}'.": { - "code": 2038, - "category": 1 /* Error */ - }, - "Parameter '{0}' of method from exported interface has or is using private type '{1}'.": { - "code": 2039, - "category": 1 /* Error */ - }, - "Parameter '{0}' of exported function has or is using private type '{1}'.": { - "code": 2040, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor from exported class is using inaccessible module {1}.": { - "code": 2041, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static property setter from exported class is using inaccessible module {1}.": { - "code": 2042, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public property setter from exported class is using inaccessible module {1}.": { - "code": 2043, - "category": 1 /* Error */ - }, - "Parameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { - "code": 2044, - "category": 1 /* Error */ - }, - "Parameter '{0}' of call signature from exported interface is using inaccessible module {1}": { - "code": 2045, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public static method from exported class is using inaccessible module {1}.": { - "code": 2046, - "category": 1 /* Error */ - }, - "Parameter '{0}' of public method from exported class is using inaccessible module {1}.": { - "code": 2047, - "category": 1 /* Error */ - }, - "Parameter '{0}' of method from exported interface is using inaccessible module {1}.": { - "code": 2048, - "category": 1 /* Error */ - }, - "Parameter '{0}' of exported function is using inaccessible module {1}.": { - "code": 2049, - "category": 1 /* Error */ - }, - "Return type of public static property getter from exported class has or is using private type '{0}'.": { - "code": 2050, - "category": 1 /* Error */ - }, - "Return type of public property getter from exported class has or is using private type '{0}'.": { - "code": 2051, - "category": 1 /* Error */ - }, - "Return type of constructor signature from exported interface has or is using private type '{0}'.": { - "code": 2052, - "category": 1 /* Error */ - }, - "Return type of call signature from exported interface has or is using private type '{0}'.": { - "code": 2053, - "category": 1 /* Error */ - }, - "Return type of index signature from exported interface has or is using private type '{0}'.": { - "code": 2054, - "category": 1 /* Error */ - }, - "Return type of public static method from exported class has or is using private type '{0}'.": { - "code": 2055, - "category": 1 /* Error */ - }, - "Return type of public method from exported class has or is using private type '{0}'.": { - "code": 2056, - "category": 1 /* Error */ - }, - "Return type of method from exported interface has or is using private type '{0}'.": { - "code": 2057, - "category": 1 /* Error */ - }, - "Return type of exported function has or is using private type '{0}'.": { - "code": 2058, - "category": 1 /* Error */ - }, - "Return type of public static property getter from exported class is using inaccessible module {0}.": { - "code": 2059, - "category": 1 /* Error */ - }, - "Return type of public property getter from exported class is using inaccessible module {0}.": { - "code": 2060, - "category": 1 /* Error */ - }, - "Return type of constructor signature from exported interface is using inaccessible module {0}.": { - "code": 2061, - "category": 1 /* Error */ - }, - "Return type of call signature from exported interface is using inaccessible module {0}.": { - "code": 2062, - "category": 1 /* Error */ - }, - "Return type of index signature from exported interface is using inaccessible module {0}.": { - "code": 2063, - "category": 1 /* Error */ - }, - "Return type of public static method from exported class is using inaccessible module {0}.": { - "code": 2064, - "category": 1 /* Error */ - }, - "Return type of public method from exported class is using inaccessible module {0}.": { - "code": 2065, - "category": 1 /* Error */ - }, - "Return type of method from exported interface is using inaccessible module {0}.": { - "code": 2066, - "category": 1 /* Error */ - }, - "Return type of exported function is using inaccessible module {0}.": { - "code": 2067, - "category": 1 /* Error */ - }, - "'new T[]' cannot be used to create an array. Use 'new Array()' instead.": { - "code": 2068, - "category": 1 /* Error */ - }, - "A parameter list must follow a generic type argument list. '(' expected.": { - "code": 2069, - "category": 1 /* Error */ - }, - "Multiple constructor implementations are not allowed.": { - "code": 2070, - "category": 1 /* Error */ - }, - "Unable to resolve external module '{0}'.": { - "code": 2071, - "category": 1 /* Error */ - }, - "Module cannot be aliased to a non-module type.": { - "code": 2072, - "category": 1 /* Error */ - }, - "A class may only extend another class.": { - "code": 2073, - "category": 1 /* Error */ - }, - "A class may only implement another class or interface.": { - "code": 2074, - "category": 1 /* Error */ - }, - "An interface may only extend another class or interface.": { - "code": 2075, - "category": 1 /* Error */ - }, - "Unable to resolve type.": { - "code": 2077, - "category": 1 /* Error */ - }, - "Unable to resolve type of '{0}'.": { - "code": 2078, - "category": 1 /* Error */ - }, - "Unable to resolve type parameter constraint.": { - "code": 2079, - "category": 1 /* Error */ - }, - "Type parameter constraint cannot be a primitive type.": { - "code": 2080, - "category": 1 /* Error */ - }, - "Supplied parameters do not match any signature of call target.": { - "code": 2081, - "category": 1 /* Error */ - }, - "Supplied parameters do not match any signature of call target:{NL}{0}": { - "code": 2082, - "category": 1 /* Error */ - }, - "Invalid 'new' expression.": { - "code": 2083, - "category": 1 /* Error */ - }, - "Call signatures used in a 'new' expression must have a 'void' return type.": { - "code": 2084, - "category": 1 /* Error */ - }, - "Could not select overload for 'new' expression.": { - "code": 2085, - "category": 1 /* Error */ - }, - "Type '{0}' does not satisfy the constraint '{1}' for type parameter '{2}'.": { - "code": 2086, - "category": 1 /* Error */ - }, - "Could not select overload for 'call' expression.": { - "code": 2087, - "category": 1 /* Error */ - }, - "Cannot invoke an expression whose type lacks a call signature.": { - "code": 2088, - "category": 1 /* Error */ - }, - "Calls to 'super' are only valid inside a class.": { - "code": 2089, - "category": 1 /* Error */ - }, - "Generic type '{0}' requires {1} type argument(s).": { - "code": 2090, - "category": 1 /* Error */ - }, - "Type of array literal cannot be determined. Best common type could not be found for array elements.": { - "code": 2092, - "category": 1 /* Error */ - }, - "Could not find enclosing symbol for dotted name '{0}'.": { - "code": 2093, - "category": 1 /* Error */ - }, - "The property '{0}' does not exist on value of type '{1}'.": { - "code": 2094, - "category": 1 /* Error */ - }, - "Could not find symbol '{0}'.": { - "code": 2095, - "category": 1 /* Error */ - }, - "'get' and 'set' accessor must have the same type.": { - "code": 2096, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in current location.": { - "code": 2097, - "category": 1 /* Error */ - }, - "Static members cannot reference class type parameters.": { - "code": 2099, - "category": 1 /* Error */ - }, - "Class '{0}' is recursively referenced as a base type of itself.": { - "code": 2100, - "category": 1 /* Error */ - }, - "Interface '{0}' is recursively referenced as a base type of itself.": { - "code": 2101, - "category": 1 /* Error */ - }, - "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class.": { - "code": 2102, - "category": 1 /* Error */ - }, - "'super' cannot be referenced in non-derived classes.": { - "code": 2103, - "category": 1 /* Error */ - }, - "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.": { - "code": 2104, - "category": 1 /* Error */ - }, - "Constructors for derived classes must contain a 'super' call.": { - "code": 2105, - "category": 1 /* Error */ - }, - "Super calls are not permitted outside constructors or in nested functions inside constructors.": { - "code": 2106, - "category": 1 /* Error */ - }, - "'{0}.{1}' is inaccessible.": { - "code": 2107, - "category": 1 /* Error */ - }, - "'this' cannot be referenced within module bodies.": { - "code": 2108, - "category": 1 /* Error */ - }, - "Invalid '+' expression - types not known to support the addition operator.": { - "code": 2111, - "category": 1 /* Error */ - }, - "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "code": 2112, - "category": 1 /* Error */ - }, - "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.": { - "code": 2113, - "category": 1 /* Error */ - }, - "The type of a unary arithmetic operation operand must be of type 'any', 'number' or an enum type.": { - "code": 2114, - "category": 1 /* Error */ - }, - "Variable declarations of a 'for' statement cannot use a type annotation.": { - "code": 2115, - "category": 1 /* Error */ - }, - "Variable declarations of a 'for' statement must be of types 'string' or 'any'.": { - "code": 2116, - "category": 1 /* Error */ - }, - "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.": { - "code": 2117, - "category": 1 /* Error */ - }, - "The left-hand side of an 'in' expression must be of types 'any', 'string' or 'number'.": { - "code": 2118, - "category": 1 /* Error */ - }, - "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.": { - "code": 2119, - "category": 1 /* Error */ - }, - "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.": { - "code": 2120, - "category": 1 /* Error */ - }, - "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type.": { - "code": 2121, - "category": 1 /* Error */ - }, - "Setters cannot return a value.": { - "code": 2122, - "category": 1 /* Error */ - }, - "Tried to query type of uninitialized module '{0}'.": { - "code": 2123, - "category": 1 /* Error */ - }, - "Tried to set variable type to uninitialized module type '{0}'.": { - "code": 2124, - "category": 1 /* Error */ - }, - "Type '{0}' does not have type parameters.": { - "code": 2125, - "category": 1 /* Error */ - }, - "Getters must return a value.": { - "code": 2126, - "category": 1 /* Error */ - }, - "Getter and setter accessors do not agree in visibility.": { - "code": 2127, - "category": 1 /* Error */ - }, - "Invalid left-hand side of assignment expression.": { - "code": 2130, - "category": 1 /* Error */ - }, - "Function declared a non-void return type, but has no return expression.": { - "code": 2131, - "category": 1 /* Error */ - }, - "Cannot resolve return type reference.": { - "code": 2132, - "category": 1 /* Error */ - }, - "Constructors cannot have a return type of 'void'.": { - "code": 2133, - "category": 1 /* Error */ - }, - "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": { - "code": 2134, - "category": 1 /* Error */ - }, - "All symbols within a with block will be resolved to 'any'.": { - "code": 2135, - "category": 1 /* Error */ - }, - "Import declarations in an internal module cannot reference an external module.": { - "code": 2136, - "category": 1 /* Error */ - }, - "Class {0} declares interface {1} but does not implement it:{NL}{2}": { - "code": 2137, - "category": 1 /* Error */ - }, - "Class {0} declares class {1} as an interface but does not implement it:{NL}{2}": { - "code": 2138, - "category": 1 /* Error */ - }, - "The operand of an increment or decrement operator must be a variable, property or indexer.": { - "code": 2139, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in static initializers in a class body.": { - "code": 2140, - "category": 1 /* Error */ - }, - "Class '{0}' cannot extend class '{1}':{NL}{2}": { - "code": 2141, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot extend class '{1}':{NL}{2}": { - "code": 2142, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot extend interface '{1}':{NL}{2}": { - "code": 2143, - "category": 1 /* Error */ - }, - "Duplicate overload signature for '{0}'.": { - "code": 2144, - "category": 1 /* Error */ - }, - "Duplicate constructor overload signature.": { - "code": 2145, - "category": 1 /* Error */ - }, - "Duplicate overload call signature.": { - "code": 2146, - "category": 1 /* Error */ - }, - "Duplicate overload construct signature.": { - "code": 2147, - "category": 1 /* Error */ - }, - "Overload signature is not compatible with function definition.": { - "code": 2148, - "category": 1 /* Error */ - }, - "Overload signature is not compatible with function definition:{NL}{0}": { - "code": 2149, - "category": 1 /* Error */ - }, - "Overload signatures must all be public or private.": { - "code": 2150, - "category": 1 /* Error */ - }, - "Overload signatures must all be exported or not exported.": { - "code": 2151, - "category": 1 /* Error */ - }, - "Overload signatures must all be ambient or non-ambient.": { - "code": 2152, - "category": 1 /* Error */ - }, - "Overload signatures must all be optional or required.": { - "code": 2153, - "category": 1 /* Error */ - }, - "Specialized overload signature is not assignable to any non-specialized signature.": { - "code": 2154, - "category": 1 /* Error */ - }, - "'this' cannot be referenced in constructor arguments.": { - "code": 2155, - "category": 1 /* Error */ - }, - "Instance member cannot be accessed off a class.": { - "code": 2157, - "category": 1 /* Error */ - }, - "Untyped function calls may not accept type arguments.": { - "code": 2158, - "category": 1 /* Error */ - }, - "Non-generic functions may not accept type arguments.": { - "code": 2159, - "category": 1 /* Error */ - }, - "A generic type may not reference itself with a wrapped form of its own type parameters.": { - "code": 2160, - "category": 1 /* Error */ - }, - "Rest parameters must be array types.": { - "code": 2162, - "category": 1 /* Error */ - }, - "Overload signature implementation cannot use specialized type.": { - "code": 2163, - "category": 1 /* Error */ - }, - "Export assignments may only be used at the top-level of external modules.": { - "code": 2164, - "category": 1 /* Error */ - }, - "Export assignments may only be made with variables, functions, classes, interfaces, enums and internal modules.": { - "code": 2165, - "category": 1 /* Error */ - }, - "Only public methods of the base class are accessible via the 'super' keyword.": { - "code": 2166, - "category": 1 /* Error */ - }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}'.": { - "code": 2167, - "category": 1 /* Error */ - }, - "Numeric indexer type '{0}' must be assignable to string indexer type '{1}':{NL}{2}": { - "code": 2168, - "category": 1 /* Error */ - }, - "All numerically named properties must be assignable to numeric indexer type '{0}'.": { - "code": 2169, - "category": 1 /* Error */ - }, - "All numerically named properties must be assignable to numeric indexer type '{0}':{NL}{1}": { - "code": 2170, - "category": 1 /* Error */ - }, - "All named properties must be assignable to string indexer type '{0}'.": { - "code": 2171, - "category": 1 /* Error */ - }, - "All named properties must be assignable to string indexer type '{0}':{NL}{1}": { - "code": 2172, - "category": 1 /* Error */ - }, - "Generic type references must include all type arguments.": { - "code": 2173, - "category": 1 /* Error */ - }, - "Default arguments are only allowed in implementation.": { - "code": 2174, - "category": 1 /* Error */ - }, - "Overloads cannot differ only by return type.": { - "code": 2175, - "category": 1 /* Error */ - }, - "Function expression declared a non-void return type, but has no return expression.": { - "code": 2176, - "category": 1 /* Error */ - }, - "Import declaration referencing identifier from internal module can only be made with variables, functions, classes, interfaces, enums and internal modules.": { - "code": 2177, - "category": 1 /* Error */ - }, - "Could not find symbol '{0}' in module '{1}'.": { - "code": 2178, - "category": 1 /* Error */ - }, - "Unable to resolve module reference '{0}'.": { - "code": 2179, - "category": 1 /* Error */ - }, - "Could not find module '{0}' in module '{1}'.": { - "code": 2180, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned value with type that has or is using private type '{1}'.": { - "code": 2181, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned value with type that is using inaccessible module '{1}'.": { - "code": 2182, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned type that has or is using private type '{1}'.": { - "code": 2183, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned type that is using inaccessible module '{1}'.": { - "code": 2184, - "category": 1 /* Error */ - }, - "Exported import declaration '{0}' is assigned container that is or is using inaccessible module '{1}'.": { - "code": 2185, - "category": 1 /* Error */ - }, - "Type name '{0}' in extends clause does not reference constructor function for '{1}'.": { - "code": 2186, - "category": 1 /* Error */ - }, - "Internal module reference '{0}' in import declaration does not reference module instance for '{1}'.": { - "code": 2187, - "category": 1 /* Error */ - }, - "Module '{0}' cannot merge with previous declaration of '{1}' in a different file '{2}'.": { - "code": 2188, - "category": 1 /* Error */ - }, - "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}':{NL}{3}": { - "code": 2189, - "category": 1 /* Error */ - }, - "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it.": { - "code": 2190, - "category": 1 /* Error */ - }, - "Ambient external module declaration cannot be reopened.": { - "code": 2191, - "category": 1 /* Error */ - }, - "All declarations of merged declaration '{0}' must be exported or not exported.": { - "code": 2192, - "category": 1 /* Error */ - }, - "'super' cannot be referenced in constructor arguments.": { - "code": 2193, - "category": 1 /* Error */ - }, - "Return type of constructor signature must be assignable to the instance type of the class.": { - "code": 2194, - "category": 1 /* Error */ - }, - "Ambient external module declaration must be defined in global context.": { - "code": 2195, - "category": 1 /* Error */ - }, - "Ambient external module declaration cannot specify relative module name.": { - "code": 2196, - "category": 1 /* Error */ - }, - "Import declaration in an ambient external module declaration cannot reference external module through relative external module name.": { - "code": 2197, - "category": 1 /* Error */ - }, - "Could not find the best common type of types of all return statement expressions.": { - "code": 2198, - "category": 1 /* Error */ - }, - "Import declaration cannot refer to external module reference when --noResolve option is set.": { - "code": 2199, - "category": 1 /* Error */ - }, - "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference.": { - "code": 2200, - "category": 1 /* Error */ - }, - "'continue' statement can only be used within an enclosing iteration statement.": { - "code": 2201, - "category": 1 /* Error */ - }, - "'break' statement can only be used within an enclosing iteration or switch statement.": { - "code": 2202, - "category": 1 /* Error */ - }, - "Jump target not found.": { - "code": 2203, - "category": 1 /* Error */ - }, - "Jump target cannot cross function boundary.": { - "code": 2204, - "category": 1 /* Error */ - }, - "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference.": { - "code": 2205, - "category": 1 /* Error */ - }, - "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference.": { - "code": 2206, - "category": 1 /* Error */ - }, - "Expression resolves to '_super' that compiler uses to capture base class reference.": { - "code": 2207, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of constructor signature from exported interface has or is using private type '{1}'.": { - "code": 2208, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of call signature from exported interface has or is using private type '{1}'.": { - "code": 2209, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public static method from exported class has or is using private type '{1}'.": { - "code": 2210, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public method from exported class has or is using private type '{1}'.": { - "code": 2211, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of method from exported interface has or is using private type '{1}'.": { - "code": 2212, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported function has or is using private type '{1}'.": { - "code": 2213, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of constructor signature from exported interface is using inaccessible module {1}.": { - "code": 2214, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of call signature from exported interface is using inaccessible module {1}": { - "code": 2215, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public static method from exported class is using inaccessible module {1}.": { - "code": 2216, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of public method from exported class is using inaccessible module {1}.": { - "code": 2217, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of method from exported interface is using inaccessible module {1}.": { - "code": 2218, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported function is using inaccessible module {1}.": { - "code": 2219, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported class has or is using private type '{1}'.": { - "code": 2220, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported interface has or is using private type '{1}'.": { - "code": 2221, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported class is using inaccessible module {1}.": { - "code": 2222, - "category": 1 /* Error */ - }, - "TypeParameter '{0}' of exported interface is using inaccessible module {1}.": { - "code": 2223, - "category": 1 /* Error */ - }, - "Duplicate identifier '_i'. Compiler uses '_i' to initialize rest parameter.": { - "code": 2224, - "category": 1 /* Error */ - }, - "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters.": { - "code": 2225, - "category": 1 /* Error */ - }, - "Type of conditional '{0}' must be identical to '{1}' or '{2}'.": { - "code": 2226, - "category": 1 /* Error */ - }, - "Type of conditional '{0}' must be identical to '{1}', '{2}' or '{3}'.": { - "code": 2227, - "category": 1 /* Error */ - }, - "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of an external module.": { - "code": 2228, - "category": 1 /* Error */ - }, - "Constraint of a type parameter cannot reference any type parameter from the same type parameter list.": { - "code": 2229, - "category": 1 /* Error */ - }, - "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": { - "code": 2230, - "category": 1 /* Error */ - }, - "Parameter '{0}' cannot be referenced in its initializer.": { - "code": 2231, - "category": 1 /* Error */ - }, - "Duplicate string index signature.": { - "code": 2232, - "category": 1 /* Error */ - }, - "Duplicate number index signature.": { - "code": 2233, - "category": 1 /* Error */ - }, - "All declarations of an interface must have identical type parameters.": { - "code": 2234, - "category": 1 /* Error */ - }, - "Expression resolves to variable declaration '_i' that compiler uses to initialize rest parameter.": { - "code": 2235, - "category": 1 /* Error */ - }, - "Type '{0}' is missing property '{1}' from type '{2}'.": { - "code": 4000, - "category": 3 /* NoPrefix */ - }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible.": { - "code": 4001, - "category": 3 /* NoPrefix */ - }, - "Types of property '{0}' of types '{1}' and '{2}' are incompatible:{NL}{3}": { - "code": 4002, - "category": 3 /* NoPrefix */ - }, - "Property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { - "code": 4003, - "category": 3 /* NoPrefix */ - }, - "Property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { - "code": 4004, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' define property '{2}' as private.": { - "code": 4005, - "category": 3 /* NoPrefix */ - }, - "Call signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4006, - "category": 3 /* NoPrefix */ - }, - "Call signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4007, - "category": 3 /* NoPrefix */ - }, - "Type '{0}' requires a call signature, but type '{1}' lacks one.": { - "code": 4008, - "category": 3 /* NoPrefix */ - }, - "Construct signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4009, - "category": 3 /* NoPrefix */ - }, - "Construct signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4010, - "category": 3 /* NoPrefix */ - }, - "Type '{0}' requires a construct signature, but type '{1}' lacks one.": { - "code": 4011, - "category": 3 /* NoPrefix */ - }, - "Index signatures of types '{0}' and '{1}' are incompatible.": { - "code": 4012, - "category": 3 /* NoPrefix */ - }, - "Index signatures of types '{0}' and '{1}' are incompatible:{NL}{2}": { - "code": 4013, - "category": 3 /* NoPrefix */ - }, - "Call signature expects {0} or fewer parameters.": { - "code": 4014, - "category": 3 /* NoPrefix */ - }, - "Could not apply type '{0}' to argument {1} which is of type '{2}'.": { - "code": 4015, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function.": { - "code": 4016, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function.": { - "code": 4017, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor.": { - "code": 4018, - "category": 3 /* NoPrefix */ - }, - "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property.": { - "code": 4019, - "category": 3 /* NoPrefix */ - }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible.": { - "code": 4020, - "category": 3 /* NoPrefix */ - }, - "Types of static property '{0}' of class '{1}' and class '{2}' are incompatible:{NL}{3}": { - "code": 4021, - "category": 3 /* NoPrefix */ - }, - "Type reference cannot refer to container '{0}'.": { - "code": 4022, - "category": 1 /* Error */ - }, - "Type reference must refer to type.": { - "code": 4023, - "category": 1 /* Error */ - }, - "In enums with multiple declarations only one declaration can omit an initializer for the first enum element.": { - "code": 4024, - "category": 1 /* Error */ - }, - " (+ {0} overload(s))": { - "code": 4025, - "category": 2 /* Message */ - }, - "Variable declaration cannot have the same name as an import declaration.": { - "code": 4026, - "category": 1 /* Error */ - }, - "Signature expected {0} type arguments, got {1} instead.": { - "code": 4027, - "category": 1 /* Error */ - }, - "Property '{0}' defined as optional in type '{1}', but is required in type '{2}'.": { - "code": 4028, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference do not refer to same named type.": { - "code": 4029, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments.": { - "code": 4030, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' originating in infinitely expanding type reference have incompatible type arguments:{NL}{2}": { - "code": 4031, - "category": 3 /* NoPrefix */ - }, - "Named properties '{0}' of types '{1}' and '{2}' are not identical.": { - "code": 4032, - "category": 3 /* NoPrefix */ - }, - "Types of string indexer of types '{0}' and '{1}' are not identical.": { - "code": 4033, - "category": 3 /* NoPrefix */ - }, - "Types of number indexer of types '{0}' and '{1}' are not identical.": { - "code": 4034, - "category": 3 /* NoPrefix */ - }, - "Type of number indexer in type '{0}' is not assignable to string indexer type in type '{1}'.{NL}{2}": { - "code": 4035, - "category": 3 /* NoPrefix */ - }, - "Type of property '{0}' in type '{1}' is not assignable to string indexer type in type '{2}'.{NL}{3}": { - "code": 4036, - "category": 3 /* NoPrefix */ - }, - "Type of property '{0}' in type '{1}' is not assignable to number indexer type in type '{2}'.{NL}{3}": { - "code": 4037, - "category": 3 /* NoPrefix */ - }, - "Static property '{0}' defined as private in type '{1}' is defined as public in type '{2}'.": { - "code": 4038, - "category": 3 /* NoPrefix */ - }, - "Static property '{0}' defined as public in type '{1}' is defined as private in type '{2}'.": { - "code": 4039, - "category": 3 /* NoPrefix */ - }, - "Types '{0}' and '{1}' define static property '{2}' as private.": { - "code": 4040, - "category": 3 /* NoPrefix */ - }, - "Current host does not support '{0}' option.": { - "code": 5001, - "category": 1 /* Error */ - }, - "ECMAScript target version '{0}' not supported. Specify a valid target version: '{1}' (default), or '{2}'": { - "code": 5002, - "category": 1 /* Error */ - }, - "Module code generation '{0}' not supported.": { - "code": 5003, - "category": 1 /* Error */ - }, - "Could not find file: '{0}'.": { - "code": 5004, - "category": 1 /* Error */ - }, - "A file cannot have a reference to itself.": { - "code": 5006, - "category": 1 /* Error */ - }, - "Cannot resolve referenced file: '{0}'.": { - "code": 5007, - "category": 1 /* Error */ - }, - "Cannot find the common subdirectory path for the input files.": { - "code": 5009, - "category": 1 /* Error */ - }, - "Emit Error: {0}.": { - "code": 5011, - "category": 1 /* Error */ - }, - "Cannot read file '{0}': {1}": { - "code": 5012, - "category": 1 /* Error */ - }, - "Unsupported file encoding.": { - "code": 5013, - "category": 3 /* NoPrefix */ - }, - "Locale must be of the form or -. For example '{0}' or '{1}'.": { - "code": 5014, - "category": 1 /* Error */ - }, - "Unsupported locale: '{0}'.": { - "code": 5015, - "category": 1 /* Error */ - }, - "Execution Failed.{NL}": { - "code": 5016, - "category": 1 /* Error */ - }, - "Invalid call to 'up'": { - "code": 5019, - "category": 1 /* Error */ - }, - "Invalid call to 'down'": { - "code": 5020, - "category": 1 /* Error */ - }, - "Base64 value '{0}' finished with a continuation bit.": { - "code": 5021, - "category": 1 /* Error */ - }, - "Unknown option '{0}'": { - "code": 5023, - "category": 1 /* Error */ - }, - "Expected {0} arguments to message, got {1} instead.": { - "code": 5024, - "category": 1 /* Error */ - }, - "Expected the message '{0}' to have {1} arguments, but it had {2}": { - "code": 5025, - "category": 1 /* Error */ - }, - "Could not delete file '{0}'": { - "code": 5034, - "category": 1 /* Error */ - }, - "Could not create directory '{0}'": { - "code": 5035, - "category": 1 /* Error */ - }, - "Error while executing file '{0}': ": { - "code": 5036, - "category": 1 /* Error */ - }, - "Cannot compile external modules unless the '--module' flag is provided.": { - "code": 5037, - "category": 1 /* Error */ - }, - "Option mapRoot cannot be specified without specifying sourcemap option.": { - "code": 5038, - "category": 1 /* Error */ - }, - "Option sourceRoot cannot be specified without specifying sourcemap option.": { - "code": 5039, - "category": 1 /* Error */ - }, - "Options mapRoot and sourceRoot cannot be specified without specifying sourcemap option.": { - "code": 5040, - "category": 1 /* Error */ - }, - "Option '{0}' specified without '{1}'": { - "code": 5041, - "category": 1 /* Error */ - }, - "'codepage' option not supported on current platform.": { - "code": 5042, - "category": 1 /* Error */ - }, - "Concatenate and emit output to single file.": { - "code": 6001, - "category": 2 /* Message */ - }, - "Generates corresponding {0} file.": { - "code": 6002, - "category": 2 /* Message */ - }, - "Specifies the location where debugger should locate map files instead of generated locations.": { - "code": 6003, - "category": 2 /* Message */ - }, - "Specifies the location where debugger should locate TypeScript files instead of source locations.": { - "code": 6004, - "category": 2 /* Message */ - }, - "Watch input files.": { - "code": 6005, - "category": 2 /* Message */ - }, - "Redirect output structure to the directory.": { - "code": 6006, - "category": 2 /* Message */ - }, - "Do not emit comments to output.": { - "code": 6009, - "category": 2 /* Message */ - }, - "Skip resolution and preprocessing.": { - "code": 6010, - "category": 2 /* Message */ - }, - "Specify ECMAScript target version: '{0}' (default), or '{1}'": { - "code": 6015, - "category": 2 /* Message */ - }, - "Specify module code generation: '{0}' or '{1}'": { - "code": 6016, - "category": 2 /* Message */ - }, - "Print this message.": { - "code": 6017, - "category": 2 /* Message */ - }, - "Print the compiler's version: {0}": { - "code": 6019, - "category": 2 /* Message */ - }, - "Allow use of deprecated '{0}' keyword when referencing an external module.": { - "code": 6021, - "category": 2 /* Message */ - }, - "Specify locale for errors and messages. For example '{0}' or '{1}'": { - "code": 6022, - "category": 2 /* Message */ - }, - "Syntax: {0}": { - "code": 6023, - "category": 2 /* Message */ - }, - "options": { - "code": 6024, - "category": 2 /* Message */ - }, - "file1": { - "code": 6025, - "category": 2 /* Message */ - }, - "Examples:": { - "code": 6026, - "category": 2 /* Message */ - }, - "Options:": { - "code": 6027, - "category": 2 /* Message */ - }, - "Insert command line options and files from a file.": { - "code": 6030, - "category": 2 /* Message */ - }, - "Version {0}": { - "code": 6029, - "category": 2 /* Message */ - }, - "Use the '{0}' flag to see options.": { - "code": 6031, - "category": 2 /* Message */ - }, - "{NL}Recompiling ({0}):": { - "code": 6032, - "category": 2 /* Message */ - }, - "STRING": { - "code": 6033, - "category": 2 /* Message */ - }, - "KIND": { - "code": 6034, - "category": 2 /* Message */ - }, - "file2": { - "code": 6035, - "category": 2 /* Message */ - }, - "VERSION": { - "code": 6036, - "category": 2 /* Message */ - }, - "LOCATION": { - "code": 6037, - "category": 2 /* Message */ - }, - "DIRECTORY": { - "code": 6038, - "category": 2 /* Message */ - }, - "NUMBER": { - "code": 6039, - "category": 2 /* Message */ - }, - "Specify the codepage to use when opening source files.": { - "code": 6040, - "category": 2 /* Message */ - }, - "Additional locations:": { - "code": 6041, - "category": 2 /* Message */ - }, - "This version of the Javascript runtime does not support the '{0}' function.": { - "code": 7000, - "category": 1 /* Error */ - }, - "Unknown rule.": { - "code": 7002, - "category": 1 /* Error */ - }, - "Invalid line number ({0})": { - "code": 7003, - "category": 1 /* Error */ - }, - "Warn on expressions and declarations with an implied 'any' type.": { - "code": 7004, - "category": 2 /* Message */ - }, - "Variable '{0}' implicitly has an 'any' type.": { - "code": 7005, - "category": 1 /* Error */ - }, - "Parameter '{0}' of '{1}' implicitly has an 'any' type.": { - "code": 7006, - "category": 1 /* Error */ - }, - "Parameter '{0}' of function type implicitly has an 'any' type.": { - "code": 7007, - "category": 1 /* Error */ - }, - "Member '{0}' of object type implicitly has an 'any' type.": { - "code": 7008, - "category": 1 /* Error */ - }, - "'new' expression, which lacks a constructor signature, implicitly has an 'any' type.": { - "code": 7009, - "category": 1 /* Error */ - }, - "'{0}', which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7010, - "category": 1 /* Error */ - }, - "Function expression, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7011, - "category": 1 /* Error */ - }, - "Parameter '{0}' of lambda function implicitly has an 'any' type.": { - "code": 7012, - "category": 1 /* Error */ - }, - "Constructor signature, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7013, - "category": 1 /* Error */ - }, - "Lambda Function, which lacks return-type annotation, implicitly has an 'any' return type.": { - "code": 7014, - "category": 1 /* Error */ - }, - "Array Literal implicitly has an 'any' type from widening.": { - "code": 7015, - "category": 1 /* Error */ - }, - "'{0}', which lacks 'get' accessor and parameter type annotation on 'set' accessor, implicitly has an 'any' type.": { - "code": 7016, - "category": 1 /* Error */ - }, - "Index signature of object type implicitly has an 'any' type.": { - "code": 7017, - "category": 1 /* Error */ - }, - "Object literal's property '{0}' implicitly has an 'any' type from widening.": { - "code": 7018, - "category": 1 /* Error */ - } - }; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 0x2028] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 0x2029] = "paragraphSeparator"; - - CharacterCodes[CharacterCodes["nextLine"] = 0x0085] = "nextLine"; - - CharacterCodes[CharacterCodes["space"] = 0x0020] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 0x00A0] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 0x2000] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 0x2001] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 0x2002] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 0x2003] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 0x2004] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 0x2005] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 0x2006] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 0x2007] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 0x2008] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 0x2009] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 0x200A] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 0x200B] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 0x202F] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 0x3000] = "ideographicSpace"; - - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 0xFEFF] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(TypeScript.CharacterCodes || (TypeScript.CharacterCodes = {})); - var CharacterCodes = TypeScript.CharacterCodes; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - - - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = null; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - - StringScriptSnapshot.prototype.getLineStartPositions = function () { - if (!this._lineStartPositions) { - this._lineStartPositions = TypeScript.TextUtilities.parseLineStarts(this.text); - } - - return this._lineStartPositions; - }; - - StringScriptSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) { - throw TypeScript.Errors.notYetImplemented(); - }; - return StringScriptSnapshot; - })(); - - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(TypeScript.ScriptSnapshot || (TypeScript.ScriptSnapshot = {})); - var ScriptSnapshot = TypeScript.ScriptSnapshot; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (LineMap1) { - function fromSimpleText(text) { - return new TypeScript.LineMap(function () { - return TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { - return text.charCodeAt(index); - }, length: text.length() }); - }, text.length()); - } - LineMap1.fromSimpleText = fromSimpleText; - - function fromScriptSnapshot(scriptSnapshot) { - return new TypeScript.LineMap(function () { - return scriptSnapshot.getLineStartPositions(); - }, scriptSnapshot.getLength()); - } - LineMap1.fromScriptSnapshot = fromScriptSnapshot; - - function fromString(text) { - return new TypeScript.LineMap(function () { - return TypeScript.TextUtilities.parseLineStarts(text); - }, text.length); - } - LineMap1.fromString = fromString; - })(TypeScript.LineMap1 || (TypeScript.LineMap1 = {})); - var LineMap1 = TypeScript.LineMap1; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (TextFactory) { - function getStartAndLengthOfLineBreakEndingAt(text, index, info) { - var c = text.charCodeAt(index); - if (c === 10 /* lineFeed */) { - if (index > 0 && text.charCodeAt(index - 1) === 13 /* carriageReturn */) { - info.startPosition = index - 1; - info.length = 2; - } else { - info.startPosition = index; - info.length = 1; - } - } else if (TypeScript.TextUtilities.isAnyLineBreakCharacter(c)) { - info.startPosition = index; - info.length = 1; - } else { - info.startPosition = index + 1; - info.length = 0; - } - } - - var LinebreakInfo = (function () { - function LinebreakInfo(startPosition, length) { - this.startPosition = startPosition; - this.length = length; - } - return LinebreakInfo; - })(); - - var TextLine = (function () { - function TextLine(text, body, lineBreakLength, lineNumber) { - this._text = null; - this._textSpan = null; - if (text === null) { - throw TypeScript.Errors.argumentNull('text'); - } - TypeScript.Debug.assert(lineBreakLength >= 0); - TypeScript.Debug.assert(lineNumber >= 0); - this._text = text; - this._textSpan = body; - this._lineBreakLength = lineBreakLength; - this._lineNumber = lineNumber; - } - TextLine.prototype.start = function () { - return this._textSpan.start(); - }; - - TextLine.prototype.end = function () { - return this._textSpan.end(); - }; - - TextLine.prototype.endIncludingLineBreak = function () { - return this.end() + this._lineBreakLength; - }; - - TextLine.prototype.extent = function () { - return this._textSpan; - }; - - TextLine.prototype.extentIncludingLineBreak = function () { - return TypeScript.TextSpan.fromBounds(this.start(), this.endIncludingLineBreak()); - }; - - TextLine.prototype.toString = function () { - return this._text.toString(this._textSpan); - }; - - TextLine.prototype.lineNumber = function () { - return this._lineNumber; - }; - return TextLine; - })(); - - var TextBase = (function () { - function TextBase() { - this.linebreakInfo = new LinebreakInfo(0, 0); - this.lastLineFoundForPosition = null; - } - TextBase.prototype.length = function () { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.charCodeAt = function (position) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.checkSubSpan = function (span) { - if (span.start() < 0 || span.start() > this.length() || span.end() > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("span"); - } - }; - - TextBase.prototype.toString = function (span) { - if (typeof span === "undefined") { span = null; } - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SubText(this, span); - }; - - TextBase.prototype.substr = function (start, length, intern) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.lineCount = function () { - return this._lineStarts().length; - }; - - TextBase.prototype.lines = function () { - var lines = []; - - var length = this.lineCount(); - for (var i = 0; i < length; ++i) { - lines[i] = this.getLineFromLineNumber(i); - } - - return lines; - }; - - TextBase.prototype.lineMap = function () { - var _this = this; - return new TypeScript.LineMap(function () { - return _this._lineStarts(); - }, this.length()); - }; - - TextBase.prototype._lineStarts = function () { - throw TypeScript.Errors.abstract(); - }; - - TextBase.prototype.getLineFromLineNumber = function (lineNumber) { - var lineStarts = this._lineStarts(); - - if (lineNumber < 0 || lineNumber >= lineStarts.length) { - throw TypeScript.Errors.argumentOutOfRange("lineNumber"); - } - - var first = lineStarts[lineNumber]; - if (lineNumber === lineStarts.length - 1) { - return new TextLine(this, new TypeScript.TextSpan(first, this.length() - first), 0, lineNumber); - } else { - getStartAndLengthOfLineBreakEndingAt(this, lineStarts[lineNumber + 1] - 1, this.linebreakInfo); - return new TextLine(this, new TypeScript.TextSpan(first, this.linebreakInfo.startPosition - first), this.linebreakInfo.length, lineNumber); - } - }; - - TextBase.prototype.getLineFromPosition = function (position) { - var lastFound = this.lastLineFoundForPosition; - if (lastFound !== null && lastFound.start() <= position && lastFound.endIncludingLineBreak() > position) { - return lastFound; - } - - var lineNumber = this.getLineNumberFromPosition(position); - - var result = this.getLineFromLineNumber(lineNumber); - this.lastLineFoundForPosition = result; - return result; - }; - - TextBase.prototype.getLineNumberFromPosition = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - if (position === this.length()) { - return this.lineCount() - 1; - } - - var lineNumber = TypeScript.ArrayUtilities.binarySearch(this._lineStarts(), position); - if (lineNumber < 0) { - lineNumber = (~lineNumber) - 1; - } - - return lineNumber; - }; - - TextBase.prototype.getLinePosition = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var lineNumber = this.getLineNumberFromPosition(position); - - return new TypeScript.LineAndCharacter(lineNumber, position - this._lineStarts()[lineNumber]); - }; - return TextBase; - })(); - - var SubText = (function (_super) { - __extends(SubText, _super); - function SubText(text, span) { - _super.call(this); - this._lazyLineStarts = null; - - if (text === null) { - throw TypeScript.Errors.argumentNull("text"); - } - - if (span.start() < 0 || span.start() >= text.length() || span.end() < 0 || span.end() > text.length()) { - throw TypeScript.Errors.argument("span"); - } - - this.text = text; - this.span = span; - } - SubText.prototype.length = function () { - return this.span.length(); - }; - - SubText.prototype.charCodeAt = function (position) { - if (position < 0 || position > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - return this.text.charCodeAt(this.span.start() + position); - }; - - SubText.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SubText(this.text, this.getCompositeSpan(span.start(), span.length())); - }; - - SubText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var span = this.getCompositeSpan(sourceIndex, count); - this.text.copyTo(span.start(), destination, destinationIndex, span.length()); - }; - - SubText.prototype.substr = function (start, length, intern) { - var startInOriginalText = this.span.start() + start; - return this.text.substr(startInOriginalText, length, intern); - }; - - SubText.prototype.getCompositeSpan = function (start, length) { - var compositeStart = TypeScript.MathPrototype.min(this.text.length(), this.span.start() + start); - var compositeEnd = TypeScript.MathPrototype.min(this.text.length(), compositeStart + length); - return new TypeScript.TextSpan(compositeStart, compositeEnd - compositeStart); - }; - - SubText.prototype._lineStarts = function () { - var _this = this; - if (!this._lazyLineStarts) { - this._lazyLineStarts = TypeScript.TextUtilities.parseLineStarts({ charCodeAt: function (index) { - return _this.charCodeAt(index); - }, length: this.length() }); - } - - return this._lazyLineStarts; - }; - return SubText; - })(TextBase); - - var StringText = (function (_super) { - __extends(StringText, _super); - function StringText(data) { - _super.call(this); - this.source = null; - this._lazyLineStarts = null; - - if (data === null) { - throw TypeScript.Errors.argumentNull("data"); - } - - this.source = data; - } - StringText.prototype.length = function () { - return this.source.length; - }; - - StringText.prototype.charCodeAt = function (position) { - if (position < 0 || position >= this.source.length) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - return this.source.charCodeAt(position); - }; - - StringText.prototype.substr = function (start, length, intern) { - return this.source.substr(start, length); - }; - - StringText.prototype.toString = function (span) { - if (typeof span === "undefined") { span = null; } - if (span === null) { - span = new TypeScript.TextSpan(0, this.length()); - } - - this.checkSubSpan(span); - - if (span.start() === 0 && span.length() === this.length()) { - return this.source; - } - - return this.source.substr(span.start(), span.length()); - }; - - StringText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - TypeScript.StringUtilities.copyTo(this.source, sourceIndex, destination, destinationIndex, count); - }; - - StringText.prototype._lineStarts = function () { - if (this._lazyLineStarts === null) { - this._lazyLineStarts = TypeScript.TextUtilities.parseLineStarts(this.source); - } - - return this._lazyLineStarts; - }; - return StringText; - })(TextBase); - - function createText(value) { - return new StringText(value); - } - TextFactory.createText = createText; - })(TypeScript.TextFactory || (TypeScript.TextFactory = {})); - var TextFactory = TypeScript.TextFactory; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (SimpleText) { - var SimpleSubText = (function () { - function SimpleSubText(text, span) { - this.text = null; - this.span = null; - if (text === null) { - throw TypeScript.Errors.argumentNull("text"); - } - - if (span.start() < 0 || span.start() >= text.length() || span.end() < 0 || span.end() > text.length()) { - throw TypeScript.Errors.argument("span"); - } - - this.text = text; - this.span = span; - } - SimpleSubText.prototype.checkSubSpan = function (span) { - if (span.start() < 0 || span.start() > this.length() || span.end() > this.length()) { - throw TypeScript.Errors.argumentOutOfRange("span"); - } - }; - - SimpleSubText.prototype.checkSubPosition = function (position) { - if (position < 0 || position >= this.length()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - }; - - SimpleSubText.prototype.length = function () { - return this.span.length(); - }; - - SimpleSubText.prototype.subText = function (span) { - this.checkSubSpan(span); - - return new SimpleSubText(this.text, this.getCompositeSpan(span.start(), span.length())); - }; - - SimpleSubText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var span = this.getCompositeSpan(sourceIndex, count); - this.text.copyTo(span.start(), destination, destinationIndex, span.length()); - }; - - SimpleSubText.prototype.substr = function (start, length, intern) { - var span = this.getCompositeSpan(start, length); - return this.text.substr(span.start(), span.length(), intern); - }; - - SimpleSubText.prototype.getCompositeSpan = function (start, length) { - var compositeStart = TypeScript.MathPrototype.min(this.text.length(), this.span.start() + start); - var compositeEnd = TypeScript.MathPrototype.min(this.text.length(), compositeStart + length); - return new TypeScript.TextSpan(compositeStart, compositeEnd - compositeStart); - }; - - SimpleSubText.prototype.charCodeAt = function (index) { - this.checkSubPosition(index); - return this.text.charCodeAt(this.span.start() + index); - }; - - SimpleSubText.prototype.lineMap = function () { - return TypeScript.LineMap1.fromSimpleText(this); - }; - return SimpleSubText; - })(); - - var SimpleStringText = (function () { - function SimpleStringText(value) { - this.value = value; - this._lineMap = null; - } - SimpleStringText.prototype.length = function () { - return this.value.length; - }; - - SimpleStringText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - TypeScript.StringUtilities.copyTo(this.value, sourceIndex, destination, destinationIndex, count); - }; - - SimpleStringText.prototype.substr = function (start, length, intern) { - if (intern) { - var array = length <= SimpleStringText.charArray.length ? SimpleStringText.charArray : TypeScript.ArrayUtilities.createArray(length, 0); - this.copyTo(start, array, 0, length); - return TypeScript.Collections.DefaultStringTable.addCharArray(array, 0, length); - } - - return this.value.substr(start, length); - }; - - SimpleStringText.prototype.subText = function (span) { - return new SimpleSubText(this, span); - }; - - SimpleStringText.prototype.charCodeAt = function (index) { - return this.value.charCodeAt(index); - }; - - SimpleStringText.prototype.lineMap = function () { - if (!this._lineMap) { - this._lineMap = TypeScript.LineMap1.fromString(this.value); - } - - return this._lineMap; - }; - SimpleStringText.charArray = TypeScript.ArrayUtilities.createArray(1024, 0); - return SimpleStringText; - })(); - - var SimpleScriptSnapshotText = (function () { - function SimpleScriptSnapshotText(scriptSnapshot) { - this.scriptSnapshot = scriptSnapshot; - } - SimpleScriptSnapshotText.prototype.charCodeAt = function (index) { - return this.scriptSnapshot.getText(index, index + 1).charCodeAt(0); - }; - - SimpleScriptSnapshotText.prototype.length = function () { - return this.scriptSnapshot.getLength(); - }; - - SimpleScriptSnapshotText.prototype.copyTo = function (sourceIndex, destination, destinationIndex, count) { - var text = this.scriptSnapshot.getText(sourceIndex, sourceIndex + count); - TypeScript.StringUtilities.copyTo(text, 0, destination, destinationIndex, count); - }; - - SimpleScriptSnapshotText.prototype.substr = function (start, length, intern) { - return this.scriptSnapshot.getText(start, start + length); - }; - - SimpleScriptSnapshotText.prototype.subText = function (span) { - return new SimpleSubText(this, span); - }; - - SimpleScriptSnapshotText.prototype.lineMap = function () { - var _this = this; - return new TypeScript.LineMap(function () { - return _this.scriptSnapshot.getLineStartPositions(); - }, this.length()); - }; - return SimpleScriptSnapshotText; - })(); - - function fromString(value) { - return new SimpleStringText(value); - } - SimpleText.fromString = fromString; - - function fromScriptSnapshot(scriptSnapshot) { - return new SimpleScriptSnapshotText(scriptSnapshot); - } - SimpleText.fromScriptSnapshot = fromScriptSnapshot; - })(TypeScript.SimpleText || (TypeScript.SimpleText = {})); - var SimpleText = TypeScript.SimpleText; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (TextUtilities) { - function parseLineStarts(text) { - var length = text.length; - - if (0 === length) { - var result = new Array(); - result.push(0); - return result; - } - - var position = 0; - var index = 0; - var arrayBuilder = new Array(); - var lineNumber = 0; - - while (index < length) { - var c = text.charCodeAt(index); - var lineBreakLength; - - if (c > 13 /* carriageReturn */ && c <= 127) { - index++; - continue; - } else if (c === 13 /* carriageReturn */ && index + 1 < length && text.charCodeAt(index + 1) === 10 /* lineFeed */) { - lineBreakLength = 2; - } else if (c === 10 /* lineFeed */) { - lineBreakLength = 1; - } else { - lineBreakLength = TextUtilities.getLengthOfLineBreak(text, index); - } - - if (0 === lineBreakLength) { - index++; - } else { - arrayBuilder.push(position); - index += lineBreakLength; - position = index; - lineNumber++; - } - } - - arrayBuilder.push(position); - - return arrayBuilder; - } - TextUtilities.parseLineStarts = parseLineStarts; - - function getLengthOfLineBreakSlow(text, index, c) { - if (c === 13 /* carriageReturn */) { - var next = index + 1; - return (next < text.length) && 10 /* lineFeed */ === text.charCodeAt(next) ? 2 : 1; - } else if (isAnyLineBreakCharacter(c)) { - return 1; - } else { - return 0; - } - } - TextUtilities.getLengthOfLineBreakSlow = getLengthOfLineBreakSlow; - - function getLengthOfLineBreak(text, index) { - var c = text.charCodeAt(index); - - if (c > 13 /* carriageReturn */ && c <= 127) { - return 0; - } - - return getLengthOfLineBreakSlow(text, index, c); - } - TextUtilities.getLengthOfLineBreak = getLengthOfLineBreak; - - function isAnyLineBreakCharacter(c) { - return c === 10 /* lineFeed */ || c === 13 /* carriageReturn */ || c === 133 /* nextLine */ || c === 8232 /* lineSeparator */ || c === 8233 /* paragraphSeparator */; - } - TextUtilities.isAnyLineBreakCharacter = isAnyLineBreakCharacter; - })(TypeScript.TextUtilities || (TypeScript.TextUtilities = {})); - var TextUtilities = TypeScript.TextUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextSpan = (function () { - function TextSpan(start, length) { - if (start < 0) { - TypeScript.Errors.argument("start"); - } - - if (length < 0) { - TypeScript.Errors.argument("length"); - } - - this._start = start; - this._length = length; - } - TextSpan.prototype.start = function () { - return this._start; - }; - - TextSpan.prototype.length = function () { - return this._length; - }; - - TextSpan.prototype.end = function () { - return this._start + this._length; - }; - - TextSpan.prototype.isEmpty = function () { - return this._length === 0; - }; - - TextSpan.prototype.containsPosition = function (position) { - return position >= this._start && position < this.end(); - }; - - TextSpan.prototype.containsTextSpan = function (span) { - return span._start >= this._start && span.end() <= this.end(); - }; - - TextSpan.prototype.overlapsWith = function (span) { - var overlapStart = TypeScript.MathPrototype.max(this._start, span._start); - var overlapEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - return overlapStart < overlapEnd; - }; - - TextSpan.prototype.overlap = function (span) { - var overlapStart = TypeScript.MathPrototype.max(this._start, span._start); - var overlapEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - if (overlapStart < overlapEnd) { - return TextSpan.fromBounds(overlapStart, overlapEnd); - } - - return null; - }; - - TextSpan.prototype.intersectsWithTextSpan = function (span) { - return span._start <= this.end() && span.end() >= this._start; - }; - - TextSpan.prototype.intersectsWith = function (start, length) { - var end = start + length; - return start <= this.end() && end >= this._start; - }; - - TextSpan.prototype.intersectsWithPosition = function (position) { - return position <= this.end() && position >= this._start; - }; - - TextSpan.prototype.intersection = function (span) { - var intersectStart = TypeScript.MathPrototype.max(this._start, span._start); - var intersectEnd = TypeScript.MathPrototype.min(this.end(), span.end()); - - if (intersectStart <= intersectEnd) { - return TextSpan.fromBounds(intersectStart, intersectEnd); - } - - return null; - }; - - TextSpan.fromBounds = function (start, end) { - TypeScript.Debug.assert(start >= 0); - TypeScript.Debug.assert(end - start >= 0); - return new TextSpan(start, end - start); - }; - return TextSpan; - })(); - TypeScript.TextSpan = TextSpan; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextChangeRange = (function () { - function TextChangeRange(span, newLength) { - if (newLength < 0) { - throw TypeScript.Errors.argumentOutOfRange("newLength"); - } - - this._span = span; - this._newLength = newLength; - } - TextChangeRange.prototype.span = function () { - return this._span; - }; - - TextChangeRange.prototype.newLength = function () { - return this._newLength; - }; - - TextChangeRange.prototype.newSpan = function () { - return new TypeScript.TextSpan(this.span().start(), this.newLength()); - }; - - TextChangeRange.prototype.isUnchanged = function () { - return this.span().isEmpty() && this.newLength() === 0; - }; - - TextChangeRange.collapseChangesFromSingleVersion = function (changes) { - var diff = 0; - var start = 1073741823 /* Max31BitInteger */; - var end = 0; - - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - diff += change.newLength() - change.span().length(); - - if (change.span().start() < start) { - start = change.span().start(); - } - - if (change.span().end() > end) { - end = change.span().end(); - } - } - - if (start > end) { - return null; - } - - var combined = TypeScript.TextSpan.fromBounds(start, end); - var newLen = combined.length() + diff; - - return new TextChangeRange(combined, newLen); - }; - - TextChangeRange.collapseChangesAcrossMultipleVersions = function (changes) { - if (changes.length === 0) { - return TextChangeRange.unchanged; - } - - if (changes.length === 1) { - return changes[0]; - } - - var change0 = changes[0]; - - var oldStartN = change0.span().start(); - var oldEndN = change0.span().end(); - var newEndN = oldStartN + change0.newLength(); - - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - - var oldStart2 = nextChange.span().start(); - var oldEnd2 = nextChange.span().end(); - var newEnd2 = oldStart2 + nextChange.newLength(); - - oldStartN = TypeScript.MathPrototype.min(oldStart1, oldStart2); - oldEndN = TypeScript.MathPrototype.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = TypeScript.MathPrototype.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - - return new TextChangeRange(TypeScript.TextSpan.fromBounds(oldStartN, oldEndN), newEndN - oldStartN); - }; - TextChangeRange.unchanged = new TextChangeRange(new TypeScript.TextSpan(0, 0), 0); - return TextChangeRange; - })(); - TypeScript.TextChangeRange = TextChangeRange; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CharacterInfo = (function () { - function CharacterInfo() { - } - CharacterInfo.isDecimalDigit = function (c) { - return c >= 48 /* _0 */ && c <= 57 /* _9 */; - }; - CharacterInfo.isOctalDigit = function (c) { - return c >= 48 /* _0 */ && c <= 55 /* _7 */; - }; - - CharacterInfo.isHexDigit = function (c) { - return CharacterInfo.isDecimalDigit(c) || (c >= 65 /* A */ && c <= 70 /* F */) || (c >= 97 /* a */ && c <= 102 /* f */); - }; - - CharacterInfo.hexValue = function (c) { - return CharacterInfo.isDecimalDigit(c) ? (c - 48 /* _0 */) : (c >= 65 /* A */ && c <= 70 /* F */) ? c - 65 /* A */ + 10 : c - 97 /* a */ + 10; - }; - - CharacterInfo.isWhitespace = function (ch) { - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - return true; - } - - return false; - }; - - CharacterInfo.isLineTerminator = function (ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - } - - return false; - }; - return CharacterInfo; - })(); - TypeScript.CharacterInfo = CharacterInfo; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxConstants) { - SyntaxConstants[SyntaxConstants["TriviaNewLineMask"] = 0x00000001] = "TriviaNewLineMask"; - SyntaxConstants[SyntaxConstants["TriviaCommentMask"] = 0x00000002] = "TriviaCommentMask"; - SyntaxConstants[SyntaxConstants["TriviaFullWidthShift"] = 2] = "TriviaFullWidthShift"; - - SyntaxConstants[SyntaxConstants["NodeDataComputed"] = 0x00000001] = "NodeDataComputed"; - SyntaxConstants[SyntaxConstants["NodeIncrementallyUnusableMask"] = 0x00000002] = "NodeIncrementallyUnusableMask"; - SyntaxConstants[SyntaxConstants["NodeParsedInStrictModeMask"] = 0x00000004] = "NodeParsedInStrictModeMask"; - SyntaxConstants[SyntaxConstants["NodeFullWidthShift"] = 3] = "NodeFullWidthShift"; - - SyntaxConstants[SyntaxConstants["IsVariableWidthKeyword"] = 1 << 31] = "IsVariableWidthKeyword"; - })(TypeScript.SyntaxConstants || (TypeScript.SyntaxConstants = {})); - var SyntaxConstants = TypeScript.SyntaxConstants; -})(TypeScript || (TypeScript = {})); -var FormattingOptions = (function () { - function FormattingOptions(useTabs, spacesPerTab, indentSpaces, newLineCharacter) { - this.useTabs = useTabs; - this.spacesPerTab = spacesPerTab; - this.indentSpaces = indentSpaces; - this.newLineCharacter = newLineCharacter; - } - FormattingOptions.defaultOptions = new FormattingOptions(false, 4, 4, "\r\n"); - return FormattingOptions; -})(); -var TypeScript; -(function (TypeScript) { - (function (Indentation) { - function columnForEndOfToken(token, syntaxInformationMap, options) { - return columnForStartOfToken(token, syntaxInformationMap, options) + token.width(); - } - Indentation.columnForEndOfToken = columnForEndOfToken; - - function columnForStartOfToken(token, syntaxInformationMap, options) { - var firstTokenInLine = syntaxInformationMap.firstTokenInLineContainingToken(token); - var leadingTextInReverse = []; - - var current = token; - while (current !== firstTokenInLine) { - current = syntaxInformationMap.previousToken(current); - - if (current === firstTokenInLine) { - leadingTextInReverse.push(current.trailingTrivia().fullText()); - leadingTextInReverse.push(current.text()); - } else { - leadingTextInReverse.push(current.fullText()); - } - } - - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfToken = columnForStartOfToken; - - function columnForStartOfFirstTokenInLineContainingToken(token, syntaxInformationMap, options) { - var firstTokenInLine = syntaxInformationMap.firstTokenInLineContainingToken(token); - var leadingTextInReverse = []; - - collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse); - - return columnForLeadingTextInReverse(leadingTextInReverse, options); - } - Indentation.columnForStartOfFirstTokenInLineContainingToken = columnForStartOfFirstTokenInLineContainingToken; - - function collectLeadingTriviaTextToStartOfLine(firstTokenInLine, leadingTextInReverse) { - var leadingTrivia = firstTokenInLine.leadingTrivia(); - - for (var i = leadingTrivia.count() - 1; i >= 0; i--) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.kind() === 5 /* NewLineTrivia */) { - break; - } - - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var lineSegments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - leadingTextInReverse.push(TypeScript.ArrayUtilities.last(lineSegments)); - - if (lineSegments.length > 0) { - break; - } - } - - leadingTextInReverse.push(trivia.fullText()); - } - } - - function columnForLeadingTextInReverse(leadingTextInReverse, options) { - var column = 0; - - for (var i = leadingTextInReverse.length - 1; i >= 0; i--) { - var text = leadingTextInReverse[i]; - column = columnForPositionInStringWorker(text, text.length, column, options); - } - - return column; - } - - function columnForPositionInString(input, position, options) { - return columnForPositionInStringWorker(input, position, 0, options); - } - Indentation.columnForPositionInString = columnForPositionInString; - - function columnForPositionInStringWorker(input, position, startColumn, options) { - var column = startColumn; - var spacesPerTab = options.spacesPerTab; - - for (var j = 0; j < position; j++) { - var ch = input.charCodeAt(j); - - if (ch === 9 /* tab */) { - column += spacesPerTab - column % spacesPerTab; - } else { - column++; - } - } - - return column; - } - - function indentationString(column, options) { - var numberOfTabs = 0; - var numberOfSpaces = TypeScript.MathPrototype.max(0, column); - - if (options.useTabs) { - numberOfTabs = Math.floor(column / options.spacesPerTab); - numberOfSpaces -= numberOfTabs * options.spacesPerTab; - } - - return TypeScript.StringUtilities.repeat('\t', numberOfTabs) + TypeScript.StringUtilities.repeat(' ', numberOfSpaces); - } - Indentation.indentationString = indentationString; - - function indentationTrivia(column, options) { - return TypeScript.Syntax.whitespace(this.indentationString(column, options)); - } - Indentation.indentationTrivia = indentationTrivia; - - function firstNonWhitespacePosition(value) { - for (var i = 0; i < value.length; i++) { - var ch = value.charCodeAt(i); - if (!TypeScript.CharacterInfo.isWhitespace(ch)) { - return i; - } - } - - return value.length; - } - Indentation.firstNonWhitespacePosition = firstNonWhitespacePosition; - })(TypeScript.Indentation || (TypeScript.Indentation = {})); - var Indentation = TypeScript.Indentation; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (LanguageVersion) { - LanguageVersion[LanguageVersion["EcmaScript3"] = 0] = "EcmaScript3"; - LanguageVersion[LanguageVersion["EcmaScript5"] = 1] = "EcmaScript5"; - })(TypeScript.LanguageVersion || (TypeScript.LanguageVersion = {})); - var LanguageVersion = TypeScript.LanguageVersion; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ParseOptions = (function () { - function ParseOptions(languageVersion, allowAutomaticSemicolonInsertion) { - this._languageVersion = languageVersion; - this._allowAutomaticSemicolonInsertion = allowAutomaticSemicolonInsertion; - } - ParseOptions.prototype.toJSON = function (key) { - return { allowAutomaticSemicolonInsertion: this._allowAutomaticSemicolonInsertion }; - }; - - ParseOptions.prototype.languageVersion = function () { - return this._languageVersion; - }; - - ParseOptions.prototype.allowAutomaticSemicolonInsertion = function () { - return this._allowAutomaticSemicolonInsertion; - }; - return ParseOptions; - })(); - TypeScript.ParseOptions = ParseOptions; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PositionedElement = (function () { - function PositionedElement(parent, element, fullStart) { - this._parent = parent; - this._element = element; - this._fullStart = fullStart; - } - PositionedElement.create = function (parent, element, fullStart) { - if (element === null) { - return null; - } - - if (element.isNode()) { - return new PositionedNode(parent, element, fullStart); - } else if (element.isToken()) { - return new PositionedToken(parent, element, fullStart); - } else if (element.isList()) { - return new PositionedList(parent, element, fullStart); - } else if (element.isSeparatedList()) { - return new PositionedSeparatedList(parent, element, fullStart); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - PositionedElement.prototype.parent = function () { - return this._parent; - }; - - PositionedElement.prototype.parentElement = function () { - return this._parent && this._parent._element; - }; - - PositionedElement.prototype.element = function () { - return this._element; - }; - - PositionedElement.prototype.kind = function () { - return this.element().kind(); - }; - - PositionedElement.prototype.childIndex = function (child) { - return TypeScript.Syntax.childIndex(this.element(), child); - }; - - PositionedElement.prototype.childCount = function () { - return this.element().childCount(); - }; - - PositionedElement.prototype.childAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - return PositionedElement.create(this, this.element().childAt(index), this.fullStart() + offset); - }; - - PositionedElement.prototype.childStart = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return this.fullStart() + offset + child.leadingTriviaWidth(); - }; - - PositionedElement.prototype.childEnd = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return this.fullStart() + offset + child.leadingTriviaWidth() + child.width(); - }; - - PositionedElement.prototype.childStartAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - var child = this.element().childAt(index); - return this.fullStart() + offset + child.leadingTriviaWidth(); - }; - - PositionedElement.prototype.childEndAt = function (index) { - var offset = TypeScript.Syntax.childOffsetAt(this.element(), index); - var child = this.element().childAt(index); - return this.fullStart() + offset + child.leadingTriviaWidth() + child.width(); - }; - - PositionedElement.prototype.getPositionedChild = function (child) { - var offset = TypeScript.Syntax.childOffset(this.element(), child); - return PositionedElement.create(this, child, this.fullStart() + offset); - }; - - PositionedElement.prototype.fullStart = function () { - return this._fullStart; - }; - - PositionedElement.prototype.fullEnd = function () { - return this.fullStart() + this.element().fullWidth(); - }; - - PositionedElement.prototype.fullWidth = function () { - return this.element().fullWidth(); - }; - - PositionedElement.prototype.start = function () { - return this.fullStart() + this.element().leadingTriviaWidth(); - }; - - PositionedElement.prototype.end = function () { - return this.fullStart() + this.element().leadingTriviaWidth() + this.element().width(); - }; - - PositionedElement.prototype.root = function () { - var current = this; - while (current.parent() !== null) { - current = current.parent(); - } - - return current; - }; - - PositionedElement.prototype.containingNode = function () { - var current = this.parent(); - - while (current !== null && !current.element().isNode()) { - current = current.parent(); - } - - return current; - }; - return PositionedElement; - })(); - TypeScript.PositionedElement = PositionedElement; - - var PositionedNodeOrToken = (function (_super) { - __extends(PositionedNodeOrToken, _super); - function PositionedNodeOrToken(parent, nodeOrToken, fullStart) { - _super.call(this, parent, nodeOrToken, fullStart); - } - PositionedNodeOrToken.prototype.nodeOrToken = function () { - return this.element(); - }; - return PositionedNodeOrToken; - })(PositionedElement); - TypeScript.PositionedNodeOrToken = PositionedNodeOrToken; - - var PositionedNode = (function (_super) { - __extends(PositionedNode, _super); - function PositionedNode(parent, node, fullStart) { - _super.call(this, parent, node, fullStart); - } - PositionedNode.prototype.node = function () { - return this.element(); - }; - return PositionedNode; - })(PositionedNodeOrToken); - TypeScript.PositionedNode = PositionedNode; - - var PositionedToken = (function (_super) { - __extends(PositionedToken, _super); - function PositionedToken(parent, token, fullStart) { - _super.call(this, parent, token, fullStart); - } - PositionedToken.prototype.token = function () { - return this.element(); - }; - - PositionedToken.prototype.previousToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var triviaList = this.token().leadingTrivia(); - if (includeSkippedTokens && triviaList && triviaList.hasSkippedToken()) { - var currentTriviaEndPosition = this.start(); - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return new PositionedSkippedToken(this, trivia.skippedToken(), currentTriviaEndPosition - trivia.fullWidth()); - } - - currentTriviaEndPosition -= trivia.fullWidth(); - } - } - - var start = this.fullStart(); - if (start === 0) { - return null; - } - - return this.root().node().findToken(start - 1, includeSkippedTokens); - }; - - PositionedToken.prototype.nextToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - if (this.token().tokenKind === 10 /* EndOfFileToken */) { - return null; - } - - var triviaList = this.token().trailingTrivia(); - if (includeSkippedTokens && triviaList && triviaList.hasSkippedToken()) { - var fullStart = this.end(); - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (trivia.isSkippedToken()) { - return new PositionedSkippedToken(this, trivia.skippedToken(), fullStart); - } - - fullStart += trivia.fullWidth(); - } - } - - return this.root().node().findToken(this.fullEnd(), includeSkippedTokens); - }; - return PositionedToken; - })(PositionedNodeOrToken); - TypeScript.PositionedToken = PositionedToken; - - var PositionedList = (function (_super) { - __extends(PositionedList, _super); - function PositionedList(parent, list, fullStart) { - _super.call(this, parent, list, fullStart); - } - PositionedList.prototype.list = function () { - return this.element(); - }; - return PositionedList; - })(PositionedElement); - TypeScript.PositionedList = PositionedList; - - var PositionedSeparatedList = (function (_super) { - __extends(PositionedSeparatedList, _super); - function PositionedSeparatedList(parent, list, fullStart) { - _super.call(this, parent, list, fullStart); - } - PositionedSeparatedList.prototype.list = function () { - return this.element(); - }; - return PositionedSeparatedList; - })(PositionedElement); - TypeScript.PositionedSeparatedList = PositionedSeparatedList; - - var PositionedSkippedToken = (function (_super) { - __extends(PositionedSkippedToken, _super); - function PositionedSkippedToken(parentToken, token, fullStart) { - _super.call(this, parentToken.parent(), token, fullStart); - this._parentToken = parentToken; - } - PositionedSkippedToken.prototype.parentToken = function () { - return this._parentToken; - }; - - PositionedSkippedToken.prototype.previousToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var start = this.fullStart(); - - if (includeSkippedTokens) { - var previousToken; - - if (start >= this.parentToken().end()) { - previousToken = TypeScript.Syntax.findSkippedTokenInTrailingTriviaList(this.parentToken(), start - 1); - - if (previousToken) { - return previousToken; - } - - return this.parentToken(); - } else { - previousToken = TypeScript.Syntax.findSkippedTokenInLeadingTriviaList(this.parentToken(), start - 1); - - if (previousToken) { - return previousToken; - } - } - } - - var start = this.parentToken().fullStart(); - if (start === 0) { - return null; - } - - return this.root().node().findToken(start - 1, includeSkippedTokens); - }; - - PositionedSkippedToken.prototype.nextToken = function (includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - if (this.token().tokenKind === 10 /* EndOfFileToken */) { - return null; - } - - if (includeSkippedTokens) { - var end = this.end(); - var nextToken; - - if (end <= this.parentToken().start()) { - nextToken = TypeScript.Syntax.findSkippedTokenInLeadingTriviaList(this.parentToken(), end); - - if (nextToken) { - return nextToken; - } - - return this.parentToken(); - } else { - nextToken = TypeScript.Syntax.findSkippedTokenInTrailingTriviaList(this.parentToken(), end); - - if (nextToken) { - return nextToken; - } - } - } - - return this.root().node().findToken(this.parentToken().fullEnd(), includeSkippedTokens); - }; - return PositionedSkippedToken; - })(PositionedToken); - TypeScript.PositionedSkippedToken = PositionedSkippedToken; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["None"] = 0] = "None"; - SyntaxKind[SyntaxKind["List"] = 1] = "List"; - SyntaxKind[SyntaxKind["SeparatedList"] = 2] = "SeparatedList"; - SyntaxKind[SyntaxKind["TriviaList"] = 3] = "TriviaList"; - - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 4] = "WhitespaceTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 5] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 6] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 7] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["SkippedTokenTrivia"] = 8] = "SkippedTokenTrivia"; - - SyntaxKind[SyntaxKind["ErrorToken"] = 9] = "ErrorToken"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 10] = "EndOfFileToken"; - - SyntaxKind[SyntaxKind["IdentifierName"] = 11] = "IdentifierName"; - - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 12] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NumericLiteral"] = 13] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 14] = "StringLiteral"; - - SyntaxKind[SyntaxKind["BreakKeyword"] = 15] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 16] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 17] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 18] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 19] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 20] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 21] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 22] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 23] = "ElseKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 24] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 25] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 26] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 27] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 28] = "IfKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 29] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 30] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 31] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 32] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 33] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 34] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 35] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 36] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 37] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 38] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 39] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 40] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 41] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 42] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 43] = "WithKeyword"; - - SyntaxKind[SyntaxKind["ClassKeyword"] = 44] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 45] = "ConstKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 46] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 47] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 48] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 49] = "ImportKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 50] = "SuperKeyword"; - - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 51] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 52] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 53] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 54] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 55] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 56] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 57] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 58] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 59] = "YieldKeyword"; - - SyntaxKind[SyntaxKind["AnyKeyword"] = 60] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 61] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 62] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 63] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 64] = "GetKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 65] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 66] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 67] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 68] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 69] = "StringKeyword"; - - SyntaxKind[SyntaxKind["OpenBraceToken"] = 70] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 71] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 72] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 73] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 74] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 75] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 76] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 77] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 78] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 79] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 80] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 81] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 82] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 83] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 84] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 85] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 86] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 87] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 88] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 89] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 90] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 91] = "AsteriskToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 92] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 93] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 94] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 95] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 96] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 97] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 98] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 99] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 100] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 101] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 102] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 103] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 104] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 105] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 106] = "ColonToken"; - SyntaxKind[SyntaxKind["EqualsToken"] = 107] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 108] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 109] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 110] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 111] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 112] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 113] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 114] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 115] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 116] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 117] = "CaretEqualsToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 118] = "SlashToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 119] = "SlashEqualsToken"; - - SyntaxKind[SyntaxKind["SourceUnit"] = 120] = "SourceUnit"; - - SyntaxKind[SyntaxKind["QualifiedName"] = 121] = "QualifiedName"; - - SyntaxKind[SyntaxKind["ObjectType"] = 122] = "ObjectType"; - SyntaxKind[SyntaxKind["FunctionType"] = 123] = "FunctionType"; - SyntaxKind[SyntaxKind["ArrayType"] = 124] = "ArrayType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 125] = "ConstructorType"; - SyntaxKind[SyntaxKind["GenericType"] = 126] = "GenericType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 127] = "TypeQuery"; - - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 128] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 129] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 130] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 131] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 132] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 133] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 134] = "ExportAssignment"; - - SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 135] = "MemberFunctionDeclaration"; - SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 136] = "MemberVariableDeclaration"; - SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 137] = "ConstructorDeclaration"; - SyntaxKind[SyntaxKind["IndexMemberDeclaration"] = 138] = "IndexMemberDeclaration"; - - SyntaxKind[SyntaxKind["GetAccessor"] = 139] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 140] = "SetAccessor"; - - SyntaxKind[SyntaxKind["PropertySignature"] = 141] = "PropertySignature"; - SyntaxKind[SyntaxKind["CallSignature"] = 142] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 143] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 144] = "IndexSignature"; - SyntaxKind[SyntaxKind["MethodSignature"] = 145] = "MethodSignature"; - - SyntaxKind[SyntaxKind["Block"] = 146] = "Block"; - SyntaxKind[SyntaxKind["IfStatement"] = 147] = "IfStatement"; - SyntaxKind[SyntaxKind["VariableStatement"] = 148] = "VariableStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 149] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 150] = "ReturnStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 151] = "SwitchStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 152] = "BreakStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 153] = "ContinueStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 154] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 155] = "ForInStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 156] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 157] = "ThrowStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 158] = "WhileStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 159] = "TryStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 160] = "LabeledStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 161] = "DoStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 162] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 163] = "WithStatement"; - - SyntaxKind[SyntaxKind["PlusExpression"] = 164] = "PlusExpression"; - SyntaxKind[SyntaxKind["NegateExpression"] = 165] = "NegateExpression"; - SyntaxKind[SyntaxKind["BitwiseNotExpression"] = 166] = "BitwiseNotExpression"; - SyntaxKind[SyntaxKind["LogicalNotExpression"] = 167] = "LogicalNotExpression"; - SyntaxKind[SyntaxKind["PreIncrementExpression"] = 168] = "PreIncrementExpression"; - SyntaxKind[SyntaxKind["PreDecrementExpression"] = 169] = "PreDecrementExpression"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 170] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 171] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 172] = "VoidExpression"; - SyntaxKind[SyntaxKind["CommaExpression"] = 173] = "CommaExpression"; - SyntaxKind[SyntaxKind["AssignmentExpression"] = 174] = "AssignmentExpression"; - SyntaxKind[SyntaxKind["AddAssignmentExpression"] = 175] = "AddAssignmentExpression"; - SyntaxKind[SyntaxKind["SubtractAssignmentExpression"] = 176] = "SubtractAssignmentExpression"; - SyntaxKind[SyntaxKind["MultiplyAssignmentExpression"] = 177] = "MultiplyAssignmentExpression"; - SyntaxKind[SyntaxKind["DivideAssignmentExpression"] = 178] = "DivideAssignmentExpression"; - SyntaxKind[SyntaxKind["ModuloAssignmentExpression"] = 179] = "ModuloAssignmentExpression"; - SyntaxKind[SyntaxKind["AndAssignmentExpression"] = 180] = "AndAssignmentExpression"; - SyntaxKind[SyntaxKind["ExclusiveOrAssignmentExpression"] = 181] = "ExclusiveOrAssignmentExpression"; - SyntaxKind[SyntaxKind["OrAssignmentExpression"] = 182] = "OrAssignmentExpression"; - SyntaxKind[SyntaxKind["LeftShiftAssignmentExpression"] = 183] = "LeftShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftAssignmentExpression"] = 184] = "SignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftAssignmentExpression"] = 185] = "UnsignedRightShiftAssignmentExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 186] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["LogicalOrExpression"] = 187] = "LogicalOrExpression"; - SyntaxKind[SyntaxKind["LogicalAndExpression"] = 188] = "LogicalAndExpression"; - SyntaxKind[SyntaxKind["BitwiseOrExpression"] = 189] = "BitwiseOrExpression"; - SyntaxKind[SyntaxKind["BitwiseExclusiveOrExpression"] = 190] = "BitwiseExclusiveOrExpression"; - SyntaxKind[SyntaxKind["BitwiseAndExpression"] = 191] = "BitwiseAndExpression"; - SyntaxKind[SyntaxKind["EqualsWithTypeConversionExpression"] = 192] = "EqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["NotEqualsWithTypeConversionExpression"] = 193] = "NotEqualsWithTypeConversionExpression"; - SyntaxKind[SyntaxKind["EqualsExpression"] = 194] = "EqualsExpression"; - SyntaxKind[SyntaxKind["NotEqualsExpression"] = 195] = "NotEqualsExpression"; - SyntaxKind[SyntaxKind["LessThanExpression"] = 196] = "LessThanExpression"; - SyntaxKind[SyntaxKind["GreaterThanExpression"] = 197] = "GreaterThanExpression"; - SyntaxKind[SyntaxKind["LessThanOrEqualExpression"] = 198] = "LessThanOrEqualExpression"; - SyntaxKind[SyntaxKind["GreaterThanOrEqualExpression"] = 199] = "GreaterThanOrEqualExpression"; - SyntaxKind[SyntaxKind["InstanceOfExpression"] = 200] = "InstanceOfExpression"; - SyntaxKind[SyntaxKind["InExpression"] = 201] = "InExpression"; - SyntaxKind[SyntaxKind["LeftShiftExpression"] = 202] = "LeftShiftExpression"; - SyntaxKind[SyntaxKind["SignedRightShiftExpression"] = 203] = "SignedRightShiftExpression"; - SyntaxKind[SyntaxKind["UnsignedRightShiftExpression"] = 204] = "UnsignedRightShiftExpression"; - SyntaxKind[SyntaxKind["MultiplyExpression"] = 205] = "MultiplyExpression"; - SyntaxKind[SyntaxKind["DivideExpression"] = 206] = "DivideExpression"; - SyntaxKind[SyntaxKind["ModuloExpression"] = 207] = "ModuloExpression"; - SyntaxKind[SyntaxKind["AddExpression"] = 208] = "AddExpression"; - SyntaxKind[SyntaxKind["SubtractExpression"] = 209] = "SubtractExpression"; - SyntaxKind[SyntaxKind["PostIncrementExpression"] = 210] = "PostIncrementExpression"; - SyntaxKind[SyntaxKind["PostDecrementExpression"] = 211] = "PostDecrementExpression"; - SyntaxKind[SyntaxKind["MemberAccessExpression"] = 212] = "MemberAccessExpression"; - SyntaxKind[SyntaxKind["InvocationExpression"] = 213] = "InvocationExpression"; - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 214] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 215] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectCreationExpression"] = 216] = "ObjectCreationExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 217] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["ParenthesizedArrowFunctionExpression"] = 218] = "ParenthesizedArrowFunctionExpression"; - SyntaxKind[SyntaxKind["SimpleArrowFunctionExpression"] = 219] = "SimpleArrowFunctionExpression"; - SyntaxKind[SyntaxKind["CastExpression"] = 220] = "CastExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 221] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 222] = "FunctionExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 223] = "OmittedExpression"; - - SyntaxKind[SyntaxKind["VariableDeclaration"] = 224] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarator"] = 225] = "VariableDeclarator"; - - SyntaxKind[SyntaxKind["ArgumentList"] = 226] = "ArgumentList"; - SyntaxKind[SyntaxKind["ParameterList"] = 227] = "ParameterList"; - SyntaxKind[SyntaxKind["TypeArgumentList"] = 228] = "TypeArgumentList"; - SyntaxKind[SyntaxKind["TypeParameterList"] = 229] = "TypeParameterList"; - - SyntaxKind[SyntaxKind["ExtendsHeritageClause"] = 230] = "ExtendsHeritageClause"; - SyntaxKind[SyntaxKind["ImplementsHeritageClause"] = 231] = "ImplementsHeritageClause"; - SyntaxKind[SyntaxKind["EqualsValueClause"] = 232] = "EqualsValueClause"; - SyntaxKind[SyntaxKind["CaseSwitchClause"] = 233] = "CaseSwitchClause"; - SyntaxKind[SyntaxKind["DefaultSwitchClause"] = 234] = "DefaultSwitchClause"; - SyntaxKind[SyntaxKind["ElseClause"] = 235] = "ElseClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 236] = "CatchClause"; - SyntaxKind[SyntaxKind["FinallyClause"] = 237] = "FinallyClause"; - - SyntaxKind[SyntaxKind["TypeParameter"] = 238] = "TypeParameter"; - SyntaxKind[SyntaxKind["Constraint"] = 239] = "Constraint"; - - SyntaxKind[SyntaxKind["SimplePropertyAssignment"] = 240] = "SimplePropertyAssignment"; - - SyntaxKind[SyntaxKind["FunctionPropertyAssignment"] = 241] = "FunctionPropertyAssignment"; - - SyntaxKind[SyntaxKind["Parameter"] = 242] = "Parameter"; - SyntaxKind[SyntaxKind["EnumElement"] = 243] = "EnumElement"; - SyntaxKind[SyntaxKind["TypeAnnotation"] = 244] = "TypeAnnotation"; - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 245] = "ExternalModuleReference"; - SyntaxKind[SyntaxKind["ModuleNameModuleReference"] = 246] = "ModuleNameModuleReference"; - SyntaxKind[SyntaxKind["Last"] = SyntaxKind.ModuleNameModuleReference] = "Last"; - - SyntaxKind[SyntaxKind["FirstStandardKeyword"] = SyntaxKind.BreakKeyword] = "FirstStandardKeyword"; - SyntaxKind[SyntaxKind["LastStandardKeyword"] = SyntaxKind.WithKeyword] = "LastStandardKeyword"; - - SyntaxKind[SyntaxKind["FirstFutureReservedKeyword"] = SyntaxKind.ClassKeyword] = "FirstFutureReservedKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedKeyword"] = SyntaxKind.SuperKeyword] = "LastFutureReservedKeyword"; - - SyntaxKind[SyntaxKind["FirstFutureReservedStrictKeyword"] = SyntaxKind.ImplementsKeyword] = "FirstFutureReservedStrictKeyword"; - SyntaxKind[SyntaxKind["LastFutureReservedStrictKeyword"] = SyntaxKind.YieldKeyword] = "LastFutureReservedStrictKeyword"; - - SyntaxKind[SyntaxKind["FirstTypeScriptKeyword"] = SyntaxKind.AnyKeyword] = "FirstTypeScriptKeyword"; - SyntaxKind[SyntaxKind["LastTypeScriptKeyword"] = SyntaxKind.StringKeyword] = "LastTypeScriptKeyword"; - - SyntaxKind[SyntaxKind["FirstKeyword"] = SyntaxKind.FirstStandardKeyword] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = SyntaxKind.LastTypeScriptKeyword] = "LastKeyword"; - - SyntaxKind[SyntaxKind["FirstToken"] = SyntaxKind.ErrorToken] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = SyntaxKind.SlashEqualsToken] = "LastToken"; - - SyntaxKind[SyntaxKind["FirstPunctuation"] = SyntaxKind.OpenBraceToken] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = SyntaxKind.SlashEqualsToken] = "LastPunctuation"; - - SyntaxKind[SyntaxKind["FirstFixedWidth"] = SyntaxKind.FirstKeyword] = "FirstFixedWidth"; - SyntaxKind[SyntaxKind["LastFixedWidth"] = SyntaxKind.LastPunctuation] = "LastFixedWidth"; - - SyntaxKind[SyntaxKind["FirstTrivia"] = SyntaxKind.WhitespaceTrivia] = "FirstTrivia"; - SyntaxKind[SyntaxKind["LastTrivia"] = SyntaxKind.SkippedTokenTrivia] = "LastTrivia"; - })(TypeScript.SyntaxKind || (TypeScript.SyntaxKind = {})); - var SyntaxKind = TypeScript.SyntaxKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - var textToKeywordKind = { - "any": 60 /* AnyKeyword */, - "boolean": 61 /* BooleanKeyword */, - "break": 15 /* BreakKeyword */, - "case": 16 /* CaseKeyword */, - "catch": 17 /* CatchKeyword */, - "class": 44 /* ClassKeyword */, - "continue": 18 /* ContinueKeyword */, - "const": 45 /* ConstKeyword */, - "constructor": 62 /* ConstructorKeyword */, - "debugger": 19 /* DebuggerKeyword */, - "declare": 63 /* DeclareKeyword */, - "default": 20 /* DefaultKeyword */, - "delete": 21 /* DeleteKeyword */, - "do": 22 /* DoKeyword */, - "else": 23 /* ElseKeyword */, - "enum": 46 /* EnumKeyword */, - "export": 47 /* ExportKeyword */, - "extends": 48 /* ExtendsKeyword */, - "false": 24 /* FalseKeyword */, - "finally": 25 /* FinallyKeyword */, - "for": 26 /* ForKeyword */, - "function": 27 /* FunctionKeyword */, - "get": 64 /* GetKeyword */, - "if": 28 /* IfKeyword */, - "implements": 51 /* ImplementsKeyword */, - "import": 49 /* ImportKeyword */, - "in": 29 /* InKeyword */, - "instanceof": 30 /* InstanceOfKeyword */, - "interface": 52 /* InterfaceKeyword */, - "let": 53 /* LetKeyword */, - "module": 65 /* ModuleKeyword */, - "new": 31 /* NewKeyword */, - "null": 32 /* NullKeyword */, - "number": 67 /* NumberKeyword */, - "package": 54 /* PackageKeyword */, - "private": 55 /* PrivateKeyword */, - "protected": 56 /* ProtectedKeyword */, - "public": 57 /* PublicKeyword */, - "require": 66 /* RequireKeyword */, - "return": 33 /* ReturnKeyword */, - "set": 68 /* SetKeyword */, - "static": 58 /* StaticKeyword */, - "string": 69 /* StringKeyword */, - "super": 50 /* SuperKeyword */, - "switch": 34 /* SwitchKeyword */, - "this": 35 /* ThisKeyword */, - "throw": 36 /* ThrowKeyword */, - "true": 37 /* TrueKeyword */, - "try": 38 /* TryKeyword */, - "typeof": 39 /* TypeOfKeyword */, - "var": 40 /* VarKeyword */, - "void": 41 /* VoidKeyword */, - "while": 42 /* WhileKeyword */, - "with": 43 /* WithKeyword */, - "yield": 59 /* YieldKeyword */, - "{": 70 /* OpenBraceToken */, - "}": 71 /* CloseBraceToken */, - "(": 72 /* OpenParenToken */, - ")": 73 /* CloseParenToken */, - "[": 74 /* OpenBracketToken */, - "]": 75 /* CloseBracketToken */, - ".": 76 /* DotToken */, - "...": 77 /* DotDotDotToken */, - ";": 78 /* SemicolonToken */, - ",": 79 /* CommaToken */, - "<": 80 /* LessThanToken */, - ">": 81 /* GreaterThanToken */, - "<=": 82 /* LessThanEqualsToken */, - ">=": 83 /* GreaterThanEqualsToken */, - "==": 84 /* EqualsEqualsToken */, - "=>": 85 /* EqualsGreaterThanToken */, - "!=": 86 /* ExclamationEqualsToken */, - "===": 87 /* EqualsEqualsEqualsToken */, - "!==": 88 /* ExclamationEqualsEqualsToken */, - "+": 89 /* PlusToken */, - "-": 90 /* MinusToken */, - "*": 91 /* AsteriskToken */, - "%": 92 /* PercentToken */, - "++": 93 /* PlusPlusToken */, - "--": 94 /* MinusMinusToken */, - "<<": 95 /* LessThanLessThanToken */, - ">>": 96 /* GreaterThanGreaterThanToken */, - ">>>": 97 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 98 /* AmpersandToken */, - "|": 99 /* BarToken */, - "^": 100 /* CaretToken */, - "!": 101 /* ExclamationToken */, - "~": 102 /* TildeToken */, - "&&": 103 /* AmpersandAmpersandToken */, - "||": 104 /* BarBarToken */, - "?": 105 /* QuestionToken */, - ":": 106 /* ColonToken */, - "=": 107 /* EqualsToken */, - "+=": 108 /* PlusEqualsToken */, - "-=": 109 /* MinusEqualsToken */, - "*=": 110 /* AsteriskEqualsToken */, - "%=": 111 /* PercentEqualsToken */, - "<<=": 112 /* LessThanLessThanEqualsToken */, - ">>=": 113 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 115 /* AmpersandEqualsToken */, - "|=": 116 /* BarEqualsToken */, - "^=": 117 /* CaretEqualsToken */, - "/": 118 /* SlashToken */, - "/=": 119 /* SlashEqualsToken */ - }; - - var kindToText = new Array(); - - for (var name in textToKeywordKind) { - if (textToKeywordKind.hasOwnProperty(name)) { - kindToText[textToKeywordKind[name]] = name; - } - } - - kindToText[62 /* ConstructorKeyword */] = "constructor"; - - function getTokenKind(text) { - if (textToKeywordKind.hasOwnProperty(text)) { - return textToKeywordKind[text]; - } - - return 0 /* None */; - } - SyntaxFacts.getTokenKind = getTokenKind; - - function getText(kind) { - var result = kindToText[kind]; - return result !== undefined ? result : null; - } - SyntaxFacts.getText = getText; - - function isTokenKind(kind) { - return kind >= 9 /* FirstToken */ && kind <= 119 /* LastToken */; - } - SyntaxFacts.isTokenKind = isTokenKind; - - function isAnyKeyword(kind) { - return kind >= 15 /* FirstKeyword */ && kind <= 69 /* LastKeyword */; - } - SyntaxFacts.isAnyKeyword = isAnyKeyword; - - function isStandardKeyword(kind) { - return kind >= 15 /* FirstStandardKeyword */ && kind <= 43 /* LastStandardKeyword */; - } - SyntaxFacts.isStandardKeyword = isStandardKeyword; - - function isFutureReservedKeyword(kind) { - return kind >= 44 /* FirstFutureReservedKeyword */ && kind <= 50 /* LastFutureReservedKeyword */; - } - SyntaxFacts.isFutureReservedKeyword = isFutureReservedKeyword; - - function isFutureReservedStrictKeyword(kind) { - return kind >= 51 /* FirstFutureReservedStrictKeyword */ && kind <= 59 /* LastFutureReservedStrictKeyword */; - } - SyntaxFacts.isFutureReservedStrictKeyword = isFutureReservedStrictKeyword; - - function isAnyPunctuation(kind) { - return kind >= 70 /* FirstPunctuation */ && kind <= 119 /* LastPunctuation */; - } - SyntaxFacts.isAnyPunctuation = isAnyPunctuation; - - function isPrefixUnaryExpressionOperatorToken(tokenKind) { - return getPrefixUnaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isPrefixUnaryExpressionOperatorToken = isPrefixUnaryExpressionOperatorToken; - - function isBinaryExpressionOperatorToken(tokenKind) { - return getBinaryExpressionFromOperatorToken(tokenKind) !== 0 /* None */; - } - SyntaxFacts.isBinaryExpressionOperatorToken = isBinaryExpressionOperatorToken; - - function getPrefixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 89 /* PlusToken */: - return 164 /* PlusExpression */; - case 90 /* MinusToken */: - return 165 /* NegateExpression */; - case 102 /* TildeToken */: - return 166 /* BitwiseNotExpression */; - case 101 /* ExclamationToken */: - return 167 /* LogicalNotExpression */; - case 93 /* PlusPlusToken */: - return 168 /* PreIncrementExpression */; - case 94 /* MinusMinusToken */: - return 169 /* PreDecrementExpression */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken = getPrefixUnaryExpressionFromOperatorToken; - - function getPostfixUnaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 93 /* PlusPlusToken */: - return 210 /* PostIncrementExpression */; - case 94 /* MinusMinusToken */: - return 211 /* PostDecrementExpression */; - default: - return 0 /* None */; - } - } - SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken = getPostfixUnaryExpressionFromOperatorToken; - - function getBinaryExpressionFromOperatorToken(tokenKind) { - switch (tokenKind) { - case 91 /* AsteriskToken */: - return 205 /* MultiplyExpression */; - - case 118 /* SlashToken */: - return 206 /* DivideExpression */; - - case 92 /* PercentToken */: - return 207 /* ModuloExpression */; - - case 89 /* PlusToken */: - return 208 /* AddExpression */; - - case 90 /* MinusToken */: - return 209 /* SubtractExpression */; - - case 95 /* LessThanLessThanToken */: - return 202 /* LeftShiftExpression */; - - case 96 /* GreaterThanGreaterThanToken */: - return 203 /* SignedRightShiftExpression */; - - case 97 /* GreaterThanGreaterThanGreaterThanToken */: - return 204 /* UnsignedRightShiftExpression */; - - case 80 /* LessThanToken */: - return 196 /* LessThanExpression */; - - case 81 /* GreaterThanToken */: - return 197 /* GreaterThanExpression */; - - case 82 /* LessThanEqualsToken */: - return 198 /* LessThanOrEqualExpression */; - - case 83 /* GreaterThanEqualsToken */: - return 199 /* GreaterThanOrEqualExpression */; - - case 30 /* InstanceOfKeyword */: - return 200 /* InstanceOfExpression */; - - case 29 /* InKeyword */: - return 201 /* InExpression */; - - case 84 /* EqualsEqualsToken */: - return 192 /* EqualsWithTypeConversionExpression */; - - case 86 /* ExclamationEqualsToken */: - return 193 /* NotEqualsWithTypeConversionExpression */; - - case 87 /* EqualsEqualsEqualsToken */: - return 194 /* EqualsExpression */; - - case 88 /* ExclamationEqualsEqualsToken */: - return 195 /* NotEqualsExpression */; - - case 98 /* AmpersandToken */: - return 191 /* BitwiseAndExpression */; - - case 100 /* CaretToken */: - return 190 /* BitwiseExclusiveOrExpression */; - - case 99 /* BarToken */: - return 189 /* BitwiseOrExpression */; - - case 103 /* AmpersandAmpersandToken */: - return 188 /* LogicalAndExpression */; - - case 104 /* BarBarToken */: - return 187 /* LogicalOrExpression */; - - case 116 /* BarEqualsToken */: - return 182 /* OrAssignmentExpression */; - - case 115 /* AmpersandEqualsToken */: - return 180 /* AndAssignmentExpression */; - - case 117 /* CaretEqualsToken */: - return 181 /* ExclusiveOrAssignmentExpression */; - - case 112 /* LessThanLessThanEqualsToken */: - return 183 /* LeftShiftAssignmentExpression */; - - case 113 /* GreaterThanGreaterThanEqualsToken */: - return 184 /* SignedRightShiftAssignmentExpression */; - - case 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - return 185 /* UnsignedRightShiftAssignmentExpression */; - - case 108 /* PlusEqualsToken */: - return 175 /* AddAssignmentExpression */; - - case 109 /* MinusEqualsToken */: - return 176 /* SubtractAssignmentExpression */; - - case 110 /* AsteriskEqualsToken */: - return 177 /* MultiplyAssignmentExpression */; - - case 119 /* SlashEqualsToken */: - return 178 /* DivideAssignmentExpression */; - - case 111 /* PercentEqualsToken */: - return 179 /* ModuloAssignmentExpression */; - - case 107 /* EqualsToken */: - return 174 /* AssignmentExpression */; - - case 79 /* CommaToken */: - return 173 /* CommaExpression */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getBinaryExpressionFromOperatorToken = getBinaryExpressionFromOperatorToken; - - function getOperatorTokenFromBinaryExpression(tokenKind) { - switch (tokenKind) { - case 205 /* MultiplyExpression */: - return 91 /* AsteriskToken */; - - case 206 /* DivideExpression */: - return 118 /* SlashToken */; - - case 207 /* ModuloExpression */: - return 92 /* PercentToken */; - - case 208 /* AddExpression */: - return 89 /* PlusToken */; - - case 209 /* SubtractExpression */: - return 90 /* MinusToken */; - - case 202 /* LeftShiftExpression */: - return 95 /* LessThanLessThanToken */; - - case 203 /* SignedRightShiftExpression */: - return 96 /* GreaterThanGreaterThanToken */; - - case 204 /* UnsignedRightShiftExpression */: - return 97 /* GreaterThanGreaterThanGreaterThanToken */; - - case 196 /* LessThanExpression */: - return 80 /* LessThanToken */; - - case 197 /* GreaterThanExpression */: - return 81 /* GreaterThanToken */; - - case 198 /* LessThanOrEqualExpression */: - return 82 /* LessThanEqualsToken */; - - case 199 /* GreaterThanOrEqualExpression */: - return 83 /* GreaterThanEqualsToken */; - - case 200 /* InstanceOfExpression */: - return 30 /* InstanceOfKeyword */; - - case 201 /* InExpression */: - return 29 /* InKeyword */; - - case 192 /* EqualsWithTypeConversionExpression */: - return 84 /* EqualsEqualsToken */; - - case 193 /* NotEqualsWithTypeConversionExpression */: - return 86 /* ExclamationEqualsToken */; - - case 194 /* EqualsExpression */: - return 87 /* EqualsEqualsEqualsToken */; - - case 195 /* NotEqualsExpression */: - return 88 /* ExclamationEqualsEqualsToken */; - - case 191 /* BitwiseAndExpression */: - return 98 /* AmpersandToken */; - - case 190 /* BitwiseExclusiveOrExpression */: - return 100 /* CaretToken */; - - case 189 /* BitwiseOrExpression */: - return 99 /* BarToken */; - - case 188 /* LogicalAndExpression */: - return 103 /* AmpersandAmpersandToken */; - - case 187 /* LogicalOrExpression */: - return 104 /* BarBarToken */; - - case 182 /* OrAssignmentExpression */: - return 116 /* BarEqualsToken */; - - case 180 /* AndAssignmentExpression */: - return 115 /* AmpersandEqualsToken */; - - case 181 /* ExclusiveOrAssignmentExpression */: - return 117 /* CaretEqualsToken */; - - case 183 /* LeftShiftAssignmentExpression */: - return 112 /* LessThanLessThanEqualsToken */; - - case 184 /* SignedRightShiftAssignmentExpression */: - return 113 /* GreaterThanGreaterThanEqualsToken */; - - case 185 /* UnsignedRightShiftAssignmentExpression */: - return 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - - case 175 /* AddAssignmentExpression */: - return 108 /* PlusEqualsToken */; - - case 176 /* SubtractAssignmentExpression */: - return 109 /* MinusEqualsToken */; - - case 177 /* MultiplyAssignmentExpression */: - return 110 /* AsteriskEqualsToken */; - - case 178 /* DivideAssignmentExpression */: - return 119 /* SlashEqualsToken */; - - case 179 /* ModuloAssignmentExpression */: - return 111 /* PercentEqualsToken */; - - case 174 /* AssignmentExpression */: - return 107 /* EqualsToken */; - - case 173 /* CommaExpression */: - return 79 /* CommaToken */; - - default: - return 0 /* None */; - } - } - SyntaxFacts.getOperatorTokenFromBinaryExpression = getOperatorTokenFromBinaryExpression; - - function isAnyDivideToken(kind) { - switch (kind) { - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - return true; - default: - return false; - } - } - SyntaxFacts.isAnyDivideToken = isAnyDivideToken; - - function isAnyDivideOrRegularExpressionToken(kind) { - switch (kind) { - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - case 12 /* RegularExpressionLiteral */: - return true; - default: - return false; - } - } - SyntaxFacts.isAnyDivideOrRegularExpressionToken = isAnyDivideOrRegularExpressionToken; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var isKeywordStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierStartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isIdentifierPartCharacter = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - var isNumericLiteralStart = TypeScript.ArrayUtilities.createArray(127 /* maxAsciiCharacter */, false); - - for (var character = 0; character < 127 /* maxAsciiCharacter */; character++) { - if (character >= 97 /* a */ && character <= 122 /* z */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } else if ((character >= 65 /* A */ && character <= 90 /* Z */) || character === 95 /* _ */ || character === 36 /* $ */) { - isIdentifierStartCharacter[character] = true; - isIdentifierPartCharacter[character] = true; - } else if (character >= 48 /* _0 */ && character <= 57 /* _9 */) { - isIdentifierPartCharacter[character] = true; - isNumericLiteralStart[character] = true; - } - } - - isNumericLiteralStart[46 /* dot */] = true; - - for (var keywordKind = 15 /* FirstKeyword */; keywordKind <= 69 /* LastKeyword */; keywordKind++) { - var keyword = TypeScript.SyntaxFacts.getText(keywordKind); - isKeywordStartCharacter[keyword.charCodeAt(0)] = true; - } - - var Scanner = (function () { - function Scanner(fileName, text, languageVersion, window) { - if (typeof window === "undefined") { window = TypeScript.ArrayUtilities.createArray(2048, 0); } - this.slidingWindow = new TypeScript.SlidingWindow(this, window, 0, text.length()); - this.fileName = fileName; - this.text = text; - this._languageVersion = languageVersion; - } - Scanner.prototype.languageVersion = function () { - return this._languageVersion; - }; - - Scanner.prototype.fetchMoreItems = function (argument, sourceIndex, window, destinationIndex, spaceAvailable) { - var charactersRemaining = this.text.length() - sourceIndex; - var amountToRead = TypeScript.MathPrototype.min(charactersRemaining, spaceAvailable); - this.text.copyTo(sourceIndex, window, destinationIndex, amountToRead); - return amountToRead; - }; - - Scanner.prototype.currentCharCode = function () { - return this.slidingWindow.currentItem(null); - }; - - Scanner.prototype.absoluteIndex = function () { - return this.slidingWindow.absoluteIndex(); - }; - - Scanner.prototype.setAbsoluteIndex = function (index) { - this.slidingWindow.setAbsoluteIndex(index); - }; - - Scanner.prototype.scan = function (diagnostics, allowRegularExpression) { - var diagnosticsLength = diagnostics.length; - var fullStart = this.slidingWindow.absoluteIndex(); - var leadingTriviaInfo = this.scanTriviaInfo(diagnostics, false); - - var start = this.slidingWindow.absoluteIndex(); - var kindAndFlags = this.scanSyntaxToken(diagnostics, allowRegularExpression); - var end = this.slidingWindow.absoluteIndex(); - - var trailingTriviaInfo = this.scanTriviaInfo(diagnostics, true); - var fullEnd = this.slidingWindow.absoluteIndex(); - - var isVariableWidthKeyword = (kindAndFlags & -2147483648 /* IsVariableWidthKeyword */) !== 0; - var kind = kindAndFlags & ~-2147483648 /* IsVariableWidthKeyword */; - - var token = this.createToken(fullStart, leadingTriviaInfo, start, kind, end, fullEnd, trailingTriviaInfo, isVariableWidthKeyword); - - return diagnosticsLength !== diagnostics.length ? TypeScript.Syntax.realizeToken(token) : token; - }; - - Scanner.prototype.createToken = function (fullStart, leadingTriviaInfo, start, kind, end, fullEnd, trailingTriviaInfo, isVariableWidthKeyword) { - if (!isVariableWidthKeyword && kind >= 15 /* FirstFixedWidth */) { - if (leadingTriviaInfo === 0) { - if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.FixedWidthTokenWithNoTrivia(kind); - } else { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo); - } - } else if (trailingTriviaInfo === 0) { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo); - } else { - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - return new TypeScript.Syntax.FixedWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo); - } - } else { - var width = end - start; - - var fullText = this.text.substr(fullStart, fullEnd - fullStart, false); - - if (leadingTriviaInfo === 0) { - if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.VariableWidthTokenWithNoTrivia(fullText, kind); - } else { - return new TypeScript.Syntax.VariableWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo); - } - } else if (trailingTriviaInfo === 0) { - return new TypeScript.Syntax.VariableWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo); - } else { - return new TypeScript.Syntax.VariableWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo); - } - } - }; - - Scanner.scanTrivia = function (text, start, length, isTrailing) { - var scanner = new Scanner(null, text.subText(new TypeScript.TextSpan(start, length)), 1 /* EcmaScript5 */, Scanner.triviaWindow); - return scanner.scanTrivia(text, start, isTrailing); - }; - - Scanner.prototype.scanTrivia = function (underlyingText, underlyingTextStart, isTrailing) { - var trivia = new Array(); - - while (true) { - if (!this.slidingWindow.isAtEndOfSource()) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - trivia.push(this.scanWhitespaceTrivia(underlyingText, underlyingTextStart)); - continue; - - case 47 /* slash */: - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 47 /* slash */) { - trivia.push(this.scanSingleLineCommentTrivia(underlyingText, underlyingTextStart)); - continue; - } - - if (ch2 === 42 /* asterisk */) { - trivia.push(this.scanMultiLineCommentTrivia(underlyingText, underlyingTextStart)); - continue; - } - - throw TypeScript.Errors.invalidOperation(); - - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - trivia.push(this.scanLineTerminatorSequenceTrivia(ch)); - - if (!isTrailing) { - continue; - } - - break; - - default: - throw TypeScript.Errors.invalidOperation(); - } - } - - return TypeScript.Syntax.triviaList(trivia); - } - }; - - Scanner.prototype.scanTriviaInfo = function (diagnostics, isTrailing) { - var width = 0; - var hasCommentOrNewLine = 0; - - while (true) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - this.slidingWindow.moveToNextItem(); - width++; - continue; - - case 47 /* slash */: - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 47 /* slash */) { - hasCommentOrNewLine |= 2 /* TriviaCommentMask */; - width += this.scanSingleLineCommentTriviaLength(); - continue; - } - - if (ch2 === 42 /* asterisk */) { - hasCommentOrNewLine |= 2 /* TriviaCommentMask */; - width += this.scanMultiLineCommentTriviaLength(diagnostics); - continue; - } - - break; - - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - hasCommentOrNewLine |= 1 /* TriviaNewLineMask */; - width += this.scanLineTerminatorSequenceLength(ch); - - if (!isTrailing) { - continue; - } - - break; - } - - return (width << 2 /* TriviaFullWidthShift */) | hasCommentOrNewLine; - } - }; - - Scanner.prototype.isNewLineCharacter = function (ch) { - switch (ch) { - case 13 /* carriageReturn */: - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - return true; - default: - return false; - } - }; - - Scanner.prototype.scanWhitespaceTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.absoluteIndex(); - - var width = 0; - while (true) { - var ch = this.currentCharCode(); - - switch (ch) { - case 32 /* space */: - case 160 /* nonBreakingSpace */: - case 8192 /* enQuad */: - case 8193 /* emQuad */: - case 8194 /* enSpace */: - case 8195 /* emSpace */: - case 8196 /* threePerEmSpace */: - case 8197 /* fourPerEmSpace */: - case 8198 /* sixPerEmSpace */: - case 8199 /* figureSpace */: - case 8200 /* punctuationSpace */: - case 8201 /* thinSpace */: - case 8202 /* hairSpace */: - case 8203 /* zeroWidthSpace */: - case 8239 /* narrowNoBreakSpace */: - case 12288 /* ideographicSpace */: - - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 65279 /* byteOrderMark */: - this.slidingWindow.moveToNextItem(); - width++; - continue; - } - - break; - } - - return TypeScript.Syntax.deferredTrivia(4 /* WhitespaceTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanSingleLineCommentTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.slidingWindow.absoluteIndex(); - var width = this.scanSingleLineCommentTriviaLength(); - - return TypeScript.Syntax.deferredTrivia(7 /* SingleLineCommentTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanSingleLineCommentTriviaLength = function () { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - var width = 2; - while (true) { - if (this.slidingWindow.isAtEndOfSource() || this.isNewLineCharacter(this.currentCharCode())) { - return width; - } - - this.slidingWindow.moveToNextItem(); - width++; - } - }; - - Scanner.prototype.scanMultiLineCommentTrivia = function (underlyingText, underlyingTextStart) { - var absoluteStartIndex = this.absoluteIndex(); - var width = this.scanMultiLineCommentTriviaLength(null); - - return TypeScript.Syntax.deferredTrivia(6 /* MultiLineCommentTrivia */, underlyingText, underlyingTextStart + absoluteStartIndex, width); - }; - - Scanner.prototype.scanMultiLineCommentTriviaLength = function (diagnostics) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - var width = 2; - while (true) { - if (this.slidingWindow.isAtEndOfSource()) { - if (diagnostics !== null) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), this.slidingWindow.absoluteIndex(), 0, TypeScript.DiagnosticCode.AsteriskSlash_expected, null)); - } - - return width; - } - - var ch = this.currentCharCode(); - if (ch === 42 /* asterisk */ && this.slidingWindow.peekItemN(1) === 47 /* slash */) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - width += 2; - return width; - } - - this.slidingWindow.moveToNextItem(); - width++; - } - }; - - Scanner.prototype.scanLineTerminatorSequenceTrivia = function (ch) { - var absoluteStartIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - var width = this.scanLineTerminatorSequenceLength(ch); - - var text = this.substring(absoluteStartIndex, absoluteStartIndex + width, false); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(absoluteStartIndex); - - return TypeScript.Syntax.trivia(5 /* NewLineTrivia */, text); - }; - - Scanner.prototype.scanLineTerminatorSequenceLength = function (ch) { - this.slidingWindow.moveToNextItem(); - - if (ch === 13 /* carriageReturn */ && this.currentCharCode() === 10 /* lineFeed */) { - this.slidingWindow.moveToNextItem(); - return 2; - } else { - return 1; - } - }; - - Scanner.prototype.scanSyntaxToken = function (diagnostics, allowRegularExpression) { - if (this.slidingWindow.isAtEndOfSource()) { - return 10 /* EndOfFileToken */; - } - - var character = this.currentCharCode(); - - switch (character) { - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - return this.scanStringLiteral(diagnostics); - - case 47 /* slash */: - return this.scanSlashToken(allowRegularExpression); - - case 46 /* dot */: - return this.scanDotToken(diagnostics); - - case 45 /* minus */: - return this.scanMinusToken(); - - case 33 /* exclamation */: - return this.scanExclamationToken(); - - case 61 /* equals */: - return this.scanEqualsToken(); - - case 124 /* bar */: - return this.scanBarToken(); - - case 42 /* asterisk */: - return this.scanAsteriskToken(); - - case 43 /* plus */: - return this.scanPlusToken(); - - case 37 /* percent */: - return this.scanPercentToken(); - - case 38 /* ampersand */: - return this.scanAmpersandToken(); - - case 94 /* caret */: - return this.scanCaretToken(); - - case 60 /* lessThan */: - return this.scanLessThanToken(); - - case 62 /* greaterThan */: - return this.advanceAndSetTokenKind(81 /* GreaterThanToken */); - - case 44 /* comma */: - return this.advanceAndSetTokenKind(79 /* CommaToken */); - - case 58 /* colon */: - return this.advanceAndSetTokenKind(106 /* ColonToken */); - - case 59 /* semicolon */: - return this.advanceAndSetTokenKind(78 /* SemicolonToken */); - - case 126 /* tilde */: - return this.advanceAndSetTokenKind(102 /* TildeToken */); - - case 40 /* openParen */: - return this.advanceAndSetTokenKind(72 /* OpenParenToken */); - - case 41 /* closeParen */: - return this.advanceAndSetTokenKind(73 /* CloseParenToken */); - - case 123 /* openBrace */: - return this.advanceAndSetTokenKind(70 /* OpenBraceToken */); - - case 125 /* closeBrace */: - return this.advanceAndSetTokenKind(71 /* CloseBraceToken */); - - case 91 /* openBracket */: - return this.advanceAndSetTokenKind(74 /* OpenBracketToken */); - - case 93 /* closeBracket */: - return this.advanceAndSetTokenKind(75 /* CloseBracketToken */); - - case 63 /* question */: - return this.advanceAndSetTokenKind(105 /* QuestionToken */); - } - - if (isNumericLiteralStart[character]) { - return this.scanNumericLiteral(diagnostics); - } - - if (isIdentifierStartCharacter[character]) { - var result = this.tryFastScanIdentifierOrKeyword(character); - if (result !== 0 /* None */) { - return result; - } - } - - if (this.isIdentifierStart(this.peekCharOrUnicodeEscape())) { - return this.slowScanIdentifierOrKeyword(diagnostics); - } - - return this.scanDefaultCharacter(character, diagnostics); - }; - - Scanner.prototype.isIdentifierStart = function (interpretedChar) { - if (isIdentifierStartCharacter[interpretedChar]) { - return true; - } - - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierStart(interpretedChar, this._languageVersion); - }; - - Scanner.prototype.isIdentifierPart = function (interpretedChar) { - if (isIdentifierPartCharacter[interpretedChar]) { - return true; - } - - return interpretedChar > 127 /* maxAsciiCharacter */ && TypeScript.Unicode.isIdentifierPart(interpretedChar, this._languageVersion); - }; - - Scanner.prototype.tryFastScanIdentifierOrKeyword = function (firstCharacter) { - var slidingWindow = this.slidingWindow; - var window = slidingWindow.window; - - var startIndex = slidingWindow.currentRelativeItemIndex; - var endIndex = slidingWindow.windowCount; - var currentIndex = startIndex; - var character = 0; - - while (currentIndex < endIndex) { - character = window[currentIndex]; - if (!isIdentifierPartCharacter[character]) { - break; - } - - currentIndex++; - } - - if (currentIndex === endIndex) { - return 0 /* None */; - } else if (character === 92 /* backslash */ || character > 127 /* maxAsciiCharacter */) { - return 0 /* None */; - } else { - var kind; - var identifierLength = currentIndex - startIndex; - if (isKeywordStartCharacter[firstCharacter]) { - kind = TypeScript.ScannerUtilities.identifierKind(window, startIndex, identifierLength); - } else { - kind = 11 /* IdentifierName */; - } - - slidingWindow.setAbsoluteIndex(slidingWindow.absoluteIndex() + identifierLength); - - return kind; - } - }; - - Scanner.prototype.slowScanIdentifierOrKeyword = function (diagnostics) { - var startIndex = this.slidingWindow.absoluteIndex(); - var sawUnicodeEscape = false; - - do { - var unicodeEscape = this.scanCharOrUnicodeEscape(diagnostics); - sawUnicodeEscape = sawUnicodeEscape || unicodeEscape; - } while(this.isIdentifierPart(this.peekCharOrUnicodeEscape())); - - var length = this.slidingWindow.absoluteIndex() - startIndex; - var text = this.text.substr(startIndex, length, false); - var valueText = TypeScript.Syntax.massageEscapes(text); - - var keywordKind = TypeScript.SyntaxFacts.getTokenKind(valueText); - if (keywordKind >= 15 /* FirstKeyword */ && keywordKind <= 69 /* LastKeyword */) { - if (sawUnicodeEscape) { - return keywordKind | -2147483648 /* IsVariableWidthKeyword */; - } else { - return keywordKind; - } - } - - return 11 /* IdentifierName */; - }; - - Scanner.prototype.scanNumericLiteral = function (diagnostics) { - if (this.isHexNumericLiteral()) { - this.scanHexNumericLiteral(); - } else if (this.isOctalNumericLiteral()) { - this.scanOctalNumericLiteral(diagnostics); - } else { - this.scanDecimalNumericLiteral(); - } - - return 13 /* NumericLiteral */; - }; - - Scanner.prototype.isOctalNumericLiteral = function () { - return this.currentCharCode() === 48 /* _0 */ && TypeScript.CharacterInfo.isOctalDigit(this.slidingWindow.peekItemN(1)); - }; - - Scanner.prototype.scanOctalNumericLiteral = function (diagnostics) { - var position = this.absoluteIndex(); - - while (TypeScript.CharacterInfo.isOctalDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - - if (this.languageVersion() >= 1 /* EcmaScript5 */) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), position, this.absoluteIndex() - position, TypeScript.DiagnosticCode.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher, null)); - } - }; - - Scanner.prototype.scanDecimalDigits = function () { - while (TypeScript.CharacterInfo.isDecimalDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - }; - - Scanner.prototype.scanDecimalNumericLiteral = function () { - this.scanDecimalDigits(); - - if (this.currentCharCode() === 46 /* dot */) { - this.slidingWindow.moveToNextItem(); - } - - this.scanDecimalDigits(); - - var ch = this.currentCharCode(); - if (ch === 101 /* e */ || ch === 69 /* E */) { - var nextChar1 = this.slidingWindow.peekItemN(1); - - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar1)) { - this.slidingWindow.moveToNextItem(); - this.scanDecimalDigits(); - } else if (nextChar1 === 45 /* minus */ || nextChar1 === 43 /* plus */) { - var nextChar2 = this.slidingWindow.peekItemN(2); - if (TypeScript.CharacterInfo.isDecimalDigit(nextChar2)) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - this.scanDecimalDigits(); - } - } - } - }; - - Scanner.prototype.scanHexNumericLiteral = function () { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - - while (TypeScript.CharacterInfo.isHexDigit(this.currentCharCode())) { - this.slidingWindow.moveToNextItem(); - } - }; - - Scanner.prototype.isHexNumericLiteral = function () { - if (this.currentCharCode() === 48 /* _0 */) { - var ch = this.slidingWindow.peekItemN(1); - - if (ch === 120 /* x */ || ch === 88 /* X */) { - ch = this.slidingWindow.peekItemN(2); - - return TypeScript.CharacterInfo.isHexDigit(ch); - } - } - - return false; - }; - - Scanner.prototype.advanceAndSetTokenKind = function (kind) { - this.slidingWindow.moveToNextItem(); - return kind; - }; - - Scanner.prototype.scanLessThanToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 82 /* LessThanEqualsToken */; - } else if (this.currentCharCode() === 60 /* lessThan */) { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 112 /* LessThanLessThanEqualsToken */; - } else { - return 95 /* LessThanLessThanToken */; - } - } else { - return 80 /* LessThanToken */; - } - }; - - Scanner.prototype.scanBarToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 116 /* BarEqualsToken */; - } else if (this.currentCharCode() === 124 /* bar */) { - this.slidingWindow.moveToNextItem(); - return 104 /* BarBarToken */; - } else { - return 99 /* BarToken */; - } - }; - - Scanner.prototype.scanCaretToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 117 /* CaretEqualsToken */; - } else { - return 100 /* CaretToken */; - } - }; - - Scanner.prototype.scanAmpersandToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 115 /* AmpersandEqualsToken */; - } else if (this.currentCharCode() === 38 /* ampersand */) { - this.slidingWindow.moveToNextItem(); - return 103 /* AmpersandAmpersandToken */; - } else { - return 98 /* AmpersandToken */; - } - }; - - Scanner.prototype.scanPercentToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 111 /* PercentEqualsToken */; - } else { - return 92 /* PercentToken */; - } - }; - - Scanner.prototype.scanMinusToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 109 /* MinusEqualsToken */; - } else if (character === 45 /* minus */) { - this.slidingWindow.moveToNextItem(); - return 94 /* MinusMinusToken */; - } else { - return 90 /* MinusToken */; - } - }; - - Scanner.prototype.scanPlusToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 108 /* PlusEqualsToken */; - } else if (character === 43 /* plus */) { - this.slidingWindow.moveToNextItem(); - return 93 /* PlusPlusToken */; - } else { - return 89 /* PlusToken */; - } - }; - - Scanner.prototype.scanAsteriskToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 110 /* AsteriskEqualsToken */; - } else { - return 91 /* AsteriskToken */; - } - }; - - Scanner.prototype.scanEqualsToken = function () { - this.slidingWindow.moveToNextItem(); - var character = this.currentCharCode(); - if (character === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - return 87 /* EqualsEqualsEqualsToken */; - } else { - return 84 /* EqualsEqualsToken */; - } - } else if (character === 62 /* greaterThan */) { - this.slidingWindow.moveToNextItem(); - return 85 /* EqualsGreaterThanToken */; - } else { - return 107 /* EqualsToken */; - } - }; - - Scanner.prototype.isDotPrefixedNumericLiteral = function () { - if (this.currentCharCode() === 46 /* dot */) { - var ch = this.slidingWindow.peekItemN(1); - return TypeScript.CharacterInfo.isDecimalDigit(ch); - } - - return false; - }; - - Scanner.prototype.scanDotToken = function (diagnostics) { - if (this.isDotPrefixedNumericLiteral()) { - return this.scanNumericLiteral(diagnostics); - } - - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 46 /* dot */ && this.slidingWindow.peekItemN(1) === 46 /* dot */) { - this.slidingWindow.moveToNextItem(); - this.slidingWindow.moveToNextItem(); - return 77 /* DotDotDotToken */; - } else { - return 76 /* DotToken */; - } - }; - - Scanner.prototype.scanSlashToken = function (allowRegularExpression) { - if (allowRegularExpression) { - var result = this.tryScanRegularExpressionToken(); - if (result !== 0 /* None */) { - return result; - } - } - - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - return 119 /* SlashEqualsToken */; - } else { - return 118 /* SlashToken */; - } - }; - - Scanner.prototype.tryScanRegularExpressionToken = function () { - var startIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - this.slidingWindow.moveToNextItem(); - - var inEscape = false; - var inCharacterClass = false; - while (true) { - var ch = this.currentCharCode(); - - if (this.isNewLineCharacter(ch) || this.slidingWindow.isAtEndOfSource()) { - this.slidingWindow.rewindToPinnedIndex(startIndex); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - return 0 /* None */; - } - - this.slidingWindow.moveToNextItem(); - if (inEscape) { - inEscape = false; - continue; - } - - switch (ch) { - case 92 /* backslash */: - inEscape = true; - continue; - - case 91 /* openBracket */: - inCharacterClass = true; - continue; - - case 93 /* closeBracket */: - inCharacterClass = false; - continue; - - case 47 /* slash */: - if (inCharacterClass) { - continue; - } - - break; - - default: - continue; - } - - break; - } - - while (isIdentifierPartCharacter[this.currentCharCode()]) { - this.slidingWindow.moveToNextItem(); - } - - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - return 12 /* RegularExpressionLiteral */; - }; - - Scanner.prototype.scanExclamationToken = function () { - this.slidingWindow.moveToNextItem(); - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - if (this.currentCharCode() === 61 /* equals */) { - this.slidingWindow.moveToNextItem(); - - return 88 /* ExclamationEqualsEqualsToken */; - } else { - return 86 /* ExclamationEqualsToken */; - } - } else { - return 101 /* ExclamationToken */; - } - }; - - Scanner.prototype.scanDefaultCharacter = function (character, diagnostics) { - var position = this.slidingWindow.absoluteIndex(); - this.slidingWindow.moveToNextItem(); - - var text = String.fromCharCode(character); - var messageText = this.getErrorMessageText(text); - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), position, 1, TypeScript.DiagnosticCode.Unexpected_character_0, [messageText])); - - return 9 /* ErrorToken */; - }; - - Scanner.prototype.getErrorMessageText = function (text) { - if (text === "\\") { - return '"\\"'; - } - - return JSON.stringify(text); - }; - - Scanner.prototype.skipEscapeSequence = function (diagnostics) { - var rewindPoint = this.slidingWindow.getAndPinAbsoluteIndex(); - - this.slidingWindow.moveToNextItem(); - - var ch = this.currentCharCode(); - this.slidingWindow.moveToNextItem(); - switch (ch) { - case 120 /* x */: - case 117 /* u */: - this.slidingWindow.rewindToPinnedIndex(rewindPoint); - var value = this.scanUnicodeOrHexEscape(diagnostics); - break; - - case 13 /* carriageReturn */: - if (this.currentCharCode() === 10 /* lineFeed */) { - this.slidingWindow.moveToNextItem(); - } - break; - - default: - break; - } - - this.slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint); - }; - - Scanner.prototype.scanStringLiteral = function (diagnostics) { - var quoteCharacter = this.currentCharCode(); - - this.slidingWindow.moveToNextItem(); - - while (true) { - var ch = this.currentCharCode(); - if (ch === 92 /* backslash */) { - this.skipEscapeSequence(diagnostics); - } else if (ch === quoteCharacter) { - this.slidingWindow.moveToNextItem(); - break; - } else if (this.isNewLineCharacter(ch) || this.slidingWindow.isAtEndOfSource()) { - diagnostics.push(new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), TypeScript.MathPrototype.min(this.slidingWindow.absoluteIndex(), this.text.length()), 1, TypeScript.DiagnosticCode.Missing_close_quote_character, null)); - break; - } else { - this.slidingWindow.moveToNextItem(); - } - } - - return 14 /* StringLiteral */; - }; - - Scanner.prototype.isUnicodeEscape = function (character) { - if (character === 92 /* backslash */) { - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 117 /* u */) { - return true; - } - } - - return false; - }; - - Scanner.prototype.peekCharOrUnicodeEscape = function () { - var character = this.currentCharCode(); - if (this.isUnicodeEscape(character)) { - return this.peekUnicodeOrHexEscape(); - } else { - return character; - } - }; - - Scanner.prototype.peekUnicodeOrHexEscape = function () { - var startIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - var ch = this.scanUnicodeOrHexEscape(null); - - this.slidingWindow.rewindToPinnedIndex(startIndex); - this.slidingWindow.releaseAndUnpinAbsoluteIndex(startIndex); - - return ch; - }; - - Scanner.prototype.scanCharOrUnicodeEscape = function (errors) { - var ch = this.currentCharCode(); - if (ch === 92 /* backslash */) { - var ch2 = this.slidingWindow.peekItemN(1); - if (ch2 === 117 /* u */) { - this.scanUnicodeOrHexEscape(errors); - return true; - } - } - - this.slidingWindow.moveToNextItem(); - return false; - }; - - Scanner.prototype.scanUnicodeOrHexEscape = function (errors) { - var start = this.slidingWindow.absoluteIndex(); - var character = this.currentCharCode(); - - this.slidingWindow.moveToNextItem(); - - character = this.currentCharCode(); - - var intChar = 0; - this.slidingWindow.moveToNextItem(); - - var count = character === 117 /* u */ ? 4 : 2; - - for (var i = 0; i < count; i++) { - var ch2 = this.currentCharCode(); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - if (errors !== null) { - var end = this.slidingWindow.absoluteIndex(); - var info = this.createIllegalEscapeDiagnostic(start, end); - errors.push(info); - } - - break; - } - - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - this.slidingWindow.moveToNextItem(); - } - - return intChar; - }; - - Scanner.prototype.substring = function (start, end, intern) { - var length = end - start; - var offset = start - this.slidingWindow.windowAbsoluteStartIndex; - - if (intern) { - return TypeScript.Collections.DefaultStringTable.addCharArray(this.slidingWindow.window, offset, length); - } else { - return TypeScript.StringUtilities.fromCharCodeArray(this.slidingWindow.window.slice(offset, offset + length)); - } - }; - - Scanner.prototype.createIllegalEscapeDiagnostic = function (start, end) { - return new TypeScript.Diagnostic(this.fileName, this.text.lineMap(), start, end - start, TypeScript.DiagnosticCode.Unrecognized_escape_sequence, null); - }; - - Scanner.isValidIdentifier = function (text, languageVersion) { - var scanner = new Scanner(null, text, languageVersion, Scanner.triviaWindow); - var errors = new Array(); - var token = scanner.scan(errors, false); - - return errors.length === 0 && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token) && token.width() === text.length(); - }; - Scanner.triviaWindow = TypeScript.ArrayUtilities.createArray(2048, 0); - return Scanner; - })(); - TypeScript.Scanner = Scanner; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ScannerUtilities = (function () { - function ScannerUtilities() { - } - ScannerUtilities.identifierKind = function (array, startIndex, length) { - switch (length) { - case 2: - switch (array[startIndex]) { - case 100 /* d */: - return (array[startIndex + 1] === 111 /* o */) ? 22 /* DoKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - switch (array[startIndex + 1]) { - case 102 /* f */: - return 28 /* IfKeyword */; - case 110 /* n */: - return 29 /* InKeyword */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 3: - switch (array[startIndex]) { - case 102 /* f */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 114 /* r */) ? 26 /* ForKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 119 /* w */) ? 31 /* NewKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 121 /* y */) ? 38 /* TryKeyword */ : 11 /* IdentifierName */; - case 118 /* v */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 114 /* r */) ? 40 /* VarKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 53 /* LetKeyword */ : 11 /* IdentifierName */; - case 97 /* a */: - return (array[startIndex + 1] === 110 /* n */ && array[startIndex + 2] === 121 /* y */) ? 60 /* AnyKeyword */ : 11 /* IdentifierName */; - case 103 /* g */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 64 /* GetKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */) ? 68 /* SetKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 4: - switch (array[startIndex]) { - case 99 /* c */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 101 /* e */) ? 16 /* CaseKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - switch (array[startIndex + 1]) { - case 108 /* l */: - return (array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 101 /* e */) ? 23 /* ElseKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 2] === 117 /* u */ && array[startIndex + 3] === 109 /* m */) ? 46 /* EnumKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 110 /* n */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 108 /* l */) ? 32 /* NullKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (array[startIndex + 1]) { - case 104 /* h */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 115 /* s */) ? 35 /* ThisKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 2] === 117 /* u */ && array[startIndex + 3] === 101 /* e */) ? 37 /* TrueKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 118 /* v */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 100 /* d */) ? 41 /* VoidKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 104 /* h */) ? 43 /* WithKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 5: - switch (array[startIndex]) { - case 98 /* b */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 101 /* e */ && array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 107 /* k */) ? 15 /* BreakKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - switch (array[startIndex + 1]) { - case 97 /* a */: - return (array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 99 /* c */ && array[startIndex + 4] === 104 /* h */) ? 17 /* CatchKeyword */ : 11 /* IdentifierName */; - case 108 /* l */: - return (array[startIndex + 2] === 97 /* a */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 115 /* s */) ? 44 /* ClassKeyword */ : 11 /* IdentifierName */; - case 111 /* o */: - return (array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 116 /* t */) ? 45 /* ConstKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 102 /* f */: - return (array[startIndex + 1] === 97 /* a */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 101 /* e */) ? 24 /* FalseKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - return (array[startIndex + 1] === 104 /* h */ && array[startIndex + 2] === 114 /* r */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 119 /* w */) ? 36 /* ThrowKeyword */ : 11 /* IdentifierName */; - case 119 /* w */: - return (array[startIndex + 1] === 104 /* h */ && array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */) ? 42 /* WhileKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 114 /* r */) ? 50 /* SuperKeyword */ : 11 /* IdentifierName */; - case 121 /* y */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 101 /* e */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 100 /* d */) ? 59 /* YieldKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 6: - switch (array[startIndex]) { - case 100 /* d */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 108 /* l */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 101 /* e */) ? 21 /* DeleteKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 110 /* n */) ? 33 /* ReturnKeyword */ : 11 /* IdentifierName */; - case 115 /* s */: - switch (array[startIndex + 1]) { - case 119 /* w */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 99 /* c */ && array[startIndex + 5] === 104 /* h */) ? 34 /* SwitchKeyword */ : 11 /* IdentifierName */; - case 116 /* t */: - switch (array[startIndex + 2]) { - case 97 /* a */: - return (array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 99 /* c */) ? 58 /* StaticKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 3] === 105 /* i */ && array[startIndex + 4] === 110 /* n */ && array[startIndex + 5] === 103 /* g */) ? 69 /* StringKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 116 /* t */: - return (array[startIndex + 1] === 121 /* y */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 111 /* o */ && array[startIndex + 5] === 102 /* f */) ? 39 /* TypeOfKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (array[startIndex + 1] === 120 /* x */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 116 /* t */) ? 47 /* ExportKeyword */ : 11 /* IdentifierName */; - case 105 /* i */: - return (array[startIndex + 1] === 109 /* m */ && array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 111 /* o */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 116 /* t */) ? 49 /* ImportKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 98 /* b */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 99 /* c */) ? 57 /* PublicKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 100 /* d */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 108 /* l */ && array[startIndex + 5] === 101 /* e */) ? 65 /* ModuleKeyword */ : 11 /* IdentifierName */; - case 110 /* n */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 109 /* m */ && array[startIndex + 3] === 98 /* b */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 114 /* r */) ? 67 /* NumberKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 7: - switch (array[startIndex]) { - case 100 /* d */: - switch (array[startIndex + 1]) { - case 101 /* e */: - switch (array[startIndex + 2]) { - case 102 /* f */: - return (array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 117 /* u */ && array[startIndex + 5] === 108 /* l */ && array[startIndex + 6] === 116 /* t */) ? 20 /* DefaultKeyword */ : 11 /* IdentifierName */; - case 99 /* c */: - return (array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 101 /* e */) ? 63 /* DeclareKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 102 /* f */: - return (array[startIndex + 1] === 105 /* i */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 97 /* a */ && array[startIndex + 4] === 108 /* l */ && array[startIndex + 5] === 108 /* l */ && array[startIndex + 6] === 121 /* y */) ? 25 /* FinallyKeyword */ : 11 /* IdentifierName */; - case 101 /* e */: - return (array[startIndex + 1] === 120 /* x */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 110 /* n */ && array[startIndex + 5] === 100 /* d */ && array[startIndex + 6] === 115 /* s */) ? 48 /* ExtendsKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - switch (array[startIndex + 1]) { - case 97 /* a */: - return (array[startIndex + 2] === 99 /* c */ && array[startIndex + 3] === 107 /* k */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 103 /* g */ && array[startIndex + 6] === 101 /* e */) ? 54 /* PackageKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 2] === 105 /* i */ && array[startIndex + 3] === 118 /* v */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 116 /* t */ && array[startIndex + 6] === 101 /* e */) ? 55 /* PrivateKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 98 /* b */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 111 /* o */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 97 /* a */ && array[startIndex + 6] === 110 /* n */) ? 61 /* BooleanKeyword */ : 11 /* IdentifierName */; - case 114 /* r */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 113 /* q */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 101 /* e */) ? 66 /* RequireKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 8: - switch (array[startIndex]) { - case 99 /* c */: - return (array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 105 /* i */ && array[startIndex + 5] === 110 /* n */ && array[startIndex + 6] === 117 /* u */ && array[startIndex + 7] === 101 /* e */) ? 18 /* ContinueKeyword */ : 11 /* IdentifierName */; - case 100 /* d */: - return (array[startIndex + 1] === 101 /* e */ && array[startIndex + 2] === 98 /* b */ && array[startIndex + 3] === 117 /* u */ && array[startIndex + 4] === 103 /* g */ && array[startIndex + 5] === 103 /* g */ && array[startIndex + 6] === 101 /* e */ && array[startIndex + 7] === 114 /* r */) ? 19 /* DebuggerKeyword */ : 11 /* IdentifierName */; - case 102 /* f */: - return (array[startIndex + 1] === 117 /* u */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 99 /* c */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 105 /* i */ && array[startIndex + 6] === 111 /* o */ && array[startIndex + 7] === 110 /* n */) ? 27 /* FunctionKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 9: - switch (array[startIndex]) { - case 105 /* i */: - return (array[startIndex + 1] === 110 /* n */ && array[startIndex + 2] === 116 /* t */ && array[startIndex + 3] === 101 /* e */ && array[startIndex + 4] === 114 /* r */ && array[startIndex + 5] === 102 /* f */ && array[startIndex + 6] === 97 /* a */ && array[startIndex + 7] === 99 /* c */ && array[startIndex + 8] === 101 /* e */) ? 52 /* InterfaceKeyword */ : 11 /* IdentifierName */; - case 112 /* p */: - return (array[startIndex + 1] === 114 /* r */ && array[startIndex + 2] === 111 /* o */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 99 /* c */ && array[startIndex + 6] === 116 /* t */ && array[startIndex + 7] === 101 /* e */ && array[startIndex + 8] === 100 /* d */) ? 56 /* ProtectedKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - case 10: - switch (array[startIndex]) { - case 105 /* i */: - switch (array[startIndex + 1]) { - case 110 /* n */: - return (array[startIndex + 2] === 115 /* s */ && array[startIndex + 3] === 116 /* t */ && array[startIndex + 4] === 97 /* a */ && array[startIndex + 5] === 110 /* n */ && array[startIndex + 6] === 99 /* c */ && array[startIndex + 7] === 101 /* e */ && array[startIndex + 8] === 111 /* o */ && array[startIndex + 9] === 102 /* f */) ? 30 /* InstanceOfKeyword */ : 11 /* IdentifierName */; - case 109 /* m */: - return (array[startIndex + 2] === 112 /* p */ && array[startIndex + 3] === 108 /* l */ && array[startIndex + 4] === 101 /* e */ && array[startIndex + 5] === 109 /* m */ && array[startIndex + 6] === 101 /* e */ && array[startIndex + 7] === 110 /* n */ && array[startIndex + 8] === 116 /* t */ && array[startIndex + 9] === 115 /* s */) ? 51 /* ImplementsKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - - default: - return 11 /* IdentifierName */; - } - - case 11: - return (array[startIndex] === 99 /* c */ && array[startIndex + 1] === 111 /* o */ && array[startIndex + 2] === 110 /* n */ && array[startIndex + 3] === 115 /* s */ && array[startIndex + 4] === 116 /* t */ && array[startIndex + 5] === 114 /* r */ && array[startIndex + 6] === 117 /* u */ && array[startIndex + 7] === 99 /* c */ && array[startIndex + 8] === 116 /* t */ && array[startIndex + 9] === 111 /* o */ && array[startIndex + 10] === 114 /* r */) ? 62 /* ConstructorKeyword */ : 11 /* IdentifierName */; - default: - return 11 /* IdentifierName */; - } - }; - return ScannerUtilities; - })(); - TypeScript.ScannerUtilities = ScannerUtilities; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var EmptySeparatedSyntaxList = (function () { - function EmptySeparatedSyntaxList() { - } - EmptySeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - EmptySeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isList = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - - EmptySeparatedSyntaxList.prototype.toJSON = function (key) { - return []; - }; - - EmptySeparatedSyntaxList.prototype.childCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.separatorCount = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.toArray = function () { - return []; - }; - - EmptySeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - return []; - }; - - EmptySeparatedSyntaxList.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.separatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySeparatedSyntaxList.prototype.collectTextElements = function (elements) { - }; - - EmptySeparatedSyntaxList.prototype.firstToken = function () { - return null; - }; - - EmptySeparatedSyntaxList.prototype.lastToken = function () { - return null; - }; - - EmptySeparatedSyntaxList.prototype.fullWidth = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.fullText = function () { - return ""; - }; - - EmptySeparatedSyntaxList.prototype.width = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return false; - }; - - EmptySeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - throw TypeScript.Errors.invalidOperation(); - }; - - EmptySeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - }; - - EmptySeparatedSyntaxList.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySeparatedSyntaxList.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return 0; - }; - - EmptySeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return 0; - }; - return EmptySeparatedSyntaxList; - })(); - - Syntax.emptySeparatedList = new EmptySeparatedSyntaxList(); - - var SingletonSeparatedSyntaxList = (function () { - function SingletonSeparatedSyntaxList(item) { - this.item = item; - } - SingletonSeparatedSyntaxList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - SingletonSeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isList = function () { - return false; - }; - SingletonSeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - - SingletonSeparatedSyntaxList.prototype.childCount = function () { - return 1; - }; - SingletonSeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return 1; - }; - SingletonSeparatedSyntaxList.prototype.separatorCount = function () { - return 0; - }; - - SingletonSeparatedSyntaxList.prototype.toArray = function () { - return [this.item]; - }; - SingletonSeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - return [this.item]; - }; - - SingletonSeparatedSyntaxList.prototype.childAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSeparatedSyntaxList.prototype.separatorAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - SingletonSeparatedSyntaxList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSeparatedSyntaxList.prototype.firstToken = function () { - return this.item.firstToken(); - }; - - SingletonSeparatedSyntaxList.prototype.lastToken = function () { - return this.item.lastToken(); - }; - - SingletonSeparatedSyntaxList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.width = function () { - return this.item.width(); - }; - - SingletonSeparatedSyntaxList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSeparatedSyntaxList.prototype.leadingTrivia = function () { - return this.item.leadingTrivia(); - }; - - SingletonSeparatedSyntaxList.prototype.trailingTrivia = function () { - return this.item.trailingTrivia(); - }; - - SingletonSeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return this.item.leadingTriviaWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return this.item.trailingTriviaWidth(); - }; - - SingletonSeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - return this.item.isTypeScriptSpecific(); - }; - - SingletonSeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return this.item.isIncrementallyUnusable(); - }; - - SingletonSeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - return this.item.findTokenInternal(new TypeScript.PositionedSeparatedList(parent, this, fullStart), position, fullStart); - }; - - SingletonSeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - array.splice(index, 0, this.item); - }; - return SingletonSeparatedSyntaxList; - })(); - - var NormalSeparatedSyntaxList = (function () { - function NormalSeparatedSyntaxList(elements) { - this._data = 0; - this.elements = elements; - } - NormalSeparatedSyntaxList.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - NormalSeparatedSyntaxList.prototype.isToken = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isNode = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isList = function () { - return false; - }; - NormalSeparatedSyntaxList.prototype.isSeparatedList = function () { - return true; - }; - NormalSeparatedSyntaxList.prototype.toJSON = function (key) { - return this.elements; - }; - - NormalSeparatedSyntaxList.prototype.childCount = function () { - return this.elements.length; - }; - NormalSeparatedSyntaxList.prototype.nonSeparatorCount = function () { - return TypeScript.IntegerUtilities.integerDivide(this.elements.length + 1, 2); - }; - NormalSeparatedSyntaxList.prototype.separatorCount = function () { - return TypeScript.IntegerUtilities.integerDivide(this.elements.length, 2); - }; - - NormalSeparatedSyntaxList.prototype.toArray = function () { - return this.elements.slice(0); - }; - - NormalSeparatedSyntaxList.prototype.toNonSeparatorArray = function () { - var result = []; - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - result.push(this.nonSeparatorAt(i)); - } - - return result; - }; - - NormalSeparatedSyntaxList.prototype.childAt = function (index) { - if (index < 0 || index >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[index]; - }; - - NormalSeparatedSyntaxList.prototype.nonSeparatorAt = function (index) { - var value = index * 2; - if (value < 0 || value >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[value]; - }; - - NormalSeparatedSyntaxList.prototype.separatorAt = function (index) { - var value = index * 2 + 1; - if (value < 0 || value >= this.elements.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.elements[value]; - }; - - NormalSeparatedSyntaxList.prototype.firstToken = function () { - var token; - for (var i = 0, n = this.elements.length; i < n; i++) { - if (i % 2 === 0) { - var nodeOrToken = this.elements[i]; - token = nodeOrToken.firstToken(); - if (token !== null) { - return token; - } - } else { - token = this.elements[i]; - if (token.width() > 0) { - return token; - } - } - } - - return null; - }; - - NormalSeparatedSyntaxList.prototype.lastToken = function () { - var token; - for (var i = this.elements.length - 1; i >= 0; i--) { - if (i % 2 === 0) { - var nodeOrToken = this.elements[i]; - token = nodeOrToken.lastToken(); - if (token !== null) { - return token; - } - } else { - token = this.elements[i]; - if (token.width() > 0) { - return token; - } - } - } - - return null; - }; - - NormalSeparatedSyntaxList.prototype.fullText = function () { - var elements = []; - this.collectTextElements(elements); - return elements.join(""); - }; - - NormalSeparatedSyntaxList.prototype.isTypeScriptSpecific = function () { - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - if (this.nonSeparatorAt(i).isTypeScriptSpecific()) { - return true; - } - } - - return false; - }; - - NormalSeparatedSyntaxList.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - NormalSeparatedSyntaxList.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - NormalSeparatedSyntaxList.prototype.width = function () { - var fullWidth = this.fullWidth(); - return fullWidth - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.leadingTrivia = function () { - return this.firstToken().leadingTrivia(); - }; - - NormalSeparatedSyntaxList.prototype.trailingTrivia = function () { - return this.lastToken().trailingTrivia(); - }; - - NormalSeparatedSyntaxList.prototype.leadingTriviaWidth = function () { - return this.firstToken().leadingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.trailingTriviaWidth = function () { - return this.lastToken().trailingTriviaWidth(); - }; - - NormalSeparatedSyntaxList.prototype.computeData = function () { - var fullWidth = 0; - var isIncrementallyUnusable = false; - - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - - var childWidth = element.fullWidth(); - fullWidth += childWidth; - - isIncrementallyUnusable = isIncrementallyUnusable || element.isIncrementallyUnusable(); - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - NormalSeparatedSyntaxList.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data = this.computeData(); - } - - return this._data; - }; - - NormalSeparatedSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedSeparatedList(parent, this, fullStart); - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - - var childWidth = element.fullWidth(); - if (position < childWidth) { - return element.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - NormalSeparatedSyntaxList.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.elements.length; i < n; i++) { - var element = this.elements[i]; - element.collectTextElements(elements); - } - }; - - NormalSeparatedSyntaxList.prototype.insertChildrenInto = function (array, index) { - if (index === 0) { - array.unshift.apply(array, this.elements); - } else { - array.splice.apply(array, [index, 0].concat(this.elements)); - } - }; - return NormalSeparatedSyntaxList; - })(); - - function separatedList(nodes) { - return separatedListAndValidate(nodes, false); - } - Syntax.separatedList = separatedList; - - function separatedListAndValidate(nodes, validate) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return Syntax.emptySeparatedList; - } - - if (validate) { - for (var i = 0; i < nodes.length; i++) { - var item = nodes[i]; - - if (i % 2 === 1) { - } - } - } - - if (nodes.length === 1) { - return new SingletonSeparatedSyntaxList(nodes[0]); - } - - return new NormalSeparatedSyntaxList(nodes); - } - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SlidingWindow = (function () { - function SlidingWindow(source, window, defaultValue, sourceLength) { - if (typeof sourceLength === "undefined") { sourceLength = -1; } - this.source = source; - this.window = window; - this.defaultValue = defaultValue; - this.sourceLength = sourceLength; - this.windowCount = 0; - this.windowAbsoluteStartIndex = 0; - this.currentRelativeItemIndex = 0; - this._pinCount = 0; - this.firstPinnedAbsoluteIndex = -1; - } - SlidingWindow.prototype.windowAbsoluteEndIndex = function () { - return this.windowAbsoluteStartIndex + this.windowCount; - }; - - SlidingWindow.prototype.addMoreItemsToWindow = function (argument) { - if (this.sourceLength >= 0 && this.absoluteIndex() >= this.sourceLength) { - return false; - } - - if (this.windowCount >= this.window.length) { - this.tryShiftOrGrowWindow(); - } - - var spaceAvailable = this.window.length - this.windowCount; - var amountFetched = this.source.fetchMoreItems(argument, this.windowAbsoluteEndIndex(), this.window, this.windowCount, spaceAvailable); - - this.windowCount += amountFetched; - return amountFetched > 0; - }; - - SlidingWindow.prototype.tryShiftOrGrowWindow = function () { - var currentIndexIsPastWindowHalfwayPoint = this.currentRelativeItemIndex > (this.window.length >>> 1); - - var isAllowedToShift = this.firstPinnedAbsoluteIndex === -1 || this.firstPinnedAbsoluteIndex > this.windowAbsoluteStartIndex; - - if (currentIndexIsPastWindowHalfwayPoint && isAllowedToShift) { - var shiftStartIndex = this.firstPinnedAbsoluteIndex === -1 ? this.currentRelativeItemIndex : this.firstPinnedAbsoluteIndex - this.windowAbsoluteStartIndex; - - var shiftCount = this.windowCount - shiftStartIndex; - - if (shiftCount > 0) { - TypeScript.ArrayUtilities.copy(this.window, shiftStartIndex, this.window, 0, shiftCount); - } - - this.windowAbsoluteStartIndex += shiftStartIndex; - - this.windowCount -= shiftStartIndex; - - this.currentRelativeItemIndex -= shiftStartIndex; - } else { - TypeScript.ArrayUtilities.grow(this.window, this.window.length * 2, this.defaultValue); - } - }; - - SlidingWindow.prototype.absoluteIndex = function () { - return this.windowAbsoluteStartIndex + this.currentRelativeItemIndex; - }; - - SlidingWindow.prototype.isAtEndOfSource = function () { - return this.absoluteIndex() >= this.sourceLength; - }; - - SlidingWindow.prototype.getAndPinAbsoluteIndex = function () { - var absoluteIndex = this.absoluteIndex(); - var pinCount = this._pinCount++; - if (pinCount === 0) { - this.firstPinnedAbsoluteIndex = absoluteIndex; - } - - return absoluteIndex; - }; - - SlidingWindow.prototype.releaseAndUnpinAbsoluteIndex = function (absoluteIndex) { - this._pinCount--; - if (this._pinCount === 0) { - this.firstPinnedAbsoluteIndex = -1; - } - }; - - SlidingWindow.prototype.rewindToPinnedIndex = function (absoluteIndex) { - var relativeIndex = absoluteIndex - this.windowAbsoluteStartIndex; - - this.currentRelativeItemIndex = relativeIndex; - }; - - SlidingWindow.prototype.currentItem = function (argument) { - if (this.currentRelativeItemIndex >= this.windowCount) { - if (!this.addMoreItemsToWindow(argument)) { - return this.defaultValue; - } - } - - return this.window[this.currentRelativeItemIndex]; - }; - - SlidingWindow.prototype.peekItemN = function (n) { - while (this.currentRelativeItemIndex + n >= this.windowCount) { - if (!this.addMoreItemsToWindow(null)) { - return this.defaultValue; - } - } - - return this.window[this.currentRelativeItemIndex + n]; - }; - - SlidingWindow.prototype.moveToNextItem = function () { - this.currentRelativeItemIndex++; - }; - - SlidingWindow.prototype.disgardAllItemsFromCurrentIndexOnwards = function () { - this.windowCount = this.currentRelativeItemIndex; - }; - - SlidingWindow.prototype.setAbsoluteIndex = function (absoluteIndex) { - if (this.absoluteIndex() === absoluteIndex) { - return; - } - - if (this._pinCount > 0) { - } - - if (absoluteIndex >= this.windowAbsoluteStartIndex && absoluteIndex < this.windowAbsoluteEndIndex()) { - this.currentRelativeItemIndex = (absoluteIndex - this.windowAbsoluteStartIndex); - } else { - this.windowAbsoluteStartIndex = absoluteIndex; - - this.windowCount = 0; - - this.currentRelativeItemIndex = 0; - } - }; - - SlidingWindow.prototype.pinCount = function () { - return this._pinCount; - }; - return SlidingWindow; - })(); - TypeScript.SlidingWindow = SlidingWindow; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - function emptySourceUnit() { - return TypeScript.Syntax.normalModeFactory.sourceUnit(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(10 /* EndOfFileToken */, { text: "" })); - } - Syntax.emptySourceUnit = emptySourceUnit; - - function getStandaloneExpression(positionedToken) { - var token = positionedToken.token(); - if (positionedToken !== null && positionedToken.kind() === 11 /* IdentifierName */) { - var parentPositionedNode = positionedToken.containingNode(); - var parentNode = parentPositionedNode.node(); - - if (parentNode.kind() === 121 /* QualifiedName */ && parentNode.right === token) { - return parentPositionedNode; - } else if (parentNode.kind() === 212 /* MemberAccessExpression */ && parentNode.name === token) { - return parentPositionedNode; - } - } - - return positionedToken; - } - Syntax.getStandaloneExpression = getStandaloneExpression; - - function isInModuleOrTypeContext(positionedToken) { - if (positionedToken !== null) { - var positionedNodeOrToken = TypeScript.Syntax.getStandaloneExpression(positionedToken); - var parent = positionedNodeOrToken.containingNode(); - - if (parent !== null) { - switch (parent.kind()) { - case 246 /* ModuleNameModuleReference */: - return true; - case 121 /* QualifiedName */: - return true; - default: - return isInTypeOnlyContext(positionedToken); - } - } - } - - return false; - } - Syntax.isInModuleOrTypeContext = isInModuleOrTypeContext; - - function isInTypeOnlyContext(positionedToken) { - var positionedNodeOrToken = TypeScript.Syntax.getStandaloneExpression(positionedToken); - var positionedParent = positionedNodeOrToken.containingNode(); - - var parent = positionedParent.node(); - var nodeOrToken = positionedNodeOrToken.nodeOrToken(); - - if (parent !== null) { - switch (parent.kind()) { - case 124 /* ArrayType */: - return parent.type === nodeOrToken; - case 220 /* CastExpression */: - return parent.type === nodeOrToken; - case 244 /* TypeAnnotation */: - case 230 /* ExtendsHeritageClause */: - case 231 /* ImplementsHeritageClause */: - case 228 /* TypeArgumentList */: - return true; - } - } - - return false; - } - Syntax.isInTypeOnlyContext = isInTypeOnlyContext; - - function childOffset(parent, child) { - var offset = 0; - for (var i = 0, n = parent.childCount(); i < n; i++) { - var current = parent.childAt(i); - if (current === child) { - return offset; - } - - if (current !== null) { - offset += current.fullWidth(); - } - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childOffset = childOffset; - - function childOffsetAt(parent, index) { - var offset = 0; - for (var i = 0; i < index; i++) { - var current = parent.childAt(i); - if (current !== null) { - offset += current.fullWidth(); - } - } - - return offset; - } - Syntax.childOffsetAt = childOffsetAt; - - function childIndex(parent, child) { - for (var i = 0, n = parent.childCount(); i < n; i++) { - var current = parent.childAt(i); - if (current === child) { - return i; - } - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.childIndex = childIndex; - - function nodeStructuralEquals(node1, node2) { - if (node1 === null) { - return node2 === null; - } - - return node1.structuralEquals(node2); - } - Syntax.nodeStructuralEquals = nodeStructuralEquals; - - function nodeOrTokenStructuralEquals(node1, node2) { - if (node1 === node2) { - return true; - } - - if (node1 === null || node2 === null) { - return false; - } - - if (node1.isToken()) { - return node2.isToken() ? tokenStructuralEquals(node1, node2) : false; - } - - return node2.isNode() ? nodeStructuralEquals(node1, node2) : false; - } - Syntax.nodeOrTokenStructuralEquals = nodeOrTokenStructuralEquals; - - function tokenStructuralEquals(token1, token2) { - if (token1 === token2) { - return true; - } - - if (token1 === null || token2 === null) { - return false; - } - - return token1.kind() === token2.kind() && token1.width() === token2.width() && token1.fullWidth() === token2.fullWidth() && token1.text() === token2.text() && TypeScript.Syntax.triviaListStructuralEquals(token1.leadingTrivia(), token2.leadingTrivia()) && TypeScript.Syntax.triviaListStructuralEquals(token1.trailingTrivia(), token2.trailingTrivia()); - } - Syntax.tokenStructuralEquals = tokenStructuralEquals; - - function triviaListStructuralEquals(triviaList1, triviaList2) { - if (triviaList1.count() !== triviaList2.count()) { - return false; - } - - for (var i = 0, n = triviaList1.count(); i < n; i++) { - if (!TypeScript.Syntax.triviaStructuralEquals(triviaList1.syntaxTriviaAt(i), triviaList2.syntaxTriviaAt(i))) { - return false; - } - } - - return true; - } - Syntax.triviaListStructuralEquals = triviaListStructuralEquals; - - function triviaStructuralEquals(trivia1, trivia2) { - return trivia1.kind() === trivia2.kind() && trivia1.fullWidth() === trivia2.fullWidth() && trivia1.fullText() === trivia2.fullText(); - } - Syntax.triviaStructuralEquals = triviaStructuralEquals; - - function listStructuralEquals(list1, list2) { - if (list1.childCount() !== list2.childCount()) { - return false; - } - - for (var i = 0, n = list1.childCount(); i < n; i++) { - var child1 = list1.childAt(i); - var child2 = list2.childAt(i); - - if (!TypeScript.Syntax.nodeOrTokenStructuralEquals(child1, child2)) { - return false; - } - } - - return true; - } - Syntax.listStructuralEquals = listStructuralEquals; - - function separatedListStructuralEquals(list1, list2) { - if (list1.childCount() !== list2.childCount()) { - return false; - } - - for (var i = 0, n = list1.childCount(); i < n; i++) { - var element1 = list1.childAt(i); - var element2 = list2.childAt(i); - if (!TypeScript.Syntax.nodeOrTokenStructuralEquals(element1, element2)) { - return false; - } - } - - return true; - } - Syntax.separatedListStructuralEquals = separatedListStructuralEquals; - - function elementStructuralEquals(element1, element2) { - if (element1 === element2) { - return true; - } - - if (element1 === null || element2 === null) { - return false; - } - - if (element2.kind() !== element2.kind()) { - return false; - } - - if (element1.isToken()) { - return tokenStructuralEquals(element1, element2); - } else if (element1.isNode()) { - return nodeStructuralEquals(element1, element2); - } else if (element1.isList()) { - return listStructuralEquals(element1, element2); - } else if (element1.isSeparatedList()) { - return separatedListStructuralEquals(element1, element2); - } - - throw TypeScript.Errors.invalidOperation(); - } - Syntax.elementStructuralEquals = elementStructuralEquals; - - function identifierName(text, info) { - if (typeof info === "undefined") { info = null; } - return TypeScript.Syntax.identifier(text); - } - Syntax.identifierName = identifierName; - - function trueExpression() { - return TypeScript.Syntax.token(37 /* TrueKeyword */); - } - Syntax.trueExpression = trueExpression; - - function falseExpression() { - return TypeScript.Syntax.token(24 /* FalseKeyword */); - } - Syntax.falseExpression = falseExpression; - - function numericLiteralExpression(text) { - return TypeScript.Syntax.token(13 /* NumericLiteral */, { text: text }); - } - Syntax.numericLiteralExpression = numericLiteralExpression; - - function stringLiteralExpression(text) { - return TypeScript.Syntax.token(14 /* StringLiteral */, { text: text }); - } - Syntax.stringLiteralExpression = stringLiteralExpression; - - function isSuperInvocationExpression(node) { - return node.kind() === 213 /* InvocationExpression */ && node.expression.kind() === 50 /* SuperKeyword */; - } - Syntax.isSuperInvocationExpression = isSuperInvocationExpression; - - function isSuperInvocationExpressionStatement(node) { - return node.kind() === 149 /* ExpressionStatement */ && isSuperInvocationExpression(node.expression); - } - Syntax.isSuperInvocationExpressionStatement = isSuperInvocationExpressionStatement; - - function isSuperMemberAccessExpression(node) { - return node.kind() === 212 /* MemberAccessExpression */ && node.expression.kind() === 50 /* SuperKeyword */; - } - Syntax.isSuperMemberAccessExpression = isSuperMemberAccessExpression; - - function isSuperMemberAccessInvocationExpression(node) { - return node.kind() === 213 /* InvocationExpression */ && isSuperMemberAccessExpression(node.expression); - } - Syntax.isSuperMemberAccessInvocationExpression = isSuperMemberAccessInvocationExpression; - - function assignmentExpression(left, token, right) { - return TypeScript.Syntax.normalModeFactory.binaryExpression(174 /* AssignmentExpression */, left, token, right); - } - Syntax.assignmentExpression = assignmentExpression; - - function nodeHasSkippedOrMissingTokens(node) { - for (var i = 0; i < node.childCount(); i++) { - var child = node.childAt(i); - if (child !== null && child.isToken()) { - var token = child; - - if (token.hasSkippedToken() || (token.width() === 0 && token.kind() !== 10 /* EndOfFileToken */)) { - return true; - } - } - } - return false; - } - Syntax.nodeHasSkippedOrMissingTokens = nodeHasSkippedOrMissingTokens; - - function isUnterminatedStringLiteral(token) { - if (token && token.kind() === 14 /* StringLiteral */) { - var text = token.text(); - return text.length < 2 || text.charCodeAt(text.length - 1) !== text.charCodeAt(0); - } - - return false; - } - Syntax.isUnterminatedStringLiteral = isUnterminatedStringLiteral; - - function isUnterminatedMultilineCommentTrivia(trivia) { - if (trivia && trivia.kind() === 6 /* MultiLineCommentTrivia */) { - var text = trivia.fullText(); - return text.length < 4 || text.substring(text.length - 2) !== "*/"; - } - return false; - } - Syntax.isUnterminatedMultilineCommentTrivia = isUnterminatedMultilineCommentTrivia; - - function isEntirelyInsideCommentTrivia(trivia, fullStart, position) { - if (trivia && trivia.isComment() && position > fullStart) { - var end = fullStart + trivia.fullWidth(); - if (position < end) { - return true; - } else if (position === end) { - return trivia.kind() === 7 /* SingleLineCommentTrivia */ || isUnterminatedMultilineCommentTrivia(trivia); - } - } - - return false; - } - Syntax.isEntirelyInsideCommentTrivia = isEntirelyInsideCommentTrivia; - - function isEntirelyInsideComment(sourceUnit, position) { - var positionedToken = sourceUnit.findToken(position); - var fullStart = positionedToken.fullStart(); - var triviaList = null; - var lastTriviaBeforeToken = null; - - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - if (positionedToken.token().hasLeadingTrivia()) { - triviaList = positionedToken.token().leadingTrivia(); - } else { - positionedToken = positionedToken.previousToken(); - if (positionedToken) { - if (positionedToken && positionedToken.token().hasTrailingTrivia()) { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - } - } - } else { - if (position <= (fullStart + positionedToken.token().leadingTriviaWidth())) { - triviaList = positionedToken.token().leadingTrivia(); - } else if (position >= (fullStart + positionedToken.token().width())) { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - } - - if (triviaList) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - if (position <= fullStart) { - break; - } else if (position <= fullStart + trivia.fullWidth() && trivia.isComment()) { - lastTriviaBeforeToken = trivia; - break; - } - - fullStart += trivia.fullWidth(); - } - } - - return lastTriviaBeforeToken && isEntirelyInsideCommentTrivia(lastTriviaBeforeToken, fullStart, position); - } - Syntax.isEntirelyInsideComment = isEntirelyInsideComment; - - function isEntirelyInStringOrRegularExpressionLiteral(sourceUnit, position) { - var positionedToken = sourceUnit.findToken(position); - - if (positionedToken) { - if (positionedToken.kind() === 10 /* EndOfFileToken */) { - positionedToken = positionedToken.previousToken(); - return positionedToken && positionedToken.token().trailingTriviaWidth() === 0 && isUnterminatedStringLiteral(positionedToken.token()); - } else if (position > positionedToken.start()) { - return (position < positionedToken.end() && (positionedToken.kind() === 14 /* StringLiteral */ || positionedToken.kind() === 12 /* RegularExpressionLiteral */)) || (position <= positionedToken.end() && isUnterminatedStringLiteral(positionedToken.token())); - } - } - - return false; - } - Syntax.isEntirelyInStringOrRegularExpressionLiteral = isEntirelyInStringOrRegularExpressionLiteral; - - function findSkippedTokenInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullStart; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.token().leadingTrivia(); - fullStart = positionedToken.fullStart(); - } else { - triviaList = positionedToken.token().trailingTrivia(); - fullStart = positionedToken.end(); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullStart && position <= fullStart + triviaWidth) { - return new TypeScript.PositionedSkippedToken(positionedToken, trivia.skippedToken(), fullStart); - } - - fullStart += triviaWidth; - } - } - - return null; - } - - function findSkippedTokenOnLeftInTriviaList(positionedToken, position, lookInLeadingTriviaList) { - var triviaList = null; - var fullEnd; - - if (lookInLeadingTriviaList) { - triviaList = positionedToken.token().leadingTrivia(); - fullEnd = positionedToken.fullStart() + triviaList.fullWidth(); - } else { - triviaList = positionedToken.token().trailingTrivia(); - fullEnd = positionedToken.fullEnd(); - } - - if (triviaList && triviaList.hasSkippedToken()) { - for (var i = triviaList.count() - 1; i >= 0; i--) { - var trivia = triviaList.syntaxTriviaAt(i); - var triviaWidth = trivia.fullWidth(); - - if (trivia.isSkippedToken() && position >= fullEnd) { - return new TypeScript.PositionedSkippedToken(positionedToken, trivia.skippedToken(), fullEnd - triviaWidth); - } - - fullEnd -= triviaWidth; - } - } - - return null; - } - - function findSkippedTokenInLeadingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, true); - } - Syntax.findSkippedTokenInLeadingTriviaList = findSkippedTokenInLeadingTriviaList; - - function findSkippedTokenInTrailingTriviaList(positionedToken, position) { - return findSkippedTokenInTriviaList(positionedToken, position, false); - } - Syntax.findSkippedTokenInTrailingTriviaList = findSkippedTokenInTrailingTriviaList; - - function findSkippedTokenInPositionedToken(positionedToken, position) { - var positionInLeadingTriviaList = (position < positionedToken.start()); - return findSkippedTokenInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenInPositionedToken = findSkippedTokenInPositionedToken; - - function findSkippedTokenOnLeft(positionedToken, position) { - var positionInLeadingTriviaList = (position < positionedToken.start()); - return findSkippedTokenOnLeftInTriviaList(positionedToken, position, positionInLeadingTriviaList); - } - Syntax.findSkippedTokenOnLeft = findSkippedTokenOnLeft; - - function getAncestorOfKind(positionedToken, kind) { - while (positionedToken && positionedToken.parent()) { - if (positionedToken.parent().kind() === kind) { - return positionedToken.parent(); - } - - positionedToken = positionedToken.parent(); - } - - return null; - } - Syntax.getAncestorOfKind = getAncestorOfKind; - - function hasAncestorOfKind(positionedToken, kind) { - return TypeScript.Syntax.getAncestorOfKind(positionedToken, kind) !== null; - } - Syntax.hasAncestorOfKind = hasAncestorOfKind; - - function isIntegerLiteral(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return expression.isToken() && TypeScript.IntegerUtilities.isInteger(expression.text()); - - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - Syntax.isIntegerLiteral = isIntegerLiteral; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var NormalModeFactory = (function () { - function NormalModeFactory() { - } - NormalModeFactory.prototype.sourceUnit = function (moduleElements, endOfFileToken) { - return new TypeScript.SourceUnitSyntax(moduleElements, endOfFileToken, false); - }; - NormalModeFactory.prototype.externalModuleReference = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - return new TypeScript.ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, false); - }; - NormalModeFactory.prototype.moduleNameModuleReference = function (moduleName) { - return new TypeScript.ModuleNameModuleReferenceSyntax(moduleName, false); - }; - NormalModeFactory.prototype.importDeclaration = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new TypeScript.ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, false); - }; - NormalModeFactory.prototype.exportAssignment = function (exportKeyword, equalsToken, identifier, semicolonToken) { - return new TypeScript.ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.classDeclaration = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - return new TypeScript.ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.interfaceDeclaration = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - return new TypeScript.InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, false); - }; - NormalModeFactory.prototype.heritageClause = function (kind, extendsOrImplementsKeyword, typeNames) { - return new TypeScript.HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, false); - }; - NormalModeFactory.prototype.moduleDeclaration = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - return new TypeScript.ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.functionDeclaration = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - return new TypeScript.FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.variableStatement = function (modifiers, variableDeclaration, semicolonToken) { - return new TypeScript.VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, false); - }; - NormalModeFactory.prototype.variableDeclaration = function (varKeyword, variableDeclarators) { - return new TypeScript.VariableDeclarationSyntax(varKeyword, variableDeclarators, false); - }; - NormalModeFactory.prototype.variableDeclarator = function (propertyName, typeAnnotation, equalsValueClause) { - return new TypeScript.VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, false); - }; - NormalModeFactory.prototype.equalsValueClause = function (equalsToken, value) { - return new TypeScript.EqualsValueClauseSyntax(equalsToken, value, false); - }; - NormalModeFactory.prototype.prefixUnaryExpression = function (kind, operatorToken, operand) { - return new TypeScript.PrefixUnaryExpressionSyntax(kind, operatorToken, operand, false); - }; - NormalModeFactory.prototype.arrayLiteralExpression = function (openBracketToken, expressions, closeBracketToken) { - return new TypeScript.ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, false); - }; - NormalModeFactory.prototype.omittedExpression = function () { - return new TypeScript.OmittedExpressionSyntax(false); - }; - NormalModeFactory.prototype.parenthesizedExpression = function (openParenToken, expression, closeParenToken) { - return new TypeScript.ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, false); - }; - NormalModeFactory.prototype.simpleArrowFunctionExpression = function (identifier, equalsGreaterThanToken, block, expression) { - return new TypeScript.SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, false); - }; - NormalModeFactory.prototype.parenthesizedArrowFunctionExpression = function (callSignature, equalsGreaterThanToken, block, expression) { - return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, false); - }; - NormalModeFactory.prototype.qualifiedName = function (left, dotToken, right) { - return new TypeScript.QualifiedNameSyntax(left, dotToken, right, false); - }; - NormalModeFactory.prototype.typeArgumentList = function (lessThanToken, typeArguments, greaterThanToken) { - return new TypeScript.TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, false); - }; - NormalModeFactory.prototype.constructorType = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, false); - }; - NormalModeFactory.prototype.functionType = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, false); - }; - NormalModeFactory.prototype.objectType = function (openBraceToken, typeMembers, closeBraceToken) { - return new TypeScript.ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, false); - }; - NormalModeFactory.prototype.arrayType = function (type, openBracketToken, closeBracketToken) { - return new TypeScript.ArrayTypeSyntax(type, openBracketToken, closeBracketToken, false); - }; - NormalModeFactory.prototype.genericType = function (name, typeArgumentList) { - return new TypeScript.GenericTypeSyntax(name, typeArgumentList, false); - }; - NormalModeFactory.prototype.typeQuery = function (typeOfKeyword, name) { - return new TypeScript.TypeQuerySyntax(typeOfKeyword, name, false); - }; - NormalModeFactory.prototype.typeAnnotation = function (colonToken, type) { - return new TypeScript.TypeAnnotationSyntax(colonToken, type, false); - }; - NormalModeFactory.prototype.block = function (openBraceToken, statements, closeBraceToken) { - return new TypeScript.BlockSyntax(openBraceToken, statements, closeBraceToken, false); - }; - NormalModeFactory.prototype.parameter = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - return new TypeScript.ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, false); - }; - NormalModeFactory.prototype.memberAccessExpression = function (expression, dotToken, name) { - return new TypeScript.MemberAccessExpressionSyntax(expression, dotToken, name, false); - }; - NormalModeFactory.prototype.postfixUnaryExpression = function (kind, operand, operatorToken) { - return new TypeScript.PostfixUnaryExpressionSyntax(kind, operand, operatorToken, false); - }; - NormalModeFactory.prototype.elementAccessExpression = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - return new TypeScript.ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, false); - }; - NormalModeFactory.prototype.invocationExpression = function (expression, argumentList) { - return new TypeScript.InvocationExpressionSyntax(expression, argumentList, false); - }; - NormalModeFactory.prototype.argumentList = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - return new TypeScript.ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, false); - }; - NormalModeFactory.prototype.binaryExpression = function (kind, left, operatorToken, right) { - return new TypeScript.BinaryExpressionSyntax(kind, left, operatorToken, right, false); - }; - NormalModeFactory.prototype.conditionalExpression = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - return new TypeScript.ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, false); - }; - NormalModeFactory.prototype.constructSignature = function (newKeyword, callSignature) { - return new TypeScript.ConstructSignatureSyntax(newKeyword, callSignature, false); - }; - NormalModeFactory.prototype.methodSignature = function (propertyName, questionToken, callSignature) { - return new TypeScript.MethodSignatureSyntax(propertyName, questionToken, callSignature, false); - }; - NormalModeFactory.prototype.indexSignature = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - return new TypeScript.IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, false); - }; - NormalModeFactory.prototype.propertySignature = function (propertyName, questionToken, typeAnnotation) { - return new TypeScript.PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, false); - }; - NormalModeFactory.prototype.callSignature = function (typeParameterList, parameterList, typeAnnotation) { - return new TypeScript.CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, false); - }; - NormalModeFactory.prototype.parameterList = function (openParenToken, parameters, closeParenToken) { - return new TypeScript.ParameterListSyntax(openParenToken, parameters, closeParenToken, false); - }; - NormalModeFactory.prototype.typeParameterList = function (lessThanToken, typeParameters, greaterThanToken) { - return new TypeScript.TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, false); - }; - NormalModeFactory.prototype.typeParameter = function (identifier, constraint) { - return new TypeScript.TypeParameterSyntax(identifier, constraint, false); - }; - NormalModeFactory.prototype.constraint = function (extendsKeyword, type) { - return new TypeScript.ConstraintSyntax(extendsKeyword, type, false); - }; - NormalModeFactory.prototype.elseClause = function (elseKeyword, statement) { - return new TypeScript.ElseClauseSyntax(elseKeyword, statement, false); - }; - NormalModeFactory.prototype.ifStatement = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - return new TypeScript.IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, false); - }; - NormalModeFactory.prototype.expressionStatement = function (expression, semicolonToken) { - return new TypeScript.ExpressionStatementSyntax(expression, semicolonToken, false); - }; - NormalModeFactory.prototype.constructorDeclaration = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - return new TypeScript.ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.memberFunctionDeclaration = function (modifiers, propertyName, callSignature, block, semicolonToken) { - return new TypeScript.MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, false); - }; - NormalModeFactory.prototype.getAccessor = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - return new TypeScript.GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, false); - }; - NormalModeFactory.prototype.setAccessor = function (modifiers, setKeyword, propertyName, parameterList, block) { - return new TypeScript.SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, false); - }; - NormalModeFactory.prototype.memberVariableDeclaration = function (modifiers, variableDeclarator, semicolonToken) { - return new TypeScript.MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, false); - }; - NormalModeFactory.prototype.indexMemberDeclaration = function (modifiers, indexSignature, semicolonToken) { - return new TypeScript.IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, false); - }; - NormalModeFactory.prototype.throwStatement = function (throwKeyword, expression, semicolonToken) { - return new TypeScript.ThrowStatementSyntax(throwKeyword, expression, semicolonToken, false); - }; - NormalModeFactory.prototype.returnStatement = function (returnKeyword, expression, semicolonToken) { - return new TypeScript.ReturnStatementSyntax(returnKeyword, expression, semicolonToken, false); - }; - NormalModeFactory.prototype.objectCreationExpression = function (newKeyword, expression, argumentList) { - return new TypeScript.ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, false); - }; - NormalModeFactory.prototype.switchStatement = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - return new TypeScript.SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, false); - }; - NormalModeFactory.prototype.caseSwitchClause = function (caseKeyword, expression, colonToken, statements) { - return new TypeScript.CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, false); - }; - NormalModeFactory.prototype.defaultSwitchClause = function (defaultKeyword, colonToken, statements) { - return new TypeScript.DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, false); - }; - NormalModeFactory.prototype.breakStatement = function (breakKeyword, identifier, semicolonToken) { - return new TypeScript.BreakStatementSyntax(breakKeyword, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.continueStatement = function (continueKeyword, identifier, semicolonToken) { - return new TypeScript.ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, false); - }; - NormalModeFactory.prototype.forStatement = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - return new TypeScript.ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.forInStatement = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - return new TypeScript.ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.whileStatement = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.withStatement = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, false); - }; - NormalModeFactory.prototype.enumDeclaration = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - return new TypeScript.EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, false); - }; - NormalModeFactory.prototype.enumElement = function (propertyName, equalsValueClause) { - return new TypeScript.EnumElementSyntax(propertyName, equalsValueClause, false); - }; - NormalModeFactory.prototype.castExpression = function (lessThanToken, type, greaterThanToken, expression) { - return new TypeScript.CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, false); - }; - NormalModeFactory.prototype.objectLiteralExpression = function (openBraceToken, propertyAssignments, closeBraceToken) { - return new TypeScript.ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, false); - }; - NormalModeFactory.prototype.simplePropertyAssignment = function (propertyName, colonToken, expression) { - return new TypeScript.SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, false); - }; - NormalModeFactory.prototype.functionPropertyAssignment = function (propertyName, callSignature, block) { - return new TypeScript.FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, false); - }; - NormalModeFactory.prototype.functionExpression = function (functionKeyword, identifier, callSignature, block) { - return new TypeScript.FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, false); - }; - NormalModeFactory.prototype.emptyStatement = function (semicolonToken) { - return new TypeScript.EmptyStatementSyntax(semicolonToken, false); - }; - NormalModeFactory.prototype.tryStatement = function (tryKeyword, block, catchClause, finallyClause) { - return new TypeScript.TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, false); - }; - NormalModeFactory.prototype.catchClause = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - return new TypeScript.CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, false); - }; - NormalModeFactory.prototype.finallyClause = function (finallyKeyword, block) { - return new TypeScript.FinallyClauseSyntax(finallyKeyword, block, false); - }; - NormalModeFactory.prototype.labeledStatement = function (identifier, colonToken, statement) { - return new TypeScript.LabeledStatementSyntax(identifier, colonToken, statement, false); - }; - NormalModeFactory.prototype.doStatement = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - return new TypeScript.DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, false); - }; - NormalModeFactory.prototype.typeOfExpression = function (typeOfKeyword, expression) { - return new TypeScript.TypeOfExpressionSyntax(typeOfKeyword, expression, false); - }; - NormalModeFactory.prototype.deleteExpression = function (deleteKeyword, expression) { - return new TypeScript.DeleteExpressionSyntax(deleteKeyword, expression, false); - }; - NormalModeFactory.prototype.voidExpression = function (voidKeyword, expression) { - return new TypeScript.VoidExpressionSyntax(voidKeyword, expression, false); - }; - NormalModeFactory.prototype.debuggerStatement = function (debuggerKeyword, semicolonToken) { - return new TypeScript.DebuggerStatementSyntax(debuggerKeyword, semicolonToken, false); - }; - return NormalModeFactory; - })(); - Syntax.NormalModeFactory = NormalModeFactory; - - var StrictModeFactory = (function () { - function StrictModeFactory() { - } - StrictModeFactory.prototype.sourceUnit = function (moduleElements, endOfFileToken) { - return new TypeScript.SourceUnitSyntax(moduleElements, endOfFileToken, true); - }; - StrictModeFactory.prototype.externalModuleReference = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - return new TypeScript.ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, true); - }; - StrictModeFactory.prototype.moduleNameModuleReference = function (moduleName) { - return new TypeScript.ModuleNameModuleReferenceSyntax(moduleName, true); - }; - StrictModeFactory.prototype.importDeclaration = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new TypeScript.ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, true); - }; - StrictModeFactory.prototype.exportAssignment = function (exportKeyword, equalsToken, identifier, semicolonToken) { - return new TypeScript.ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.classDeclaration = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - return new TypeScript.ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.interfaceDeclaration = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - return new TypeScript.InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, true); - }; - StrictModeFactory.prototype.heritageClause = function (kind, extendsOrImplementsKeyword, typeNames) { - return new TypeScript.HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, true); - }; - StrictModeFactory.prototype.moduleDeclaration = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - return new TypeScript.ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.functionDeclaration = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - return new TypeScript.FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.variableStatement = function (modifiers, variableDeclaration, semicolonToken) { - return new TypeScript.VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, true); - }; - StrictModeFactory.prototype.variableDeclaration = function (varKeyword, variableDeclarators) { - return new TypeScript.VariableDeclarationSyntax(varKeyword, variableDeclarators, true); - }; - StrictModeFactory.prototype.variableDeclarator = function (propertyName, typeAnnotation, equalsValueClause) { - return new TypeScript.VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, true); - }; - StrictModeFactory.prototype.equalsValueClause = function (equalsToken, value) { - return new TypeScript.EqualsValueClauseSyntax(equalsToken, value, true); - }; - StrictModeFactory.prototype.prefixUnaryExpression = function (kind, operatorToken, operand) { - return new TypeScript.PrefixUnaryExpressionSyntax(kind, operatorToken, operand, true); - }; - StrictModeFactory.prototype.arrayLiteralExpression = function (openBracketToken, expressions, closeBracketToken) { - return new TypeScript.ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, true); - }; - StrictModeFactory.prototype.omittedExpression = function () { - return new TypeScript.OmittedExpressionSyntax(true); - }; - StrictModeFactory.prototype.parenthesizedExpression = function (openParenToken, expression, closeParenToken) { - return new TypeScript.ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, true); - }; - StrictModeFactory.prototype.simpleArrowFunctionExpression = function (identifier, equalsGreaterThanToken, block, expression) { - return new TypeScript.SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, true); - }; - StrictModeFactory.prototype.parenthesizedArrowFunctionExpression = function (callSignature, equalsGreaterThanToken, block, expression) { - return new TypeScript.ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, true); - }; - StrictModeFactory.prototype.qualifiedName = function (left, dotToken, right) { - return new TypeScript.QualifiedNameSyntax(left, dotToken, right, true); - }; - StrictModeFactory.prototype.typeArgumentList = function (lessThanToken, typeArguments, greaterThanToken) { - return new TypeScript.TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, true); - }; - StrictModeFactory.prototype.constructorType = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, true); - }; - StrictModeFactory.prototype.functionType = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - return new TypeScript.FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, true); - }; - StrictModeFactory.prototype.objectType = function (openBraceToken, typeMembers, closeBraceToken) { - return new TypeScript.ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, true); - }; - StrictModeFactory.prototype.arrayType = function (type, openBracketToken, closeBracketToken) { - return new TypeScript.ArrayTypeSyntax(type, openBracketToken, closeBracketToken, true); - }; - StrictModeFactory.prototype.genericType = function (name, typeArgumentList) { - return new TypeScript.GenericTypeSyntax(name, typeArgumentList, true); - }; - StrictModeFactory.prototype.typeQuery = function (typeOfKeyword, name) { - return new TypeScript.TypeQuerySyntax(typeOfKeyword, name, true); - }; - StrictModeFactory.prototype.typeAnnotation = function (colonToken, type) { - return new TypeScript.TypeAnnotationSyntax(colonToken, type, true); - }; - StrictModeFactory.prototype.block = function (openBraceToken, statements, closeBraceToken) { - return new TypeScript.BlockSyntax(openBraceToken, statements, closeBraceToken, true); - }; - StrictModeFactory.prototype.parameter = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - return new TypeScript.ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, true); - }; - StrictModeFactory.prototype.memberAccessExpression = function (expression, dotToken, name) { - return new TypeScript.MemberAccessExpressionSyntax(expression, dotToken, name, true); - }; - StrictModeFactory.prototype.postfixUnaryExpression = function (kind, operand, operatorToken) { - return new TypeScript.PostfixUnaryExpressionSyntax(kind, operand, operatorToken, true); - }; - StrictModeFactory.prototype.elementAccessExpression = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - return new TypeScript.ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, true); - }; - StrictModeFactory.prototype.invocationExpression = function (expression, argumentList) { - return new TypeScript.InvocationExpressionSyntax(expression, argumentList, true); - }; - StrictModeFactory.prototype.argumentList = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - return new TypeScript.ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, true); - }; - StrictModeFactory.prototype.binaryExpression = function (kind, left, operatorToken, right) { - return new TypeScript.BinaryExpressionSyntax(kind, left, operatorToken, right, true); - }; - StrictModeFactory.prototype.conditionalExpression = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - return new TypeScript.ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, true); - }; - StrictModeFactory.prototype.constructSignature = function (newKeyword, callSignature) { - return new TypeScript.ConstructSignatureSyntax(newKeyword, callSignature, true); - }; - StrictModeFactory.prototype.methodSignature = function (propertyName, questionToken, callSignature) { - return new TypeScript.MethodSignatureSyntax(propertyName, questionToken, callSignature, true); - }; - StrictModeFactory.prototype.indexSignature = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - return new TypeScript.IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, true); - }; - StrictModeFactory.prototype.propertySignature = function (propertyName, questionToken, typeAnnotation) { - return new TypeScript.PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, true); - }; - StrictModeFactory.prototype.callSignature = function (typeParameterList, parameterList, typeAnnotation) { - return new TypeScript.CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, true); - }; - StrictModeFactory.prototype.parameterList = function (openParenToken, parameters, closeParenToken) { - return new TypeScript.ParameterListSyntax(openParenToken, parameters, closeParenToken, true); - }; - StrictModeFactory.prototype.typeParameterList = function (lessThanToken, typeParameters, greaterThanToken) { - return new TypeScript.TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, true); - }; - StrictModeFactory.prototype.typeParameter = function (identifier, constraint) { - return new TypeScript.TypeParameterSyntax(identifier, constraint, true); - }; - StrictModeFactory.prototype.constraint = function (extendsKeyword, type) { - return new TypeScript.ConstraintSyntax(extendsKeyword, type, true); - }; - StrictModeFactory.prototype.elseClause = function (elseKeyword, statement) { - return new TypeScript.ElseClauseSyntax(elseKeyword, statement, true); - }; - StrictModeFactory.prototype.ifStatement = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - return new TypeScript.IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, true); - }; - StrictModeFactory.prototype.expressionStatement = function (expression, semicolonToken) { - return new TypeScript.ExpressionStatementSyntax(expression, semicolonToken, true); - }; - StrictModeFactory.prototype.constructorDeclaration = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - return new TypeScript.ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.memberFunctionDeclaration = function (modifiers, propertyName, callSignature, block, semicolonToken) { - return new TypeScript.MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, true); - }; - StrictModeFactory.prototype.getAccessor = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - return new TypeScript.GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, true); - }; - StrictModeFactory.prototype.setAccessor = function (modifiers, setKeyword, propertyName, parameterList, block) { - return new TypeScript.SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, true); - }; - StrictModeFactory.prototype.memberVariableDeclaration = function (modifiers, variableDeclarator, semicolonToken) { - return new TypeScript.MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, true); - }; - StrictModeFactory.prototype.indexMemberDeclaration = function (modifiers, indexSignature, semicolonToken) { - return new TypeScript.IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, true); - }; - StrictModeFactory.prototype.throwStatement = function (throwKeyword, expression, semicolonToken) { - return new TypeScript.ThrowStatementSyntax(throwKeyword, expression, semicolonToken, true); - }; - StrictModeFactory.prototype.returnStatement = function (returnKeyword, expression, semicolonToken) { - return new TypeScript.ReturnStatementSyntax(returnKeyword, expression, semicolonToken, true); - }; - StrictModeFactory.prototype.objectCreationExpression = function (newKeyword, expression, argumentList) { - return new TypeScript.ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, true); - }; - StrictModeFactory.prototype.switchStatement = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - return new TypeScript.SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, true); - }; - StrictModeFactory.prototype.caseSwitchClause = function (caseKeyword, expression, colonToken, statements) { - return new TypeScript.CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, true); - }; - StrictModeFactory.prototype.defaultSwitchClause = function (defaultKeyword, colonToken, statements) { - return new TypeScript.DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, true); - }; - StrictModeFactory.prototype.breakStatement = function (breakKeyword, identifier, semicolonToken) { - return new TypeScript.BreakStatementSyntax(breakKeyword, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.continueStatement = function (continueKeyword, identifier, semicolonToken) { - return new TypeScript.ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, true); - }; - StrictModeFactory.prototype.forStatement = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - return new TypeScript.ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.forInStatement = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - return new TypeScript.ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.whileStatement = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.withStatement = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - return new TypeScript.WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, true); - }; - StrictModeFactory.prototype.enumDeclaration = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - return new TypeScript.EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, true); - }; - StrictModeFactory.prototype.enumElement = function (propertyName, equalsValueClause) { - return new TypeScript.EnumElementSyntax(propertyName, equalsValueClause, true); - }; - StrictModeFactory.prototype.castExpression = function (lessThanToken, type, greaterThanToken, expression) { - return new TypeScript.CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, true); - }; - StrictModeFactory.prototype.objectLiteralExpression = function (openBraceToken, propertyAssignments, closeBraceToken) { - return new TypeScript.ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, true); - }; - StrictModeFactory.prototype.simplePropertyAssignment = function (propertyName, colonToken, expression) { - return new TypeScript.SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, true); - }; - StrictModeFactory.prototype.functionPropertyAssignment = function (propertyName, callSignature, block) { - return new TypeScript.FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, true); - }; - StrictModeFactory.prototype.functionExpression = function (functionKeyword, identifier, callSignature, block) { - return new TypeScript.FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, true); - }; - StrictModeFactory.prototype.emptyStatement = function (semicolonToken) { - return new TypeScript.EmptyStatementSyntax(semicolonToken, true); - }; - StrictModeFactory.prototype.tryStatement = function (tryKeyword, block, catchClause, finallyClause) { - return new TypeScript.TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, true); - }; - StrictModeFactory.prototype.catchClause = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - return new TypeScript.CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, true); - }; - StrictModeFactory.prototype.finallyClause = function (finallyKeyword, block) { - return new TypeScript.FinallyClauseSyntax(finallyKeyword, block, true); - }; - StrictModeFactory.prototype.labeledStatement = function (identifier, colonToken, statement) { - return new TypeScript.LabeledStatementSyntax(identifier, colonToken, statement, true); - }; - StrictModeFactory.prototype.doStatement = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - return new TypeScript.DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, true); - }; - StrictModeFactory.prototype.typeOfExpression = function (typeOfKeyword, expression) { - return new TypeScript.TypeOfExpressionSyntax(typeOfKeyword, expression, true); - }; - StrictModeFactory.prototype.deleteExpression = function (deleteKeyword, expression) { - return new TypeScript.DeleteExpressionSyntax(deleteKeyword, expression, true); - }; - StrictModeFactory.prototype.voidExpression = function (voidKeyword, expression) { - return new TypeScript.VoidExpressionSyntax(voidKeyword, expression, true); - }; - StrictModeFactory.prototype.debuggerStatement = function (debuggerKeyword, semicolonToken) { - return new TypeScript.DebuggerStatementSyntax(debuggerKeyword, semicolonToken, true); - }; - return StrictModeFactory; - })(); - Syntax.StrictModeFactory = StrictModeFactory; - - Syntax.normalModeFactory = new NormalModeFactory(); - Syntax.strictModeFactory = new StrictModeFactory(); - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (SyntaxFacts) { - function isDirectivePrologueElement(node) { - if (node.kind() === 149 /* ExpressionStatement */) { - var expressionStatement = node; - var expression = expressionStatement.expression; - - if (expression.kind() === 14 /* StringLiteral */) { - return true; - } - } - - return false; - } - SyntaxFacts.isDirectivePrologueElement = isDirectivePrologueElement; - - function isUseStrictDirective(node) { - var expressionStatement = node; - var stringLiteral = expressionStatement.expression; - - var text = stringLiteral.text(); - return text === '"use strict"' || text === "'use strict'"; - } - SyntaxFacts.isUseStrictDirective = isUseStrictDirective; - - function isIdentifierNameOrAnyKeyword(token) { - var tokenKind = token.tokenKind; - return tokenKind === 11 /* IdentifierName */ || TypeScript.SyntaxFacts.isAnyKeyword(tokenKind); - } - SyntaxFacts.isIdentifierNameOrAnyKeyword = isIdentifierNameOrAnyKeyword; - })(TypeScript.SyntaxFacts || (TypeScript.SyntaxFacts = {})); - var SyntaxFacts = TypeScript.SyntaxFacts; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var EmptySyntaxList = (function () { - function EmptySyntaxList() { - } - EmptySyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - EmptySyntaxList.prototype.isNode = function () { - return false; - }; - EmptySyntaxList.prototype.isToken = function () { - return false; - }; - EmptySyntaxList.prototype.isList = function () { - return true; - }; - EmptySyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - EmptySyntaxList.prototype.toJSON = function (key) { - return []; - }; - - EmptySyntaxList.prototype.childCount = function () { - return 0; - }; - - EmptySyntaxList.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptySyntaxList.prototype.toArray = function () { - return []; - }; - - EmptySyntaxList.prototype.collectTextElements = function (elements) { - }; - - EmptySyntaxList.prototype.firstToken = function () { - return null; - }; - - EmptySyntaxList.prototype.lastToken = function () { - return null; - }; - - EmptySyntaxList.prototype.fullWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.width = function () { - return 0; - }; - - EmptySyntaxList.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySyntaxList.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - EmptySyntaxList.prototype.leadingTriviaWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.trailingTriviaWidth = function () { - return 0; - }; - - EmptySyntaxList.prototype.fullText = function () { - return ""; - }; - - EmptySyntaxList.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptySyntaxList.prototype.isIncrementallyUnusable = function () { - return false; - }; - - EmptySyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - throw TypeScript.Errors.invalidOperation(); - }; - - EmptySyntaxList.prototype.insertChildrenInto = function (array, index) { - }; - return EmptySyntaxList; - })(); - Syntax.EmptySyntaxList = EmptySyntaxList; - - Syntax.emptyList = new EmptySyntaxList(); - - var SingletonSyntaxList = (function () { - function SingletonSyntaxList(item) { - this.item = item; - } - SingletonSyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - SingletonSyntaxList.prototype.isToken = function () { - return false; - }; - SingletonSyntaxList.prototype.isNode = function () { - return false; - }; - SingletonSyntaxList.prototype.isList = function () { - return true; - }; - SingletonSyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - SingletonSyntaxList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSyntaxList.prototype.childCount = function () { - return 1; - }; - - SingletonSyntaxList.prototype.childAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSyntaxList.prototype.toArray = function () { - return [this.item]; - }; - - SingletonSyntaxList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSyntaxList.prototype.firstToken = function () { - return this.item.firstToken(); - }; - - SingletonSyntaxList.prototype.lastToken = function () { - return this.item.lastToken(); - }; - - SingletonSyntaxList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSyntaxList.prototype.width = function () { - return this.item.width(); - }; - - SingletonSyntaxList.prototype.leadingTrivia = function () { - return this.item.leadingTrivia(); - }; - - SingletonSyntaxList.prototype.trailingTrivia = function () { - return this.item.trailingTrivia(); - }; - - SingletonSyntaxList.prototype.leadingTriviaWidth = function () { - return this.item.leadingTriviaWidth(); - }; - - SingletonSyntaxList.prototype.trailingTriviaWidth = function () { - return this.item.trailingTriviaWidth(); - }; - - SingletonSyntaxList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSyntaxList.prototype.isTypeScriptSpecific = function () { - return this.item.isTypeScriptSpecific(); - }; - - SingletonSyntaxList.prototype.isIncrementallyUnusable = function () { - return this.item.isIncrementallyUnusable(); - }; - - SingletonSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - return this.item.findTokenInternal(new TypeScript.PositionedList(parent, this, fullStart), position, fullStart); - }; - - SingletonSyntaxList.prototype.insertChildrenInto = function (array, index) { - array.splice(index, 0, this.item); - }; - return SingletonSyntaxList; - })(); - - var NormalSyntaxList = (function () { - function NormalSyntaxList(nodeOrTokens) { - this._data = 0; - this.nodeOrTokens = nodeOrTokens; - } - NormalSyntaxList.prototype.kind = function () { - return 1 /* List */; - }; - - NormalSyntaxList.prototype.isNode = function () { - return false; - }; - NormalSyntaxList.prototype.isToken = function () { - return false; - }; - NormalSyntaxList.prototype.isList = function () { - return true; - }; - NormalSyntaxList.prototype.isSeparatedList = function () { - return false; - }; - - NormalSyntaxList.prototype.toJSON = function (key) { - return this.nodeOrTokens; - }; - - NormalSyntaxList.prototype.childCount = function () { - return this.nodeOrTokens.length; - }; - - NormalSyntaxList.prototype.childAt = function (index) { - if (index < 0 || index >= this.nodeOrTokens.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.nodeOrTokens[index]; - }; - - NormalSyntaxList.prototype.toArray = function () { - return this.nodeOrTokens.slice(0); - }; - - NormalSyntaxList.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var element = this.nodeOrTokens[i]; - element.collectTextElements(elements); - } - }; - - NormalSyntaxList.prototype.firstToken = function () { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var token = this.nodeOrTokens[i].firstToken(); - if (token !== null) { - return token; - } - } - - return null; - }; - - NormalSyntaxList.prototype.lastToken = function () { - for (var i = this.nodeOrTokens.length - 1; i >= 0; i--) { - var token = this.nodeOrTokens[i].lastToken(); - if (token !== null) { - return token; - } - } - - return null; - }; - - NormalSyntaxList.prototype.fullText = function () { - var elements = new Array(); - this.collectTextElements(elements); - return elements.join(""); - }; - - NormalSyntaxList.prototype.isTypeScriptSpecific = function () { - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - if (this.nodeOrTokens[i].isTypeScriptSpecific()) { - return true; - } - } - - return false; - }; - - NormalSyntaxList.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - NormalSyntaxList.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - NormalSyntaxList.prototype.width = function () { - var fullWidth = this.fullWidth(); - return fullWidth - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - NormalSyntaxList.prototype.leadingTrivia = function () { - return this.firstToken().leadingTrivia(); - }; - - NormalSyntaxList.prototype.trailingTrivia = function () { - return this.lastToken().trailingTrivia(); - }; - - NormalSyntaxList.prototype.leadingTriviaWidth = function () { - return this.firstToken().leadingTriviaWidth(); - }; - - NormalSyntaxList.prototype.trailingTriviaWidth = function () { - return this.lastToken().trailingTriviaWidth(); - }; - - NormalSyntaxList.prototype.computeData = function () { - var fullWidth = 0; - var isIncrementallyUnusable = false; - - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var node = this.nodeOrTokens[i]; - fullWidth += node.fullWidth(); - isIncrementallyUnusable = isIncrementallyUnusable || node.isIncrementallyUnusable(); - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - NormalSyntaxList.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data = this.computeData(); - } - - return this._data; - }; - - NormalSyntaxList.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedList(parent, this, fullStart); - for (var i = 0, n = this.nodeOrTokens.length; i < n; i++) { - var nodeOrToken = this.nodeOrTokens[i]; - - var childWidth = nodeOrToken.fullWidth(); - if (position < childWidth) { - return nodeOrToken.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - NormalSyntaxList.prototype.insertChildrenInto = function (array, index) { - if (index === 0) { - array.unshift.apply(array, this.nodeOrTokens); - } else { - array.splice.apply(array, [index, 0].concat(this.nodeOrTokens)); - } - }; - return NormalSyntaxList; - })(); - - function list(nodes) { - if (nodes === undefined || nodes === null || nodes.length === 0) { - return Syntax.emptyList; - } - - if (nodes.length === 1) { - var item = nodes[0]; - return new SingletonSyntaxList(item); - } - - return new NormalSyntaxList(nodes); - } - Syntax.list = list; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNode = (function () { - function SyntaxNode(parsedInStrictMode) { - this._data = parsedInStrictMode ? 4 /* NodeParsedInStrictModeMask */ : 0; - } - SyntaxNode.prototype.isNode = function () { - return true; - }; - SyntaxNode.prototype.isToken = function () { - return false; - }; - SyntaxNode.prototype.isList = function () { - return false; - }; - SyntaxNode.prototype.isSeparatedList = function () { - return false; - }; - - SyntaxNode.prototype.kind = function () { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.childCount = function () { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.childAt = function (slot) { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.firstToken = function () { - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - if (element.fullWidth() > 0 || element.kind() === 10 /* EndOfFileToken */) { - return element.firstToken(); - } - } - } - - return null; - }; - - SyntaxNode.prototype.lastToken = function () { - for (var i = this.childCount() - 1; i >= 0; i--) { - var element = this.childAt(i); - - if (element !== null) { - if (element.fullWidth() > 0 || element.kind() === 10 /* EndOfFileToken */) { - return element.lastToken(); - } - } - } - - return null; - }; - - SyntaxNode.prototype.insertChildrenInto = function (array, index) { - for (var i = this.childCount() - 1; i >= 0; i--) { - var element = this.childAt(i); - - if (element !== null) { - if (element.isNode() || element.isToken()) { - array.splice(index, 0, element); - } else if (element.isList()) { - element.insertChildrenInto(array, index); - } else if (element.isSeparatedList()) { - element.insertChildrenInto(array, index); - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - } - }; - - SyntaxNode.prototype.leadingTrivia = function () { - var firstToken = this.firstToken(); - return firstToken ? firstToken.leadingTrivia() : TypeScript.Syntax.emptyTriviaList; - }; - - SyntaxNode.prototype.trailingTrivia = function () { - var lastToken = this.lastToken(); - return lastToken ? lastToken.trailingTrivia() : TypeScript.Syntax.emptyTriviaList; - }; - - SyntaxNode.prototype.toJSON = function (key) { - var result = { - kind: TypeScript.SyntaxKind[this.kind()], - fullWidth: this.fullWidth() - }; - - if (this.isIncrementallyUnusable()) { - result.isIncrementallyUnusable = true; - } - - if (this.parsedInStrictMode()) { - result.parsedInStrictMode = true; - } - - var thisAsIndexable = this; - for (var i = 0, n = this.childCount(); i < n; i++) { - var value = this.childAt(i); - - if (value) { - for (var name in this) { - if (value === thisAsIndexable[name]) { - result[name] = value; - break; - } - } - } - } - - return result; - }; - - SyntaxNode.prototype.accept = function (visitor) { - throw TypeScript.Errors.abstract(); - }; - - SyntaxNode.prototype.fullText = function () { - var elements = []; - this.collectTextElements(elements); - return elements.join(""); - }; - - SyntaxNode.prototype.collectTextElements = function (elements) { - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - element.collectTextElements(elements); - } - } - }; - - SyntaxNode.prototype.replaceToken = function (token1, token2) { - if (token1 === token2) { - return this; - } - - return this.accept(new TypeScript.SyntaxTokenReplacer(token1, token2)); - }; - - SyntaxNode.prototype.withLeadingTrivia = function (trivia) { - return this.replaceToken(this.firstToken(), this.firstToken().withLeadingTrivia(trivia)); - }; - - SyntaxNode.prototype.withTrailingTrivia = function (trivia) { - return this.replaceToken(this.lastToken(), this.lastToken().withTrailingTrivia(trivia)); - }; - - SyntaxNode.prototype.hasLeadingTrivia = function () { - return this.lastToken().hasLeadingTrivia(); - }; - - SyntaxNode.prototype.hasTrailingTrivia = function () { - return this.lastToken().hasTrailingTrivia(); - }; - - SyntaxNode.prototype.isTypeScriptSpecific = function () { - return false; - }; - - SyntaxNode.prototype.isIncrementallyUnusable = function () { - return (this.data() & 2 /* NodeIncrementallyUnusableMask */) !== 0; - }; - - SyntaxNode.prototype.parsedInStrictMode = function () { - return (this.data() & 4 /* NodeParsedInStrictModeMask */) !== 0; - }; - - SyntaxNode.prototype.fullWidth = function () { - return this.data() >>> 3 /* NodeFullWidthShift */; - }; - - SyntaxNode.prototype.computeData = function () { - var slotCount = this.childCount(); - - var fullWidth = 0; - var childWidth = 0; - - var isIncrementallyUnusable = ((this._data & 2 /* NodeIncrementallyUnusableMask */) !== 0) || slotCount === 0; - - for (var i = 0, n = slotCount; i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - childWidth = element.fullWidth(); - fullWidth += childWidth; - - if (!isIncrementallyUnusable) { - isIncrementallyUnusable = element.isIncrementallyUnusable(); - } - } - } - - return (fullWidth << 3 /* NodeFullWidthShift */) | (isIncrementallyUnusable ? 2 /* NodeIncrementallyUnusableMask */ : 0) | 1 /* NodeDataComputed */; - }; - - SyntaxNode.prototype.data = function () { - if ((this._data & 1 /* NodeDataComputed */) === 0) { - this._data |= this.computeData(); - } - - return this._data; - }; - - SyntaxNode.prototype.findToken = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var endOfFileToken = this.tryGetEndOfFileAt(position); - if (endOfFileToken !== null) { - return endOfFileToken; - } - - if (position < 0 || position >= this.fullWidth()) { - throw TypeScript.Errors.argumentOutOfRange("position"); - } - - var positionedToken = this.findTokenInternal(null, position, 0); - - if (includeSkippedTokens) { - return TypeScript.Syntax.findSkippedTokenInPositionedToken(positionedToken, position) || positionedToken; - } - - return positionedToken; - }; - - SyntaxNode.prototype.tryGetEndOfFileAt = function (position) { - if (this.kind() === 120 /* SourceUnit */ && position === this.fullWidth()) { - var sourceUnit = this; - return new TypeScript.PositionedToken(new TypeScript.PositionedNode(null, sourceUnit, 0), sourceUnit.endOfFileToken, sourceUnit.moduleElements.fullWidth()); - } - - return null; - }; - - SyntaxNode.prototype.findTokenInternal = function (parent, position, fullStart) { - parent = new TypeScript.PositionedNode(parent, this, fullStart); - for (var i = 0, n = this.childCount(); i < n; i++) { - var element = this.childAt(i); - - if (element !== null) { - var childWidth = element.fullWidth(); - - if (position < childWidth) { - return element.findTokenInternal(parent, position, fullStart); - } - - position -= childWidth; - fullStart += childWidth; - } - } - - throw TypeScript.Errors.invalidOperation(); - }; - - SyntaxNode.prototype.findTokenOnLeft = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var positionedToken = this.findToken(position, false); - var start = positionedToken.start(); - - if (includeSkippedTokens) { - positionedToken = TypeScript.Syntax.findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - - if (position > start) { - return positionedToken; - } - - if (positionedToken.fullStart() === 0) { - return null; - } - - return positionedToken.previousToken(includeSkippedTokens); - }; - - SyntaxNode.prototype.findCompleteTokenOnLeft = function (position, includeSkippedTokens) { - if (typeof includeSkippedTokens === "undefined") { includeSkippedTokens = false; } - var positionedToken = this.findToken(position, false); - - if (includeSkippedTokens) { - positionedToken = TypeScript.Syntax.findSkippedTokenOnLeft(positionedToken, position) || positionedToken; - } - - if (positionedToken.token().width() > 0 && position >= positionedToken.end()) { - return positionedToken; - } - - return positionedToken.previousToken(includeSkippedTokens); - }; - - SyntaxNode.prototype.isModuleElement = function () { - return false; - }; - - SyntaxNode.prototype.isClassElement = function () { - return false; - }; - - SyntaxNode.prototype.isTypeMember = function () { - return false; - }; - - SyntaxNode.prototype.isStatement = function () { - return false; - }; - - SyntaxNode.prototype.isExpression = function () { - return false; - }; - - SyntaxNode.prototype.isSwitchClause = function () { - return false; - }; - - SyntaxNode.prototype.structuralEquals = function (node) { - if (this === node) { - return true; - } - if (node === null) { - return false; - } - if (this.kind() !== node.kind()) { - return false; - } - - for (var i = 0, n = this.childCount(); i < n; i++) { - var element1 = this.childAt(i); - var element2 = node.childAt(i); - - if (!TypeScript.Syntax.elementStructuralEquals(element1, element2)) { - return false; - } - } - - return true; - }; - - SyntaxNode.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - SyntaxNode.prototype.leadingTriviaWidth = function () { - var firstToken = this.firstToken(); - return firstToken === null ? 0 : firstToken.leadingTriviaWidth(); - }; - - SyntaxNode.prototype.trailingTriviaWidth = function () { - var lastToken = this.lastToken(); - return lastToken === null ? 0 : lastToken.trailingTriviaWidth(); - }; - return SyntaxNode; - })(); - TypeScript.SyntaxNode = SyntaxNode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SourceUnitSyntax = (function (_super) { - __extends(SourceUnitSyntax, _super); - function SourceUnitSyntax(moduleElements, endOfFileToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.moduleElements = moduleElements; - this.endOfFileToken = endOfFileToken; - } - SourceUnitSyntax.prototype.accept = function (visitor) { - return visitor.visitSourceUnit(this); - }; - - SourceUnitSyntax.prototype.kind = function () { - return 120 /* SourceUnit */; - }; - - SourceUnitSyntax.prototype.childCount = function () { - return 2; - }; - - SourceUnitSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.moduleElements; - case 1: - return this.endOfFileToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SourceUnitSyntax.prototype.update = function (moduleElements, endOfFileToken) { - if (this.moduleElements === moduleElements && this.endOfFileToken === endOfFileToken) { - return this; - } - - return new SourceUnitSyntax(moduleElements, endOfFileToken, this.parsedInStrictMode()); - }; - - SourceUnitSyntax.create = function (endOfFileToken) { - return new SourceUnitSyntax(TypeScript.Syntax.emptyList, endOfFileToken, false); - }; - - SourceUnitSyntax.create1 = function (endOfFileToken) { - return new SourceUnitSyntax(TypeScript.Syntax.emptyList, endOfFileToken, false); - }; - - SourceUnitSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SourceUnitSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SourceUnitSyntax.prototype.withModuleElements = function (moduleElements) { - return this.update(moduleElements, this.endOfFileToken); - }; - - SourceUnitSyntax.prototype.withModuleElement = function (moduleElement) { - return this.withModuleElements(TypeScript.Syntax.list([moduleElement])); - }; - - SourceUnitSyntax.prototype.withEndOfFileToken = function (endOfFileToken) { - return this.update(this.moduleElements, endOfFileToken); - }; - - SourceUnitSyntax.prototype.isTypeScriptSpecific = function () { - if (this.moduleElements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SourceUnitSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SourceUnitSyntax = SourceUnitSyntax; - - var ExternalModuleReferenceSyntax = (function (_super) { - __extends(ExternalModuleReferenceSyntax, _super); - function ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.requireKeyword = requireKeyword; - this.openParenToken = openParenToken; - this.stringLiteral = stringLiteral; - this.closeParenToken = closeParenToken; - } - ExternalModuleReferenceSyntax.prototype.accept = function (visitor) { - return visitor.visitExternalModuleReference(this); - }; - - ExternalModuleReferenceSyntax.prototype.kind = function () { - return 245 /* ExternalModuleReference */; - }; - - ExternalModuleReferenceSyntax.prototype.childCount = function () { - return 4; - }; - - ExternalModuleReferenceSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.requireKeyword; - case 1: - return this.openParenToken; - case 2: - return this.stringLiteral; - case 3: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExternalModuleReferenceSyntax.prototype.isModuleReference = function () { - return true; - }; - - ExternalModuleReferenceSyntax.prototype.update = function (requireKeyword, openParenToken, stringLiteral, closeParenToken) { - if (this.requireKeyword === requireKeyword && this.openParenToken === openParenToken && this.stringLiteral === stringLiteral && this.closeParenToken === closeParenToken) { - return this; - } - - return new ExternalModuleReferenceSyntax(requireKeyword, openParenToken, stringLiteral, closeParenToken, this.parsedInStrictMode()); - }; - - ExternalModuleReferenceSyntax.create1 = function (stringLiteral) { - return new ExternalModuleReferenceSyntax(TypeScript.Syntax.token(66 /* RequireKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), stringLiteral, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ExternalModuleReferenceSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExternalModuleReferenceSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExternalModuleReferenceSyntax.prototype.withRequireKeyword = function (requireKeyword) { - return this.update(requireKeyword, this.openParenToken, this.stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.requireKeyword, openParenToken, this.stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withStringLiteral = function (stringLiteral) { - return this.update(this.requireKeyword, this.openParenToken, stringLiteral, this.closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.requireKeyword, this.openParenToken, this.stringLiteral, closeParenToken); - }; - - ExternalModuleReferenceSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ExternalModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExternalModuleReferenceSyntax = ExternalModuleReferenceSyntax; - - var ModuleNameModuleReferenceSyntax = (function (_super) { - __extends(ModuleNameModuleReferenceSyntax, _super); - function ModuleNameModuleReferenceSyntax(moduleName, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.moduleName = moduleName; - } - ModuleNameModuleReferenceSyntax.prototype.accept = function (visitor) { - return visitor.visitModuleNameModuleReference(this); - }; - - ModuleNameModuleReferenceSyntax.prototype.kind = function () { - return 246 /* ModuleNameModuleReference */; - }; - - ModuleNameModuleReferenceSyntax.prototype.childCount = function () { - return 1; - }; - - ModuleNameModuleReferenceSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.moduleName; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ModuleNameModuleReferenceSyntax.prototype.isModuleReference = function () { - return true; - }; - - ModuleNameModuleReferenceSyntax.prototype.update = function (moduleName) { - if (this.moduleName === moduleName) { - return this; - } - - return new ModuleNameModuleReferenceSyntax(moduleName, this.parsedInStrictMode()); - }; - - ModuleNameModuleReferenceSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ModuleNameModuleReferenceSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ModuleNameModuleReferenceSyntax.prototype.withModuleName = function (moduleName) { - return this.update(moduleName); - }; - - ModuleNameModuleReferenceSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ModuleNameModuleReferenceSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ModuleNameModuleReferenceSyntax = ModuleNameModuleReferenceSyntax; - - var ImportDeclarationSyntax = (function (_super) { - __extends(ImportDeclarationSyntax, _super); - function ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.importKeyword = importKeyword; - this.identifier = identifier; - this.equalsToken = equalsToken; - this.moduleReference = moduleReference; - this.semicolonToken = semicolonToken; - } - ImportDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitImportDeclaration(this); - }; - - ImportDeclarationSyntax.prototype.kind = function () { - return 133 /* ImportDeclaration */; - }; - - ImportDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - ImportDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.importKeyword; - case 2: - return this.identifier; - case 3: - return this.equalsToken; - case 4: - return this.moduleReference; - case 5: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ImportDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ImportDeclarationSyntax.prototype.update = function (modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - if (this.modifiers === modifiers && this.importKeyword === importKeyword && this.identifier === identifier && this.equalsToken === equalsToken && this.moduleReference === moduleReference && this.semicolonToken === semicolonToken) { - return this; - } - - return new ImportDeclarationSyntax(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, this.parsedInStrictMode()); - }; - - ImportDeclarationSyntax.create = function (importKeyword, identifier, equalsToken, moduleReference, semicolonToken) { - return new ImportDeclarationSyntax(TypeScript.Syntax.emptyList, importKeyword, identifier, equalsToken, moduleReference, semicolonToken, false); - }; - - ImportDeclarationSyntax.create1 = function (identifier, moduleReference) { - return new ImportDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(49 /* ImportKeyword */), identifier, TypeScript.Syntax.token(107 /* EqualsToken */), moduleReference, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ImportDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ImportDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ImportDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.importKeyword, this.identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ImportDeclarationSyntax.prototype.withImportKeyword = function (importKeyword) { - return this.update(this.modifiers, importKeyword, this.identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.importKeyword, identifier, this.equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(this.modifiers, this.importKeyword, this.identifier, equalsToken, this.moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withModuleReference = function (moduleReference) { - return this.update(this.modifiers, this.importKeyword, this.identifier, this.equalsToken, moduleReference, this.semicolonToken); - }; - - ImportDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.importKeyword, this.identifier, this.equalsToken, this.moduleReference, semicolonToken); - }; - - ImportDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ImportDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ImportDeclarationSyntax = ImportDeclarationSyntax; - - var ExportAssignmentSyntax = (function (_super) { - __extends(ExportAssignmentSyntax, _super); - function ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.exportKeyword = exportKeyword; - this.equalsToken = equalsToken; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - ExportAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitExportAssignment(this); - }; - - ExportAssignmentSyntax.prototype.kind = function () { - return 134 /* ExportAssignment */; - }; - - ExportAssignmentSyntax.prototype.childCount = function () { - return 4; - }; - - ExportAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.exportKeyword; - case 1: - return this.equalsToken; - case 2: - return this.identifier; - case 3: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExportAssignmentSyntax.prototype.isModuleElement = function () { - return true; - }; - - ExportAssignmentSyntax.prototype.update = function (exportKeyword, equalsToken, identifier, semicolonToken) { - if (this.exportKeyword === exportKeyword && this.equalsToken === equalsToken && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new ExportAssignmentSyntax(exportKeyword, equalsToken, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - ExportAssignmentSyntax.create1 = function (identifier) { - return new ExportAssignmentSyntax(TypeScript.Syntax.token(47 /* ExportKeyword */), TypeScript.Syntax.token(107 /* EqualsToken */), identifier, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ExportAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExportAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExportAssignmentSyntax.prototype.withExportKeyword = function (exportKeyword) { - return this.update(exportKeyword, this.equalsToken, this.identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(this.exportKeyword, equalsToken, this.identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.exportKeyword, this.equalsToken, identifier, this.semicolonToken); - }; - - ExportAssignmentSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.exportKeyword, this.equalsToken, this.identifier, semicolonToken); - }; - - ExportAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ExportAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExportAssignmentSyntax = ExportAssignmentSyntax; - - var ClassDeclarationSyntax = (function (_super) { - __extends(ClassDeclarationSyntax, _super); - function ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.classKeyword = classKeyword; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.openBraceToken = openBraceToken; - this.classElements = classElements; - this.closeBraceToken = closeBraceToken; - } - ClassDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitClassDeclaration(this); - }; - - ClassDeclarationSyntax.prototype.kind = function () { - return 131 /* ClassDeclaration */; - }; - - ClassDeclarationSyntax.prototype.childCount = function () { - return 8; - }; - - ClassDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.classKeyword; - case 2: - return this.identifier; - case 3: - return this.typeParameterList; - case 4: - return this.heritageClauses; - case 5: - return this.openBraceToken; - case 6: - return this.classElements; - case 7: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ClassDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ClassDeclarationSyntax.prototype.update = function (modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken) { - if (this.modifiers === modifiers && this.classKeyword === classKeyword && this.identifier === identifier && this.typeParameterList === typeParameterList && this.heritageClauses === heritageClauses && this.openBraceToken === openBraceToken && this.classElements === classElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ClassDeclarationSyntax(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken, this.parsedInStrictMode()); - }; - - ClassDeclarationSyntax.create = function (classKeyword, identifier, openBraceToken, closeBraceToken) { - return new ClassDeclarationSyntax(TypeScript.Syntax.emptyList, classKeyword, identifier, null, TypeScript.Syntax.emptyList, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - ClassDeclarationSyntax.create1 = function (identifier) { - return new ClassDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(44 /* ClassKeyword */), identifier, null, TypeScript.Syntax.emptyList, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ClassDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ClassDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ClassDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ClassDeclarationSyntax.prototype.withClassKeyword = function (classKeyword) { - return this.update(this.modifiers, classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.classKeyword, identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.modifiers, this.classKeyword, this.identifier, typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withHeritageClauses = function (heritageClauses) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, heritageClauses, this.openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withHeritageClause = function (heritageClause) { - return this.withHeritageClauses(TypeScript.Syntax.list([heritageClause])); - }; - - ClassDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, openBraceToken, this.classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withClassElements = function (classElements) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, classElements, this.closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.withClassElement = function (classElement) { - return this.withClassElements(TypeScript.Syntax.list([classElement])); - }; - - ClassDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.classKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.openBraceToken, this.classElements, closeBraceToken); - }; - - ClassDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ClassDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ClassDeclarationSyntax = ClassDeclarationSyntax; - - var InterfaceDeclarationSyntax = (function (_super) { - __extends(InterfaceDeclarationSyntax, _super); - function InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.interfaceKeyword = interfaceKeyword; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.body = body; - } - InterfaceDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitInterfaceDeclaration(this); - }; - - InterfaceDeclarationSyntax.prototype.kind = function () { - return 128 /* InterfaceDeclaration */; - }; - - InterfaceDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - InterfaceDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.interfaceKeyword; - case 2: - return this.identifier; - case 3: - return this.typeParameterList; - case 4: - return this.heritageClauses; - case 5: - return this.body; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - InterfaceDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - InterfaceDeclarationSyntax.prototype.update = function (modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body) { - if (this.modifiers === modifiers && this.interfaceKeyword === interfaceKeyword && this.identifier === identifier && this.typeParameterList === typeParameterList && this.heritageClauses === heritageClauses && this.body === body) { - return this; - } - - return new InterfaceDeclarationSyntax(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, body, this.parsedInStrictMode()); - }; - - InterfaceDeclarationSyntax.create = function (interfaceKeyword, identifier, body) { - return new InterfaceDeclarationSyntax(TypeScript.Syntax.emptyList, interfaceKeyword, identifier, null, TypeScript.Syntax.emptyList, body, false); - }; - - InterfaceDeclarationSyntax.create1 = function (identifier) { - return new InterfaceDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(52 /* InterfaceKeyword */), identifier, null, TypeScript.Syntax.emptyList, ObjectTypeSyntax.create1(), false); - }; - - InterfaceDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - InterfaceDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - InterfaceDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - InterfaceDeclarationSyntax.prototype.withInterfaceKeyword = function (interfaceKeyword) { - return this.update(this.modifiers, interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.interfaceKeyword, identifier, this.typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, typeParameterList, this.heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withHeritageClauses = function (heritageClauses) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, heritageClauses, this.body); - }; - - InterfaceDeclarationSyntax.prototype.withHeritageClause = function (heritageClause) { - return this.withHeritageClauses(TypeScript.Syntax.list([heritageClause])); - }; - - InterfaceDeclarationSyntax.prototype.withBody = function (body) { - return this.update(this.modifiers, this.interfaceKeyword, this.identifier, this.typeParameterList, this.heritageClauses, body); - }; - - InterfaceDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return InterfaceDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.InterfaceDeclarationSyntax = InterfaceDeclarationSyntax; - - var HeritageClauseSyntax = (function (_super) { - __extends(HeritageClauseSyntax, _super); - function HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.extendsOrImplementsKeyword = extendsOrImplementsKeyword; - this.typeNames = typeNames; - - this._kind = kind; - } - HeritageClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitHeritageClause(this); - }; - - HeritageClauseSyntax.prototype.childCount = function () { - return 2; - }; - - HeritageClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.extendsOrImplementsKeyword; - case 1: - return this.typeNames; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - HeritageClauseSyntax.prototype.kind = function () { - return this._kind; - }; - - HeritageClauseSyntax.prototype.update = function (kind, extendsOrImplementsKeyword, typeNames) { - if (this._kind === kind && this.extendsOrImplementsKeyword === extendsOrImplementsKeyword && this.typeNames === typeNames) { - return this; - } - - return new HeritageClauseSyntax(kind, extendsOrImplementsKeyword, typeNames, this.parsedInStrictMode()); - }; - - HeritageClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - HeritageClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - HeritageClauseSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.extendsOrImplementsKeyword, this.typeNames); - }; - - HeritageClauseSyntax.prototype.withExtendsOrImplementsKeyword = function (extendsOrImplementsKeyword) { - return this.update(this._kind, extendsOrImplementsKeyword, this.typeNames); - }; - - HeritageClauseSyntax.prototype.withTypeNames = function (typeNames) { - return this.update(this._kind, this.extendsOrImplementsKeyword, typeNames); - }; - - HeritageClauseSyntax.prototype.withTypeName = function (typeName) { - return this.withTypeNames(TypeScript.Syntax.separatedList([typeName])); - }; - - HeritageClauseSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return HeritageClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.HeritageClauseSyntax = HeritageClauseSyntax; - - var ModuleDeclarationSyntax = (function (_super) { - __extends(ModuleDeclarationSyntax, _super); - function ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.moduleKeyword = moduleKeyword; - this.name = name; - this.stringLiteral = stringLiteral; - this.openBraceToken = openBraceToken; - this.moduleElements = moduleElements; - this.closeBraceToken = closeBraceToken; - } - ModuleDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitModuleDeclaration(this); - }; - - ModuleDeclarationSyntax.prototype.kind = function () { - return 130 /* ModuleDeclaration */; - }; - - ModuleDeclarationSyntax.prototype.childCount = function () { - return 7; - }; - - ModuleDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.moduleKeyword; - case 2: - return this.name; - case 3: - return this.stringLiteral; - case 4: - return this.openBraceToken; - case 5: - return this.moduleElements; - case 6: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ModuleDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - ModuleDeclarationSyntax.prototype.update = function (modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken) { - if (this.modifiers === modifiers && this.moduleKeyword === moduleKeyword && this.name === name && this.stringLiteral === stringLiteral && this.openBraceToken === openBraceToken && this.moduleElements === moduleElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ModuleDeclarationSyntax(modifiers, moduleKeyword, name, stringLiteral, openBraceToken, moduleElements, closeBraceToken, this.parsedInStrictMode()); - }; - - ModuleDeclarationSyntax.create = function (moduleKeyword, openBraceToken, closeBraceToken) { - return new ModuleDeclarationSyntax(TypeScript.Syntax.emptyList, moduleKeyword, null, null, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - ModuleDeclarationSyntax.create1 = function () { - return new ModuleDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(65 /* ModuleKeyword */), null, null, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ModuleDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ModuleDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ModuleDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ModuleDeclarationSyntax.prototype.withModuleKeyword = function (moduleKeyword) { - return this.update(this.modifiers, moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withName = function (name) { - return this.update(this.modifiers, this.moduleKeyword, name, this.stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withStringLiteral = function (stringLiteral) { - return this.update(this.modifiers, this.moduleKeyword, this.name, stringLiteral, this.openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, openBraceToken, this.moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModuleElements = function (moduleElements) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, moduleElements, this.closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.withModuleElement = function (moduleElement) { - return this.withModuleElements(TypeScript.Syntax.list([moduleElement])); - }; - - ModuleDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.moduleKeyword, this.name, this.stringLiteral, this.openBraceToken, this.moduleElements, closeBraceToken); - }; - - ModuleDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ModuleDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ModuleDeclarationSyntax = ModuleDeclarationSyntax; - - var FunctionDeclarationSyntax = (function (_super) { - __extends(FunctionDeclarationSyntax, _super); - function FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.functionKeyword = functionKeyword; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - FunctionDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionDeclaration(this); - }; - - FunctionDeclarationSyntax.prototype.kind = function () { - return 129 /* FunctionDeclaration */; - }; - - FunctionDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - FunctionDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.functionKeyword; - case 2: - return this.identifier; - case 3: - return this.callSignature; - case 4: - return this.block; - case 5: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionDeclarationSyntax.prototype.isStatement = function () { - return true; - }; - - FunctionDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - FunctionDeclarationSyntax.prototype.update = function (modifiers, functionKeyword, identifier, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.functionKeyword === functionKeyword && this.identifier === identifier && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new FunctionDeclarationSyntax(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - FunctionDeclarationSyntax.create = function (functionKeyword, identifier, callSignature) { - return new FunctionDeclarationSyntax(TypeScript.Syntax.emptyList, functionKeyword, identifier, callSignature, null, null, false); - }; - - FunctionDeclarationSyntax.create1 = function (identifier) { - return new FunctionDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(27 /* FunctionKeyword */), identifier, CallSignatureSyntax.create1(), null, null, false); - }; - - FunctionDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.functionKeyword, this.identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - FunctionDeclarationSyntax.prototype.withFunctionKeyword = function (functionKeyword) { - return this.update(this.modifiers, functionKeyword, this.identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.functionKeyword, identifier, this.callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, callSignature, this.block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, this.callSignature, block, this.semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.functionKeyword, this.identifier, this.callSignature, this.block, semicolonToken); - }; - - FunctionDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block !== null && this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionDeclarationSyntax = FunctionDeclarationSyntax; - - var VariableStatementSyntax = (function (_super) { - __extends(VariableStatementSyntax, _super); - function VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.variableDeclaration = variableDeclaration; - this.semicolonToken = semicolonToken; - } - VariableStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableStatement(this); - }; - - VariableStatementSyntax.prototype.kind = function () { - return 148 /* VariableStatement */; - }; - - VariableStatementSyntax.prototype.childCount = function () { - return 3; - }; - - VariableStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.variableDeclaration; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableStatementSyntax.prototype.isStatement = function () { - return true; - }; - - VariableStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - VariableStatementSyntax.prototype.update = function (modifiers, variableDeclaration, semicolonToken) { - if (this.modifiers === modifiers && this.variableDeclaration === variableDeclaration && this.semicolonToken === semicolonToken) { - return this; - } - - return new VariableStatementSyntax(modifiers, variableDeclaration, semicolonToken, this.parsedInStrictMode()); - }; - - VariableStatementSyntax.create = function (variableDeclaration, semicolonToken) { - return new VariableStatementSyntax(TypeScript.Syntax.emptyList, variableDeclaration, semicolonToken, false); - }; - - VariableStatementSyntax.create1 = function (variableDeclaration) { - return new VariableStatementSyntax(TypeScript.Syntax.emptyList, variableDeclaration, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - VariableStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableStatementSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.variableDeclaration, this.semicolonToken); - }; - - VariableStatementSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - VariableStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.modifiers, variableDeclaration, this.semicolonToken); - }; - - VariableStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.variableDeclaration, semicolonToken); - }; - - VariableStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableStatementSyntax = VariableStatementSyntax; - - var VariableDeclarationSyntax = (function (_super) { - __extends(VariableDeclarationSyntax, _super); - function VariableDeclarationSyntax(varKeyword, variableDeclarators, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.varKeyword = varKeyword; - this.variableDeclarators = variableDeclarators; - } - VariableDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableDeclaration(this); - }; - - VariableDeclarationSyntax.prototype.kind = function () { - return 224 /* VariableDeclaration */; - }; - - VariableDeclarationSyntax.prototype.childCount = function () { - return 2; - }; - - VariableDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.varKeyword; - case 1: - return this.variableDeclarators; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableDeclarationSyntax.prototype.update = function (varKeyword, variableDeclarators) { - if (this.varKeyword === varKeyword && this.variableDeclarators === variableDeclarators) { - return this; - } - - return new VariableDeclarationSyntax(varKeyword, variableDeclarators, this.parsedInStrictMode()); - }; - - VariableDeclarationSyntax.create1 = function (variableDeclarators) { - return new VariableDeclarationSyntax(TypeScript.Syntax.token(40 /* VarKeyword */), variableDeclarators, false); - }; - - VariableDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableDeclarationSyntax.prototype.withVarKeyword = function (varKeyword) { - return this.update(varKeyword, this.variableDeclarators); - }; - - VariableDeclarationSyntax.prototype.withVariableDeclarators = function (variableDeclarators) { - return this.update(this.varKeyword, variableDeclarators); - }; - - VariableDeclarationSyntax.prototype.withVariableDeclarator = function (variableDeclarator) { - return this.withVariableDeclarators(TypeScript.Syntax.separatedList([variableDeclarator])); - }; - - VariableDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclarators.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableDeclarationSyntax = VariableDeclarationSyntax; - - var VariableDeclaratorSyntax = (function (_super) { - __extends(VariableDeclaratorSyntax, _super); - function VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - } - VariableDeclaratorSyntax.prototype.accept = function (visitor) { - return visitor.visitVariableDeclarator(this); - }; - - VariableDeclaratorSyntax.prototype.kind = function () { - return 225 /* VariableDeclarator */; - }; - - VariableDeclaratorSyntax.prototype.childCount = function () { - return 3; - }; - - VariableDeclaratorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.typeAnnotation; - case 2: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VariableDeclaratorSyntax.prototype.update = function (propertyName, typeAnnotation, equalsValueClause) { - if (this.propertyName === propertyName && this.typeAnnotation === typeAnnotation && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new VariableDeclaratorSyntax(propertyName, typeAnnotation, equalsValueClause, this.parsedInStrictMode()); - }; - - VariableDeclaratorSyntax.create = function (propertyName) { - return new VariableDeclaratorSyntax(propertyName, null, null, false); - }; - - VariableDeclaratorSyntax.create1 = function (propertyName) { - return new VariableDeclaratorSyntax(propertyName, null, null, false); - }; - - VariableDeclaratorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VariableDeclaratorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VariableDeclaratorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.typeAnnotation, this.equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.propertyName, typeAnnotation, this.equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.propertyName, this.typeAnnotation, equalsValueClause); - }; - - VariableDeclaratorSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeAnnotation !== null) { - return true; - } - if (this.equalsValueClause !== null && this.equalsValueClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VariableDeclaratorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VariableDeclaratorSyntax = VariableDeclaratorSyntax; - - var EqualsValueClauseSyntax = (function (_super) { - __extends(EqualsValueClauseSyntax, _super); - function EqualsValueClauseSyntax(equalsToken, value, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.equalsToken = equalsToken; - this.value = value; - } - EqualsValueClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitEqualsValueClause(this); - }; - - EqualsValueClauseSyntax.prototype.kind = function () { - return 232 /* EqualsValueClause */; - }; - - EqualsValueClauseSyntax.prototype.childCount = function () { - return 2; - }; - - EqualsValueClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.equalsToken; - case 1: - return this.value; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EqualsValueClauseSyntax.prototype.update = function (equalsToken, value) { - if (this.equalsToken === equalsToken && this.value === value) { - return this; - } - - return new EqualsValueClauseSyntax(equalsToken, value, this.parsedInStrictMode()); - }; - - EqualsValueClauseSyntax.create1 = function (value) { - return new EqualsValueClauseSyntax(TypeScript.Syntax.token(107 /* EqualsToken */), value, false); - }; - - EqualsValueClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EqualsValueClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EqualsValueClauseSyntax.prototype.withEqualsToken = function (equalsToken) { - return this.update(equalsToken, this.value); - }; - - EqualsValueClauseSyntax.prototype.withValue = function (value) { - return this.update(this.equalsToken, value); - }; - - EqualsValueClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.value.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return EqualsValueClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EqualsValueClauseSyntax = EqualsValueClauseSyntax; - - var PrefixUnaryExpressionSyntax = (function (_super) { - __extends(PrefixUnaryExpressionSyntax, _super); - function PrefixUnaryExpressionSyntax(kind, operatorToken, operand, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.operatorToken = operatorToken; - this.operand = operand; - - this._kind = kind; - } - PrefixUnaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitPrefixUnaryExpression(this); - }; - - PrefixUnaryExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - PrefixUnaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.operatorToken; - case 1: - return this.operand; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PrefixUnaryExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - PrefixUnaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - PrefixUnaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - PrefixUnaryExpressionSyntax.prototype.update = function (kind, operatorToken, operand) { - if (this._kind === kind && this.operatorToken === operatorToken && this.operand === operand) { - return this; - } - - return new PrefixUnaryExpressionSyntax(kind, operatorToken, operand, this.parsedInStrictMode()); - }; - - PrefixUnaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PrefixUnaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PrefixUnaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.operatorToken, this.operand); - }; - - PrefixUnaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, operatorToken, this.operand); - }; - - PrefixUnaryExpressionSyntax.prototype.withOperand = function (operand) { - return this.update(this._kind, this.operatorToken, operand); - }; - - PrefixUnaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.operand.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return PrefixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PrefixUnaryExpressionSyntax = PrefixUnaryExpressionSyntax; - - var ArrayLiteralExpressionSyntax = (function (_super) { - __extends(ArrayLiteralExpressionSyntax, _super); - function ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBracketToken = openBracketToken; - this.expressions = expressions; - this.closeBracketToken = closeBracketToken; - } - ArrayLiteralExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitArrayLiteralExpression(this); - }; - - ArrayLiteralExpressionSyntax.prototype.kind = function () { - return 214 /* ArrayLiteralExpression */; - }; - - ArrayLiteralExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ArrayLiteralExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBracketToken; - case 1: - return this.expressions; - case 2: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArrayLiteralExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ArrayLiteralExpressionSyntax.prototype.update = function (openBracketToken, expressions, closeBracketToken) { - if (this.openBracketToken === openBracketToken && this.expressions === expressions && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ArrayLiteralExpressionSyntax(openBracketToken, expressions, closeBracketToken, this.parsedInStrictMode()); - }; - - ArrayLiteralExpressionSyntax.create = function (openBracketToken, closeBracketToken) { - return new ArrayLiteralExpressionSyntax(openBracketToken, TypeScript.Syntax.emptySeparatedList, closeBracketToken, false); - }; - - ArrayLiteralExpressionSyntax.create1 = function () { - return new ArrayLiteralExpressionSyntax(TypeScript.Syntax.token(74 /* OpenBracketToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ArrayLiteralExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArrayLiteralExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArrayLiteralExpressionSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(openBracketToken, this.expressions, this.closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.withExpressions = function (expressions) { - return this.update(this.openBracketToken, expressions, this.closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.withExpression = function (expression) { - return this.withExpressions(TypeScript.Syntax.separatedList([expression])); - }; - - ArrayLiteralExpressionSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.openBracketToken, this.expressions, closeBracketToken); - }; - - ArrayLiteralExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expressions.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ArrayLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArrayLiteralExpressionSyntax = ArrayLiteralExpressionSyntax; - - var OmittedExpressionSyntax = (function (_super) { - __extends(OmittedExpressionSyntax, _super); - function OmittedExpressionSyntax(parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - } - OmittedExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitOmittedExpression(this); - }; - - OmittedExpressionSyntax.prototype.kind = function () { - return 223 /* OmittedExpression */; - }; - - OmittedExpressionSyntax.prototype.childCount = function () { - return 0; - }; - - OmittedExpressionSyntax.prototype.childAt = function (slot) { - throw TypeScript.Errors.invalidOperation(); - }; - - OmittedExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - OmittedExpressionSyntax.prototype.update = function () { - return this; - }; - - OmittedExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - OmittedExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - OmittedExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return OmittedExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.OmittedExpressionSyntax = OmittedExpressionSyntax; - - var ParenthesizedExpressionSyntax = (function (_super) { - __extends(ParenthesizedExpressionSyntax, _super); - function ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openParenToken = openParenToken; - this.expression = expression; - this.closeParenToken = closeParenToken; - } - ParenthesizedExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitParenthesizedExpression(this); - }; - - ParenthesizedExpressionSyntax.prototype.kind = function () { - return 217 /* ParenthesizedExpression */; - }; - - ParenthesizedExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ParenthesizedExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openParenToken; - case 1: - return this.expression; - case 2: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParenthesizedExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ParenthesizedExpressionSyntax.prototype.update = function (openParenToken, expression, closeParenToken) { - if (this.openParenToken === openParenToken && this.expression === expression && this.closeParenToken === closeParenToken) { - return this; - } - - return new ParenthesizedExpressionSyntax(openParenToken, expression, closeParenToken, this.parsedInStrictMode()); - }; - - ParenthesizedExpressionSyntax.create1 = function (expression) { - return new ParenthesizedExpressionSyntax(TypeScript.Syntax.token(72 /* OpenParenToken */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ParenthesizedExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParenthesizedExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParenthesizedExpressionSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(openParenToken, this.expression, this.closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.openParenToken, expression, this.closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.openParenToken, this.expression, closeParenToken); - }; - - ParenthesizedExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ParenthesizedExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParenthesizedExpressionSyntax = ParenthesizedExpressionSyntax; - - var SimpleArrowFunctionExpressionSyntax = (function (_super) { - __extends(SimpleArrowFunctionExpressionSyntax, _super); - function SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.block = block; - this.expression = expression; - } - SimpleArrowFunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitSimpleArrowFunctionExpression(this); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.kind = function () { - return 219 /* SimpleArrowFunctionExpression */; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.equalsGreaterThanToken; - case 2: - return this.block; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isArrowFunctionExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - SimpleArrowFunctionExpressionSyntax.prototype.update = function (identifier, equalsGreaterThanToken, block, expression) { - if (this.identifier === identifier && this.equalsGreaterThanToken === equalsGreaterThanToken && this.block === block && this.expression === expression) { - return this; - } - - return new SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, block, expression, this.parsedInStrictMode()); - }; - - SimpleArrowFunctionExpressionSyntax.create = function (identifier, equalsGreaterThanToken) { - return new SimpleArrowFunctionExpressionSyntax(identifier, equalsGreaterThanToken, null, null, false); - }; - - SimpleArrowFunctionExpressionSyntax.create1 = function (identifier) { - return new SimpleArrowFunctionExpressionSyntax(identifier, TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), null, null, false); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.equalsGreaterThanToken, this.block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.identifier, equalsGreaterThanToken, this.block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.identifier, this.equalsGreaterThanToken, block, this.expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.identifier, this.equalsGreaterThanToken, this.block, expression); - }; - - SimpleArrowFunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return SimpleArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SimpleArrowFunctionExpressionSyntax = SimpleArrowFunctionExpressionSyntax; - - var ParenthesizedArrowFunctionExpressionSyntax = (function (_super) { - __extends(ParenthesizedArrowFunctionExpressionSyntax, _super); - function ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.callSignature = callSignature; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.block = block; - this.expression = expression; - } - ParenthesizedArrowFunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitParenthesizedArrowFunctionExpression(this); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.kind = function () { - return 218 /* ParenthesizedArrowFunctionExpression */; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.callSignature; - case 1: - return this.equalsGreaterThanToken; - case 2: - return this.block; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isArrowFunctionExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.update = function (callSignature, equalsGreaterThanToken, block, expression) { - if (this.callSignature === callSignature && this.equalsGreaterThanToken === equalsGreaterThanToken && this.block === block && this.expression === expression) { - return this; - } - - return new ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, block, expression, this.parsedInStrictMode()); - }; - - ParenthesizedArrowFunctionExpressionSyntax.create = function (callSignature, equalsGreaterThanToken) { - return new ParenthesizedArrowFunctionExpressionSyntax(callSignature, equalsGreaterThanToken, null, null, false); - }; - - ParenthesizedArrowFunctionExpressionSyntax.create1 = function () { - return new ParenthesizedArrowFunctionExpressionSyntax(CallSignatureSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), null, null, false); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(callSignature, this.equalsGreaterThanToken, this.block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.callSignature, equalsGreaterThanToken, this.block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.callSignature, this.equalsGreaterThanToken, block, this.expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.callSignature, this.equalsGreaterThanToken, this.block, expression); - }; - - ParenthesizedArrowFunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ParenthesizedArrowFunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParenthesizedArrowFunctionExpressionSyntax = ParenthesizedArrowFunctionExpressionSyntax; - - var QualifiedNameSyntax = (function (_super) { - __extends(QualifiedNameSyntax, _super); - function QualifiedNameSyntax(left, dotToken, right, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.left = left; - this.dotToken = dotToken; - this.right = right; - } - QualifiedNameSyntax.prototype.accept = function (visitor) { - return visitor.visitQualifiedName(this); - }; - - QualifiedNameSyntax.prototype.kind = function () { - return 121 /* QualifiedName */; - }; - - QualifiedNameSyntax.prototype.childCount = function () { - return 3; - }; - - QualifiedNameSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.left; - case 1: - return this.dotToken; - case 2: - return this.right; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - QualifiedNameSyntax.prototype.isName = function () { - return true; - }; - - QualifiedNameSyntax.prototype.isType = function () { - return true; - }; - - QualifiedNameSyntax.prototype.update = function (left, dotToken, right) { - if (this.left === left && this.dotToken === dotToken && this.right === right) { - return this; - } - - return new QualifiedNameSyntax(left, dotToken, right, this.parsedInStrictMode()); - }; - - QualifiedNameSyntax.create1 = function (left, right) { - return new QualifiedNameSyntax(left, TypeScript.Syntax.token(76 /* DotToken */), right, false); - }; - - QualifiedNameSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - QualifiedNameSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - QualifiedNameSyntax.prototype.withLeft = function (left) { - return this.update(left, this.dotToken, this.right); - }; - - QualifiedNameSyntax.prototype.withDotToken = function (dotToken) { - return this.update(this.left, dotToken, this.right); - }; - - QualifiedNameSyntax.prototype.withRight = function (right) { - return this.update(this.left, this.dotToken, right); - }; - - QualifiedNameSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return QualifiedNameSyntax; - })(TypeScript.SyntaxNode); - TypeScript.QualifiedNameSyntax = QualifiedNameSyntax; - - var TypeArgumentListSyntax = (function (_super) { - __extends(TypeArgumentListSyntax, _super); - function TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.typeArguments = typeArguments; - this.greaterThanToken = greaterThanToken; - } - TypeArgumentListSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeArgumentList(this); - }; - - TypeArgumentListSyntax.prototype.kind = function () { - return 228 /* TypeArgumentList */; - }; - - TypeArgumentListSyntax.prototype.childCount = function () { - return 3; - }; - - TypeArgumentListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.typeArguments; - case 2: - return this.greaterThanToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeArgumentListSyntax.prototype.update = function (lessThanToken, typeArguments, greaterThanToken) { - if (this.lessThanToken === lessThanToken && this.typeArguments === typeArguments && this.greaterThanToken === greaterThanToken) { - return this; - } - - return new TypeArgumentListSyntax(lessThanToken, typeArguments, greaterThanToken, this.parsedInStrictMode()); - }; - - TypeArgumentListSyntax.create = function (lessThanToken, greaterThanToken) { - return new TypeArgumentListSyntax(lessThanToken, TypeScript.Syntax.emptySeparatedList, greaterThanToken, false); - }; - - TypeArgumentListSyntax.create1 = function () { - return new TypeArgumentListSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(81 /* GreaterThanToken */), false); - }; - - TypeArgumentListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeArgumentListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeArgumentListSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.typeArguments, this.greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.withTypeArguments = function (typeArguments) { - return this.update(this.lessThanToken, typeArguments, this.greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.withTypeArgument = function (typeArgument) { - return this.withTypeArguments(TypeScript.Syntax.separatedList([typeArgument])); - }; - - TypeArgumentListSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.typeArguments, greaterThanToken); - }; - - TypeArgumentListSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeArgumentListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeArgumentListSyntax = TypeArgumentListSyntax; - - var ConstructorTypeSyntax = (function (_super) { - __extends(ConstructorTypeSyntax, _super); - function ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.type = type; - } - ConstructorTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructorType(this); - }; - - ConstructorTypeSyntax.prototype.kind = function () { - return 125 /* ConstructorType */; - }; - - ConstructorTypeSyntax.prototype.childCount = function () { - return 5; - }; - - ConstructorTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.typeParameterList; - case 2: - return this.parameterList; - case 3: - return this.equalsGreaterThanToken; - case 4: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructorTypeSyntax.prototype.isType = function () { - return true; - }; - - ConstructorTypeSyntax.prototype.update = function (newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (this.newKeyword === newKeyword && this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.equalsGreaterThanToken === equalsGreaterThanToken && this.type === type) { - return this; - } - - return new ConstructorTypeSyntax(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type, this.parsedInStrictMode()); - }; - - ConstructorTypeSyntax.create = function (newKeyword, parameterList, equalsGreaterThanToken, type) { - return new ConstructorTypeSyntax(newKeyword, null, parameterList, equalsGreaterThanToken, type, false); - }; - - ConstructorTypeSyntax.create1 = function (type) { - return new ConstructorTypeSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), null, ParameterListSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), type, false); - }; - - ConstructorTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructorTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructorTypeSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(this.newKeyword, typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.newKeyword, this.typeParameterList, parameterList, this.equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.newKeyword, this.typeParameterList, this.parameterList, equalsGreaterThanToken, this.type); - }; - - ConstructorTypeSyntax.prototype.withType = function (type) { - return this.update(this.newKeyword, this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, type); - }; - - ConstructorTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructorTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructorTypeSyntax = ConstructorTypeSyntax; - - var FunctionTypeSyntax = (function (_super) { - __extends(FunctionTypeSyntax, _super); - function FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.equalsGreaterThanToken = equalsGreaterThanToken; - this.type = type; - } - FunctionTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionType(this); - }; - - FunctionTypeSyntax.prototype.kind = function () { - return 123 /* FunctionType */; - }; - - FunctionTypeSyntax.prototype.childCount = function () { - return 4; - }; - - FunctionTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeParameterList; - case 1: - return this.parameterList; - case 2: - return this.equalsGreaterThanToken; - case 3: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionTypeSyntax.prototype.isType = function () { - return true; - }; - - FunctionTypeSyntax.prototype.update = function (typeParameterList, parameterList, equalsGreaterThanToken, type) { - if (this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.equalsGreaterThanToken === equalsGreaterThanToken && this.type === type) { - return this; - } - - return new FunctionTypeSyntax(typeParameterList, parameterList, equalsGreaterThanToken, type, this.parsedInStrictMode()); - }; - - FunctionTypeSyntax.create = function (parameterList, equalsGreaterThanToken, type) { - return new FunctionTypeSyntax(null, parameterList, equalsGreaterThanToken, type, false); - }; - - FunctionTypeSyntax.create1 = function (type) { - return new FunctionTypeSyntax(null, ParameterListSyntax.create1(), TypeScript.Syntax.token(85 /* EqualsGreaterThanToken */), type, false); - }; - - FunctionTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionTypeSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(typeParameterList, this.parameterList, this.equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.typeParameterList, parameterList, this.equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withEqualsGreaterThanToken = function (equalsGreaterThanToken) { - return this.update(this.typeParameterList, this.parameterList, equalsGreaterThanToken, this.type); - }; - - FunctionTypeSyntax.prototype.withType = function (type) { - return this.update(this.typeParameterList, this.parameterList, this.equalsGreaterThanToken, type); - }; - - FunctionTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return FunctionTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionTypeSyntax = FunctionTypeSyntax; - - var ObjectTypeSyntax = (function (_super) { - __extends(ObjectTypeSyntax, _super); - function ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.typeMembers = typeMembers; - this.closeBraceToken = closeBraceToken; - } - ObjectTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectType(this); - }; - - ObjectTypeSyntax.prototype.kind = function () { - return 122 /* ObjectType */; - }; - - ObjectTypeSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.typeMembers; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectTypeSyntax.prototype.isType = function () { - return true; - }; - - ObjectTypeSyntax.prototype.update = function (openBraceToken, typeMembers, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.typeMembers === typeMembers && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ObjectTypeSyntax(openBraceToken, typeMembers, closeBraceToken, this.parsedInStrictMode()); - }; - - ObjectTypeSyntax.create = function (openBraceToken, closeBraceToken) { - return new ObjectTypeSyntax(openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - ObjectTypeSyntax.create1 = function () { - return new ObjectTypeSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ObjectTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectTypeSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.typeMembers, this.closeBraceToken); - }; - - ObjectTypeSyntax.prototype.withTypeMembers = function (typeMembers) { - return this.update(this.openBraceToken, typeMembers, this.closeBraceToken); - }; - - ObjectTypeSyntax.prototype.withTypeMember = function (typeMember) { - return this.withTypeMembers(TypeScript.Syntax.separatedList([typeMember])); - }; - - ObjectTypeSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.typeMembers, closeBraceToken); - }; - - ObjectTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ObjectTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectTypeSyntax = ObjectTypeSyntax; - - var ArrayTypeSyntax = (function (_super) { - __extends(ArrayTypeSyntax, _super); - function ArrayTypeSyntax(type, openBracketToken, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.type = type; - this.openBracketToken = openBracketToken; - this.closeBracketToken = closeBracketToken; - } - ArrayTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitArrayType(this); - }; - - ArrayTypeSyntax.prototype.kind = function () { - return 124 /* ArrayType */; - }; - - ArrayTypeSyntax.prototype.childCount = function () { - return 3; - }; - - ArrayTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.type; - case 1: - return this.openBracketToken; - case 2: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArrayTypeSyntax.prototype.isType = function () { - return true; - }; - - ArrayTypeSyntax.prototype.update = function (type, openBracketToken, closeBracketToken) { - if (this.type === type && this.openBracketToken === openBracketToken && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ArrayTypeSyntax(type, openBracketToken, closeBracketToken, this.parsedInStrictMode()); - }; - - ArrayTypeSyntax.create1 = function (type) { - return new ArrayTypeSyntax(type, TypeScript.Syntax.token(74 /* OpenBracketToken */), TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ArrayTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArrayTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArrayTypeSyntax.prototype.withType = function (type) { - return this.update(type, this.openBracketToken, this.closeBracketToken); - }; - - ArrayTypeSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(this.type, openBracketToken, this.closeBracketToken); - }; - - ArrayTypeSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.type, this.openBracketToken, closeBracketToken); - }; - - ArrayTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ArrayTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArrayTypeSyntax = ArrayTypeSyntax; - - var GenericTypeSyntax = (function (_super) { - __extends(GenericTypeSyntax, _super); - function GenericTypeSyntax(name, typeArgumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.name = name; - this.typeArgumentList = typeArgumentList; - } - GenericTypeSyntax.prototype.accept = function (visitor) { - return visitor.visitGenericType(this); - }; - - GenericTypeSyntax.prototype.kind = function () { - return 126 /* GenericType */; - }; - - GenericTypeSyntax.prototype.childCount = function () { - return 2; - }; - - GenericTypeSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.name; - case 1: - return this.typeArgumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - GenericTypeSyntax.prototype.isType = function () { - return true; - }; - - GenericTypeSyntax.prototype.update = function (name, typeArgumentList) { - if (this.name === name && this.typeArgumentList === typeArgumentList) { - return this; - } - - return new GenericTypeSyntax(name, typeArgumentList, this.parsedInStrictMode()); - }; - - GenericTypeSyntax.create1 = function (name) { - return new GenericTypeSyntax(name, TypeArgumentListSyntax.create1(), false); - }; - - GenericTypeSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - GenericTypeSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - GenericTypeSyntax.prototype.withName = function (name) { - return this.update(name, this.typeArgumentList); - }; - - GenericTypeSyntax.prototype.withTypeArgumentList = function (typeArgumentList) { - return this.update(this.name, typeArgumentList); - }; - - GenericTypeSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return GenericTypeSyntax; - })(TypeScript.SyntaxNode); - TypeScript.GenericTypeSyntax = GenericTypeSyntax; - - var TypeQuerySyntax = (function (_super) { - __extends(TypeQuerySyntax, _super); - function TypeQuerySyntax(typeOfKeyword, name, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeOfKeyword = typeOfKeyword; - this.name = name; - } - TypeQuerySyntax.prototype.accept = function (visitor) { - return visitor.visitTypeQuery(this); - }; - - TypeQuerySyntax.prototype.kind = function () { - return 127 /* TypeQuery */; - }; - - TypeQuerySyntax.prototype.childCount = function () { - return 2; - }; - - TypeQuerySyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeOfKeyword; - case 1: - return this.name; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeQuerySyntax.prototype.isType = function () { - return true; - }; - - TypeQuerySyntax.prototype.update = function (typeOfKeyword, name) { - if (this.typeOfKeyword === typeOfKeyword && this.name === name) { - return this; - } - - return new TypeQuerySyntax(typeOfKeyword, name, this.parsedInStrictMode()); - }; - - TypeQuerySyntax.create1 = function (name) { - return new TypeQuerySyntax(TypeScript.Syntax.token(39 /* TypeOfKeyword */), name, false); - }; - - TypeQuerySyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeQuerySyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeQuerySyntax.prototype.withTypeOfKeyword = function (typeOfKeyword) { - return this.update(typeOfKeyword, this.name); - }; - - TypeQuerySyntax.prototype.withName = function (name) { - return this.update(this.typeOfKeyword, name); - }; - - TypeQuerySyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeQuerySyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeQuerySyntax = TypeQuerySyntax; - - var TypeAnnotationSyntax = (function (_super) { - __extends(TypeAnnotationSyntax, _super); - function TypeAnnotationSyntax(colonToken, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.colonToken = colonToken; - this.type = type; - } - TypeAnnotationSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeAnnotation(this); - }; - - TypeAnnotationSyntax.prototype.kind = function () { - return 244 /* TypeAnnotation */; - }; - - TypeAnnotationSyntax.prototype.childCount = function () { - return 2; - }; - - TypeAnnotationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.colonToken; - case 1: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeAnnotationSyntax.prototype.update = function (colonToken, type) { - if (this.colonToken === colonToken && this.type === type) { - return this; - } - - return new TypeAnnotationSyntax(colonToken, type, this.parsedInStrictMode()); - }; - - TypeAnnotationSyntax.create1 = function (type) { - return new TypeAnnotationSyntax(TypeScript.Syntax.token(106 /* ColonToken */), type, false); - }; - - TypeAnnotationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeAnnotationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeAnnotationSyntax.prototype.withColonToken = function (colonToken) { - return this.update(colonToken, this.type); - }; - - TypeAnnotationSyntax.prototype.withType = function (type) { - return this.update(this.colonToken, type); - }; - - TypeAnnotationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeAnnotationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeAnnotationSyntax = TypeAnnotationSyntax; - - var BlockSyntax = (function (_super) { - __extends(BlockSyntax, _super); - function BlockSyntax(openBraceToken, statements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.statements = statements; - this.closeBraceToken = closeBraceToken; - } - BlockSyntax.prototype.accept = function (visitor) { - return visitor.visitBlock(this); - }; - - BlockSyntax.prototype.kind = function () { - return 146 /* Block */; - }; - - BlockSyntax.prototype.childCount = function () { - return 3; - }; - - BlockSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.statements; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BlockSyntax.prototype.isStatement = function () { - return true; - }; - - BlockSyntax.prototype.isModuleElement = function () { - return true; - }; - - BlockSyntax.prototype.update = function (openBraceToken, statements, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.statements === statements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new BlockSyntax(openBraceToken, statements, closeBraceToken, this.parsedInStrictMode()); - }; - - BlockSyntax.create = function (openBraceToken, closeBraceToken) { - return new BlockSyntax(openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - BlockSyntax.create1 = function () { - return new BlockSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - BlockSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BlockSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BlockSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.statements, this.closeBraceToken); - }; - - BlockSyntax.prototype.withStatements = function (statements) { - return this.update(this.openBraceToken, statements, this.closeBraceToken); - }; - - BlockSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - BlockSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.statements, closeBraceToken); - }; - - BlockSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return BlockSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BlockSyntax = BlockSyntax; - - var ParameterSyntax = (function (_super) { - __extends(ParameterSyntax, _super); - function ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.dotDotDotToken = dotDotDotToken; - this.modifiers = modifiers; - this.identifier = identifier; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - } - ParameterSyntax.prototype.accept = function (visitor) { - return visitor.visitParameter(this); - }; - - ParameterSyntax.prototype.kind = function () { - return 242 /* Parameter */; - }; - - ParameterSyntax.prototype.childCount = function () { - return 6; - }; - - ParameterSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.dotDotDotToken; - case 1: - return this.modifiers; - case 2: - return this.identifier; - case 3: - return this.questionToken; - case 4: - return this.typeAnnotation; - case 5: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParameterSyntax.prototype.update = function (dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - if (this.dotDotDotToken === dotDotDotToken && this.modifiers === modifiers && this.identifier === identifier && this.questionToken === questionToken && this.typeAnnotation === typeAnnotation && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new ParameterSyntax(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause, this.parsedInStrictMode()); - }; - - ParameterSyntax.create = function (identifier) { - return new ParameterSyntax(null, TypeScript.Syntax.emptyList, identifier, null, null, null, false); - }; - - ParameterSyntax.create1 = function (identifier) { - return new ParameterSyntax(null, TypeScript.Syntax.emptyList, identifier, null, null, null, false); - }; - - ParameterSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParameterSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParameterSyntax.prototype.withDotDotDotToken = function (dotDotDotToken) { - return this.update(dotDotDotToken, this.modifiers, this.identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withModifiers = function (modifiers) { - return this.update(this.dotDotDotToken, modifiers, this.identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ParameterSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.dotDotDotToken, this.modifiers, identifier, this.questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, questionToken, this.typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, this.questionToken, typeAnnotation, this.equalsValueClause); - }; - - ParameterSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.dotDotDotToken, this.modifiers, this.identifier, this.questionToken, this.typeAnnotation, equalsValueClause); - }; - - ParameterSyntax.prototype.isTypeScriptSpecific = function () { - if (this.dotDotDotToken !== null) { - return true; - } - if (this.modifiers.isTypeScriptSpecific()) { - return true; - } - if (this.questionToken !== null) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - if (this.equalsValueClause !== null) { - return true; - } - return false; - }; - return ParameterSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParameterSyntax = ParameterSyntax; - - var MemberAccessExpressionSyntax = (function (_super) { - __extends(MemberAccessExpressionSyntax, _super); - function MemberAccessExpressionSyntax(expression, dotToken, name, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.dotToken = dotToken; - this.name = name; - } - MemberAccessExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberAccessExpression(this); - }; - - MemberAccessExpressionSyntax.prototype.kind = function () { - return 212 /* MemberAccessExpression */; - }; - - MemberAccessExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - MemberAccessExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.dotToken; - case 2: - return this.name; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberAccessExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - MemberAccessExpressionSyntax.prototype.update = function (expression, dotToken, name) { - if (this.expression === expression && this.dotToken === dotToken && this.name === name) { - return this; - } - - return new MemberAccessExpressionSyntax(expression, dotToken, name, this.parsedInStrictMode()); - }; - - MemberAccessExpressionSyntax.create1 = function (expression, name) { - return new MemberAccessExpressionSyntax(expression, TypeScript.Syntax.token(76 /* DotToken */), name, false); - }; - - MemberAccessExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberAccessExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberAccessExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.dotToken, this.name); - }; - - MemberAccessExpressionSyntax.prototype.withDotToken = function (dotToken) { - return this.update(this.expression, dotToken, this.name); - }; - - MemberAccessExpressionSyntax.prototype.withName = function (name) { - return this.update(this.expression, this.dotToken, name); - }; - - MemberAccessExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return MemberAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberAccessExpressionSyntax = MemberAccessExpressionSyntax; - - var PostfixUnaryExpressionSyntax = (function (_super) { - __extends(PostfixUnaryExpressionSyntax, _super); - function PostfixUnaryExpressionSyntax(kind, operand, operatorToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.operand = operand; - this.operatorToken = operatorToken; - - this._kind = kind; - } - PostfixUnaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitPostfixUnaryExpression(this); - }; - - PostfixUnaryExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - PostfixUnaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.operand; - case 1: - return this.operatorToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PostfixUnaryExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - PostfixUnaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - PostfixUnaryExpressionSyntax.prototype.update = function (kind, operand, operatorToken) { - if (this._kind === kind && this.operand === operand && this.operatorToken === operatorToken) { - return this; - } - - return new PostfixUnaryExpressionSyntax(kind, operand, operatorToken, this.parsedInStrictMode()); - }; - - PostfixUnaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PostfixUnaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PostfixUnaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.operand, this.operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.withOperand = function (operand) { - return this.update(this._kind, operand, this.operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, this.operand, operatorToken); - }; - - PostfixUnaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.operand.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return PostfixUnaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PostfixUnaryExpressionSyntax = PostfixUnaryExpressionSyntax; - - var ElementAccessExpressionSyntax = (function (_super) { - __extends(ElementAccessExpressionSyntax, _super); - function ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.openBracketToken = openBracketToken; - this.argumentExpression = argumentExpression; - this.closeBracketToken = closeBracketToken; - } - ElementAccessExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitElementAccessExpression(this); - }; - - ElementAccessExpressionSyntax.prototype.kind = function () { - return 221 /* ElementAccessExpression */; - }; - - ElementAccessExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - ElementAccessExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.openBracketToken; - case 2: - return this.argumentExpression; - case 3: - return this.closeBracketToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ElementAccessExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ElementAccessExpressionSyntax.prototype.update = function (expression, openBracketToken, argumentExpression, closeBracketToken) { - if (this.expression === expression && this.openBracketToken === openBracketToken && this.argumentExpression === argumentExpression && this.closeBracketToken === closeBracketToken) { - return this; - } - - return new ElementAccessExpressionSyntax(expression, openBracketToken, argumentExpression, closeBracketToken, this.parsedInStrictMode()); - }; - - ElementAccessExpressionSyntax.create1 = function (expression, argumentExpression) { - return new ElementAccessExpressionSyntax(expression, TypeScript.Syntax.token(74 /* OpenBracketToken */), argumentExpression, TypeScript.Syntax.token(75 /* CloseBracketToken */), false); - }; - - ElementAccessExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ElementAccessExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ElementAccessExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.openBracketToken, this.argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(this.expression, openBracketToken, this.argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withArgumentExpression = function (argumentExpression) { - return this.update(this.expression, this.openBracketToken, argumentExpression, this.closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.expression, this.openBracketToken, this.argumentExpression, closeBracketToken); - }; - - ElementAccessExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentExpression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ElementAccessExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ElementAccessExpressionSyntax = ElementAccessExpressionSyntax; - - var InvocationExpressionSyntax = (function (_super) { - __extends(InvocationExpressionSyntax, _super); - function InvocationExpressionSyntax(expression, argumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.argumentList = argumentList; - } - InvocationExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitInvocationExpression(this); - }; - - InvocationExpressionSyntax.prototype.kind = function () { - return 213 /* InvocationExpression */; - }; - - InvocationExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - InvocationExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.argumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - InvocationExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - InvocationExpressionSyntax.prototype.update = function (expression, argumentList) { - if (this.expression === expression && this.argumentList === argumentList) { - return this; - } - - return new InvocationExpressionSyntax(expression, argumentList, this.parsedInStrictMode()); - }; - - InvocationExpressionSyntax.create1 = function (expression) { - return new InvocationExpressionSyntax(expression, ArgumentListSyntax.create1(), false); - }; - - InvocationExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - InvocationExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - InvocationExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.argumentList); - }; - - InvocationExpressionSyntax.prototype.withArgumentList = function (argumentList) { - return this.update(this.expression, argumentList); - }; - - InvocationExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentList.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return InvocationExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.InvocationExpressionSyntax = InvocationExpressionSyntax; - - var ArgumentListSyntax = (function (_super) { - __extends(ArgumentListSyntax, _super); - function ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeArgumentList = typeArgumentList; - this.openParenToken = openParenToken; - this.closeParenToken = closeParenToken; - - this.arguments = _arguments; - } - ArgumentListSyntax.prototype.accept = function (visitor) { - return visitor.visitArgumentList(this); - }; - - ArgumentListSyntax.prototype.kind = function () { - return 226 /* ArgumentList */; - }; - - ArgumentListSyntax.prototype.childCount = function () { - return 4; - }; - - ArgumentListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeArgumentList; - case 1: - return this.openParenToken; - case 2: - return this.arguments; - case 3: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ArgumentListSyntax.prototype.update = function (typeArgumentList, openParenToken, _arguments, closeParenToken) { - if (this.typeArgumentList === typeArgumentList && this.openParenToken === openParenToken && this.arguments === _arguments && this.closeParenToken === closeParenToken) { - return this; - } - - return new ArgumentListSyntax(typeArgumentList, openParenToken, _arguments, closeParenToken, this.parsedInStrictMode()); - }; - - ArgumentListSyntax.create = function (openParenToken, closeParenToken) { - return new ArgumentListSyntax(null, openParenToken, TypeScript.Syntax.emptySeparatedList, closeParenToken, false); - }; - - ArgumentListSyntax.create1 = function () { - return new ArgumentListSyntax(null, TypeScript.Syntax.token(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ArgumentListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ArgumentListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ArgumentListSyntax.prototype.withTypeArgumentList = function (typeArgumentList) { - return this.update(typeArgumentList, this.openParenToken, this.arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.typeArgumentList, openParenToken, this.arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withArguments = function (_arguments) { - return this.update(this.typeArgumentList, this.openParenToken, _arguments, this.closeParenToken); - }; - - ArgumentListSyntax.prototype.withArgument = function (_argument) { - return this.withArguments(TypeScript.Syntax.separatedList([_argument])); - }; - - ArgumentListSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.typeArgumentList, this.openParenToken, this.arguments, closeParenToken); - }; - - ArgumentListSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeArgumentList !== null && this.typeArgumentList.isTypeScriptSpecific()) { - return true; - } - if (this.arguments.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ArgumentListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ArgumentListSyntax = ArgumentListSyntax; - - var BinaryExpressionSyntax = (function (_super) { - __extends(BinaryExpressionSyntax, _super); - function BinaryExpressionSyntax(kind, left, operatorToken, right, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.left = left; - this.operatorToken = operatorToken; - this.right = right; - - this._kind = kind; - } - BinaryExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitBinaryExpression(this); - }; - - BinaryExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - BinaryExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.left; - case 1: - return this.operatorToken; - case 2: - return this.right; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BinaryExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - BinaryExpressionSyntax.prototype.kind = function () { - return this._kind; - }; - - BinaryExpressionSyntax.prototype.update = function (kind, left, operatorToken, right) { - if (this._kind === kind && this.left === left && this.operatorToken === operatorToken && this.right === right) { - return this; - } - - return new BinaryExpressionSyntax(kind, left, operatorToken, right, this.parsedInStrictMode()); - }; - - BinaryExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BinaryExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BinaryExpressionSyntax.prototype.withKind = function (kind) { - return this.update(kind, this.left, this.operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withLeft = function (left) { - return this.update(this._kind, left, this.operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withOperatorToken = function (operatorToken) { - return this.update(this._kind, this.left, operatorToken, this.right); - }; - - BinaryExpressionSyntax.prototype.withRight = function (right) { - return this.update(this._kind, this.left, this.operatorToken, right); - }; - - BinaryExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.left.isTypeScriptSpecific()) { - return true; - } - if (this.right.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return BinaryExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BinaryExpressionSyntax = BinaryExpressionSyntax; - - var ConditionalExpressionSyntax = (function (_super) { - __extends(ConditionalExpressionSyntax, _super); - function ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.condition = condition; - this.questionToken = questionToken; - this.whenTrue = whenTrue; - this.colonToken = colonToken; - this.whenFalse = whenFalse; - } - ConditionalExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitConditionalExpression(this); - }; - - ConditionalExpressionSyntax.prototype.kind = function () { - return 186 /* ConditionalExpression */; - }; - - ConditionalExpressionSyntax.prototype.childCount = function () { - return 5; - }; - - ConditionalExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.condition; - case 1: - return this.questionToken; - case 2: - return this.whenTrue; - case 3: - return this.colonToken; - case 4: - return this.whenFalse; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConditionalExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ConditionalExpressionSyntax.prototype.update = function (condition, questionToken, whenTrue, colonToken, whenFalse) { - if (this.condition === condition && this.questionToken === questionToken && this.whenTrue === whenTrue && this.colonToken === colonToken && this.whenFalse === whenFalse) { - return this; - } - - return new ConditionalExpressionSyntax(condition, questionToken, whenTrue, colonToken, whenFalse, this.parsedInStrictMode()); - }; - - ConditionalExpressionSyntax.create1 = function (condition, whenTrue, whenFalse) { - return new ConditionalExpressionSyntax(condition, TypeScript.Syntax.token(105 /* QuestionToken */), whenTrue, TypeScript.Syntax.token(106 /* ColonToken */), whenFalse, false); - }; - - ConditionalExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConditionalExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConditionalExpressionSyntax.prototype.withCondition = function (condition) { - return this.update(condition, this.questionToken, this.whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.condition, questionToken, this.whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withWhenTrue = function (whenTrue) { - return this.update(this.condition, this.questionToken, whenTrue, this.colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.condition, this.questionToken, this.whenTrue, colonToken, this.whenFalse); - }; - - ConditionalExpressionSyntax.prototype.withWhenFalse = function (whenFalse) { - return this.update(this.condition, this.questionToken, this.whenTrue, this.colonToken, whenFalse); - }; - - ConditionalExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.whenTrue.isTypeScriptSpecific()) { - return true; - } - if (this.whenFalse.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ConditionalExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConditionalExpressionSyntax = ConditionalExpressionSyntax; - - var ConstructSignatureSyntax = (function (_super) { - __extends(ConstructSignatureSyntax, _super); - function ConstructSignatureSyntax(newKeyword, callSignature, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.callSignature = callSignature; - } - ConstructSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructSignature(this); - }; - - ConstructSignatureSyntax.prototype.kind = function () { - return 143 /* ConstructSignature */; - }; - - ConstructSignatureSyntax.prototype.childCount = function () { - return 2; - }; - - ConstructSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.callSignature; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - ConstructSignatureSyntax.prototype.update = function (newKeyword, callSignature) { - if (this.newKeyword === newKeyword && this.callSignature === callSignature) { - return this; - } - - return new ConstructSignatureSyntax(newKeyword, callSignature, this.parsedInStrictMode()); - }; - - ConstructSignatureSyntax.create1 = function () { - return new ConstructSignatureSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), CallSignatureSyntax.create1(), false); - }; - - ConstructSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructSignatureSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.callSignature); - }; - - ConstructSignatureSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.newKeyword, callSignature); - }; - - ConstructSignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructSignatureSyntax = ConstructSignatureSyntax; - - var MethodSignatureSyntax = (function (_super) { - __extends(MethodSignatureSyntax, _super); - function MethodSignatureSyntax(propertyName, questionToken, callSignature, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.callSignature = callSignature; - } - MethodSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitMethodSignature(this); - }; - - MethodSignatureSyntax.prototype.kind = function () { - return 145 /* MethodSignature */; - }; - - MethodSignatureSyntax.prototype.childCount = function () { - return 3; - }; - - MethodSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.questionToken; - case 2: - return this.callSignature; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MethodSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - MethodSignatureSyntax.prototype.update = function (propertyName, questionToken, callSignature) { - if (this.propertyName === propertyName && this.questionToken === questionToken && this.callSignature === callSignature) { - return this; - } - - return new MethodSignatureSyntax(propertyName, questionToken, callSignature, this.parsedInStrictMode()); - }; - - MethodSignatureSyntax.create = function (propertyName, callSignature) { - return new MethodSignatureSyntax(propertyName, null, callSignature, false); - }; - - MethodSignatureSyntax.create1 = function (propertyName) { - return new MethodSignatureSyntax(propertyName, null, CallSignatureSyntax.create1(), false); - }; - - MethodSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MethodSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MethodSignatureSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.questionToken, this.callSignature); - }; - - MethodSignatureSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.propertyName, questionToken, this.callSignature); - }; - - MethodSignatureSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.propertyName, this.questionToken, callSignature); - }; - - MethodSignatureSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return MethodSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MethodSignatureSyntax = MethodSignatureSyntax; - - var IndexSignatureSyntax = (function (_super) { - __extends(IndexSignatureSyntax, _super); - function IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBracketToken = openBracketToken; - this.parameter = parameter; - this.closeBracketToken = closeBracketToken; - this.typeAnnotation = typeAnnotation; - } - IndexSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitIndexSignature(this); - }; - - IndexSignatureSyntax.prototype.kind = function () { - return 144 /* IndexSignature */; - }; - - IndexSignatureSyntax.prototype.childCount = function () { - return 4; - }; - - IndexSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBracketToken; - case 1: - return this.parameter; - case 2: - return this.closeBracketToken; - case 3: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IndexSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - IndexSignatureSyntax.prototype.update = function (openBracketToken, parameter, closeBracketToken, typeAnnotation) { - if (this.openBracketToken === openBracketToken && this.parameter === parameter && this.closeBracketToken === closeBracketToken && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, typeAnnotation, this.parsedInStrictMode()); - }; - - IndexSignatureSyntax.create = function (openBracketToken, parameter, closeBracketToken) { - return new IndexSignatureSyntax(openBracketToken, parameter, closeBracketToken, null, false); - }; - - IndexSignatureSyntax.create1 = function (parameter) { - return new IndexSignatureSyntax(TypeScript.Syntax.token(74 /* OpenBracketToken */), parameter, TypeScript.Syntax.token(75 /* CloseBracketToken */), null, false); - }; - - IndexSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IndexSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IndexSignatureSyntax.prototype.withOpenBracketToken = function (openBracketToken) { - return this.update(openBracketToken, this.parameter, this.closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withParameter = function (parameter) { - return this.update(this.openBracketToken, parameter, this.closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withCloseBracketToken = function (closeBracketToken) { - return this.update(this.openBracketToken, this.parameter, closeBracketToken, this.typeAnnotation); - }; - - IndexSignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.openBracketToken, this.parameter, this.closeBracketToken, typeAnnotation); - }; - - IndexSignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return IndexSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IndexSignatureSyntax = IndexSignatureSyntax; - - var PropertySignatureSyntax = (function (_super) { - __extends(PropertySignatureSyntax, _super); - function PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - } - PropertySignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitPropertySignature(this); - }; - - PropertySignatureSyntax.prototype.kind = function () { - return 141 /* PropertySignature */; - }; - - PropertySignatureSyntax.prototype.childCount = function () { - return 3; - }; - - PropertySignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.questionToken; - case 2: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - PropertySignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - PropertySignatureSyntax.prototype.update = function (propertyName, questionToken, typeAnnotation) { - if (this.propertyName === propertyName && this.questionToken === questionToken && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new PropertySignatureSyntax(propertyName, questionToken, typeAnnotation, this.parsedInStrictMode()); - }; - - PropertySignatureSyntax.create = function (propertyName) { - return new PropertySignatureSyntax(propertyName, null, null, false); - }; - - PropertySignatureSyntax.create1 = function (propertyName) { - return new PropertySignatureSyntax(propertyName, null, null, false); - }; - - PropertySignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - PropertySignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - PropertySignatureSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.questionToken, this.typeAnnotation); - }; - - PropertySignatureSyntax.prototype.withQuestionToken = function (questionToken) { - return this.update(this.propertyName, questionToken, this.typeAnnotation); - }; - - PropertySignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.propertyName, this.questionToken, typeAnnotation); - }; - - PropertySignatureSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return PropertySignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.PropertySignatureSyntax = PropertySignatureSyntax; - - var CallSignatureSyntax = (function (_super) { - __extends(CallSignatureSyntax, _super); - function CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - } - CallSignatureSyntax.prototype.accept = function (visitor) { - return visitor.visitCallSignature(this); - }; - - CallSignatureSyntax.prototype.kind = function () { - return 142 /* CallSignature */; - }; - - CallSignatureSyntax.prototype.childCount = function () { - return 3; - }; - - CallSignatureSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeParameterList; - case 1: - return this.parameterList; - case 2: - return this.typeAnnotation; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CallSignatureSyntax.prototype.isTypeMember = function () { - return true; - }; - - CallSignatureSyntax.prototype.update = function (typeParameterList, parameterList, typeAnnotation) { - if (this.typeParameterList === typeParameterList && this.parameterList === parameterList && this.typeAnnotation === typeAnnotation) { - return this; - } - - return new CallSignatureSyntax(typeParameterList, parameterList, typeAnnotation, this.parsedInStrictMode()); - }; - - CallSignatureSyntax.create = function (parameterList) { - return new CallSignatureSyntax(null, parameterList, null, false); - }; - - CallSignatureSyntax.create1 = function () { - return new CallSignatureSyntax(null, ParameterListSyntax.create1(), null, false); - }; - - CallSignatureSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CallSignatureSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CallSignatureSyntax.prototype.withTypeParameterList = function (typeParameterList) { - return this.update(typeParameterList, this.parameterList, this.typeAnnotation); - }; - - CallSignatureSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.typeParameterList, parameterList, this.typeAnnotation); - }; - - CallSignatureSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.typeParameterList, this.parameterList, typeAnnotation); - }; - - CallSignatureSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeParameterList !== null) { - return true; - } - if (this.parameterList.isTypeScriptSpecific()) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - return false; - }; - return CallSignatureSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CallSignatureSyntax = CallSignatureSyntax; - - var ParameterListSyntax = (function (_super) { - __extends(ParameterListSyntax, _super); - function ParameterListSyntax(openParenToken, parameters, closeParenToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openParenToken = openParenToken; - this.parameters = parameters; - this.closeParenToken = closeParenToken; - } - ParameterListSyntax.prototype.accept = function (visitor) { - return visitor.visitParameterList(this); - }; - - ParameterListSyntax.prototype.kind = function () { - return 227 /* ParameterList */; - }; - - ParameterListSyntax.prototype.childCount = function () { - return 3; - }; - - ParameterListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openParenToken; - case 1: - return this.parameters; - case 2: - return this.closeParenToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParameterListSyntax.prototype.update = function (openParenToken, parameters, closeParenToken) { - if (this.openParenToken === openParenToken && this.parameters === parameters && this.closeParenToken === closeParenToken) { - return this; - } - - return new ParameterListSyntax(openParenToken, parameters, closeParenToken, this.parsedInStrictMode()); - }; - - ParameterListSyntax.create = function (openParenToken, closeParenToken) { - return new ParameterListSyntax(openParenToken, TypeScript.Syntax.emptySeparatedList, closeParenToken, false); - }; - - ParameterListSyntax.create1 = function () { - return new ParameterListSyntax(TypeScript.Syntax.token(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(73 /* CloseParenToken */), false); - }; - - ParameterListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ParameterListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ParameterListSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(openParenToken, this.parameters, this.closeParenToken); - }; - - ParameterListSyntax.prototype.withParameters = function (parameters) { - return this.update(this.openParenToken, parameters, this.closeParenToken); - }; - - ParameterListSyntax.prototype.withParameter = function (parameter) { - return this.withParameters(TypeScript.Syntax.separatedList([parameter])); - }; - - ParameterListSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.openParenToken, this.parameters, closeParenToken); - }; - - ParameterListSyntax.prototype.isTypeScriptSpecific = function () { - if (this.parameters.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ParameterListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ParameterListSyntax = ParameterListSyntax; - - var TypeParameterListSyntax = (function (_super) { - __extends(TypeParameterListSyntax, _super); - function TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.typeParameters = typeParameters; - this.greaterThanToken = greaterThanToken; - } - TypeParameterListSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeParameterList(this); - }; - - TypeParameterListSyntax.prototype.kind = function () { - return 229 /* TypeParameterList */; - }; - - TypeParameterListSyntax.prototype.childCount = function () { - return 3; - }; - - TypeParameterListSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.typeParameters; - case 2: - return this.greaterThanToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeParameterListSyntax.prototype.update = function (lessThanToken, typeParameters, greaterThanToken) { - if (this.lessThanToken === lessThanToken && this.typeParameters === typeParameters && this.greaterThanToken === greaterThanToken) { - return this; - } - - return new TypeParameterListSyntax(lessThanToken, typeParameters, greaterThanToken, this.parsedInStrictMode()); - }; - - TypeParameterListSyntax.create = function (lessThanToken, greaterThanToken) { - return new TypeParameterListSyntax(lessThanToken, TypeScript.Syntax.emptySeparatedList, greaterThanToken, false); - }; - - TypeParameterListSyntax.create1 = function () { - return new TypeParameterListSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(81 /* GreaterThanToken */), false); - }; - - TypeParameterListSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeParameterListSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeParameterListSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.typeParameters, this.greaterThanToken); - }; - - TypeParameterListSyntax.prototype.withTypeParameters = function (typeParameters) { - return this.update(this.lessThanToken, typeParameters, this.greaterThanToken); - }; - - TypeParameterListSyntax.prototype.withTypeParameter = function (typeParameter) { - return this.withTypeParameters(TypeScript.Syntax.separatedList([typeParameter])); - }; - - TypeParameterListSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.typeParameters, greaterThanToken); - }; - - TypeParameterListSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeParameterListSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeParameterListSyntax = TypeParameterListSyntax; - - var TypeParameterSyntax = (function (_super) { - __extends(TypeParameterSyntax, _super); - function TypeParameterSyntax(identifier, constraint, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.constraint = constraint; - } - TypeParameterSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeParameter(this); - }; - - TypeParameterSyntax.prototype.kind = function () { - return 238 /* TypeParameter */; - }; - - TypeParameterSyntax.prototype.childCount = function () { - return 2; - }; - - TypeParameterSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.constraint; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeParameterSyntax.prototype.update = function (identifier, constraint) { - if (this.identifier === identifier && this.constraint === constraint) { - return this; - } - - return new TypeParameterSyntax(identifier, constraint, this.parsedInStrictMode()); - }; - - TypeParameterSyntax.create = function (identifier) { - return new TypeParameterSyntax(identifier, null, false); - }; - - TypeParameterSyntax.create1 = function (identifier) { - return new TypeParameterSyntax(identifier, null, false); - }; - - TypeParameterSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeParameterSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeParameterSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.constraint); - }; - - TypeParameterSyntax.prototype.withConstraint = function (constraint) { - return this.update(this.identifier, constraint); - }; - - TypeParameterSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return TypeParameterSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeParameterSyntax = TypeParameterSyntax; - - var ConstraintSyntax = (function (_super) { - __extends(ConstraintSyntax, _super); - function ConstraintSyntax(extendsKeyword, type, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.extendsKeyword = extendsKeyword; - this.type = type; - } - ConstraintSyntax.prototype.accept = function (visitor) { - return visitor.visitConstraint(this); - }; - - ConstraintSyntax.prototype.kind = function () { - return 239 /* Constraint */; - }; - - ConstraintSyntax.prototype.childCount = function () { - return 2; - }; - - ConstraintSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.extendsKeyword; - case 1: - return this.type; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstraintSyntax.prototype.update = function (extendsKeyword, type) { - if (this.extendsKeyword === extendsKeyword && this.type === type) { - return this; - } - - return new ConstraintSyntax(extendsKeyword, type, this.parsedInStrictMode()); - }; - - ConstraintSyntax.create1 = function (type) { - return new ConstraintSyntax(TypeScript.Syntax.token(48 /* ExtendsKeyword */), type, false); - }; - - ConstraintSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstraintSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstraintSyntax.prototype.withExtendsKeyword = function (extendsKeyword) { - return this.update(extendsKeyword, this.type); - }; - - ConstraintSyntax.prototype.withType = function (type) { - return this.update(this.extendsKeyword, type); - }; - - ConstraintSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstraintSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstraintSyntax = ConstraintSyntax; - - var ElseClauseSyntax = (function (_super) { - __extends(ElseClauseSyntax, _super); - function ElseClauseSyntax(elseKeyword, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.elseKeyword = elseKeyword; - this.statement = statement; - } - ElseClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitElseClause(this); - }; - - ElseClauseSyntax.prototype.kind = function () { - return 235 /* ElseClause */; - }; - - ElseClauseSyntax.prototype.childCount = function () { - return 2; - }; - - ElseClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.elseKeyword; - case 1: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ElseClauseSyntax.prototype.update = function (elseKeyword, statement) { - if (this.elseKeyword === elseKeyword && this.statement === statement) { - return this; - } - - return new ElseClauseSyntax(elseKeyword, statement, this.parsedInStrictMode()); - }; - - ElseClauseSyntax.create1 = function (statement) { - return new ElseClauseSyntax(TypeScript.Syntax.token(23 /* ElseKeyword */), statement, false); - }; - - ElseClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ElseClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ElseClauseSyntax.prototype.withElseKeyword = function (elseKeyword) { - return this.update(elseKeyword, this.statement); - }; - - ElseClauseSyntax.prototype.withStatement = function (statement) { - return this.update(this.elseKeyword, statement); - }; - - ElseClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ElseClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ElseClauseSyntax = ElseClauseSyntax; - - var IfStatementSyntax = (function (_super) { - __extends(IfStatementSyntax, _super); - function IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.ifKeyword = ifKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - this.elseClause = elseClause; - } - IfStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitIfStatement(this); - }; - - IfStatementSyntax.prototype.kind = function () { - return 147 /* IfStatement */; - }; - - IfStatementSyntax.prototype.childCount = function () { - return 6; - }; - - IfStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.ifKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - case 5: - return this.elseClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IfStatementSyntax.prototype.isStatement = function () { - return true; - }; - - IfStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - IfStatementSyntax.prototype.update = function (ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause) { - if (this.ifKeyword === ifKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement && this.elseClause === elseClause) { - return this; - } - - return new IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause, this.parsedInStrictMode()); - }; - - IfStatementSyntax.create = function (ifKeyword, openParenToken, condition, closeParenToken, statement) { - return new IfStatementSyntax(ifKeyword, openParenToken, condition, closeParenToken, statement, null, false); - }; - - IfStatementSyntax.create1 = function (condition, statement) { - return new IfStatementSyntax(TypeScript.Syntax.token(28 /* IfKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, null, false); - }; - - IfStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IfStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IfStatementSyntax.prototype.withIfKeyword = function (ifKeyword) { - return this.update(ifKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.ifKeyword, openParenToken, this.condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.ifKeyword, this.openParenToken, condition, this.closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, closeParenToken, this.statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, this.closeParenToken, statement, this.elseClause); - }; - - IfStatementSyntax.prototype.withElseClause = function (elseClause) { - return this.update(this.ifKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement, elseClause); - }; - - IfStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - if (this.elseClause !== null && this.elseClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return IfStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IfStatementSyntax = IfStatementSyntax; - - var ExpressionStatementSyntax = (function (_super) { - __extends(ExpressionStatementSyntax, _super); - function ExpressionStatementSyntax(expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ExpressionStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitExpressionStatement(this); - }; - - ExpressionStatementSyntax.prototype.kind = function () { - return 149 /* ExpressionStatement */; - }; - - ExpressionStatementSyntax.prototype.childCount = function () { - return 2; - }; - - ExpressionStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.expression; - case 1: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ExpressionStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ExpressionStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ExpressionStatementSyntax.prototype.update = function (expression, semicolonToken) { - if (this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ExpressionStatementSyntax(expression, semicolonToken, this.parsedInStrictMode()); - }; - - ExpressionStatementSyntax.create1 = function (expression) { - return new ExpressionStatementSyntax(expression, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ExpressionStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ExpressionStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ExpressionStatementSyntax.prototype.withExpression = function (expression) { - return this.update(expression, this.semicolonToken); - }; - - ExpressionStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.expression, semicolonToken); - }; - - ExpressionStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ExpressionStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ExpressionStatementSyntax = ExpressionStatementSyntax; - - var ConstructorDeclarationSyntax = (function (_super) { - __extends(ConstructorDeclarationSyntax, _super); - function ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.constructorKeyword = constructorKeyword; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - ConstructorDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitConstructorDeclaration(this); - }; - - ConstructorDeclarationSyntax.prototype.kind = function () { - return 137 /* ConstructorDeclaration */; - }; - - ConstructorDeclarationSyntax.prototype.childCount = function () { - return 5; - }; - - ConstructorDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.constructorKeyword; - case 2: - return this.callSignature; - case 3: - return this.block; - case 4: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ConstructorDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - ConstructorDeclarationSyntax.prototype.update = function (modifiers, constructorKeyword, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.constructorKeyword === constructorKeyword && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new ConstructorDeclarationSyntax(modifiers, constructorKeyword, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - ConstructorDeclarationSyntax.create = function (constructorKeyword, callSignature) { - return new ConstructorDeclarationSyntax(TypeScript.Syntax.emptyList, constructorKeyword, callSignature, null, null, false); - }; - - ConstructorDeclarationSyntax.create1 = function () { - return new ConstructorDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(62 /* ConstructorKeyword */), CallSignatureSyntax.create1(), null, null, false); - }; - - ConstructorDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ConstructorDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ConstructorDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.constructorKeyword, this.callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - ConstructorDeclarationSyntax.prototype.withConstructorKeyword = function (constructorKeyword) { - return this.update(this.modifiers, constructorKeyword, this.callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.constructorKeyword, callSignature, this.block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.constructorKeyword, this.callSignature, block, this.semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.constructorKeyword, this.callSignature, this.block, semicolonToken); - }; - - ConstructorDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return ConstructorDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ConstructorDeclarationSyntax = ConstructorDeclarationSyntax; - - var MemberFunctionDeclarationSyntax = (function (_super) { - __extends(MemberFunctionDeclarationSyntax, _super); - function MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - this.semicolonToken = semicolonToken; - } - MemberFunctionDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberFunctionDeclaration(this); - }; - - MemberFunctionDeclarationSyntax.prototype.kind = function () { - return 135 /* MemberFunctionDeclaration */; - }; - - MemberFunctionDeclarationSyntax.prototype.childCount = function () { - return 5; - }; - - MemberFunctionDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.propertyName; - case 2: - return this.callSignature; - case 3: - return this.block; - case 4: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberFunctionDeclarationSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - MemberFunctionDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - MemberFunctionDeclarationSyntax.prototype.update = function (modifiers, propertyName, callSignature, block, semicolonToken) { - if (this.modifiers === modifiers && this.propertyName === propertyName && this.callSignature === callSignature && this.block === block && this.semicolonToken === semicolonToken) { - return this; - } - - return new MemberFunctionDeclarationSyntax(modifiers, propertyName, callSignature, block, semicolonToken, this.parsedInStrictMode()); - }; - - MemberFunctionDeclarationSyntax.create = function (propertyName, callSignature) { - return new MemberFunctionDeclarationSyntax(TypeScript.Syntax.emptyList, propertyName, callSignature, null, null, false); - }; - - MemberFunctionDeclarationSyntax.create1 = function (propertyName) { - return new MemberFunctionDeclarationSyntax(TypeScript.Syntax.emptyList, propertyName, CallSignatureSyntax.create1(), null, null, false); - }; - - MemberFunctionDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberFunctionDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberFunctionDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.propertyName, this.callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - MemberFunctionDeclarationSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, propertyName, this.callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.modifiers, this.propertyName, callSignature, this.block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.propertyName, this.callSignature, block, this.semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.propertyName, this.callSignature, this.block, semicolonToken); - }; - - MemberFunctionDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return MemberFunctionDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberFunctionDeclarationSyntax = MemberFunctionDeclarationSyntax; - - var GetAccessorSyntax = (function (_super) { - __extends(GetAccessorSyntax, _super); - function GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.getKeyword = getKeyword; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - this.block = block; - } - GetAccessorSyntax.prototype.accept = function (visitor) { - return visitor.visitGetAccessor(this); - }; - - GetAccessorSyntax.prototype.kind = function () { - return 139 /* GetAccessor */; - }; - - GetAccessorSyntax.prototype.childCount = function () { - return 6; - }; - - GetAccessorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.getKeyword; - case 2: - return this.propertyName; - case 3: - return this.parameterList; - case 4: - return this.typeAnnotation; - case 5: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - GetAccessorSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - GetAccessorSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - GetAccessorSyntax.prototype.isClassElement = function () { - return true; - }; - - GetAccessorSyntax.prototype.update = function (modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block) { - if (this.modifiers === modifiers && this.getKeyword === getKeyword && this.propertyName === propertyName && this.parameterList === parameterList && this.typeAnnotation === typeAnnotation && this.block === block) { - return this; - } - - return new GetAccessorSyntax(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block, this.parsedInStrictMode()); - }; - - GetAccessorSyntax.create = function (getKeyword, propertyName, parameterList, block) { - return new GetAccessorSyntax(TypeScript.Syntax.emptyList, getKeyword, propertyName, parameterList, null, block, false); - }; - - GetAccessorSyntax.create1 = function (propertyName) { - return new GetAccessorSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(64 /* GetKeyword */), propertyName, ParameterListSyntax.create1(), null, BlockSyntax.create1(), false); - }; - - GetAccessorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - GetAccessorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - GetAccessorSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - GetAccessorSyntax.prototype.withGetKeyword = function (getKeyword) { - return this.update(this.modifiers, getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, this.getKeyword, propertyName, this.parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, parameterList, this.typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, this.parameterList, typeAnnotation, this.block); - }; - - GetAccessorSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.getKeyword, this.propertyName, this.parameterList, this.typeAnnotation, block); - }; - - GetAccessorSyntax.prototype.isTypeScriptSpecific = function () { - if (this.modifiers.childCount() > 0) { - return true; - } - if (this.parameterList.isTypeScriptSpecific()) { - return true; - } - if (this.typeAnnotation !== null) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return GetAccessorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.GetAccessorSyntax = GetAccessorSyntax; - - var SetAccessorSyntax = (function (_super) { - __extends(SetAccessorSyntax, _super); - function SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.setKeyword = setKeyword; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.block = block; - } - SetAccessorSyntax.prototype.accept = function (visitor) { - return visitor.visitSetAccessor(this); - }; - - SetAccessorSyntax.prototype.kind = function () { - return 140 /* SetAccessor */; - }; - - SetAccessorSyntax.prototype.childCount = function () { - return 5; - }; - - SetAccessorSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.setKeyword; - case 2: - return this.propertyName; - case 3: - return this.parameterList; - case 4: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SetAccessorSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - SetAccessorSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - SetAccessorSyntax.prototype.isClassElement = function () { - return true; - }; - - SetAccessorSyntax.prototype.update = function (modifiers, setKeyword, propertyName, parameterList, block) { - if (this.modifiers === modifiers && this.setKeyword === setKeyword && this.propertyName === propertyName && this.parameterList === parameterList && this.block === block) { - return this; - } - - return new SetAccessorSyntax(modifiers, setKeyword, propertyName, parameterList, block, this.parsedInStrictMode()); - }; - - SetAccessorSyntax.create = function (setKeyword, propertyName, parameterList, block) { - return new SetAccessorSyntax(TypeScript.Syntax.emptyList, setKeyword, propertyName, parameterList, block, false); - }; - - SetAccessorSyntax.create1 = function (propertyName) { - return new SetAccessorSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(68 /* SetKeyword */), propertyName, ParameterListSyntax.create1(), BlockSyntax.create1(), false); - }; - - SetAccessorSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SetAccessorSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SetAccessorSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.setKeyword, this.propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - SetAccessorSyntax.prototype.withSetKeyword = function (setKeyword) { - return this.update(this.modifiers, setKeyword, this.propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(this.modifiers, this.setKeyword, propertyName, this.parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withParameterList = function (parameterList) { - return this.update(this.modifiers, this.setKeyword, this.propertyName, parameterList, this.block); - }; - - SetAccessorSyntax.prototype.withBlock = function (block) { - return this.update(this.modifiers, this.setKeyword, this.propertyName, this.parameterList, block); - }; - - SetAccessorSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return SetAccessorSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SetAccessorSyntax = SetAccessorSyntax; - - var MemberVariableDeclarationSyntax = (function (_super) { - __extends(MemberVariableDeclarationSyntax, _super); - function MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.variableDeclarator = variableDeclarator; - this.semicolonToken = semicolonToken; - } - MemberVariableDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitMemberVariableDeclaration(this); - }; - - MemberVariableDeclarationSyntax.prototype.kind = function () { - return 136 /* MemberVariableDeclaration */; - }; - - MemberVariableDeclarationSyntax.prototype.childCount = function () { - return 3; - }; - - MemberVariableDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.variableDeclarator; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - MemberVariableDeclarationSyntax.prototype.isMemberDeclaration = function () { - return true; - }; - - MemberVariableDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - MemberVariableDeclarationSyntax.prototype.update = function (modifiers, variableDeclarator, semicolonToken) { - if (this.modifiers === modifiers && this.variableDeclarator === variableDeclarator && this.semicolonToken === semicolonToken) { - return this; - } - - return new MemberVariableDeclarationSyntax(modifiers, variableDeclarator, semicolonToken, this.parsedInStrictMode()); - }; - - MemberVariableDeclarationSyntax.create = function (variableDeclarator, semicolonToken) { - return new MemberVariableDeclarationSyntax(TypeScript.Syntax.emptyList, variableDeclarator, semicolonToken, false); - }; - - MemberVariableDeclarationSyntax.create1 = function (variableDeclarator) { - return new MemberVariableDeclarationSyntax(TypeScript.Syntax.emptyList, variableDeclarator, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - MemberVariableDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - MemberVariableDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - MemberVariableDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.variableDeclarator, this.semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - MemberVariableDeclarationSyntax.prototype.withVariableDeclarator = function (variableDeclarator) { - return this.update(this.modifiers, variableDeclarator, this.semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.variableDeclarator, semicolonToken); - }; - - MemberVariableDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return MemberVariableDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.MemberVariableDeclarationSyntax = MemberVariableDeclarationSyntax; - - var IndexMemberDeclarationSyntax = (function (_super) { - __extends(IndexMemberDeclarationSyntax, _super); - function IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.indexSignature = indexSignature; - this.semicolonToken = semicolonToken; - } - IndexMemberDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitIndexMemberDeclaration(this); - }; - - IndexMemberDeclarationSyntax.prototype.kind = function () { - return 138 /* IndexMemberDeclaration */; - }; - - IndexMemberDeclarationSyntax.prototype.childCount = function () { - return 3; - }; - - IndexMemberDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.indexSignature; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - IndexMemberDeclarationSyntax.prototype.isClassElement = function () { - return true; - }; - - IndexMemberDeclarationSyntax.prototype.update = function (modifiers, indexSignature, semicolonToken) { - if (this.modifiers === modifiers && this.indexSignature === indexSignature && this.semicolonToken === semicolonToken) { - return this; - } - - return new IndexMemberDeclarationSyntax(modifiers, indexSignature, semicolonToken, this.parsedInStrictMode()); - }; - - IndexMemberDeclarationSyntax.create = function (indexSignature, semicolonToken) { - return new IndexMemberDeclarationSyntax(TypeScript.Syntax.emptyList, indexSignature, semicolonToken, false); - }; - - IndexMemberDeclarationSyntax.create1 = function (indexSignature) { - return new IndexMemberDeclarationSyntax(TypeScript.Syntax.emptyList, indexSignature, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - IndexMemberDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - IndexMemberDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - IndexMemberDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.indexSignature, this.semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - IndexMemberDeclarationSyntax.prototype.withIndexSignature = function (indexSignature) { - return this.update(this.modifiers, indexSignature, this.semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.modifiers, this.indexSignature, semicolonToken); - }; - - IndexMemberDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return IndexMemberDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.IndexMemberDeclarationSyntax = IndexMemberDeclarationSyntax; - - var ThrowStatementSyntax = (function (_super) { - __extends(ThrowStatementSyntax, _super); - function ThrowStatementSyntax(throwKeyword, expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.throwKeyword = throwKeyword; - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ThrowStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitThrowStatement(this); - }; - - ThrowStatementSyntax.prototype.kind = function () { - return 157 /* ThrowStatement */; - }; - - ThrowStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ThrowStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.throwKeyword; - case 1: - return this.expression; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ThrowStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ThrowStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ThrowStatementSyntax.prototype.update = function (throwKeyword, expression, semicolonToken) { - if (this.throwKeyword === throwKeyword && this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ThrowStatementSyntax(throwKeyword, expression, semicolonToken, this.parsedInStrictMode()); - }; - - ThrowStatementSyntax.create1 = function (expression) { - return new ThrowStatementSyntax(TypeScript.Syntax.token(36 /* ThrowKeyword */), expression, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ThrowStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ThrowStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ThrowStatementSyntax.prototype.withThrowKeyword = function (throwKeyword) { - return this.update(throwKeyword, this.expression, this.semicolonToken); - }; - - ThrowStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.throwKeyword, expression, this.semicolonToken); - }; - - ThrowStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.throwKeyword, this.expression, semicolonToken); - }; - - ThrowStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ThrowStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ThrowStatementSyntax = ThrowStatementSyntax; - - var ReturnStatementSyntax = (function (_super) { - __extends(ReturnStatementSyntax, _super); - function ReturnStatementSyntax(returnKeyword, expression, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.returnKeyword = returnKeyword; - this.expression = expression; - this.semicolonToken = semicolonToken; - } - ReturnStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitReturnStatement(this); - }; - - ReturnStatementSyntax.prototype.kind = function () { - return 150 /* ReturnStatement */; - }; - - ReturnStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ReturnStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.returnKeyword; - case 1: - return this.expression; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ReturnStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ReturnStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ReturnStatementSyntax.prototype.update = function (returnKeyword, expression, semicolonToken) { - if (this.returnKeyword === returnKeyword && this.expression === expression && this.semicolonToken === semicolonToken) { - return this; - } - - return new ReturnStatementSyntax(returnKeyword, expression, semicolonToken, this.parsedInStrictMode()); - }; - - ReturnStatementSyntax.create = function (returnKeyword, semicolonToken) { - return new ReturnStatementSyntax(returnKeyword, null, semicolonToken, false); - }; - - ReturnStatementSyntax.create1 = function () { - return new ReturnStatementSyntax(TypeScript.Syntax.token(33 /* ReturnKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ReturnStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ReturnStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ReturnStatementSyntax.prototype.withReturnKeyword = function (returnKeyword) { - return this.update(returnKeyword, this.expression, this.semicolonToken); - }; - - ReturnStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.returnKeyword, expression, this.semicolonToken); - }; - - ReturnStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.returnKeyword, this.expression, semicolonToken); - }; - - ReturnStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression !== null && this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ReturnStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ReturnStatementSyntax = ReturnStatementSyntax; - - var ObjectCreationExpressionSyntax = (function (_super) { - __extends(ObjectCreationExpressionSyntax, _super); - function ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.newKeyword = newKeyword; - this.expression = expression; - this.argumentList = argumentList; - } - ObjectCreationExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectCreationExpression(this); - }; - - ObjectCreationExpressionSyntax.prototype.kind = function () { - return 216 /* ObjectCreationExpression */; - }; - - ObjectCreationExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectCreationExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.newKeyword; - case 1: - return this.expression; - case 2: - return this.argumentList; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectCreationExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ObjectCreationExpressionSyntax.prototype.update = function (newKeyword, expression, argumentList) { - if (this.newKeyword === newKeyword && this.expression === expression && this.argumentList === argumentList) { - return this; - } - - return new ObjectCreationExpressionSyntax(newKeyword, expression, argumentList, this.parsedInStrictMode()); - }; - - ObjectCreationExpressionSyntax.create = function (newKeyword, expression) { - return new ObjectCreationExpressionSyntax(newKeyword, expression, null, false); - }; - - ObjectCreationExpressionSyntax.create1 = function (expression) { - return new ObjectCreationExpressionSyntax(TypeScript.Syntax.token(31 /* NewKeyword */), expression, null, false); - }; - - ObjectCreationExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectCreationExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectCreationExpressionSyntax.prototype.withNewKeyword = function (newKeyword) { - return this.update(newKeyword, this.expression, this.argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.newKeyword, expression, this.argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.withArgumentList = function (argumentList) { - return this.update(this.newKeyword, this.expression, argumentList); - }; - - ObjectCreationExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.argumentList !== null && this.argumentList.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ObjectCreationExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectCreationExpressionSyntax = ObjectCreationExpressionSyntax; - - var SwitchStatementSyntax = (function (_super) { - __extends(SwitchStatementSyntax, _super); - function SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.switchKeyword = switchKeyword; - this.openParenToken = openParenToken; - this.expression = expression; - this.closeParenToken = closeParenToken; - this.openBraceToken = openBraceToken; - this.switchClauses = switchClauses; - this.closeBraceToken = closeBraceToken; - } - SwitchStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitSwitchStatement(this); - }; - - SwitchStatementSyntax.prototype.kind = function () { - return 151 /* SwitchStatement */; - }; - - SwitchStatementSyntax.prototype.childCount = function () { - return 7; - }; - - SwitchStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.switchKeyword; - case 1: - return this.openParenToken; - case 2: - return this.expression; - case 3: - return this.closeParenToken; - case 4: - return this.openBraceToken; - case 5: - return this.switchClauses; - case 6: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SwitchStatementSyntax.prototype.isStatement = function () { - return true; - }; - - SwitchStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - SwitchStatementSyntax.prototype.update = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken) { - if (this.switchKeyword === switchKeyword && this.openParenToken === openParenToken && this.expression === expression && this.closeParenToken === closeParenToken && this.openBraceToken === openBraceToken && this.switchClauses === switchClauses && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken, this.parsedInStrictMode()); - }; - - SwitchStatementSyntax.create = function (switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, closeBraceToken) { - return new SwitchStatementSyntax(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, TypeScript.Syntax.emptyList, closeBraceToken, false); - }; - - SwitchStatementSyntax.create1 = function (expression) { - return new SwitchStatementSyntax(TypeScript.Syntax.token(34 /* SwitchKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptyList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - SwitchStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SwitchStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SwitchStatementSyntax.prototype.withSwitchKeyword = function (switchKeyword) { - return this.update(switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.switchKeyword, openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.switchKeyword, this.openParenToken, expression, this.closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, closeParenToken, this.openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, openBraceToken, this.switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withSwitchClauses = function (switchClauses) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, switchClauses, this.closeBraceToken); - }; - - SwitchStatementSyntax.prototype.withSwitchClause = function (switchClause) { - return this.withSwitchClauses(TypeScript.Syntax.list([switchClause])); - }; - - SwitchStatementSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.switchKeyword, this.openParenToken, this.expression, this.closeParenToken, this.openBraceToken, this.switchClauses, closeBraceToken); - }; - - SwitchStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.switchClauses.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SwitchStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SwitchStatementSyntax = SwitchStatementSyntax; - - var CaseSwitchClauseSyntax = (function (_super) { - __extends(CaseSwitchClauseSyntax, _super); - function CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.caseKeyword = caseKeyword; - this.expression = expression; - this.colonToken = colonToken; - this.statements = statements; - } - CaseSwitchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitCaseSwitchClause(this); - }; - - CaseSwitchClauseSyntax.prototype.kind = function () { - return 233 /* CaseSwitchClause */; - }; - - CaseSwitchClauseSyntax.prototype.childCount = function () { - return 4; - }; - - CaseSwitchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.caseKeyword; - case 1: - return this.expression; - case 2: - return this.colonToken; - case 3: - return this.statements; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CaseSwitchClauseSyntax.prototype.isSwitchClause = function () { - return true; - }; - - CaseSwitchClauseSyntax.prototype.update = function (caseKeyword, expression, colonToken, statements) { - if (this.caseKeyword === caseKeyword && this.expression === expression && this.colonToken === colonToken && this.statements === statements) { - return this; - } - - return new CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, statements, this.parsedInStrictMode()); - }; - - CaseSwitchClauseSyntax.create = function (caseKeyword, expression, colonToken) { - return new CaseSwitchClauseSyntax(caseKeyword, expression, colonToken, TypeScript.Syntax.emptyList, false); - }; - - CaseSwitchClauseSyntax.create1 = function (expression) { - return new CaseSwitchClauseSyntax(TypeScript.Syntax.token(16 /* CaseKeyword */), expression, TypeScript.Syntax.token(106 /* ColonToken */), TypeScript.Syntax.emptyList, false); - }; - - CaseSwitchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CaseSwitchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CaseSwitchClauseSyntax.prototype.withCaseKeyword = function (caseKeyword) { - return this.update(caseKeyword, this.expression, this.colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withExpression = function (expression) { - return this.update(this.caseKeyword, expression, this.colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.caseKeyword, this.expression, colonToken, this.statements); - }; - - CaseSwitchClauseSyntax.prototype.withStatements = function (statements) { - return this.update(this.caseKeyword, this.expression, this.colonToken, statements); - }; - - CaseSwitchClauseSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - CaseSwitchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return CaseSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CaseSwitchClauseSyntax = CaseSwitchClauseSyntax; - - var DefaultSwitchClauseSyntax = (function (_super) { - __extends(DefaultSwitchClauseSyntax, _super); - function DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.defaultKeyword = defaultKeyword; - this.colonToken = colonToken; - this.statements = statements; - } - DefaultSwitchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitDefaultSwitchClause(this); - }; - - DefaultSwitchClauseSyntax.prototype.kind = function () { - return 234 /* DefaultSwitchClause */; - }; - - DefaultSwitchClauseSyntax.prototype.childCount = function () { - return 3; - }; - - DefaultSwitchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.defaultKeyword; - case 1: - return this.colonToken; - case 2: - return this.statements; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DefaultSwitchClauseSyntax.prototype.isSwitchClause = function () { - return true; - }; - - DefaultSwitchClauseSyntax.prototype.update = function (defaultKeyword, colonToken, statements) { - if (this.defaultKeyword === defaultKeyword && this.colonToken === colonToken && this.statements === statements) { - return this; - } - - return new DefaultSwitchClauseSyntax(defaultKeyword, colonToken, statements, this.parsedInStrictMode()); - }; - - DefaultSwitchClauseSyntax.create = function (defaultKeyword, colonToken) { - return new DefaultSwitchClauseSyntax(defaultKeyword, colonToken, TypeScript.Syntax.emptyList, false); - }; - - DefaultSwitchClauseSyntax.create1 = function () { - return new DefaultSwitchClauseSyntax(TypeScript.Syntax.token(20 /* DefaultKeyword */), TypeScript.Syntax.token(106 /* ColonToken */), TypeScript.Syntax.emptyList, false); - }; - - DefaultSwitchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DefaultSwitchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DefaultSwitchClauseSyntax.prototype.withDefaultKeyword = function (defaultKeyword) { - return this.update(defaultKeyword, this.colonToken, this.statements); - }; - - DefaultSwitchClauseSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.defaultKeyword, colonToken, this.statements); - }; - - DefaultSwitchClauseSyntax.prototype.withStatements = function (statements) { - return this.update(this.defaultKeyword, this.colonToken, statements); - }; - - DefaultSwitchClauseSyntax.prototype.withStatement = function (statement) { - return this.withStatements(TypeScript.Syntax.list([statement])); - }; - - DefaultSwitchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statements.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DefaultSwitchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DefaultSwitchClauseSyntax = DefaultSwitchClauseSyntax; - - var BreakStatementSyntax = (function (_super) { - __extends(BreakStatementSyntax, _super); - function BreakStatementSyntax(breakKeyword, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.breakKeyword = breakKeyword; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - BreakStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitBreakStatement(this); - }; - - BreakStatementSyntax.prototype.kind = function () { - return 152 /* BreakStatement */; - }; - - BreakStatementSyntax.prototype.childCount = function () { - return 3; - }; - - BreakStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.breakKeyword; - case 1: - return this.identifier; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - BreakStatementSyntax.prototype.isStatement = function () { - return true; - }; - - BreakStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - BreakStatementSyntax.prototype.update = function (breakKeyword, identifier, semicolonToken) { - if (this.breakKeyword === breakKeyword && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new BreakStatementSyntax(breakKeyword, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - BreakStatementSyntax.create = function (breakKeyword, semicolonToken) { - return new BreakStatementSyntax(breakKeyword, null, semicolonToken, false); - }; - - BreakStatementSyntax.create1 = function () { - return new BreakStatementSyntax(TypeScript.Syntax.token(15 /* BreakKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - BreakStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - BreakStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - BreakStatementSyntax.prototype.withBreakKeyword = function (breakKeyword) { - return this.update(breakKeyword, this.identifier, this.semicolonToken); - }; - - BreakStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.breakKeyword, identifier, this.semicolonToken); - }; - - BreakStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.breakKeyword, this.identifier, semicolonToken); - }; - - BreakStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return BreakStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.BreakStatementSyntax = BreakStatementSyntax; - - var ContinueStatementSyntax = (function (_super) { - __extends(ContinueStatementSyntax, _super); - function ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.continueKeyword = continueKeyword; - this.identifier = identifier; - this.semicolonToken = semicolonToken; - } - ContinueStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitContinueStatement(this); - }; - - ContinueStatementSyntax.prototype.kind = function () { - return 153 /* ContinueStatement */; - }; - - ContinueStatementSyntax.prototype.childCount = function () { - return 3; - }; - - ContinueStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.continueKeyword; - case 1: - return this.identifier; - case 2: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ContinueStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ContinueStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ContinueStatementSyntax.prototype.update = function (continueKeyword, identifier, semicolonToken) { - if (this.continueKeyword === continueKeyword && this.identifier === identifier && this.semicolonToken === semicolonToken) { - return this; - } - - return new ContinueStatementSyntax(continueKeyword, identifier, semicolonToken, this.parsedInStrictMode()); - }; - - ContinueStatementSyntax.create = function (continueKeyword, semicolonToken) { - return new ContinueStatementSyntax(continueKeyword, null, semicolonToken, false); - }; - - ContinueStatementSyntax.create1 = function () { - return new ContinueStatementSyntax(TypeScript.Syntax.token(18 /* ContinueKeyword */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - ContinueStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ContinueStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ContinueStatementSyntax.prototype.withContinueKeyword = function (continueKeyword) { - return this.update(continueKeyword, this.identifier, this.semicolonToken); - }; - - ContinueStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.continueKeyword, identifier, this.semicolonToken); - }; - - ContinueStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.continueKeyword, this.identifier, semicolonToken); - }; - - ContinueStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return ContinueStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ContinueStatementSyntax = ContinueStatementSyntax; - - var ForStatementSyntax = (function (_super) { - __extends(ForStatementSyntax, _super); - function ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.forKeyword = forKeyword; - this.openParenToken = openParenToken; - this.variableDeclaration = variableDeclaration; - this.initializer = initializer; - this.firstSemicolonToken = firstSemicolonToken; - this.condition = condition; - this.secondSemicolonToken = secondSemicolonToken; - this.incrementor = incrementor; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - ForStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitForStatement(this); - }; - - ForStatementSyntax.prototype.kind = function () { - return 154 /* ForStatement */; - }; - - ForStatementSyntax.prototype.childCount = function () { - return 10; - }; - - ForStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.forKeyword; - case 1: - return this.openParenToken; - case 2: - return this.variableDeclaration; - case 3: - return this.initializer; - case 4: - return this.firstSemicolonToken; - case 5: - return this.condition; - case 6: - return this.secondSemicolonToken; - case 7: - return this.incrementor; - case 8: - return this.closeParenToken; - case 9: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ForStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - ForStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ForStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ForStatementSyntax.prototype.update = function (forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement) { - if (this.forKeyword === forKeyword && this.openParenToken === openParenToken && this.variableDeclaration === variableDeclaration && this.initializer === initializer && this.firstSemicolonToken === firstSemicolonToken && this.condition === condition && this.secondSemicolonToken === secondSemicolonToken && this.incrementor === incrementor && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new ForStatementSyntax(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement, this.parsedInStrictMode()); - }; - - ForStatementSyntax.create = function (forKeyword, openParenToken, firstSemicolonToken, secondSemicolonToken, closeParenToken, statement) { - return new ForStatementSyntax(forKeyword, openParenToken, null, null, firstSemicolonToken, null, secondSemicolonToken, null, closeParenToken, statement, false); - }; - - ForStatementSyntax.create1 = function (statement) { - return new ForStatementSyntax(TypeScript.Syntax.token(26 /* ForKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), null, null, TypeScript.Syntax.token(78 /* SemicolonToken */), null, TypeScript.Syntax.token(78 /* SemicolonToken */), null, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - ForStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ForStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ForStatementSyntax.prototype.withForKeyword = function (forKeyword) { - return this.update(forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.forKeyword, openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.forKeyword, this.openParenToken, variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withInitializer = function (initializer) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withFirstSemicolonToken = function (firstSemicolonToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withSecondSemicolonToken = function (secondSemicolonToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, secondSemicolonToken, this.incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withIncrementor = function (incrementor) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, incrementor, this.closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, closeParenToken, this.statement); - }; - - ForStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.initializer, this.firstSemicolonToken, this.condition, this.secondSemicolonToken, this.incrementor, this.closeParenToken, statement); - }; - - ForStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclaration !== null && this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - if (this.initializer !== null && this.initializer.isTypeScriptSpecific()) { - return true; - } - if (this.condition !== null && this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.incrementor !== null && this.incrementor.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ForStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ForStatementSyntax = ForStatementSyntax; - - var ForInStatementSyntax = (function (_super) { - __extends(ForInStatementSyntax, _super); - function ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.forKeyword = forKeyword; - this.openParenToken = openParenToken; - this.variableDeclaration = variableDeclaration; - this.left = left; - this.inKeyword = inKeyword; - this.expression = expression; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - ForInStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitForInStatement(this); - }; - - ForInStatementSyntax.prototype.kind = function () { - return 155 /* ForInStatement */; - }; - - ForInStatementSyntax.prototype.childCount = function () { - return 8; - }; - - ForInStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.forKeyword; - case 1: - return this.openParenToken; - case 2: - return this.variableDeclaration; - case 3: - return this.left; - case 4: - return this.inKeyword; - case 5: - return this.expression; - case 6: - return this.closeParenToken; - case 7: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ForInStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - ForInStatementSyntax.prototype.isStatement = function () { - return true; - }; - - ForInStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - ForInStatementSyntax.prototype.update = function (forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement) { - if (this.forKeyword === forKeyword && this.openParenToken === openParenToken && this.variableDeclaration === variableDeclaration && this.left === left && this.inKeyword === inKeyword && this.expression === expression && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new ForInStatementSyntax(forKeyword, openParenToken, variableDeclaration, left, inKeyword, expression, closeParenToken, statement, this.parsedInStrictMode()); - }; - - ForInStatementSyntax.create = function (forKeyword, openParenToken, inKeyword, expression, closeParenToken, statement) { - return new ForInStatementSyntax(forKeyword, openParenToken, null, null, inKeyword, expression, closeParenToken, statement, false); - }; - - ForInStatementSyntax.create1 = function (expression, statement) { - return new ForInStatementSyntax(TypeScript.Syntax.token(26 /* ForKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), null, null, TypeScript.Syntax.token(29 /* InKeyword */), expression, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - ForInStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ForInStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ForInStatementSyntax.prototype.withForKeyword = function (forKeyword) { - return this.update(forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.forKeyword, openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withVariableDeclaration = function (variableDeclaration) { - return this.update(this.forKeyword, this.openParenToken, variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withLeft = function (left) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, left, this.inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withInKeyword = function (inKeyword) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, inKeyword, this.expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withExpression = function (expression) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, expression, this.closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, closeParenToken, this.statement); - }; - - ForInStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.forKeyword, this.openParenToken, this.variableDeclaration, this.left, this.inKeyword, this.expression, this.closeParenToken, statement); - }; - - ForInStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.variableDeclaration !== null && this.variableDeclaration.isTypeScriptSpecific()) { - return true; - } - if (this.left !== null && this.left.isTypeScriptSpecific()) { - return true; - } - if (this.expression.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ForInStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ForInStatementSyntax = ForInStatementSyntax; - - var WhileStatementSyntax = (function (_super) { - __extends(WhileStatementSyntax, _super); - function WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.whileKeyword = whileKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - WhileStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitWhileStatement(this); - }; - - WhileStatementSyntax.prototype.kind = function () { - return 158 /* WhileStatement */; - }; - - WhileStatementSyntax.prototype.childCount = function () { - return 5; - }; - - WhileStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.whileKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - WhileStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - WhileStatementSyntax.prototype.isStatement = function () { - return true; - }; - - WhileStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - WhileStatementSyntax.prototype.update = function (whileKeyword, openParenToken, condition, closeParenToken, statement) { - if (this.whileKeyword === whileKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new WhileStatementSyntax(whileKeyword, openParenToken, condition, closeParenToken, statement, this.parsedInStrictMode()); - }; - - WhileStatementSyntax.create1 = function (condition, statement) { - return new WhileStatementSyntax(TypeScript.Syntax.token(42 /* WhileKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - WhileStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - WhileStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - WhileStatementSyntax.prototype.withWhileKeyword = function (whileKeyword) { - return this.update(whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.whileKeyword, openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.whileKeyword, this.openParenToken, condition, this.closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.whileKeyword, this.openParenToken, this.condition, closeParenToken, this.statement); - }; - - WhileStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, statement); - }; - - WhileStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return WhileStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.WhileStatementSyntax = WhileStatementSyntax; - - var WithStatementSyntax = (function (_super) { - __extends(WithStatementSyntax, _super); - function WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.withKeyword = withKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.statement = statement; - } - WithStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitWithStatement(this); - }; - - WithStatementSyntax.prototype.kind = function () { - return 163 /* WithStatement */; - }; - - WithStatementSyntax.prototype.childCount = function () { - return 5; - }; - - WithStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.withKeyword; - case 1: - return this.openParenToken; - case 2: - return this.condition; - case 3: - return this.closeParenToken; - case 4: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - WithStatementSyntax.prototype.isStatement = function () { - return true; - }; - - WithStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - WithStatementSyntax.prototype.update = function (withKeyword, openParenToken, condition, closeParenToken, statement) { - if (this.withKeyword === withKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.statement === statement) { - return this; - } - - return new WithStatementSyntax(withKeyword, openParenToken, condition, closeParenToken, statement, this.parsedInStrictMode()); - }; - - WithStatementSyntax.create1 = function (condition, statement) { - return new WithStatementSyntax(TypeScript.Syntax.token(43 /* WithKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), statement, false); - }; - - WithStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - WithStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - WithStatementSyntax.prototype.withWithKeyword = function (withKeyword) { - return this.update(withKeyword, this.openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.withKeyword, openParenToken, this.condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.withKeyword, this.openParenToken, condition, this.closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.withKeyword, this.openParenToken, this.condition, closeParenToken, this.statement); - }; - - WithStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.withKeyword, this.openParenToken, this.condition, this.closeParenToken, statement); - }; - - WithStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.condition.isTypeScriptSpecific()) { - return true; - } - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return WithStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.WithStatementSyntax = WithStatementSyntax; - - var EnumDeclarationSyntax = (function (_super) { - __extends(EnumDeclarationSyntax, _super); - function EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.modifiers = modifiers; - this.enumKeyword = enumKeyword; - this.identifier = identifier; - this.openBraceToken = openBraceToken; - this.enumElements = enumElements; - this.closeBraceToken = closeBraceToken; - } - EnumDeclarationSyntax.prototype.accept = function (visitor) { - return visitor.visitEnumDeclaration(this); - }; - - EnumDeclarationSyntax.prototype.kind = function () { - return 132 /* EnumDeclaration */; - }; - - EnumDeclarationSyntax.prototype.childCount = function () { - return 6; - }; - - EnumDeclarationSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.modifiers; - case 1: - return this.enumKeyword; - case 2: - return this.identifier; - case 3: - return this.openBraceToken; - case 4: - return this.enumElements; - case 5: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EnumDeclarationSyntax.prototype.isModuleElement = function () { - return true; - }; - - EnumDeclarationSyntax.prototype.update = function (modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken) { - if (this.modifiers === modifiers && this.enumKeyword === enumKeyword && this.identifier === identifier && this.openBraceToken === openBraceToken && this.enumElements === enumElements && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new EnumDeclarationSyntax(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken, this.parsedInStrictMode()); - }; - - EnumDeclarationSyntax.create = function (enumKeyword, identifier, openBraceToken, closeBraceToken) { - return new EnumDeclarationSyntax(TypeScript.Syntax.emptyList, enumKeyword, identifier, openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - EnumDeclarationSyntax.create1 = function (identifier) { - return new EnumDeclarationSyntax(TypeScript.Syntax.emptyList, TypeScript.Syntax.token(46 /* EnumKeyword */), identifier, TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - EnumDeclarationSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EnumDeclarationSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EnumDeclarationSyntax.prototype.withModifiers = function (modifiers) { - return this.update(modifiers, this.enumKeyword, this.identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withModifier = function (modifier) { - return this.withModifiers(TypeScript.Syntax.list([modifier])); - }; - - EnumDeclarationSyntax.prototype.withEnumKeyword = function (enumKeyword) { - return this.update(this.modifiers, enumKeyword, this.identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.modifiers, this.enumKeyword, identifier, this.openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, openBraceToken, this.enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withEnumElements = function (enumElements) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, this.openBraceToken, enumElements, this.closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.withEnumElement = function (enumElement) { - return this.withEnumElements(TypeScript.Syntax.separatedList([enumElement])); - }; - - EnumDeclarationSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.modifiers, this.enumKeyword, this.identifier, this.openBraceToken, this.enumElements, closeBraceToken); - }; - - EnumDeclarationSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return EnumDeclarationSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EnumDeclarationSyntax = EnumDeclarationSyntax; - - var EnumElementSyntax = (function (_super) { - __extends(EnumElementSyntax, _super); - function EnumElementSyntax(propertyName, equalsValueClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.equalsValueClause = equalsValueClause; - } - EnumElementSyntax.prototype.accept = function (visitor) { - return visitor.visitEnumElement(this); - }; - - EnumElementSyntax.prototype.kind = function () { - return 243 /* EnumElement */; - }; - - EnumElementSyntax.prototype.childCount = function () { - return 2; - }; - - EnumElementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.equalsValueClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EnumElementSyntax.prototype.update = function (propertyName, equalsValueClause) { - if (this.propertyName === propertyName && this.equalsValueClause === equalsValueClause) { - return this; - } - - return new EnumElementSyntax(propertyName, equalsValueClause, this.parsedInStrictMode()); - }; - - EnumElementSyntax.create = function (propertyName) { - return new EnumElementSyntax(propertyName, null, false); - }; - - EnumElementSyntax.create1 = function (propertyName) { - return new EnumElementSyntax(propertyName, null, false); - }; - - EnumElementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EnumElementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EnumElementSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.equalsValueClause); - }; - - EnumElementSyntax.prototype.withEqualsValueClause = function (equalsValueClause) { - return this.update(this.propertyName, equalsValueClause); - }; - - EnumElementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.equalsValueClause !== null && this.equalsValueClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return EnumElementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EnumElementSyntax = EnumElementSyntax; - - var CastExpressionSyntax = (function (_super) { - __extends(CastExpressionSyntax, _super); - function CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.lessThanToken = lessThanToken; - this.type = type; - this.greaterThanToken = greaterThanToken; - this.expression = expression; - } - CastExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitCastExpression(this); - }; - - CastExpressionSyntax.prototype.kind = function () { - return 220 /* CastExpression */; - }; - - CastExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - CastExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.lessThanToken; - case 1: - return this.type; - case 2: - return this.greaterThanToken; - case 3: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CastExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - CastExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - CastExpressionSyntax.prototype.update = function (lessThanToken, type, greaterThanToken, expression) { - if (this.lessThanToken === lessThanToken && this.type === type && this.greaterThanToken === greaterThanToken && this.expression === expression) { - return this; - } - - return new CastExpressionSyntax(lessThanToken, type, greaterThanToken, expression, this.parsedInStrictMode()); - }; - - CastExpressionSyntax.create1 = function (type, expression) { - return new CastExpressionSyntax(TypeScript.Syntax.token(80 /* LessThanToken */), type, TypeScript.Syntax.token(81 /* GreaterThanToken */), expression, false); - }; - - CastExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CastExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CastExpressionSyntax.prototype.withLessThanToken = function (lessThanToken) { - return this.update(lessThanToken, this.type, this.greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withType = function (type) { - return this.update(this.lessThanToken, type, this.greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withGreaterThanToken = function (greaterThanToken) { - return this.update(this.lessThanToken, this.type, greaterThanToken, this.expression); - }; - - CastExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.lessThanToken, this.type, this.greaterThanToken, expression); - }; - - CastExpressionSyntax.prototype.isTypeScriptSpecific = function () { - return true; - }; - return CastExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CastExpressionSyntax = CastExpressionSyntax; - - var ObjectLiteralExpressionSyntax = (function (_super) { - __extends(ObjectLiteralExpressionSyntax, _super); - function ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.openBraceToken = openBraceToken; - this.propertyAssignments = propertyAssignments; - this.closeBraceToken = closeBraceToken; - } - ObjectLiteralExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitObjectLiteralExpression(this); - }; - - ObjectLiteralExpressionSyntax.prototype.kind = function () { - return 215 /* ObjectLiteralExpression */; - }; - - ObjectLiteralExpressionSyntax.prototype.childCount = function () { - return 3; - }; - - ObjectLiteralExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.openBraceToken; - case 1: - return this.propertyAssignments; - case 2: - return this.closeBraceToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ObjectLiteralExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - ObjectLiteralExpressionSyntax.prototype.update = function (openBraceToken, propertyAssignments, closeBraceToken) { - if (this.openBraceToken === openBraceToken && this.propertyAssignments === propertyAssignments && this.closeBraceToken === closeBraceToken) { - return this; - } - - return new ObjectLiteralExpressionSyntax(openBraceToken, propertyAssignments, closeBraceToken, this.parsedInStrictMode()); - }; - - ObjectLiteralExpressionSyntax.create = function (openBraceToken, closeBraceToken) { - return new ObjectLiteralExpressionSyntax(openBraceToken, TypeScript.Syntax.emptySeparatedList, closeBraceToken, false); - }; - - ObjectLiteralExpressionSyntax.create1 = function () { - return new ObjectLiteralExpressionSyntax(TypeScript.Syntax.token(70 /* OpenBraceToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.token(71 /* CloseBraceToken */), false); - }; - - ObjectLiteralExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - ObjectLiteralExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - ObjectLiteralExpressionSyntax.prototype.withOpenBraceToken = function (openBraceToken) { - return this.update(openBraceToken, this.propertyAssignments, this.closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.withPropertyAssignments = function (propertyAssignments) { - return this.update(this.openBraceToken, propertyAssignments, this.closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.withPropertyAssignment = function (propertyAssignment) { - return this.withPropertyAssignments(TypeScript.Syntax.separatedList([propertyAssignment])); - }; - - ObjectLiteralExpressionSyntax.prototype.withCloseBraceToken = function (closeBraceToken) { - return this.update(this.openBraceToken, this.propertyAssignments, closeBraceToken); - }; - - ObjectLiteralExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.propertyAssignments.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return ObjectLiteralExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.ObjectLiteralExpressionSyntax = ObjectLiteralExpressionSyntax; - - var SimplePropertyAssignmentSyntax = (function (_super) { - __extends(SimplePropertyAssignmentSyntax, _super); - function SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.colonToken = colonToken; - this.expression = expression; - } - SimplePropertyAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitSimplePropertyAssignment(this); - }; - - SimplePropertyAssignmentSyntax.prototype.kind = function () { - return 240 /* SimplePropertyAssignment */; - }; - - SimplePropertyAssignmentSyntax.prototype.childCount = function () { - return 3; - }; - - SimplePropertyAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.colonToken; - case 2: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SimplePropertyAssignmentSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - SimplePropertyAssignmentSyntax.prototype.update = function (propertyName, colonToken, expression) { - if (this.propertyName === propertyName && this.colonToken === colonToken && this.expression === expression) { - return this; - } - - return new SimplePropertyAssignmentSyntax(propertyName, colonToken, expression, this.parsedInStrictMode()); - }; - - SimplePropertyAssignmentSyntax.create1 = function (propertyName, expression) { - return new SimplePropertyAssignmentSyntax(propertyName, TypeScript.Syntax.token(106 /* ColonToken */), expression, false); - }; - - SimplePropertyAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - SimplePropertyAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - SimplePropertyAssignmentSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.colonToken, this.expression); - }; - - SimplePropertyAssignmentSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.propertyName, colonToken, this.expression); - }; - - SimplePropertyAssignmentSyntax.prototype.withExpression = function (expression) { - return this.update(this.propertyName, this.colonToken, expression); - }; - - SimplePropertyAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return SimplePropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.SimplePropertyAssignmentSyntax = SimplePropertyAssignmentSyntax; - - var FunctionPropertyAssignmentSyntax = (function (_super) { - __extends(FunctionPropertyAssignmentSyntax, _super); - function FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - } - FunctionPropertyAssignmentSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionPropertyAssignment(this); - }; - - FunctionPropertyAssignmentSyntax.prototype.kind = function () { - return 241 /* FunctionPropertyAssignment */; - }; - - FunctionPropertyAssignmentSyntax.prototype.childCount = function () { - return 3; - }; - - FunctionPropertyAssignmentSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.propertyName; - case 1: - return this.callSignature; - case 2: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionPropertyAssignmentSyntax.prototype.isPropertyAssignment = function () { - return true; - }; - - FunctionPropertyAssignmentSyntax.prototype.update = function (propertyName, callSignature, block) { - if (this.propertyName === propertyName && this.callSignature === callSignature && this.block === block) { - return this; - } - - return new FunctionPropertyAssignmentSyntax(propertyName, callSignature, block, this.parsedInStrictMode()); - }; - - FunctionPropertyAssignmentSyntax.create1 = function (propertyName) { - return new FunctionPropertyAssignmentSyntax(propertyName, CallSignatureSyntax.create1(), BlockSyntax.create1(), false); - }; - - FunctionPropertyAssignmentSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionPropertyAssignmentSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionPropertyAssignmentSyntax.prototype.withPropertyName = function (propertyName) { - return this.update(propertyName, this.callSignature, this.block); - }; - - FunctionPropertyAssignmentSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.propertyName, callSignature, this.block); - }; - - FunctionPropertyAssignmentSyntax.prototype.withBlock = function (block) { - return this.update(this.propertyName, this.callSignature, block); - }; - - FunctionPropertyAssignmentSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionPropertyAssignmentSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionPropertyAssignmentSyntax = FunctionPropertyAssignmentSyntax; - - var FunctionExpressionSyntax = (function (_super) { - __extends(FunctionExpressionSyntax, _super); - function FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.functionKeyword = functionKeyword; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - } - FunctionExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitFunctionExpression(this); - }; - - FunctionExpressionSyntax.prototype.kind = function () { - return 222 /* FunctionExpression */; - }; - - FunctionExpressionSyntax.prototype.childCount = function () { - return 4; - }; - - FunctionExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.functionKeyword; - case 1: - return this.identifier; - case 2: - return this.callSignature; - case 3: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FunctionExpressionSyntax.prototype.isPrimaryExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isMemberExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isPostfixExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - FunctionExpressionSyntax.prototype.update = function (functionKeyword, identifier, callSignature, block) { - if (this.functionKeyword === functionKeyword && this.identifier === identifier && this.callSignature === callSignature && this.block === block) { - return this; - } - - return new FunctionExpressionSyntax(functionKeyword, identifier, callSignature, block, this.parsedInStrictMode()); - }; - - FunctionExpressionSyntax.create = function (functionKeyword, callSignature, block) { - return new FunctionExpressionSyntax(functionKeyword, null, callSignature, block, false); - }; - - FunctionExpressionSyntax.create1 = function () { - return new FunctionExpressionSyntax(TypeScript.Syntax.token(27 /* FunctionKeyword */), null, CallSignatureSyntax.create1(), BlockSyntax.create1(), false); - }; - - FunctionExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FunctionExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FunctionExpressionSyntax.prototype.withFunctionKeyword = function (functionKeyword) { - return this.update(functionKeyword, this.identifier, this.callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.functionKeyword, identifier, this.callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withCallSignature = function (callSignature) { - return this.update(this.functionKeyword, this.identifier, callSignature, this.block); - }; - - FunctionExpressionSyntax.prototype.withBlock = function (block) { - return this.update(this.functionKeyword, this.identifier, this.callSignature, block); - }; - - FunctionExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.callSignature.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FunctionExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FunctionExpressionSyntax = FunctionExpressionSyntax; - - var EmptyStatementSyntax = (function (_super) { - __extends(EmptyStatementSyntax, _super); - function EmptyStatementSyntax(semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.semicolonToken = semicolonToken; - } - EmptyStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitEmptyStatement(this); - }; - - EmptyStatementSyntax.prototype.kind = function () { - return 156 /* EmptyStatement */; - }; - - EmptyStatementSyntax.prototype.childCount = function () { - return 1; - }; - - EmptyStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - EmptyStatementSyntax.prototype.isStatement = function () { - return true; - }; - - EmptyStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - EmptyStatementSyntax.prototype.update = function (semicolonToken) { - if (this.semicolonToken === semicolonToken) { - return this; - } - - return new EmptyStatementSyntax(semicolonToken, this.parsedInStrictMode()); - }; - - EmptyStatementSyntax.create1 = function () { - return new EmptyStatementSyntax(TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - EmptyStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - EmptyStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - EmptyStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(semicolonToken); - }; - - EmptyStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return EmptyStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.EmptyStatementSyntax = EmptyStatementSyntax; - - var TryStatementSyntax = (function (_super) { - __extends(TryStatementSyntax, _super); - function TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.tryKeyword = tryKeyword; - this.block = block; - this.catchClause = catchClause; - this.finallyClause = finallyClause; - } - TryStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitTryStatement(this); - }; - - TryStatementSyntax.prototype.kind = function () { - return 159 /* TryStatement */; - }; - - TryStatementSyntax.prototype.childCount = function () { - return 4; - }; - - TryStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.tryKeyword; - case 1: - return this.block; - case 2: - return this.catchClause; - case 3: - return this.finallyClause; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TryStatementSyntax.prototype.isStatement = function () { - return true; - }; - - TryStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - TryStatementSyntax.prototype.update = function (tryKeyword, block, catchClause, finallyClause) { - if (this.tryKeyword === tryKeyword && this.block === block && this.catchClause === catchClause && this.finallyClause === finallyClause) { - return this; - } - - return new TryStatementSyntax(tryKeyword, block, catchClause, finallyClause, this.parsedInStrictMode()); - }; - - TryStatementSyntax.create = function (tryKeyword, block) { - return new TryStatementSyntax(tryKeyword, block, null, null, false); - }; - - TryStatementSyntax.create1 = function () { - return new TryStatementSyntax(TypeScript.Syntax.token(38 /* TryKeyword */), BlockSyntax.create1(), null, null, false); - }; - - TryStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TryStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TryStatementSyntax.prototype.withTryKeyword = function (tryKeyword) { - return this.update(tryKeyword, this.block, this.catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withBlock = function (block) { - return this.update(this.tryKeyword, block, this.catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withCatchClause = function (catchClause) { - return this.update(this.tryKeyword, this.block, catchClause, this.finallyClause); - }; - - TryStatementSyntax.prototype.withFinallyClause = function (finallyClause) { - return this.update(this.tryKeyword, this.block, this.catchClause, finallyClause); - }; - - TryStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.block.isTypeScriptSpecific()) { - return true; - } - if (this.catchClause !== null && this.catchClause.isTypeScriptSpecific()) { - return true; - } - if (this.finallyClause !== null && this.finallyClause.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return TryStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TryStatementSyntax = TryStatementSyntax; - - var CatchClauseSyntax = (function (_super) { - __extends(CatchClauseSyntax, _super); - function CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.catchKeyword = catchKeyword; - this.openParenToken = openParenToken; - this.identifier = identifier; - this.typeAnnotation = typeAnnotation; - this.closeParenToken = closeParenToken; - this.block = block; - } - CatchClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitCatchClause(this); - }; - - CatchClauseSyntax.prototype.kind = function () { - return 236 /* CatchClause */; - }; - - CatchClauseSyntax.prototype.childCount = function () { - return 6; - }; - - CatchClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.catchKeyword; - case 1: - return this.openParenToken; - case 2: - return this.identifier; - case 3: - return this.typeAnnotation; - case 4: - return this.closeParenToken; - case 5: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - CatchClauseSyntax.prototype.update = function (catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block) { - if (this.catchKeyword === catchKeyword && this.openParenToken === openParenToken && this.identifier === identifier && this.typeAnnotation === typeAnnotation && this.closeParenToken === closeParenToken && this.block === block) { - return this; - } - - return new CatchClauseSyntax(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block, this.parsedInStrictMode()); - }; - - CatchClauseSyntax.create = function (catchKeyword, openParenToken, identifier, closeParenToken, block) { - return new CatchClauseSyntax(catchKeyword, openParenToken, identifier, null, closeParenToken, block, false); - }; - - CatchClauseSyntax.create1 = function (identifier) { - return new CatchClauseSyntax(TypeScript.Syntax.token(17 /* CatchKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), identifier, null, TypeScript.Syntax.token(73 /* CloseParenToken */), BlockSyntax.create1(), false); - }; - - CatchClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - CatchClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - CatchClauseSyntax.prototype.withCatchKeyword = function (catchKeyword) { - return this.update(catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.catchKeyword, openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withIdentifier = function (identifier) { - return this.update(this.catchKeyword, this.openParenToken, identifier, this.typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withTypeAnnotation = function (typeAnnotation) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, typeAnnotation, this.closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, closeParenToken, this.block); - }; - - CatchClauseSyntax.prototype.withBlock = function (block) { - return this.update(this.catchKeyword, this.openParenToken, this.identifier, this.typeAnnotation, this.closeParenToken, block); - }; - - CatchClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.typeAnnotation !== null && this.typeAnnotation.isTypeScriptSpecific()) { - return true; - } - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return CatchClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.CatchClauseSyntax = CatchClauseSyntax; - - var FinallyClauseSyntax = (function (_super) { - __extends(FinallyClauseSyntax, _super); - function FinallyClauseSyntax(finallyKeyword, block, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.finallyKeyword = finallyKeyword; - this.block = block; - } - FinallyClauseSyntax.prototype.accept = function (visitor) { - return visitor.visitFinallyClause(this); - }; - - FinallyClauseSyntax.prototype.kind = function () { - return 237 /* FinallyClause */; - }; - - FinallyClauseSyntax.prototype.childCount = function () { - return 2; - }; - - FinallyClauseSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.finallyKeyword; - case 1: - return this.block; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - FinallyClauseSyntax.prototype.update = function (finallyKeyword, block) { - if (this.finallyKeyword === finallyKeyword && this.block === block) { - return this; - } - - return new FinallyClauseSyntax(finallyKeyword, block, this.parsedInStrictMode()); - }; - - FinallyClauseSyntax.create1 = function () { - return new FinallyClauseSyntax(TypeScript.Syntax.token(25 /* FinallyKeyword */), BlockSyntax.create1(), false); - }; - - FinallyClauseSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - FinallyClauseSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - FinallyClauseSyntax.prototype.withFinallyKeyword = function (finallyKeyword) { - return this.update(finallyKeyword, this.block); - }; - - FinallyClauseSyntax.prototype.withBlock = function (block) { - return this.update(this.finallyKeyword, block); - }; - - FinallyClauseSyntax.prototype.isTypeScriptSpecific = function () { - if (this.block.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return FinallyClauseSyntax; - })(TypeScript.SyntaxNode); - TypeScript.FinallyClauseSyntax = FinallyClauseSyntax; - - var LabeledStatementSyntax = (function (_super) { - __extends(LabeledStatementSyntax, _super); - function LabeledStatementSyntax(identifier, colonToken, statement, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.identifier = identifier; - this.colonToken = colonToken; - this.statement = statement; - } - LabeledStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitLabeledStatement(this); - }; - - LabeledStatementSyntax.prototype.kind = function () { - return 160 /* LabeledStatement */; - }; - - LabeledStatementSyntax.prototype.childCount = function () { - return 3; - }; - - LabeledStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.identifier; - case 1: - return this.colonToken; - case 2: - return this.statement; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - LabeledStatementSyntax.prototype.isStatement = function () { - return true; - }; - - LabeledStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - LabeledStatementSyntax.prototype.update = function (identifier, colonToken, statement) { - if (this.identifier === identifier && this.colonToken === colonToken && this.statement === statement) { - return this; - } - - return new LabeledStatementSyntax(identifier, colonToken, statement, this.parsedInStrictMode()); - }; - - LabeledStatementSyntax.create1 = function (identifier, statement) { - return new LabeledStatementSyntax(identifier, TypeScript.Syntax.token(106 /* ColonToken */), statement, false); - }; - - LabeledStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - LabeledStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - LabeledStatementSyntax.prototype.withIdentifier = function (identifier) { - return this.update(identifier, this.colonToken, this.statement); - }; - - LabeledStatementSyntax.prototype.withColonToken = function (colonToken) { - return this.update(this.identifier, colonToken, this.statement); - }; - - LabeledStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.identifier, this.colonToken, statement); - }; - - LabeledStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return LabeledStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.LabeledStatementSyntax = LabeledStatementSyntax; - - var DoStatementSyntax = (function (_super) { - __extends(DoStatementSyntax, _super); - function DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.doKeyword = doKeyword; - this.statement = statement; - this.whileKeyword = whileKeyword; - this.openParenToken = openParenToken; - this.condition = condition; - this.closeParenToken = closeParenToken; - this.semicolonToken = semicolonToken; - } - DoStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitDoStatement(this); - }; - - DoStatementSyntax.prototype.kind = function () { - return 161 /* DoStatement */; - }; - - DoStatementSyntax.prototype.childCount = function () { - return 7; - }; - - DoStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.doKeyword; - case 1: - return this.statement; - case 2: - return this.whileKeyword; - case 3: - return this.openParenToken; - case 4: - return this.condition; - case 5: - return this.closeParenToken; - case 6: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DoStatementSyntax.prototype.isIterationStatement = function () { - return true; - }; - - DoStatementSyntax.prototype.isStatement = function () { - return true; - }; - - DoStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - DoStatementSyntax.prototype.update = function (doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken) { - if (this.doKeyword === doKeyword && this.statement === statement && this.whileKeyword === whileKeyword && this.openParenToken === openParenToken && this.condition === condition && this.closeParenToken === closeParenToken && this.semicolonToken === semicolonToken) { - return this; - } - - return new DoStatementSyntax(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken, this.parsedInStrictMode()); - }; - - DoStatementSyntax.create1 = function (statement, condition) { - return new DoStatementSyntax(TypeScript.Syntax.token(22 /* DoKeyword */), statement, TypeScript.Syntax.token(42 /* WhileKeyword */), TypeScript.Syntax.token(72 /* OpenParenToken */), condition, TypeScript.Syntax.token(73 /* CloseParenToken */), TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - DoStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DoStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DoStatementSyntax.prototype.withDoKeyword = function (doKeyword) { - return this.update(doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withStatement = function (statement) { - return this.update(this.doKeyword, statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withWhileKeyword = function (whileKeyword) { - return this.update(this.doKeyword, this.statement, whileKeyword, this.openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withOpenParenToken = function (openParenToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, openParenToken, this.condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withCondition = function (condition) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, condition, this.closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withCloseParenToken = function (closeParenToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, closeParenToken, this.semicolonToken); - }; - - DoStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.doKeyword, this.statement, this.whileKeyword, this.openParenToken, this.condition, this.closeParenToken, semicolonToken); - }; - - DoStatementSyntax.prototype.isTypeScriptSpecific = function () { - if (this.statement.isTypeScriptSpecific()) { - return true; - } - if (this.condition.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DoStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DoStatementSyntax = DoStatementSyntax; - - var TypeOfExpressionSyntax = (function (_super) { - __extends(TypeOfExpressionSyntax, _super); - function TypeOfExpressionSyntax(typeOfKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.typeOfKeyword = typeOfKeyword; - this.expression = expression; - } - TypeOfExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitTypeOfExpression(this); - }; - - TypeOfExpressionSyntax.prototype.kind = function () { - return 171 /* TypeOfExpression */; - }; - - TypeOfExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - TypeOfExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.typeOfKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - TypeOfExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - TypeOfExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - TypeOfExpressionSyntax.prototype.update = function (typeOfKeyword, expression) { - if (this.typeOfKeyword === typeOfKeyword && this.expression === expression) { - return this; - } - - return new TypeOfExpressionSyntax(typeOfKeyword, expression, this.parsedInStrictMode()); - }; - - TypeOfExpressionSyntax.create1 = function (expression) { - return new TypeOfExpressionSyntax(TypeScript.Syntax.token(39 /* TypeOfKeyword */), expression, false); - }; - - TypeOfExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - TypeOfExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - TypeOfExpressionSyntax.prototype.withTypeOfKeyword = function (typeOfKeyword) { - return this.update(typeOfKeyword, this.expression); - }; - - TypeOfExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.typeOfKeyword, expression); - }; - - TypeOfExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return TypeOfExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.TypeOfExpressionSyntax = TypeOfExpressionSyntax; - - var DeleteExpressionSyntax = (function (_super) { - __extends(DeleteExpressionSyntax, _super); - function DeleteExpressionSyntax(deleteKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.deleteKeyword = deleteKeyword; - this.expression = expression; - } - DeleteExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitDeleteExpression(this); - }; - - DeleteExpressionSyntax.prototype.kind = function () { - return 170 /* DeleteExpression */; - }; - - DeleteExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - DeleteExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.deleteKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DeleteExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - DeleteExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - DeleteExpressionSyntax.prototype.update = function (deleteKeyword, expression) { - if (this.deleteKeyword === deleteKeyword && this.expression === expression) { - return this; - } - - return new DeleteExpressionSyntax(deleteKeyword, expression, this.parsedInStrictMode()); - }; - - DeleteExpressionSyntax.create1 = function (expression) { - return new DeleteExpressionSyntax(TypeScript.Syntax.token(21 /* DeleteKeyword */), expression, false); - }; - - DeleteExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DeleteExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DeleteExpressionSyntax.prototype.withDeleteKeyword = function (deleteKeyword) { - return this.update(deleteKeyword, this.expression); - }; - - DeleteExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.deleteKeyword, expression); - }; - - DeleteExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return DeleteExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DeleteExpressionSyntax = DeleteExpressionSyntax; - - var VoidExpressionSyntax = (function (_super) { - __extends(VoidExpressionSyntax, _super); - function VoidExpressionSyntax(voidKeyword, expression, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.voidKeyword = voidKeyword; - this.expression = expression; - } - VoidExpressionSyntax.prototype.accept = function (visitor) { - return visitor.visitVoidExpression(this); - }; - - VoidExpressionSyntax.prototype.kind = function () { - return 172 /* VoidExpression */; - }; - - VoidExpressionSyntax.prototype.childCount = function () { - return 2; - }; - - VoidExpressionSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.voidKeyword; - case 1: - return this.expression; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - VoidExpressionSyntax.prototype.isUnaryExpression = function () { - return true; - }; - - VoidExpressionSyntax.prototype.isExpression = function () { - return true; - }; - - VoidExpressionSyntax.prototype.update = function (voidKeyword, expression) { - if (this.voidKeyword === voidKeyword && this.expression === expression) { - return this; - } - - return new VoidExpressionSyntax(voidKeyword, expression, this.parsedInStrictMode()); - }; - - VoidExpressionSyntax.create1 = function (expression) { - return new VoidExpressionSyntax(TypeScript.Syntax.token(41 /* VoidKeyword */), expression, false); - }; - - VoidExpressionSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - VoidExpressionSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - VoidExpressionSyntax.prototype.withVoidKeyword = function (voidKeyword) { - return this.update(voidKeyword, this.expression); - }; - - VoidExpressionSyntax.prototype.withExpression = function (expression) { - return this.update(this.voidKeyword, expression); - }; - - VoidExpressionSyntax.prototype.isTypeScriptSpecific = function () { - if (this.expression.isTypeScriptSpecific()) { - return true; - } - return false; - }; - return VoidExpressionSyntax; - })(TypeScript.SyntaxNode); - TypeScript.VoidExpressionSyntax = VoidExpressionSyntax; - - var DebuggerStatementSyntax = (function (_super) { - __extends(DebuggerStatementSyntax, _super); - function DebuggerStatementSyntax(debuggerKeyword, semicolonToken, parsedInStrictMode) { - _super.call(this, parsedInStrictMode); - this.debuggerKeyword = debuggerKeyword; - this.semicolonToken = semicolonToken; - } - DebuggerStatementSyntax.prototype.accept = function (visitor) { - return visitor.visitDebuggerStatement(this); - }; - - DebuggerStatementSyntax.prototype.kind = function () { - return 162 /* DebuggerStatement */; - }; - - DebuggerStatementSyntax.prototype.childCount = function () { - return 2; - }; - - DebuggerStatementSyntax.prototype.childAt = function (slot) { - switch (slot) { - case 0: - return this.debuggerKeyword; - case 1: - return this.semicolonToken; - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - DebuggerStatementSyntax.prototype.isStatement = function () { - return true; - }; - - DebuggerStatementSyntax.prototype.isModuleElement = function () { - return true; - }; - - DebuggerStatementSyntax.prototype.update = function (debuggerKeyword, semicolonToken) { - if (this.debuggerKeyword === debuggerKeyword && this.semicolonToken === semicolonToken) { - return this; - } - - return new DebuggerStatementSyntax(debuggerKeyword, semicolonToken, this.parsedInStrictMode()); - }; - - DebuggerStatementSyntax.create1 = function () { - return new DebuggerStatementSyntax(TypeScript.Syntax.token(19 /* DebuggerKeyword */), TypeScript.Syntax.token(78 /* SemicolonToken */), false); - }; - - DebuggerStatementSyntax.prototype.withLeadingTrivia = function (trivia) { - return _super.prototype.withLeadingTrivia.call(this, trivia); - }; - - DebuggerStatementSyntax.prototype.withTrailingTrivia = function (trivia) { - return _super.prototype.withTrailingTrivia.call(this, trivia); - }; - - DebuggerStatementSyntax.prototype.withDebuggerKeyword = function (debuggerKeyword) { - return this.update(debuggerKeyword, this.semicolonToken); - }; - - DebuggerStatementSyntax.prototype.withSemicolonToken = function (semicolonToken) { - return this.update(this.debuggerKeyword, semicolonToken); - }; - - DebuggerStatementSyntax.prototype.isTypeScriptSpecific = function () { - return false; - }; - return DebuggerStatementSyntax; - })(TypeScript.SyntaxNode); - TypeScript.DebuggerStatementSyntax = DebuggerStatementSyntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxRewriter = (function () { - function SyntaxRewriter() { - } - SyntaxRewriter.prototype.visitToken = function (token) { - return token; - }; - - SyntaxRewriter.prototype.visitNode = function (node) { - return node.accept(this); - }; - - SyntaxRewriter.prototype.visitNodeOrToken = function (node) { - return node.isToken() ? this.visitToken(node) : this.visitNode(node); - }; - - SyntaxRewriter.prototype.visitList = function (list) { - var newItems = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - var newItem = this.visitNodeOrToken(item); - - if (item !== newItem && newItems === null) { - newItems = []; - for (var j = 0; j < i; j++) { - newItems.push(list.childAt(j)); - } - } - - if (newItems) { - newItems.push(newItem); - } - } - - return newItems === null ? list : TypeScript.Syntax.list(newItems); - }; - - SyntaxRewriter.prototype.visitSeparatedList = function (list) { - var newItems = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - var newItem = item.isToken() ? this.visitToken(item) : this.visitNode(item); - - if (item !== newItem && newItems === null) { - newItems = []; - for (var j = 0; j < i; j++) { - newItems.push(list.childAt(j)); - } - } - - if (newItems) { - newItems.push(newItem); - } - } - - return newItems === null ? list : TypeScript.Syntax.separatedList(newItems); - }; - - SyntaxRewriter.prototype.visitSourceUnit = function (node) { - return node.update(this.visitList(node.moduleElements), this.visitToken(node.endOfFileToken)); - }; - - SyntaxRewriter.prototype.visitExternalModuleReference = function (node) { - return node.update(this.visitToken(node.requireKeyword), this.visitToken(node.openParenToken), this.visitToken(node.stringLiteral), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitModuleNameModuleReference = function (node) { - return node.update(this.visitNodeOrToken(node.moduleName)); - }; - - SyntaxRewriter.prototype.visitImportDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.importKeyword), this.visitToken(node.identifier), this.visitToken(node.equalsToken), this.visitNodeOrToken(node.moduleReference), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitExportAssignment = function (node) { - return node.update(this.visitToken(node.exportKeyword), this.visitToken(node.equalsToken), this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitClassDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.classKeyword), this.visitToken(node.identifier), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitList(node.heritageClauses), this.visitToken(node.openBraceToken), this.visitList(node.classElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitInterfaceDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.interfaceKeyword), this.visitToken(node.identifier), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitList(node.heritageClauses), this.visitNode(node.body)); - }; - - SyntaxRewriter.prototype.visitHeritageClause = function (node) { - return node.update(node.kind(), this.visitToken(node.extendsOrImplementsKeyword), this.visitSeparatedList(node.typeNames)); - }; - - SyntaxRewriter.prototype.visitModuleDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.moduleKeyword), node.name === null ? null : this.visitNodeOrToken(node.name), node.stringLiteral === null ? null : this.visitToken(node.stringLiteral), this.visitToken(node.openBraceToken), this.visitList(node.moduleElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitFunctionDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.functionKeyword), this.visitToken(node.identifier), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitVariableStatement = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.variableDeclaration), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitVariableDeclaration = function (node) { - return node.update(this.visitToken(node.varKeyword), this.visitSeparatedList(node.variableDeclarators)); - }; - - SyntaxRewriter.prototype.visitVariableDeclarator = function (node) { - return node.update(this.visitToken(node.propertyName), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitEqualsValueClause = function (node) { - return node.update(this.visitToken(node.equalsToken), this.visitNodeOrToken(node.value)); - }; - - SyntaxRewriter.prototype.visitPrefixUnaryExpression = function (node) { - return node.update(node.kind(), this.visitToken(node.operatorToken), this.visitNodeOrToken(node.operand)); - }; - - SyntaxRewriter.prototype.visitArrayLiteralExpression = function (node) { - return node.update(this.visitToken(node.openBracketToken), this.visitSeparatedList(node.expressions), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitOmittedExpression = function (node) { - return node; - }; - - SyntaxRewriter.prototype.visitParenthesizedExpression = function (node) { - return node.update(this.visitToken(node.openParenToken), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitSimpleArrowFunctionExpression = function (node) { - return node.update(this.visitToken(node.identifier), this.visitToken(node.equalsGreaterThanToken), node.block === null ? null : this.visitNode(node.block), node.expression === null ? null : this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - return node.update(this.visitNode(node.callSignature), this.visitToken(node.equalsGreaterThanToken), node.block === null ? null : this.visitNode(node.block), node.expression === null ? null : this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitQualifiedName = function (node) { - return node.update(this.visitNodeOrToken(node.left), this.visitToken(node.dotToken), this.visitToken(node.right)); - }; - - SyntaxRewriter.prototype.visitTypeArgumentList = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitSeparatedList(node.typeArguments), this.visitToken(node.greaterThanToken)); - }; - - SyntaxRewriter.prototype.visitConstructorType = function (node) { - return node.update(this.visitToken(node.newKeyword), node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), this.visitToken(node.equalsGreaterThanToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitFunctionType = function (node) { - return node.update(node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), this.visitToken(node.equalsGreaterThanToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitObjectType = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitSeparatedList(node.typeMembers), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitArrayType = function (node) { - return node.update(this.visitNodeOrToken(node.type), this.visitToken(node.openBracketToken), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitGenericType = function (node) { - return node.update(this.visitNodeOrToken(node.name), this.visitNode(node.typeArgumentList)); - }; - - SyntaxRewriter.prototype.visitTypeQuery = function (node) { - return node.update(this.visitToken(node.typeOfKeyword), this.visitNodeOrToken(node.name)); - }; - - SyntaxRewriter.prototype.visitTypeAnnotation = function (node) { - return node.update(this.visitToken(node.colonToken), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitBlock = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitList(node.statements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitParameter = function (node) { - return node.update(node.dotDotDotToken === null ? null : this.visitToken(node.dotDotDotToken), this.visitList(node.modifiers), this.visitToken(node.identifier), node.questionToken === null ? null : this.visitToken(node.questionToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitMemberAccessExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.dotToken), this.visitToken(node.name)); - }; - - SyntaxRewriter.prototype.visitPostfixUnaryExpression = function (node) { - return node.update(node.kind(), this.visitNodeOrToken(node.operand), this.visitToken(node.operatorToken)); - }; - - SyntaxRewriter.prototype.visitElementAccessExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.openBracketToken), this.visitNodeOrToken(node.argumentExpression), this.visitToken(node.closeBracketToken)); - }; - - SyntaxRewriter.prototype.visitInvocationExpression = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitNode(node.argumentList)); - }; - - SyntaxRewriter.prototype.visitArgumentList = function (node) { - return node.update(node.typeArgumentList === null ? null : this.visitNode(node.typeArgumentList), this.visitToken(node.openParenToken), this.visitSeparatedList(node.arguments), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitBinaryExpression = function (node) { - return node.update(node.kind(), this.visitNodeOrToken(node.left), this.visitToken(node.operatorToken), this.visitNodeOrToken(node.right)); - }; - - SyntaxRewriter.prototype.visitConditionalExpression = function (node) { - return node.update(this.visitNodeOrToken(node.condition), this.visitToken(node.questionToken), this.visitNodeOrToken(node.whenTrue), this.visitToken(node.colonToken), this.visitNodeOrToken(node.whenFalse)); - }; - - SyntaxRewriter.prototype.visitConstructSignature = function (node) { - return node.update(this.visitToken(node.newKeyword), this.visitNode(node.callSignature)); - }; - - SyntaxRewriter.prototype.visitMethodSignature = function (node) { - return node.update(this.visitToken(node.propertyName), node.questionToken === null ? null : this.visitToken(node.questionToken), this.visitNode(node.callSignature)); - }; - - SyntaxRewriter.prototype.visitIndexSignature = function (node) { - return node.update(this.visitToken(node.openBracketToken), this.visitNode(node.parameter), this.visitToken(node.closeBracketToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitPropertySignature = function (node) { - return node.update(this.visitToken(node.propertyName), node.questionToken === null ? null : this.visitToken(node.questionToken), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitCallSignature = function (node) { - return node.update(node.typeParameterList === null ? null : this.visitNode(node.typeParameterList), this.visitNode(node.parameterList), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation)); - }; - - SyntaxRewriter.prototype.visitParameterList = function (node) { - return node.update(this.visitToken(node.openParenToken), this.visitSeparatedList(node.parameters), this.visitToken(node.closeParenToken)); - }; - - SyntaxRewriter.prototype.visitTypeParameterList = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitSeparatedList(node.typeParameters), this.visitToken(node.greaterThanToken)); - }; - - SyntaxRewriter.prototype.visitTypeParameter = function (node) { - return node.update(this.visitToken(node.identifier), node.constraint === null ? null : this.visitNode(node.constraint)); - }; - - SyntaxRewriter.prototype.visitConstraint = function (node) { - return node.update(this.visitToken(node.extendsKeyword), this.visitNodeOrToken(node.type)); - }; - - SyntaxRewriter.prototype.visitElseClause = function (node) { - return node.update(this.visitToken(node.elseKeyword), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitIfStatement = function (node) { - return node.update(this.visitToken(node.ifKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement), node.elseClause === null ? null : this.visitNode(node.elseClause)); - }; - - SyntaxRewriter.prototype.visitExpressionStatement = function (node) { - return node.update(this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitConstructorDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.constructorKeyword), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitMemberFunctionDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.propertyName), this.visitNode(node.callSignature), node.block === null ? null : this.visitNode(node.block), node.semicolonToken === null ? null : this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitGetAccessor = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.getKeyword), this.visitToken(node.propertyName), this.visitNode(node.parameterList), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitSetAccessor = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.setKeyword), this.visitToken(node.propertyName), this.visitNode(node.parameterList), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitMemberVariableDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.variableDeclarator), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitIndexMemberDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitNode(node.indexSignature), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitThrowStatement = function (node) { - return node.update(this.visitToken(node.throwKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitReturnStatement = function (node) { - return node.update(this.visitToken(node.returnKeyword), node.expression === null ? null : this.visitNodeOrToken(node.expression), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitObjectCreationExpression = function (node) { - return node.update(this.visitToken(node.newKeyword), this.visitNodeOrToken(node.expression), node.argumentList === null ? null : this.visitNode(node.argumentList)); - }; - - SyntaxRewriter.prototype.visitSwitchStatement = function (node) { - return node.update(this.visitToken(node.switchKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken), this.visitToken(node.openBraceToken), this.visitList(node.switchClauses), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitCaseSwitchClause = function (node) { - return node.update(this.visitToken(node.caseKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.colonToken), this.visitList(node.statements)); - }; - - SyntaxRewriter.prototype.visitDefaultSwitchClause = function (node) { - return node.update(this.visitToken(node.defaultKeyword), this.visitToken(node.colonToken), this.visitList(node.statements)); - }; - - SyntaxRewriter.prototype.visitBreakStatement = function (node) { - return node.update(this.visitToken(node.breakKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitContinueStatement = function (node) { - return node.update(this.visitToken(node.continueKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitForStatement = function (node) { - return node.update(this.visitToken(node.forKeyword), this.visitToken(node.openParenToken), node.variableDeclaration === null ? null : this.visitNode(node.variableDeclaration), node.initializer === null ? null : this.visitNodeOrToken(node.initializer), this.visitToken(node.firstSemicolonToken), node.condition === null ? null : this.visitNodeOrToken(node.condition), this.visitToken(node.secondSemicolonToken), node.incrementor === null ? null : this.visitNodeOrToken(node.incrementor), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitForInStatement = function (node) { - return node.update(this.visitToken(node.forKeyword), this.visitToken(node.openParenToken), node.variableDeclaration === null ? null : this.visitNode(node.variableDeclaration), node.left === null ? null : this.visitNodeOrToken(node.left), this.visitToken(node.inKeyword), this.visitNodeOrToken(node.expression), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitWhileStatement = function (node) { - return node.update(this.visitToken(node.whileKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitWithStatement = function (node) { - return node.update(this.visitToken(node.withKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitEnumDeclaration = function (node) { - return node.update(this.visitList(node.modifiers), this.visitToken(node.enumKeyword), this.visitToken(node.identifier), this.visitToken(node.openBraceToken), this.visitSeparatedList(node.enumElements), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitEnumElement = function (node) { - return node.update(this.visitToken(node.propertyName), node.equalsValueClause === null ? null : this.visitNode(node.equalsValueClause)); - }; - - SyntaxRewriter.prototype.visitCastExpression = function (node) { - return node.update(this.visitToken(node.lessThanToken), this.visitNodeOrToken(node.type), this.visitToken(node.greaterThanToken), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitObjectLiteralExpression = function (node) { - return node.update(this.visitToken(node.openBraceToken), this.visitSeparatedList(node.propertyAssignments), this.visitToken(node.closeBraceToken)); - }; - - SyntaxRewriter.prototype.visitSimplePropertyAssignment = function (node) { - return node.update(this.visitToken(node.propertyName), this.visitToken(node.colonToken), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitFunctionPropertyAssignment = function (node) { - return node.update(this.visitToken(node.propertyName), this.visitNode(node.callSignature), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitFunctionExpression = function (node) { - return node.update(this.visitToken(node.functionKeyword), node.identifier === null ? null : this.visitToken(node.identifier), this.visitNode(node.callSignature), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitEmptyStatement = function (node) { - return node.update(this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitTryStatement = function (node) { - return node.update(this.visitToken(node.tryKeyword), this.visitNode(node.block), node.catchClause === null ? null : this.visitNode(node.catchClause), node.finallyClause === null ? null : this.visitNode(node.finallyClause)); - }; - - SyntaxRewriter.prototype.visitCatchClause = function (node) { - return node.update(this.visitToken(node.catchKeyword), this.visitToken(node.openParenToken), this.visitToken(node.identifier), node.typeAnnotation === null ? null : this.visitNode(node.typeAnnotation), this.visitToken(node.closeParenToken), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitFinallyClause = function (node) { - return node.update(this.visitToken(node.finallyKeyword), this.visitNode(node.block)); - }; - - SyntaxRewriter.prototype.visitLabeledStatement = function (node) { - return node.update(this.visitToken(node.identifier), this.visitToken(node.colonToken), this.visitNodeOrToken(node.statement)); - }; - - SyntaxRewriter.prototype.visitDoStatement = function (node) { - return node.update(this.visitToken(node.doKeyword), this.visitNodeOrToken(node.statement), this.visitToken(node.whileKeyword), this.visitToken(node.openParenToken), this.visitNodeOrToken(node.condition), this.visitToken(node.closeParenToken), this.visitToken(node.semicolonToken)); - }; - - SyntaxRewriter.prototype.visitTypeOfExpression = function (node) { - return node.update(this.visitToken(node.typeOfKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitDeleteExpression = function (node) { - return node.update(this.visitToken(node.deleteKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitVoidExpression = function (node) { - return node.update(this.visitToken(node.voidKeyword), this.visitNodeOrToken(node.expression)); - }; - - SyntaxRewriter.prototype.visitDebuggerStatement = function (node) { - return node.update(this.visitToken(node.debuggerKeyword), this.visitToken(node.semicolonToken)); - }; - return SyntaxRewriter; - })(); - TypeScript.SyntaxRewriter = SyntaxRewriter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxDedenter = (function (_super) { - __extends(SyntaxDedenter, _super); - function SyntaxDedenter(dedentFirstToken, dedentationAmount, minimumIndent, options) { - _super.call(this); - this.dedentationAmount = dedentationAmount; - this.minimumIndent = minimumIndent; - this.options = options; - this.lastTriviaWasNewLine = dedentFirstToken; - } - SyntaxDedenter.prototype.abort = function () { - this.lastTriviaWasNewLine = false; - this.dedentationAmount = 0; - }; - - SyntaxDedenter.prototype.isAborted = function () { - return this.dedentationAmount === 0; - }; - - SyntaxDedenter.prototype.visitToken = function (token) { - if (token.width() === 0) { - return token; - } - - var result = token; - if (this.lastTriviaWasNewLine) { - result = token.withLeadingTrivia(this.dedentTriviaList(token.leadingTrivia())); - } - - if (this.isAborted()) { - return token; - } - - this.lastTriviaWasNewLine = token.hasTrailingNewLine(); - return result; - }; - - SyntaxDedenter.prototype.dedentTriviaList = function (triviaList) { - var result = []; - var dedentNextWhitespace = true; - - for (var i = 0, n = triviaList.count(); i < n && !this.isAborted(); i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - var dedentThisTrivia = dedentNextWhitespace; - dedentNextWhitespace = false; - - if (dedentThisTrivia) { - if (trivia.kind() === 4 /* WhitespaceTrivia */) { - var hasFollowingNewLine = (i < triviaList.count() - 1) && triviaList.syntaxTriviaAt(i + 1).kind() === 5 /* NewLineTrivia */; - result.push(this.dedentWhitespace(trivia, hasFollowingNewLine)); - continue; - } else if (trivia.kind() !== 5 /* NewLineTrivia */) { - this.abort(); - break; - } - } - - if (trivia.kind() === 6 /* MultiLineCommentTrivia */) { - result.push(this.dedentMultiLineComment(trivia)); - continue; - } - - result.push(trivia); - if (trivia.kind() === 5 /* NewLineTrivia */) { - dedentNextWhitespace = true; - } - } - - if (dedentNextWhitespace) { - this.abort(); - } - - if (this.isAborted()) { - return triviaList; - } - - return TypeScript.Syntax.triviaList(result); - }; - - SyntaxDedenter.prototype.dedentSegment = function (segment, hasFollowingNewLineTrivia) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - - if (firstNonWhitespacePosition === segment.length) { - if (hasFollowingNewLineTrivia) { - return ""; - } - } else if (TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return segment.substring(firstNonWhitespacePosition); - } - - var firstNonWhitespaceColumn = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - - var newFirstNonWhitespaceColumn = TypeScript.MathPrototype.min(firstNonWhitespaceColumn, TypeScript.MathPrototype.max(firstNonWhitespaceColumn - this.dedentationAmount, this.minimumIndent)); - - if (newFirstNonWhitespaceColumn === firstNonWhitespaceColumn) { - this.abort(); - return segment; - } - - this.dedentationAmount = firstNonWhitespaceColumn - newFirstNonWhitespaceColumn; - TypeScript.Debug.assert(this.dedentationAmount >= 0); - - var indentationString = TypeScript.Indentation.indentationString(newFirstNonWhitespaceColumn, this.options); - - return indentationString + segment.substring(firstNonWhitespacePosition); - }; - - SyntaxDedenter.prototype.dedentWhitespace = function (trivia, hasFollowingNewLineTrivia) { - var newIndentation = this.dedentSegment(trivia.fullText(), hasFollowingNewLineTrivia); - return TypeScript.Syntax.whitespace(newIndentation); - }; - - SyntaxDedenter.prototype.dedentMultiLineComment = function (trivia) { - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - if (segments.length === 1) { - return trivia; - } - - for (var i = 1; i < segments.length; i++) { - var segment = segments[i]; - segments[i] = this.dedentSegment(segment, false); - } - - var result = segments.join(""); - - return TypeScript.Syntax.multiLineComment(result); - }; - - SyntaxDedenter.dedentNode = function (node, dedentFirstToken, dedentAmount, minimumIndent, options) { - var dedenter = new SyntaxDedenter(dedentFirstToken, dedentAmount, minimumIndent, options); - var result = node.accept(dedenter); - - if (dedenter.isAborted()) { - return node; - } - - return result; - }; - return SyntaxDedenter; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxDedenter = SyntaxDedenter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxIndenter = (function (_super) { - __extends(SyntaxIndenter, _super); - function SyntaxIndenter(indentFirstToken, indentationAmount, options) { - _super.call(this); - this.indentationAmount = indentationAmount; - this.options = options; - this.lastTriviaWasNewLine = indentFirstToken; - this.indentationTrivia = TypeScript.Indentation.indentationTrivia(this.indentationAmount, this.options); - } - SyntaxIndenter.prototype.visitToken = function (token) { - if (token.width() === 0) { - return token; - } - - var result = token; - if (this.lastTriviaWasNewLine) { - result = token.withLeadingTrivia(this.indentTriviaList(token.leadingTrivia())); - } - - this.lastTriviaWasNewLine = token.hasTrailingNewLine(); - return result; - }; - - SyntaxIndenter.prototype.indentTriviaList = function (triviaList) { - var result = []; - - var indentNextTrivia = true; - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - var indentThisTrivia = indentNextTrivia; - indentNextTrivia = false; - - switch (trivia.kind()) { - case 6 /* MultiLineCommentTrivia */: - this.indentMultiLineComment(trivia, indentThisTrivia, result); - continue; - - case 7 /* SingleLineCommentTrivia */: - case 8 /* SkippedTokenTrivia */: - this.indentSingleLineOrSkippedText(trivia, indentThisTrivia, result); - continue; - - case 4 /* WhitespaceTrivia */: - this.indentWhitespace(trivia, indentThisTrivia, result); - continue; - - case 5 /* NewLineTrivia */: - result.push(trivia); - indentNextTrivia = true; - continue; - - default: - throw TypeScript.Errors.invalidOperation(); - } - } - - if (indentNextTrivia) { - result.push(this.indentationTrivia); - } - - return TypeScript.Syntax.triviaList(result); - }; - - SyntaxIndenter.prototype.indentSegment = function (segment) { - var firstNonWhitespacePosition = TypeScript.Indentation.firstNonWhitespacePosition(segment); - - if (firstNonWhitespacePosition < segment.length && TypeScript.CharacterInfo.isLineTerminator(segment.charCodeAt(firstNonWhitespacePosition))) { - return segment; - } - - var firstNonWhitespaceColumn = TypeScript.Indentation.columnForPositionInString(segment, firstNonWhitespacePosition, this.options); - - var newFirstNonWhitespaceColumn = firstNonWhitespaceColumn + this.indentationAmount; - - var indentationString = TypeScript.Indentation.indentationString(newFirstNonWhitespaceColumn, this.options); - - return indentationString + segment.substring(firstNonWhitespacePosition); - }; - - SyntaxIndenter.prototype.indentWhitespace = function (trivia, indentThisTrivia, result) { - if (!indentThisTrivia) { - result.push(trivia); - return; - } - - var newIndentation = this.indentSegment(trivia.fullText()); - result.push(TypeScript.Syntax.whitespace(newIndentation)); - }; - - SyntaxIndenter.prototype.indentSingleLineOrSkippedText = function (trivia, indentThisTrivia, result) { - if (indentThisTrivia) { - result.push(this.indentationTrivia); - } - - result.push(trivia); - }; - - SyntaxIndenter.prototype.indentMultiLineComment = function (trivia, indentThisTrivia, result) { - if (indentThisTrivia) { - result.push(this.indentationTrivia); - } - - var segments = TypeScript.Syntax.splitMultiLineCommentTriviaIntoMultipleLines(trivia); - - for (var i = 1; i < segments.length; i++) { - segments[i] = this.indentSegment(segments[i]); - } - - var newText = segments.join(""); - result.push(TypeScript.Syntax.multiLineComment(newText)); - }; - - SyntaxIndenter.indentNode = function (node, indentFirstToken, indentAmount, options) { - var indenter = new SyntaxIndenter(indentFirstToken, indentAmount, options); - return node.accept(indenter); - }; - - SyntaxIndenter.indentNodes = function (nodes, indentFirstToken, indentAmount, options) { - var indenter = new SyntaxIndenter(indentFirstToken, indentAmount, options); - var result = TypeScript.ArrayUtilities.select(nodes, function (n) { - return n.accept(indenter); - }); - - return result; - }; - return SyntaxIndenter; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxIndenter = SyntaxIndenter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var VariableWidthTokenWithNoTrivia = (function () { - function VariableWidthTokenWithNoTrivia(fullText, kind) { - this._fullText = fullText; - this.tokenKind = kind; - } - VariableWidthTokenWithNoTrivia.prototype.clone = function () { - return new VariableWidthTokenWithNoTrivia(this._fullText, this.tokenKind); - }; - - VariableWidthTokenWithNoTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithNoTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithNoTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithNoTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithNoTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithNoTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithNoTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithNoTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithNoTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithNoTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithNoTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithNoTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithNoTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithNoTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithNoTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithNoTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithNoTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithNoTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithNoTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithNoTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithNoTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithNoTrivia; - })(); - Syntax.VariableWidthTokenWithNoTrivia = VariableWidthTokenWithNoTrivia; - - var VariableWidthTokenWithLeadingTrivia = (function () { - function VariableWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - } - VariableWidthTokenWithLeadingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithLeadingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithLeadingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithLeadingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithLeadingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingComment = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithLeadingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithLeadingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithLeadingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithLeadingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithLeadingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithLeadingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithLeadingTrivia; - })(); - Syntax.VariableWidthTokenWithLeadingTrivia = VariableWidthTokenWithLeadingTrivia; - - var VariableWidthTokenWithTrailingTrivia = (function () { - function VariableWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._trailingTriviaInfo = trailingTriviaInfo; - } - VariableWidthTokenWithTrailingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithTrailingTrivia(this._fullText, this.tokenKind, this._trailingTriviaInfo); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithTrailingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingComment = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - VariableWidthTokenWithTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - VariableWidthTokenWithTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithTrailingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithTrailingTrivia; - })(); - Syntax.VariableWidthTokenWithTrailingTrivia = VariableWidthTokenWithTrailingTrivia; - - var VariableWidthTokenWithLeadingAndTrailingTrivia = (function () { - function VariableWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - this._trailingTriviaInfo = trailingTriviaInfo; - } - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.clone = function () { - return new VariableWidthTokenWithLeadingAndTrailingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo, this._trailingTriviaInfo); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isNode = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isToken = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isList = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.childCount = function () { - return 0; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.width = function () { - return this.fullWidth() - this.leadingTriviaWidth() - this.trailingTriviaWidth(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.text = function () { - return this.fullText().substr(this.leadingTriviaWidth(), this.width()); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.value = function () { - if (this._value === undefined) { - this._value = TypeScript.Syntax.value(this); - } - - return this._value; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.valueText = function () { - if (this._valueText === undefined) { - this._valueText = TypeScript.Syntax.valueText(this); - } - - return this._valueText; - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.firstToken = function () { - return this; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.lastToken = function () { - return this; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - VariableWidthTokenWithLeadingAndTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return VariableWidthTokenWithLeadingAndTrailingTrivia; - })(); - Syntax.VariableWidthTokenWithLeadingAndTrailingTrivia = VariableWidthTokenWithLeadingAndTrailingTrivia; - - var FixedWidthTokenWithNoTrivia = (function () { - function FixedWidthTokenWithNoTrivia(kind) { - this.tokenKind = kind; - } - FixedWidthTokenWithNoTrivia.prototype.clone = function () { - return new FixedWidthTokenWithNoTrivia(this.tokenKind); - }; - - FixedWidthTokenWithNoTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithNoTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithNoTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithNoTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithNoTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithNoTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithNoTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithNoTrivia.prototype.fullText = function () { - return this.text(); - }; - - FixedWidthTokenWithNoTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithNoTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithNoTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithNoTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithNoTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithNoTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithNoTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithNoTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithNoTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithNoTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithNoTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithNoTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithNoTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithNoTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithNoTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithNoTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithNoTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithNoTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithNoTrivia; - })(); - Syntax.FixedWidthTokenWithNoTrivia = FixedWidthTokenWithNoTrivia; - - var FixedWidthTokenWithLeadingTrivia = (function () { - function FixedWidthTokenWithLeadingTrivia(fullText, kind, leadingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - } - FixedWidthTokenWithLeadingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithLeadingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithLeadingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithLeadingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithLeadingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingTrivia = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingComment = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingNewLine = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.trailingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithLeadingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithLeadingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithLeadingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithLeadingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithLeadingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithLeadingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithLeadingTrivia; - })(); - Syntax.FixedWidthTokenWithLeadingTrivia = FixedWidthTokenWithLeadingTrivia; - - var FixedWidthTokenWithTrailingTrivia = (function () { - function FixedWidthTokenWithTrailingTrivia(fullText, kind, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._trailingTriviaInfo = trailingTriviaInfo; - } - FixedWidthTokenWithTrailingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithTrailingTrivia(this._fullText, this.tokenKind, this._trailingTriviaInfo); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithTrailingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingTrivia = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingComment = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingNewLine = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.leadingTriviaWidth = function () { - return 0; - }; - FixedWidthTokenWithTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - FixedWidthTokenWithTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithTrailingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithTrailingTrivia; - })(); - Syntax.FixedWidthTokenWithTrailingTrivia = FixedWidthTokenWithTrailingTrivia; - - var FixedWidthTokenWithLeadingAndTrailingTrivia = (function () { - function FixedWidthTokenWithLeadingAndTrailingTrivia(fullText, kind, leadingTriviaInfo, trailingTriviaInfo) { - this._fullText = fullText; - this.tokenKind = kind; - this._leadingTriviaInfo = leadingTriviaInfo; - this._trailingTriviaInfo = trailingTriviaInfo; - } - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.clone = function () { - return new FixedWidthTokenWithLeadingAndTrailingTrivia(this._fullText, this.tokenKind, this._leadingTriviaInfo, this._trailingTriviaInfo); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isNode = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isToken = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isList = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isSeparatedList = function () { - return false; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.kind = function () { - return this.tokenKind; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.childCount = function () { - return 0; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange('index'); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.width = function () { - return this.text().length; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.text = function () { - return TypeScript.SyntaxFacts.getText(this.tokenKind); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.fullText = function () { - return this._fullText; - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.value = function () { - return TypeScript.Syntax.value(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.valueText = function () { - return TypeScript.Syntax.valueText(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingComment = function () { - return hasTriviaComment(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingNewLine = function () { - return hasTriviaNewLine(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasLeadingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTriviaWidth = function () { - return getTriviaWidth(this._leadingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.leadingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), 0, getTriviaWidth(this._leadingTriviaInfo), false); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingTrivia = function () { - return true; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingComment = function () { - return hasTriviaComment(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingNewLine = function () { - return hasTriviaNewLine(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasTrailingSkippedText = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTriviaWidth = function () { - return getTriviaWidth(this._trailingTriviaInfo); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.trailingTrivia = function () { - return TypeScript.Scanner.scanTrivia(TypeScript.SimpleText.fromString(this._fullText), this.leadingTriviaWidth() + this.width(), getTriviaWidth(this._trailingTriviaInfo), true); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.hasSkippedToken = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.toJSON = function (key) { - return TypeScript.Syntax.tokenToJSON(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.firstToken = function () { - return this; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.lastToken = function () { - return this; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isTypeScriptSpecific = function () { - return false; - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isIncrementallyUnusable = function () { - return this.fullWidth() === 0 || TypeScript.SyntaxFacts.isAnyDivideOrRegularExpressionToken(this.tokenKind); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.realize = function () { - return TypeScript.Syntax.realizeToken(this); - }; - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.collectTextElements = function (elements) { - collectTokenTextElements(this, elements); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isExpression = function () { - return TypeScript.Syntax.isExpression(this); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - FixedWidthTokenWithLeadingAndTrailingTrivia.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return FixedWidthTokenWithLeadingAndTrailingTrivia; - })(); - Syntax.FixedWidthTokenWithLeadingAndTrailingTrivia = FixedWidthTokenWithLeadingAndTrailingTrivia; - - function collectTokenTextElements(token, elements) { - token.leadingTrivia().collectTextElements(elements); - elements.push(token.text()); - token.trailingTrivia().collectTextElements(elements); - } - - function getTriviaWidth(value) { - return value >>> 2 /* TriviaFullWidthShift */; - } - - function hasTriviaComment(value) { - return (value & 2 /* TriviaCommentMask */) !== 0; - } - - function hasTriviaNewLine(value) { - return (value & 1 /* TriviaNewLineMask */) !== 0; - } - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - function isExpression(token) { - switch (token.tokenKind) { - case 11 /* IdentifierName */: - case 12 /* RegularExpressionLiteral */: - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 50 /* SuperKeyword */: - return true; - } - - return false; - } - Syntax.isExpression = isExpression; - - function realizeToken(token) { - return new RealizedToken(token.tokenKind, token.leadingTrivia(), token.text(), token.value(), token.valueText(), token.trailingTrivia()); - } - Syntax.realizeToken = realizeToken; - - function convertToIdentifierName(token) { - TypeScript.Debug.assert(TypeScript.SyntaxFacts.isAnyKeyword(token.tokenKind)); - return new RealizedToken(11 /* IdentifierName */, token.leadingTrivia(), token.text(), token.text(), token.text(), token.trailingTrivia()); - } - Syntax.convertToIdentifierName = convertToIdentifierName; - - function tokenToJSON(token) { - var result = {}; - - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === token.kind()) { - result.kind = name; - break; - } - } - - result.width = token.width(); - if (token.fullWidth() !== token.width()) { - result.fullWidth = token.fullWidth(); - } - - result.text = token.text(); - - var value = token.value(); - if (value !== null) { - result.value = value; - result.valueText = token.valueText(); - } - - if (token.hasLeadingTrivia()) { - result.hasLeadingTrivia = true; - } - - if (token.hasLeadingComment()) { - result.hasLeadingComment = true; - } - - if (token.hasLeadingNewLine()) { - result.hasLeadingNewLine = true; - } - - if (token.hasLeadingSkippedText()) { - result.hasLeadingSkippedText = true; - } - - if (token.hasTrailingTrivia()) { - result.hasTrailingTrivia = true; - } - - if (token.hasTrailingComment()) { - result.hasTrailingComment = true; - } - - if (token.hasTrailingNewLine()) { - result.hasTrailingNewLine = true; - } - - if (token.hasTrailingSkippedText()) { - result.hasTrailingSkippedText = true; - } - - var trivia = token.leadingTrivia(); - if (trivia.count() > 0) { - result.leadingTrivia = trivia; - } - - trivia = token.trailingTrivia(); - if (trivia.count() > 0) { - result.trailingTrivia = trivia; - } - - return result; - } - Syntax.tokenToJSON = tokenToJSON; - - function value(token) { - return value1(token.tokenKind, token.text()); - } - Syntax.value = value; - - function hexValue(text, start, length) { - var intChar = 0; - for (var i = 0; i < length; i++) { - var ch2 = text.charCodeAt(start + i); - if (!TypeScript.CharacterInfo.isHexDigit(ch2)) { - break; - } - - intChar = (intChar << 4) + TypeScript.CharacterInfo.hexValue(ch2); - } - - return intChar; - } - - var characterArray = []; - - function convertEscapes(text) { - characterArray.length = 0; - var result = ""; - - for (var i = 0, n = text.length; i < n; i++) { - var ch = text.charCodeAt(i); - - if (ch === 92 /* backslash */) { - i++; - if (i < n) { - ch = text.charCodeAt(i); - switch (ch) { - case 48 /* _0 */: - characterArray.push(0 /* nullCharacter */); - continue; - - case 98 /* b */: - characterArray.push(8 /* backspace */); - continue; - - case 102 /* f */: - characterArray.push(12 /* formFeed */); - continue; - - case 110 /* n */: - characterArray.push(10 /* lineFeed */); - continue; - - case 114 /* r */: - characterArray.push(13 /* carriageReturn */); - continue; - - case 116 /* t */: - characterArray.push(9 /* tab */); - continue; - - case 118 /* v */: - characterArray.push(11 /* verticalTab */); - continue; - - case 120 /* x */: - characterArray.push(hexValue(text, i + 1, 2)); - i += 2; - continue; - - case 117 /* u */: - characterArray.push(hexValue(text, i + 1, 4)); - i += 4; - continue; - - case 13 /* carriageReturn */: - var nextIndex = i + 1; - if (nextIndex < text.length && text.charCodeAt(nextIndex) === 10 /* lineFeed */) { - i++; - } - continue; - - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - continue; - - default: - } - } - } - - characterArray.push(ch); - - if (i && !(i % 1024)) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - characterArray.length = 0; - } - } - - if (characterArray.length) { - result = result.concat(String.fromCharCode.apply(null, characterArray)); - } - - return result; - } - - function massageEscapes(text) { - return text.indexOf("\\") >= 0 ? convertEscapes(text) : text; - } - Syntax.massageEscapes = massageEscapes; - - function value1(kind, text) { - if (kind === 11 /* IdentifierName */) { - return massageEscapes(text); - } - - switch (kind) { - case 37 /* TrueKeyword */: - return true; - case 24 /* FalseKeyword */: - return false; - case 32 /* NullKeyword */: - return null; - } - - if (TypeScript.SyntaxFacts.isAnyKeyword(kind) || TypeScript.SyntaxFacts.isAnyPunctuation(kind)) { - return TypeScript.SyntaxFacts.getText(kind); - } - - if (kind === 13 /* NumericLiteral */) { - return TypeScript.IntegerUtilities.isHexInteger(text) ? parseInt(text, 16) : parseFloat(text); - } else if (kind === 14 /* StringLiteral */) { - if (text.length > 1 && text.charCodeAt(text.length - 1) === text.charCodeAt(0)) { - return massageEscapes(text.substr(1, text.length - 2)); - } else { - return massageEscapes(text.substr(1)); - } - } else if (kind === 12 /* RegularExpressionLiteral */) { - return regularExpressionValue(text); - } else if (kind === 10 /* EndOfFileToken */ || kind === 9 /* ErrorToken */) { - return null; - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - - function regularExpressionValue(text) { - try { - var lastSlash = text.lastIndexOf("/"); - var body = text.substring(1, lastSlash); - var flags = text.substring(lastSlash + 1); - return new RegExp(body, flags); - } catch (e) { - return null; - } - } - - function valueText1(kind, text) { - var value = value1(kind, text); - return value === null ? "" : value.toString(); - } - - function valueText(token) { - var value = token.value(); - return value === null ? "" : value.toString(); - } - Syntax.valueText = valueText; - - var EmptyToken = (function () { - function EmptyToken(kind) { - this.tokenKind = kind; - } - EmptyToken.prototype.clone = function () { - return new EmptyToken(this.tokenKind); - }; - - EmptyToken.prototype.kind = function () { - return this.tokenKind; - }; - - EmptyToken.prototype.isToken = function () { - return true; - }; - EmptyToken.prototype.isNode = function () { - return false; - }; - EmptyToken.prototype.isList = function () { - return false; - }; - EmptyToken.prototype.isSeparatedList = function () { - return false; - }; - - EmptyToken.prototype.childCount = function () { - return 0; - }; - - EmptyToken.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - EmptyToken.prototype.toJSON = function (key) { - return tokenToJSON(this); - }; - EmptyToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - - EmptyToken.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - EmptyToken.prototype.firstToken = function () { - return this; - }; - EmptyToken.prototype.lastToken = function () { - return this; - }; - EmptyToken.prototype.isTypeScriptSpecific = function () { - return false; - }; - - EmptyToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - - EmptyToken.prototype.fullWidth = function () { - return 0; - }; - EmptyToken.prototype.width = function () { - return 0; - }; - EmptyToken.prototype.text = function () { - return ""; - }; - EmptyToken.prototype.fullText = function () { - return ""; - }; - EmptyToken.prototype.value = function () { - return null; - }; - EmptyToken.prototype.valueText = function () { - return ""; - }; - - EmptyToken.prototype.hasLeadingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasLeadingComment = function () { - return false; - }; - EmptyToken.prototype.hasLeadingNewLine = function () { - return false; - }; - EmptyToken.prototype.hasLeadingSkippedText = function () { - return false; - }; - EmptyToken.prototype.leadingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.hasTrailingTrivia = function () { - return false; - }; - EmptyToken.prototype.hasTrailingComment = function () { - return false; - }; - EmptyToken.prototype.hasTrailingNewLine = function () { - return false; - }; - EmptyToken.prototype.hasTrailingSkippedText = function () { - return false; - }; - EmptyToken.prototype.hasSkippedToken = function () { - return false; - }; - - EmptyToken.prototype.trailingTriviaWidth = function () { - return 0; - }; - EmptyToken.prototype.leadingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - EmptyToken.prototype.trailingTrivia = function () { - return TypeScript.Syntax.emptyTriviaList; - }; - EmptyToken.prototype.realize = function () { - return realizeToken(this); - }; - EmptyToken.prototype.collectTextElements = function (elements) { - }; - - EmptyToken.prototype.withLeadingTrivia = function (leadingTrivia) { - return this.realize().withLeadingTrivia(leadingTrivia); - }; - - EmptyToken.prototype.withTrailingTrivia = function (trailingTrivia) { - return this.realize().withTrailingTrivia(trailingTrivia); - }; - - EmptyToken.prototype.isExpression = function () { - return isExpression(this); - }; - - EmptyToken.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - EmptyToken.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return EmptyToken; - })(); - - function emptyToken(kind) { - return new EmptyToken(kind); - } - Syntax.emptyToken = emptyToken; - - var RealizedToken = (function () { - function RealizedToken(tokenKind, leadingTrivia, text, value, valueText, trailingTrivia) { - this.tokenKind = tokenKind; - this._leadingTrivia = leadingTrivia; - this._text = text; - this._value = value; - this._valueText = valueText; - this._trailingTrivia = trailingTrivia; - } - RealizedToken.prototype.clone = function () { - return new RealizedToken(this.tokenKind, this._leadingTrivia, this._text, this._value, this._valueText, this._trailingTrivia); - }; - - RealizedToken.prototype.kind = function () { - return this.tokenKind; - }; - RealizedToken.prototype.toJSON = function (key) { - return tokenToJSON(this); - }; - RealizedToken.prototype.firstToken = function () { - return this; - }; - RealizedToken.prototype.lastToken = function () { - return this; - }; - RealizedToken.prototype.isTypeScriptSpecific = function () { - return false; - }; - - RealizedToken.prototype.isIncrementallyUnusable = function () { - return true; - }; - - RealizedToken.prototype.accept = function (visitor) { - return visitor.visitToken(this); - }; - - RealizedToken.prototype.childCount = function () { - return 0; - }; - - RealizedToken.prototype.childAt = function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }; - - RealizedToken.prototype.isToken = function () { - return true; - }; - RealizedToken.prototype.isNode = function () { - return false; - }; - RealizedToken.prototype.isList = function () { - return false; - }; - RealizedToken.prototype.isSeparatedList = function () { - return false; - }; - RealizedToken.prototype.isTrivia = function () { - return false; - }; - RealizedToken.prototype.isTriviaList = function () { - return false; - }; - - RealizedToken.prototype.fullWidth = function () { - return this._leadingTrivia.fullWidth() + this.width() + this._trailingTrivia.fullWidth(); - }; - RealizedToken.prototype.width = function () { - return this.text().length; - }; - - RealizedToken.prototype.text = function () { - return this._text; - }; - RealizedToken.prototype.fullText = function () { - return this._leadingTrivia.fullText() + this.text() + this._trailingTrivia.fullText(); - }; - - RealizedToken.prototype.value = function () { - return this._value; - }; - RealizedToken.prototype.valueText = function () { - return this._valueText; - }; - - RealizedToken.prototype.hasLeadingTrivia = function () { - return this._leadingTrivia.count() > 0; - }; - RealizedToken.prototype.hasLeadingComment = function () { - return this._leadingTrivia.hasComment(); - }; - RealizedToken.prototype.hasLeadingNewLine = function () { - return this._leadingTrivia.hasNewLine(); - }; - RealizedToken.prototype.hasLeadingSkippedText = function () { - return this._leadingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.leadingTriviaWidth = function () { - return this._leadingTrivia.fullWidth(); - }; - - RealizedToken.prototype.hasTrailingTrivia = function () { - return this._trailingTrivia.count() > 0; - }; - RealizedToken.prototype.hasTrailingComment = function () { - return this._trailingTrivia.hasComment(); - }; - RealizedToken.prototype.hasTrailingNewLine = function () { - return this._trailingTrivia.hasNewLine(); - }; - RealizedToken.prototype.hasTrailingSkippedText = function () { - return this._trailingTrivia.hasSkippedToken(); - }; - RealizedToken.prototype.trailingTriviaWidth = function () { - return this._trailingTrivia.fullWidth(); - }; - - RealizedToken.prototype.hasSkippedToken = function () { - return this.hasLeadingSkippedText() || this.hasTrailingSkippedText(); - }; - - RealizedToken.prototype.leadingTrivia = function () { - return this._leadingTrivia; - }; - RealizedToken.prototype.trailingTrivia = function () { - return this._trailingTrivia; - }; - - RealizedToken.prototype.findTokenInternal = function (parent, position, fullStart) { - return new TypeScript.PositionedToken(parent, this, fullStart); - }; - - RealizedToken.prototype.collectTextElements = function (elements) { - this.leadingTrivia().collectTextElements(elements); - elements.push(this.text()); - this.trailingTrivia().collectTextElements(elements); - }; - - RealizedToken.prototype.withLeadingTrivia = function (leadingTrivia) { - return new RealizedToken(this.tokenKind, leadingTrivia, this._text, this._value, this._valueText, this._trailingTrivia); - }; - - RealizedToken.prototype.withTrailingTrivia = function (trailingTrivia) { - return new RealizedToken(this.tokenKind, this._leadingTrivia, this._text, this._value, this._valueText, trailingTrivia); - }; - - RealizedToken.prototype.isExpression = function () { - return isExpression(this); - }; - - RealizedToken.prototype.isPrimaryExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isMemberExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isPostfixExpression = function () { - return this.isExpression(); - }; - - RealizedToken.prototype.isUnaryExpression = function () { - return this.isExpression(); - }; - return RealizedToken; - })(); - - function token(kind, info) { - if (typeof info === "undefined") { info = null; } - var text = (info !== null && info.text !== undefined) ? info.text : TypeScript.SyntaxFacts.getText(kind); - - return new RealizedToken(kind, TypeScript.Syntax.triviaList(info === null ? null : info.leadingTrivia), text, value1(kind, text), valueText1(kind, text), TypeScript.Syntax.triviaList(info === null ? null : info.trailingTrivia)); - } - Syntax.token = token; - - function identifier(text, info) { - if (typeof info === "undefined") { info = null; } - info = info || {}; - info.text = text; - return token(11 /* IdentifierName */, info); - } - Syntax.identifier = identifier; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTokenReplacer = (function (_super) { - __extends(SyntaxTokenReplacer, _super); - function SyntaxTokenReplacer(token1, token2) { - _super.call(this); - this.token1 = token1; - this.token2 = token2; - } - SyntaxTokenReplacer.prototype.visitToken = function (token) { - if (token === this.token1) { - var result = this.token2; - this.token1 = null; - this.token2 = null; - - return result; - } - - return token; - }; - - SyntaxTokenReplacer.prototype.visitNode = function (node) { - if (this.token1 === null) { - return node; - } - - return _super.prototype.visitNode.call(this, node); - }; - - SyntaxTokenReplacer.prototype.visitList = function (list) { - if (this.token1 === null) { - return list; - } - - return _super.prototype.visitList.call(this, list); - }; - - SyntaxTokenReplacer.prototype.visitSeparatedList = function (list) { - if (this.token1 === null) { - return list; - } - - return _super.prototype.visitSeparatedList.call(this, list); - }; - return SyntaxTokenReplacer; - })(TypeScript.SyntaxRewriter); - TypeScript.SyntaxTokenReplacer = SyntaxTokenReplacer; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - var AbstractTrivia = (function () { - function AbstractTrivia(_kind) { - this._kind = _kind; - } - AbstractTrivia.prototype.fullWidth = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.fullText = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.abstract(); - }; - - AbstractTrivia.prototype.toJSON = function (key) { - var result = {}; - - for (var name in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind[name] === this._kind) { - result.kind = name; - break; - } - } - - if (this.isSkippedToken()) { - result.skippedToken = this.skippedToken(); - } else { - result.text = this.fullText(); - } - return result; - }; - - AbstractTrivia.prototype.kind = function () { - return this._kind; - }; - - AbstractTrivia.prototype.isWhitespace = function () { - return this.kind() === 4 /* WhitespaceTrivia */; - }; - - AbstractTrivia.prototype.isComment = function () { - return this.kind() === 7 /* SingleLineCommentTrivia */ || this.kind() === 6 /* MultiLineCommentTrivia */; - }; - - AbstractTrivia.prototype.isNewLine = function () { - return this.kind() === 5 /* NewLineTrivia */; - }; - - AbstractTrivia.prototype.isSkippedToken = function () { - return this.kind() === 8 /* SkippedTokenTrivia */; - }; - - AbstractTrivia.prototype.collectTextElements = function (elements) { - elements.push(this.fullText()); - }; - return AbstractTrivia; - })(); - - var NormalTrivia = (function (_super) { - __extends(NormalTrivia, _super); - function NormalTrivia(kind, _text) { - _super.call(this, kind); - this._text = _text; - } - NormalTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - - NormalTrivia.prototype.fullText = function () { - return this._text; - }; - - NormalTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return NormalTrivia; - })(AbstractTrivia); - - var SkippedTokenTrivia = (function (_super) { - __extends(SkippedTokenTrivia, _super); - function SkippedTokenTrivia(_skippedToken) { - _super.call(this, 8 /* SkippedTokenTrivia */); - this._skippedToken = _skippedToken; - } - SkippedTokenTrivia.prototype.fullWidth = function () { - return this.fullText().length; - }; - - SkippedTokenTrivia.prototype.fullText = function () { - return this.skippedToken().fullText(); - }; - - SkippedTokenTrivia.prototype.skippedToken = function () { - return this._skippedToken; - }; - return SkippedTokenTrivia; - })(AbstractTrivia); - - var DeferredTrivia = (function (_super) { - __extends(DeferredTrivia, _super); - function DeferredTrivia(kind, _text, _fullStart, _fullWidth) { - _super.call(this, kind); - this._text = _text; - this._fullStart = _fullStart; - this._fullWidth = _fullWidth; - this._fullText = null; - } - DeferredTrivia.prototype.fullWidth = function () { - return this._fullWidth; - }; - - DeferredTrivia.prototype.fullText = function () { - if (!this._fullText) { - this._fullText = this._text.substr(this._fullStart, this._fullWidth, false); - this._text = null; - } - - return this._fullText; - }; - - DeferredTrivia.prototype.skippedToken = function () { - throw TypeScript.Errors.invalidOperation(); - }; - return DeferredTrivia; - })(AbstractTrivia); - - function deferredTrivia(kind, text, fullStart, fullWidth) { - return new DeferredTrivia(kind, text, fullStart, fullWidth); - } - Syntax.deferredTrivia = deferredTrivia; - - function trivia(kind, text) { - return new NormalTrivia(kind, text); - } - Syntax.trivia = trivia; - - function skippedTokenTrivia(token) { - TypeScript.Debug.assert(!token.hasLeadingTrivia()); - TypeScript.Debug.assert(!token.hasTrailingTrivia()); - TypeScript.Debug.assert(token.fullWidth() > 0); - return new SkippedTokenTrivia(token); - } - Syntax.skippedTokenTrivia = skippedTokenTrivia; - - function spaces(count) { - return trivia(4 /* WhitespaceTrivia */, TypeScript.StringUtilities.repeat(" ", count)); - } - Syntax.spaces = spaces; - - function whitespace(text) { - return trivia(4 /* WhitespaceTrivia */, text); - } - Syntax.whitespace = whitespace; - - function multiLineComment(text) { - return trivia(6 /* MultiLineCommentTrivia */, text); - } - Syntax.multiLineComment = multiLineComment; - - function singleLineComment(text) { - return trivia(7 /* SingleLineCommentTrivia */, text); - } - Syntax.singleLineComment = singleLineComment; - - Syntax.spaceTrivia = spaces(1); - Syntax.lineFeedTrivia = trivia(5 /* NewLineTrivia */, "\n"); - Syntax.carriageReturnTrivia = trivia(5 /* NewLineTrivia */, "\r"); - Syntax.carriageReturnLineFeedTrivia = trivia(5 /* NewLineTrivia */, "\r\n"); - - function splitMultiLineCommentTriviaIntoMultipleLines(trivia) { - var result = []; - - var triviaText = trivia.fullText(); - var currentIndex = 0; - - for (var i = 0; i < triviaText.length; i++) { - var ch = triviaText.charCodeAt(i); - - var isCarriageReturnLineFeed = false; - switch (ch) { - case 13 /* carriageReturn */: - if (i < triviaText.length - 1 && triviaText.charCodeAt(i + 1) === 10 /* lineFeed */) { - i++; - } - - case 10 /* lineFeed */: - case 8233 /* paragraphSeparator */: - case 8232 /* lineSeparator */: - result.push(triviaText.substring(currentIndex, i + 1)); - - currentIndex = i + 1; - continue; - } - } - - result.push(triviaText.substring(currentIndex)); - return result; - } - Syntax.splitMultiLineCommentTriviaIntoMultipleLines = splitMultiLineCommentTriviaIntoMultipleLines; - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (Syntax) { - Syntax.emptyTriviaList = { - kind: function () { - return 3 /* TriviaList */; - }, - count: function () { - return 0; - }, - syntaxTriviaAt: function (index) { - throw TypeScript.Errors.argumentOutOfRange("index"); - }, - last: function () { - throw TypeScript.Errors.argumentOutOfRange("index"); - }, - fullWidth: function () { - return 0; - }, - fullText: function () { - return ""; - }, - hasComment: function () { - return false; - }, - hasNewLine: function () { - return false; - }, - hasSkippedToken: function () { - return false; - }, - toJSON: function (key) { - return []; - }, - collectTextElements: function (elements) { - }, - toArray: function () { - return []; - }, - concat: function (trivia) { - return trivia; - } - }; - - function concatTrivia(list1, list2) { - if (list1.count() === 0) { - return list2; - } - - if (list2.count() === 0) { - return list1; - } - - var trivia = list1.toArray(); - trivia.push.apply(trivia, list2.toArray()); - - return triviaList(trivia); - } - - function isComment(trivia) { - return trivia.kind() === 6 /* MultiLineCommentTrivia */ || trivia.kind() === 7 /* SingleLineCommentTrivia */; - } - - var SingletonSyntaxTriviaList = (function () { - function SingletonSyntaxTriviaList(item) { - this.item = item; - } - SingletonSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - - SingletonSyntaxTriviaList.prototype.count = function () { - return 1; - }; - - SingletonSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index !== 0) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.item; - }; - - SingletonSyntaxTriviaList.prototype.last = function () { - return this.item; - }; - - SingletonSyntaxTriviaList.prototype.fullWidth = function () { - return this.item.fullWidth(); - }; - - SingletonSyntaxTriviaList.prototype.fullText = function () { - return this.item.fullText(); - }; - - SingletonSyntaxTriviaList.prototype.hasComment = function () { - return isComment(this.item); - }; - - SingletonSyntaxTriviaList.prototype.hasNewLine = function () { - return this.item.kind() === 5 /* NewLineTrivia */; - }; - - SingletonSyntaxTriviaList.prototype.hasSkippedToken = function () { - return this.item.kind() === 8 /* SkippedTokenTrivia */; - }; - - SingletonSyntaxTriviaList.prototype.toJSON = function (key) { - return [this.item]; - }; - - SingletonSyntaxTriviaList.prototype.collectTextElements = function (elements) { - this.item.collectTextElements(elements); - }; - - SingletonSyntaxTriviaList.prototype.toArray = function () { - return [this.item]; - }; - - SingletonSyntaxTriviaList.prototype.concat = function (trivia) { - return concatTrivia(this, trivia); - }; - return SingletonSyntaxTriviaList; - })(); - - var NormalSyntaxTriviaList = (function () { - function NormalSyntaxTriviaList(trivia) { - this.trivia = trivia; - } - NormalSyntaxTriviaList.prototype.kind = function () { - return 3 /* TriviaList */; - }; - - NormalSyntaxTriviaList.prototype.count = function () { - return this.trivia.length; - }; - - NormalSyntaxTriviaList.prototype.syntaxTriviaAt = function (index) { - if (index < 0 || index >= this.trivia.length) { - throw TypeScript.Errors.argumentOutOfRange("index"); - } - - return this.trivia[index]; - }; - - NormalSyntaxTriviaList.prototype.last = function () { - return this.trivia[this.trivia.length - 1]; - }; - - NormalSyntaxTriviaList.prototype.fullWidth = function () { - return TypeScript.ArrayUtilities.sum(this.trivia, function (t) { - return t.fullWidth(); - }); - }; - - NormalSyntaxTriviaList.prototype.fullText = function () { - var result = ""; - - for (var i = 0, n = this.trivia.length; i < n; i++) { - result += this.trivia[i].fullText(); - } - - return result; - }; - - NormalSyntaxTriviaList.prototype.hasComment = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (isComment(this.trivia[i])) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.hasNewLine = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 5 /* NewLineTrivia */) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.hasSkippedToken = function () { - for (var i = 0; i < this.trivia.length; i++) { - if (this.trivia[i].kind() === 8 /* SkippedTokenTrivia */) { - return true; - } - } - - return false; - }; - - NormalSyntaxTriviaList.prototype.toJSON = function (key) { - return this.trivia; - }; - - NormalSyntaxTriviaList.prototype.collectTextElements = function (elements) { - for (var i = 0; i < this.trivia.length; i++) { - this.trivia[i].collectTextElements(elements); - } - }; - - NormalSyntaxTriviaList.prototype.toArray = function () { - return this.trivia.slice(0); - }; - - NormalSyntaxTriviaList.prototype.concat = function (trivia) { - return concatTrivia(this, trivia); - }; - return NormalSyntaxTriviaList; - })(); - - function triviaList(trivia) { - if (trivia === undefined || trivia === null || trivia.length === 0) { - return Syntax.emptyTriviaList; - } - - if (trivia.length === 1) { - return new SingletonSyntaxTriviaList(trivia[0]); - } - - return new NormalSyntaxTriviaList(trivia); - } - Syntax.triviaList = triviaList; - - Syntax.spaceTriviaList = triviaList([TypeScript.Syntax.spaceTrivia]); - })(TypeScript.Syntax || (TypeScript.Syntax = {})); - var Syntax = TypeScript.Syntax; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxUtilities = (function () { - function SyntaxUtilities() { - } - SyntaxUtilities.isAngleBracket = function (positionedElement) { - var element = positionedElement.element(); - var parent = positionedElement.parentElement(); - if (parent !== null && (element.kind() === 80 /* LessThanToken */ || element.kind() === 81 /* GreaterThanToken */)) { - switch (parent.kind()) { - case 228 /* TypeArgumentList */: - case 229 /* TypeParameterList */: - case 220 /* CastExpression */: - return true; - } - } - - return false; - }; - - SyntaxUtilities.getToken = function (list, kind) { - for (var i = 0, n = list.childCount(); i < n; i++) { - var token = list.childAt(i); - if (token.tokenKind === kind) { - return token; - } - } - - return null; - }; - - SyntaxUtilities.containsToken = function (list, kind) { - return SyntaxUtilities.getToken(list, kind) !== null; - }; - - SyntaxUtilities.hasExportKeyword = function (moduleElement) { - return SyntaxUtilities.getExportKeyword(moduleElement) !== null; - }; - - SyntaxUtilities.getExportKeyword = function (moduleElement) { - switch (moduleElement.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - case 128 /* InterfaceDeclaration */: - case 133 /* ImportDeclaration */: - return SyntaxUtilities.getToken(moduleElement.modifiers, 47 /* ExportKeyword */); - default: - return null; - } - }; - - SyntaxUtilities.isAmbientDeclarationSyntax = function (positionNode) { - if (!positionNode) { - return false; - } - - var node = positionNode.node(); - switch (node.kind()) { - case 130 /* ModuleDeclaration */: - case 131 /* ClassDeclaration */: - case 129 /* FunctionDeclaration */: - case 148 /* VariableStatement */: - case 132 /* EnumDeclaration */: - if (SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - return true; - } - - case 133 /* ImportDeclaration */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - if (node.isClassElement() || node.isModuleElement()) { - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode()); - } - - case 243 /* EnumElement */: - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode().containingNode()); - - default: - return SyntaxUtilities.isAmbientDeclarationSyntax(positionNode.containingNode()); - } - }; - return SyntaxUtilities; - })(); - TypeScript.SyntaxUtilities = SyntaxUtilities; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxVisitor = (function () { - function SyntaxVisitor() { - } - SyntaxVisitor.prototype.defaultVisit = function (node) { - return null; - }; - - SyntaxVisitor.prototype.visitToken = function (token) { - return this.defaultVisit(token); - }; - - SyntaxVisitor.prototype.visitSourceUnit = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExternalModuleReference = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitModuleNameModuleReference = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitImportDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExportAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitClassDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitInterfaceDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitHeritageClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitModuleDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVariableDeclarator = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEqualsValueClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPrefixUnaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArrayLiteralExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitOmittedExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParenthesizedExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitQualifiedName = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeArgumentList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructorType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArrayType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitGenericType = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeQuery = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeAnnotation = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBlock = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParameter = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberAccessExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPostfixUnaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitElementAccessExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitInvocationExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitArgumentList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBinaryExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConditionalExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMethodSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIndexSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitPropertySignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCallSignature = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitParameterList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeParameterList = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeParameter = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstraint = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitElseClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIfStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitExpressionStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitConstructorDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitGetAccessor = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSetAccessor = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitMemberVariableDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitIndexMemberDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitThrowStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitReturnStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectCreationExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSwitchStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCaseSwitchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDefaultSwitchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitBreakStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitContinueStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitForStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitForInStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitWhileStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitWithStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEnumDeclaration = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEnumElement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCastExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitObjectLiteralExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitSimplePropertyAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFunctionExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitEmptyStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTryStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitCatchClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitFinallyClause = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitLabeledStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDoStatement = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitTypeOfExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDeleteExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitVoidExpression = function (node) { - return this.defaultVisit(node); - }; - - SyntaxVisitor.prototype.visitDebuggerStatement = function (node) { - return this.defaultVisit(node); - }; - return SyntaxVisitor; - })(); - TypeScript.SyntaxVisitor = SyntaxVisitor; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxWalker = (function () { - function SyntaxWalker() { - } - SyntaxWalker.prototype.visitToken = function (token) { - }; - - SyntaxWalker.prototype.visitNode = function (node) { - node.accept(this); - }; - - SyntaxWalker.prototype.visitNodeOrToken = function (nodeOrToken) { - if (nodeOrToken.isToken()) { - this.visitToken(nodeOrToken); - } else { - this.visitNode(nodeOrToken); - } - }; - - SyntaxWalker.prototype.visitOptionalToken = function (token) { - if (token === null) { - return; - } - - this.visitToken(token); - }; - - SyntaxWalker.prototype.visitOptionalNode = function (node) { - if (node === null) { - return; - } - - this.visitNode(node); - }; - - SyntaxWalker.prototype.visitOptionalNodeOrToken = function (nodeOrToken) { - if (nodeOrToken === null) { - return; - } - - this.visitNodeOrToken(nodeOrToken); - }; - - SyntaxWalker.prototype.visitList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - this.visitNodeOrToken(list.childAt(i)); - } - }; - - SyntaxWalker.prototype.visitSeparatedList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - var item = list.childAt(i); - this.visitNodeOrToken(item); - } - }; - - SyntaxWalker.prototype.visitSourceUnit = function (node) { - this.visitList(node.moduleElements); - this.visitToken(node.endOfFileToken); - }; - - SyntaxWalker.prototype.visitExternalModuleReference = function (node) { - this.visitToken(node.requireKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.stringLiteral); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitModuleNameModuleReference = function (node) { - this.visitNodeOrToken(node.moduleName); - }; - - SyntaxWalker.prototype.visitImportDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.importKeyword); - this.visitToken(node.identifier); - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.moduleReference); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitExportAssignment = function (node) { - this.visitToken(node.exportKeyword); - this.visitToken(node.equalsToken); - this.visitToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitClassDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.classKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitToken(node.openBraceToken); - this.visitList(node.classElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitInterfaceDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.interfaceKeyword); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeParameterList); - this.visitList(node.heritageClauses); - this.visitNode(node.body); - }; - - SyntaxWalker.prototype.visitHeritageClause = function (node) { - this.visitToken(node.extendsOrImplementsKeyword); - this.visitSeparatedList(node.typeNames); - }; - - SyntaxWalker.prototype.visitModuleDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.moduleKeyword); - this.visitOptionalNodeOrToken(node.name); - this.visitOptionalToken(node.stringLiteral); - this.visitToken(node.openBraceToken); - this.visitList(node.moduleElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.functionKeyword); - this.visitToken(node.identifier); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitVariableStatement = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclaration); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitVariableDeclaration = function (node) { - this.visitToken(node.varKeyword); - this.visitSeparatedList(node.variableDeclarators); - }; - - SyntaxWalker.prototype.visitVariableDeclarator = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitEqualsValueClause = function (node) { - this.visitToken(node.equalsToken); - this.visitNodeOrToken(node.value); - }; - - SyntaxWalker.prototype.visitPrefixUnaryExpression = function (node) { - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.operand); - }; - - SyntaxWalker.prototype.visitArrayLiteralExpression = function (node) { - this.visitToken(node.openBracketToken); - this.visitSeparatedList(node.expressions); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitOmittedExpression = function (node) { - }; - - SyntaxWalker.prototype.visitParenthesizedExpression = function (node) { - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitSimpleArrowFunctionExpression = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - this.visitNode(node.callSignature); - this.visitToken(node.equalsGreaterThanToken); - this.visitOptionalNode(node.block); - this.visitOptionalNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitQualifiedName = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.dotToken); - this.visitToken(node.right); - }; - - SyntaxWalker.prototype.visitTypeArgumentList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeArguments); - this.visitToken(node.greaterThanToken); - }; - - SyntaxWalker.prototype.visitConstructorType = function (node) { - this.visitToken(node.newKeyword); - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitFunctionType = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitToken(node.equalsGreaterThanToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitObjectType = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.typeMembers); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitArrayType = function (node) { - this.visitNodeOrToken(node.type); - this.visitToken(node.openBracketToken); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitGenericType = function (node) { - this.visitNodeOrToken(node.name); - this.visitNode(node.typeArgumentList); - }; - - SyntaxWalker.prototype.visitTypeQuery = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.name); - }; - - SyntaxWalker.prototype.visitTypeAnnotation = function (node) { - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitBlock = function (node) { - this.visitToken(node.openBraceToken); - this.visitList(node.statements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitParameter = function (node) { - this.visitOptionalToken(node.dotDotDotToken); - this.visitList(node.modifiers); - this.visitToken(node.identifier); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitMemberAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.dotToken); - this.visitToken(node.name); - }; - - SyntaxWalker.prototype.visitPostfixUnaryExpression = function (node) { - this.visitNodeOrToken(node.operand); - this.visitToken(node.operatorToken); - }; - - SyntaxWalker.prototype.visitElementAccessExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.openBracketToken); - this.visitNodeOrToken(node.argumentExpression); - this.visitToken(node.closeBracketToken); - }; - - SyntaxWalker.prototype.visitInvocationExpression = function (node) { - this.visitNodeOrToken(node.expression); - this.visitNode(node.argumentList); - }; - - SyntaxWalker.prototype.visitArgumentList = function (node) { - this.visitOptionalNode(node.typeArgumentList); - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.arguments); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitBinaryExpression = function (node) { - this.visitNodeOrToken(node.left); - this.visitToken(node.operatorToken); - this.visitNodeOrToken(node.right); - }; - - SyntaxWalker.prototype.visitConditionalExpression = function (node) { - this.visitNodeOrToken(node.condition); - this.visitToken(node.questionToken); - this.visitNodeOrToken(node.whenTrue); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.whenFalse); - }; - - SyntaxWalker.prototype.visitConstructSignature = function (node) { - this.visitToken(node.newKeyword); - this.visitNode(node.callSignature); - }; - - SyntaxWalker.prototype.visitMethodSignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitNode(node.callSignature); - }; - - SyntaxWalker.prototype.visitIndexSignature = function (node) { - this.visitToken(node.openBracketToken); - this.visitNode(node.parameter); - this.visitToken(node.closeBracketToken); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitPropertySignature = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalToken(node.questionToken); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitCallSignature = function (node) { - this.visitOptionalNode(node.typeParameterList); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - }; - - SyntaxWalker.prototype.visitParameterList = function (node) { - this.visitToken(node.openParenToken); - this.visitSeparatedList(node.parameters); - this.visitToken(node.closeParenToken); - }; - - SyntaxWalker.prototype.visitTypeParameterList = function (node) { - this.visitToken(node.lessThanToken); - this.visitSeparatedList(node.typeParameters); - this.visitToken(node.greaterThanToken); - }; - - SyntaxWalker.prototype.visitTypeParameter = function (node) { - this.visitToken(node.identifier); - this.visitOptionalNode(node.constraint); - }; - - SyntaxWalker.prototype.visitConstraint = function (node) { - this.visitToken(node.extendsKeyword); - this.visitNodeOrToken(node.type); - }; - - SyntaxWalker.prototype.visitElseClause = function (node) { - this.visitToken(node.elseKeyword); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitIfStatement = function (node) { - this.visitToken(node.ifKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - this.visitOptionalNode(node.elseClause); - }; - - SyntaxWalker.prototype.visitExpressionStatement = function (node) { - this.visitNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitConstructorDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.constructorKeyword); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitMemberFunctionDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitOptionalNode(node.block); - this.visitOptionalToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitGetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.getKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.parameterList); - this.visitOptionalNode(node.typeAnnotation); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitSetAccessor = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.setKeyword); - this.visitToken(node.propertyName); - this.visitNode(node.parameterList); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitMemberVariableDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.variableDeclarator); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitIndexMemberDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitNode(node.indexSignature); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitThrowStatement = function (node) { - this.visitToken(node.throwKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitReturnStatement = function (node) { - this.visitToken(node.returnKeyword); - this.visitOptionalNodeOrToken(node.expression); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitObjectCreationExpression = function (node) { - this.visitToken(node.newKeyword); - this.visitNodeOrToken(node.expression); - this.visitOptionalNode(node.argumentList); - }; - - SyntaxWalker.prototype.visitSwitchStatement = function (node) { - this.visitToken(node.switchKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitToken(node.openBraceToken); - this.visitList(node.switchClauses); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitCaseSwitchClause = function (node) { - this.visitToken(node.caseKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - - SyntaxWalker.prototype.visitDefaultSwitchClause = function (node) { - this.visitToken(node.defaultKeyword); - this.visitToken(node.colonToken); - this.visitList(node.statements); - }; - - SyntaxWalker.prototype.visitBreakStatement = function (node) { - this.visitToken(node.breakKeyword); - this.visitOptionalToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitContinueStatement = function (node) { - this.visitToken(node.continueKeyword); - this.visitOptionalToken(node.identifier); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitForStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.initializer); - this.visitToken(node.firstSemicolonToken); - this.visitOptionalNodeOrToken(node.condition); - this.visitToken(node.secondSemicolonToken); - this.visitOptionalNodeOrToken(node.incrementor); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitForInStatement = function (node) { - this.visitToken(node.forKeyword); - this.visitToken(node.openParenToken); - this.visitOptionalNode(node.variableDeclaration); - this.visitOptionalNodeOrToken(node.left); - this.visitToken(node.inKeyword); - this.visitNodeOrToken(node.expression); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitWhileStatement = function (node) { - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitWithStatement = function (node) { - this.visitToken(node.withKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitEnumDeclaration = function (node) { - this.visitList(node.modifiers); - this.visitToken(node.enumKeyword); - this.visitToken(node.identifier); - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.enumElements); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitEnumElement = function (node) { - this.visitToken(node.propertyName); - this.visitOptionalNode(node.equalsValueClause); - }; - - SyntaxWalker.prototype.visitCastExpression = function (node) { - this.visitToken(node.lessThanToken); - this.visitNodeOrToken(node.type); - this.visitToken(node.greaterThanToken); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitObjectLiteralExpression = function (node) { - this.visitToken(node.openBraceToken); - this.visitSeparatedList(node.propertyAssignments); - this.visitToken(node.closeBraceToken); - }; - - SyntaxWalker.prototype.visitSimplePropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitFunctionPropertyAssignment = function (node) { - this.visitToken(node.propertyName); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitFunctionExpression = function (node) { - this.visitToken(node.functionKeyword); - this.visitOptionalToken(node.identifier); - this.visitNode(node.callSignature); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitEmptyStatement = function (node) { - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitTryStatement = function (node) { - this.visitToken(node.tryKeyword); - this.visitNode(node.block); - this.visitOptionalNode(node.catchClause); - this.visitOptionalNode(node.finallyClause); - }; - - SyntaxWalker.prototype.visitCatchClause = function (node) { - this.visitToken(node.catchKeyword); - this.visitToken(node.openParenToken); - this.visitToken(node.identifier); - this.visitOptionalNode(node.typeAnnotation); - this.visitToken(node.closeParenToken); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitFinallyClause = function (node) { - this.visitToken(node.finallyKeyword); - this.visitNode(node.block); - }; - - SyntaxWalker.prototype.visitLabeledStatement = function (node) { - this.visitToken(node.identifier); - this.visitToken(node.colonToken); - this.visitNodeOrToken(node.statement); - }; - - SyntaxWalker.prototype.visitDoStatement = function (node) { - this.visitToken(node.doKeyword); - this.visitNodeOrToken(node.statement); - this.visitToken(node.whileKeyword); - this.visitToken(node.openParenToken); - this.visitNodeOrToken(node.condition); - this.visitToken(node.closeParenToken); - this.visitToken(node.semicolonToken); - }; - - SyntaxWalker.prototype.visitTypeOfExpression = function (node) { - this.visitToken(node.typeOfKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitDeleteExpression = function (node) { - this.visitToken(node.deleteKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitVoidExpression = function (node) { - this.visitToken(node.voidKeyword); - this.visitNodeOrToken(node.expression); - }; - - SyntaxWalker.prototype.visitDebuggerStatement = function (node) { - this.visitToken(node.debuggerKeyword); - this.visitToken(node.semicolonToken); - }; - return SyntaxWalker; - })(); - TypeScript.SyntaxWalker = SyntaxWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PositionTrackingWalker = (function (_super) { - __extends(PositionTrackingWalker, _super); - function PositionTrackingWalker() { - _super.apply(this, arguments); - this._position = 0; - } - PositionTrackingWalker.prototype.visitToken = function (token) { - this._position += token.fullWidth(); - }; - - PositionTrackingWalker.prototype.position = function () { - return this._position; - }; - - PositionTrackingWalker.prototype.skip = function (element) { - this._position += element.fullWidth(); - }; - return PositionTrackingWalker; - })(TypeScript.SyntaxWalker); - TypeScript.PositionTrackingWalker = PositionTrackingWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxInformationMap = (function (_super) { - __extends(SyntaxInformationMap, _super); - function SyntaxInformationMap(trackParents, trackPreviousToken) { - _super.call(this); - this.trackParents = trackParents; - this.trackPreviousToken = trackPreviousToken; - this.tokenToInformation = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this.elementToPosition = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this._previousToken = null; - this._previousTokenInformation = null; - this._currentPosition = 0; - this._elementToParent = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - this._parentStack = []; - this._parentStack.push(null); - } - SyntaxInformationMap.create = function (node, trackParents, trackPreviousToken) { - var map = new SyntaxInformationMap(trackParents, trackPreviousToken); - map.visitNode(node); - return map; - }; - - SyntaxInformationMap.prototype.visitNode = function (node) { - this.trackParents && this._elementToParent.add(node, TypeScript.ArrayUtilities.last(this._parentStack)); - this.elementToPosition.add(node, this._currentPosition); - - this.trackParents && this._parentStack.push(node); - _super.prototype.visitNode.call(this, node); - this.trackParents && this._parentStack.pop(); - }; - - SyntaxInformationMap.prototype.visitToken = function (token) { - this.trackParents && this._elementToParent.add(token, TypeScript.ArrayUtilities.last(this._parentStack)); - - if (this.trackPreviousToken) { - var tokenInformation = { - previousToken: this._previousToken, - nextToken: null - }; - - if (this._previousTokenInformation !== null) { - this._previousTokenInformation.nextToken = token; - } - - this._previousToken = token; - this._previousTokenInformation = tokenInformation; - - this.tokenToInformation.add(token, tokenInformation); - } - - this.elementToPosition.add(token, this._currentPosition); - this._currentPosition += token.fullWidth(); - }; - - SyntaxInformationMap.prototype.parent = function (element) { - return this._elementToParent.get(element); - }; - - SyntaxInformationMap.prototype.fullStart = function (element) { - return this.elementToPosition.get(element); - }; - - SyntaxInformationMap.prototype.start = function (element) { - return this.fullStart(element) + element.leadingTriviaWidth(); - }; - - SyntaxInformationMap.prototype.end = function (element) { - return this.start(element) + element.width(); - }; - - SyntaxInformationMap.prototype.previousToken = function (token) { - return this.tokenInformation(token).previousToken; - }; - - SyntaxInformationMap.prototype.tokenInformation = function (token) { - return this.tokenToInformation.get(token); - }; - - SyntaxInformationMap.prototype.firstTokenInLineContainingToken = function (token) { - var current = token; - while (true) { - var information = this.tokenInformation(current); - if (this.isFirstTokenInLineWorker(information)) { - break; - } - - current = information.previousToken; - } - - return current; - }; - - SyntaxInformationMap.prototype.isFirstTokenInLine = function (token) { - var information = this.tokenInformation(token); - return this.isFirstTokenInLineWorker(information); - }; - - SyntaxInformationMap.prototype.isFirstTokenInLineWorker = function (information) { - return information.previousToken === null || information.previousToken.hasTrailingNewLine(); - }; - return SyntaxInformationMap; - })(TypeScript.SyntaxWalker); - TypeScript.SyntaxInformationMap = SyntaxInformationMap; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxNodeInvariantsChecker = (function (_super) { - __extends(SyntaxNodeInvariantsChecker, _super); - function SyntaxNodeInvariantsChecker() { - _super.apply(this, arguments); - this.tokenTable = TypeScript.Collections.createHashTable(TypeScript.Collections.DefaultHashTableCapacity, TypeScript.Collections.identityHashCode); - } - SyntaxNodeInvariantsChecker.checkInvariants = function (node) { - node.accept(new SyntaxNodeInvariantsChecker()); - }; - - SyntaxNodeInvariantsChecker.prototype.visitToken = function (token) { - this.tokenTable.add(token, token); - }; - return SyntaxNodeInvariantsChecker; - })(TypeScript.SyntaxWalker); - TypeScript.SyntaxNodeInvariantsChecker = SyntaxNodeInvariantsChecker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DepthLimitedWalker = (function (_super) { - __extends(DepthLimitedWalker, _super); - function DepthLimitedWalker(maximumDepth) { - _super.call(this); - this._depth = 0; - this._maximumDepth = 0; - this._maximumDepth = maximumDepth; - } - DepthLimitedWalker.prototype.visitNode = function (node) { - if (this._depth < this._maximumDepth) { - this._depth++; - _super.prototype.visitNode.call(this, node); - this._depth--; - } else { - this.skip(node); - } - }; - return DepthLimitedWalker; - })(TypeScript.PositionTrackingWalker); - TypeScript.DepthLimitedWalker = DepthLimitedWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (Parser) { - - - var ExpressionPrecedence; - (function (ExpressionPrecedence) { - ExpressionPrecedence[ExpressionPrecedence["CommaExpressionPrecedence"] = 1] = "CommaExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["AssignmentExpressionPrecedence"] = 2] = "AssignmentExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["ConditionalExpressionPrecedence"] = 3] = "ConditionalExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["ArrowFunctionPrecedence"] = 4] = "ArrowFunctionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["LogicalOrExpressionPrecedence"] = 5] = "LogicalOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["LogicalAndExpressionPrecedence"] = 6] = "LogicalAndExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseOrExpressionPrecedence"] = 7] = "BitwiseOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseExclusiveOrExpressionPrecedence"] = 8] = "BitwiseExclusiveOrExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["BitwiseAndExpressionPrecedence"] = 9] = "BitwiseAndExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["EqualityExpressionPrecedence"] = 10] = "EqualityExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["RelationalExpressionPrecedence"] = 11] = "RelationalExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["ShiftExpressionPrecdence"] = 12] = "ShiftExpressionPrecdence"; - ExpressionPrecedence[ExpressionPrecedence["AdditiveExpressionPrecedence"] = 13] = "AdditiveExpressionPrecedence"; - ExpressionPrecedence[ExpressionPrecedence["MultiplicativeExpressionPrecedence"] = 14] = "MultiplicativeExpressionPrecedence"; - - ExpressionPrecedence[ExpressionPrecedence["UnaryExpressionPrecedence"] = 15] = "UnaryExpressionPrecedence"; - })(ExpressionPrecedence || (ExpressionPrecedence = {})); - - var ListParsingState; - (function (ListParsingState) { - ListParsingState[ListParsingState["SourceUnit_ModuleElements"] = 1 << 0] = "SourceUnit_ModuleElements"; - ListParsingState[ListParsingState["ClassDeclaration_ClassElements"] = 1 << 1] = "ClassDeclaration_ClassElements"; - ListParsingState[ListParsingState["ModuleDeclaration_ModuleElements"] = 1 << 2] = "ModuleDeclaration_ModuleElements"; - ListParsingState[ListParsingState["SwitchStatement_SwitchClauses"] = 1 << 3] = "SwitchStatement_SwitchClauses"; - ListParsingState[ListParsingState["SwitchClause_Statements"] = 1 << 4] = "SwitchClause_Statements"; - ListParsingState[ListParsingState["Block_Statements"] = 1 << 5] = "Block_Statements"; - ListParsingState[ListParsingState["TryBlock_Statements"] = 1 << 6] = "TryBlock_Statements"; - ListParsingState[ListParsingState["CatchBlock_Statements"] = 1 << 7] = "CatchBlock_Statements"; - ListParsingState[ListParsingState["EnumDeclaration_EnumElements"] = 1 << 8] = "EnumDeclaration_EnumElements"; - ListParsingState[ListParsingState["ObjectType_TypeMembers"] = 1 << 9] = "ObjectType_TypeMembers"; - ListParsingState[ListParsingState["ClassOrInterfaceDeclaration_HeritageClauses"] = 1 << 10] = "ClassOrInterfaceDeclaration_HeritageClauses"; - ListParsingState[ListParsingState["HeritageClause_TypeNameList"] = 1 << 11] = "HeritageClause_TypeNameList"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_AllowIn"] = 1 << 12] = "VariableDeclaration_VariableDeclarators_AllowIn"; - ListParsingState[ListParsingState["VariableDeclaration_VariableDeclarators_DisallowIn"] = 1 << 13] = "VariableDeclaration_VariableDeclarators_DisallowIn"; - ListParsingState[ListParsingState["ArgumentList_AssignmentExpressions"] = 1 << 14] = "ArgumentList_AssignmentExpressions"; - ListParsingState[ListParsingState["ObjectLiteralExpression_PropertyAssignments"] = 1 << 15] = "ObjectLiteralExpression_PropertyAssignments"; - ListParsingState[ListParsingState["ArrayLiteralExpression_AssignmentExpressions"] = 1 << 16] = "ArrayLiteralExpression_AssignmentExpressions"; - ListParsingState[ListParsingState["ParameterList_Parameters"] = 1 << 17] = "ParameterList_Parameters"; - ListParsingState[ListParsingState["TypeArgumentList_Types"] = 1 << 18] = "TypeArgumentList_Types"; - ListParsingState[ListParsingState["TypeParameterList_TypeParameters"] = 1 << 19] = "TypeParameterList_TypeParameters"; - - ListParsingState[ListParsingState["FirstListParsingState"] = ListParsingState.SourceUnit_ModuleElements] = "FirstListParsingState"; - ListParsingState[ListParsingState["LastListParsingState"] = ListParsingState.TypeParameterList_TypeParameters] = "LastListParsingState"; - })(ListParsingState || (ListParsingState = {})); - - var SyntaxCursor = (function () { - function SyntaxCursor(sourceUnit) { - this._elements = []; - this._index = 0; - this._pinCount = 0; - sourceUnit.insertChildrenInto(this._elements, 0); - } - SyntaxCursor.prototype.isFinished = function () { - return this._index === this._elements.length; - }; - - SyntaxCursor.prototype.currentElement = function () { - if (this.isFinished()) { - return null; - } - - return this._elements[this._index]; - }; - - SyntaxCursor.prototype.currentNode = function () { - var element = this.currentElement(); - return element !== null && element.isNode() ? element : null; - }; - - SyntaxCursor.prototype.moveToFirstChild = function () { - if (this.isFinished()) { - return; - } - - var element = this._elements[this._index]; - if (element.isToken()) { - return; - } - - var node = element; - - this._elements.splice(this._index, 1); - - node.insertChildrenInto(this._elements, this._index); - }; - - SyntaxCursor.prototype.moveToNextSibling = function () { - if (this.isFinished()) { - return; - } - - if (this._pinCount > 0) { - this._index++; - return; - } - - this._elements.shift(); - }; - - SyntaxCursor.prototype.getAndPinCursorIndex = function () { - this._pinCount++; - return this._index; - }; - - SyntaxCursor.prototype.releaseAndUnpinCursorIndex = function (index) { - this._pinCount--; - if (this._pinCount === 0) { - } - }; - - SyntaxCursor.prototype.rewindToPinnedCursorIndex = function (index) { - this._index = index; - }; - - SyntaxCursor.prototype.pinCount = function () { - return this._pinCount; - }; - - SyntaxCursor.prototype.moveToFirstToken = function () { - var element; - - while (!this.isFinished()) { - element = this.currentElement(); - if (element.isNode()) { - this.moveToFirstChild(); - continue; - } - - return; - } - }; - - SyntaxCursor.prototype.currentToken = function () { - this.moveToFirstToken(); - if (this.isFinished()) { - return null; - } - - var element = this.currentElement(); - - return element; - }; - - SyntaxCursor.prototype.peekToken = function (n) { - this.moveToFirstToken(); - var pin = this.getAndPinCursorIndex(); - - for (var i = 0; i < n; i++) { - this.moveToNextSibling(); - this.moveToFirstToken(); - } - - var result = this.currentToken(); - this.rewindToPinnedCursorIndex(pin); - this.releaseAndUnpinCursorIndex(pin); - - return result; - }; - return SyntaxCursor; - })(); - - - - var NormalParserSource = (function () { - function NormalParserSource(fileName, text, languageVersion) { - this._previousToken = null; - this._absolutePosition = 0; - this._tokenDiagnostics = []; - this.rewindPointPool = []; - this.rewindPointPoolCount = 0; - this.slidingWindow = new TypeScript.SlidingWindow(this, TypeScript.ArrayUtilities.createArray(32, null), null); - this.scanner = new TypeScript.Scanner(fileName, text, languageVersion); - } - NormalParserSource.prototype.currentNode = function () { - return null; - }; - - NormalParserSource.prototype.moveToNextNode = function () { - throw TypeScript.Errors.invalidOperation(); - }; - - NormalParserSource.prototype.absolutePosition = function () { - return this._absolutePosition; - }; - - NormalParserSource.prototype.previousToken = function () { - return this._previousToken; - }; - - NormalParserSource.prototype.tokenDiagnostics = function () { - return this._tokenDiagnostics; - }; - - NormalParserSource.prototype.getOrCreateRewindPoint = function () { - if (this.rewindPointPoolCount === 0) { - return {}; - } - - this.rewindPointPoolCount--; - var result = this.rewindPointPool[this.rewindPointPoolCount]; - this.rewindPointPool[this.rewindPointPoolCount] = null; - return result; - }; - - NormalParserSource.prototype.getRewindPoint = function () { - var slidingWindowIndex = this.slidingWindow.getAndPinAbsoluteIndex(); - - var rewindPoint = this.getOrCreateRewindPoint(); - - rewindPoint.slidingWindowIndex = slidingWindowIndex; - rewindPoint.previousToken = this._previousToken; - rewindPoint.absolutePosition = this._absolutePosition; - - rewindPoint.pinCount = this.slidingWindow.pinCount(); - - return rewindPoint; - }; - - NormalParserSource.prototype.isPinned = function () { - return this.slidingWindow.pinCount() > 0; - }; - - NormalParserSource.prototype.rewind = function (rewindPoint) { - this.slidingWindow.rewindToPinnedIndex(rewindPoint.slidingWindowIndex); - - this._previousToken = rewindPoint.previousToken; - this._absolutePosition = rewindPoint.absolutePosition; - }; - - NormalParserSource.prototype.releaseRewindPoint = function (rewindPoint) { - this.slidingWindow.releaseAndUnpinAbsoluteIndex(rewindPoint.absoluteIndex); - - this.rewindPointPool[this.rewindPointPoolCount] = rewindPoint; - this.rewindPointPoolCount++; - }; - - NormalParserSource.prototype.fetchMoreItems = function (allowRegularExpression, sourceIndex, window, destinationIndex, spaceAvailable) { - window[destinationIndex] = this.scanner.scan(this._tokenDiagnostics, allowRegularExpression); - return 1; - }; - - NormalParserSource.prototype.peekToken = function (n) { - return this.slidingWindow.peekItemN(n); - }; - - NormalParserSource.prototype.moveToNextToken = function () { - var currentToken = this.currentToken(); - this._absolutePosition += currentToken.fullWidth(); - this._previousToken = currentToken; - - this.slidingWindow.moveToNextItem(); - }; - - NormalParserSource.prototype.currentToken = function () { - return this.slidingWindow.currentItem(false); - }; - - NormalParserSource.prototype.removeDiagnosticsOnOrAfterPosition = function (position) { - var tokenDiagnosticsLength = this._tokenDiagnostics.length; - while (tokenDiagnosticsLength > 0) { - var diagnostic = this._tokenDiagnostics[tokenDiagnosticsLength - 1]; - if (diagnostic.start() >= position) { - tokenDiagnosticsLength--; - } else { - break; - } - } - - this._tokenDiagnostics.length = tokenDiagnosticsLength; - }; - - NormalParserSource.prototype.resetToPosition = function (absolutePosition, previousToken) { - this._absolutePosition = absolutePosition; - this._previousToken = previousToken; - - this.removeDiagnosticsOnOrAfterPosition(absolutePosition); - - this.slidingWindow.disgardAllItemsFromCurrentIndexOnwards(); - - this.scanner.setAbsoluteIndex(absolutePosition); - }; - - NormalParserSource.prototype.currentTokenAllowingRegularExpression = function () { - this.resetToPosition(this._absolutePosition, this._previousToken); - - var token = this.slidingWindow.currentItem(true); - - return token; - }; - return NormalParserSource; - })(); - - var IncrementalParserSource = (function () { - function IncrementalParserSource(oldSyntaxTree, textChangeRange, newText) { - this._changeDelta = 0; - var oldSourceUnit = oldSyntaxTree.sourceUnit(); - this._oldSourceUnitCursor = new SyntaxCursor(oldSourceUnit); - - this._changeRange = IncrementalParserSource.extendToAffectedRange(textChangeRange, oldSourceUnit); - - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert((oldSourceUnit.fullWidth() - this._changeRange.span().length() + this._changeRange.newLength()) === newText.length()); - } - - this._normalParserSource = new NormalParserSource(oldSyntaxTree.fileName(), newText, oldSyntaxTree.parseOptions().languageVersion()); - } - IncrementalParserSource.extendToAffectedRange = function (changeRange, sourceUnit) { - var maxLookahead = 1; - - var start = changeRange.span().start(); - - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var token = sourceUnit.findToken(start); - - var position = token.fullStart(); - - start = TypeScript.MathPrototype.max(0, position - 1); - } - - var finalSpan = TypeScript.TextSpan.fromBounds(start, changeRange.span().end()); - var finalLength = changeRange.newLength() + (changeRange.span().start() - start); - - return new TypeScript.TextChangeRange(finalSpan, finalLength); - }; - - IncrementalParserSource.prototype.absolutePosition = function () { - return this._normalParserSource.absolutePosition(); - }; - - IncrementalParserSource.prototype.previousToken = function () { - return this._normalParserSource.previousToken(); - }; - - IncrementalParserSource.prototype.tokenDiagnostics = function () { - return this._normalParserSource.tokenDiagnostics(); - }; - - IncrementalParserSource.prototype.getRewindPoint = function () { - var rewindPoint = this._normalParserSource.getRewindPoint(); - var oldSourceUnitCursorIndex = this._oldSourceUnitCursor.getAndPinCursorIndex(); - - rewindPoint.changeDelta = this._changeDelta; - rewindPoint.changeRange = this._changeRange; - rewindPoint.oldSourceUnitCursorIndex = oldSourceUnitCursorIndex; - - return rewindPoint; - }; - - IncrementalParserSource.prototype.rewind = function (rewindPoint) { - this._changeRange = rewindPoint.changeRange; - this._changeDelta = rewindPoint.changeDelta; - this._oldSourceUnitCursor.rewindToPinnedCursorIndex(rewindPoint.oldSourceUnitCursorIndex); - - this._normalParserSource.rewind(rewindPoint); - }; - - IncrementalParserSource.prototype.releaseRewindPoint = function (rewindPoint) { - this._oldSourceUnitCursor.releaseAndUnpinCursorIndex(rewindPoint.oldSourceUnitCursorIndex); - this._normalParserSource.releaseRewindPoint(rewindPoint); - }; - - IncrementalParserSource.prototype.canReadFromOldSourceUnit = function () { - if (this._normalParserSource.isPinned()) { - return false; - } - - if (this._changeRange !== null && this._changeRange.newSpan().intersectsWithPosition(this.absolutePosition())) { - return false; - } - - this.syncCursorToNewTextIfBehind(); - - return this._changeDelta === 0 && !this._oldSourceUnitCursor.isFinished(); - }; - - IncrementalParserSource.prototype.currentNode = function () { - if (this.canReadFromOldSourceUnit()) { - return this.tryGetNodeFromOldSourceUnit(); - } - - return null; - }; - - IncrementalParserSource.prototype.currentToken = function () { - if (this.canReadFromOldSourceUnit()) { - var token = this.tryGetTokenFromOldSourceUnit(); - if (token !== null) { - return token; - } - } - - return this._normalParserSource.currentToken(); - }; - - IncrementalParserSource.prototype.currentTokenAllowingRegularExpression = function () { - return this._normalParserSource.currentTokenAllowingRegularExpression(); - }; - - IncrementalParserSource.prototype.syncCursorToNewTextIfBehind = function () { - while (true) { - if (this._oldSourceUnitCursor.isFinished()) { - break; - } - - if (this._changeDelta >= 0) { - break; - } - - var currentElement = this._oldSourceUnitCursor.currentElement(); - - if (currentElement.isNode() && (currentElement.fullWidth() > Math.abs(this._changeDelta))) { - this._oldSourceUnitCursor.moveToFirstChild(); - } else { - this._oldSourceUnitCursor.moveToNextSibling(); - - this._changeDelta += currentElement.fullWidth(); - } - } - }; - - IncrementalParserSource.prototype.intersectsWithChangeRangeSpanInOriginalText = function (start, length) { - return this._changeRange !== null && this._changeRange.span().intersectsWith(start, length); - }; - - IncrementalParserSource.prototype.tryGetNodeFromOldSourceUnit = function () { - while (true) { - var node = this._oldSourceUnitCursor.currentNode(); - if (node === null) { - return null; - } - - if (!this.intersectsWithChangeRangeSpanInOriginalText(this.absolutePosition(), node.fullWidth())) { - if (!node.isIncrementallyUnusable()) { - return node; - } - } - - this._oldSourceUnitCursor.moveToFirstChild(); - } - }; - - IncrementalParserSource.prototype.canReuseTokenFromOldSourceUnit = function (position, token) { - if (token !== null) { - if (!this.intersectsWithChangeRangeSpanInOriginalText(position, token.fullWidth())) { - if (!token.isIncrementallyUnusable()) { - return true; - } - } - } - - return false; - }; - - IncrementalParserSource.prototype.tryGetTokenFromOldSourceUnit = function () { - var token = this._oldSourceUnitCursor.currentToken(); - - return this.canReuseTokenFromOldSourceUnit(this.absolutePosition(), token) ? token : null; - }; - - IncrementalParserSource.prototype.peekToken = function (n) { - if (this.canReadFromOldSourceUnit()) { - var token = this.tryPeekTokenFromOldSourceUnit(n); - if (token !== null) { - return token; - } - } - - return this._normalParserSource.peekToken(n); - }; - - IncrementalParserSource.prototype.tryPeekTokenFromOldSourceUnit = function (n) { - var currentPosition = this.absolutePosition(); - for (var i = 0; i < n; i++) { - var interimToken = this._oldSourceUnitCursor.peekToken(i); - if (!this.canReuseTokenFromOldSourceUnit(currentPosition, interimToken)) { - return null; - } - - currentPosition += interimToken.fullWidth(); - } - - var token = this._oldSourceUnitCursor.peekToken(n); - return this.canReuseTokenFromOldSourceUnit(currentPosition, token) ? token : null; - }; - - IncrementalParserSource.prototype.moveToNextNode = function () { - var currentElement = this._oldSourceUnitCursor.currentElement(); - var currentNode = this._oldSourceUnitCursor.currentNode(); - - this._oldSourceUnitCursor.moveToNextSibling(); - - var absolutePosition = this.absolutePosition() + currentNode.fullWidth(); - var previousToken = currentNode.lastToken(); - this._normalParserSource.resetToPosition(absolutePosition, previousToken); - - if (this._changeRange !== null) { - } - }; - - IncrementalParserSource.prototype.moveToNextToken = function () { - var currentToken = this.currentToken(); - - if (this._oldSourceUnitCursor.currentToken() === currentToken) { - this._oldSourceUnitCursor.moveToNextSibling(); - - var absolutePosition = this.absolutePosition() + currentToken.fullWidth(); - var previousToken = currentToken; - this._normalParserSource.resetToPosition(absolutePosition, previousToken); - - if (this._changeRange !== null) { - } - } else { - this._changeDelta -= currentToken.fullWidth(); - - this._normalParserSource.moveToNextToken(); - - if (this._changeRange !== null) { - var changeRangeSpanInNewText = this._changeRange.newSpan(); - if (this.absolutePosition() >= changeRangeSpanInNewText.end()) { - this._changeDelta += this._changeRange.newLength() - this._changeRange.span().length(); - this._changeRange = null; - } - } - } - }; - return IncrementalParserSource; - })(); - - var ParserImpl = (function () { - function ParserImpl(fileName, lineMap, source, parseOptions, newText_forDebuggingPurposesOnly) { - this.newText_forDebuggingPurposesOnly = newText_forDebuggingPurposesOnly; - this.listParsingState = 0; - this.isInStrictMode = false; - this.diagnostics = []; - this.factory = TypeScript.Syntax.normalModeFactory; - this.mergeTokensStorage = []; - this.arrayPool = []; - this.fileName = fileName; - this.lineMap = lineMap; - this.source = source; - this.parseOptions = parseOptions; - } - ParserImpl.prototype.getRewindPoint = function () { - var rewindPoint = this.source.getRewindPoint(); - - rewindPoint.diagnosticsCount = this.diagnostics.length; - - rewindPoint.isInStrictMode = this.isInStrictMode; - rewindPoint.listParsingState = this.listParsingState; - - return rewindPoint; - }; - - ParserImpl.prototype.rewind = function (rewindPoint) { - this.source.rewind(rewindPoint); - - this.diagnostics.length = rewindPoint.diagnosticsCount; - }; - - ParserImpl.prototype.releaseRewindPoint = function (rewindPoint) { - this.source.releaseRewindPoint(rewindPoint); - }; - - ParserImpl.prototype.currentTokenStart = function () { - return this.source.absolutePosition() + this.currentToken().leadingTriviaWidth(); - }; - - ParserImpl.prototype.previousTokenStart = function () { - if (this.previousToken() === null) { - return 0; - } - - return this.source.absolutePosition() - this.previousToken().fullWidth() + this.previousToken().leadingTriviaWidth(); - }; - - ParserImpl.prototype.previousTokenEnd = function () { - if (this.previousToken() === null) { - return 0; - } - - return this.previousTokenStart() + this.previousToken().width(); - }; - - ParserImpl.prototype.currentNode = function () { - var node = this.source.currentNode(); - - if (node === null || node.parsedInStrictMode() !== this.isInStrictMode) { - return null; - } - - return node; - }; - - ParserImpl.prototype.currentToken = function () { - return this.source.currentToken(); - }; - - ParserImpl.prototype.currentTokenAllowingRegularExpression = function () { - return this.source.currentTokenAllowingRegularExpression(); - }; - - ParserImpl.prototype.peekToken = function (n) { - return this.source.peekToken(n); - }; - - ParserImpl.prototype.eatAnyToken = function () { - var token = this.currentToken(); - this.moveToNextToken(); - return token; - }; - - ParserImpl.prototype.moveToNextToken = function () { - this.source.moveToNextToken(); - }; - - ParserImpl.prototype.previousToken = function () { - return this.source.previousToken(); - }; - - ParserImpl.prototype.eatNode = function () { - var node = this.source.currentNode(); - this.source.moveToNextNode(); - return node; - }; - - ParserImpl.prototype.eatToken = function (kind) { - var token = this.currentToken(); - if (token.tokenKind === kind) { - this.moveToNextToken(); - return token; - } - - return this.createMissingToken(kind, token); - }; - - ParserImpl.prototype.tryEatToken = function (kind) { - if (this.currentToken().tokenKind === kind) { - return this.eatToken(kind); - } - - return null; - }; - - ParserImpl.prototype.eatKeyword = function (kind) { - var token = this.currentToken(); - if (token.tokenKind === kind) { - this.moveToNextToken(); - return token; - } - - return this.createMissingToken(kind, token); - }; - - ParserImpl.prototype.isIdentifier = function (token) { - var tokenKind = token.tokenKind; - - if (tokenKind === 11 /* IdentifierName */) { - return true; - } - - if (tokenKind >= 51 /* FirstFutureReservedStrictKeyword */) { - if (tokenKind <= 59 /* LastFutureReservedStrictKeyword */) { - return !this.isInStrictMode; - } - - return tokenKind <= 69 /* LastTypeScriptKeyword */; - } - - return false; - }; - - ParserImpl.prototype.eatIdentifierNameToken = function () { - var token = this.currentToken(); - - if (token.tokenKind === 11 /* IdentifierName */) { - this.moveToNextToken(); - return token; - } - - if (TypeScript.SyntaxFacts.isAnyKeyword(token.tokenKind)) { - this.moveToNextToken(); - return TypeScript.Syntax.convertToIdentifierName(token); - } - - return this.createMissingToken(11 /* IdentifierName */, token); - }; - - ParserImpl.prototype.eatIdentifierToken = function () { - var token = this.currentToken(); - if (this.isIdentifier(token)) { - this.moveToNextToken(); - - if (token.tokenKind === 11 /* IdentifierName */) { - return token; - } - - return TypeScript.Syntax.convertToIdentifierName(token); - } - - return this.createMissingToken(11 /* IdentifierName */, token); - }; - - ParserImpl.prototype.canEatAutomaticSemicolon = function (allowWithoutNewLine) { - var token = this.currentToken(); - - if (token.tokenKind === 10 /* EndOfFileToken */) { - return true; - } - - if (token.tokenKind === 71 /* CloseBraceToken */) { - return true; - } - - if (allowWithoutNewLine) { - return true; - } - - if (this.previousToken() !== null && this.previousToken().hasTrailingNewLine()) { - return true; - } - - return false; - }; - - ParserImpl.prototype.canEatExplicitOrAutomaticSemicolon = function (allowWithoutNewline) { - var token = this.currentToken(); - - if (token.tokenKind === 78 /* SemicolonToken */) { - return true; - } - - return this.canEatAutomaticSemicolon(allowWithoutNewline); - }; - - ParserImpl.prototype.eatExplicitOrAutomaticSemicolon = function (allowWithoutNewline) { - var token = this.currentToken(); - - if (token.tokenKind === 78 /* SemicolonToken */) { - return this.eatToken(78 /* SemicolonToken */); - } - - if (this.canEatAutomaticSemicolon(allowWithoutNewline)) { - var semicolonToken = TypeScript.Syntax.emptyToken(78 /* SemicolonToken */); - - if (!this.parseOptions.allowAutomaticSemicolonInsertion()) { - this.addDiagnostic(new TypeScript.Diagnostic(this.fileName, this.lineMap, this.previousTokenEnd(), 0, TypeScript.DiagnosticCode.Automatic_semicolon_insertion_not_allowed, null)); - } - - return semicolonToken; - } - - return this.eatToken(78 /* SemicolonToken */); - }; - - ParserImpl.prototype.isKeyword = function (kind) { - if (kind >= 15 /* FirstKeyword */) { - if (kind <= 50 /* LastFutureReservedKeyword */) { - return true; - } - - if (this.isInStrictMode) { - return kind <= 59 /* LastFutureReservedStrictKeyword */; - } - } - - return false; - }; - - ParserImpl.prototype.createMissingToken = function (expectedKind, actual) { - var diagnostic = this.getExpectedTokenDiagnostic(expectedKind, actual); - this.addDiagnostic(diagnostic); - - return TypeScript.Syntax.emptyToken(expectedKind); - }; - - ParserImpl.prototype.getExpectedTokenDiagnostic = function (expectedKind, actual) { - var token = this.currentToken(); - - if (TypeScript.SyntaxFacts.isAnyKeyword(expectedKind) || TypeScript.SyntaxFacts.isAnyPunctuation(expectedKind)) { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(expectedKind)]); - } else { - if (actual !== null && TypeScript.SyntaxFacts.isAnyKeyword(actual.tokenKind)) { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Identifier_expected_0_is_a_keyword, [TypeScript.SyntaxFacts.getText(actual.tokenKind)]); - } else { - return new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Identifier_expected, null); - } - } - }; - - ParserImpl.getPrecedence = function (expressionKind) { - switch (expressionKind) { - case 173 /* CommaExpression */: - return 1 /* CommaExpressionPrecedence */; - - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - return 2 /* AssignmentExpressionPrecedence */; - - case 186 /* ConditionalExpression */: - return 3 /* ConditionalExpressionPrecedence */; - - case 187 /* LogicalOrExpression */: - return 5 /* LogicalOrExpressionPrecedence */; - - case 188 /* LogicalAndExpression */: - return 6 /* LogicalAndExpressionPrecedence */; - - case 189 /* BitwiseOrExpression */: - return 7 /* BitwiseOrExpressionPrecedence */; - - case 190 /* BitwiseExclusiveOrExpression */: - return 8 /* BitwiseExclusiveOrExpressionPrecedence */; - - case 191 /* BitwiseAndExpression */: - return 9 /* BitwiseAndExpressionPrecedence */; - - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - return 10 /* EqualityExpressionPrecedence */; - - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - return 11 /* RelationalExpressionPrecedence */; - - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - return 12 /* ShiftExpressionPrecdence */; - - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - return 13 /* AdditiveExpressionPrecedence */; - - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - return 14 /* MultiplicativeExpressionPrecedence */; - - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 167 /* LogicalNotExpression */: - case 170 /* DeleteExpression */: - case 171 /* TypeOfExpression */: - case 172 /* VoidExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return 15 /* UnaryExpressionPrecedence */; - } - - throw TypeScript.Errors.invalidOperation(); - }; - - ParserImpl.prototype.addSkippedTokenAfterNodeOrToken = function (nodeOrToken, skippedToken) { - if (nodeOrToken.isToken()) { - return this.addSkippedTokenAfterToken(nodeOrToken, skippedToken); - } else if (nodeOrToken.isNode()) { - return this.addSkippedTokenAfterNode(nodeOrToken, skippedToken); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.addSkippedTokenAfterNode = function (node, skippedToken) { - var oldToken = node.lastToken(); - var newToken = this.addSkippedTokenAfterToken(oldToken, skippedToken); - - return node.replaceToken(oldToken, newToken); - }; - - ParserImpl.prototype.addSkippedTokensBeforeNode = function (node, skippedTokens) { - if (skippedTokens.length > 0) { - var oldToken = node.firstToken(); - var newToken = this.addSkippedTokensBeforeToken(oldToken, skippedTokens); - - return node.replaceToken(oldToken, newToken); - } - - return node; - }; - - ParserImpl.prototype.addSkippedTokensBeforeToken = function (token, skippedTokens) { - var leadingTrivia = []; - for (var i = 0, n = skippedTokens.length; i < n; i++) { - this.addSkippedTokenToTriviaArray(leadingTrivia, skippedTokens[i]); - } - - this.addTriviaTo(token.leadingTrivia(), leadingTrivia); - - this.returnArray(skippedTokens); - return token.withLeadingTrivia(TypeScript.Syntax.triviaList(leadingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokensAfterToken = function (token, skippedTokens) { - if (skippedTokens.length === 0) { - this.returnArray(skippedTokens); - return token; - } - - var trailingTrivia = token.trailingTrivia().toArray(); - - for (var i = 0, n = skippedTokens.length; i < n; i++) { - this.addSkippedTokenToTriviaArray(trailingTrivia, skippedTokens[i]); - } - - this.returnArray(skippedTokens); - return token.withTrailingTrivia(TypeScript.Syntax.triviaList(trailingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokenAfterToken = function (token, skippedToken) { - var trailingTrivia = token.trailingTrivia().toArray(); - this.addSkippedTokenToTriviaArray(trailingTrivia, skippedToken); - - return token.withTrailingTrivia(TypeScript.Syntax.triviaList(trailingTrivia)); - }; - - ParserImpl.prototype.addSkippedTokenToTriviaArray = function (array, skippedToken) { - this.addTriviaTo(skippedToken.leadingTrivia(), array); - - var trimmedToken = skippedToken.withLeadingTrivia(TypeScript.Syntax.emptyTriviaList).withTrailingTrivia(TypeScript.Syntax.emptyTriviaList); - array.push(TypeScript.Syntax.skippedTokenTrivia(trimmedToken)); - - this.addTriviaTo(skippedToken.trailingTrivia(), array); - }; - - ParserImpl.prototype.addTriviaTo = function (list, array) { - for (var i = 0, n = list.count(); i < n; i++) { - array.push(list.syntaxTriviaAt(i)); - } - }; - - ParserImpl.prototype.parseSyntaxTree = function (isDeclaration) { - var sourceUnit = this.parseSourceUnit(); - - var allDiagnostics = this.source.tokenDiagnostics().concat(this.diagnostics); - allDiagnostics.sort(function (a, b) { - return a.start() - b.start(); - }); - - return new TypeScript.SyntaxTree(sourceUnit, isDeclaration, allDiagnostics, this.fileName, this.lineMap, this.parseOptions); - }; - - ParserImpl.prototype.setStrictMode = function (isInStrictMode) { - this.isInStrictMode = isInStrictMode; - this.factory = isInStrictMode ? TypeScript.Syntax.strictModeFactory : TypeScript.Syntax.normalModeFactory; - }; - - ParserImpl.prototype.parseSourceUnit = function () { - var savedIsInStrictMode = this.isInStrictMode; - - var result = this.parseSyntaxList(1 /* SourceUnit_ModuleElements */, ParserImpl.updateStrictModeState); - var moduleElements = result.list; - - this.setStrictMode(savedIsInStrictMode); - - var sourceUnit = this.factory.sourceUnit(moduleElements, this.currentToken()); - sourceUnit = this.addSkippedTokensBeforeNode(sourceUnit, result.skippedTokens); - - if (TypeScript.Debug.shouldAssert(2 /* Aggressive */)) { - TypeScript.Debug.assert(sourceUnit.fullWidth() === this.newText_forDebuggingPurposesOnly.length()); - - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - TypeScript.Debug.assert(sourceUnit.fullText() === this.newText_forDebuggingPurposesOnly.substr(0, this.newText_forDebuggingPurposesOnly.length(), false)); - } - } - - return sourceUnit; - }; - - ParserImpl.updateStrictModeState = function (parser, items) { - if (!parser.isInStrictMode) { - for (var i = 0; i < items.length; i++) { - var item = items[i]; - if (!TypeScript.SyntaxFacts.isDirectivePrologueElement(item)) { - return; - } - } - - parser.setStrictMode(TypeScript.SyntaxFacts.isUseStrictDirective(items[items.length - 1])); - } - }; - - ParserImpl.prototype.isModuleElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isModuleElement()) { - return true; - } - - var modifierCount = this.modifierCount(); - return this.isImportDeclaration(modifierCount) || this.isExportAssignment() || this.isModuleDeclaration(modifierCount) || this.isInterfaceDeclaration(modifierCount) || this.isClassDeclaration(modifierCount) || this.isEnumDeclaration(modifierCount) || this.isStatement(inErrorRecovery); - }; - - ParserImpl.prototype.parseModuleElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isModuleElement()) { - return this.eatNode(); - } - - var modifierCount = this.modifierCount(); - if (this.isImportDeclaration(modifierCount)) { - return this.parseImportDeclaration(); - } else if (this.isExportAssignment()) { - return this.parseExportAssignment(); - } else if (this.isModuleDeclaration(modifierCount)) { - return this.parseModuleDeclaration(); - } else if (this.isInterfaceDeclaration(modifierCount)) { - return this.parseInterfaceDeclaration(); - } else if (this.isClassDeclaration(modifierCount)) { - return this.parseClassDeclaration(); - } else if (this.isEnumDeclaration(modifierCount)) { - return this.parseEnumDeclaration(); - } else if (this.isStatement(inErrorRecovery)) { - return this.parseStatement(inErrorRecovery); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isImportDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 49 /* ImportKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 49 /* ImportKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseImportDeclaration = function () { - var modifiers = this.parseModifiers(); - var importKeyword = this.eatKeyword(49 /* ImportKeyword */); - var identifier = this.eatIdentifierToken(); - var equalsToken = this.eatToken(107 /* EqualsToken */); - var moduleReference = this.parseModuleReference(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.importDeclaration(modifiers, importKeyword, identifier, equalsToken, moduleReference, semicolonToken); - }; - - ParserImpl.prototype.isExportAssignment = function () { - return this.currentToken().tokenKind === 47 /* ExportKeyword */ && this.peekToken(1).tokenKind === 107 /* EqualsToken */; - }; - - ParserImpl.prototype.parseExportAssignment = function () { - var exportKeyword = this.eatKeyword(47 /* ExportKeyword */); - var equalsToken = this.eatToken(107 /* EqualsToken */); - var identifier = this.eatIdentifierToken(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.exportAssignment(exportKeyword, equalsToken, identifier, semicolonToken); - }; - - ParserImpl.prototype.parseModuleReference = function () { - if (this.isExternalModuleReference()) { - return this.parseExternalModuleReference(); - } else { - return this.parseModuleNameModuleReference(); - } - }; - - ParserImpl.prototype.isExternalModuleReference = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 66 /* RequireKeyword */) { - return this.peekToken(1).tokenKind === 72 /* OpenParenToken */; - } - - return false; - }; - - ParserImpl.prototype.parseExternalModuleReference = function () { - var requireKeyword = this.eatKeyword(66 /* RequireKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var stringLiteral = this.eatToken(14 /* StringLiteral */); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.externalModuleReference(requireKeyword, openParenToken, stringLiteral, closeParenToken); - }; - - ParserImpl.prototype.parseModuleNameModuleReference = function () { - var name = this.parseName(); - return this.factory.moduleNameModuleReference(name); - }; - - ParserImpl.prototype.parseIdentifierName = function () { - var identifierName = this.eatIdentifierNameToken(); - return identifierName; - }; - - ParserImpl.prototype.tryParseTypeArgumentList = function (inExpression) { - if (this.currentToken().kind() !== 80 /* LessThanToken */) { - return null; - } - - var lessThanToken; - var greaterThanToken; - var result; - var typeArguments; - - if (!inExpression) { - lessThanToken = this.eatToken(80 /* LessThanToken */); - - result = this.parseSeparatedSyntaxList(262144 /* TypeArgumentList_Types */); - typeArguments = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - return this.factory.typeArgumentList(lessThanToken, typeArguments, greaterThanToken); - } - - var rewindPoint = this.getRewindPoint(); - - lessThanToken = this.eatToken(80 /* LessThanToken */); - - result = this.parseSeparatedSyntaxList(262144 /* TypeArgumentList_Types */); - typeArguments = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - if (greaterThanToken.fullWidth() === 0 || !this.canFollowTypeArgumentListInExpression(this.currentToken().kind())) { - this.rewind(rewindPoint); - - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - var typeArgumentList = this.factory.typeArgumentList(lessThanToken, typeArguments, greaterThanToken); - - return typeArgumentList; - } - }; - - ParserImpl.prototype.canFollowTypeArgumentListInExpression = function (kind) { - switch (kind) { - case 72 /* OpenParenToken */: - case 76 /* DotToken */: - - case 73 /* CloseParenToken */: - case 75 /* CloseBracketToken */: - case 106 /* ColonToken */: - case 78 /* SemicolonToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - case 84 /* EqualsEqualsToken */: - case 87 /* EqualsEqualsEqualsToken */: - case 86 /* ExclamationEqualsToken */: - case 88 /* ExclamationEqualsEqualsToken */: - case 103 /* AmpersandAmpersandToken */: - case 104 /* BarBarToken */: - case 100 /* CaretToken */: - case 98 /* AmpersandToken */: - case 99 /* BarToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.parseName = function () { - var shouldContinue = this.isIdentifier(this.currentToken()); - var current = this.eatIdentifierToken(); - - while (shouldContinue && this.currentToken().tokenKind === 76 /* DotToken */) { - var dotToken = this.eatToken(76 /* DotToken */); - - var currentToken = this.currentToken(); - var identifierName; - - if (TypeScript.SyntaxFacts.isAnyKeyword(currentToken.tokenKind) && this.previousToken().hasTrailingNewLine() && !currentToken.hasTrailingNewLine() && TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(this.peekToken(1))) { - identifierName = this.createMissingToken(11 /* IdentifierName */, currentToken); - } else { - identifierName = this.eatIdentifierNameToken(); - } - - current = this.factory.qualifiedName(current, dotToken, identifierName); - - shouldContinue = identifierName.fullWidth() > 0; - } - - return current; - }; - - ParserImpl.prototype.isEnumDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 46 /* EnumKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 46 /* EnumKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseEnumDeclaration = function () { - var modifiers = this.parseModifiers(); - var enumKeyword = this.eatKeyword(46 /* EnumKeyword */); - var identifier = this.eatIdentifierToken(); - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - var enumElements = TypeScript.Syntax.emptySeparatedList; - - if (openBraceToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(256 /* EnumDeclaration_EnumElements */); - enumElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.enumDeclaration(modifiers, enumKeyword, identifier, openBraceToken, enumElements, closeBraceToken); - }; - - ParserImpl.prototype.isEnumElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().kind() === 243 /* EnumElement */) { - return true; - } - - return this.isPropertyName(this.currentToken(), inErrorRecovery); - }; - - ParserImpl.prototype.parseEnumElement = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 243 /* EnumElement */) { - return this.eatNode(); - } - - var propertyName = this.eatPropertyName(); - var equalsValueClause = null; - if (this.isEqualsValueClause(false)) { - equalsValueClause = this.parseEqualsValueClause(true); - } - - return this.factory.enumElement(propertyName, equalsValueClause); - }; - - ParserImpl.isModifier = function (token) { - switch (token.tokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - case 47 /* ExportKeyword */: - case 63 /* DeclareKeyword */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.modifierCount = function () { - var modifierCount = 0; - while (true) { - if (ParserImpl.isModifier(this.peekToken(modifierCount))) { - modifierCount++; - continue; - } - - break; - } - - return modifierCount; - }; - - ParserImpl.prototype.parseModifiers = function () { - var tokens = this.getArray(); - - while (true) { - if (ParserImpl.isModifier(this.currentToken())) { - tokens.push(this.eatAnyToken()); - continue; - } - - break; - } - - var result = TypeScript.Syntax.list(tokens); - - this.returnZeroOrOneLengthArray(tokens); - - return result; - }; - - ParserImpl.prototype.isClassDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 44 /* ClassKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 44 /* ClassKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseHeritageClauses = function () { - var heritageClauses = TypeScript.Syntax.emptyList; - - if (this.isHeritageClause()) { - var result = this.parseSyntaxList(1024 /* ClassOrInterfaceDeclaration_HeritageClauses */); - heritageClauses = result.list; - TypeScript.Debug.assert(result.skippedTokens.length === 0); - } - - return heritageClauses; - }; - - ParserImpl.prototype.parseClassDeclaration = function () { - var modifiers = this.parseModifiers(); - - var classKeyword = this.eatKeyword(44 /* ClassKeyword */); - var identifier = this.eatIdentifierToken(); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var heritageClauses = this.parseHeritageClauses(); - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - var classElements = TypeScript.Syntax.emptyList; - - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(2 /* ClassDeclaration_ClassElements */); - - classElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.classDeclaration(modifiers, classKeyword, identifier, typeParameterList, heritageClauses, openBraceToken, classElements, closeBraceToken); - }; - - ParserImpl.isPublicOrPrivateKeyword = function (token) { - return token.tokenKind === 57 /* PublicKeyword */ || token.tokenKind === 55 /* PrivateKeyword */; - }; - - ParserImpl.prototype.isAccessor = function (inErrorRecovery) { - var index = this.modifierCount(); - - if (this.peekToken(index).tokenKind !== 64 /* GetKeyword */ && this.peekToken(index).tokenKind !== 68 /* SetKeyword */) { - return false; - } - - index++; - return this.isPropertyName(this.peekToken(index), inErrorRecovery); - }; - - ParserImpl.prototype.parseAccessor = function (checkForStrictMode) { - var modifiers = this.parseModifiers(); - - if (this.currentToken().tokenKind === 64 /* GetKeyword */) { - return this.parseGetMemberAccessorDeclaration(modifiers, checkForStrictMode); - } else if (this.currentToken().tokenKind === 68 /* SetKeyword */) { - return this.parseSetMemberAccessorDeclaration(modifiers, checkForStrictMode); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseGetMemberAccessorDeclaration = function (modifiers, checkForStrictMode) { - var getKeyword = this.eatKeyword(64 /* GetKeyword */); - var propertyName = this.eatPropertyName(); - var parameterList = this.parseParameterList(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - var block = this.parseBlock(false, checkForStrictMode); - - return this.factory.getAccessor(modifiers, getKeyword, propertyName, parameterList, typeAnnotation, block); - }; - - ParserImpl.prototype.parseSetMemberAccessorDeclaration = function (modifiers, checkForStrictMode) { - var setKeyword = this.eatKeyword(68 /* SetKeyword */); - var propertyName = this.eatPropertyName(); - var parameterList = this.parseParameterList(); - var block = this.parseBlock(false, checkForStrictMode); - - return this.factory.setAccessor(modifiers, setKeyword, propertyName, parameterList, block); - }; - - ParserImpl.prototype.isClassElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isClassElement()) { - return true; - } - - return this.isConstructorDeclaration() || this.isMemberFunctionDeclaration(inErrorRecovery) || this.isAccessor(inErrorRecovery) || this.isMemberVariableDeclaration(inErrorRecovery) || this.isIndexMemberDeclaration(); - }; - - ParserImpl.prototype.parseClassElement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isClassElement()) { - return this.eatNode(); - } - - if (this.isConstructorDeclaration()) { - return this.parseConstructorDeclaration(); - } else if (this.isMemberFunctionDeclaration(inErrorRecovery)) { - return this.parseMemberFunctionDeclaration(); - } else if (this.isAccessor(inErrorRecovery)) { - return this.parseAccessor(false); - } else if (this.isMemberVariableDeclaration(inErrorRecovery)) { - return this.parseMemberVariableDeclaration(); - } else if (this.isIndexMemberDeclaration()) { - return this.parseIndexMemberDeclaration(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isConstructorDeclaration = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 62 /* ConstructorKeyword */; - }; - - ParserImpl.prototype.parseConstructorDeclaration = function () { - var modifiers = this.parseModifiers(); - var constructorKeyword = this.eatKeyword(62 /* ConstructorKeyword */); - var callSignature = this.parseCallSignature(false); - - var semicolonToken = null; - var block = null; - - if (this.isBlock()) { - block = this.parseBlock(false, true); - } else { - semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.constructorDeclaration(modifiers, constructorKeyword, callSignature, block, semicolonToken); - }; - - ParserImpl.prototype.isMemberFunctionDeclaration = function (inErrorRecovery) { - var index = 0; - - while (true) { - var token = this.peekToken(index); - if (this.isPropertyName(token, inErrorRecovery) && this.isCallSignature(index + 1)) { - return true; - } - - if (ParserImpl.isModifier(token)) { - index++; - continue; - } - - return false; - } - }; - - ParserImpl.prototype.parseMemberFunctionDeclaration = function () { - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (this.isPropertyName(currentToken, false) && this.isCallSignature(1)) { - break; - } - - TypeScript.Debug.assert(ParserImpl.isModifier(currentToken)); - modifierArray.push(this.eatAnyToken()); - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var propertyName = this.eatPropertyName(); - var callSignature = this.parseCallSignature(false); - - var parseBlockEvenWithNoOpenBrace = false; - var newCallSignature = this.tryAddUnexpectedEqualsGreaterThanToken(callSignature); - if (newCallSignature !== callSignature) { - parseBlockEvenWithNoOpenBrace = true; - callSignature = newCallSignature; - } - - var block = null; - var semicolon = null; - - if (parseBlockEvenWithNoOpenBrace || this.isBlock()) { - block = this.parseBlock(parseBlockEvenWithNoOpenBrace, true); - } else { - semicolon = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.memberFunctionDeclaration(modifiers, propertyName, callSignature, block, semicolon); - }; - - ParserImpl.prototype.isDefinitelyMemberVariablePropertyName = function (index) { - if (TypeScript.SyntaxFacts.isAnyKeyword(this.peekToken(index).tokenKind)) { - switch (this.peekToken(index + 1).tokenKind) { - case 78 /* SemicolonToken */: - case 107 /* EqualsToken */: - case 106 /* ColonToken */: - case 71 /* CloseBraceToken */: - case 10 /* EndOfFileToken */: - return true; - default: - return false; - } - } else { - return true; - } - }; - - ParserImpl.prototype.isMemberVariableDeclaration = function (inErrorRecovery) { - var index = 0; - - while (true) { - var token = this.peekToken(index); - if (this.isPropertyName(token, inErrorRecovery) && this.isDefinitelyMemberVariablePropertyName(index)) { - return true; - } - - if (ParserImpl.isModifier(this.peekToken(index))) { - index++; - continue; - } - - return false; - } - }; - - ParserImpl.prototype.parseMemberVariableDeclaration = function () { - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (this.isPropertyName(currentToken, false) && this.isDefinitelyMemberVariablePropertyName(0)) { - break; - } - - TypeScript.Debug.assert(ParserImpl.isModifier(currentToken)); - modifierArray.push(this.eatAnyToken()); - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var variableDeclarator = this.parseVariableDeclarator(true, true); - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.memberVariableDeclaration(modifiers, variableDeclarator, semicolon); - }; - - ParserImpl.prototype.isIndexMemberDeclaration = function () { - var index = this.modifierCount(); - return this.isIndexSignature(index); - }; - - ParserImpl.prototype.parseIndexMemberDeclaration = function () { - var modifiers = this.parseModifiers(); - var indexSignature = this.parseIndexSignature(); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.indexMemberDeclaration(modifiers, indexSignature, semicolonToken); - }; - - ParserImpl.prototype.tryAddUnexpectedEqualsGreaterThanToken = function (callSignature) { - var token0 = this.currentToken(); - - var hasEqualsGreaterThanToken = token0.tokenKind === 85 /* EqualsGreaterThanToken */; - if (hasEqualsGreaterThanToken) { - if (callSignature.lastToken()) { - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token0.width(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [TypeScript.SyntaxFacts.getText(70 /* OpenBraceToken */)]); - this.addDiagnostic(diagnostic); - - var token = this.eatAnyToken(); - return this.addSkippedTokenAfterNode(callSignature, token0); - } - } - - return callSignature; - }; - - ParserImpl.prototype.isFunctionDeclaration = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 27 /* FunctionKeyword */; - }; - - ParserImpl.prototype.parseFunctionDeclaration = function () { - var modifiers = this.parseModifiers(); - var functionKeyword = this.eatKeyword(27 /* FunctionKeyword */); - var identifier = this.eatIdentifierToken(); - var callSignature = this.parseCallSignature(false); - - var parseBlockEvenWithNoOpenBrace = false; - var newCallSignature = this.tryAddUnexpectedEqualsGreaterThanToken(callSignature); - if (newCallSignature !== callSignature) { - parseBlockEvenWithNoOpenBrace = true; - callSignature = newCallSignature; - } - - var semicolonToken = null; - var block = null; - - if (parseBlockEvenWithNoOpenBrace || this.isBlock()) { - block = this.parseBlock(parseBlockEvenWithNoOpenBrace, true); - } else { - semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - } - - return this.factory.functionDeclaration(modifiers, functionKeyword, identifier, callSignature, block, semicolonToken); - }; - - ParserImpl.prototype.isModuleDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 65 /* ModuleKeyword */) { - return true; - } - - if (this.currentToken().tokenKind === 65 /* ModuleKeyword */) { - var token1 = this.peekToken(1); - return this.isIdentifier(token1) || token1.tokenKind === 14 /* StringLiteral */; - } - - return false; - }; - - ParserImpl.prototype.parseModuleDeclaration = function () { - var modifiers = this.parseModifiers(); - var moduleKeyword = this.eatKeyword(65 /* ModuleKeyword */); - - var moduleName = null; - var stringLiteral = null; - - if (this.currentToken().tokenKind === 14 /* StringLiteral */) { - stringLiteral = this.eatToken(14 /* StringLiteral */); - } else { - moduleName = this.parseName(); - } - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var moduleElements = TypeScript.Syntax.emptyList; - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(4 /* ModuleDeclaration_ModuleElements */); - moduleElements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.moduleDeclaration(modifiers, moduleKeyword, moduleName, stringLiteral, openBraceToken, moduleElements, closeBraceToken); - }; - - ParserImpl.prototype.isInterfaceDeclaration = function (modifierCount) { - if (modifierCount > 0 && this.peekToken(modifierCount).tokenKind === 52 /* InterfaceKeyword */) { - return true; - } - - return this.currentToken().tokenKind === 52 /* InterfaceKeyword */ && this.isIdentifier(this.peekToken(1)); - }; - - ParserImpl.prototype.parseInterfaceDeclaration = function () { - var modifiers = this.parseModifiers(); - var interfaceKeyword = this.eatKeyword(52 /* InterfaceKeyword */); - var identifier = this.eatIdentifierToken(); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var heritageClauses = this.parseHeritageClauses(); - - var objectType = this.parseObjectType(); - return this.factory.interfaceDeclaration(modifiers, interfaceKeyword, identifier, typeParameterList, heritageClauses, objectType); - }; - - ParserImpl.prototype.parseObjectType = function () { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var typeMembers = TypeScript.Syntax.emptySeparatedList; - if (openBraceToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(512 /* ObjectType_TypeMembers */); - typeMembers = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.objectType(openBraceToken, typeMembers, closeBraceToken); - }; - - ParserImpl.prototype.isTypeMember = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isTypeMember()) { - return true; - } - - return this.isCallSignature(0) || this.isConstructSignature() || this.isIndexSignature(0) || this.isMethodSignature(inErrorRecovery) || this.isPropertySignature(inErrorRecovery); - }; - - ParserImpl.prototype.parseTypeMember = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isTypeMember()) { - return this.eatNode(); - } - - if (this.isCallSignature(0)) { - return this.parseCallSignature(false); - } else if (this.isConstructSignature()) { - return this.parseConstructSignature(); - } else if (this.isIndexSignature(0)) { - return this.parseIndexSignature(); - } else if (this.isMethodSignature(inErrorRecovery)) { - return this.parseMethodSignature(); - } else if (this.isPropertySignature(inErrorRecovery)) { - return this.parsePropertySignature(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseConstructSignature = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - var callSignature = this.parseCallSignature(false); - - return this.factory.constructSignature(newKeyword, callSignature); - }; - - ParserImpl.prototype.parseIndexSignature = function () { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var parameter = this.parseParameter(); - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.indexSignature(openBracketToken, parameter, closeBracketToken, typeAnnotation); - }; - - ParserImpl.prototype.parseMethodSignature = function () { - var propertyName = this.eatPropertyName(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var callSignature = this.parseCallSignature(false); - - return this.factory.methodSignature(propertyName, questionToken, callSignature); - }; - - ParserImpl.prototype.parsePropertySignature = function () { - var propertyName = this.eatPropertyName(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.propertySignature(propertyName, questionToken, typeAnnotation); - }; - - ParserImpl.prototype.isCallSignature = function (tokenIndex) { - var tokenKind = this.peekToken(tokenIndex).tokenKind; - return tokenKind === 72 /* OpenParenToken */ || tokenKind === 80 /* LessThanToken */; - }; - - ParserImpl.prototype.isConstructSignature = function () { - if (this.currentToken().tokenKind !== 31 /* NewKeyword */) { - return false; - } - - var token1 = this.peekToken(1); - return token1.tokenKind === 80 /* LessThanToken */ || token1.tokenKind === 72 /* OpenParenToken */; - }; - - ParserImpl.prototype.isIndexSignature = function (tokenIndex) { - return this.peekToken(tokenIndex).tokenKind === 74 /* OpenBracketToken */; - }; - - ParserImpl.prototype.isMethodSignature = function (inErrorRecovery) { - if (this.isPropertyName(this.currentToken(), inErrorRecovery)) { - if (this.isCallSignature(1)) { - return true; - } - - if (this.peekToken(1).tokenKind === 105 /* QuestionToken */ && this.isCallSignature(2)) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.isPropertySignature = function (inErrorRecovery) { - var currentToken = this.currentToken(); - - if (ParserImpl.isModifier(currentToken) && !currentToken.hasTrailingNewLine() && this.isPropertyName(this.peekToken(1), inErrorRecovery)) { - return false; - } - - return this.isPropertyName(currentToken, inErrorRecovery); - }; - - ParserImpl.prototype.isHeritageClause = function () { - var token0 = this.currentToken(); - return token0.tokenKind === 48 /* ExtendsKeyword */ || token0.tokenKind === 51 /* ImplementsKeyword */; - }; - - ParserImpl.prototype.isNotHeritageClauseTypeName = function () { - if (this.currentToken().tokenKind === 51 /* ImplementsKeyword */ || this.currentToken().tokenKind === 48 /* ExtendsKeyword */) { - return this.isIdentifier(this.peekToken(1)); - } - - return false; - }; - - ParserImpl.prototype.isHeritageClauseTypeName = function () { - if (this.isIdentifier(this.currentToken())) { - return !this.isNotHeritageClauseTypeName(); - } - - return false; - }; - - ParserImpl.prototype.parseHeritageClause = function () { - var extendsOrImplementsKeyword = this.eatAnyToken(); - TypeScript.Debug.assert(extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ || extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - - var result = this.parseSeparatedSyntaxList(2048 /* HeritageClause_TypeNameList */); - var typeNames = result.list; - extendsOrImplementsKeyword = this.addSkippedTokensAfterToken(extendsOrImplementsKeyword, result.skippedTokens); - - return this.factory.heritageClause(extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ ? 230 /* ExtendsHeritageClause */ : 231 /* ImplementsHeritageClause */, extendsOrImplementsKeyword, typeNames); - }; - - ParserImpl.prototype.isStatement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isStatement()) { - return true; - } - - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 57 /* PublicKeyword */: - case 55 /* PrivateKeyword */: - case 58 /* StaticKeyword */: - var token1 = this.peekToken(1); - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token1)) { - return false; - } - - break; - - case 28 /* IfKeyword */: - case 70 /* OpenBraceToken */: - case 33 /* ReturnKeyword */: - case 34 /* SwitchKeyword */: - case 36 /* ThrowKeyword */: - case 15 /* BreakKeyword */: - case 18 /* ContinueKeyword */: - case 26 /* ForKeyword */: - case 42 /* WhileKeyword */: - case 43 /* WithKeyword */: - case 22 /* DoKeyword */: - case 38 /* TryKeyword */: - case 19 /* DebuggerKeyword */: - return true; - } - - if (this.isInterfaceDeclaration(0) || this.isClassDeclaration(0) || this.isEnumDeclaration(0) || this.isModuleDeclaration(0)) { - return false; - } - - return this.isLabeledStatement(currentToken) || this.isVariableStatement() || this.isFunctionDeclaration() || this.isEmptyStatement(currentToken, inErrorRecovery) || this.isExpressionStatement(currentToken); - }; - - ParserImpl.prototype.parseStatement = function (inErrorRecovery) { - if (this.currentNode() !== null && this.currentNode().isStatement()) { - return this.eatNode(); - } - - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - switch (currentTokenKind) { - case 28 /* IfKeyword */: - return this.parseIfStatement(); - case 70 /* OpenBraceToken */: - return this.parseBlock(false, false); - case 33 /* ReturnKeyword */: - return this.parseReturnStatement(); - case 34 /* SwitchKeyword */: - return this.parseSwitchStatement(); - case 36 /* ThrowKeyword */: - return this.parseThrowStatement(); - case 15 /* BreakKeyword */: - return this.parseBreakStatement(); - case 18 /* ContinueKeyword */: - return this.parseContinueStatement(); - case 26 /* ForKeyword */: - return this.parseForOrForInStatement(); - case 42 /* WhileKeyword */: - return this.parseWhileStatement(); - case 43 /* WithKeyword */: - return this.parseWithStatement(); - case 22 /* DoKeyword */: - return this.parseDoStatement(); - case 38 /* TryKeyword */: - return this.parseTryStatement(); - case 19 /* DebuggerKeyword */: - return this.parseDebuggerStatement(); - } - - if (this.isVariableStatement()) { - return this.parseVariableStatement(); - } else if (this.isLabeledStatement(currentToken)) { - return this.parseLabeledStatement(); - } else if (this.isFunctionDeclaration()) { - return this.parseFunctionDeclaration(); - } else if (this.isEmptyStatement(currentToken, inErrorRecovery)) { - return this.parseEmptyStatement(); - } else { - return this.parseExpressionStatement(); - } - }; - - ParserImpl.prototype.parseDebuggerStatement = function () { - var debuggerKeyword = this.eatKeyword(19 /* DebuggerKeyword */); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.debuggerStatement(debuggerKeyword, semicolonToken); - }; - - ParserImpl.prototype.parseDoStatement = function () { - var doKeyword = this.eatKeyword(22 /* DoKeyword */); - var statement = this.parseStatement(false); - var whileKeyword = this.eatKeyword(42 /* WhileKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(true); - - return this.factory.doStatement(doKeyword, statement, whileKeyword, openParenToken, condition, closeParenToken, semicolonToken); - }; - - ParserImpl.prototype.isLabeledStatement = function (currentToken) { - return this.isIdentifier(currentToken) && this.peekToken(1).tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.parseLabeledStatement = function () { - var identifier = this.eatIdentifierToken(); - var colonToken = this.eatToken(106 /* ColonToken */); - var statement = this.parseStatement(false); - - return this.factory.labeledStatement(identifier, colonToken, statement); - }; - - ParserImpl.prototype.parseTryStatement = function () { - var tryKeyword = this.eatKeyword(38 /* TryKeyword */); - - var savedListParsingState = this.listParsingState; - this.listParsingState |= 64 /* TryBlock_Statements */; - var block = this.parseBlock(false, false); - this.listParsingState = savedListParsingState; - - var catchClause = null; - if (this.isCatchClause()) { - catchClause = this.parseCatchClause(); - } - - var finallyClause = null; - if (catchClause === null || this.isFinallyClause()) { - finallyClause = this.parseFinallyClause(); - } - - return this.factory.tryStatement(tryKeyword, block, catchClause, finallyClause); - }; - - ParserImpl.prototype.isCatchClause = function () { - return this.currentToken().tokenKind === 17 /* CatchKeyword */; - }; - - ParserImpl.prototype.parseCatchClause = function () { - var catchKeyword = this.eatKeyword(17 /* CatchKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var identifier = this.eatIdentifierToken(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var savedListParsingState = this.listParsingState; - this.listParsingState |= 128 /* CatchBlock_Statements */; - var block = this.parseBlock(false, false); - this.listParsingState = savedListParsingState; - - return this.factory.catchClause(catchKeyword, openParenToken, identifier, typeAnnotation, closeParenToken, block); - }; - - ParserImpl.prototype.isFinallyClause = function () { - return this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.parseFinallyClause = function () { - var finallyKeyword = this.eatKeyword(25 /* FinallyKeyword */); - var block = this.parseBlock(false, false); - - return this.factory.finallyClause(finallyKeyword, block); - }; - - ParserImpl.prototype.parseWithStatement = function () { - var withKeyword = this.eatKeyword(43 /* WithKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.withStatement(withKeyword, openParenToken, condition, closeParenToken, statement); - }; - - ParserImpl.prototype.parseWhileStatement = function () { - var whileKeyword = this.eatKeyword(42 /* WhileKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.whileStatement(whileKeyword, openParenToken, condition, closeParenToken, statement); - }; - - ParserImpl.prototype.isEmptyStatement = function (currentToken, inErrorRecovery) { - if (inErrorRecovery) { - return false; - } - - return currentToken.tokenKind === 78 /* SemicolonToken */; - }; - - ParserImpl.prototype.parseEmptyStatement = function () { - var semicolonToken = this.eatToken(78 /* SemicolonToken */); - return this.factory.emptyStatement(semicolonToken); - }; - - ParserImpl.prototype.parseForOrForInStatement = function () { - var forKeyword = this.eatKeyword(26 /* ForKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - - var currentToken = this.currentToken(); - if (currentToken.tokenKind === 40 /* VarKeyword */) { - return this.parseForOrForInStatementWithVariableDeclaration(forKeyword, openParenToken); - } else if (currentToken.tokenKind === 78 /* SemicolonToken */) { - return this.parseForStatementWithNoVariableDeclarationOrInitializer(forKeyword, openParenToken); - } else { - return this.parseForOrForInStatementWithInitializer(forKeyword, openParenToken); - } - }; - - ParserImpl.prototype.parseForOrForInStatementWithVariableDeclaration = function (forKeyword, openParenToken) { - var variableDeclaration = this.parseVariableDeclaration(false); - - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return this.parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - } - - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, variableDeclaration, null); - }; - - ParserImpl.prototype.parseForInStatementWithVariableDeclarationOrInitializer = function (forKeyword, openParenToken, variableDeclaration, initializer) { - var inKeyword = this.eatKeyword(29 /* InKeyword */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.forInStatement(forKeyword, openParenToken, variableDeclaration, initializer, inKeyword, expression, closeParenToken, statement); - }; - - ParserImpl.prototype.parseForOrForInStatementWithInitializer = function (forKeyword, openParenToken) { - var initializer = this.parseExpression(false); - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return this.parseForInStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } else { - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, initializer); - } - }; - - ParserImpl.prototype.parseForStatementWithNoVariableDeclarationOrInitializer = function (forKeyword, openParenToken) { - return this.parseForStatementWithVariableDeclarationOrInitializer(forKeyword, openParenToken, null, null); - }; - - ParserImpl.prototype.parseForStatementWithVariableDeclarationOrInitializer = function (forKeyword, openParenToken, variableDeclaration, initializer) { - var firstSemicolonToken = this.eatToken(78 /* SemicolonToken */); - - var condition = null; - if (this.currentToken().tokenKind !== 78 /* SemicolonToken */ && this.currentToken().tokenKind !== 73 /* CloseParenToken */ && this.currentToken().tokenKind !== 10 /* EndOfFileToken */) { - condition = this.parseExpression(true); - } - - var secondSemicolonToken = this.eatToken(78 /* SemicolonToken */); - - var incrementor = null; - if (this.currentToken().tokenKind !== 73 /* CloseParenToken */ && this.currentToken().tokenKind !== 10 /* EndOfFileToken */) { - incrementor = this.parseExpression(true); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - return this.factory.forStatement(forKeyword, openParenToken, variableDeclaration, initializer, firstSemicolonToken, condition, secondSemicolonToken, incrementor, closeParenToken, statement); - }; - - ParserImpl.prototype.parseBreakStatement = function () { - var breakKeyword = this.eatKeyword(15 /* BreakKeyword */); - - var identifier = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - } - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - return this.factory.breakStatement(breakKeyword, identifier, semicolon); - }; - - ParserImpl.prototype.parseContinueStatement = function () { - var continueKeyword = this.eatKeyword(18 /* ContinueKeyword */); - - var identifier = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - } - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - return this.factory.continueStatement(continueKeyword, identifier, semicolon); - }; - - ParserImpl.prototype.parseSwitchStatement = function () { - var switchKeyword = this.eatKeyword(34 /* SwitchKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var switchClauses = TypeScript.Syntax.emptyList; - if (openBraceToken.width() > 0) { - var result = this.parseSyntaxList(8 /* SwitchStatement_SwitchClauses */); - switchClauses = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - return this.factory.switchStatement(switchKeyword, openParenToken, expression, closeParenToken, openBraceToken, switchClauses, closeBraceToken); - }; - - ParserImpl.prototype.isCaseSwitchClause = function () { - return this.currentToken().tokenKind === 16 /* CaseKeyword */; - }; - - ParserImpl.prototype.isDefaultSwitchClause = function () { - return this.currentToken().tokenKind === 20 /* DefaultKeyword */; - }; - - ParserImpl.prototype.isSwitchClause = function () { - if (this.currentNode() !== null && this.currentNode().isSwitchClause()) { - return true; - } - - return this.isCaseSwitchClause() || this.isDefaultSwitchClause(); - }; - - ParserImpl.prototype.parseSwitchClause = function () { - if (this.currentNode() !== null && this.currentNode().isSwitchClause()) { - return this.eatNode(); - } - - if (this.isCaseSwitchClause()) { - return this.parseCaseSwitchClause(); - } else if (this.isDefaultSwitchClause()) { - return this.parseDefaultSwitchClause(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseCaseSwitchClause = function () { - var caseKeyword = this.eatKeyword(16 /* CaseKeyword */); - var expression = this.parseExpression(true); - var colonToken = this.eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList; - - if (colonToken.fullWidth() > 0) { - var result = this.parseSyntaxList(16 /* SwitchClause_Statements */); - statements = result.list; - colonToken = this.addSkippedTokensAfterToken(colonToken, result.skippedTokens); - } - - return this.factory.caseSwitchClause(caseKeyword, expression, colonToken, statements); - }; - - ParserImpl.prototype.parseDefaultSwitchClause = function () { - var defaultKeyword = this.eatKeyword(20 /* DefaultKeyword */); - var colonToken = this.eatToken(106 /* ColonToken */); - var statements = TypeScript.Syntax.emptyList; - - if (colonToken.fullWidth() > 0) { - var result = this.parseSyntaxList(16 /* SwitchClause_Statements */); - statements = result.list; - colonToken = this.addSkippedTokensAfterToken(colonToken, result.skippedTokens); - } - - return this.factory.defaultSwitchClause(defaultKeyword, colonToken, statements); - }; - - ParserImpl.prototype.parseThrowStatement = function () { - var throwKeyword = this.eatKeyword(36 /* ThrowKeyword */); - - var expression = null; - if (this.canEatExplicitOrAutomaticSemicolon(false)) { - var token = this.createMissingToken(11 /* IdentifierName */, null); - expression = token; - } else { - expression = this.parseExpression(true); - } - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.throwStatement(throwKeyword, expression, semicolonToken); - }; - - ParserImpl.prototype.parseReturnStatement = function () { - var returnKeyword = this.eatKeyword(33 /* ReturnKeyword */); - - var expression = null; - if (!this.canEatExplicitOrAutomaticSemicolon(false)) { - expression = this.parseExpression(true); - } - - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.returnStatement(returnKeyword, expression, semicolonToken); - }; - - ParserImpl.prototype.isExpressionStatement = function (currentToken) { - var kind = currentToken.tokenKind; - if (kind === 70 /* OpenBraceToken */ || kind === 27 /* FunctionKeyword */) { - return false; - } - - return this.isExpression(currentToken); - }; - - ParserImpl.prototype.isAssignmentOrOmittedExpression = function () { - var currentToken = this.currentToken(); - if (currentToken.tokenKind === 79 /* CommaToken */) { - return true; - } - - return this.isExpression(currentToken); - }; - - ParserImpl.prototype.parseAssignmentOrOmittedExpression = function () { - if (this.currentToken().tokenKind === 79 /* CommaToken */) { - return this.factory.omittedExpression(); - } - - return this.parseAssignmentExpression(true); - }; - - ParserImpl.prototype.isExpression = function (currentToken) { - switch (currentToken.tokenKind) { - case 13 /* NumericLiteral */: - case 14 /* StringLiteral */: - case 12 /* RegularExpressionLiteral */: - - case 74 /* OpenBracketToken */: - - case 72 /* OpenParenToken */: - - case 80 /* LessThanToken */: - - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 89 /* PlusToken */: - case 90 /* MinusToken */: - case 102 /* TildeToken */: - case 101 /* ExclamationToken */: - - case 70 /* OpenBraceToken */: - - case 85 /* EqualsGreaterThanToken */: - - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - - case 50 /* SuperKeyword */: - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - - case 31 /* NewKeyword */: - - case 21 /* DeleteKeyword */: - case 41 /* VoidKeyword */: - case 39 /* TypeOfKeyword */: - - case 27 /* FunctionKeyword */: - return true; - } - - return this.isIdentifier(currentToken); - }; - - ParserImpl.prototype.parseExpressionStatement = function () { - var expression = this.parseExpression(true); - - var semicolon = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.expressionStatement(expression, semicolon); - }; - - ParserImpl.prototype.parseIfStatement = function () { - var ifKeyword = this.eatKeyword(28 /* IfKeyword */); - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var condition = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - var statement = this.parseStatement(false); - - var elseClause = null; - if (this.isElseClause()) { - elseClause = this.parseElseClause(); - } - - return this.factory.ifStatement(ifKeyword, openParenToken, condition, closeParenToken, statement, elseClause); - }; - - ParserImpl.prototype.isElseClause = function () { - return this.currentToken().tokenKind === 23 /* ElseKeyword */; - }; - - ParserImpl.prototype.parseElseClause = function () { - var elseKeyword = this.eatKeyword(23 /* ElseKeyword */); - var statement = this.parseStatement(false); - - return this.factory.elseClause(elseKeyword, statement); - }; - - ParserImpl.prototype.isVariableStatement = function () { - var index = this.modifierCount(); - return this.peekToken(index).tokenKind === 40 /* VarKeyword */; - }; - - ParserImpl.prototype.parseVariableStatement = function () { - var modifiers = this.parseModifiers(); - var variableDeclaration = this.parseVariableDeclaration(true); - var semicolonToken = this.eatExplicitOrAutomaticSemicolon(false); - - return this.factory.variableStatement(modifiers, variableDeclaration, semicolonToken); - }; - - ParserImpl.prototype.parseVariableDeclaration = function (allowIn) { - var varKeyword = this.eatKeyword(40 /* VarKeyword */); - - var listParsingState = allowIn ? 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */ : 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */; - - var result = this.parseSeparatedSyntaxList(listParsingState); - var variableDeclarators = result.list; - varKeyword = this.addSkippedTokensAfterToken(varKeyword, result.skippedTokens); - - return this.factory.variableDeclaration(varKeyword, variableDeclarators); - }; - - ParserImpl.prototype.isVariableDeclarator = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 225 /* VariableDeclarator */) { - return true; - } - - return this.isIdentifier(this.currentToken()); - }; - - ParserImpl.prototype.canReuseVariableDeclaratorNode = function (node) { - if (node === null || node.kind() !== 225 /* VariableDeclarator */) { - return false; - } - - var variableDeclarator = node; - return variableDeclarator.equalsValueClause === null; - }; - - ParserImpl.prototype.parseVariableDeclarator = function (allowIn, allowPropertyName) { - if (this.canReuseVariableDeclaratorNode(this.currentNode())) { - return this.eatNode(); - } - - var propertyName = allowPropertyName ? this.eatPropertyName() : this.eatIdentifierToken(); - var equalsValueClause = null; - var typeAnnotation = null; - - if (propertyName.width() > 0) { - typeAnnotation = this.parseOptionalTypeAnnotation(false); - - if (this.isEqualsValueClause(false)) { - equalsValueClause = this.parseEqualsValueClause(allowIn); - } - } - - return this.factory.variableDeclarator(propertyName, typeAnnotation, equalsValueClause); - }; - - ParserImpl.prototype.isColonValueClause = function () { - return this.currentToken().tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.isEqualsValueClause = function (inParameter) { - var token0 = this.currentToken(); - if (token0.tokenKind === 107 /* EqualsToken */) { - return true; - } - - if (!this.previousToken().hasTrailingNewLine()) { - if (token0.tokenKind === 85 /* EqualsGreaterThanToken */) { - return false; - } - - if (token0.tokenKind === 70 /* OpenBraceToken */ && inParameter) { - return false; - } - - return this.isExpression(token0); - } - - return false; - }; - - ParserImpl.prototype.parseEqualsValueClause = function (allowIn) { - var equalsToken = this.eatToken(107 /* EqualsToken */); - var value = this.parseAssignmentExpression(allowIn); - - return this.factory.equalsValueClause(equalsToken, value); - }; - - ParserImpl.prototype.parseExpression = function (allowIn) { - return this.parseSubExpression(0, allowIn); - }; - - ParserImpl.prototype.parseAssignmentExpression = function (allowIn) { - return this.parseSubExpression(2 /* AssignmentExpressionPrecedence */, allowIn); - }; - - ParserImpl.prototype.parseUnaryExpressionOrLower = function () { - var currentTokenKind = this.currentToken().tokenKind; - if (TypeScript.SyntaxFacts.isPrefixUnaryExpressionOperatorToken(currentTokenKind)) { - var operatorKind = TypeScript.SyntaxFacts.getPrefixUnaryExpressionFromOperatorToken(currentTokenKind); - - var operatorToken = this.eatAnyToken(); - - var operand = this.parseUnaryExpressionOrLower(); - return this.factory.prefixUnaryExpression(operatorKind, operatorToken, operand); - } else if (currentTokenKind === 39 /* TypeOfKeyword */) { - return this.parseTypeOfExpression(); - } else if (currentTokenKind === 41 /* VoidKeyword */) { - return this.parseVoidExpression(); - } else if (currentTokenKind === 21 /* DeleteKeyword */) { - return this.parseDeleteExpression(); - } else if (currentTokenKind === 80 /* LessThanToken */) { - return this.parseCastExpression(); - } else { - return this.parsePostfixExpressionOrLower(); - } - }; - - ParserImpl.prototype.parseSubExpression = function (precedence, allowIn) { - if (precedence <= 2 /* AssignmentExpressionPrecedence */) { - if (this.isSimpleArrowFunctionExpression()) { - return this.parseSimpleArrowFunctionExpression(); - } - - var parethesizedArrowFunction = this.tryParseParenthesizedArrowFunctionExpression(); - if (parethesizedArrowFunction !== null) { - return parethesizedArrowFunction; - } - } - - var leftOperand = this.parseUnaryExpressionOrLower(); - return this.parseBinaryOrConditionalExpressions(precedence, allowIn, leftOperand); - }; - - ParserImpl.prototype.parseBinaryOrConditionalExpressions = function (precedence, allowIn, leftOperand) { - while (true) { - var token0 = this.currentToken(); - var token0Kind = token0.tokenKind; - - if (TypeScript.SyntaxFacts.isBinaryExpressionOperatorToken(token0Kind)) { - if (token0Kind === 29 /* InKeyword */ && !allowIn) { - break; - } - - var mergedToken = this.tryMergeBinaryExpressionTokens(); - var tokenKind = mergedToken === null ? token0Kind : mergedToken.syntaxKind; - - var binaryExpressionKind = TypeScript.SyntaxFacts.getBinaryExpressionFromOperatorToken(tokenKind); - var newPrecedence = ParserImpl.getPrecedence(binaryExpressionKind); - - if (newPrecedence < precedence) { - break; - } - - if (newPrecedence === precedence && !this.isRightAssociative(binaryExpressionKind)) { - break; - } - - var operatorToken = mergedToken === null ? token0 : TypeScript.Syntax.token(mergedToken.syntaxKind).withLeadingTrivia(token0.leadingTrivia()).withTrailingTrivia(this.peekToken(mergedToken.tokenCount - 1).trailingTrivia()); - - var skipCount = mergedToken === null ? 1 : mergedToken.tokenCount; - for (var i = 0; i < skipCount; i++) { - this.eatAnyToken(); - } - - leftOperand = this.factory.binaryExpression(binaryExpressionKind, leftOperand, operatorToken, this.parseSubExpression(newPrecedence, allowIn)); - continue; - } - - if (token0Kind === 105 /* QuestionToken */ && precedence <= 3 /* ConditionalExpressionPrecedence */) { - var questionToken = this.eatToken(105 /* QuestionToken */); - - var whenTrueExpression = this.parseAssignmentExpression(allowIn); - var colon = this.eatToken(106 /* ColonToken */); - - var whenFalseExpression = this.parseAssignmentExpression(allowIn); - leftOperand = this.factory.conditionalExpression(leftOperand, questionToken, whenTrueExpression, colon, whenFalseExpression); - continue; - } - - break; - } - - return leftOperand; - }; - - ParserImpl.prototype.tryMergeBinaryExpressionTokens = function () { - var token0 = this.currentToken(); - - if (token0.tokenKind === 81 /* GreaterThanToken */ && !token0.hasTrailingTrivia()) { - var storage = this.mergeTokensStorage; - storage[0] = 0 /* None */; - storage[1] = 0 /* None */; - storage[2] = 0 /* None */; - - for (var i = 0; i < storage.length; i++) { - var nextToken = this.peekToken(i + 1); - - if (!nextToken.hasLeadingTrivia()) { - storage[i] = nextToken.tokenKind; - } - - if (nextToken.hasTrailingTrivia()) { - break; - } - } - - if (storage[0] === 81 /* GreaterThanToken */) { - if (storage[1] === 81 /* GreaterThanToken */) { - if (storage[2] === 107 /* EqualsToken */) { - return { tokenCount: 4, syntaxKind: 114 /* GreaterThanGreaterThanGreaterThanEqualsToken */ }; - } else { - return { tokenCount: 3, syntaxKind: 97 /* GreaterThanGreaterThanGreaterThanToken */ }; - } - } else if (storage[1] === 107 /* EqualsToken */) { - return { tokenCount: 3, syntaxKind: 113 /* GreaterThanGreaterThanEqualsToken */ }; - } else { - return { tokenCount: 2, syntaxKind: 96 /* GreaterThanGreaterThanToken */ }; - } - } else if (storage[0] === 107 /* EqualsToken */) { - return { tokenCount: 2, syntaxKind: 83 /* GreaterThanEqualsToken */ }; - } - } - - return null; - }; - - ParserImpl.prototype.isRightAssociative = function (expressionKind) { - switch (expressionKind) { - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - return true; - default: - return false; - } - }; - - ParserImpl.prototype.parseMemberExpressionOrLower = function (inObjectCreation) { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } - - var expression = this.parsePrimaryExpression(); - if (expression === null) { - return this.eatIdentifierToken(); - } - - return this.parseMemberExpressionRest(expression, false, inObjectCreation); - }; - - ParserImpl.prototype.parseCallExpressionOrLower = function () { - var expression; - if (this.currentToken().tokenKind === 50 /* SuperKeyword */) { - expression = this.eatKeyword(50 /* SuperKeyword */); - - var currentTokenKind = this.currentToken().tokenKind; - if (currentTokenKind !== 72 /* OpenParenToken */ && currentTokenKind !== 76 /* DotToken */) { - expression = this.factory.memberAccessExpression(expression, this.eatToken(76 /* DotToken */), this.eatIdentifierNameToken()); - } - } else { - expression = this.parseMemberExpressionOrLower(false); - } - - return this.parseMemberExpressionRest(expression, true, false); - }; - - ParserImpl.prototype.parseMemberExpressionRest = function (expression, allowArguments, inObjectCreation) { - while (true) { - var currentTokenKind = this.currentToken().tokenKind; - - switch (currentTokenKind) { - case 72 /* OpenParenToken */: - if (!allowArguments) { - return expression; - } - - expression = this.factory.invocationExpression(expression, this.parseArgumentList(null)); - continue; - - case 80 /* LessThanToken */: - if (!allowArguments) { - return expression; - } - - var argumentList = this.tryParseArgumentList(); - if (argumentList !== null) { - expression = this.factory.invocationExpression(expression, argumentList); - continue; - } - - break; - - case 74 /* OpenBracketToken */: - expression = this.parseElementAccessExpression(expression, inObjectCreation); - continue; - - case 76 /* DotToken */: - expression = this.factory.memberAccessExpression(expression, this.eatToken(76 /* DotToken */), this.eatIdentifierNameToken()); - continue; - } - - return expression; - } - }; - - ParserImpl.prototype.parseLeftHandSideExpressionOrLower = function () { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } else { - return this.parseCallExpressionOrLower(); - } - }; - - ParserImpl.prototype.parsePostfixExpressionOrLower = function () { - var expression = this.parseLeftHandSideExpressionOrLower(); - if (expression === null) { - return this.eatIdentifierToken(); - } - - var currentTokenKind = this.currentToken().tokenKind; - - switch (currentTokenKind) { - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - if (this.previousToken() !== null && this.previousToken().hasTrailingNewLine()) { - break; - } - - return this.factory.postfixUnaryExpression(TypeScript.SyntaxFacts.getPostfixUnaryExpressionFromOperatorToken(currentTokenKind), expression, this.eatAnyToken()); - } - - return expression; - }; - - ParserImpl.prototype.tryParseGenericArgumentList = function () { - var rewindPoint = this.getRewindPoint(); - - var typeArgumentList = this.tryParseTypeArgumentList(true); - var token0 = this.currentToken(); - - var isOpenParen = token0.tokenKind === 72 /* OpenParenToken */; - var isDot = token0.tokenKind === 76 /* DotToken */; - var isOpenParenOrDot = isOpenParen || isDot; - - var argumentList = null; - if (typeArgumentList === null || !isOpenParenOrDot) { - this.rewind(rewindPoint); - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - - if (isDot) { - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token0.width(), TypeScript.DiagnosticCode.A_parameter_list_must_follow_a_generic_type_argument_list_expected, null); - this.addDiagnostic(diagnostic); - - return this.factory.argumentList(typeArgumentList, TypeScript.Syntax.emptyToken(72 /* OpenParenToken */), TypeScript.Syntax.emptySeparatedList, TypeScript.Syntax.emptyToken(73 /* CloseParenToken */)); - } else { - return this.parseArgumentList(typeArgumentList); - } - } - }; - - ParserImpl.prototype.tryParseArgumentList = function () { - if (this.currentToken().tokenKind === 80 /* LessThanToken */) { - return this.tryParseGenericArgumentList(); - } - - if (this.currentToken().tokenKind === 72 /* OpenParenToken */) { - return this.parseArgumentList(null); - } - - return null; - }; - - ParserImpl.prototype.parseArgumentList = function (typeArgumentList) { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - - var _arguments = TypeScript.Syntax.emptySeparatedList; - - if (openParenToken.fullWidth() > 0) { - var result = this.parseSeparatedSyntaxList(16384 /* ArgumentList_AssignmentExpressions */); - _arguments = result.list; - openParenToken = this.addSkippedTokensAfterToken(openParenToken, result.skippedTokens); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.argumentList(typeArgumentList, openParenToken, _arguments, closeParenToken); - }; - - ParserImpl.prototype.parseElementAccessExpression = function (expression, inObjectCreation) { - var start = this.currentTokenStart(); - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var argumentExpression; - - if (this.currentToken().tokenKind === 75 /* CloseBracketToken */ && inObjectCreation) { - var end = this.currentTokenStart() + this.currentToken().width(); - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, start, end - start, TypeScript.DiagnosticCode.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead, null); - this.addDiagnostic(diagnostic); - - argumentExpression = TypeScript.Syntax.emptyToken(11 /* IdentifierName */); - } else { - argumentExpression = this.parseExpression(true); - } - - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - return this.factory.elementAccessExpression(expression, openBracketToken, argumentExpression, closeBracketToken); - }; - - ParserImpl.prototype.parsePrimaryExpression = function () { - var currentToken = this.currentToken(); - - if (this.isIdentifier(currentToken)) { - return this.eatIdentifierToken(); - } - - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 35 /* ThisKeyword */: - return this.parseThisExpression(); - - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return this.parseLiteralExpression(); - - case 32 /* NullKeyword */: - return this.parseLiteralExpression(); - - case 27 /* FunctionKeyword */: - return this.parseFunctionExpression(); - - case 13 /* NumericLiteral */: - return this.parseLiteralExpression(); - - case 12 /* RegularExpressionLiteral */: - return this.parseLiteralExpression(); - - case 14 /* StringLiteral */: - return this.parseLiteralExpression(); - - case 74 /* OpenBracketToken */: - return this.parseArrayLiteralExpression(); - - case 70 /* OpenBraceToken */: - return this.parseObjectLiteralExpression(); - - case 72 /* OpenParenToken */: - return this.parseParenthesizedExpression(); - - case 118 /* SlashToken */: - case 119 /* SlashEqualsToken */: - var result = this.tryReparseDivideAsRegularExpression(); - if (result !== null) { - return result; - } - break; - } - - return null; - }; - - ParserImpl.prototype.tryReparseDivideAsRegularExpression = function () { - var currentToken = this.currentToken(); - - if (this.previousToken() !== null) { - var previousTokenKind = this.previousToken().tokenKind; - switch (previousTokenKind) { - case 11 /* IdentifierName */: - return null; - - case 35 /* ThisKeyword */: - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return null; - - case 14 /* StringLiteral */: - case 13 /* NumericLiteral */: - case 12 /* RegularExpressionLiteral */: - case 93 /* PlusPlusToken */: - case 94 /* MinusMinusToken */: - case 75 /* CloseBracketToken */: - return null; - } - } - - currentToken = this.currentTokenAllowingRegularExpression(); - - if (currentToken.tokenKind === 118 /* SlashToken */ || currentToken.tokenKind === 119 /* SlashEqualsToken */) { - return null; - } else if (currentToken.tokenKind === 12 /* RegularExpressionLiteral */) { - return this.parseLiteralExpression(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.parseTypeOfExpression = function () { - var typeOfKeyword = this.eatKeyword(39 /* TypeOfKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.typeOfExpression(typeOfKeyword, expression); - }; - - ParserImpl.prototype.parseDeleteExpression = function () { - var deleteKeyword = this.eatKeyword(21 /* DeleteKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.deleteExpression(deleteKeyword, expression); - }; - - ParserImpl.prototype.parseVoidExpression = function () { - var voidKeyword = this.eatKeyword(41 /* VoidKeyword */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.voidExpression(voidKeyword, expression); - }; - - ParserImpl.prototype.parseFunctionExpression = function () { - var functionKeyword = this.eatKeyword(27 /* FunctionKeyword */); - var identifier = null; - - if (this.isIdentifier(this.currentToken())) { - identifier = this.eatIdentifierToken(); - } - - var callSignature = this.parseCallSignature(false); - var block = this.parseBlock(false, true); - - return this.factory.functionExpression(functionKeyword, identifier, callSignature, block); - }; - - ParserImpl.prototype.parseObjectCreationExpression = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - - var expression = this.parseObjectCreationExpressionOrLower(true); - var argumentList = this.tryParseArgumentList(); - - var result = this.factory.objectCreationExpression(newKeyword, expression, argumentList); - return this.parseMemberExpressionRest(result, true, false); - }; - - ParserImpl.prototype.parseObjectCreationExpressionOrLower = function (inObjectCreation) { - if (this.currentToken().tokenKind === 31 /* NewKeyword */) { - return this.parseObjectCreationExpression(); - } else { - return this.parseMemberExpressionOrLower(inObjectCreation); - } - }; - - ParserImpl.prototype.parseCastExpression = function () { - var lessThanToken = this.eatToken(80 /* LessThanToken */); - var type = this.parseType(); - var greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - var expression = this.parseUnaryExpressionOrLower(); - - return this.factory.castExpression(lessThanToken, type, greaterThanToken, expression); - }; - - ParserImpl.prototype.parseParenthesizedExpression = function () { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var expression = this.parseExpression(true); - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - - return this.factory.parenthesizedExpression(openParenToken, expression, closeParenToken); - }; - - ParserImpl.prototype.tryParseParenthesizedArrowFunctionExpression = function () { - var tokenKind = this.currentToken().tokenKind; - if (tokenKind !== 72 /* OpenParenToken */ && tokenKind !== 80 /* LessThanToken */) { - return null; - } - - if (this.isDefinitelyArrowFunctionExpression()) { - return this.parseParenthesizedArrowFunctionExpression(false); - } - - if (!this.isPossiblyArrowFunctionExpression()) { - return null; - } - - var rewindPoint = this.getRewindPoint(); - - var arrowFunction = this.parseParenthesizedArrowFunctionExpression(true); - if (arrowFunction === null) { - this.rewind(rewindPoint); - } - - this.releaseRewindPoint(rewindPoint); - return arrowFunction; - }; - - ParserImpl.prototype.parseParenthesizedArrowFunctionExpression = function (requireArrow) { - var currentToken = this.currentToken(); - - var callSignature = this.parseCallSignature(true); - - if (requireArrow && this.currentToken().tokenKind !== 85 /* EqualsGreaterThanToken */) { - return null; - } - - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - - var block = this.tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = this.parseAssignmentExpression(true); - } - - return this.factory.parenthesizedArrowFunctionExpression(callSignature, equalsGreaterThanToken, block, expression); - }; - - ParserImpl.prototype.tryParseArrowFunctionBlock = function () { - if (this.isBlock()) { - return this.parseBlock(false, false); - } else { - if (this.isStatement(false) && !this.isExpressionStatement(this.currentToken()) && !this.isFunctionDeclaration()) { - return this.parseBlock(true, false); - } else { - return null; - } - } - }; - - ParserImpl.prototype.isSimpleArrowFunctionExpression = function () { - if (this.currentToken().tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return this.isIdentifier(this.currentToken()) && this.peekToken(1).tokenKind === 85 /* EqualsGreaterThanToken */; - }; - - ParserImpl.prototype.parseSimpleArrowFunctionExpression = function () { - var identifier = this.eatIdentifierToken(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - - var block = this.tryParseArrowFunctionBlock(); - var expression = null; - if (block === null) { - expression = this.parseAssignmentExpression(true); - } - - return this.factory.simpleArrowFunctionExpression(identifier, equalsGreaterThanToken, block, expression); - }; - - ParserImpl.prototype.isBlock = function () { - return this.currentToken().tokenKind === 70 /* OpenBraceToken */; - }; - - ParserImpl.prototype.isDefinitelyArrowFunctionExpression = function () { - var token0 = this.currentToken(); - if (token0.tokenKind !== 72 /* OpenParenToken */) { - return false; - } - - var token1 = this.peekToken(1); - var token2; - - if (token1.tokenKind === 73 /* CloseParenToken */) { - token2 = this.peekToken(2); - return token2.tokenKind === 106 /* ColonToken */ || token2.tokenKind === 85 /* EqualsGreaterThanToken */ || token2.tokenKind === 70 /* OpenBraceToken */; - } - - if (token1.tokenKind === 77 /* DotDotDotToken */) { - return true; - } - - token2 = this.peekToken(2); - if (token1.tokenKind === 57 /* PublicKeyword */ || token1.tokenKind === 55 /* PrivateKeyword */) { - if (this.isIdentifier(token2)) { - return true; - } - } - - if (!this.isIdentifier(token1)) { - return false; - } - - if (token2.tokenKind === 106 /* ColonToken */) { - return true; - } - - var token3 = this.peekToken(3); - if (token2.tokenKind === 105 /* QuestionToken */) { - if (token3.tokenKind === 106 /* ColonToken */ || token3.tokenKind === 73 /* CloseParenToken */ || token3.tokenKind === 79 /* CommaToken */) { - return true; - } - } - - if (token2.tokenKind === 73 /* CloseParenToken */) { - if (token3.tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.isPossiblyArrowFunctionExpression = function () { - var token0 = this.currentToken(); - if (token0.tokenKind !== 72 /* OpenParenToken */) { - return true; - } - - var token1 = this.peekToken(1); - - if (!this.isIdentifier(token1)) { - return false; - } - - var token2 = this.peekToken(2); - if (token2.tokenKind === 107 /* EqualsToken */) { - return true; - } - - if (token2.tokenKind === 79 /* CommaToken */) { - return true; - } - - if (token2.tokenKind === 73 /* CloseParenToken */) { - var token3 = this.peekToken(3); - if (token3.tokenKind === 106 /* ColonToken */) { - return true; - } - } - - return false; - }; - - ParserImpl.prototype.parseObjectLiteralExpression = function () { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var result = this.parseSeparatedSyntaxList(32768 /* ObjectLiteralExpression_PropertyAssignments */); - var propertyAssignments = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.objectLiteralExpression(openBraceToken, propertyAssignments, closeBraceToken); - }; - - ParserImpl.prototype.parsePropertyAssignment = function (inErrorRecovery) { - if (this.isAccessor(inErrorRecovery)) { - return this.parseAccessor(true); - } else if (this.isFunctionPropertyAssignment(inErrorRecovery)) { - return this.parseFunctionPropertyAssignment(); - } else if (this.isSimplePropertyAssignment(inErrorRecovery)) { - return this.parseSimplePropertyAssignment(); - } else { - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isPropertyAssignment = function (inErrorRecovery) { - return this.isAccessor(inErrorRecovery) || this.isFunctionPropertyAssignment(inErrorRecovery) || this.isSimplePropertyAssignment(inErrorRecovery); - }; - - ParserImpl.prototype.eatPropertyName = function () { - return TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(this.currentToken()) ? this.eatIdentifierNameToken() : this.eatAnyToken(); - }; - - ParserImpl.prototype.isFunctionPropertyAssignment = function (inErrorRecovery) { - return this.isPropertyName(this.currentToken(), inErrorRecovery) && this.isCallSignature(1); - }; - - ParserImpl.prototype.parseFunctionPropertyAssignment = function () { - var propertyName = this.eatPropertyName(); - var callSignature = this.parseCallSignature(false); - var block = this.parseBlock(false, true); - - return this.factory.functionPropertyAssignment(propertyName, callSignature, block); - }; - - ParserImpl.prototype.isSimplePropertyAssignment = function (inErrorRecovery) { - return this.isPropertyName(this.currentToken(), inErrorRecovery); - }; - - ParserImpl.prototype.parseSimplePropertyAssignment = function () { - var propertyName = this.eatPropertyName(); - var colonToken = this.eatToken(106 /* ColonToken */); - var expression = this.parseAssignmentExpression(true); - - return this.factory.simplePropertyAssignment(propertyName, colonToken, expression); - }; - - ParserImpl.prototype.isPropertyName = function (token, inErrorRecovery) { - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - if (inErrorRecovery) { - return this.isIdentifier(token); - } else { - return true; - } - } - - switch (token.tokenKind) { - case 14 /* StringLiteral */: - case 13 /* NumericLiteral */: - return true; - - default: - return false; - } - }; - - ParserImpl.prototype.parseArrayLiteralExpression = function () { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - - var result = this.parseSeparatedSyntaxList(65536 /* ArrayLiteralExpression_AssignmentExpressions */); - var expressions = result.list; - openBracketToken = this.addSkippedTokensAfterToken(openBracketToken, result.skippedTokens); - - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - return this.factory.arrayLiteralExpression(openBracketToken, expressions, closeBracketToken); - }; - - ParserImpl.prototype.parseLiteralExpression = function () { - return this.eatAnyToken(); - }; - - ParserImpl.prototype.parseThisExpression = function () { - return this.eatKeyword(35 /* ThisKeyword */); - }; - - ParserImpl.prototype.parseBlock = function (parseBlockEvenWithNoOpenBrace, checkForStrictMode) { - var openBraceToken = this.eatToken(70 /* OpenBraceToken */); - - var statements = TypeScript.Syntax.emptyList; - - if (parseBlockEvenWithNoOpenBrace || openBraceToken.width() > 0) { - var savedIsInStrictMode = this.isInStrictMode; - - var processItems = checkForStrictMode ? ParserImpl.updateStrictModeState : null; - var result = this.parseSyntaxList(32 /* Block_Statements */, processItems); - statements = result.list; - openBraceToken = this.addSkippedTokensAfterToken(openBraceToken, result.skippedTokens); - - this.setStrictMode(savedIsInStrictMode); - } - - var closeBraceToken = this.eatToken(71 /* CloseBraceToken */); - - return this.factory.block(openBraceToken, statements, closeBraceToken); - }; - - ParserImpl.prototype.parseCallSignature = function (requireCompleteTypeParameterList) { - var typeParameterList = this.parseOptionalTypeParameterList(requireCompleteTypeParameterList); - var parameterList = this.parseParameterList(); - var typeAnnotation = this.parseOptionalTypeAnnotation(false); - - return this.factory.callSignature(typeParameterList, parameterList, typeAnnotation); - }; - - ParserImpl.prototype.parseOptionalTypeParameterList = function (requireCompleteTypeParameterList) { - if (this.currentToken().tokenKind !== 80 /* LessThanToken */) { - return null; - } - - var rewindPoint = this.getRewindPoint(); - - var lessThanToken = this.eatToken(80 /* LessThanToken */); - - var result = this.parseSeparatedSyntaxList(524288 /* TypeParameterList_TypeParameters */); - var typeParameters = result.list; - lessThanToken = this.addSkippedTokensAfterToken(lessThanToken, result.skippedTokens); - - var greaterThanToken = this.eatToken(81 /* GreaterThanToken */); - - if (requireCompleteTypeParameterList && greaterThanToken.fullWidth() === 0) { - this.rewind(rewindPoint); - this.releaseRewindPoint(rewindPoint); - return null; - } else { - this.releaseRewindPoint(rewindPoint); - var typeParameterList = this.factory.typeParameterList(lessThanToken, typeParameters, greaterThanToken); - - return typeParameterList; - } - }; - - ParserImpl.prototype.isTypeParameter = function () { - return this.isIdentifier(this.currentToken()); - }; - - ParserImpl.prototype.parseTypeParameter = function () { - var identifier = this.eatIdentifierToken(); - var constraint = this.parseOptionalConstraint(); - - return this.factory.typeParameter(identifier, constraint); - }; - - ParserImpl.prototype.parseOptionalConstraint = function () { - if (this.currentToken().kind() !== 48 /* ExtendsKeyword */) { - return null; - } - - var extendsKeyword = this.eatKeyword(48 /* ExtendsKeyword */); - var type = this.parseType(); - - return this.factory.constraint(extendsKeyword, type); - }; - - ParserImpl.prototype.parseParameterList = function () { - var openParenToken = this.eatToken(72 /* OpenParenToken */); - var parameters = TypeScript.Syntax.emptySeparatedList; - - if (openParenToken.width() > 0) { - var result = this.parseSeparatedSyntaxList(131072 /* ParameterList_Parameters */); - parameters = result.list; - openParenToken = this.addSkippedTokensAfterToken(openParenToken, result.skippedTokens); - } - - var closeParenToken = this.eatToken(73 /* CloseParenToken */); - return this.factory.parameterList(openParenToken, parameters, closeParenToken); - }; - - ParserImpl.prototype.isTypeAnnotation = function () { - return this.currentToken().tokenKind === 106 /* ColonToken */; - }; - - ParserImpl.prototype.parseOptionalTypeAnnotation = function (allowStringLiteral) { - return this.isTypeAnnotation() ? this.parseTypeAnnotation(allowStringLiteral) : null; - }; - - ParserImpl.prototype.parseTypeAnnotation = function (allowStringLiteral) { - var colonToken = this.eatToken(106 /* ColonToken */); - var type = allowStringLiteral && this.currentToken().tokenKind === 14 /* StringLiteral */ ? this.eatToken(14 /* StringLiteral */) : this.parseType(); - - return this.factory.typeAnnotation(colonToken, type); - }; - - ParserImpl.prototype.isType = function () { - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - switch (currentTokenKind) { - case 39 /* TypeOfKeyword */: - - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - - case 70 /* OpenBraceToken */: - - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - - case 31 /* NewKeyword */: - return true; - } - - return this.isIdentifier(currentToken); - }; - - ParserImpl.prototype.parseType = function () { - var currentToken = this.currentToken(); - var currentTokenKind = currentToken.tokenKind; - - var type = this.parseNonArrayType(currentToken); - - while (this.currentToken().tokenKind === 74 /* OpenBracketToken */) { - var openBracketToken = this.eatToken(74 /* OpenBracketToken */); - var closeBracketToken = this.eatToken(75 /* CloseBracketToken */); - - type = this.factory.arrayType(type, openBracketToken, closeBracketToken); - } - - return type; - }; - - ParserImpl.prototype.isTypeQuery = function () { - return this.currentToken().tokenKind === 39 /* TypeOfKeyword */; - }; - - ParserImpl.prototype.parseTypeQuery = function () { - var typeOfKeyword = this.eatToken(39 /* TypeOfKeyword */); - var name = this.parseName(); - - return this.factory.typeQuery(typeOfKeyword, name); - }; - - ParserImpl.prototype.parseNonArrayType = function (currentToken) { - var currentTokenKind = currentToken.tokenKind; - switch (currentTokenKind) { - case 60 /* AnyKeyword */: - case 67 /* NumberKeyword */: - case 61 /* BooleanKeyword */: - case 69 /* StringKeyword */: - case 41 /* VoidKeyword */: - return this.eatAnyToken(); - - case 70 /* OpenBraceToken */: - return this.parseObjectType(); - - case 72 /* OpenParenToken */: - case 80 /* LessThanToken */: - return this.parseFunctionType(); - - case 31 /* NewKeyword */: - return this.parseConstructorType(); - - case 39 /* TypeOfKeyword */: - return this.parseTypeQuery(); - } - - return this.parseNameOrGenericType(); - }; - - ParserImpl.prototype.parseNameOrGenericType = function () { - var name = this.parseName(); - var typeArgumentList = this.tryParseTypeArgumentList(false); - - return typeArgumentList === null ? name : this.factory.genericType(name, typeArgumentList); - }; - - ParserImpl.prototype.parseFunctionType = function () { - var typeParameterList = this.parseOptionalTypeParameterList(false); - var parameterList = this.parseParameterList(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - var returnType = this.parseType(); - - return this.factory.functionType(typeParameterList, parameterList, equalsGreaterThanToken, returnType); - }; - - ParserImpl.prototype.parseConstructorType = function () { - var newKeyword = this.eatKeyword(31 /* NewKeyword */); - var typeParameterList = this.parseOptionalTypeParameterList(false); - var parameterList = this.parseParameterList(); - var equalsGreaterThanToken = this.eatToken(85 /* EqualsGreaterThanToken */); - var type = this.parseType(); - - return this.factory.constructorType(newKeyword, typeParameterList, parameterList, equalsGreaterThanToken, type); - }; - - ParserImpl.prototype.isParameter = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 242 /* Parameter */) { - return true; - } - - var token = this.currentToken(); - var tokenKind = token.tokenKind; - if (tokenKind === 77 /* DotDotDotToken */) { - return true; - } - - if (ParserImpl.isModifier(token) && !this.isModifierUsedAsParameterIdentifier(token)) { - return true; - } - - return this.isIdentifier(token); - }; - - ParserImpl.prototype.isModifierUsedAsParameterIdentifier = function (token) { - if (this.isIdentifier(token)) { - var nextTokenKind = this.peekToken(1).tokenKind; - switch (nextTokenKind) { - case 73 /* CloseParenToken */: - case 106 /* ColonToken */: - case 107 /* EqualsToken */: - case 79 /* CommaToken */: - case 105 /* QuestionToken */: - return true; - } - } - - return false; - }; - - ParserImpl.prototype.parseParameter = function () { - if (this.currentNode() !== null && this.currentNode().kind() === 242 /* Parameter */) { - return this.eatNode(); - } - - var dotDotDotToken = this.tryEatToken(77 /* DotDotDotToken */); - - var modifierArray = this.getArray(); - - while (true) { - var currentToken = this.currentToken(); - if (ParserImpl.isModifier(currentToken) && !this.isModifierUsedAsParameterIdentifier(currentToken)) { - modifierArray.push(this.eatAnyToken()); - continue; - } - - break; - } - - var modifiers = TypeScript.Syntax.list(modifierArray); - this.returnZeroOrOneLengthArray(modifierArray); - - var identifier = this.eatIdentifierToken(); - var questionToken = this.tryEatToken(105 /* QuestionToken */); - var typeAnnotation = this.parseOptionalTypeAnnotation(true); - - var equalsValueClause = null; - if (this.isEqualsValueClause(true)) { - equalsValueClause = this.parseEqualsValueClause(true); - } - - return this.factory.parameter(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause); - }; - - ParserImpl.prototype.parseSyntaxList = function (currentListType, processItems) { - if (typeof processItems === "undefined") { processItems = null; } - var savedListParsingState = this.listParsingState; - this.listParsingState |= currentListType; - - var result = this.parseSyntaxListWorker(currentListType, processItems); - - this.listParsingState = savedListParsingState; - - return result; - }; - - ParserImpl.prototype.parseSeparatedSyntaxList = function (currentListType) { - var savedListParsingState = this.listParsingState; - this.listParsingState |= currentListType; - - var result = this.parseSeparatedSyntaxListWorker(currentListType); - - this.listParsingState = savedListParsingState; - - return result; - }; - - ParserImpl.prototype.abortParsingListOrMoveToNextToken = function (currentListType, items, skippedTokens) { - this.reportUnexpectedTokenDiagnostic(currentListType); - - for (var state = 524288 /* LastListParsingState */; state >= 1 /* FirstListParsingState */; state >>= 1) { - if ((this.listParsingState & state) !== 0) { - if (this.isExpectedListTerminator(state) || this.isExpectedListItem(state, true)) { - return true; - } - } - } - - var skippedToken = this.currentToken(); - - this.moveToNextToken(); - - this.addSkippedTokenToList(items, skippedTokens, skippedToken); - - return false; - }; - - ParserImpl.prototype.addSkippedTokenToList = function (items, skippedTokens, skippedToken) { - for (var i = items.length - 1; i >= 0; i--) { - var item = items[i]; - var lastToken = item.lastToken(); - if (lastToken.fullWidth() > 0) { - items[i] = this.addSkippedTokenAfterNodeOrToken(item, skippedToken); - return; - } - } - - skippedTokens.push(skippedToken); - }; - - ParserImpl.prototype.tryParseExpectedListItem = function (currentListType, inErrorRecovery, items, processItems) { - if (this.isExpectedListItem(currentListType, inErrorRecovery)) { - var item = this.parseExpectedListItem(currentListType, inErrorRecovery); - - items.push(item); - - if (processItems !== null) { - processItems(this, items); - } - } - }; - - ParserImpl.prototype.listIsTerminated = function (currentListType) { - return this.isExpectedListTerminator(currentListType) || this.currentToken().tokenKind === 10 /* EndOfFileToken */; - }; - - ParserImpl.prototype.getArray = function () { - if (this.arrayPool.length > 0) { - return this.arrayPool.pop(); - } - - return []; - }; - - ParserImpl.prototype.returnZeroOrOneLengthArray = function (array) { - if (array.length <= 1) { - this.returnArray(array); - } - }; - - ParserImpl.prototype.returnArray = function (array) { - array.length = 0; - this.arrayPool.push(array); - }; - - ParserImpl.prototype.parseSyntaxListWorker = function (currentListType, processItems) { - var items = this.getArray(); - var skippedTokens = this.getArray(); - - while (true) { - var oldItemsCount = items.length; - this.tryParseExpectedListItem(currentListType, false, items, processItems); - - var newItemsCount = items.length; - if (newItemsCount === oldItemsCount) { - if (this.listIsTerminated(currentListType)) { - break; - } - - var abort = this.abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); - if (abort) { - break; - } - } - } - - var result = TypeScript.Syntax.list(items); - - this.returnZeroOrOneLengthArray(items); - - return { skippedTokens: skippedTokens, list: result }; - }; - - ParserImpl.prototype.parseSeparatedSyntaxListWorker = function (currentListType) { - var items = this.getArray(); - var skippedTokens = this.getArray(); - TypeScript.Debug.assert(items.length === 0); - TypeScript.Debug.assert(skippedTokens.length === 0); - TypeScript.Debug.assert(skippedTokens !== items); - - var separatorKind = this.separatorKind(currentListType); - var allowAutomaticSemicolonInsertion = separatorKind === 78 /* SemicolonToken */; - - var inErrorRecovery = false; - var listWasTerminated = false; - while (true) { - var oldItemsCount = items.length; - - this.tryParseExpectedListItem(currentListType, inErrorRecovery, items, null); - - var newItemsCount = items.length; - if (newItemsCount === oldItemsCount) { - if (this.listIsTerminated(currentListType)) { - listWasTerminated = true; - break; - } - - var abort = this.abortParsingListOrMoveToNextToken(currentListType, items, skippedTokens); - if (abort) { - break; - } else { - inErrorRecovery = true; - continue; - } - } - - inErrorRecovery = false; - - var currentToken = this.currentToken(); - if (currentToken.tokenKind === separatorKind || currentToken.tokenKind === 79 /* CommaToken */) { - items.push(this.eatAnyToken()); - continue; - } - - if (this.listIsTerminated(currentListType)) { - listWasTerminated = true; - break; - } - - if (allowAutomaticSemicolonInsertion && this.canEatAutomaticSemicolon(false)) { - items.push(this.eatExplicitOrAutomaticSemicolon(false)); - - continue; - } - - items.push(this.eatToken(separatorKind)); - - inErrorRecovery = true; - } - - var result = TypeScript.Syntax.separatedList(items); - - this.returnZeroOrOneLengthArray(items); - - return { skippedTokens: skippedTokens, list: result }; - }; - - ParserImpl.prototype.separatorKind = function (currentListType) { - switch (currentListType) { - case 2048 /* HeritageClause_TypeNameList */: - case 16384 /* ArgumentList_AssignmentExpressions */: - case 256 /* EnumDeclaration_EnumElements */: - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - case 131072 /* ParameterList_Parameters */: - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - case 262144 /* TypeArgumentList_Types */: - case 524288 /* TypeParameterList_TypeParameters */: - return 79 /* CommaToken */; - - case 512 /* ObjectType_TypeMembers */: - return 78 /* SemicolonToken */; - - case 1 /* SourceUnit_ModuleElements */: - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - case 2 /* ClassDeclaration_ClassElements */: - case 4 /* ModuleDeclaration_ModuleElements */: - case 8 /* SwitchStatement_SwitchClauses */: - case 16 /* SwitchClause_Statements */: - case 32 /* Block_Statements */: - default: - throw TypeScript.Errors.notYetImplemented(); - } - }; - - ParserImpl.prototype.reportUnexpectedTokenDiagnostic = function (listType) { - var token = this.currentToken(); - - var diagnostic = new TypeScript.Diagnostic(this.fileName, this.lineMap, this.currentTokenStart(), token.width(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [this.getExpectedListElementType(listType)]); - this.addDiagnostic(diagnostic); - }; - - ParserImpl.prototype.addDiagnostic = function (diagnostic) { - if (this.diagnostics.length > 0 && this.diagnostics[this.diagnostics.length - 1].start() === diagnostic.start()) { - return; - } - - this.diagnostics.push(diagnostic); - }; - - ParserImpl.prototype.isExpectedListTerminator = function (currentListType) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.isExpectedSourceUnit_ModuleElementsTerminator(); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.isExpectedClassDeclaration_ClassElementsTerminator(); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.isExpectedModuleDeclaration_ModuleElementsTerminator(); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.isExpectedSwitchStatement_SwitchClausesTerminator(); - - case 16 /* SwitchClause_Statements */: - return this.isExpectedSwitchClause_StatementsTerminator(); - - case 32 /* Block_Statements */: - return this.isExpectedBlock_StatementsTerminator(); - - case 64 /* TryBlock_Statements */: - return this.isExpectedTryBlock_StatementsTerminator(); - - case 128 /* CatchBlock_Statements */: - return this.isExpectedCatchBlock_StatementsTerminator(); - - case 256 /* EnumDeclaration_EnumElements */: - return this.isExpectedEnumDeclaration_EnumElementsTerminator(); - - case 512 /* ObjectType_TypeMembers */: - return this.isExpectedObjectType_TypeMembersTerminator(); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.isExpectedArgumentList_AssignmentExpressionsTerminator(); - - case 2048 /* HeritageClause_TypeNameList */: - return this.isExpectedHeritageClause_TypeNameListTerminator(); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return this.isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator(); - - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator(); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator(); - - case 131072 /* ParameterList_Parameters */: - return this.isExpectedParameterList_ParametersTerminator(); - - case 262144 /* TypeArgumentList_Types */: - return this.isExpectedTypeArgumentList_TypesTerminator(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.isExpectedTypeParameterList_TypeParametersTerminator(); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.isExpectedLiteralExpression_AssignmentExpressionsTerminator(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isExpectedSourceUnit_ModuleElementsTerminator = function () { - return this.currentToken().tokenKind === 10 /* EndOfFileToken */; - }; - - ParserImpl.prototype.isExpectedEnumDeclaration_EnumElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedModuleDeclaration_ModuleElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedObjectType_TypeMembersTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedObjectLiteralExpression_PropertyAssignmentsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedLiteralExpression_AssignmentExpressionsTerminator = function () { - return this.currentToken().tokenKind === 75 /* CloseBracketToken */; - }; - - ParserImpl.prototype.isExpectedTypeArgumentList_TypesTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 81 /* GreaterThanToken */) { - return true; - } - - if (this.canFollowTypeArgumentListInExpression(token.tokenKind)) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedTypeParameterList_TypeParametersTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 81 /* GreaterThanToken */) { - return true; - } - - if (token.tokenKind === 72 /* OpenParenToken */ || token.tokenKind === 70 /* OpenBraceToken */ || token.tokenKind === 48 /* ExtendsKeyword */ || token.tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedParameterList_ParametersTerminator = function () { - var token = this.currentToken(); - if (token.tokenKind === 73 /* CloseParenToken */) { - return true; - } - - if (token.tokenKind === 70 /* OpenBraceToken */) { - return true; - } - - if (token.tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedVariableDeclaration_VariableDeclarators_DisallowInTerminator = function () { - if (this.currentToken().tokenKind === 78 /* SemicolonToken */ || this.currentToken().tokenKind === 73 /* CloseParenToken */) { - return true; - } - - if (this.currentToken().tokenKind === 29 /* InKeyword */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedVariableDeclaration_VariableDeclarators_AllowInTerminator = function () { - if (this.previousToken().tokenKind === 79 /* CommaToken */) { - return false; - } - - if (this.currentToken().tokenKind === 85 /* EqualsGreaterThanToken */) { - return true; - } - - return this.canEatExplicitOrAutomaticSemicolon(false); - }; - - ParserImpl.prototype.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 70 /* OpenBraceToken */ || token0.tokenKind === 71 /* CloseBraceToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedHeritageClause_TypeNameListTerminator = function () { - var token0 = this.currentToken(); - if (token0.tokenKind === 48 /* ExtendsKeyword */ || token0.tokenKind === 51 /* ImplementsKeyword */) { - return true; - } - - if (this.isExpectedClassOrInterfaceDeclaration_HeritageClausesTerminator()) { - return true; - } - - return false; - }; - - ParserImpl.prototype.isExpectedArgumentList_AssignmentExpressionsTerminator = function () { - var token0 = this.currentToken(); - return token0.tokenKind === 73 /* CloseParenToken */ || token0.tokenKind === 78 /* SemicolonToken */; - }; - - ParserImpl.prototype.isExpectedClassDeclaration_ClassElementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedSwitchStatement_SwitchClausesTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedSwitchClause_StatementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */ || this.isSwitchClause(); - }; - - ParserImpl.prototype.isExpectedBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 71 /* CloseBraceToken */; - }; - - ParserImpl.prototype.isExpectedTryBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 17 /* CatchKeyword */ || this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.isExpectedCatchBlock_StatementsTerminator = function () { - return this.currentToken().tokenKind === 25 /* FinallyKeyword */; - }; - - ParserImpl.prototype.isExpectedListItem = function (currentListType, inErrorRecovery) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.isModuleElement(inErrorRecovery); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.isHeritageClause(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.isClassElement(inErrorRecovery); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.isModuleElement(inErrorRecovery); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.isSwitchClause(); - - case 16 /* SwitchClause_Statements */: - return this.isStatement(inErrorRecovery); - - case 32 /* Block_Statements */: - return this.isStatement(inErrorRecovery); - - case 64 /* TryBlock_Statements */: - case 128 /* CatchBlock_Statements */: - return false; - - case 256 /* EnumDeclaration_EnumElements */: - return this.isEnumElement(inErrorRecovery); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.isVariableDeclarator(); - - case 512 /* ObjectType_TypeMembers */: - return this.isTypeMember(inErrorRecovery); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.isExpectedArgumentList_AssignmentExpression(); - - case 2048 /* HeritageClause_TypeNameList */: - return this.isHeritageClauseTypeName(); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.isPropertyAssignment(inErrorRecovery); - - case 131072 /* ParameterList_Parameters */: - return this.isParameter(); - - case 262144 /* TypeArgumentList_Types */: - return this.isType(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.isTypeParameter(); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.isAssignmentOrOmittedExpression(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.isExpectedArgumentList_AssignmentExpression = function () { - var currentToken = this.currentToken(); - if (this.isExpression(currentToken)) { - return true; - } - - if (currentToken.tokenKind === 79 /* CommaToken */) { - return true; - } - - return false; - }; - - ParserImpl.prototype.parseExpectedListItem = function (currentListType, inErrorRecovery) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return this.parseModuleElement(inErrorRecovery); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return this.parseHeritageClause(); - - case 2 /* ClassDeclaration_ClassElements */: - return this.parseClassElement(inErrorRecovery); - - case 4 /* ModuleDeclaration_ModuleElements */: - return this.parseModuleElement(inErrorRecovery); - - case 8 /* SwitchStatement_SwitchClauses */: - return this.parseSwitchClause(); - - case 16 /* SwitchClause_Statements */: - return this.parseStatement(inErrorRecovery); - - case 32 /* Block_Statements */: - return this.parseStatement(inErrorRecovery); - - case 256 /* EnumDeclaration_EnumElements */: - return this.parseEnumElement(); - - case 512 /* ObjectType_TypeMembers */: - return this.parseTypeMember(inErrorRecovery); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return this.parseAssignmentExpression(true); - - case 2048 /* HeritageClause_TypeNameList */: - return this.parseNameOrGenericType(); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - return this.parseVariableDeclarator(true, false); - - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return this.parseVariableDeclarator(false, false); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return this.parsePropertyAssignment(inErrorRecovery); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return this.parseAssignmentOrOmittedExpression(); - - case 131072 /* ParameterList_Parameters */: - return this.parseParameter(); - - case 262144 /* TypeArgumentList_Types */: - return this.parseType(); - - case 524288 /* TypeParameterList_TypeParameters */: - return this.parseTypeParameter(); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - ParserImpl.prototype.getExpectedListElementType = function (currentListType) { - switch (currentListType) { - case 1 /* SourceUnit_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - - case 1024 /* ClassOrInterfaceDeclaration_HeritageClauses */: - return '{'; - - case 2 /* ClassDeclaration_ClassElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.constructor_function_accessor_or_variable, null); - - case 4 /* ModuleDeclaration_ModuleElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.module_class_interface_enum_import_or_statement, null); - - case 8 /* SwitchStatement_SwitchClauses */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.case_or_default_clause, null); - - case 16 /* SwitchClause_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - - case 32 /* Block_Statements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.statement, null); - - case 4096 /* VariableDeclaration_VariableDeclarators_AllowIn */: - case 8192 /* VariableDeclaration_VariableDeclarators_DisallowIn */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - - case 256 /* EnumDeclaration_EnumElements */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null); - - case 512 /* ObjectType_TypeMembers */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.call_construct_index_property_or_function_signature, null); - - case 16384 /* ArgumentList_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - case 2048 /* HeritageClause_TypeNameList */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null); - - case 32768 /* ObjectLiteralExpression_PropertyAssignments */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.property_or_accessor, null); - - case 131072 /* ParameterList_Parameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.parameter, null); - - case 262144 /* TypeArgumentList_Types */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type, null); - - case 524288 /* TypeParameterList_TypeParameters */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_parameter, null); - - case 65536 /* ArrayLiteralExpression_AssignmentExpressions */: - return TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - return ParserImpl; - })(); - - function parse(fileName, text, isDeclaration, options) { - var source = new NormalParserSource(fileName, text, options.languageVersion()); - - return new ParserImpl(fileName, text.lineMap(), source, options, text).parseSyntaxTree(isDeclaration); - } - Parser.parse = parse; - - function incrementalParse(oldSyntaxTree, textChangeRange, newText) { - if (textChangeRange.isUnchanged()) { - return oldSyntaxTree; - } - - var source = new IncrementalParserSource(oldSyntaxTree, textChangeRange, newText); - - return new ParserImpl(oldSyntaxTree.fileName(), newText.lineMap(), source, oldSyntaxTree.parseOptions(), newText).parseSyntaxTree(oldSyntaxTree.isDeclaration()); - } - Parser.incrementalParse = incrementalParse; - })(TypeScript.Parser || (TypeScript.Parser = {})); - var Parser = TypeScript.Parser; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTree = (function () { - function SyntaxTree(sourceUnit, isDeclaration, diagnostics, fileName, lineMap, parseOtions) { - this._allDiagnostics = null; - this._sourceUnit = sourceUnit; - this._isDeclaration = isDeclaration; - this._parserDiagnostics = diagnostics; - this._fileName = fileName; - this._lineMap = lineMap; - this._parseOptions = parseOtions; - } - SyntaxTree.prototype.toJSON = function (key) { - var result = {}; - - result.isDeclaration = this._isDeclaration; - result.languageVersion = TypeScript.LanguageVersion[this._parseOptions.languageVersion()]; - result.parseOptions = this._parseOptions; - - if (this.diagnostics().length > 0) { - result.diagnostics = this.diagnostics(); - } - - result.sourceUnit = this._sourceUnit; - result.lineMap = this._lineMap; - - return result; - }; - - SyntaxTree.prototype.sourceUnit = function () { - return this._sourceUnit; - }; - - SyntaxTree.prototype.isDeclaration = function () { - return this._isDeclaration; - }; - - SyntaxTree.prototype.computeDiagnostics = function () { - if (this._parserDiagnostics.length > 0) { - return this._parserDiagnostics; - } - - var diagnostics = []; - this.sourceUnit().accept(new GrammarCheckerWalker(this, diagnostics)); - - return diagnostics; - }; - - SyntaxTree.prototype.diagnostics = function () { - if (this._allDiagnostics === null) { - this._allDiagnostics = this.computeDiagnostics(); - } - - return this._allDiagnostics; - }; - - SyntaxTree.prototype.fileName = function () { - return this._fileName; - }; - - SyntaxTree.prototype.lineMap = function () { - return this._lineMap; - }; - - SyntaxTree.prototype.parseOptions = function () { - return this._parseOptions; - }; - - SyntaxTree.prototype.structuralEquals = function (tree) { - return TypeScript.ArrayUtilities.sequenceEquals(this.diagnostics(), tree.diagnostics(), TypeScript.Diagnostic.equals) && this.sourceUnit().structuralEquals(tree.sourceUnit()); - }; - return SyntaxTree; - })(); - TypeScript.SyntaxTree = SyntaxTree; - - var GrammarCheckerWalker = (function (_super) { - __extends(GrammarCheckerWalker, _super); - function GrammarCheckerWalker(syntaxTree, diagnostics) { - _super.call(this); - this.syntaxTree = syntaxTree; - this.diagnostics = diagnostics; - this.inAmbientDeclaration = false; - this.inBlock = false; - this.inObjectLiteralExpression = false; - this.currentConstructor = null; - } - GrammarCheckerWalker.prototype.childFullStart = function (parent, child) { - return this.position() + TypeScript.Syntax.childOffset(parent, child); - }; - - GrammarCheckerWalker.prototype.childStart = function (parent, child) { - return this.childFullStart(parent, child) + child.leadingTriviaWidth(); - }; - - GrammarCheckerWalker.prototype.pushDiagnostic = function (start, length, diagnosticKey, args) { - if (typeof args === "undefined") { args = null; } - this.diagnostics.push(new TypeScript.Diagnostic(this.syntaxTree.fileName(), this.syntaxTree.lineMap(), start, length, diagnosticKey, args)); - }; - - GrammarCheckerWalker.prototype.pushDiagnostic1 = function (elementFullStart, element, diagnosticKey, args) { - if (typeof args === "undefined") { args = null; } - this.diagnostics.push(new TypeScript.Diagnostic(this.syntaxTree.fileName(), this.syntaxTree.lineMap(), elementFullStart + element.leadingTriviaWidth(), element.width(), diagnosticKey, args)); - }; - - GrammarCheckerWalker.prototype.visitCatchClause = function (node) { - if (node.typeAnnotation) { - this.pushDiagnostic(this.childStart(node, node.typeAnnotation), node.typeAnnotation.width(), TypeScript.DiagnosticCode.Catch_clause_parameter_cannot_have_a_type_annotation); - } - - _super.prototype.visitCatchClause.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkParameterListOrder = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameters); - - var seenOptionalParameter = false; - var parameterCount = node.parameters.nonSeparatorCount(); - - for (var i = 0, n = node.parameters.childCount(); i < n; i++) { - var nodeOrToken = node.parameters.childAt(i); - if (i % 2 === 0) { - var parameterIndex = i / 2; - var parameter = node.parameters.childAt(i); - - if (parameter.dotDotDotToken) { - if (parameterIndex !== (parameterCount - 1)) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_must_be_last_in_list); - return true; - } - - if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_cannot_be_optional); - return true; - } - - if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Rest_parameter_cannot_have_an_initializer); - return true; - } - } else if (parameter.questionToken || parameter.equalsValueClause) { - seenOptionalParameter = true; - - if (parameter.questionToken && parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Parameter_cannot_have_question_mark_and_initializer); - return true; - } - } else { - if (seenOptionalParameter) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Required_parameter_cannot_follow_optional_parameter); - return true; - } - } - } - - parameterFullStart += nodeOrToken.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterListAcessibilityModifiers = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameters); - - for (var i = 0, n = node.parameters.childCount(); i < n; i++) { - var nodeOrToken = node.parameters.childAt(i); - if (i % 2 === 0) { - var parameter = node.parameters.childAt(i); - - if (this.checkParameterAccessibilityModifiers(node, parameter, parameterFullStart)) { - return true; - } - } - - parameterFullStart += nodeOrToken.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifiers = function (parameterList, parameter, parameterFullStart) { - if (parameter.modifiers.childCount() > 0) { - var modifiers = parameter.modifiers; - var modifierFullStart = parameterFullStart + TypeScript.Syntax.childOffset(parameter, modifiers); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - - if (this.checkParameterAccessibilityModifier(parameterList, modifier, modifierFullStart, i)) { - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkParameterAccessibilityModifier = function (parameterList, modifier, modifierFullStart, modifierIndex) { - if (modifier.tokenKind !== 57 /* PublicKeyword */ && modifier.tokenKind !== 55 /* PrivateKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_parameter, [modifier.text()]); - return true; - } else { - if (modifierIndex > 0) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - - if (!this.inAmbientDeclaration && this.currentConstructor && !this.currentConstructor.block && this.currentConstructor.callSignature.parameterList === parameterList) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Parameter_property_declarations_cannot_be_used_in_a_constructor_overload); - return true; - } else if (this.inAmbientDeclaration || this.currentConstructor === null || this.currentConstructor.callSignature.parameterList !== parameterList) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Parameter_property_declarations_can_only_be_used_in_a_non_ambient_constructor_declaration); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForTrailingSeparator = function (parent, list) { - if (list.childCount() === 0 || list.childCount() % 2 === 1) { - return false; - } - - var currentElementFullStart = this.childFullStart(parent, list); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var child = list.childAt(i); - if (i === n - 1) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode.Trailing_separator_not_allowed); - } - - currentElementFullStart += child.fullWidth(); - } - - return true; - }; - - GrammarCheckerWalker.prototype.checkForAtLeastOneElement = function (parent, list, expected) { - if (list.childCount() > 0) { - return false; - } - - var listFullStart = this.childFullStart(parent, list); - var tokenAtStart = this.syntaxTree.sourceUnit().findToken(listFullStart); - - this.pushDiagnostic1(listFullStart, tokenAtStart.token(), TypeScript.DiagnosticCode.Unexpected_token_0_expected, [expected]); - - return true; - }; - - GrammarCheckerWalker.prototype.visitParameterList = function (node) { - if (this.checkParameterListAcessibilityModifiers(node) || this.checkParameterListOrder(node) || this.checkForTrailingSeparator(node, node.parameters)) { - this.skip(node); - return; - } - - _super.prototype.visitParameterList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitHeritageClause = function (node) { - if (this.checkForTrailingSeparator(node, node.typeNames) || this.checkForAtLeastOneElement(node, node.typeNames, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.type_name, null))) { - this.skip(node); - return; - } - - _super.prototype.visitHeritageClause.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitArgumentList = function (node) { - if (this.checkForTrailingSeparator(node, node.arguments)) { - this.skip(node); - return; - } - - _super.prototype.visitArgumentList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitVariableDeclaration = function (node) { - if (this.checkForTrailingSeparator(node, node.variableDeclarators) || this.checkForAtLeastOneElement(node, node.variableDeclarators, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitVariableDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTypeArgumentList = function (node) { - if (this.checkForTrailingSeparator(node, node.typeArguments) || this.checkForAtLeastOneElement(node, node.typeArguments, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitTypeArgumentList.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTypeParameterList = function (node) { - if (this.checkForTrailingSeparator(node, node.typeParameters) || this.checkForAtLeastOneElement(node, node.typeParameters, TypeScript.getLocalizedText(TypeScript.DiagnosticCode.identifier, null))) { - this.skip(node); - return; - } - - _super.prototype.visitTypeParameterList.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkIndexSignatureParameter = function (node) { - var parameterFullStart = this.childFullStart(node, node.parameter); - var parameter = node.parameter; - - if (parameter.dotDotDotToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signatures_cannot_have_rest_parameters); - return true; - } else if (parameter.modifiers.childCount() > 0) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_accessibility_modifiers); - return true; - } else if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_a_question_mark); - return true; - } else if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_cannot_have_an_initializer); - return true; - } else if (!parameter.typeAnnotation) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_must_have_a_type_annotation); - return true; - } else if (parameter.typeAnnotation.type.kind() !== 69 /* StringKeyword */ && parameter.typeAnnotation.type.kind() !== 67 /* NumberKeyword */) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.Index_signature_parameter_type_must_be_string_or_number); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitIndexSignature = function (node) { - if (this.checkIndexSignatureParameter(node)) { - this.skip(node); - return; - } - - if (!node.typeAnnotation) { - this.pushDiagnostic1(this.position(), node, TypeScript.DiagnosticCode.Index_signature_must_have_a_type_annotation); - this.skip(node); - return; - } - - _super.prototype.visitIndexSignature.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkClassDeclarationHeritageClauses = function (node) { - var heritageClauseFullStart = this.childFullStart(node, node.heritageClauses); - - var seenExtendsClause = false; - var seenImplementsClause = false; - - for (var i = 0, n = node.heritageClauses.childCount(); i < n; i++) { - TypeScript.Debug.assert(i <= 2); - var heritageClause = node.heritageClauses.childAt(i); - - if (heritageClause.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - - if (seenImplementsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_must_precede_implements_clause); - return true; - } - - if (heritageClause.typeNames.nonSeparatorCount() > 1) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.Classes_can_only_extend_a_single_class); - return true; - } - - seenExtendsClause = true; - } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - if (seenImplementsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.implements_clause_already_seen); - return true; - } - - seenImplementsClause = true; - } - - heritageClauseFullStart += heritageClause.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifier = function (modifiers) { - if (this.inAmbientDeclaration) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - - if (declareToken) { - this.pushDiagnostic1(this.childFullStart(modifiers, declareToken), declareToken, TypeScript.DiagnosticCode.declare_modifier_not_allowed_for_code_already_in_an_ambient_context); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForRequiredDeclareModifier = function (moduleElement, typeKeyword, modifiers) { - if (!this.inAmbientDeclaration && this.syntaxTree.isDeclaration()) { - if (!TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - this.pushDiagnostic1(this.childFullStart(moduleElement, typeKeyword), typeKeyword.firstToken(), TypeScript.DiagnosticCode.declare_modifier_required_for_top_level_element); - return true; - } - } - }; - - GrammarCheckerWalker.prototype.checkFunctionOverloads = function (node, moduleElements) { - if (!this.inAmbientDeclaration && !this.syntaxTree.isDeclaration()) { - var moduleElementFullStart = this.childFullStart(node, moduleElements); - - var inFunctionOverloadChain = false; - var functionOverloadChainName = null; - - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - var lastElement = i === (n - 1); - - if (inFunctionOverloadChain) { - if (moduleElement.kind() !== 129 /* FunctionDeclaration */) { - this.pushDiagnostic1(moduleElementFullStart, moduleElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - - var functionDeclaration = moduleElement; - if (functionDeclaration.identifier.valueText() !== functionOverloadChainName) { - var identifierFullStart = moduleElementFullStart + TypeScript.Syntax.childOffset(moduleElement, functionDeclaration.identifier); - this.pushDiagnostic1(identifierFullStart, functionDeclaration.identifier, TypeScript.DiagnosticCode.Function_overload_name_must_be_0, [functionOverloadChainName]); - return true; - } - } - - if (moduleElement.kind() === 129 /* FunctionDeclaration */) { - functionDeclaration = moduleElement; - if (!TypeScript.SyntaxUtilities.containsToken(functionDeclaration.modifiers, 63 /* DeclareKeyword */)) { - inFunctionOverloadChain = functionDeclaration.block === null; - functionOverloadChainName = functionDeclaration.identifier.valueText(); - - if (inFunctionOverloadChain) { - if (lastElement) { - this.pushDiagnostic1(moduleElementFullStart, moduleElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } else { - var nextElement = moduleElements.childAt(i + 1); - if (nextElement.kind() === 129 /* FunctionDeclaration */) { - var nextFunction = nextElement; - - if (nextFunction.identifier.valueText() !== functionOverloadChainName && nextFunction.block === null) { - var identifierFullStart = moduleElementFullStart + TypeScript.Syntax.childOffset(moduleElement, functionDeclaration.identifier); - this.pushDiagnostic1(identifierFullStart, functionDeclaration.identifier, TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - } - } - } - } else { - inFunctionOverloadChain = false; - functionOverloadChainName = ""; - } - } - - moduleElementFullStart += moduleElement.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkClassOverloads = function (node) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - var classElementFullStart = this.childFullStart(node, node.classElements); - - var inFunctionOverloadChain = false; - var inConstructorOverloadChain = false; - - var functionOverloadChainName = null; - var isInStaticOverloadChain = null; - var memberFunctionDeclaration = null; - - for (var i = 0, n = node.classElements.childCount(); i < n; i++) { - var classElement = node.classElements.childAt(i); - var lastElement = i === (n - 1); - var isStaticOverload = null; - - if (inFunctionOverloadChain) { - if (classElement.kind() !== 135 /* MemberFunctionDeclaration */) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - - memberFunctionDeclaration = classElement; - if (memberFunctionDeclaration.propertyName.valueText() !== functionOverloadChainName) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, TypeScript.DiagnosticCode.Function_overload_name_must_be_0, [functionOverloadChainName]); - return true; - } - - isStaticOverload = TypeScript.SyntaxUtilities.containsToken(memberFunctionDeclaration.modifiers, 58 /* StaticKeyword */); - if (isStaticOverload !== isInStaticOverloadChain) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - var diagnostic = isInStaticOverloadChain ? TypeScript.DiagnosticCode.Function_overload_must_be_static : TypeScript.DiagnosticCode.Function_overload_must_not_be_static; - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, diagnostic, null); - return true; - } - } else if (inConstructorOverloadChain) { - if (classElement.kind() !== 137 /* ConstructorDeclaration */) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Constructor_implementation_expected); - return true; - } - } - - if (classElement.kind() === 135 /* MemberFunctionDeclaration */) { - memberFunctionDeclaration = classElement; - - inFunctionOverloadChain = memberFunctionDeclaration.block === null; - functionOverloadChainName = memberFunctionDeclaration.propertyName.valueText(); - isInStaticOverloadChain = TypeScript.SyntaxUtilities.containsToken(memberFunctionDeclaration.modifiers, 58 /* StaticKeyword */); - - if (inFunctionOverloadChain) { - if (lastElement) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } else { - var nextElement = node.classElements.childAt(i + 1); - if (nextElement.kind() === 135 /* MemberFunctionDeclaration */) { - var nextMemberFunction = nextElement; - - if (nextMemberFunction.propertyName.valueText() !== functionOverloadChainName && nextMemberFunction.block === null) { - var propertyNameFullStart = classElementFullStart + TypeScript.Syntax.childOffset(classElement, memberFunctionDeclaration.propertyName); - this.pushDiagnostic1(propertyNameFullStart, memberFunctionDeclaration.propertyName, TypeScript.DiagnosticCode.Function_implementation_expected); - return true; - } - } - } - } - } else if (classElement.kind() === 137 /* ConstructorDeclaration */) { - var constructorDeclaration = classElement; - - inConstructorOverloadChain = constructorDeclaration.block === null; - if (lastElement && inConstructorOverloadChain) { - this.pushDiagnostic1(classElementFullStart, classElement.firstToken(), TypeScript.DiagnosticCode.Constructor_implementation_expected); - return true; - } - } - - classElementFullStart += classElement.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForReservedName = function (parent, name, diagnosticKey) { - var nameFullStart = this.childFullStart(parent, name); - var token; - var tokenFullStart; - - var current = name; - while (current !== null) { - if (current.kind() === 121 /* QualifiedName */) { - var qualifiedName = current; - token = qualifiedName.right; - tokenFullStart = nameFullStart + this.childFullStart(qualifiedName, token); - current = qualifiedName.left; - } else { - TypeScript.Debug.assert(current.kind() === 11 /* IdentifierName */); - token = current; - tokenFullStart = nameFullStart; - current = null; - } - - switch (token.valueText()) { - case "any": - case "number": - case "boolean": - case "string": - case "void": - this.pushDiagnostic(tokenFullStart + token.leadingTriviaWidth(), token.width(), diagnosticKey, [token.valueText()]); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitClassDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Class_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.classKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkClassDeclarationHeritageClauses(node) || this.checkClassOverloads(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitClassDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkInterfaceDeclarationHeritageClauses = function (node) { - var heritageClauseFullStart = this.childFullStart(node, node.heritageClauses); - - var seenExtendsClause = false; - - for (var i = 0, n = node.heritageClauses.childCount(); i < n; i++) { - TypeScript.Debug.assert(i <= 1); - var heritageClause = node.heritageClauses.childAt(i); - - if (heritageClause.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */) { - if (seenExtendsClause) { - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.extends_clause_already_seen); - return true; - } - - seenExtendsClause = true; - } else { - TypeScript.Debug.assert(heritageClause.extendsOrImplementsKeyword.tokenKind === 51 /* ImplementsKeyword */); - this.pushDiagnostic1(heritageClauseFullStart, heritageClause, TypeScript.DiagnosticCode.Interface_declaration_cannot_have_implements_clause); - return true; - } - - heritageClauseFullStart += heritageClause.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkInterfaceModifiers = function (modifiers) { - var modifierFullStart = this.position(); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - if (modifier.tokenKind === 63 /* DeclareKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.declare_modifier_cannot_appear_on_an_interface_declaration); - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitInterfaceDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Interface_name_cannot_be_0) || this.checkInterfaceModifiers(node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkInterfaceDeclarationHeritageClauses(node)) { - this.skip(node); - return; - } - - _super.prototype.visitInterfaceDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkClassElementModifiers = function (list) { - var modifierFullStart = this.position(); - - var seenAccessibilityModifier = false; - var seenStaticModifier = false; - - for (var i = 0, n = list.childCount(); i < n; i++) { - var modifier = list.childAt(i); - if (modifier.tokenKind === 57 /* PublicKeyword */ || modifier.tokenKind === 55 /* PrivateKeyword */) { - if (seenAccessibilityModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return true; - } - - if (seenStaticModifier) { - var previousToken = list.childAt(i - 1); - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [modifier.text(), previousToken.text()]); - return true; - } - - seenAccessibilityModifier = true; - } else if (modifier.tokenKind === 58 /* StaticKeyword */) { - if (seenStaticModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return true; - } - - seenStaticModifier = true; - } else { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_class_element, [modifier.text()]); - return true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitMemberVariableDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitMemberVariableDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitMemberFunctionDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitMemberFunctionDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkGetAccessorParameter = function (node, getKeyword, parameterList) { - var getKeywordFullStart = this.childFullStart(node, getKeyword); - if (parameterList.parameters.childCount() !== 0) { - this.pushDiagnostic1(getKeywordFullStart, getKeyword, TypeScript.DiagnosticCode.get_accessor_cannot_have_parameters); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitIndexMemberDeclaration = function (node) { - if (this.checkIndexMemberModifiers(node)) { - this.skip(node); - return; - } - - _super.prototype.visitIndexMemberDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkIndexMemberModifiers = function (node) { - if (node.modifiers.childCount() > 0) { - var modifierFullStart = this.childFullStart(node, node.modifiers); - this.pushDiagnostic1(modifierFullStart, node.modifiers.childAt(0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkEcmaScriptVersionIsAtLeast = function (parent, node, languageVersion, diagnosticKey) { - if (this.syntaxTree.parseOptions().languageVersion() < languageVersion) { - var nodeFullStart = this.childFullStart(parent, node); - this.pushDiagnostic1(nodeFullStart, node, diagnosticKey); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitObjectLiteralExpression = function (node) { - var savedInObjectLiteralExpression = this.inObjectLiteralExpression; - this.inObjectLiteralExpression = true; - _super.prototype.visitObjectLiteralExpression.call(this, node); - this.inObjectLiteralExpression = savedInObjectLiteralExpression; - }; - - GrammarCheckerWalker.prototype.visitGetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.getKeyword, 1 /* EcmaScript5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkGetAccessorParameter(node, node.getKeyword, node.parameterList)) { - this.skip(node); - return; - } - - _super.prototype.visitGetAccessor.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForAccessorDeclarationInAmbientContext = function (accessor) { - if (this.inAmbientDeclaration) { - this.pushDiagnostic1(this.position(), accessor, TypeScript.DiagnosticCode.Accessors_are_not_allowed_in_ambient_contexts, null); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkSetAccessorParameter = function (node, setKeyword, parameterList) { - var setKeywordFullStart = this.childFullStart(node, setKeyword); - if (parameterList.parameters.childCount() !== 1) { - this.pushDiagnostic1(setKeywordFullStart, setKeyword, TypeScript.DiagnosticCode.set_accessor_must_have_one_and_only_one_parameter); - return true; - } - - var parameterListFullStart = this.childFullStart(node, parameterList); - var parameterFullStart = parameterListFullStart + TypeScript.Syntax.childOffset(parameterList, parameterList.openParenToken); - var parameter = parameterList.parameters.childAt(0); - - if (parameter.questionToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_be_optional); - return true; - } - - if (parameter.equalsValueClause) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_parameter_cannot_have_an_initializer); - return true; - } - - if (parameter.dotDotDotToken) { - this.pushDiagnostic1(parameterFullStart, parameter, TypeScript.DiagnosticCode.set_accessor_cannot_have_rest_parameter); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitSetAccessor = function (node) { - if (this.checkForAccessorDeclarationInAmbientContext(node) || this.checkEcmaScriptVersionIsAtLeast(node, node.setKeyword, 1 /* EcmaScript5 */, TypeScript.DiagnosticCode.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkClassElementModifiers(node.modifiers) || this.checkSetAccessorParameter(node, node.setKeyword, node.parameterList)) { - this.skip(node); - return; - } - - _super.prototype.visitSetAccessor.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitEnumDeclaration = function (node) { - if (this.checkForReservedName(node, node.identifier, TypeScript.DiagnosticCode.Enum_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.enumKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers), this.checkEnumElements(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitEnumDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkEnumElements = function (node) { - var enumElementFullStart = this.childFullStart(node, node.enumElements); - - var previousValueWasComputed = false; - for (var i = 0, n = node.enumElements.childCount(); i < n; i++) { - var child = node.enumElements.childAt(i); - - if (i % 2 === 0) { - var enumElement = child; - - if (!enumElement.equalsValueClause && previousValueWasComputed) { - this.pushDiagnostic1(enumElementFullStart, enumElement, TypeScript.DiagnosticCode.Enum_member_must_have_initializer, null); - return true; - } - - if (enumElement.equalsValueClause) { - var value = enumElement.equalsValueClause.value; - previousValueWasComputed = !TypeScript.Syntax.isIntegerLiteral(value); - } - } - - enumElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitEnumElement = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - var expression = node.equalsValueClause.value; - if (!TypeScript.Syntax.isIntegerLiteral(expression)) { - this.pushDiagnostic1(this.childFullStart(node, node.equalsValueClause), node.equalsValueClause.firstToken(), TypeScript.DiagnosticCode.Ambient_enum_elements_can_only_have_integer_literal_initializers); - this.skip(node); - return; - } - } - - _super.prototype.visitEnumElement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitInvocationExpression = function (node) { - if (node.expression.kind() === 50 /* SuperKeyword */ && node.argumentList.typeArgumentList !== null) { - this.pushDiagnostic1(this.position(), node, TypeScript.DiagnosticCode.super_invocation_cannot_have_type_arguments); - } - - _super.prototype.visitInvocationExpression.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkModuleElementModifiers = function (modifiers) { - var modifierFullStart = this.position(); - var seenExportModifier = false; - var seenDeclareModifier = false; - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var modifier = modifiers.childAt(i); - if (modifier.tokenKind === 57 /* PublicKeyword */ || modifier.tokenKind === 55 /* PrivateKeyword */ || modifier.tokenKind === 58 /* StaticKeyword */) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_module_element, [modifier.text()]); - return true; - } - - if (modifier.tokenKind === 63 /* DeclareKeyword */) { - if (seenDeclareModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode.Accessibility_modifier_already_seen); - return; - } - - seenDeclareModifier = true; - } else if (modifier.tokenKind === 47 /* ExportKeyword */) { - if (seenExportModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_already_seen, [modifier.text()]); - return; - } - - if (seenDeclareModifier) { - this.pushDiagnostic1(modifierFullStart, modifier, TypeScript.DiagnosticCode._0_modifier_must_precede_1_modifier, [TypeScript.SyntaxFacts.getText(47 /* ExportKeyword */), TypeScript.SyntaxFacts.getText(63 /* DeclareKeyword */)]); - return; - } - - seenExportModifier = true; - } - - modifierFullStart += modifier.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedImportDeclaration = function (node) { - var currentElementFullStart = this.childFullStart(node, node.moduleElements); - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var child = node.moduleElements.childAt(i); - if (child.kind() === 133 /* ImportDeclaration */) { - var importDeclaration = child; - if (importDeclaration.moduleReference.kind() === 245 /* ExternalModuleReference */) { - if (node.stringLiteral === null) { - this.pushDiagnostic1(currentElementFullStart, importDeclaration, TypeScript.DiagnosticCode.Import_declarations_in_an_internal_module_cannot_reference_an_external_module, null); - } - } - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedDeclareModifierOnImportDeclaration = function (modifiers) { - var declareToken = TypeScript.SyntaxUtilities.getToken(modifiers, 63 /* DeclareKeyword */); - - if (declareToken) { - this.pushDiagnostic1(this.childFullStart(modifiers, declareToken), declareToken, TypeScript.DiagnosticCode.declare_modifier_not_allowed_on_import_declaration); - return true; - } - }; - - GrammarCheckerWalker.prototype.visitImportDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifierOnImportDeclaration(node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - _super.prototype.visitImportDeclaration.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitModuleDeclaration = function (node) { - if (this.checkForReservedName(node, node.name, TypeScript.DiagnosticCode.Module_name_cannot_be_0) || this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForRequiredDeclareModifier(node, node.moduleKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers) || this.checkForDisallowedImportDeclaration(node) || this.checkForDisallowedExports(node, node.moduleElements) || this.checkForMultipleExportAssignments(node, node.moduleElements)) { - this.skip(node); - return; - } - - if (!TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */) && this.checkFunctionOverloads(node, node.moduleElements)) { - this.skip(node); - return; - } - - if (node.stringLiteral) { - if (!this.inAmbientDeclaration && !TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */)) { - var stringLiteralFullStart = this.childFullStart(node, node.stringLiteral); - this.pushDiagnostic1(stringLiteralFullStart, node.stringLiteral, TypeScript.DiagnosticCode.Only_ambient_modules_can_use_quoted_names); - this.skip(node); - return; - } - } - - if (!node.stringLiteral && this.checkForDisallowedExportAssignment(node)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitModuleDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedExports = function (node, moduleElements) { - var seenExportedElement = false; - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - - if (TypeScript.SyntaxUtilities.hasExportKeyword(child)) { - seenExportedElement = true; - break; - } - } - - var moduleElementFullStart = this.childFullStart(node, moduleElements); - if (seenExportedElement) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - - if (child.kind() === 134 /* ExportAssignment */) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Export_assignment_not_allowed_in_module_with_exported_element); - return true; - } - - moduleElementFullStart += child.fullWidth(); - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkForMultipleExportAssignments = function (node, moduleElements) { - var moduleElementFullStart = this.childFullStart(node, moduleElements); - var seenExportAssignment = false; - var errorFound = false; - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var child = moduleElements.childAt(i); - if (child.kind() === 134 /* ExportAssignment */) { - if (seenExportAssignment) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Module_cannot_have_multiple_export_assignments); - errorFound = true; - } - seenExportAssignment = true; - } - - moduleElementFullStart += child.fullWidth(); - } - - return errorFound; - }; - - GrammarCheckerWalker.prototype.checkForDisallowedExportAssignment = function (node) { - var moduleElementFullStart = this.childFullStart(node, node.moduleElements); - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var child = node.moduleElements.childAt(i); - - if (child.kind() === 134 /* ExportAssignment */) { - this.pushDiagnostic1(moduleElementFullStart, child, TypeScript.DiagnosticCode.Export_assignment_cannot_be_used_in_internal_modules); - - return true; - } - - moduleElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitBlock = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic1(this.position(), node.firstToken(), TypeScript.DiagnosticCode.Implementations_are_not_allowed_in_ambient_contexts); - this.skip(node); - return; - } - - if (this.checkFunctionOverloads(node, node.statements)) { - this.skip(node); - return; - } - - var savedInBlock = this.inBlock; - this.inBlock = true; - _super.prototype.visitBlock.call(this, node); - this.inBlock = savedInBlock; - }; - - GrammarCheckerWalker.prototype.checkForStatementInAmbientContxt = function (node) { - if (this.inAmbientDeclaration || this.syntaxTree.isDeclaration()) { - this.pushDiagnostic1(this.position(), node.firstToken(), TypeScript.DiagnosticCode.Statements_are_not_allowed_in_ambient_contexts); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitBreakStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitBreakStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitContinueStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitContinueStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitDebuggerStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitDebuggerStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitDoStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitDoStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitEmptyStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitEmptyStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitExpressionStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitExpressionStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitForInStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node) || this.checkForInStatementVariableDeclaration(node)) { - this.skip(node); - return; - } - - _super.prototype.visitForInStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForInStatementVariableDeclaration = function (node) { - if (node.variableDeclaration && node.variableDeclaration.variableDeclarators.nonSeparatorCount() > 1) { - var variableDeclarationFullStart = this.childFullStart(node, node.variableDeclaration); - - this.pushDiagnostic1(variableDeclarationFullStart, node.variableDeclaration, TypeScript.DiagnosticCode.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitForStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitForStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitIfStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitIfStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitLabeledStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitLabeledStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitReturnStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitReturnStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitSwitchStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitSwitchStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitThrowStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitThrowStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitTryStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitTryStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitWhileStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitWhileStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitWithStatement = function (node) { - if (this.checkForStatementInAmbientContxt(node)) { - this.skip(node); - return; - } - - _super.prototype.visitWithStatement.call(this, node); - }; - - GrammarCheckerWalker.prototype.checkForDisallowedModifiers = function (parent, modifiers) { - if (this.inBlock || this.inObjectLiteralExpression) { - if (modifiers.childCount() > 0) { - var modifierFullStart = this.childFullStart(parent, modifiers); - this.pushDiagnostic1(modifierFullStart, modifiers.childAt(0), TypeScript.DiagnosticCode.Modifiers_cannot_appear_here); - return true; - } - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitFunctionDeclaration = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.functionKeyword, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitFunctionDeclaration.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitVariableStatement = function (node) { - if (this.checkForDisallowedDeclareModifier(node.modifiers) || this.checkForDisallowedModifiers(node, node.modifiers) || this.checkForRequiredDeclareModifier(node, node.variableDeclaration, node.modifiers) || this.checkModuleElementModifiers(node.modifiers)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = this.inAmbientDeclaration || this.syntaxTree.isDeclaration() || TypeScript.SyntaxUtilities.containsToken(node.modifiers, 63 /* DeclareKeyword */); - _super.prototype.visitVariableStatement.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.checkListSeparators = function (parent, list, kind) { - var currentElementFullStart = this.childFullStart(parent, list); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var child = list.childAt(i); - if (i % 2 === 1 && child.kind() !== kind) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode._0_expected, [TypeScript.SyntaxFacts.getText(kind)]); - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitObjectType = function (node) { - if (this.checkListSeparators(node, node.typeMembers, 78 /* SemicolonToken */)) { - this.skip(node); - return; - } - - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitObjectType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitArrayType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitArrayType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitFunctionType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitFunctionType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitConstructorType = function (node) { - var savedInAmbientDeclaration = this.inAmbientDeclaration; - this.inAmbientDeclaration = true; - _super.prototype.visitConstructorType.call(this, node); - this.inAmbientDeclaration = savedInAmbientDeclaration; - }; - - GrammarCheckerWalker.prototype.visitVariableDeclarator = function (node) { - if (this.inAmbientDeclaration && node.equalsValueClause) { - this.pushDiagnostic1(this.childFullStart(node, node.equalsValueClause), node.equalsValueClause.firstToken(), TypeScript.DiagnosticCode.Initializers_are_not_allowed_in_ambient_contexts); - this.skip(node); - return; - } - - _super.prototype.visitVariableDeclarator.call(this, node); - }; - - GrammarCheckerWalker.prototype.visitConstructorDeclaration = function (node) { - if (this.checkClassElementModifiers(node.modifiers) || this.checkConstructorModifiers(node.modifiers) || this.checkConstructorTypeParameterList(node) || this.checkConstructorTypeAnnotation(node)) { - this.skip(node); - return; - } - - var savedCurrentConstructor = this.currentConstructor; - this.currentConstructor = node; - _super.prototype.visitConstructorDeclaration.call(this, node); - this.currentConstructor = savedCurrentConstructor; - }; - - GrammarCheckerWalker.prototype.checkConstructorModifiers = function (modifiers) { - var currentElementFullStart = this.position(); - - for (var i = 0, n = modifiers.childCount(); i < n; i++) { - var child = modifiers.childAt(i); - if (child.kind() !== 57 /* PublicKeyword */) { - this.pushDiagnostic1(currentElementFullStart, child, TypeScript.DiagnosticCode._0_modifier_cannot_appear_on_a_constructor_declaration, [TypeScript.SyntaxFacts.getText(child.kind())]); - return true; - } - - currentElementFullStart += child.fullWidth(); - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkConstructorTypeParameterList = function (node) { - var currentElementFullStart = this.position(); - - if (node.callSignature.typeParameterList) { - var callSignatureFullStart = this.childFullStart(node, node.callSignature); - var typeParameterListFullStart = callSignatureFullStart + TypeScript.Syntax.childOffset(node.callSignature, node.callSignature.typeAnnotation); - this.pushDiagnostic1(callSignatureFullStart, node.callSignature.typeParameterList, TypeScript.DiagnosticCode.Type_parameters_cannot_appear_on_a_constructor_declaration); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.checkConstructorTypeAnnotation = function (node) { - var currentElementFullStart = this.position(); - - if (node.callSignature.typeAnnotation) { - var callSignatureFullStart = this.childFullStart(node, node.callSignature); - var typeAnnotationFullStart = callSignatureFullStart + TypeScript.Syntax.childOffset(node.callSignature, node.callSignature.typeAnnotation); - this.pushDiagnostic1(typeAnnotationFullStart, node.callSignature.typeAnnotation, TypeScript.DiagnosticCode.Type_annotation_cannot_appear_on_a_constructor_declaration); - return true; - } - - return false; - }; - - GrammarCheckerWalker.prototype.visitSourceUnit = function (node) { - if (this.checkFunctionOverloads(node, node.moduleElements) || this.checkForDisallowedExports(node, node.moduleElements) || this.checkForMultipleExportAssignments(node, node.moduleElements)) { - this.skip(node); - return; - } - - _super.prototype.visitSourceUnit.call(this, node); - }; - return GrammarCheckerWalker; - })(TypeScript.PositionTrackingWalker); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Unicode = (function () { - function Unicode() { - } - Unicode.lookupInUnicodeMap = function (code, map) { - if (code < map[0]) { - return false; - } - - var lo = 0; - var hi = map.length; - var mid; - - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - - if (code < map[mid]) { - hi = mid; - } else { - lo = mid + 2; - } - } - - return false; - }; - - Unicode.isIdentifierStart = function (code, languageVersion) { - if (languageVersion === 0 /* EcmaScript3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierStart); - } else if (languageVersion === 1 /* EcmaScript5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierStart); - } else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - - Unicode.isIdentifierPart = function (code, languageVersion) { - if (languageVersion === 0 /* EcmaScript3 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES3IdentifierPart); - } else if (languageVersion === 1 /* EcmaScript5 */) { - return Unicode.lookupInUnicodeMap(code, Unicode.unicodeES5IdentifierPart); - } else { - throw TypeScript.Errors.argumentOutOfRange("languageVersion"); - } - }; - Unicode.unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - Unicode.unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - - Unicode.unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - Unicode.unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500]; - return Unicode; - })(); - TypeScript.Unicode = Unicode; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (CompilerDiagnostics) { - CompilerDiagnostics.debug = false; - - CompilerDiagnostics.diagnosticWriter = null; - - CompilerDiagnostics.analysisPass = 0; - - function Alert(output) { - if (CompilerDiagnostics.diagnosticWriter) { - CompilerDiagnostics.diagnosticWriter.Alert(output); - } - } - CompilerDiagnostics.Alert = Alert; - - function debugPrint(s) { - if (CompilerDiagnostics.debug) { - Alert(s); - } - } - CompilerDiagnostics.debugPrint = debugPrint; - - function assert(condition, s) { - if (CompilerDiagnostics.debug) { - if (!condition) { - Alert(s); - } - } - } - CompilerDiagnostics.assert = assert; - })(TypeScript.CompilerDiagnostics || (TypeScript.CompilerDiagnostics = {})); - var CompilerDiagnostics = TypeScript.CompilerDiagnostics; - - var NullLogger = (function () { - function NullLogger() { - } - NullLogger.prototype.information = function () { - return false; - }; - NullLogger.prototype.debug = function () { - return false; - }; - NullLogger.prototype.warning = function () { - return false; - }; - NullLogger.prototype.error = function () { - return false; - }; - NullLogger.prototype.fatal = function () { - return false; - }; - NullLogger.prototype.log = function (s) { - }; - return NullLogger; - })(); - TypeScript.NullLogger = NullLogger; - - function timeFunction(logger, funcDescription, func) { - var start = (new Date()).getTime(); - var result = func(); - var end = (new Date()).getTime(); - if (logger.information()) { - logger.log(funcDescription + " completed in " + (end - start) + " msec"); - } - return result; - } - TypeScript.timeFunction = timeFunction; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Document = (function () { - function Document(_compiler, _semanticInfoChain, fileName, referencedFiles, _scriptSnapshot, byteOrderMark, version, isOpen, _syntaxTree, _topLevelDecl) { - this._compiler = _compiler; - this._semanticInfoChain = _semanticInfoChain; - this.fileName = fileName; - this.referencedFiles = referencedFiles; - this._scriptSnapshot = _scriptSnapshot; - this.byteOrderMark = byteOrderMark; - this.version = version; - this.isOpen = isOpen; - this._syntaxTree = _syntaxTree; - this._topLevelDecl = _topLevelDecl; - this._diagnostics = null; - this._bloomFilter = null; - this._sourceUnit = null; - this._lineMap = null; - this._declASTMap = []; - this._astDeclMap = []; - this._amdDependencies = undefined; - this._externalModuleIndicatorSpan = undefined; - } - Document.prototype.invalidate = function () { - this._declASTMap.length = 0; - this._astDeclMap.length = 0; - this._topLevelDecl = null; - - this._syntaxTree = null; - this._sourceUnit = null; - this._diagnostics = null; - this._bloomFilter = null; - }; - - Document.prototype.isDeclareFile = function () { - return TypeScript.isDTSFile(this.fileName); - }; - - Document.prototype.cacheSyntaxTreeInfo = function (syntaxTree) { - var start = new Date().getTime(); - this._diagnostics = syntaxTree.diagnostics(); - TypeScript.syntaxDiagnosticsTime += new Date().getTime() - start; - - this._lineMap = syntaxTree.lineMap(); - - var sourceUnit = syntaxTree.sourceUnit(); - var leadingTrivia = sourceUnit.leadingTrivia(); - - this._externalModuleIndicatorSpan = this.getImplicitImportSpan(leadingTrivia) || this.getTopLevelImportOrExportSpan(sourceUnit); - - var amdDependencies = []; - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - if (trivia.isComment()) { - var amdDependency = this.getAmdDependency(trivia.fullText()); - if (amdDependency) { - amdDependencies.push(amdDependency); - } - } - } - - this._amdDependencies = amdDependencies; - }; - - Document.prototype.getAmdDependency = function (comment) { - var amdDependencyRegEx = /^\/\/\/\s*/gim; - var match = implicitImportRegEx.exec(trivia.fullText()); - - if (match) { - return new TypeScript.TextSpan(position, trivia.fullWidth()); - } - - return null; - }; - - Document.prototype.getTopLevelImportOrExportSpan = function (node) { - var firstToken; - var position = 0; - - for (var i = 0, n = node.moduleElements.childCount(); i < n; i++) { - var moduleElement = node.moduleElements.childAt(i); - - firstToken = moduleElement.firstToken(); - if (firstToken !== null && firstToken.tokenKind === 47 /* ExportKeyword */) { - return new TypeScript.TextSpan(position + firstToken.leadingTriviaWidth(), firstToken.width()); - } - - if (moduleElement.kind() === 133 /* ImportDeclaration */) { - var importDecl = moduleElement; - if (importDecl.moduleReference.kind() === 245 /* ExternalModuleReference */) { - return new TypeScript.TextSpan(position + importDecl.leadingTriviaWidth(), importDecl.width()); - } - } - - position += moduleElement.fullWidth(); - } - - return null; - ; - }; - - Document.prototype.sourceUnit = function () { - if (!this._sourceUnit) { - var start = new Date().getTime(); - var syntaxTree = this.syntaxTree(); - this._sourceUnit = TypeScript.SyntaxTreeToAstVisitor.visit(syntaxTree, this.fileName, this._compiler.compilationSettings(), this.isOpen); - TypeScript.astTranslationTime += new Date().getTime() - start; - - if (!this.isOpen) { - this._syntaxTree = null; - } - } - - return this._sourceUnit; - }; - - Document.prototype.diagnostics = function () { - if (this._diagnostics === null) { - this.syntaxTree(); - TypeScript.Debug.assert(this._diagnostics); - } - - return this._diagnostics; - }; - - Document.prototype.lineMap = function () { - if (this._lineMap === null) { - this.syntaxTree(); - TypeScript.Debug.assert(this._lineMap); - } - - return this._lineMap; - }; - - Document.prototype.isExternalModule = function () { - return this.externalModuleIndicatorSpan() !== null; - }; - - Document.prototype.externalModuleIndicatorSpan = function () { - if (this._externalModuleIndicatorSpan === undefined) { - this.syntaxTree(); - TypeScript.Debug.assert(this._externalModuleIndicatorSpan !== undefined); - } - - return this._externalModuleIndicatorSpan; - }; - - Document.prototype.amdDependencies = function () { - if (this._amdDependencies === undefined) { - this.syntaxTree(); - TypeScript.Debug.assert(this._amdDependencies !== undefined); - } - - return this._amdDependencies; - }; - - Document.prototype.syntaxTree = function () { - var result = this._syntaxTree; - if (!result) { - var start = new Date().getTime(); - - result = TypeScript.Parser.parse(this.fileName, TypeScript.SimpleText.fromScriptSnapshot(this._scriptSnapshot), TypeScript.isDTSFile(this.fileName), TypeScript.getParseOptions(this._compiler.compilationSettings())); - - TypeScript.syntaxTreeParseTime += new Date().getTime() - start; - - if (this.isOpen || !this._sourceUnit) { - this._syntaxTree = result; - } - } - - this.cacheSyntaxTreeInfo(result); - return result; - }; - - Document.prototype.bloomFilter = function () { - if (!this._bloomFilter) { - var identifiers = TypeScript.createIntrinsicsObject(); - var pre = function (cur) { - if (TypeScript.ASTHelpers.isValidAstNode(cur)) { - if (cur.kind() === 11 /* IdentifierName */) { - var nodeText = cur.valueText(); - - identifiers[nodeText] = true; - } - } - }; - - TypeScript.getAstWalkerFactory().simpleWalk(this.sourceUnit(), pre, null, identifiers); - - var identifierCount = 0; - for (var name in identifiers) { - if (identifiers[name]) { - identifierCount++; - } - } - - this._bloomFilter = new TypeScript.BloomFilter(identifierCount); - this._bloomFilter.addKeys(identifiers); - } - return this._bloomFilter; - }; - - Document.prototype.emitToOwnOutputFile = function () { - return !this._compiler.compilationSettings().outFileOption() || this.isExternalModule(); - }; - - Document.prototype.update = function (scriptSnapshot, version, isOpen, textChangeRange) { - var oldSyntaxTree = this._syntaxTree; - - if (textChangeRange !== null && TypeScript.Debug.shouldAssert(1 /* Normal */)) { - var oldText = this._scriptSnapshot; - var newText = scriptSnapshot; - - TypeScript.Debug.assert((oldText.getLength() - textChangeRange.span().length() + textChangeRange.newLength()) === newText.getLength()); - - if (TypeScript.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldTextPrefix = oldText.getText(0, textChangeRange.span().start()); - var newTextPrefix = newText.getText(0, textChangeRange.span().start()); - TypeScript.Debug.assert(oldTextPrefix === newTextPrefix); - - var oldTextSuffix = oldText.getText(textChangeRange.span().end(), oldText.getLength()); - var newTextSuffix = newText.getText(textChangeRange.newSpan().end(), newText.getLength()); - TypeScript.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - - var text = TypeScript.SimpleText.fromScriptSnapshot(scriptSnapshot); - - var newSyntaxTree = textChangeRange === null || oldSyntaxTree === null ? TypeScript.Parser.parse(this.fileName, text, TypeScript.isDTSFile(this.fileName), TypeScript.getParseOptions(this._compiler.compilationSettings())) : TypeScript.Parser.incrementalParse(oldSyntaxTree, textChangeRange, text); - - return new Document(this._compiler, this._semanticInfoChain, this.fileName, this.referencedFiles, scriptSnapshot, this.byteOrderMark, version, isOpen, newSyntaxTree, null); - }; - - Document.create = function (compiler, semanticInfoChain, fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles) { - return new Document(compiler, semanticInfoChain, fileName, referencedFiles, scriptSnapshot, byteOrderMark, version, isOpen, null, null); - }; - - Document.prototype.topLevelDecl = function () { - if (this._topLevelDecl === null) { - this._topLevelDecl = TypeScript.DeclarationCreator.create(this, this._semanticInfoChain, this._compiler.compilationSettings()); - } - - return this._topLevelDecl; - }; - - Document.prototype._getDeclForAST = function (ast) { - this.topLevelDecl(); - return this._astDeclMap[ast.syntaxID()]; - }; - - Document.prototype.getEnclosingDecl = function (ast) { - if (ast.kind() === 120 /* SourceUnit */) { - return this._getDeclForAST(ast); - } - - ast = ast.parent; - var decl = null; - while (ast) { - decl = this._getDeclForAST(ast); - - if (decl) { - break; - } - - ast = ast.parent; - } - - return decl._getEnclosingDeclFromParentDecl(); - }; - - Document.prototype._setDeclForAST = function (ast, decl) { - TypeScript.Debug.assert(decl.fileName() === this.fileName); - this._astDeclMap[ast.syntaxID()] = decl; - }; - - Document.prototype._getASTForDecl = function (decl) { - return this._declASTMap[decl.declID]; - }; - - Document.prototype._setASTForDecl = function (decl, ast) { - TypeScript.Debug.assert(decl.fileName() === this.fileName); - this._declASTMap[decl.declID] = ast; - }; - return Document; - })(); - TypeScript.Document = Document; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function hasFlag(val, flag) { - return (val & flag) !== 0; - } - TypeScript.hasFlag = hasFlag; - - (function (TypeRelationshipFlags) { - TypeRelationshipFlags[TypeRelationshipFlags["SuccessfulComparison"] = 0] = "SuccessfulComparison"; - TypeRelationshipFlags[TypeRelationshipFlags["RequiredPropertyIsMissing"] = 1 << 1] = "RequiredPropertyIsMissing"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleSignatures"] = 1 << 2] = "IncompatibleSignatures"; - TypeRelationshipFlags[TypeRelationshipFlags["SourceSignatureHasTooManyParameters"] = 3] = "SourceSignatureHasTooManyParameters"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleReturnTypes"] = 1 << 4] = "IncompatibleReturnTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatiblePropertyTypes"] = 1 << 5] = "IncompatiblePropertyTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["IncompatibleParameterTypes"] = 1 << 6] = "IncompatibleParameterTypes"; - TypeRelationshipFlags[TypeRelationshipFlags["InconsistantPropertyAccesibility"] = 1 << 7] = "InconsistantPropertyAccesibility"; - })(TypeScript.TypeRelationshipFlags || (TypeScript.TypeRelationshipFlags = {})); - var TypeRelationshipFlags = TypeScript.TypeRelationshipFlags; - - (function (ModuleGenTarget) { - ModuleGenTarget[ModuleGenTarget["Unspecified"] = 0] = "Unspecified"; - ModuleGenTarget[ModuleGenTarget["Synchronous"] = 1] = "Synchronous"; - ModuleGenTarget[ModuleGenTarget["Asynchronous"] = 2] = "Asynchronous"; - })(TypeScript.ModuleGenTarget || (TypeScript.ModuleGenTarget = {})); - var ModuleGenTarget = TypeScript.ModuleGenTarget; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var proto = "__proto__"; - - var BlockIntrinsics = (function () { - function BlockIntrinsics() { - this.prototype = undefined; - this.toString = undefined; - this.toLocaleString = undefined; - this.valueOf = undefined; - this.hasOwnProperty = undefined; - this.propertyIsEnumerable = undefined; - this.isPrototypeOf = undefined; - this["constructor"] = undefined; - - this[proto] = null; - this[proto] = undefined; - } - return BlockIntrinsics; - })(); - - function createIntrinsicsObject() { - return new BlockIntrinsics(); - } - TypeScript.createIntrinsicsObject = createIntrinsicsObject; - - var StringHashTable = (function () { - function StringHashTable() { - this.itemCount = 0; - this.table = createIntrinsicsObject(); - } - StringHashTable.prototype.getAllKeys = function () { - var result = []; - - for (var k in this.table) { - if (this.table[k] !== undefined) { - result.push(k); - } - } - - return result; - }; - - StringHashTable.prototype.add = function (key, data) { - if (this.table[key] !== undefined) { - return false; - } - - this.table[key] = data; - this.itemCount++; - return true; - }; - - StringHashTable.prototype.addOrUpdate = function (key, data) { - if (this.table[key] !== undefined) { - this.table[key] = data; - return false; - } - - this.table[key] = data; - this.itemCount++; - return true; - }; - - StringHashTable.prototype.map = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - fn(k, this.table[k], context); - } - } - }; - - StringHashTable.prototype.every = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - if (!fn(k, this.table[k], context)) { - return false; - } - } - } - - return true; - }; - - StringHashTable.prototype.some = function (fn, context) { - for (var k in this.table) { - var data = this.table[k]; - - if (data !== undefined) { - if (fn(k, this.table[k], context)) { - return true; - } - } - } - - return false; - }; - - StringHashTable.prototype.count = function () { - return this.itemCount; - }; - - StringHashTable.prototype.lookup = function (key) { - var data = this.table[key]; - return data === undefined ? null : data; - }; - - StringHashTable.prototype.remove = function (key) { - if (this.table[key] !== undefined) { - this.table[key] = undefined; - this.itemCount--; - } - }; - return StringHashTable; - })(); - TypeScript.StringHashTable = StringHashTable; - - var IdentiferNameHashTable = (function (_super) { - __extends(IdentiferNameHashTable, _super); - function IdentiferNameHashTable() { - _super.apply(this, arguments); - } - IdentiferNameHashTable.prototype.getAllKeys = function () { - var result = []; - - _super.prototype.map.call(this, function (k, v, c) { - if (v !== undefined) { - result.push(k.substring(1)); - } - }, null); - - return result; - }; - - IdentiferNameHashTable.prototype.add = function (key, data) { - return _super.prototype.add.call(this, "#" + key, data); - }; - - IdentiferNameHashTable.prototype.addOrUpdate = function (key, data) { - return _super.prototype.addOrUpdate.call(this, "#" + key, data); - }; - - IdentiferNameHashTable.prototype.map = function (fn, context) { - return _super.prototype.map.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.every = function (fn, context) { - return _super.prototype.every.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.some = function (fn, context) { - return _super.prototype.some.call(this, function (k, v, c) { - return fn(k.substring(1), v, c); - }, context); - }; - - IdentiferNameHashTable.prototype.lookup = function (key) { - return _super.prototype.lookup.call(this, "#" + key); - }; - return IdentiferNameHashTable; - })(StringHashTable); - TypeScript.IdentiferNameHashTable = IdentiferNameHashTable; -})(TypeScript || (TypeScript = {})); - -var TypeScript; -(function (TypeScript) { - (function (ASTHelpers) { - function scriptIsElided(sourceUnit) { - return TypeScript.isDTSFile(sourceUnit.fileName()) || moduleMembersAreElided(sourceUnit.moduleElements); - } - ASTHelpers.scriptIsElided = scriptIsElided; - - function moduleIsElided(declaration) { - return TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) || moduleMembersAreElided(declaration.moduleElements); - } - ASTHelpers.moduleIsElided = moduleIsElided; - - function moduleMembersAreElided(members) { - for (var i = 0, n = members.childCount(); i < n; i++) { - var member = members.childAt(i); - - if (member.kind() === 130 /* ModuleDeclaration */) { - if (!moduleIsElided(member)) { - return false; - } - } else if (member.kind() !== 128 /* InterfaceDeclaration */) { - return false; - } - } - - return true; - } - - function enumIsElided(declaration) { - if (TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */)) { - return true; - } - - return false; - } - ASTHelpers.enumIsElided = enumIsElided; - - function isValidAstNode(ast) { - if (!ast) - return false; - - if (ast.start() === -1 || ast.end() === -1) - return false; - - return true; - } - ASTHelpers.isValidAstNode = isValidAstNode; - - function getAstAtPosition(script, pos, useTrailingTriviaAsLimChar, forceInclusive) { - if (typeof useTrailingTriviaAsLimChar === "undefined") { useTrailingTriviaAsLimChar = true; } - if (typeof forceInclusive === "undefined") { forceInclusive = false; } - var top = null; - - var pre = function (cur, walker) { - if (isValidAstNode(cur)) { - var isInvalid1 = cur.kind() === 149 /* ExpressionStatement */ && cur.width() === 0; - - if (isInvalid1) { - walker.options.goChildren = false; - } else { - var inclusive = forceInclusive || cur.kind() === 11 /* IdentifierName */ || cur.kind() === 212 /* MemberAccessExpression */ || cur.kind() === 121 /* QualifiedName */ || cur.kind() === 224 /* VariableDeclaration */ || cur.kind() === 225 /* VariableDeclarator */ || cur.kind() === 213 /* InvocationExpression */ || pos === script.end() + script.trailingTriviaWidth(); - - var minChar = cur.start(); - var limChar = cur.end() + (useTrailingTriviaAsLimChar ? cur.trailingTriviaWidth() : 0) + (inclusive ? 1 : 0); - if (pos >= minChar && pos < limChar) { - if ((cur.kind() !== 1 /* List */ && cur.kind() !== 2 /* SeparatedList */) || cur.end() > cur.start()) { - if (top === null) { - top = cur; - } else if (cur.start() >= top.start() && (cur.end() + (useTrailingTriviaAsLimChar ? cur.trailingTriviaWidth() : 0)) <= (top.end() + (useTrailingTriviaAsLimChar ? top.trailingTriviaWidth() : 0))) { - if (top.width() !== 0 || cur.width() !== 0) { - top = cur; - } - } - } - } - - walker.options.goChildren = (minChar <= pos && pos <= limChar); - } - } - }; - - TypeScript.getAstWalkerFactory().walk(script, pre); - return top; - } - ASTHelpers.getAstAtPosition = getAstAtPosition; - - function getExtendsHeritageClause(clauses) { - if (!clauses) { - return null; - } - - return clauses.firstOrDefault(function (c) { - return c.typeNames.nonSeparatorCount() > 0 && c.kind() === 230 /* ExtendsHeritageClause */; - }); - } - ASTHelpers.getExtendsHeritageClause = getExtendsHeritageClause; - - function getImplementsHeritageClause(clauses) { - if (!clauses) { - return null; - } - - return clauses.firstOrDefault(function (c) { - return c.typeNames.nonSeparatorCount() > 0 && c.kind() === 231 /* ImplementsHeritageClause */; - }); - } - ASTHelpers.getImplementsHeritageClause = getImplementsHeritageClause; - - function isCallExpression(ast) { - return (ast && ast.kind() === 213 /* InvocationExpression */) || (ast && ast.kind() === 216 /* ObjectCreationExpression */); - } - ASTHelpers.isCallExpression = isCallExpression; - - function isCallExpressionTarget(ast) { - if (!ast) { - return false; - } - - var current = ast; - - while (current && current.parent) { - if (current.parent.kind() === 212 /* MemberAccessExpression */ && current.parent.name === current) { - current = current.parent; - continue; - } - - break; - } - - if (current && current.parent) { - if (current.parent.kind() === 213 /* InvocationExpression */ || current.parent.kind() === 216 /* ObjectCreationExpression */) { - return current === current.parent.expression; - } - } - - return false; - } - ASTHelpers.isCallExpressionTarget = isCallExpressionTarget; - - function isNameOfSomeDeclaration(ast) { - if (ast === null || ast.parent === null) { - return false; - } - if (ast.kind() !== 11 /* IdentifierName */) { - return false; - } - - switch (ast.parent.kind()) { - case 131 /* ClassDeclaration */: - return ast.parent.identifier === ast; - case 128 /* InterfaceDeclaration */: - return ast.parent.identifier === ast; - case 132 /* EnumDeclaration */: - return ast.parent.identifier === ast; - case 130 /* ModuleDeclaration */: - return ast.parent.name === ast || ast.parent.stringLiteral === ast; - case 225 /* VariableDeclarator */: - return ast.parent.propertyName === ast; - case 129 /* FunctionDeclaration */: - return ast.parent.identifier === ast; - case 135 /* MemberFunctionDeclaration */: - return ast.parent.propertyName === ast; - case 242 /* Parameter */: - return ast.parent.identifier === ast; - case 238 /* TypeParameter */: - return ast.parent.identifier === ast; - case 240 /* SimplePropertyAssignment */: - return ast.parent.propertyName === ast; - case 241 /* FunctionPropertyAssignment */: - return ast.parent.propertyName === ast; - case 243 /* EnumElement */: - return ast.parent.propertyName === ast; - case 133 /* ImportDeclaration */: - return ast.parent.identifier === ast; - } - - return false; - } - - function isDeclarationASTOrDeclarationNameAST(ast) { - return isNameOfSomeDeclaration(ast) || isDeclarationAST(ast); - } - ASTHelpers.isDeclarationASTOrDeclarationNameAST = isDeclarationASTOrDeclarationNameAST; - - function getEnclosingParameterForInitializer(ast) { - var current = ast; - while (current) { - switch (current.kind()) { - case 232 /* EqualsValueClause */: - if (current.parent && current.parent.kind() === 242 /* Parameter */) { - return current.parent; - } - break; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - - current = current.parent; - } - return null; - } - ASTHelpers.getEnclosingParameterForInitializer = getEnclosingParameterForInitializer; - - function getEnclosingMemberVariableDeclaration(ast) { - var current = ast; - - while (current) { - switch (current.kind()) { - case 136 /* MemberVariableDeclaration */: - return current; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - return null; - } - current = current.parent; - } - - return null; - } - ASTHelpers.getEnclosingMemberVariableDeclaration = getEnclosingMemberVariableDeclaration; - - function isNameOfFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 129 /* FunctionDeclaration */ && ast.parent.identifier === ast; - } - ASTHelpers.isNameOfFunction = isNameOfFunction; - - function isNameOfMemberFunction(ast) { - return ast && ast.parent && ast.kind() === 11 /* IdentifierName */ && ast.parent.kind() === 135 /* MemberFunctionDeclaration */ && ast.parent.propertyName === ast; - } - ASTHelpers.isNameOfMemberFunction = isNameOfMemberFunction; - - function isNameOfMemberAccessExpression(ast) { - if (ast && ast.parent && ast.parent.kind() === 212 /* MemberAccessExpression */ && ast.parent.name === ast) { - return true; - } - - return false; - } - ASTHelpers.isNameOfMemberAccessExpression = isNameOfMemberAccessExpression; - - function isRightSideOfQualifiedName(ast) { - if (ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast) { - return true; - } - - return false; - } - ASTHelpers.isRightSideOfQualifiedName = isRightSideOfQualifiedName; - - function parametersFromIdentifier(id) { - return { - length: 1, - lastParameterIsRest: function () { - return false; - }, - ast: id, - astAt: function (index) { - return id; - }, - identifierAt: function (index) { - return id; - }, - typeAt: function (index) { - return null; - }, - initializerAt: function (index) { - return null; - }, - isOptionalAt: function (index) { - return false; - } - }; - } - ASTHelpers.parametersFromIdentifier = parametersFromIdentifier; - - function parametersFromParameter(parameter) { - return { - length: 1, - lastParameterIsRest: function () { - return parameter.dotDotDotToken !== null; - }, - ast: parameter, - astAt: function (index) { - return parameter; - }, - identifierAt: function (index) { - return parameter.identifier; - }, - typeAt: function (index) { - return getType(parameter); - }, - initializerAt: function (index) { - return parameter.equalsValueClause; - }, - isOptionalAt: function (index) { - return parameterIsOptional(parameter); - } - }; - } - ASTHelpers.parametersFromParameter = parametersFromParameter; - - function parameterIsOptional(parameter) { - return parameter.questionToken !== null || parameter.equalsValueClause !== null; - } - - function parametersFromParameterList(list) { - return { - length: list.parameters.nonSeparatorCount(), - lastParameterIsRest: function () { - return TypeScript.lastParameterIsRest(list); - }, - ast: list.parameters, - astAt: function (index) { - return list.parameters.nonSeparatorAt(index); - }, - identifierAt: function (index) { - return list.parameters.nonSeparatorAt(index).identifier; - }, - typeAt: function (index) { - return getType(list.parameters.nonSeparatorAt(index)); - }, - initializerAt: function (index) { - return list.parameters.nonSeparatorAt(index).equalsValueClause; - }, - isOptionalAt: function (index) { - return parameterIsOptional(list.parameters.nonSeparatorAt(index)); - } - }; - } - ASTHelpers.parametersFromParameterList = parametersFromParameterList; - - function isDeclarationAST(ast) { - switch (ast.kind()) { - case 225 /* VariableDeclarator */: - return getVariableStatement(ast) !== null; - - case 133 /* ImportDeclaration */: - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 242 /* Parameter */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 144 /* IndexSignature */: - case 129 /* FunctionDeclaration */: - case 130 /* ModuleDeclaration */: - case 124 /* ArrayType */: - case 122 /* ObjectType */: - case 238 /* TypeParameter */: - case 137 /* ConstructorDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - case 136 /* MemberVariableDeclaration */: - case 138 /* IndexMemberDeclaration */: - case 132 /* EnumDeclaration */: - case 243 /* EnumElement */: - case 240 /* SimplePropertyAssignment */: - case 241 /* FunctionPropertyAssignment */: - case 222 /* FunctionExpression */: - case 142 /* CallSignature */: - case 143 /* ConstructSignature */: - case 145 /* MethodSignature */: - case 141 /* PropertySignature */: - return true; - default: - return false; - } - } - ASTHelpers.isDeclarationAST = isDeclarationAST; - - function docComments(ast) { - if (isDeclarationAST(ast)) { - var preComments = ast.kind() === 225 /* VariableDeclarator */ ? getVariableStatement(ast).preComments() : ast.preComments(); - - if (preComments && preComments.length > 0) { - var preCommentsLength = preComments.length; - var docComments = new Array(); - for (var i = preCommentsLength - 1; i >= 0; i--) { - if (isDocComment(preComments[i])) { - docComments.push(preComments[i]); - continue; - } - - break; - } - - return docComments.reverse(); - } - } - - return TypeScript.sentinelEmptyArray; - } - ASTHelpers.docComments = docComments; - - function isDocComment(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - var fullText = comment.fullText(); - return fullText.charAt(2) === "*" && fullText.charAt(3) !== "/"; - } - - return false; - } - - function getParameterList(ast) { - if (ast) { - switch (ast.kind()) { - case 137 /* ConstructorDeclaration */: - return getParameterList(ast.callSignature); - case 129 /* FunctionDeclaration */: - return getParameterList(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getParameterList(ast.callSignature); - case 143 /* ConstructSignature */: - return getParameterList(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getParameterList(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getParameterList(ast.callSignature); - case 222 /* FunctionExpression */: - return getParameterList(ast.callSignature); - case 145 /* MethodSignature */: - return getParameterList(ast.callSignature); - case 125 /* ConstructorType */: - return ast.parameterList; - case 123 /* FunctionType */: - return ast.parameterList; - case 142 /* CallSignature */: - return ast.parameterList; - case 139 /* GetAccessor */: - return ast.parameterList; - case 140 /* SetAccessor */: - return ast.parameterList; - } - } - - return null; - } - ASTHelpers.getParameterList = getParameterList; - - function getType(ast) { - if (ast) { - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - return getType(ast.callSignature); - case 218 /* ParenthesizedArrowFunctionExpression */: - return getType(ast.callSignature); - case 143 /* ConstructSignature */: - return getType(ast.callSignature); - case 135 /* MemberFunctionDeclaration */: - return getType(ast.callSignature); - case 241 /* FunctionPropertyAssignment */: - return getType(ast.callSignature); - case 222 /* FunctionExpression */: - return getType(ast.callSignature); - case 145 /* MethodSignature */: - return getType(ast.callSignature); - case 142 /* CallSignature */: - return getType(ast.typeAnnotation); - case 144 /* IndexSignature */: - return getType(ast.typeAnnotation); - case 141 /* PropertySignature */: - return getType(ast.typeAnnotation); - case 139 /* GetAccessor */: - return getType(ast.typeAnnotation); - case 242 /* Parameter */: - return getType(ast.typeAnnotation); - case 136 /* MemberVariableDeclaration */: - return getType(ast.variableDeclarator); - case 225 /* VariableDeclarator */: - return getType(ast.typeAnnotation); - case 236 /* CatchClause */: - return getType(ast.typeAnnotation); - case 125 /* ConstructorType */: - return ast.type; - case 123 /* FunctionType */: - return ast.type; - case 244 /* TypeAnnotation */: - return ast.type; - } - } - - return null; - } - ASTHelpers.getType = getType; - - function getVariableStatement(variableDeclarator) { - if (variableDeclarator && variableDeclarator.parent && variableDeclarator.parent.parent && variableDeclarator.parent.parent.parent && variableDeclarator.parent.kind() === 2 /* SeparatedList */ && variableDeclarator.parent.parent.kind() === 224 /* VariableDeclaration */ && variableDeclarator.parent.parent.parent.kind() === 148 /* VariableStatement */) { - return variableDeclarator.parent.parent.parent; - } - - return null; - } - - function getVariableDeclaratorModifiers(variableDeclarator) { - var variableStatement = getVariableStatement(variableDeclarator); - return variableStatement ? variableStatement.modifiers : TypeScript.sentinelEmptyArray; - } - ASTHelpers.getVariableDeclaratorModifiers = getVariableDeclaratorModifiers; - - function isIntegerLiteralAST(expression) { - if (expression) { - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - expression = expression.operand; - return expression.kind() === 13 /* NumericLiteral */ && TypeScript.IntegerUtilities.isInteger(expression.text()); - - case 13 /* NumericLiteral */: - var text = expression.text(); - return TypeScript.IntegerUtilities.isInteger(text) || TypeScript.IntegerUtilities.isHexInteger(text); - } - } - - return false; - } - ASTHelpers.isIntegerLiteralAST = isIntegerLiteralAST; - - function getEnclosingModuleDeclaration(ast) { - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - return ast; - } - - ast = ast.parent; - } - - return null; - } - ASTHelpers.getEnclosingModuleDeclaration = getEnclosingModuleDeclaration; - - function isLastNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return astName === ast.stringLiteral; - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - var nameIndex = moduleNames.indexOf(astName); - - return nameIndex === (moduleNames.length - 1); - } - } - - return false; - } - ASTHelpers.isLastNameOfModule = isLastNameOfModule; - - function isAnyNameOfModule(ast, astName) { - if (ast) { - if (ast.stringLiteral) { - return ast.stringLiteral === astName; - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - var nameIndex = moduleNames.indexOf(astName); - - return nameIndex >= 0; - } - } - - return false; - } - ASTHelpers.isAnyNameOfModule = isAnyNameOfModule; - - function getNameOfIdenfierOrQualifiedName(name) { - if (name.kind() === 11 /* IdentifierName */) { - return name.text(); - } else { - TypeScript.Debug.assert(name.kind() == 121 /* QualifiedName */); - var dotExpr = name; - return getNameOfIdenfierOrQualifiedName(dotExpr.left) + "." + getNameOfIdenfierOrQualifiedName(dotExpr.right); - } - } - ASTHelpers.getNameOfIdenfierOrQualifiedName = getNameOfIdenfierOrQualifiedName; - })(TypeScript.ASTHelpers || (TypeScript.ASTHelpers = {})); - var ASTHelpers = TypeScript.ASTHelpers; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function walkListChildren(preAst, walker) { - for (var i = 0, n = preAst.childCount(); i < n; i++) { - walker.walk(preAst.childAt(i)); - } - } - - function walkThrowStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkPrefixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - - function walkPostfixUnaryExpressionChildren(preAst, walker) { - walker.walk(preAst.operand); - } - - function walkDeleteExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkTypeArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArguments); - } - - function walkTypeOfExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkVoidExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkArgumentListChildren(preAst, walker) { - walker.walk(preAst.typeArgumentList); - walker.walk(preAst.arguments); - } - - function walkArrayLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.expressions); - } - - function walkSimplePropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.expression); - } - - function walkFunctionPropertyAssignmentChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkGetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkSeparatedListChildren(preAst, walker) { - for (var i = 0, n = preAst.nonSeparatorCount(); i < n; i++) { - walker.walk(preAst.nonSeparatorAt(i)); - } - } - - function walkSetAccessorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.parameterList); - walker.walk(preAst.block); - } - - function walkObjectLiteralExpressionChildren(preAst, walker) { - walker.walk(preAst.propertyAssignments); - } - - function walkCastExpressionChildren(preAst, walker) { - walker.walk(preAst.type); - walker.walk(preAst.expression); - } - - function walkParenthesizedExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkElementAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentExpression); - } - - function walkMemberAccessExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.name); - } - - function walkQualifiedNameChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkBinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.left); - walker.walk(preAst.right); - } - - function walkEqualsValueClauseChildren(preAst, walker) { - walker.walk(preAst.value); - } - - function walkTypeParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.constraint); - } - - function walkTypeParameterListChildren(preAst, walker) { - walker.walk(preAst.typeParameters); - } - - function walkGenericTypeChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.typeArgumentList); - } - - function walkTypeAnnotationChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkTypeQueryChildren(preAst, walker) { - walker.walk(preAst.name); - } - - function walkInvocationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkObjectCreationExpressionChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.argumentList); - } - - function walkTrinaryExpressionChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.whenTrue); - walker.walk(preAst.whenFalse); - } - - function walkFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFunctionTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkParenthesizedArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkSimpleArrowFunctionExpressionChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.block); - walker.walk(preAst.expression); - } - - function walkMemberFunctionDeclarationChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkFuncDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkIndexMemberDeclarationChildren(preAst, walker) { - walker.walk(preAst.indexSignature); - } - - function walkIndexSignatureChildren(preAst, walker) { - walker.walk(preAst.parameter); - walker.walk(preAst.typeAnnotation); - } - - function walkCallSignatureChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.typeAnnotation); - } - - function walkConstraintChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkConstructorDeclarationChildren(preAst, walker) { - walker.walk(preAst.callSignature); - walker.walk(preAst.block); - } - - function walkConstructorTypeChildren(preAst, walker) { - walker.walk(preAst.typeParameterList); - walker.walk(preAst.parameterList); - walker.walk(preAst.type); - } - - function walkConstructSignatureChildren(preAst, walker) { - walker.walk(preAst.callSignature); - } - - function walkParameterChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkParameterListChildren(preAst, walker) { - walker.walk(preAst.parameters); - } - - function walkPropertySignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - } - - function walkVariableDeclaratorChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.equalsValueClause); - } - - function walkMemberVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.variableDeclarator); - } - - function walkMethodSignatureChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.callSignature); - } - - function walkReturnStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkForStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.initializer); - walker.walk(preAst.condition); - walker.walk(preAst.incrementor); - walker.walk(preAst.statement); - } - - function walkForInStatementChildren(preAst, walker) { - walker.walk(preAst.variableDeclaration); - walker.walk(preAst.left); - walker.walk(preAst.expression); - walker.walk(preAst.statement); - } - - function walkIfStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - walker.walk(preAst.elseClause); - } - - function walkElseClauseChildren(preAst, walker) { - walker.walk(preAst.statement); - } - - function walkWhileStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkDoStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkBlockChildren(preAst, walker) { - walker.walk(preAst.statements); - } - - function walkVariableDeclarationChildren(preAst, walker) { - walker.walk(preAst.declarators); - } - - function walkCaseSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.statements); - } - - function walkDefaultSwitchClauseChildren(preAst, walker) { - walker.walk(preAst.statements); - } - - function walkSwitchStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - walker.walk(preAst.switchClauses); - } - - function walkTryStatementChildren(preAst, walker) { - walker.walk(preAst.block); - walker.walk(preAst.catchClause); - walker.walk(preAst.finallyClause); - } - - function walkCatchClauseChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeAnnotation); - walker.walk(preAst.block); - } - - function walkExternalModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.stringLiteral); - } - - function walkFinallyClauseChildren(preAst, walker) { - walker.walk(preAst.block); - } - - function walkClassDeclChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.classElements); - } - - function walkScriptChildren(preAst, walker) { - walker.walk(preAst.moduleElements); - } - - function walkHeritageClauseChildren(preAst, walker) { - walker.walk(preAst.typeNames); - } - - function walkInterfaceDeclerationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.typeParameterList); - walker.walk(preAst.heritageClauses); - walker.walk(preAst.body); - } - - function walkObjectTypeChildren(preAst, walker) { - walker.walk(preAst.typeMembers); - } - - function walkArrayTypeChildren(preAst, walker) { - walker.walk(preAst.type); - } - - function walkModuleDeclarationChildren(preAst, walker) { - walker.walk(preAst.name); - walker.walk(preAst.stringLiteral); - walker.walk(preAst.moduleElements); - } - - function walkModuleNameModuleReferenceChildren(preAst, walker) { - walker.walk(preAst.moduleName); - } - - function walkEnumDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.enumElements); - } - - function walkEnumElementChildren(preAst, walker) { - walker.walk(preAst.propertyName); - walker.walk(preAst.equalsValueClause); - } - - function walkImportDeclarationChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.moduleReference); - } - - function walkExportAssignmentChildren(preAst, walker) { - walker.walk(preAst.identifier); - } - - function walkWithStatementChildren(preAst, walker) { - walker.walk(preAst.condition); - walker.walk(preAst.statement); - } - - function walkExpressionStatementChildren(preAst, walker) { - walker.walk(preAst.expression); - } - - function walkLabeledStatementChildren(preAst, walker) { - walker.walk(preAst.identifier); - walker.walk(preAst.statement); - } - - function walkVariableStatementChildren(preAst, walker) { - walker.walk(preAst.declaration); - } - - var childrenWalkers = new Array(246 /* Last */ + 1); - - for (var i = 9 /* FirstToken */, n = 119 /* LastToken */; i <= n; i++) { - childrenWalkers[i] = null; - } - for (var i = 4 /* FirstTrivia */, n = 8 /* LastTrivia */; i <= n; i++) { - childrenWalkers[i] = null; - } - - childrenWalkers[175 /* AddAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[208 /* AddExpression */] = walkBinaryExpressionChildren; - childrenWalkers[180 /* AndAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[60 /* AnyKeyword */] = null; - childrenWalkers[226 /* ArgumentList */] = walkArgumentListChildren; - childrenWalkers[214 /* ArrayLiteralExpression */] = walkArrayLiteralExpressionChildren; - childrenWalkers[124 /* ArrayType */] = walkArrayTypeChildren; - childrenWalkers[219 /* SimpleArrowFunctionExpression */] = walkSimpleArrowFunctionExpressionChildren; - childrenWalkers[218 /* ParenthesizedArrowFunctionExpression */] = walkParenthesizedArrowFunctionExpressionChildren; - childrenWalkers[174 /* AssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[191 /* BitwiseAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[190 /* BitwiseExclusiveOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[166 /* BitwiseNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[189 /* BitwiseOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[146 /* Block */] = walkBlockChildren; - childrenWalkers[61 /* BooleanKeyword */] = null; - childrenWalkers[152 /* BreakStatement */] = null; - childrenWalkers[142 /* CallSignature */] = walkCallSignatureChildren; - childrenWalkers[233 /* CaseSwitchClause */] = walkCaseSwitchClauseChildren; - childrenWalkers[220 /* CastExpression */] = walkCastExpressionChildren; - childrenWalkers[236 /* CatchClause */] = walkCatchClauseChildren; - childrenWalkers[131 /* ClassDeclaration */] = walkClassDeclChildren; - childrenWalkers[173 /* CommaExpression */] = walkBinaryExpressionChildren; - childrenWalkers[186 /* ConditionalExpression */] = walkTrinaryExpressionChildren; - childrenWalkers[239 /* Constraint */] = walkConstraintChildren; - childrenWalkers[137 /* ConstructorDeclaration */] = walkConstructorDeclarationChildren; - childrenWalkers[143 /* ConstructSignature */] = walkConstructSignatureChildren; - childrenWalkers[153 /* ContinueStatement */] = null; - childrenWalkers[125 /* ConstructorType */] = walkConstructorTypeChildren; - childrenWalkers[162 /* DebuggerStatement */] = null; - childrenWalkers[234 /* DefaultSwitchClause */] = walkDefaultSwitchClauseChildren; - childrenWalkers[170 /* DeleteExpression */] = walkDeleteExpressionChildren; - childrenWalkers[178 /* DivideAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[206 /* DivideExpression */] = walkBinaryExpressionChildren; - childrenWalkers[161 /* DoStatement */] = walkDoStatementChildren; - childrenWalkers[221 /* ElementAccessExpression */] = walkElementAccessExpressionChildren; - childrenWalkers[235 /* ElseClause */] = walkElseClauseChildren; - childrenWalkers[156 /* EmptyStatement */] = null; - childrenWalkers[132 /* EnumDeclaration */] = walkEnumDeclarationChildren; - childrenWalkers[243 /* EnumElement */] = walkEnumElementChildren; - childrenWalkers[194 /* EqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[232 /* EqualsValueClause */] = walkEqualsValueClauseChildren; - childrenWalkers[192 /* EqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[181 /* ExclusiveOrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[134 /* ExportAssignment */] = walkExportAssignmentChildren; - childrenWalkers[149 /* ExpressionStatement */] = walkExpressionStatementChildren; - childrenWalkers[230 /* ExtendsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[245 /* ExternalModuleReference */] = walkExternalModuleReferenceChildren; - childrenWalkers[24 /* FalseKeyword */] = null; - childrenWalkers[237 /* FinallyClause */] = walkFinallyClauseChildren; - childrenWalkers[155 /* ForInStatement */] = walkForInStatementChildren; - childrenWalkers[154 /* ForStatement */] = walkForStatementChildren; - childrenWalkers[129 /* FunctionDeclaration */] = walkFuncDeclChildren; - childrenWalkers[222 /* FunctionExpression */] = walkFunctionExpressionChildren; - childrenWalkers[241 /* FunctionPropertyAssignment */] = walkFunctionPropertyAssignmentChildren; - childrenWalkers[123 /* FunctionType */] = walkFunctionTypeChildren; - childrenWalkers[126 /* GenericType */] = walkGenericTypeChildren; - childrenWalkers[139 /* GetAccessor */] = walkGetAccessorChildren; - childrenWalkers[197 /* GreaterThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[199 /* GreaterThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[147 /* IfStatement */] = walkIfStatementChildren; - childrenWalkers[231 /* ImplementsHeritageClause */] = walkHeritageClauseChildren; - childrenWalkers[133 /* ImportDeclaration */] = walkImportDeclarationChildren; - childrenWalkers[138 /* IndexMemberDeclaration */] = walkIndexMemberDeclarationChildren; - childrenWalkers[144 /* IndexSignature */] = walkIndexSignatureChildren; - childrenWalkers[201 /* InExpression */] = walkBinaryExpressionChildren; - childrenWalkers[200 /* InstanceOfExpression */] = walkBinaryExpressionChildren; - childrenWalkers[128 /* InterfaceDeclaration */] = walkInterfaceDeclerationChildren; - childrenWalkers[213 /* InvocationExpression */] = walkInvocationExpressionChildren; - childrenWalkers[160 /* LabeledStatement */] = walkLabeledStatementChildren; - childrenWalkers[183 /* LeftShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[202 /* LeftShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[196 /* LessThanExpression */] = walkBinaryExpressionChildren; - childrenWalkers[198 /* LessThanOrEqualExpression */] = walkBinaryExpressionChildren; - childrenWalkers[1 /* List */] = walkListChildren; - childrenWalkers[188 /* LogicalAndExpression */] = walkBinaryExpressionChildren; - childrenWalkers[167 /* LogicalNotExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[187 /* LogicalOrExpression */] = walkBinaryExpressionChildren; - childrenWalkers[212 /* MemberAccessExpression */] = walkMemberAccessExpressionChildren; - childrenWalkers[135 /* MemberFunctionDeclaration */] = walkMemberFunctionDeclarationChildren; - childrenWalkers[136 /* MemberVariableDeclaration */] = walkMemberVariableDeclarationChildren; - childrenWalkers[145 /* MethodSignature */] = walkMethodSignatureChildren; - childrenWalkers[130 /* ModuleDeclaration */] = walkModuleDeclarationChildren; - childrenWalkers[246 /* ModuleNameModuleReference */] = walkModuleNameModuleReferenceChildren; - childrenWalkers[179 /* ModuloAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[207 /* ModuloExpression */] = walkBinaryExpressionChildren; - childrenWalkers[177 /* MultiplyAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[205 /* MultiplyExpression */] = walkBinaryExpressionChildren; - childrenWalkers[11 /* IdentifierName */] = null; - childrenWalkers[165 /* NegateExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[0 /* None */] = null; - childrenWalkers[195 /* NotEqualsExpression */] = walkBinaryExpressionChildren; - childrenWalkers[193 /* NotEqualsWithTypeConversionExpression */] = walkBinaryExpressionChildren; - childrenWalkers[32 /* NullKeyword */] = null; - childrenWalkers[67 /* NumberKeyword */] = null; - childrenWalkers[13 /* NumericLiteral */] = null; - childrenWalkers[216 /* ObjectCreationExpression */] = walkObjectCreationExpressionChildren; - childrenWalkers[215 /* ObjectLiteralExpression */] = walkObjectLiteralExpressionChildren; - childrenWalkers[122 /* ObjectType */] = walkObjectTypeChildren; - childrenWalkers[223 /* OmittedExpression */] = null; - childrenWalkers[182 /* OrAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[242 /* Parameter */] = walkParameterChildren; - childrenWalkers[227 /* ParameterList */] = walkParameterListChildren; - childrenWalkers[217 /* ParenthesizedExpression */] = walkParenthesizedExpressionChildren; - childrenWalkers[164 /* PlusExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[211 /* PostDecrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[210 /* PostIncrementExpression */] = walkPostfixUnaryExpressionChildren; - childrenWalkers[169 /* PreDecrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[168 /* PreIncrementExpression */] = walkPrefixUnaryExpressionChildren; - childrenWalkers[141 /* PropertySignature */] = walkPropertySignatureChildren; - childrenWalkers[121 /* QualifiedName */] = walkQualifiedNameChildren; - childrenWalkers[12 /* RegularExpressionLiteral */] = null; - childrenWalkers[150 /* ReturnStatement */] = walkReturnStatementChildren; - childrenWalkers[120 /* SourceUnit */] = walkScriptChildren; - childrenWalkers[2 /* SeparatedList */] = walkSeparatedListChildren; - childrenWalkers[140 /* SetAccessor */] = walkSetAccessorChildren; - childrenWalkers[184 /* SignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[203 /* SignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[240 /* SimplePropertyAssignment */] = walkSimplePropertyAssignmentChildren; - childrenWalkers[14 /* StringLiteral */] = null; - childrenWalkers[69 /* StringKeyword */] = null; - childrenWalkers[176 /* SubtractAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[209 /* SubtractExpression */] = walkBinaryExpressionChildren; - childrenWalkers[50 /* SuperKeyword */] = null; - childrenWalkers[151 /* SwitchStatement */] = walkSwitchStatementChildren; - childrenWalkers[35 /* ThisKeyword */] = null; - childrenWalkers[157 /* ThrowStatement */] = walkThrowStatementChildren; - childrenWalkers[3 /* TriviaList */] = null; - childrenWalkers[37 /* TrueKeyword */] = null; - childrenWalkers[159 /* TryStatement */] = walkTryStatementChildren; - childrenWalkers[244 /* TypeAnnotation */] = walkTypeAnnotationChildren; - childrenWalkers[228 /* TypeArgumentList */] = walkTypeArgumentListChildren; - childrenWalkers[171 /* TypeOfExpression */] = walkTypeOfExpressionChildren; - childrenWalkers[238 /* TypeParameter */] = walkTypeParameterChildren; - childrenWalkers[229 /* TypeParameterList */] = walkTypeParameterListChildren; - childrenWalkers[127 /* TypeQuery */] = walkTypeQueryChildren; - childrenWalkers[185 /* UnsignedRightShiftAssignmentExpression */] = walkBinaryExpressionChildren; - childrenWalkers[204 /* UnsignedRightShiftExpression */] = walkBinaryExpressionChildren; - childrenWalkers[224 /* VariableDeclaration */] = walkVariableDeclarationChildren; - childrenWalkers[225 /* VariableDeclarator */] = walkVariableDeclaratorChildren; - childrenWalkers[148 /* VariableStatement */] = walkVariableStatementChildren; - childrenWalkers[172 /* VoidExpression */] = walkVoidExpressionChildren; - childrenWalkers[41 /* VoidKeyword */] = null; - childrenWalkers[158 /* WhileStatement */] = walkWhileStatementChildren; - childrenWalkers[163 /* WithStatement */] = walkWithStatementChildren; - - for (var e in TypeScript.SyntaxKind) { - if (TypeScript.SyntaxKind.hasOwnProperty(e) && TypeScript.StringUtilities.isString(TypeScript.SyntaxKind[e])) { - TypeScript.Debug.assert(childrenWalkers[e] !== undefined, "Fix initWalkers: " + TypeScript.SyntaxKind[e]); - } - } - - var AstWalkOptions = (function () { - function AstWalkOptions() { - this.goChildren = true; - this.stopWalking = false; - } - return AstWalkOptions; - })(); - TypeScript.AstWalkOptions = AstWalkOptions; - - var SimplePreAstWalker = (function () { - function SimplePreAstWalker(pre, state) { - this.pre = pre; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePreAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - }; - return SimplePreAstWalker; - })(); - - var SimplePrePostAstWalker = (function () { - function SimplePrePostAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - SimplePrePostAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - this.pre(ast, this.state); - - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - - this.post(ast, this.state); - }; - return SimplePrePostAstWalker; - })(); - - var NormalAstWalker = (function () { - function NormalAstWalker(pre, post, state) { - this.pre = pre; - this.post = post; - this.state = state; - this.options = new AstWalkOptions(); - } - NormalAstWalker.prototype.walk = function (ast) { - if (!ast) { - return; - } - - if (this.options.stopWalking) { - return; - } - - this.pre(ast, this); - - if (this.options.stopWalking) { - return; - } - - if (this.options.goChildren) { - var walker = childrenWalkers[ast.kind()]; - if (walker) { - walker(ast, this); - } - } else { - this.options.goChildren = true; - } - - if (this.post) { - this.post(ast, this); - } - }; - return NormalAstWalker; - })(); - - var AstWalkerFactory = (function () { - function AstWalkerFactory() { - } - AstWalkerFactory.prototype.walk = function (ast, pre, post, state) { - new NormalAstWalker(pre, post, state).walk(ast); - }; - - AstWalkerFactory.prototype.simpleWalk = function (ast, pre, post, state) { - if (post) { - new SimplePrePostAstWalker(pre, post, state).walk(ast); - } else { - new SimplePreAstWalker(pre, state).walk(ast); - } - }; - return AstWalkerFactory; - })(); - TypeScript.AstWalkerFactory = AstWalkerFactory; - - var globalAstWalkerFactory = new AstWalkerFactory(); - - function getAstWalkerFactory() { - return globalAstWalkerFactory; - } - TypeScript.getAstWalkerFactory = getAstWalkerFactory; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var Base64Format = (function () { - function Base64Format() { - } - Base64Format.encode = function (inValue) { - if (inValue < 64) { - return Base64Format.encodedValues.charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - }; - - Base64Format.decodeChar = function (inChar) { - if (inChar.length === 1) { - return Base64Format.encodedValues.indexOf(inChar); - } else { - throw TypeError('"' + inChar + '" must have length 1'); - } - }; - Base64Format.encodedValues = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; - return Base64Format; - })(); - - var Base64VLQFormat = (function () { - function Base64VLQFormat() { - } - Base64VLQFormat.encode = function (inValue) { - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } else { - inValue = inValue << 1; - } - - var encodedStr = ""; - do { - var currentDigit = inValue & 31; - inValue = inValue >> 5; - if (inValue > 0) { - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + Base64Format.encode(currentDigit); - } while(inValue > 0); - - return encodedStr; - }; - - Base64VLQFormat.decode = function (inString) { - var result = 0; - var negative = false; - - var shift = 0; - for (var i = 0; i < inString.length; i++) { - var byte = Base64Format.decodeChar(inString[i]); - if (i === 0) { - if ((byte & 1) === 1) { - negative = true; - } - result = (byte >> 1) & 15; - } else { - result = result | ((byte & 31) << shift); - } - - shift += (i === 0) ? 4 : 5; - - if ((byte & 32) === 32) { - } else { - return { value: negative ? -(result) : result, rest: inString.substr(i + 1) }; - } - } - - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Base64_value_0_finished_with_a_continuation_bit, [inString])); - }; - return Base64VLQFormat; - })(); - TypeScript.Base64VLQFormat = Base64VLQFormat; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SourceMapPosition = (function () { - function SourceMapPosition() { - } - return SourceMapPosition; - })(); - TypeScript.SourceMapPosition = SourceMapPosition; - - var SourceMapping = (function () { - function SourceMapping() { - this.start = new SourceMapPosition(); - this.end = new SourceMapPosition(); - this.nameIndex = -1; - this.childMappings = []; - } - return SourceMapping; - })(); - TypeScript.SourceMapping = SourceMapping; - - var SourceMapEntry = (function () { - function SourceMapEntry(emittedFile, emittedLine, emittedColumn, sourceFile, sourceLine, sourceColumn, sourceName) { - this.emittedFile = emittedFile; - this.emittedLine = emittedLine; - this.emittedColumn = emittedColumn; - this.sourceFile = sourceFile; - this.sourceLine = sourceLine; - this.sourceColumn = sourceColumn; - this.sourceName = sourceName; - TypeScript.Debug.assert(isFinite(emittedLine)); - TypeScript.Debug.assert(isFinite(emittedColumn)); - TypeScript.Debug.assert(isFinite(sourceColumn)); - TypeScript.Debug.assert(isFinite(sourceLine)); - } - return SourceMapEntry; - })(); - TypeScript.SourceMapEntry = SourceMapEntry; - - var SourceMapper = (function () { - function SourceMapper(jsFile, sourceMapOut, document, jsFilePath, emitOptions, resolvePath) { - this.jsFile = jsFile; - this.sourceMapOut = sourceMapOut; - this.names = []; - this.mappingLevel = []; - this.tsFilePaths = []; - this.allSourceMappings = []; - this.sourceMapEntries = []; - this.setSourceMapOptions(document, jsFilePath, emitOptions, resolvePath); - this.setNewSourceFile(document, emitOptions); - } - SourceMapper.prototype.getOutputFile = function () { - var result = this.sourceMapOut.getOutputFile(); - result.sourceMapEntries = this.sourceMapEntries; - - return result; - }; - - SourceMapper.prototype.increaseMappingLevel = function (ast) { - this.mappingLevel.push(ast); - }; - - SourceMapper.prototype.decreaseMappingLevel = function (ast) { - TypeScript.Debug.assert(this.mappingLevel.length > 0, "Mapping level should never be less than 0. This suggests a missing start call."); - var expectedAst = this.mappingLevel.pop(); - var expectedAstInfo = expectedAst.kind ? TypeScript.SyntaxKind[expectedAst.kind()] : [expectedAst.start(), expectedAst.end()]; - var astInfo = ast.kind ? TypeScript.SyntaxKind[ast.kind()] : [ast.start(), ast.end()]; - TypeScript.Debug.assert(ast === expectedAst, "Provided ast is not the expected AST, Expected: " + expectedAstInfo + " Given: " + astInfo); - }; - - SourceMapper.prototype.setNewSourceFile = function (document, emitOptions) { - var sourceMappings = []; - this.allSourceMappings.push(sourceMappings); - this.currentMappings = [sourceMappings]; - this.currentNameIndex = []; - - this.setNewSourceFilePath(document, emitOptions); - }; - - SourceMapper.prototype.setSourceMapOptions = function (document, jsFilePath, emitOptions, resolvePath) { - var prettyJsFileName = TypeScript.getPrettyName(jsFilePath, false, true); - var prettyMapFileName = prettyJsFileName + SourceMapper.MapFileExtension; - this.jsFileName = prettyJsFileName; - - if (emitOptions.sourceMapRootDirectory()) { - this.sourceMapDirectory = emitOptions.sourceMapRootDirectory(); - if (document.emitToOwnOutputFile()) { - this.sourceMapDirectory = this.sourceMapDirectory + TypeScript.switchToForwardSlashes(TypeScript.getRootFilePath((document.fileName)).replace(emitOptions.commonDirectoryPath(), "")); - } - - if (TypeScript.isRelative(this.sourceMapDirectory)) { - this.sourceMapDirectory = emitOptions.commonDirectoryPath() + this.sourceMapDirectory; - this.sourceMapDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(resolvePath(this.sourceMapDirectory))); - this.sourceMapPath = TypeScript.getRelativePathToFixedPath(TypeScript.getRootFilePath(jsFilePath), this.sourceMapDirectory + prettyMapFileName); - } else { - this.sourceMapPath = this.sourceMapDirectory + prettyMapFileName; - } - } else { - this.sourceMapPath = prettyMapFileName; - this.sourceMapDirectory = TypeScript.getRootFilePath(jsFilePath); - } - this.sourceRoot = emitOptions.sourceRootDirectory(); - }; - - SourceMapper.prototype.setNewSourceFilePath = function (document, emitOptions) { - var tsFilePath = TypeScript.switchToForwardSlashes(document.fileName); - if (emitOptions.sourceRootDirectory()) { - tsFilePath = TypeScript.getRelativePathToFixedPath(emitOptions.commonDirectoryPath(), tsFilePath); - } else { - tsFilePath = TypeScript.getRelativePathToFixedPath(this.sourceMapDirectory, tsFilePath); - } - this.tsFilePaths.push(tsFilePath); - }; - - SourceMapper.prototype.emitSourceMapping = function () { - var _this = this; - TypeScript.Debug.assert(this.mappingLevel.length === 0, "Mapping level is not 0. This suggest a missing end call. Value: " + this.mappingLevel.map(function (item) { - return ['Node of type', TypeScript.SyntaxKind[item.kind()], 'at', item.start(), 'to', item.end()].join(' '); - }).join(', ')); - - this.jsFile.WriteLine("//# sourceMappingURL=" + this.sourceMapPath); - - var mappingsString = ""; - - var prevEmittedColumn = 0; - var prevEmittedLine = 0; - var prevSourceColumn = 0; - var prevSourceLine = 0; - var prevSourceIndex = 0; - var prevNameIndex = 0; - var emitComma = false; - - var recordedPosition = null; - for (var sourceIndex = 0; sourceIndex < this.tsFilePaths.length; sourceIndex++) { - var recordSourceMapping = function (mappedPosition, nameIndex) { - if (recordedPosition !== null && recordedPosition.emittedColumn === mappedPosition.emittedColumn && recordedPosition.emittedLine === mappedPosition.emittedLine) { - return; - } - - if (prevEmittedLine !== mappedPosition.emittedLine) { - while (prevEmittedLine < mappedPosition.emittedLine) { - prevEmittedColumn = 0; - mappingsString = mappingsString + ";"; - prevEmittedLine++; - } - emitComma = false; - } else if (emitComma) { - mappingsString = mappingsString + ","; - } - - _this.sourceMapEntries.push(new SourceMapEntry(_this.jsFileName, mappedPosition.emittedLine + 1, mappedPosition.emittedColumn + 1, _this.tsFilePaths[sourceIndex], mappedPosition.sourceLine, mappedPosition.sourceColumn + 1, nameIndex >= 0 ? _this.names[nameIndex] : undefined)); - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.emittedColumn - prevEmittedColumn); - prevEmittedColumn = mappedPosition.emittedColumn; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(sourceIndex - prevSourceIndex); - prevSourceIndex = sourceIndex; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.sourceLine - 1 - prevSourceLine); - prevSourceLine = mappedPosition.sourceLine - 1; - - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(mappedPosition.sourceColumn - prevSourceColumn); - prevSourceColumn = mappedPosition.sourceColumn; - - if (nameIndex >= 0) { - mappingsString = mappingsString + TypeScript.Base64VLQFormat.encode(nameIndex - prevNameIndex); - prevNameIndex = nameIndex; - } - - emitComma = true; - recordedPosition = mappedPosition; - }; - - var recordSourceMappingSiblings = function (sourceMappings) { - for (var i = 0; i < sourceMappings.length; i++) { - var sourceMapping = sourceMappings[i]; - recordSourceMapping(sourceMapping.start, sourceMapping.nameIndex); - recordSourceMappingSiblings(sourceMapping.childMappings); - recordSourceMapping(sourceMapping.end, sourceMapping.nameIndex); - } - }; - - recordSourceMappingSiblings(this.allSourceMappings[sourceIndex]); - } - - this.sourceMapOut.Write(JSON.stringify({ - version: 3, - file: this.jsFileName, - sourceRoot: this.sourceRoot, - sources: this.tsFilePaths, - names: this.names, - mappings: mappingsString - })); - - this.sourceMapOut.Close(); - }; - SourceMapper.MapFileExtension = ".map"; - return SourceMapper; - })(); - TypeScript.SourceMapper = SourceMapper; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (EmitContainer) { - EmitContainer[EmitContainer["Prog"] = 0] = "Prog"; - EmitContainer[EmitContainer["Module"] = 1] = "Module"; - EmitContainer[EmitContainer["DynamicModule"] = 2] = "DynamicModule"; - EmitContainer[EmitContainer["Class"] = 3] = "Class"; - EmitContainer[EmitContainer["Constructor"] = 4] = "Constructor"; - EmitContainer[EmitContainer["Function"] = 5] = "Function"; - EmitContainer[EmitContainer["Args"] = 6] = "Args"; - EmitContainer[EmitContainer["Interface"] = 7] = "Interface"; - })(TypeScript.EmitContainer || (TypeScript.EmitContainer = {})); - var EmitContainer = TypeScript.EmitContainer; - - var EmitState = (function () { - function EmitState() { - this.column = 0; - this.line = 0; - this.container = 0 /* Prog */; - } - return EmitState; - })(); - TypeScript.EmitState = EmitState; - - var EmitOptions = (function () { - function EmitOptions(compiler, resolvePath) { - this.resolvePath = resolvePath; - this._diagnostic = null; - this._settings = null; - this._commonDirectoryPath = ""; - this._sharedOutputFile = ""; - this._sourceRootDirectory = ""; - this._sourceMapRootDirectory = ""; - this._outputDirectory = ""; - var settings = compiler.compilationSettings(); - this._settings = settings; - - if (settings.moduleGenTarget() === 0 /* Unspecified */) { - var fileNames = compiler.fileNames(); - for (var i = 0, n = fileNames.length; i < n; i++) { - var document = compiler.getDocument(fileNames[i]); - if (!document.isDeclareFile() && document.isExternalModule()) { - var errorSpan = document.externalModuleIndicatorSpan(); - this._diagnostic = new TypeScript.Diagnostic(document.fileName, document.lineMap(), errorSpan.start(), errorSpan.length(), TypeScript.DiagnosticCode.Cannot_compile_external_modules_unless_the_module_flag_is_provided); - - return; - } - } - } - - if (!settings.mapSourceFiles()) { - if (settings.mapRoot()) { - if (settings.sourceRoot()) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Options_mapRoot_and_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } else { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Option_mapRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } - } else if (settings.sourceRoot()) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Option_sourceRoot_cannot_be_specified_without_specifying_sourcemap_option, null); - return; - } - } - - this._sourceMapRootDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(settings.mapRoot())); - this._sourceRootDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(settings.sourceRoot())); - - if (settings.outFileOption() || settings.outDirOption() || settings.mapRoot() || settings.sourceRoot()) { - if (settings.outFileOption()) { - this._sharedOutputFile = TypeScript.switchToForwardSlashes(resolvePath(settings.outFileOption())); - } - - if (settings.outDirOption()) { - this._outputDirectory = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(resolvePath(settings.outDirOption()))); - } - - if (this._outputDirectory || this._sourceMapRootDirectory || this.sourceRootDirectory) { - this.determineCommonDirectoryPath(compiler); - } - } - } - EmitOptions.prototype.diagnostic = function () { - return this._diagnostic; - }; - - EmitOptions.prototype.commonDirectoryPath = function () { - return this._commonDirectoryPath; - }; - EmitOptions.prototype.sharedOutputFile = function () { - return this._sharedOutputFile; - }; - EmitOptions.prototype.sourceRootDirectory = function () { - return this._sourceRootDirectory; - }; - EmitOptions.prototype.sourceMapRootDirectory = function () { - return this._sourceMapRootDirectory; - }; - EmitOptions.prototype.outputDirectory = function () { - return this._outputDirectory; - }; - - EmitOptions.prototype.compilationSettings = function () { - return this._settings; - }; - - EmitOptions.prototype.determineCommonDirectoryPath = function (compiler) { - var commonComponents = []; - var commonComponentsLength = -1; - - var fileNames = compiler.fileNames(); - for (var i = 0, len = fileNames.length; i < len; i++) { - var fileName = fileNames[i]; - var document = compiler.getDocument(fileNames[i]); - var sourceUnit = document.sourceUnit(); - - if (!document.isDeclareFile()) { - var fileComponents = TypeScript.filePathComponents(fileName); - if (commonComponentsLength === -1) { - commonComponents = fileComponents; - commonComponentsLength = commonComponents.length; - } else { - var updatedPath = false; - for (var j = 0; j < commonComponentsLength && j < fileComponents.length; j++) { - if (commonComponents[j] !== fileComponents[j]) { - commonComponentsLength = j; - updatedPath = true; - - if (j === 0) { - if (this._outputDirectory || this._sourceMapRootDirectory) { - this._diagnostic = new TypeScript.Diagnostic(null, null, 0, 0, TypeScript.DiagnosticCode.Cannot_find_the_common_subdirectory_path_for_the_input_files, null); - return; - } - - return; - } - - break; - } - } - - if (!updatedPath && fileComponents.length < commonComponentsLength) { - commonComponentsLength = fileComponents.length; - } - } - } - } - - this._commonDirectoryPath = commonComponents.slice(0, commonComponentsLength).join("/") + "/"; - }; - return EmitOptions; - })(); - TypeScript.EmitOptions = EmitOptions; - - var Indenter = (function () { - function Indenter() { - this.indentAmt = 0; - } - Indenter.prototype.increaseIndent = function () { - this.indentAmt += Indenter.indentStep; - }; - - Indenter.prototype.decreaseIndent = function () { - this.indentAmt -= Indenter.indentStep; - }; - - Indenter.prototype.getIndent = function () { - var indentString = Indenter.indentStrings[this.indentAmt]; - if (indentString === undefined) { - indentString = ""; - for (var i = 0; i < this.indentAmt; i = i + Indenter.indentStep) { - indentString += Indenter.indentStepString; - } - Indenter.indentStrings[this.indentAmt] = indentString; - } - return indentString; - }; - Indenter.indentStep = 4; - Indenter.indentStepString = " "; - Indenter.indentStrings = []; - return Indenter; - })(); - TypeScript.Indenter = Indenter; - - function lastParameterIsRest(parameterList) { - var parameters = parameterList.parameters; - return parameters.nonSeparatorCount() > 0 && parameters.nonSeparatorAt(parameters.nonSeparatorCount() - 1).dotDotDotToken !== null; - } - TypeScript.lastParameterIsRest = lastParameterIsRest; - - var Emitter = (function () { - function Emitter(emittingFileName, outfile, emitOptions, semanticInfoChain) { - this.emittingFileName = emittingFileName; - this.outfile = outfile; - this.emitOptions = emitOptions; - this.semanticInfoChain = semanticInfoChain; - this.globalThisCapturePrologueEmitted = false; - this.extendsPrologueEmitted = false; - this.thisClassNode = null; - this.inArrowFunction = false; - this.moduleName = ""; - this.emitState = new EmitState(); - this.indenter = new Indenter(); - this.sourceMapper = null; - this.captureThisStmtString = "var _this = this;"; - this.declStack = []; - this.exportAssignment = null; - this.inWithBlock = false; - this.document = null; - this.detachedCommentsElement = null; - } - Emitter.prototype.pushDecl = function (decl) { - if (decl) { - this.declStack[this.declStack.length] = decl; - } - }; - - Emitter.prototype.popDecl = function (decl) { - if (decl) { - this.declStack.length--; - } - }; - - Emitter.prototype.getEnclosingDecl = function () { - var declStackLen = this.declStack.length; - var enclosingDecl = declStackLen > 0 ? this.declStack[declStackLen - 1] : null; - return enclosingDecl; - }; - - Emitter.prototype.setExportAssignment = function (exportAssignment) { - this.exportAssignment = exportAssignment; - }; - - Emitter.prototype.getExportAssignment = function () { - return this.exportAssignment; - }; - - Emitter.prototype.setDocument = function (document) { - this.document = document; - }; - - Emitter.prototype.shouldEmitImportDeclaration = function (importDeclAST) { - var isExternalModuleReference = importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */; - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var isExported = TypeScript.hasFlag(importDecl.flags, 1 /* Exported */); - var isAmdCodeGen = this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */; - - if (isExternalModuleReference && !isExported && isAmdCodeGen) { - return false; - } - - var importSymbol = importDecl.getSymbol(); - if (importSymbol.isUsedAsValue()) { - return true; - } - - if (importDeclAST.moduleReference.kind() !== 245 /* ExternalModuleReference */) { - var canBeUsedExternally = isExported || importSymbol.typeUsedExternally() || importSymbol.isUsedInExportedAlias(); - if (!canBeUsedExternally && !this.document.isExternalModule()) { - canBeUsedExternally = TypeScript.hasFlag(importDecl.getParentDecl().kind, 1 /* Script */ | 32 /* DynamicModule */); - } - - if (canBeUsedExternally) { - if (importSymbol.getExportAssignedValueSymbol()) { - return true; - } - - var containerSymbol = importSymbol.getExportAssignedContainerSymbol(); - if (containerSymbol && containerSymbol.getInstanceSymbol()) { - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitImportDeclaration = function (importDeclAST) { - var isExternalModuleReference = importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */; - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var isExported = TypeScript.hasFlag(importDecl.flags, 1 /* Exported */); - var isAmdCodeGen = this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */; - - this.emitComments(importDeclAST, true); - - var importSymbol = importDecl.getSymbol(); - - var parentSymbol = importSymbol.getContainer(); - var parentKind = parentSymbol ? parentSymbol.kind : 0 /* None */; - var associatedParentSymbol = parentSymbol ? parentSymbol.getAssociatedContainerType() : null; - var associatedParentSymbolKind = associatedParentSymbol ? associatedParentSymbol.kind : 0 /* None */; - - var needsPropertyAssignment = false; - var usePropertyAssignmentInsteadOfVarDecl = false; - var moduleNamePrefix; - - if (isExported && (parentKind === 4 /* Container */ || parentKind === 32 /* DynamicModule */ || associatedParentSymbolKind === 4 /* Container */ || associatedParentSymbolKind === 32 /* DynamicModule */)) { - if (importSymbol.getExportAssignedTypeSymbol() || importSymbol.getExportAssignedContainerSymbol()) { - needsPropertyAssignment = true; - } else { - var valueSymbol = importSymbol.getExportAssignedValueSymbol(); - if (valueSymbol && (valueSymbol.kind === 65536 /* Method */ || valueSymbol.kind === 16384 /* Function */)) { - needsPropertyAssignment = true; - } else { - usePropertyAssignmentInsteadOfVarDecl = true; - } - } - - if (this.emitState.container === 2 /* DynamicModule */) { - moduleNamePrefix = "exports."; - } else { - moduleNamePrefix = this.moduleName + "."; - } - } - - if (isAmdCodeGen && isExternalModuleReference) { - needsPropertyAssignment = true; - } else { - this.recordSourceMappingStart(importDeclAST); - if (usePropertyAssignmentInsteadOfVarDecl) { - this.writeToOutput(moduleNamePrefix); - } else { - this.writeToOutput("var "); - } - this.writeToOutput(importDeclAST.identifier.text() + " = "); - var aliasAST = importDeclAST.moduleReference; - - if (isExternalModuleReference) { - this.writeToOutput("require(" + aliasAST.stringLiteral.text() + ")"); - } else { - this.emitJavascript(aliasAST.moduleName, false); - } - - this.recordSourceMappingEnd(importDeclAST); - this.writeToOutput(";"); - - if (needsPropertyAssignment) { - this.writeLineToOutput(""); - this.emitIndent(); - } - } - - if (needsPropertyAssignment) { - this.writeToOutputWithSourceMapRecord(moduleNamePrefix + importDeclAST.identifier.text() + " = " + importDeclAST.identifier.text(), importDeclAST); - this.writeToOutput(";"); - } - this.emitComments(importDeclAST, false); - }; - - Emitter.prototype.createSourceMapper = function (document, jsFileName, jsFile, sourceMapOut, resolvePath) { - this.sourceMapper = new TypeScript.SourceMapper(jsFile, sourceMapOut, document, jsFileName, this.emitOptions, resolvePath); - }; - - Emitter.prototype.setSourceMapperNewSourceFile = function (document) { - this.sourceMapper.setNewSourceFile(document, this.emitOptions); - }; - - Emitter.prototype.updateLineAndColumn = function (s) { - var lineNumbers = TypeScript.TextUtilities.parseLineStarts(s); - if (lineNumbers.length > 1) { - this.emitState.line += lineNumbers.length - 1; - this.emitState.column = s.length - lineNumbers[lineNumbers.length - 1]; - } else { - this.emitState.column += s.length; - } - }; - - Emitter.prototype.writeToOutputWithSourceMapRecord = function (s, astSpan) { - this.recordSourceMappingStart(astSpan); - this.writeToOutput(s); - this.recordSourceMappingEnd(astSpan); - }; - - Emitter.prototype.writeToOutput = function (s) { - this.outfile.Write(s); - this.updateLineAndColumn(s); - }; - - Emitter.prototype.writeLineToOutput = function (s, force) { - if (typeof force === "undefined") { force = false; } - if (!force && s === "" && this.emitState.column === 0) { - return; - } - - this.outfile.WriteLine(s); - this.updateLineAndColumn(s); - this.emitState.column = 0; - this.emitState.line++; - }; - - Emitter.prototype.writeCaptureThisStatement = function (ast) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord(this.captureThisStmtString, ast); - this.writeLineToOutput(""); - }; - - Emitter.prototype.setContainer = function (c) { - var temp = this.emitState.container; - this.emitState.container = c; - return temp; - }; - - Emitter.prototype.getIndentString = function () { - return this.indenter.getIndent(); - }; - - Emitter.prototype.emitIndent = function () { - this.writeToOutput(this.getIndentString()); - }; - - Emitter.prototype.emitComment = function (comment, trailing, first) { - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var text = getTrimmedTextLines(comment); - var emitColumn = this.emitState.column; - - if (emitColumn === 0) { - this.emitIndent(); - } else if (trailing && first) { - this.writeToOutput(" "); - } - - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - this.recordSourceMappingStart(comment); - this.writeToOutput(text[0]); - - if (text.length > 1 || comment.endsLine) { - for (var i = 1; i < text.length; i++) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput(text[i]); - } - this.recordSourceMappingEnd(comment); - this.writeLineToOutput(""); - } else { - this.recordSourceMappingEnd(comment); - this.writeToOutput(" "); - return; - } - } else { - this.recordSourceMappingStart(comment); - this.writeToOutput(text[0]); - this.recordSourceMappingEnd(comment); - this.writeLineToOutput(""); - } - - if (!trailing && emitColumn !== 0) { - this.emitIndent(); - } - }; - - Emitter.prototype.emitComments = function (ast, pre, onlyPinnedOrTripleSlashComments) { - var _this = this; - if (typeof onlyPinnedOrTripleSlashComments === "undefined") { onlyPinnedOrTripleSlashComments = false; } - if (ast && ast.kind() !== 146 /* Block */) { - if (ast.parent.kind() === 219 /* SimpleArrowFunctionExpression */ || ast.parent.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - return; - } - } - - if (pre) { - var preComments = ast.preComments(); - - if (preComments && ast === this.detachedCommentsElement) { - var detachedComments = this.getDetachedComments(ast); - preComments = preComments.slice(detachedComments.length); - this.detachedCommentsElement = null; - } - - if (preComments && onlyPinnedOrTripleSlashComments) { - preComments = TypeScript.ArrayUtilities.where(preComments, function (c) { - return _this.isPinnedOrTripleSlash(c); - }); - } - - this.emitCommentsArray(preComments, false); - } else { - this.emitCommentsArray(ast.postComments(), true); - } - }; - - Emitter.prototype.isPinnedOrTripleSlash = function (comment) { - var fullText = comment.fullText(); - if (fullText.match(TypeScript.tripleSlashReferenceRegExp)) { - return true; - } else { - return fullText.indexOf("/*!") === 0; - } - }; - - Emitter.prototype.emitCommentsArray = function (comments, trailing) { - if (!this.emitOptions.compilationSettings().removeComments() && comments) { - for (var i = 0, n = comments.length; i < n; i++) { - this.emitComment(comments[i], trailing, i === 0); - } - } - }; - - Emitter.prototype.emitObjectLiteralExpression = function (objectLiteral) { - this.recordSourceMappingStart(objectLiteral); - - this.writeToOutput("{"); - this.emitCommaSeparatedList(objectLiteral, objectLiteral.propertyAssignments, " ", true); - this.writeToOutput("}"); - - this.recordSourceMappingEnd(objectLiteral); - }; - - Emitter.prototype.emitArrayLiteralExpression = function (arrayLiteral) { - this.recordSourceMappingStart(arrayLiteral); - - this.writeToOutput("["); - this.emitCommaSeparatedList(arrayLiteral, arrayLiteral.expressions, "", true); - this.writeToOutput("]"); - - this.recordSourceMappingEnd(arrayLiteral); - }; - - Emitter.prototype.emitObjectCreationExpression = function (objectCreationExpression) { - this.recordSourceMappingStart(objectCreationExpression); - this.writeToOutput("new "); - var target = objectCreationExpression.expression; - - this.emit(target); - if (objectCreationExpression.argumentList) { - this.recordSourceMappingStart(objectCreationExpression.argumentList); - this.writeToOutput("("); - this.emitCommaSeparatedList(objectCreationExpression.argumentList, objectCreationExpression.argumentList.arguments, "", false); - this.writeToOutputWithSourceMapRecord(")", objectCreationExpression.argumentList.closeParenToken); - this.recordSourceMappingEnd(objectCreationExpression.argumentList); - } - - this.recordSourceMappingEnd(objectCreationExpression); - }; - - Emitter.prototype.getConstantDecl = function (dotExpr) { - var pullSymbol = this.semanticInfoChain.getSymbolForAST(dotExpr); - if (pullSymbol && pullSymbol.kind === 67108864 /* EnumMember */) { - var pullDecls = pullSymbol.getDeclarations(); - if (pullDecls.length === 1) { - var pullDecl = pullDecls[0]; - if (pullDecl.kind === 67108864 /* EnumMember */) { - return pullDecl; - } - } - } - - return null; - }; - - Emitter.prototype.tryEmitConstant = function (dotExpr) { - var propertyName = dotExpr.name; - var boundDecl = this.getConstantDecl(dotExpr); - if (boundDecl) { - var value = boundDecl.constantValue; - if (value !== null) { - this.recordSourceMappingStart(dotExpr); - this.writeToOutput(value.toString()); - var comment = " /* "; - comment += propertyName.text(); - comment += " */"; - this.writeToOutput(comment); - this.recordSourceMappingEnd(dotExpr); - return true; - } - } - - return false; - }; - - Emitter.prototype.emitInvocationExpression = function (callNode) { - this.recordSourceMappingStart(callNode); - var target = callNode.expression; - var args = callNode.argumentList.arguments; - - if (target.kind() === 212 /* MemberAccessExpression */ && target.expression.kind() === 50 /* SuperKeyword */) { - this.emit(target); - this.writeToOutput(".call"); - this.recordSourceMappingStart(args); - this.writeToOutput("("); - this.emitThis(); - if (args && args.nonSeparatorCount() > 0) { - this.writeToOutput(", "); - this.emitCommaSeparatedList(callNode.argumentList, args, "", false); - } - } else { - if (callNode.expression.kind() === 50 /* SuperKeyword */ && this.emitState.container === 4 /* Constructor */) { - this.writeToOutput("_super.call"); - } else { - this.emitJavascript(target, false); - } - this.recordSourceMappingStart(args); - this.writeToOutput("("); - if (callNode.expression.kind() === 50 /* SuperKeyword */ && this.emitState.container === 4 /* Constructor */) { - this.writeToOutput("this"); - if (args && args.nonSeparatorCount() > 0) { - this.writeToOutput(", "); - } - } - this.emitCommaSeparatedList(callNode.argumentList, args, "", false); - } - - this.writeToOutputWithSourceMapRecord(")", callNode.argumentList.closeParenToken); - this.recordSourceMappingEnd(args); - this.recordSourceMappingEnd(callNode); - }; - - Emitter.prototype.emitParameterList = function (list) { - this.writeToOutput("("); - this.emitCommentsArray(list.openParenTrailingComments, true); - this.emitFunctionParameters(TypeScript.ASTHelpers.parametersFromParameterList(list)); - this.writeToOutput(")"); - }; - - Emitter.prototype.emitFunctionParameters = function (parameters) { - var argsLen = 0; - - if (parameters) { - this.emitComments(parameters.ast, true); - - var tempContainer = this.setContainer(6 /* Args */); - argsLen = parameters.length; - var printLen = argsLen; - if (parameters.lastParameterIsRest()) { - printLen--; - } - for (var i = 0; i < printLen; i++) { - var arg = parameters.astAt(i); - this.emit(arg); - - if (i < (printLen - 1)) { - this.writeToOutput(", "); - } - } - this.setContainer(tempContainer); - - this.emitComments(parameters.ast, false); - } - }; - - Emitter.prototype.emitFunctionBodyStatements = function (name, funcDecl, parameterList, block, bodyExpression) { - this.writeLineToOutput(" {"); - if (name) { - this.recordSourceMappingNameStart(name); - } - - this.indenter.increaseIndent(); - - if (block) { - this.emitDetachedComments(block.statements); - } - - if (this.shouldCaptureThis(funcDecl)) { - this.writeCaptureThisStatement(funcDecl); - } - - if (parameterList) { - this.emitDefaultValueAssignments(parameterList); - this.emitRestParameterInitializer(parameterList); - } - - if (block) { - this.emitList(block.statements); - this.emitCommentsArray(block.closeBraceLeadingComments, false); - } else { - this.emitIndent(); - this.emitCommentsArray(bodyExpression.preComments(), false); - this.writeToOutput("return "); - this.emit(bodyExpression); - this.writeLineToOutput(";"); - this.emitCommentsArray(bodyExpression.postComments(), true); - } - - this.indenter.decreaseIndent(); - this.emitIndent(); - - if (block) { - this.writeToOutputWithSourceMapRecord("}", block.closeBraceToken); - } else { - this.writeToOutputWithSourceMapRecord("}", bodyExpression); - } - - if (name) { - this.recordSourceMappingNameEnd(); - } - }; - - Emitter.prototype.emitDefaultValueAssignments = function (parameters) { - var n = parameters.length; - if (parameters.lastParameterIsRest()) { - n--; - } - - for (var i = 0; i < n; i++) { - var arg = parameters.astAt(i); - var id = parameters.identifierAt(i); - var equalsValueClause = parameters.initializerAt(i); - if (equalsValueClause) { - this.emitIndent(); - this.recordSourceMappingStart(arg); - this.writeToOutput("if (typeof " + id.text() + " === \"undefined\") { "); - this.writeToOutputWithSourceMapRecord(id.text(), id); - this.emitJavascript(equalsValueClause, false); - this.writeLineToOutput("; }"); - this.recordSourceMappingEnd(arg); - } - } - }; - - Emitter.prototype.emitRestParameterInitializer = function (parameters) { - if (parameters.lastParameterIsRest()) { - var n = parameters.length; - var lastArg = parameters.astAt(n - 1); - var id = parameters.identifierAt(n - 1); - this.emitIndent(); - this.recordSourceMappingStart(lastArg); - this.writeToOutput("var "); - this.writeToOutputWithSourceMapRecord(id.text(), id); - this.writeLineToOutput(" = [];"); - this.recordSourceMappingEnd(lastArg); - this.emitIndent(); - this.writeToOutput("for ("); - this.writeToOutputWithSourceMapRecord("var _i = 0;", lastArg); - this.writeToOutput(" "); - this.writeToOutputWithSourceMapRecord("_i < (arguments.length - " + (n - 1) + ")", lastArg); - this.writeToOutput("; "); - this.writeToOutputWithSourceMapRecord("_i++", lastArg); - this.writeLineToOutput(") {"); - this.indenter.increaseIndent(); - this.emitIndent(); - - this.writeToOutputWithSourceMapRecord(id.text() + "[_i] = arguments[_i + " + (n - 1) + "];", lastArg); - this.writeLineToOutput(""); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeLineToOutput("}"); - } - }; - - Emitter.prototype.getImportDecls = function (fileName) { - var topLevelDecl = this.semanticInfoChain.topLevelDecl(this.document.fileName); - var result = []; - - var dynamicModuleDecl = topLevelDecl.getChildDecls()[0]; - var queue = dynamicModuleDecl.getChildDecls(); - - for (var i = 0, n = queue.length; i < n; i++) { - var decl = queue[i]; - - if (decl.kind & 128 /* TypeAlias */) { - var importStatementAST = this.semanticInfoChain.getASTForDecl(decl); - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var symbol = decl.getSymbol(); - var typeSymbol = symbol && symbol.type; - if (typeSymbol && typeSymbol !== this.semanticInfoChain.anyTypeSymbol && !typeSymbol.isError()) { - result.push(decl); - } - } - } - } - - return result; - }; - - Emitter.prototype.getModuleImportAndDependencyList = function (sourceUnit) { - var importList = ""; - var dependencyList = ""; - - var importDecls = this.getImportDecls(this.document.fileName); - - if (importDecls.length) { - for (var i = 0; i < importDecls.length; i++) { - var importStatementDecl = importDecls[i]; - var importStatementSymbol = importStatementDecl.getSymbol(); - var importStatementAST = this.semanticInfoChain.getASTForDecl(importStatementDecl); - - if (importStatementSymbol.isUsedAsValue()) { - if (i <= importDecls.length - 1) { - dependencyList += ", "; - importList += ", "; - } - - importList += importStatementDecl.name; - dependencyList += importStatementAST.moduleReference.stringLiteral.text(); - } - } - } - - var amdDependencies = this.document.amdDependencies(); - for (var i = 0; i < amdDependencies.length; i++) { - dependencyList += ", \"" + amdDependencies[i] + "\""; - } - - return { - importList: importList, - dependencyList: dependencyList - }; - }; - - Emitter.prototype.shouldCaptureThis = function (ast) { - if (ast.kind() === 120 /* SourceUnit */) { - var scriptDecl = this.semanticInfoChain.topLevelDecl(this.document.fileName); - return TypeScript.hasFlag(scriptDecl.flags, 262144 /* MustCaptureThis */); - } - - var decl = this.semanticInfoChain.getDeclForAST(ast); - if (decl) { - return TypeScript.hasFlag(decl.flags, 262144 /* MustCaptureThis */); - } - - return false; - }; - - Emitter.prototype.emitEnum = function (moduleDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.pushDecl(pullDecl); - - var svModuleName = this.moduleName; - this.moduleName = moduleDecl.identifier.text(); - - var temp = this.setContainer(1 /* Module */); - var isExported = TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */); - - if (!isExported) { - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("var "); - this.recordSourceMappingStart(moduleDecl.identifier); - this.writeToOutput(this.moduleName); - this.recordSourceMappingEnd(moduleDecl.identifier); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(moduleDecl); - this.emitIndent(); - } - - this.writeToOutput("("); - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("function ("); - this.writeToOutputWithSourceMapRecord(this.moduleName, moduleDecl.identifier); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart(this.moduleName); - - this.indenter.increaseIndent(); - - if (this.shouldCaptureThis(moduleDecl)) { - this.writeCaptureThisStatement(moduleDecl); - } - - this.emitSeparatedList(moduleDecl.enumElements); - this.indenter.decreaseIndent(); - this.emitIndent(); - - var parentIsDynamic = temp === 2 /* DynamicModule */; - if (temp === 0 /* Prog */ && isExported) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));"); - } else if (isExported || temp === 0 /* Prog */) { - var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName; - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));"); - } else if (!isExported && temp !== 0 /* Prog */) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));"); - } else { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.writeToOutput(")();"); - } - - this.recordSourceMappingEnd(moduleDecl); - if (temp !== 0 /* Prog */ && isExported) { - this.recordSourceMappingStart(moduleDecl); - if (parentIsDynamic) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = exports." + this.moduleName + ";"); - } else { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = " + svModuleName + "." + this.moduleName + ";"); - } - this.recordSourceMappingEnd(moduleDecl); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - - this.popDecl(pullDecl); - }; - - Emitter.prototype.getModuleDeclToVerifyChildNameCollision = function (moduleDecl, changeNameIfAnyDeclarationInContext) { - if (TypeScript.ArrayUtilities.contains(this.declStack, moduleDecl)) { - return moduleDecl; - } else if (changeNameIfAnyDeclarationInContext) { - var symbol = moduleDecl.getSymbol(); - if (symbol) { - var otherDecls = symbol.getDeclarations(); - for (var i = 0; i < otherDecls.length; i++) { - if (TypeScript.ArrayUtilities.contains(this.declStack, otherDecls[i])) { - return otherDecls[i]; - } - } - } - } - - return null; - }; - - Emitter.prototype.hasChildNameCollision = function (moduleName, parentDecl) { - var _this = this; - var childDecls = parentDecl.getChildDecls(); - return TypeScript.ArrayUtilities.any(childDecls, function (childDecl) { - var childAST = _this.semanticInfoChain.getASTForDecl(childDecl); - - if (childDecl.kind != 67108864 /* EnumMember */ && _this.shouldEmit(childAST)) { - if (childDecl.name === moduleName) { - if (parentDecl.kind != 8 /* Class */) { - return true; - } - - if (!(childDecl.kind == 65536 /* Method */ || childDecl.kind == 4096 /* Property */ || childDecl.kind == 524288 /* SetAccessor */ || childDecl.kind == 262144 /* GetAccessor */)) { - return true; - } - } - - if (_this.hasChildNameCollision(moduleName, childDecl)) { - return true; - } - } - return false; - }); - }; - - Emitter.prototype.getModuleName = function (moduleDecl, changeNameIfAnyDeclarationInContext) { - var moduleName = moduleDecl.name; - var moduleDisplayName = moduleDecl.getDisplayName(); - - moduleDecl = this.getModuleDeclToVerifyChildNameCollision(moduleDecl, changeNameIfAnyDeclarationInContext); - if (moduleDecl && moduleDecl.kind != 64 /* Enum */) { - while (this.hasChildNameCollision(moduleName, moduleDecl)) { - moduleName = "_" + moduleName; - moduleDisplayName = "_" + moduleDisplayName; - } - } - - return moduleDisplayName; - }; - - Emitter.prototype.emitModuleDeclarationWorker = function (moduleDecl) { - if (moduleDecl.stringLiteral) { - this.emitSingleModuleDeclaration(moduleDecl, moduleDecl.stringLiteral); - } else { - var moduleNames = TypeScript.getModuleNames(moduleDecl.name); - this.emitSingleModuleDeclaration(moduleDecl, moduleNames[0]); - } - }; - - Emitter.prototype.emitSingleModuleDeclaration = function (moduleDecl, moduleName) { - var isLastName = TypeScript.ASTHelpers.isLastNameOfModule(moduleDecl, moduleName); - - if (isLastName) { - this.emitComments(moduleDecl, true); - } - - var pullDecl = this.semanticInfoChain.getDeclForAST(moduleName); - this.pushDecl(pullDecl); - - var svModuleName = this.moduleName; - - if (moduleDecl.stringLiteral) { - this.moduleName = moduleDecl.stringLiteral.valueText(); - if (TypeScript.isTSFile(this.moduleName)) { - this.moduleName = this.moduleName.substring(0, this.moduleName.length - ".ts".length); - } - } else { - this.moduleName = moduleName.text(); - } - - var temp = this.setContainer(1 /* Module */); - var isExported = TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */); - - if (!isExported) { - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("var "); - this.recordSourceMappingStart(moduleName); - this.writeToOutput(this.moduleName); - this.recordSourceMappingEnd(moduleName); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(moduleDecl); - this.emitIndent(); - } - - this.writeToOutput("("); - this.recordSourceMappingStart(moduleDecl); - this.writeToOutput("function ("); - - this.moduleName = this.getModuleName(pullDecl); - this.writeToOutputWithSourceMapRecord(this.moduleName, moduleName); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart(moduleName.text()); - - this.indenter.increaseIndent(); - - if (this.shouldCaptureThis(moduleDecl)) { - this.writeCaptureThisStatement(moduleDecl); - } - - if (moduleName === moduleDecl.stringLiteral) { - this.emitList(moduleDecl.moduleElements); - } else { - var moduleNames = TypeScript.getModuleNames(moduleDecl.name); - var nameIndex = moduleNames.indexOf(moduleName); - TypeScript.Debug.assert(nameIndex >= 0); - - if (isLastName) { - this.emitList(moduleDecl.moduleElements); - } else { - this.emitIndent(); - this.emitSingleModuleDeclaration(moduleDecl, moduleNames[nameIndex + 1]); - this.writeLineToOutput(""); - } - } - - this.moduleName = moduleName.text(); - this.indenter.decreaseIndent(); - this.emitIndent(); - - var parentIsDynamic = temp === 2 /* DynamicModule */; - this.recordSourceMappingStart(moduleDecl.endingToken); - if (temp === 0 /* Prog */ && isExported) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(this." + this.moduleName + " || (this." + this.moduleName + " = {}));"); - } else if (isExported || temp === 0 /* Prog */) { - var dotMod = svModuleName !== "" ? (parentIsDynamic ? "exports" : svModuleName) + "." : svModuleName; - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(" + dotMod + this.moduleName + " || (" + dotMod + this.moduleName + " = {}));"); - } else if (!isExported && temp !== 0 /* Prog */) { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")(" + this.moduleName + " || (" + this.moduleName + " = {}));"); - } else { - this.writeToOutput("}"); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(moduleDecl.endingToken); - this.writeToOutput(")();"); - } - - this.recordSourceMappingEnd(moduleDecl); - if (temp !== 0 /* Prog */ && isExported) { - this.recordSourceMappingStart(moduleDecl); - if (parentIsDynamic) { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = exports." + this.moduleName + ";"); - } else { - this.writeLineToOutput(""); - this.emitIndent(); - this.writeToOutput("var " + this.moduleName + " = " + svModuleName + "." + this.moduleName + ";"); - } - this.recordSourceMappingEnd(moduleDecl); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - - this.popDecl(pullDecl); - - if (isLastName) { - this.emitComments(moduleDecl, false); - } - }; - - Emitter.prototype.emitEnumElement = function (varDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - TypeScript.Debug.assert(pullDecl && pullDecl.kind === 67108864 /* EnumMember */); - - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - var name = varDecl.propertyName.text(); - var quoted = TypeScript.isQuoted(name); - this.writeToOutput(this.moduleName); - this.writeToOutput('['); - this.writeToOutput(this.moduleName); - this.writeToOutput('['); - this.writeToOutput(quoted ? name : '"' + name + '"'); - this.writeToOutput(']'); - - if (varDecl.equalsValueClause) { - this.emit(varDecl.equalsValueClause); - } else if (pullDecl.constantValue !== null) { - this.writeToOutput(' = '); - this.writeToOutput(pullDecl.constantValue.toString()); - } else { - this.writeToOutput(' = null'); - } - - this.writeToOutput('] = '); - this.writeToOutput(quoted ? name : '"' + name + '"'); - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - this.writeToOutput(';'); - }; - - Emitter.prototype.emitElementAccessExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.emit(expression.expression); - this.writeToOutput("["); - this.emit(expression.argumentExpression); - this.writeToOutput("]"); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitSimpleArrowFunctionExpression = function (arrowFunction) { - this.emitAnyArrowFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromIdentifier(arrowFunction.identifier), arrowFunction.block, arrowFunction.expression); - }; - - Emitter.prototype.emitParenthesizedArrowFunctionExpression = function (arrowFunction) { - this.emitAnyArrowFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), arrowFunction.block, arrowFunction.expression); - }; - - Emitter.prototype.emitAnyArrowFunctionExpression = function (arrowFunction, funcName, parameters, block, expression) { - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = true; - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(arrowFunction); - - var pullDecl = this.semanticInfoChain.getDeclForAST(arrowFunction); - this.pushDecl(pullDecl); - - this.emitComments(arrowFunction, true); - - this.recordSourceMappingStart(arrowFunction); - this.writeToOutput("function "); - this.writeToOutput("("); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcName, arrowFunction, parameters, block, expression); - - this.recordSourceMappingEnd(arrowFunction); - - this.recordSourceMappingEnd(arrowFunction); - - this.emitComments(arrowFunction, false); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitConstructor = function (funcDecl) { - if (!funcDecl.block) { - return; - } - var temp = this.setContainer(4 /* Constructor */); - - this.recordSourceMappingStart(funcDecl); - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.emitComments(funcDecl, true); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - this.writeToOutput(this.thisClassNode.identifier.text()); - this.writeToOutput("("); - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeLineToOutput(") {"); - - this.recordSourceMappingNameStart("constructor"); - this.indenter.increaseIndent(); - - this.emitDefaultValueAssignments(parameters); - this.emitRestParameterInitializer(parameters); - - if (this.shouldCaptureThis(funcDecl)) { - this.writeCaptureThisStatement(funcDecl); - } - - this.emitConstructorStatements(funcDecl); - this.emitCommentsArray(funcDecl.block.closeBraceLeadingComments, false); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", funcDecl.block.closeBraceToken); - - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - this.setContainer(temp); - }; - - Emitter.prototype.emitGetAccessor = function (accessor) { - this.recordSourceMappingStart(accessor); - this.writeToOutput("get "); - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(accessor); - - var pullDecl = this.semanticInfoChain.getDeclForAST(accessor); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(accessor); - - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(accessor, this.semanticInfoChain); - var container = accessorSymbol.getContainer(); - var containerKind = container.kind; - - this.recordSourceMappingNameStart(accessor.propertyName.text()); - this.writeToOutput(accessor.propertyName.text()); - this.writeToOutput("("); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, accessor, TypeScript.ASTHelpers.parametersFromParameterList(accessor.parameterList), accessor.block, null); - - this.recordSourceMappingEnd(accessor); - - this.recordSourceMappingEnd(accessor); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.recordSourceMappingEnd(accessor); - }; - - Emitter.prototype.emitSetAccessor = function (accessor) { - this.recordSourceMappingStart(accessor); - this.writeToOutput("set "); - - var temp = this.setContainer(5 /* Function */); - - this.recordSourceMappingStart(accessor); - - var pullDecl = this.semanticInfoChain.getDeclForAST(accessor); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(accessor); - - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(accessor, this.semanticInfoChain); - var container = accessorSymbol.getContainer(); - var containerKind = container.kind; - - this.recordSourceMappingNameStart(accessor.propertyName.text()); - this.writeToOutput(accessor.propertyName.text()); - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(accessor.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, accessor, parameters, accessor.block, null); - - this.recordSourceMappingEnd(accessor); - - this.recordSourceMappingEnd(accessor); - - this.popDecl(pullDecl); - this.setContainer(temp); - this.recordSourceMappingEnd(accessor); - }; - - Emitter.prototype.emitFunctionExpression = function (funcDecl) { - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - - var funcName = funcDecl.identifier ? funcDecl.identifier.text() : null; - - this.recordSourceMappingStart(funcDecl); - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - if (funcDecl.identifier) { - this.recordSourceMappingStart(funcDecl.identifier); - this.writeToOutput(funcDecl.identifier.text()); - this.recordSourceMappingEnd(funcDecl.identifier); - } - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcName, funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitFunction = function (funcDecl) { - if (funcDecl.block === null) { - return; - } - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - - var funcName = funcDecl.identifier.text(); - - this.recordSourceMappingStart(funcDecl); - - var printName = funcDecl.identifier !== null; - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.emitComments(funcDecl, true); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - if (printName) { - var id = funcDecl.identifier.text(); - if (id) { - if (funcDecl.identifier) { - this.recordSourceMappingStart(funcDecl.identifier); - } - this.writeToOutput(id); - if (funcDecl.identifier) { - this.recordSourceMappingEnd(funcDecl.identifier); - } - } - } - - this.emitParameterList(funcDecl.callSignature.parameterList); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionBodyStatements(funcDecl.identifier.text(), funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - - if (funcDecl.block) { - var pullFunctionDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - if ((this.emitState.container === 1 /* Module */ || this.emitState.container === 2 /* DynamicModule */) && pullFunctionDecl && TypeScript.hasFlag(pullFunctionDecl.flags, 1 /* Exported */)) { - this.writeLineToOutput(""); - this.emitIndent(); - var modName = this.emitState.container === 1 /* Module */ ? this.moduleName : "exports"; - this.recordSourceMappingStart(funcDecl); - this.writeToOutput(modName + "." + funcName + " = " + funcName + ";"); - this.recordSourceMappingEnd(funcDecl); - } - } - }; - - Emitter.prototype.emitAmbientVarDecl = function (varDecl) { - this.recordSourceMappingStart(this.currentVariableDeclaration); - if (varDecl.equalsValueClause) { - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - this.writeToOutputWithSourceMapRecord(varDecl.propertyName.text(), varDecl.propertyName); - this.emitJavascript(varDecl.equalsValueClause, false); - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - } - }; - - Emitter.prototype.emitVarDeclVar = function () { - if (this.currentVariableDeclaration) { - this.writeToOutput("var "); - } - }; - - Emitter.prototype.emitVariableDeclaration = function (declaration) { - var varDecl = declaration.declarators.nonSeparatorAt(0); - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentKind = parentSymbol ? parentSymbol.kind : 0 /* None */; - - this.emitComments(declaration, true); - - var pullVarDecl = this.semanticInfoChain.getDeclForAST(varDecl); - var isAmbientWithoutInit = pullVarDecl && TypeScript.hasFlag(pullVarDecl.flags, 8 /* Ambient */) && varDecl.equalsValueClause === null; - if (!isAmbientWithoutInit) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.currentVariableDeclaration = declaration; - - for (var i = 0, n = declaration.declarators.nonSeparatorCount(); i < n; i++) { - var declarator = declaration.declarators.nonSeparatorAt(i); - - if (i > 0) { - this.writeToOutput(", "); - } - - this.emit(declarator); - } - this.currentVariableDeclaration = prevVariableDeclaration; - - this.recordSourceMappingEnd(declaration); - } - - this.emitComments(declaration, false); - }; - - Emitter.prototype.emitMemberVariableDeclaration = function (varDecl) { - TypeScript.Debug.assert(!TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause); - - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - this.pushDecl(pullDecl); - - this.emitComments(varDecl, true); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.variableDeclarator.propertyName.text(); - var quotedOrNumber = TypeScript.isQuoted(varDeclName) || varDecl.variableDeclarator.propertyName.kind() !== 11 /* IdentifierName */; - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentDecl = pullDecl && pullDecl.getParentDecl(); - - if (quotedOrNumber) { - this.writeToOutput("this["); - } else { - this.writeToOutput("this."); - } - - this.writeToOutputWithSourceMapRecord(varDecl.variableDeclarator.propertyName.text(), varDecl.variableDeclarator.propertyName); - - if (quotedOrNumber) { - this.writeToOutput("]"); - } - - if (varDecl.variableDeclarator.equalsValueClause) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.emit(varDecl.variableDeclarator.equalsValueClause); - this.currentVariableDeclaration = prevVariableDeclaration; - } - - if (this.emitState.container !== 6 /* Args */) { - this.writeToOutput(";"); - } - - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitVariableDeclarator = function (varDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(varDecl); - this.pushDecl(pullDecl); - if (pullDecl && (pullDecl.flags & 8 /* Ambient */) === 8 /* Ambient */) { - this.emitAmbientVarDecl(varDecl); - } else { - this.emitComments(varDecl, true); - this.recordSourceMappingStart(this.currentVariableDeclaration); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.propertyName.text(); - - var symbol = this.semanticInfoChain.getSymbolForAST(varDecl); - var parentSymbol = symbol ? symbol.getContainer() : null; - var parentDecl = pullDecl && pullDecl.getParentDecl(); - var parentIsModule = parentDecl && (parentDecl.flags & 102400 /* SomeInitializedModule */); - - if (parentIsModule) { - if (!TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - this.emitVarDeclVar(); - } else { - if (this.emitState.container === 2 /* DynamicModule */) { - this.writeToOutput("exports."); - } else { - this.writeToOutput(this.moduleName + "."); - } - } - } else { - this.emitVarDeclVar(); - } - - this.writeToOutputWithSourceMapRecord(varDecl.propertyName.text(), varDecl.propertyName); - - if (varDecl.equalsValueClause) { - var prevVariableDeclaration = this.currentVariableDeclaration; - this.emit(varDecl.equalsValueClause); - this.currentVariableDeclaration = prevVariableDeclaration; - } - - this.recordSourceMappingEnd(varDecl); - this.emitComments(varDecl, false); - } - this.currentVariableDeclaration = undefined; - this.popDecl(pullDecl); - }; - - Emitter.prototype.symbolIsUsedInItsEnclosingContainer = function (symbol, dynamic) { - if (typeof dynamic === "undefined") { dynamic = false; } - var symDecls = symbol.getDeclarations(); - - if (symDecls.length) { - var enclosingDecl = this.getEnclosingDecl(); - if (enclosingDecl) { - var parentDecl = symDecls[0].getParentDecl(); - if (parentDecl) { - var symbolDeclarationEnclosingContainer = parentDecl; - var enclosingContainer = enclosingDecl; - - while (symbolDeclarationEnclosingContainer) { - if (symbolDeclarationEnclosingContainer.kind === (dynamic ? 32 /* DynamicModule */ : 4 /* Container */)) { - break; - } - symbolDeclarationEnclosingContainer = symbolDeclarationEnclosingContainer.getParentDecl(); - } - - if (symbolDeclarationEnclosingContainer) { - while (enclosingContainer) { - if (enclosingContainer.kind === (dynamic ? 32 /* DynamicModule */ : 4 /* Container */)) { - break; - } - - enclosingContainer = enclosingContainer.getParentDecl(); - } - } - - if (symbolDeclarationEnclosingContainer && enclosingContainer) { - var same = symbolDeclarationEnclosingContainer === enclosingContainer; - - if (!same && symbol.anyDeclHasFlag(32768 /* InitializedModule */)) { - same = symbolDeclarationEnclosingContainer === enclosingContainer.getParentDecl(); - } - - return same; - } - } - } - } - - return false; - }; - - Emitter.prototype.getPotentialDeclPathInfoForEmit = function (pullSymbol) { - var decl = pullSymbol.getDeclarations()[0]; - var parentDecl = decl.getParentDecl(); - var symbolContainerDeclPath = parentDecl ? parentDecl.getParentPath() : []; - - var enclosingContextDeclPath = this.declStack; - var commonNodeIndex = -1; - - if (enclosingContextDeclPath.length) { - for (var i = symbolContainerDeclPath.length - 1; i >= 0; i--) { - var symbolContainerDeclPathNode = symbolContainerDeclPath[i]; - for (var j = enclosingContextDeclPath.length - 1; j >= 0; j--) { - var enclosingContextDeclPathNode = enclosingContextDeclPath[j]; - if (symbolContainerDeclPathNode === enclosingContextDeclPathNode) { - commonNodeIndex = i; - break; - } - } - - if (commonNodeIndex >= 0) { - break; - } - } - } - - var startingIndex = symbolContainerDeclPath.length - 1; - for (var i = startingIndex - 1; i > commonNodeIndex; i--) { - if (symbolContainerDeclPath[i + 1].flags & 1 /* Exported */) { - startingIndex = i; - } else { - break; - } - } - return { potentialPath: symbolContainerDeclPath, startingIndex: startingIndex }; - }; - - Emitter.prototype.emitDottedNameFromDeclPath = function (declPath, startingIndex, lastIndex) { - for (var i = startingIndex; i <= lastIndex; i++) { - if (declPath[i].kind === 32 /* DynamicModule */ || declPath[i].flags & 65536 /* InitializedDynamicModule */) { - this.writeToOutput("exports."); - } else { - this.writeToOutput(this.getModuleName(declPath[i], true) + "."); - } - } - }; - - Emitter.prototype.emitSymbolContainerNameInEnclosingContext = function (pullSymbol) { - var declPathInfo = this.getPotentialDeclPathInfoForEmit(pullSymbol); - var potentialDeclPath = declPathInfo.potentialPath; - var startingIndex = declPathInfo.startingIndex; - - this.emitDottedNameFromDeclPath(potentialDeclPath, startingIndex, potentialDeclPath.length - 1); - }; - - Emitter.prototype.getSymbolForEmit = function (ast) { - var pullSymbol = this.semanticInfoChain.getSymbolForAST(ast); - var pullSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(ast); - if (pullSymbol && pullSymbolAlias) { - var symbolToCompare = TypeScript.isTypesOnlyLocation(ast) ? pullSymbolAlias.getExportAssignedTypeSymbol() : pullSymbolAlias.getExportAssignedValueSymbol(); - - if (pullSymbol === symbolToCompare) { - pullSymbol = pullSymbolAlias; - pullSymbolAlias = null; - } - } - return { symbol: pullSymbol, aliasSymbol: pullSymbolAlias }; - }; - - Emitter.prototype.emitName = function (name, addThis) { - this.emitComments(name, true); - this.recordSourceMappingStart(name); - if (name.text().length > 0) { - var symbolForEmit = this.getSymbolForEmit(name); - var pullSymbol = symbolForEmit.symbol; - if (!pullSymbol) { - pullSymbol = this.semanticInfoChain.anyTypeSymbol; - } - var pullSymbolAlias = symbolForEmit.aliasSymbol; - var pullSymbolKind = pullSymbol.kind; - var isLocalAlias = pullSymbolAlias && (pullSymbolAlias.getDeclarations()[0].getParentDecl() === this.getEnclosingDecl()); - if (addThis && (this.emitState.container !== 6 /* Args */) && pullSymbol) { - var pullSymbolContainer = pullSymbol.getContainer(); - - if (pullSymbolContainer) { - var pullSymbolContainerKind = pullSymbolContainer.kind; - - if (pullSymbolContainerKind === 8 /* Class */) { - if (pullSymbol.anyDeclHasFlag(16 /* Static */)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbolKind === 4096 /* Property */) { - this.emitThis(); - this.writeToOutput("."); - } - } else if (TypeScript.PullHelpers.symbolIsModule(pullSymbolContainer) || pullSymbolContainerKind === 64 /* Enum */ || pullSymbolContainer.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) { - if (pullSymbolKind === 4096 /* Property */ || pullSymbolKind === 67108864 /* EnumMember */) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && pullSymbolKind === 512 /* Variable */ && !pullSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && !this.symbolIsUsedInItsEnclosingContainer(pullSymbol)) { - this.emitSymbolContainerNameInEnclosingContext(pullSymbol); - } - } else if (pullSymbolContainerKind === 32 /* DynamicModule */ || pullSymbolContainer.anyDeclHasFlag(65536 /* InitializedDynamicModule */)) { - if (pullSymbolKind === 4096 /* Property */) { - this.writeToOutput("exports."); - } else if (pullSymbol.anyDeclHasFlag(1 /* Exported */) && !isLocalAlias && !pullSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */) && pullSymbol.kind !== 32768 /* ConstructorMethod */ && pullSymbol.kind !== 8 /* Class */ && pullSymbol.kind !== 64 /* Enum */) { - this.writeToOutput("exports."); - } - } - } - } - - this.writeToOutput(name.text()); - } - - this.recordSourceMappingEnd(name); - this.emitComments(name, false); - }; - - Emitter.prototype.recordSourceMappingNameStart = function (name) { - if (this.sourceMapper) { - var nameIndex = -1; - if (name) { - if (this.sourceMapper.currentNameIndex.length > 0) { - var parentNameIndex = this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length - 1]; - if (parentNameIndex !== -1) { - name = this.sourceMapper.names[parentNameIndex] + "." + name; - } - } - - var nameIndex = this.sourceMapper.names.length - 1; - for (nameIndex; nameIndex >= 0; nameIndex--) { - if (this.sourceMapper.names[nameIndex] === name) { - break; - } - } - - if (nameIndex === -1) { - nameIndex = this.sourceMapper.names.length; - this.sourceMapper.names.push(name); - } - } - this.sourceMapper.currentNameIndex.push(nameIndex); - } - }; - - Emitter.prototype.recordSourceMappingNameEnd = function () { - if (this.sourceMapper) { - this.sourceMapper.currentNameIndex.pop(); - } - }; - - Emitter.prototype.recordSourceMappingStart = function (ast) { - if (this.sourceMapper && TypeScript.ASTHelpers.isValidAstNode(ast)) { - var lineCol = { line: -1, character: -1 }; - var sourceMapping = new TypeScript.SourceMapping(); - sourceMapping.start.emittedColumn = this.emitState.column; - sourceMapping.start.emittedLine = this.emitState.line; - - var lineMap = this.document.lineMap(); - lineMap.fillLineAndCharacterFromPosition(ast.start(), lineCol); - sourceMapping.start.sourceColumn = lineCol.character; - sourceMapping.start.sourceLine = lineCol.line + 1; - lineMap.fillLineAndCharacterFromPosition(ast.end(), lineCol); - sourceMapping.end.sourceColumn = lineCol.character; - sourceMapping.end.sourceLine = lineCol.line + 1; - - TypeScript.Debug.assert(!isNaN(sourceMapping.start.emittedColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.emittedLine)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.sourceColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.start.sourceLine)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.sourceColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.sourceLine)); - - if (this.sourceMapper.currentNameIndex.length > 0) { - sourceMapping.nameIndex = this.sourceMapper.currentNameIndex[this.sourceMapper.currentNameIndex.length - 1]; - } - - var siblings = this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length - 1]; - siblings.push(sourceMapping); - this.sourceMapper.currentMappings.push(sourceMapping.childMappings); - this.sourceMapper.increaseMappingLevel(ast); - } - }; - - Emitter.prototype.recordSourceMappingEnd = function (ast) { - if (this.sourceMapper && TypeScript.ASTHelpers.isValidAstNode(ast)) { - this.sourceMapper.currentMappings.pop(); - - var siblings = this.sourceMapper.currentMappings[this.sourceMapper.currentMappings.length - 1]; - var sourceMapping = siblings[siblings.length - 1]; - - sourceMapping.end.emittedColumn = this.emitState.column; - sourceMapping.end.emittedLine = this.emitState.line; - - TypeScript.Debug.assert(!isNaN(sourceMapping.end.emittedColumn)); - TypeScript.Debug.assert(!isNaN(sourceMapping.end.emittedLine)); - - this.sourceMapper.decreaseMappingLevel(ast); - } - }; - - Emitter.prototype.getOutputFiles = function () { - var result = []; - if (this.sourceMapper !== null) { - this.sourceMapper.emitSourceMapping(); - result.push(this.sourceMapper.getOutputFile()); - } - - result.push(this.outfile.getOutputFile()); - return result; - }; - - Emitter.prototype.emitParameterPropertyAndMemberVariableAssignments = function () { - var constructorDecl = getLastConstructor(this.thisClassNode); - - if (constructorDecl) { - for (var i = 0, n = constructorDecl.callSignature.parameterList.parameters.nonSeparatorCount(); i < n; i++) { - var parameter = constructorDecl.callSignature.parameterList.parameters.nonSeparatorAt(i); - var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); - if (TypeScript.hasFlag(parameterDecl.flags, 8388608 /* PropertyParameter */)) { - this.emitIndent(); - this.recordSourceMappingStart(parameter); - this.writeToOutputWithSourceMapRecord("this." + parameter.identifier.text(), parameter.identifier); - this.writeToOutput(" = "); - this.writeToOutputWithSourceMapRecord(parameter.identifier.text(), parameter.identifier); - this.writeLineToOutput(";"); - this.recordSourceMappingEnd(parameter); - } - } - } - - for (var i = 0, n = this.thisClassNode.classElements.childCount(); i < n; i++) { - if (this.thisClassNode.classElements.childAt(i).kind() === 136 /* MemberVariableDeclaration */) { - var varDecl = this.thisClassNode.classElements.childAt(i); - if (!TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause) { - this.emitIndent(); - this.emitMemberVariableDeclaration(varDecl); - this.writeLineToOutput(""); - } - } - } - }; - - Emitter.prototype.isOnSameLine = function (pos1, pos2) { - var lineMap = this.document.lineMap(); - return lineMap.getLineNumberFromPosition(pos1) === lineMap.getLineNumberFromPosition(pos2); - }; - - Emitter.prototype.emitCommaSeparatedList = function (parent, list, buffer, preserveNewLines) { - if (list === null || list.nonSeparatorCount() === 0) { - return; - } - - var startLine = preserveNewLines && !this.isOnSameLine(parent.end(), list.nonSeparatorAt(0).end()); - - if (preserveNewLines) { - this.indenter.increaseIndent(); - } - - if (startLine) { - this.writeLineToOutput(""); - } else { - this.writeToOutput(buffer); - } - - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - var emitNode = list.nonSeparatorAt(i); - - this.emitJavascript(emitNode, startLine); - - if (i < (n - 1)) { - startLine = preserveNewLines && !this.isOnSameLine(emitNode.end(), list.nonSeparatorAt(i + 1).start()); - if (startLine) { - this.writeLineToOutput(","); - } else { - this.writeToOutput(", "); - } - } - } - - if (preserveNewLines) { - this.indenter.decreaseIndent(); - } - - if (preserveNewLines && !this.isOnSameLine(parent.end(), list.nonSeparatorAt(list.nonSeparatorCount() - 1).end())) { - this.writeLineToOutput(""); - this.emitIndent(); - } else { - this.writeToOutput(buffer); - } - }; - - Emitter.prototype.emitList = function (list, useNewLineSeparator, startInclusive, endExclusive) { - if (typeof useNewLineSeparator === "undefined") { useNewLineSeparator = true; } - if (typeof startInclusive === "undefined") { startInclusive = 0; } - if (typeof endExclusive === "undefined") { endExclusive = list.childCount(); } - if (list === null) { - return; - } - - this.emitComments(list, true); - var lastEmittedNode = null; - - for (var i = startInclusive; i < endExclusive; i++) { - var node = list.childAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - if (useNewLineSeparator) { - this.writeLineToOutput(""); - } - - lastEmittedNode = node; - } - } - - this.emitComments(list, false); - }; - - Emitter.prototype.emitSeparatedList = function (list, useNewLineSeparator, startInclusive, endExclusive) { - if (typeof useNewLineSeparator === "undefined") { useNewLineSeparator = true; } - if (typeof startInclusive === "undefined") { startInclusive = 0; } - if (typeof endExclusive === "undefined") { endExclusive = list.nonSeparatorCount(); } - if (list === null) { - return; - } - - this.emitComments(list, true); - var lastEmittedNode = null; - - for (var i = startInclusive; i < endExclusive; i++) { - var node = list.nonSeparatorAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - if (useNewLineSeparator) { - this.writeLineToOutput(""); - } - - lastEmittedNode = node; - } - } - - this.emitComments(list, false); - }; - - Emitter.prototype.isDirectivePrologueElement = function (node) { - if (node.kind() === 149 /* ExpressionStatement */) { - var exprStatement = node; - return exprStatement.expression.kind() === 14 /* StringLiteral */; - } - - return false; - }; - - Emitter.prototype.emitSpaceBetweenConstructs = function (node1, node2) { - if (node1 === null || node2 === null) { - return; - } - - if (node1.start() === -1 || node1.end() === -1 || node2.start() === -1 || node2.end() === -1) { - return; - } - - var lineMap = this.document.lineMap(); - var node1EndLine = lineMap.getLineNumberFromPosition(node1.end()); - var node2StartLine = lineMap.getLineNumberFromPosition(node2.start()); - - if ((node2StartLine - node1EndLine) > 1) { - this.writeLineToOutput("", true); - } - }; - - Emitter.prototype.getDetachedComments = function (element) { - var preComments = element.preComments(); - if (preComments) { - var lineMap = this.document.lineMap(); - - var detachedComments = []; - var lastComment = null; - - for (var i = 0, n = preComments.length; i < n; i++) { - var comment = preComments[i]; - - if (lastComment) { - var lastCommentLine = lineMap.getLineNumberFromPosition(lastComment.end()); - var commentLine = lineMap.getLineNumberFromPosition(comment.start()); - - if (commentLine >= lastCommentLine + 2) { - return detachedComments; - } - } - - detachedComments.push(comment); - lastComment = comment; - } - - var lastCommentLine = lineMap.getLineNumberFromPosition(TypeScript.ArrayUtilities.last(detachedComments).end()); - var astLine = lineMap.getLineNumberFromPosition(element.start()); - if (astLine >= lastCommentLine + 2) { - return detachedComments; - } - } - - return []; - }; - - Emitter.prototype.emitPossibleCopyrightHeaders = function (script) { - this.emitDetachedComments(script.moduleElements); - }; - - Emitter.prototype.emitDetachedComments = function (list) { - if (list.childCount() > 0) { - var firstElement = list.childAt(0); - - this.detachedCommentsElement = firstElement; - this.emitCommentsArray(this.getDetachedComments(this.detachedCommentsElement), false); - } - }; - - Emitter.prototype.emitScriptElements = function (sourceUnit) { - var list = sourceUnit.moduleElements; - - this.emitPossibleCopyrightHeaders(sourceUnit); - - for (var i = 0, n = list.childCount(); i < n; i++) { - var node = list.childAt(i); - - if (!this.isDirectivePrologueElement(node)) { - break; - } - - this.emitJavascript(node, true); - this.writeLineToOutput(""); - } - - this.emitPrologue(sourceUnit); - - var isExternalModule = this.document.isExternalModule(); - var isNonElidedExternalModule = isExternalModule && !TypeScript.ASTHelpers.scriptIsElided(sourceUnit); - if (isNonElidedExternalModule) { - this.recordSourceMappingStart(sourceUnit); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - var dependencyList = "[\"require\", \"exports\""; - var importList = "require, exports"; - - var importAndDependencyList = this.getModuleImportAndDependencyList(sourceUnit); - importList += importAndDependencyList.importList; - dependencyList += importAndDependencyList.dependencyList + "]"; - - this.writeLineToOutput("define(" + dependencyList + "," + " function(" + importList + ") {"); - } - } - - if (isExternalModule) { - var temp = this.setContainer(2 /* DynamicModule */); - - var svModuleName = this.moduleName; - this.moduleName = sourceUnit.fileName(); - if (TypeScript.isTSFile(this.moduleName)) { - this.moduleName = this.moduleName.substring(0, this.moduleName.length - ".ts".length); - } - - this.setExportAssignment(null); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - this.indenter.increaseIndent(); - } - - var externalModule = this.semanticInfoChain.getDeclForAST(this.document.sourceUnit()); - - if (TypeScript.hasFlag(externalModule.flags, 262144 /* MustCaptureThis */)) { - this.writeCaptureThisStatement(sourceUnit); - } - - this.pushDecl(externalModule); - } - - this.emitList(list, true, i, n); - - if (isExternalModule) { - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - this.indenter.decreaseIndent(); - } - - if (isNonElidedExternalModule) { - var exportAssignment = this.getExportAssignment(); - var exportAssignmentIdentifierText = exportAssignment ? exportAssignment.identifier.text() : null; - var exportAssignmentValueSymbol = externalModule.getSymbol().getExportAssignedValueSymbol(); - - if (this.emitOptions.compilationSettings().moduleGenTarget() === 2 /* Asynchronous */) { - if (exportAssignmentIdentifierText && exportAssignmentValueSymbol && !(exportAssignmentValueSymbol.kind & 58720272 /* SomeTypeReference */)) { - this.indenter.increaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("return " + exportAssignmentIdentifierText, exportAssignment); - this.writeLineToOutput(";"); - this.indenter.decreaseIndent(); - } - this.writeToOutput("});"); - } else if (exportAssignmentIdentifierText && exportAssignmentValueSymbol && !(exportAssignmentValueSymbol.kind & 58720272 /* SomeTypeReference */)) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("module.exports = " + exportAssignmentIdentifierText, exportAssignment); - this.writeToOutput(";"); - } - - this.recordSourceMappingEnd(sourceUnit); - this.writeLineToOutput(""); - } - - this.setContainer(temp); - this.moduleName = svModuleName; - this.popDecl(externalModule); - } - }; - - Emitter.prototype.emitConstructorStatements = function (funcDecl) { - var list = funcDecl.block.statements; - - if (list === null) { - return; - } - - this.emitComments(list, true); - - var emitPropertyAssignmentsAfterSuperCall = TypeScript.ASTHelpers.getExtendsHeritageClause(this.thisClassNode.heritageClauses) !== null; - var propertyAssignmentIndex = emitPropertyAssignmentsAfterSuperCall ? 1 : 0; - var lastEmittedNode = null; - - for (var i = 0, n = list.childCount(); i < n; i++) { - if (i === propertyAssignmentIndex) { - this.emitParameterPropertyAndMemberVariableAssignments(); - } - - var node = list.childAt(i); - - if (this.shouldEmit(node)) { - this.emitSpaceBetweenConstructs(lastEmittedNode, node); - - this.emitJavascript(node, true); - this.writeLineToOutput(""); - - lastEmittedNode = node; - } - } - - if (i === propertyAssignmentIndex) { - this.emitParameterPropertyAndMemberVariableAssignments(); - } - - this.emitComments(list, false); - }; - - Emitter.prototype.emitJavascript = function (ast, startLine) { - if (ast === null) { - return; - } - - if (startLine && this.indenter.indentAmt > 0) { - this.emitIndent(); - } - - this.emit(ast); - }; - - Emitter.prototype.emitAccessorMemberDeclaration = function (funcDecl, name, className, isProto) { - if (funcDecl.kind() !== 139 /* GetAccessor */) { - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(funcDecl, this.semanticInfoChain); - if (accessorSymbol.getGetter()) { - return; - } - } - - this.emitIndent(); - this.recordSourceMappingStart(funcDecl); - - this.writeToOutput("Object.defineProperty(" + className); - if (isProto) { - this.writeToOutput(".prototype, "); - } else { - this.writeToOutput(", "); - } - - var functionName = name.text(); - if (TypeScript.isQuoted(functionName)) { - this.writeToOutput(functionName); - } else { - this.writeToOutput('"' + functionName + '"'); - } - - this.writeLineToOutput(", {"); - - this.indenter.increaseIndent(); - - var accessors = TypeScript.PullHelpers.getGetterAndSetterFunction(funcDecl, this.semanticInfoChain); - if (accessors.getter) { - this.emitIndent(); - this.recordSourceMappingStart(accessors.getter); - this.emitComments(accessors.getter, true); - this.writeToOutput("get: "); - this.emitAccessorBody(accessors.getter, accessors.getter.parameterList, accessors.getter.block); - this.writeLineToOutput(","); - } - - if (accessors.setter) { - this.emitIndent(); - this.recordSourceMappingStart(accessors.setter); - this.emitComments(accessors.setter, true); - this.writeToOutput("set: "); - this.emitAccessorBody(accessors.setter, accessors.setter.parameterList, accessors.setter.block); - this.writeLineToOutput(","); - } - - this.emitIndent(); - this.writeLineToOutput("enumerable: true,"); - this.emitIndent(); - this.writeLineToOutput("configurable: true"); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeLineToOutput("});"); - this.recordSourceMappingEnd(funcDecl); - }; - - Emitter.prototype.emitAccessorBody = function (funcDecl, parameterList, block) { - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(null, funcDecl, parameters, block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.recordSourceMappingEnd(funcDecl); - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitClass = function (classDecl) { - var pullDecl = this.semanticInfoChain.getDeclForAST(classDecl); - this.pushDecl(pullDecl); - - var svClassNode = this.thisClassNode; - this.thisClassNode = classDecl; - var className = classDecl.identifier.text(); - this.emitComments(classDecl, true); - var temp = this.setContainer(3 /* Class */); - - this.recordSourceMappingStart(classDecl); - this.writeToOutput("var " + className); - - var hasBaseClass = TypeScript.ASTHelpers.getExtendsHeritageClause(classDecl.heritageClauses) !== null; - var baseTypeReference = null; - var varDecl = null; - - if (hasBaseClass) { - this.writeLineToOutput(" = (function (_super) {"); - } else { - this.writeLineToOutput(" = (function () {"); - } - - this.recordSourceMappingNameStart(className); - this.indenter.increaseIndent(); - - if (hasBaseClass) { - baseTypeReference = TypeScript.ASTHelpers.getExtendsHeritageClause(classDecl.heritageClauses).typeNames.nonSeparatorAt(0); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("__extends(" + className + ", _super)", baseTypeReference); - this.writeLineToOutput(";"); - } - - this.emitIndent(); - - var constrDecl = getLastConstructor(classDecl); - - if (constrDecl) { - this.emit(constrDecl); - this.writeLineToOutput(""); - } else { - this.recordSourceMappingStart(classDecl); - - this.indenter.increaseIndent(); - this.writeLineToOutput("function " + classDecl.identifier.text() + "() {"); - this.recordSourceMappingNameStart("constructor"); - if (hasBaseClass) { - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("_super.apply(this, arguments)", baseTypeReference); - this.writeLineToOutput(";"); - } - - if (this.shouldCaptureThis(classDecl)) { - this.writeCaptureThisStatement(classDecl); - } - - this.emitParameterPropertyAndMemberVariableAssignments(); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", classDecl.closeBraceToken); - this.writeLineToOutput(""); - - this.recordSourceMappingNameEnd(); - this.recordSourceMappingEnd(classDecl); - } - - this.emitClassMembers(classDecl); - - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("return " + className + ";", classDecl.closeBraceToken); - this.writeLineToOutput(""); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutputWithSourceMapRecord("}", classDecl.closeBraceToken); - this.recordSourceMappingNameEnd(); - this.recordSourceMappingStart(classDecl); - this.writeToOutput(")("); - if (hasBaseClass) { - this.emitJavascript(baseTypeReference, false); - } - this.writeToOutput(");"); - this.recordSourceMappingEnd(classDecl); - - if ((temp === 1 /* Module */ || temp === 2 /* DynamicModule */) && TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - this.writeLineToOutput(""); - this.emitIndent(); - var modName = temp === 1 /* Module */ ? this.moduleName : "exports"; - this.writeToOutputWithSourceMapRecord(modName + "." + className + " = " + className + ";", classDecl); - } - - this.recordSourceMappingEnd(classDecl); - this.emitComments(classDecl, false); - this.setContainer(temp); - this.thisClassNode = svClassNode; - - this.popDecl(pullDecl); - }; - - Emitter.prototype.emitClassMembers = function (classDecl) { - var lastEmittedMember = null; - - for (var i = 0, n = classDecl.classElements.childCount(); i < n; i++) { - var memberDecl = classDecl.classElements.childAt(i); - - if (memberDecl.kind() === 139 /* GetAccessor */) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - var getter = memberDecl; - this.emitAccessorMemberDeclaration(getter, getter.propertyName, classDecl.identifier.text(), !TypeScript.hasModifier(getter.modifiers, 16 /* Static */)); - lastEmittedMember = memberDecl; - } else if (memberDecl.kind() === 140 /* SetAccessor */) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - var setter = memberDecl; - this.emitAccessorMemberDeclaration(setter, setter.propertyName, classDecl.identifier.text(), !TypeScript.hasModifier(setter.modifiers, 16 /* Static */)); - lastEmittedMember = memberDecl; - } else if (memberDecl.kind() === 135 /* MemberFunctionDeclaration */) { - var memberFunction = memberDecl; - - if (memberFunction.block) { - this.emitSpaceBetweenConstructs(lastEmittedMember, memberDecl); - - this.emitClassMemberFunctionDeclaration(classDecl, memberFunction); - lastEmittedMember = memberDecl; - } - } - } - - for (var i = 0, n = classDecl.classElements.childCount(); i < n; i++) { - var memberDecl = classDecl.classElements.childAt(i); - - if (memberDecl.kind() === 136 /* MemberVariableDeclaration */) { - var varDecl = memberDecl; - - if (TypeScript.hasModifier(varDecl.modifiers, 16 /* Static */) && varDecl.variableDeclarator.equalsValueClause) { - this.emitSpaceBetweenConstructs(lastEmittedMember, varDecl); - - this.emitIndent(); - this.recordSourceMappingStart(varDecl); - - var varDeclName = varDecl.variableDeclarator.propertyName.text(); - if (TypeScript.isQuoted(varDeclName) || varDecl.variableDeclarator.propertyName.kind() !== 11 /* IdentifierName */) { - this.writeToOutput(classDecl.identifier.text() + "[" + varDeclName + "]"); - } else { - this.writeToOutput(classDecl.identifier.text() + "." + varDeclName); - } - - this.emit(varDecl.variableDeclarator.equalsValueClause); - - this.recordSourceMappingEnd(varDecl); - this.writeLineToOutput(";"); - - lastEmittedMember = varDecl; - } - } - } - }; - - Emitter.prototype.emitClassMemberFunctionDeclaration = function (classDecl, funcDecl) { - this.emitIndent(); - this.recordSourceMappingStart(funcDecl); - this.emitComments(funcDecl, true); - var functionName = funcDecl.propertyName.text(); - - this.writeToOutput(classDecl.identifier.text()); - - if (!TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */)) { - this.writeToOutput(".prototype"); - } - - if (TypeScript.isQuoted(functionName) || funcDecl.propertyName.kind() !== 11 /* IdentifierName */) { - this.writeToOutput("[" + functionName + "] = "); - } else { - this.writeToOutput("." + functionName + " = "); - } - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcDecl); - this.writeToOutput("function "); - - this.emitParameterList(funcDecl.callSignature.parameterList); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList); - this.emitFunctionBodyStatements(funcDecl.propertyName.text(), funcDecl, parameters, funcDecl.block, null); - - this.recordSourceMappingEnd(funcDecl); - - this.emitComments(funcDecl, false); - - this.recordSourceMappingEnd(funcDecl); - this.popDecl(pullDecl); - - this.writeLineToOutput(";"); - }; - - Emitter.prototype.requiresExtendsBlock = function (moduleElements) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - - if (moduleElement.kind() === 130 /* ModuleDeclaration */) { - var moduleAST = moduleElement; - - if (!TypeScript.hasModifier(moduleAST.modifiers, 8 /* Ambient */) && this.requiresExtendsBlock(moduleAST.moduleElements)) { - return true; - } - } else if (moduleElement.kind() === 131 /* ClassDeclaration */) { - var classDeclaration = moduleElement; - - if (!TypeScript.hasModifier(classDeclaration.modifiers, 8 /* Ambient */) && TypeScript.ASTHelpers.getExtendsHeritageClause(classDeclaration.heritageClauses) !== null) { - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitPrologue = function (sourceUnit) { - if (!this.extendsPrologueEmitted) { - if (this.requiresExtendsBlock(sourceUnit.moduleElements)) { - this.extendsPrologueEmitted = true; - this.writeLineToOutput("var __extends = this.__extends || function (d, b) {"); - this.writeLineToOutput(" for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];"); - this.writeLineToOutput(" function __() { this.constructor = d; }"); - this.writeLineToOutput(" __.prototype = b.prototype;"); - this.writeLineToOutput(" d.prototype = new __();"); - this.writeLineToOutput("};"); - } - } - - if (!this.globalThisCapturePrologueEmitted) { - if (this.shouldCaptureThis(sourceUnit)) { - this.globalThisCapturePrologueEmitted = true; - this.writeLineToOutput(this.captureThisStmtString); - } - } - }; - - Emitter.prototype.emitThis = function () { - if (!this.inWithBlock && this.inArrowFunction) { - this.writeToOutput("_this"); - } else { - this.writeToOutput("this"); - } - }; - - Emitter.prototype.emitBlockOrStatement = function (node) { - if (node.kind() === 146 /* Block */) { - this.emit(node); - } else { - this.writeLineToOutput(""); - this.indenter.increaseIndent(); - this.emitJavascript(node, true); - this.indenter.decreaseIndent(); - } - }; - - Emitter.prototype.emitLiteralExpression = function (expression) { - switch (expression.kind()) { - case 32 /* NullKeyword */: - this.writeToOutputWithSourceMapRecord("null", expression); - break; - case 24 /* FalseKeyword */: - this.writeToOutputWithSourceMapRecord("false", expression); - break; - case 37 /* TrueKeyword */: - this.writeToOutputWithSourceMapRecord("true", expression); - break; - default: - throw TypeScript.Errors.abstract(); - } - }; - - Emitter.prototype.emitThisExpression = function (expression) { - if (!this.inWithBlock && this.inArrowFunction) { - this.writeToOutputWithSourceMapRecord("_this", expression); - } else { - this.writeToOutputWithSourceMapRecord("this", expression); - } - }; - - Emitter.prototype.emitSuperExpression = function (expression) { - this.writeToOutputWithSourceMapRecord("_super.prototype", expression); - }; - - Emitter.prototype.emitParenthesizedExpression = function (parenthesizedExpression) { - if (parenthesizedExpression.expression.kind() === 220 /* CastExpression */ && parenthesizedExpression.openParenTrailingComments === null) { - this.emit(parenthesizedExpression.expression); - } else { - this.recordSourceMappingStart(parenthesizedExpression); - this.writeToOutput("("); - this.emitCommentsArray(parenthesizedExpression.openParenTrailingComments, false); - this.emit(parenthesizedExpression.expression); - this.writeToOutput(")"); - this.recordSourceMappingEnd(parenthesizedExpression); - } - }; - - Emitter.prototype.emitCastExpression = function (expression) { - this.emit(expression.expression); - }; - - Emitter.prototype.emitPrefixUnaryExpression = function (expression) { - var nodeType = expression.kind(); - - this.recordSourceMappingStart(expression); - switch (nodeType) { - case 167 /* LogicalNotExpression */: - this.writeToOutput("!"); - this.emit(expression.operand); - break; - case 166 /* BitwiseNotExpression */: - this.writeToOutput("~"); - this.emit(expression.operand); - break; - case 165 /* NegateExpression */: - this.writeToOutput("-"); - if (expression.operand.kind() === 165 /* NegateExpression */ || expression.operand.kind() === 169 /* PreDecrementExpression */) { - this.writeToOutput(" "); - } - this.emit(expression.operand); - break; - case 164 /* PlusExpression */: - this.writeToOutput("+"); - if (expression.operand.kind() === 164 /* PlusExpression */ || expression.operand.kind() === 168 /* PreIncrementExpression */) { - this.writeToOutput(" "); - } - this.emit(expression.operand); - break; - case 168 /* PreIncrementExpression */: - this.writeToOutput("++"); - this.emit(expression.operand); - break; - case 169 /* PreDecrementExpression */: - this.writeToOutput("--"); - this.emit(expression.operand); - break; - default: - throw TypeScript.Errors.abstract(); - } - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitPostfixUnaryExpression = function (expression) { - var nodeType = expression.kind(); - - this.recordSourceMappingStart(expression); - switch (nodeType) { - case 210 /* PostIncrementExpression */: - this.emit(expression.operand); - this.writeToOutput("++"); - break; - case 211 /* PostDecrementExpression */: - this.emit(expression.operand); - this.writeToOutput("--"); - break; - default: - throw TypeScript.Errors.abstract(); - } - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitTypeOfExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("typeof "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitDeleteExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("delete "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitVoidExpression = function (expression) { - this.recordSourceMappingStart(expression); - this.writeToOutput("void "); - this.emit(expression.expression); - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.canEmitDottedNameMemberAccessExpression = function (expression) { - var memberExpressionNodeType = expression.expression.kind(); - - if (memberExpressionNodeType === 11 /* IdentifierName */ || memberExpressionNodeType == 212 /* MemberAccessExpression */) { - var memberAccessSymbol = this.getSymbolForEmit(expression).symbol; - var memberAccessExpressionSymbol = this.getSymbolForEmit(expression.expression).symbol; - if (memberAccessSymbol && memberAccessExpressionSymbol && !this.semanticInfoChain.getAliasSymbolForAST(expression.expression) && (TypeScript.PullHelpers.symbolIsModule(memberAccessExpressionSymbol) || memberAccessExpressionSymbol.kind === 64 /* Enum */ || memberAccessExpressionSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */))) { - var memberAccessSymbolKind = memberAccessSymbol.kind; - if (memberAccessSymbolKind === 4096 /* Property */ || memberAccessSymbolKind === 67108864 /* EnumMember */ || (memberAccessSymbol.anyDeclHasFlag(1 /* Exported */) && memberAccessSymbolKind === 512 /* Variable */ && !memberAccessSymbol.anyDeclHasFlag(32768 /* InitializedModule */ | 4096 /* Enum */)) || ((memberAccessSymbol.anyDeclHasFlag(1 /* Exported */) && !this.symbolIsUsedInItsEnclosingContainer(memberAccessSymbol)))) { - if (memberExpressionNodeType === 212 /* MemberAccessExpression */) { - return this.canEmitDottedNameMemberAccessExpression(expression.expression); - } - - return true; - } - } - } - - return false; - }; - - Emitter.prototype.emitDottedNameMemberAccessExpressionWorker = function (expression, potentialPath, startingIndex, lastIndex) { - this.recordSourceMappingStart(expression); - if (expression.expression.kind() === 212 /* MemberAccessExpression */) { - this.emitDottedNameMemberAccessExpressionRecurse(expression.expression, potentialPath, startingIndex, lastIndex - 1); - } else { - this.emitComments(expression.expression, true); - this.recordSourceMappingStart(expression.expression); - - this.emitDottedNameFromDeclPath(potentialPath, startingIndex, lastIndex - 2); - - this.writeToOutput(expression.expression.text()); - - this.recordSourceMappingEnd(expression.expression); - this.emitComments(expression.expression, false); - } - - this.writeToOutput("."); - this.emitName(expression.name, false); - - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitDottedNameMemberAccessExpressionRecurse = function (expression, potentialPath, startingIndex, lastIndex) { - this.emitComments(expression, true); - - if (lastIndex - startingIndex < 1) { - startingIndex = lastIndex - 1; - TypeScript.Debug.assert(startingIndex >= 0); - } - - this.emitDottedNameMemberAccessExpressionWorker(expression, potentialPath, startingIndex, lastIndex); - this.emitComments(expression, false); - }; - - Emitter.prototype.emitDottedNameMemberAccessExpression = function (expression) { - var memberAccessSymbol = this.getSymbolForEmit(expression).symbol; - - var potentialDeclInfo = this.getPotentialDeclPathInfoForEmit(memberAccessSymbol); - this.emitDottedNameMemberAccessExpressionWorker(expression, potentialDeclInfo.potentialPath, potentialDeclInfo.startingIndex, potentialDeclInfo.potentialPath.length); - }; - - Emitter.prototype.emitMemberAccessExpression = function (expression) { - if (!this.tryEmitConstant(expression)) { - if (this.canEmitDottedNameMemberAccessExpression(expression)) { - this.emitDottedNameMemberAccessExpression(expression); - } else { - this.recordSourceMappingStart(expression); - this.emit(expression.expression); - this.writeToOutput("."); - this.emitName(expression.name, false); - this.recordSourceMappingEnd(expression); - } - } - }; - - Emitter.prototype.emitQualifiedName = function (name) { - this.recordSourceMappingStart(name); - - this.emit(name.left); - this.writeToOutput("."); - this.emitName(name.right, false); - - this.recordSourceMappingEnd(name); - }; - - Emitter.prototype.emitBinaryExpression = function (expression) { - this.recordSourceMappingStart(expression); - switch (expression.kind()) { - case 173 /* CommaExpression */: - this.emit(expression.left); - this.writeToOutput(", "); - this.emit(expression.right); - break; - default: { - this.emit(expression.left); - var binOp = TypeScript.SyntaxFacts.getText(TypeScript.SyntaxFacts.getOperatorTokenFromBinaryExpression(expression.kind())); - if (binOp === "instanceof") { - this.writeToOutput(" instanceof "); - } else if (binOp === "in") { - this.writeToOutput(" in "); - } else { - this.writeToOutput(" " + binOp + " "); - } - this.emit(expression.right); - } - } - this.recordSourceMappingEnd(expression); - }; - - Emitter.prototype.emitSimplePropertyAssignment = function (property) { - this.recordSourceMappingStart(property); - this.emit(property.propertyName); - this.writeToOutput(": "); - this.emit(property.expression); - this.recordSourceMappingEnd(property); - }; - - Emitter.prototype.emitFunctionPropertyAssignment = function (funcProp) { - this.recordSourceMappingStart(funcProp); - - this.emit(funcProp.propertyName); - this.writeToOutput(": "); - - var pullFunctionDecl = this.semanticInfoChain.getDeclForAST(funcProp); - - var savedInArrowFunction = this.inArrowFunction; - this.inArrowFunction = false; - - var temp = this.setContainer(5 /* Function */); - var funcName = funcProp.propertyName; - - var pullDecl = this.semanticInfoChain.getDeclForAST(funcProp); - this.pushDecl(pullDecl); - - this.recordSourceMappingStart(funcProp); - this.writeToOutput("function "); - - this.writeToOutput("("); - - var parameters = TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList); - this.emitFunctionParameters(parameters); - this.writeToOutput(")"); - - this.emitFunctionBodyStatements(funcProp.propertyName.text(), funcProp, parameters, funcProp.block, null); - - this.recordSourceMappingEnd(funcProp); - - this.recordSourceMappingEnd(funcProp); - - this.emitComments(funcProp, false); - - this.popDecl(pullDecl); - - this.setContainer(temp); - this.inArrowFunction = savedInArrowFunction; - }; - - Emitter.prototype.emitConditionalExpression = function (expression) { - this.emit(expression.condition); - this.writeToOutput(" ? "); - this.emit(expression.whenTrue); - this.writeToOutput(" : "); - this.emit(expression.whenFalse); - }; - - Emitter.prototype.emitThrowStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("throw "); - this.emit(statement.expression); - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitExpressionStatement = function (statement) { - var isArrowExpression = statement.expression.kind() === 219 /* SimpleArrowFunctionExpression */ || statement.expression.kind() === 218 /* ParenthesizedArrowFunctionExpression */; - - this.recordSourceMappingStart(statement); - if (isArrowExpression) { - this.writeToOutput("("); - } - - this.emit(statement.expression); - - if (isArrowExpression) { - this.writeToOutput(")"); - } - - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitLabeledStatement = function (statement) { - this.writeToOutputWithSourceMapRecord(statement.identifier.text(), statement.identifier); - this.writeLineToOutput(":"); - this.emitJavascript(statement.statement, true); - }; - - Emitter.prototype.emitBlock = function (block) { - this.recordSourceMappingStart(block); - this.writeLineToOutput(" {"); - this.indenter.increaseIndent(); - if (block.statements) { - this.emitList(block.statements); - } - this.emitCommentsArray(block.closeBraceLeadingComments, false); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutput("}"); - this.recordSourceMappingEnd(block); - }; - - Emitter.prototype.emitBreakStatement = function (jump) { - this.recordSourceMappingStart(jump); - this.writeToOutput("break"); - - if (jump.identifier) { - this.writeToOutput(" " + jump.identifier.text()); - } - - this.recordSourceMappingEnd(jump); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitContinueStatement = function (jump) { - this.recordSourceMappingStart(jump); - this.writeToOutput("continue"); - - if (jump.identifier) { - this.writeToOutput(" " + jump.identifier.text()); - } - - this.recordSourceMappingEnd(jump); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitWhileStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("while ("); - this.emit(statement.condition); - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitDoStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("do"); - this.emitBlockOrStatement(statement.statement); - this.writeToOutputWithSourceMapRecord(" while", statement.whileKeyword); - this.writeToOutput('('); - this.emit(statement.condition); - this.writeToOutput(")"); - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitIfStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("if ("); - this.emit(statement.condition); - this.writeToOutput(")"); - - this.emitBlockOrStatement(statement.statement); - - if (statement.elseClause) { - if (statement.statement.kind() !== 146 /* Block */) { - this.writeLineToOutput(""); - this.emitIndent(); - } else { - this.writeToOutput(" "); - } - - this.emit(statement.elseClause); - } - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitElseClause = function (elseClause) { - if (elseClause.statement.kind() === 147 /* IfStatement */) { - this.writeToOutput("else "); - this.emit(elseClause.statement); - } else { - this.writeToOutput("else"); - this.emitBlockOrStatement(elseClause.statement); - } - }; - - Emitter.prototype.emitReturnStatement = function (statement) { - this.recordSourceMappingStart(statement); - if (statement.expression) { - this.writeToOutput("return "); - this.emit(statement.expression); - } else { - this.writeToOutput("return"); - } - this.recordSourceMappingEnd(statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitForInStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("for ("); - if (statement.left) { - this.emit(statement.left); - } else { - this.emit(statement.variableDeclaration); - } - this.writeToOutput(" in "); - this.emit(statement.expression); - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitForStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("for ("); - if (statement.variableDeclaration) { - this.emit(statement.variableDeclaration); - } else if (statement.initializer) { - this.emit(statement.initializer); - } - - this.writeToOutput("; "); - this.emitJavascript(statement.condition, false); - this.writeToOutput(";"); - if (statement.incrementor) { - this.writeToOutput(" "); - this.emitJavascript(statement.incrementor, false); - } - this.writeToOutput(")"); - this.emitBlockOrStatement(statement.statement); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitWithStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("with ("); - if (statement.condition) { - this.emit(statement.condition); - } - - this.writeToOutput(")"); - var prevInWithBlock = this.inWithBlock; - this.inWithBlock = true; - this.emitBlockOrStatement(statement.statement); - this.inWithBlock = prevInWithBlock; - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitSwitchStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("switch ("); - this.emit(statement.expression); - this.recordSourceMappingStart(statement.closeParenToken); - this.writeToOutput(")"); - this.recordSourceMappingEnd(statement.closeParenToken); - this.writeLineToOutput(" {"); - this.indenter.increaseIndent(); - this.emitList(statement.switchClauses, false); - this.indenter.decreaseIndent(); - this.emitIndent(); - this.writeToOutput("}"); - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitCaseSwitchClause = function (clause) { - this.recordSourceMappingStart(clause); - this.writeToOutput("case "); - this.emit(clause.expression); - this.writeToOutput(":"); - - this.emitSwitchClauseBody(clause.statements); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitSwitchClauseBody = function (body) { - if (body.childCount() === 1 && body.childAt(0).kind() === 146 /* Block */) { - this.emit(body.childAt(0)); - this.writeLineToOutput(""); - } else { - this.writeLineToOutput(""); - this.indenter.increaseIndent(); - this.emit(body); - this.indenter.decreaseIndent(); - } - }; - - Emitter.prototype.emitDefaultSwitchClause = function (clause) { - this.recordSourceMappingStart(clause); - this.writeToOutput("default:"); - - this.emitSwitchClauseBody(clause.statements); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitTryStatement = function (statement) { - this.recordSourceMappingStart(statement); - this.writeToOutput("try "); - this.emit(statement.block); - this.emitJavascript(statement.catchClause, false); - - if (statement.finallyClause) { - this.emit(statement.finallyClause); - } - this.recordSourceMappingEnd(statement); - }; - - Emitter.prototype.emitCatchClause = function (clause) { - this.writeToOutput(" "); - this.recordSourceMappingStart(clause); - this.writeToOutput("catch ("); - this.emit(clause.identifier); - this.writeToOutput(")"); - this.emit(clause.block); - this.recordSourceMappingEnd(clause); - }; - - Emitter.prototype.emitFinallyClause = function (clause) { - this.writeToOutput(" finally"); - this.emit(clause.block); - }; - - Emitter.prototype.emitDebuggerStatement = function (statement) { - this.writeToOutputWithSourceMapRecord("debugger", statement); - this.writeToOutput(";"); - }; - - Emitter.prototype.emitNumericLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitRegularExpressionLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitStringLiteral = function (literal) { - this.writeToOutputWithSourceMapRecord(literal.text(), literal); - }; - - Emitter.prototype.emitEqualsValueClause = function (clause) { - this.writeToOutput(" = "); - this.emit(clause.value); - }; - - Emitter.prototype.emitParameter = function (parameter) { - this.writeToOutputWithSourceMapRecord(parameter.identifier.text(), parameter); - }; - - Emitter.prototype.emitConstructorDeclaration = function (declaration) { - if (declaration.block) { - this.emitConstructor(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitFunctionDeclaration = function (declaration) { - return declaration.preComments() !== null || (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) && declaration.block !== null); - }; - - Emitter.prototype.emitFunctionDeclaration = function (declaration) { - if (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */) && declaration.block !== null) { - this.emitFunction(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.emitSourceUnit = function (sourceUnit) { - if (!this.document.isDeclareFile()) { - var pullDecl = this.semanticInfoChain.getDeclForAST(sourceUnit); - this.pushDecl(pullDecl); - this.emitScriptElements(sourceUnit); - this.popDecl(pullDecl); - - this.emitCommentsArray(sourceUnit.endOfFileTokenLeadingComments, false); - } - }; - - Emitter.prototype.shouldEmitEnumDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.ASTHelpers.enumIsElided(declaration); - }; - - Emitter.prototype.emitEnumDeclaration = function (declaration) { - if (!TypeScript.ASTHelpers.enumIsElided(declaration)) { - this.emitComments(declaration, true); - this.emitEnum(declaration); - this.emitComments(declaration, false); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitModuleDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.ASTHelpers.moduleIsElided(declaration); - }; - - Emitter.prototype.emitModuleDeclaration = function (declaration) { - if (!TypeScript.ASTHelpers.moduleIsElided(declaration)) { - this.emitModuleDeclarationWorker(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitClassDeclaration = function (declaration) { - return declaration.preComments() !== null || !TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */); - }; - - Emitter.prototype.emitClassDeclaration = function (declaration) { - if (!TypeScript.hasModifier(declaration.modifiers, 8 /* Ambient */)) { - this.emitClass(declaration); - } else { - this.emitComments(declaration, true, true); - } - }; - - Emitter.prototype.shouldEmitInterfaceDeclaration = function (declaration) { - return declaration.preComments() !== null; - }; - - Emitter.prototype.emitInterfaceDeclaration = function (declaration) { - this.emitComments(declaration, true, true); - }; - - Emitter.prototype.firstVariableDeclarator = function (statement) { - return statement.declaration.declarators.nonSeparatorAt(0); - }; - - Emitter.prototype.isNotAmbientOrHasInitializer = function (variableStatement) { - return !TypeScript.hasModifier(variableStatement.modifiers, 8 /* Ambient */) || this.firstVariableDeclarator(variableStatement).equalsValueClause !== null; - }; - - Emitter.prototype.shouldEmitVariableStatement = function (statement) { - return statement.preComments() !== null || this.isNotAmbientOrHasInitializer(statement); - }; - - Emitter.prototype.emitVariableStatement = function (statement) { - if (this.isNotAmbientOrHasInitializer(statement)) { - this.emitComments(statement, true); - this.emit(statement.declaration); - this.writeToOutput(";"); - this.emitComments(statement, false); - } else { - this.emitComments(statement, true, true); - } - }; - - Emitter.prototype.emitGenericType = function (type) { - this.emit(type.name); - }; - - Emitter.prototype.shouldEmit = function (ast) { - if (!ast) { - return false; - } - - switch (ast.kind()) { - case 133 /* ImportDeclaration */: - return this.shouldEmitImportDeclaration(ast); - case 131 /* ClassDeclaration */: - return this.shouldEmitClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.shouldEmitInterfaceDeclaration(ast); - case 129 /* FunctionDeclaration */: - return this.shouldEmitFunctionDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.shouldEmitModuleDeclaration(ast); - case 148 /* VariableStatement */: - return this.shouldEmitVariableStatement(ast); - case 223 /* OmittedExpression */: - return false; - case 132 /* EnumDeclaration */: - return this.shouldEmitEnumDeclaration(ast); - } - - return true; - }; - - Emitter.prototype.emit = function (ast) { - if (!ast) { - return; - } - - switch (ast.kind()) { - case 2 /* SeparatedList */: - return this.emitSeparatedList(ast); - case 1 /* List */: - return this.emitList(ast); - case 120 /* SourceUnit */: - return this.emitSourceUnit(ast); - case 133 /* ImportDeclaration */: - return this.emitImportDeclaration(ast); - case 134 /* ExportAssignment */: - return this.setExportAssignment(ast); - case 131 /* ClassDeclaration */: - return this.emitClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.emitInterfaceDeclaration(ast); - case 11 /* IdentifierName */: - return this.emitName(ast, true); - case 225 /* VariableDeclarator */: - return this.emitVariableDeclarator(ast); - case 219 /* SimpleArrowFunctionExpression */: - return this.emitSimpleArrowFunctionExpression(ast); - case 218 /* ParenthesizedArrowFunctionExpression */: - return this.emitParenthesizedArrowFunctionExpression(ast); - case 129 /* FunctionDeclaration */: - return this.emitFunctionDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.emitModuleDeclaration(ast); - case 224 /* VariableDeclaration */: - return this.emitVariableDeclaration(ast); - case 126 /* GenericType */: - return this.emitGenericType(ast); - case 137 /* ConstructorDeclaration */: - return this.emitConstructorDeclaration(ast); - case 132 /* EnumDeclaration */: - return this.emitEnumDeclaration(ast); - case 243 /* EnumElement */: - return this.emitEnumElement(ast); - case 222 /* FunctionExpression */: - return this.emitFunctionExpression(ast); - case 148 /* VariableStatement */: - return this.emitVariableStatement(ast); - } - - this.emitComments(ast, true); - this.emitWorker(ast); - this.emitComments(ast, false); - }; - - Emitter.prototype.emitWorker = function (ast) { - if (!ast) { - return; - } - - switch (ast.kind()) { - case 13 /* NumericLiteral */: - return this.emitNumericLiteral(ast); - case 12 /* RegularExpressionLiteral */: - return this.emitRegularExpressionLiteral(ast); - case 14 /* StringLiteral */: - return this.emitStringLiteral(ast); - case 24 /* FalseKeyword */: - case 32 /* NullKeyword */: - case 37 /* TrueKeyword */: - return this.emitLiteralExpression(ast); - case 35 /* ThisKeyword */: - return this.emitThisExpression(ast); - case 50 /* SuperKeyword */: - return this.emitSuperExpression(ast); - case 217 /* ParenthesizedExpression */: - return this.emitParenthesizedExpression(ast); - case 214 /* ArrayLiteralExpression */: - return this.emitArrayLiteralExpression(ast); - case 211 /* PostDecrementExpression */: - case 210 /* PostIncrementExpression */: - return this.emitPostfixUnaryExpression(ast); - case 167 /* LogicalNotExpression */: - case 166 /* BitwiseNotExpression */: - case 165 /* NegateExpression */: - case 164 /* PlusExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return this.emitPrefixUnaryExpression(ast); - case 213 /* InvocationExpression */: - return this.emitInvocationExpression(ast); - case 221 /* ElementAccessExpression */: - return this.emitElementAccessExpression(ast); - case 212 /* MemberAccessExpression */: - return this.emitMemberAccessExpression(ast); - case 121 /* QualifiedName */: - return this.emitQualifiedName(ast); - case 173 /* CommaExpression */: - case 174 /* AssignmentExpression */: - case 175 /* AddAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 187 /* LogicalOrExpression */: - case 188 /* LogicalAndExpression */: - case 189 /* BitwiseOrExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 191 /* BitwiseAndExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 193 /* NotEqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 197 /* GreaterThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 200 /* InstanceOfExpression */: - case 201 /* InExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 208 /* AddExpression */: - case 209 /* SubtractExpression */: - return this.emitBinaryExpression(ast); - case 186 /* ConditionalExpression */: - return this.emitConditionalExpression(ast); - case 232 /* EqualsValueClause */: - return this.emitEqualsValueClause(ast); - case 242 /* Parameter */: - return this.emitParameter(ast); - case 146 /* Block */: - return this.emitBlock(ast); - case 235 /* ElseClause */: - return this.emitElseClause(ast); - case 147 /* IfStatement */: - return this.emitIfStatement(ast); - case 149 /* ExpressionStatement */: - return this.emitExpressionStatement(ast); - case 139 /* GetAccessor */: - return this.emitGetAccessor(ast); - case 140 /* SetAccessor */: - return this.emitSetAccessor(ast); - case 157 /* ThrowStatement */: - return this.emitThrowStatement(ast); - case 150 /* ReturnStatement */: - return this.emitReturnStatement(ast); - case 216 /* ObjectCreationExpression */: - return this.emitObjectCreationExpression(ast); - case 151 /* SwitchStatement */: - return this.emitSwitchStatement(ast); - case 233 /* CaseSwitchClause */: - return this.emitCaseSwitchClause(ast); - case 234 /* DefaultSwitchClause */: - return this.emitDefaultSwitchClause(ast); - case 152 /* BreakStatement */: - return this.emitBreakStatement(ast); - case 153 /* ContinueStatement */: - return this.emitContinueStatement(ast); - case 154 /* ForStatement */: - return this.emitForStatement(ast); - case 155 /* ForInStatement */: - return this.emitForInStatement(ast); - case 158 /* WhileStatement */: - return this.emitWhileStatement(ast); - case 163 /* WithStatement */: - return this.emitWithStatement(ast); - case 220 /* CastExpression */: - return this.emitCastExpression(ast); - case 215 /* ObjectLiteralExpression */: - return this.emitObjectLiteralExpression(ast); - case 240 /* SimplePropertyAssignment */: - return this.emitSimplePropertyAssignment(ast); - case 241 /* FunctionPropertyAssignment */: - return this.emitFunctionPropertyAssignment(ast); - case 156 /* EmptyStatement */: - return this.writeToOutputWithSourceMapRecord(";", ast); - case 159 /* TryStatement */: - return this.emitTryStatement(ast); - case 236 /* CatchClause */: - return this.emitCatchClause(ast); - case 237 /* FinallyClause */: - return this.emitFinallyClause(ast); - case 160 /* LabeledStatement */: - return this.emitLabeledStatement(ast); - case 161 /* DoStatement */: - return this.emitDoStatement(ast); - case 171 /* TypeOfExpression */: - return this.emitTypeOfExpression(ast); - case 170 /* DeleteExpression */: - return this.emitDeleteExpression(ast); - case 172 /* VoidExpression */: - return this.emitVoidExpression(ast); - case 162 /* DebuggerStatement */: - return this.emitDebuggerStatement(ast); - } - }; - return Emitter; - })(); - TypeScript.Emitter = Emitter; - - function getLastConstructor(classDecl) { - return classDecl.classElements.lastOrDefault(function (e) { - return e.kind() === 137 /* ConstructorDeclaration */; - }); - } - TypeScript.getLastConstructor = getLastConstructor; - - function getTrimmedTextLines(comment) { - if (comment.kind() === 6 /* MultiLineCommentTrivia */) { - return comment.fullText().split("\n").map(function (s) { - return s.trim(); - }); - } else { - return [comment.fullText().trim()]; - } - } - TypeScript.getTrimmedTextLines = getTrimmedTextLines; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var MemberName = (function () { - function MemberName() { - this.prefix = ""; - this.suffix = ""; - } - MemberName.prototype.isString = function () { - return false; - }; - MemberName.prototype.isArray = function () { - return false; - }; - MemberName.prototype.isMarker = function () { - return !this.isString() && !this.isArray(); - }; - - MemberName.prototype.toString = function () { - return MemberName.memberNameToString(this); - }; - - MemberName.memberNameToString = function (memberName, markerInfo, markerBaseLength) { - if (typeof markerBaseLength === "undefined") { markerBaseLength = 0; } - var result = memberName.prefix; - - if (memberName.isString()) { - result += memberName.text; - } else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - if (ar.entries[index].isMarker()) { - if (markerInfo) { - markerInfo.push(markerBaseLength + result.length); - } - continue; - } - - result += MemberName.memberNameToString(ar.entries[index], markerInfo, markerBaseLength + result.length); - result += ar.delim; - } - } - - result += memberName.suffix; - return result; - }; - - MemberName.create = function (arg1, arg2, arg3) { - if (typeof arg1 === "string") { - return new MemberNameString(arg1); - } else { - var result = new MemberNameArray(); - if (arg2) - result.prefix = arg2; - if (arg3) - result.suffix = arg3; - result.entries.push(arg1); - return result; - } - }; - return MemberName; - })(); - TypeScript.MemberName = MemberName; - - var MemberNameString = (function (_super) { - __extends(MemberNameString, _super); - function MemberNameString(text) { - _super.call(this); - this.text = text; - } - MemberNameString.prototype.isString = function () { - return true; - }; - return MemberNameString; - })(MemberName); - TypeScript.MemberNameString = MemberNameString; - - var MemberNameArray = (function (_super) { - __extends(MemberNameArray, _super); - function MemberNameArray() { - _super.call(this); - this.delim = ""; - this.entries = []; - } - MemberNameArray.prototype.isArray = function () { - return true; - }; - - MemberNameArray.prototype.add = function (entry) { - this.entries.push(entry); - }; - - MemberNameArray.prototype.addAll = function (entries) { - for (var i = 0; i < entries.length; i++) { - this.entries.push(entries[i]); - } - }; - return MemberNameArray; - })(MemberName); - TypeScript.MemberNameArray = MemberNameArray; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - function stripStartAndEndQuotes(str) { - var firstCharCode = str && str.charCodeAt(0); - if (str && str.length >= 2 && firstCharCode === str.charCodeAt(str.length - 1) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - return str.substring(1, str.length - 1); - } - - return str; - } - TypeScript.stripStartAndEndQuotes = stripStartAndEndQuotes; - - function isSingleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 39 /* singleQuote */; - } - TypeScript.isSingleQuoted = isSingleQuoted; - - function isDoubleQuoted(str) { - return str && str.length >= 2 && str.charCodeAt(0) === str.charCodeAt(str.length - 1) && str.charCodeAt(0) === 34 /* doubleQuote */; - } - TypeScript.isDoubleQuoted = isDoubleQuoted; - - function isQuoted(str) { - return isDoubleQuoted(str) || isSingleQuoted(str); - } - TypeScript.isQuoted = isQuoted; - - function quoteStr(str) { - return "\"" + str + "\""; - } - TypeScript.quoteStr = quoteStr; - - var switchToForwardSlashesRegEx = /\\/g; - function switchToForwardSlashes(path) { - return path.replace(switchToForwardSlashesRegEx, "/"); - } - TypeScript.switchToForwardSlashes = switchToForwardSlashes; - - function trimModName(modName) { - if (modName.length > 5 && modName.substring(modName.length - 5, modName.length) === ".d.ts") { - return modName.substring(0, modName.length - 5); - } - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".ts") { - return modName.substring(0, modName.length - 3); - } - - if (modName.length > 3 && modName.substring(modName.length - 3, modName.length) === ".js") { - return modName.substring(0, modName.length - 3); - } - - return modName; - } - TypeScript.trimModName = trimModName; - - function getDeclareFilePath(fname) { - return isTSFile(fname) ? changePathToDTS(fname) : changePathToDTS(fname); - } - TypeScript.getDeclareFilePath = getDeclareFilePath; - - function isFileOfExtension(fname, ext) { - var invariantFname = fname.toLocaleUpperCase(); - var invariantExt = ext.toLocaleUpperCase(); - var extLength = invariantExt.length; - return invariantFname.length > extLength && invariantFname.substring(invariantFname.length - extLength, invariantFname.length) === invariantExt; - } - - function isTSFile(fname) { - return isFileOfExtension(fname, ".ts"); - } - TypeScript.isTSFile = isTSFile; - - function isDTSFile(fname) { - return isFileOfExtension(fname, ".d.ts"); - } - TypeScript.isDTSFile = isDTSFile; - - function getPrettyName(modPath, quote, treatAsFileName) { - if (typeof quote === "undefined") { quote = true; } - if (typeof treatAsFileName === "undefined") { treatAsFileName = false; } - var modName = treatAsFileName ? switchToForwardSlashes(modPath) : trimModName(stripStartAndEndQuotes(modPath)); - var components = this.getPathComponents(modName); - return components.length ? (quote ? quoteStr(components[components.length - 1]) : components[components.length - 1]) : modPath; - } - TypeScript.getPrettyName = getPrettyName; - - function getPathComponents(path) { - return path.split("/"); - } - TypeScript.getPathComponents = getPathComponents; - - function getRelativePathToFixedPath(fixedModFilePath, absoluteModPath, isAbsoultePathURL) { - if (typeof isAbsoultePathURL === "undefined") { isAbsoultePathURL = true; } - absoluteModPath = switchToForwardSlashes(absoluteModPath); - - var modComponents = this.getPathComponents(absoluteModPath); - var fixedModComponents = this.getPathComponents(fixedModFilePath); - - var joinStartIndex = 0; - for (; joinStartIndex < modComponents.length && joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== modComponents[joinStartIndex]) { - break; - } - } - - if (joinStartIndex !== 0) { - var relativePath = ""; - var relativePathComponents = modComponents.slice(joinStartIndex, modComponents.length); - for (; joinStartIndex < fixedModComponents.length; joinStartIndex++) { - if (fixedModComponents[joinStartIndex] !== "") { - relativePath = relativePath + "../"; - } - } - - return relativePath + relativePathComponents.join("/"); - } - - if (isAbsoultePathURL && absoluteModPath.indexOf("://") === -1) { - absoluteModPath = "file:///" + absoluteModPath; - } - - return absoluteModPath; - } - TypeScript.getRelativePathToFixedPath = getRelativePathToFixedPath; - - function changePathToDTS(modPath) { - return trimModName(stripStartAndEndQuotes(modPath)) + ".d.ts"; - } - TypeScript.changePathToDTS = changePathToDTS; - - function isRelative(path) { - return path.length > 0 && path.charAt(0) === "."; - } - TypeScript.isRelative = isRelative; - function isRooted(path) { - return path.length > 0 && (path.charAt(0) === "\\" || path.charAt(0) === "/" || (path.indexOf(":\\") !== -1) || (path.indexOf(":/") !== -1)); - } - TypeScript.isRooted = isRooted; - - function getRootFilePath(outFname) { - if (outFname === "") { - return outFname; - } else { - var isPath = outFname.indexOf("/") !== -1; - return isPath ? filePath(outFname) : ""; - } - } - TypeScript.getRootFilePath = getRootFilePath; - - function filePathComponents(fullPath) { - fullPath = switchToForwardSlashes(fullPath); - var components = getPathComponents(fullPath); - return components.slice(0, components.length - 1); - } - TypeScript.filePathComponents = filePathComponents; - - function filePath(fullPath) { - var path = filePathComponents(fullPath); - return path.join("/") + "/"; - } - TypeScript.filePath = filePath; - - function convertToDirectoryPath(dirPath) { - if (dirPath && dirPath.charAt(dirPath.length - 1) !== "/") { - dirPath += "/"; - } - - return dirPath; - } - TypeScript.convertToDirectoryPath = convertToDirectoryPath; - - var normalizePathRegEx = /^\\\\[^\\]/; - function normalizePath(path) { - if (normalizePathRegEx.test(path)) { - path = "file:" + path; - } - var parts = this.getPathComponents(switchToForwardSlashes(path)); - var normalizedParts = []; - - for (var i = 0; i < parts.length; i++) { - var part = parts[i]; - if (part === ".") { - continue; - } - - if (normalizedParts.length > 0 && TypeScript.ArrayUtilities.last(normalizedParts) !== ".." && part === "..") { - normalizedParts.pop(); - continue; - } - - normalizedParts.push(part); - } - - return normalizedParts.join("/"); - } - TypeScript.normalizePath = normalizePath; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - - - function isNoDefaultLibMatch(comment) { - var isNoDefaultLibRegex = /^(\/\/\/\s*/gim; - return isNoDefaultLibRegex.exec(comment); - } - - TypeScript.tripleSlashReferenceRegExp = /^(\/\/\/\s*/; - - function getFileReferenceFromReferencePath(fileName, lineMap, position, comment, diagnostics) { - var simpleReferenceRegEx = /^\/\/\/\s*= 7 && fullReference[6] === "true"; - if (isResident) { - TypeScript.CompilerDiagnostics.debugPrint(path + " is resident"); - } - return { - line: 0, - character: 0, - position: 0, - length: 0, - path: TypeScript.switchToForwardSlashes(adjustedPath), - isResident: isResident - }; - } - } - } - - return null; - } - - var scannerWindow = TypeScript.ArrayUtilities.createArray(2048, 0); - var scannerDiagnostics = []; - - function processImports(lineMap, scanner, token, importedFiles) { - var position = 0; - var lineChar = { line: -1, character: -1 }; - - var start = new Date().getTime(); - - while (token.tokenKind !== 10 /* EndOfFileToken */) { - if (token.tokenKind === 49 /* ImportKeyword */) { - var importStart = position + token.leadingTriviaWidth(); - token = scanner.scan(scannerDiagnostics, false); - - if (TypeScript.SyntaxFacts.isIdentifierNameOrAnyKeyword(token)) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 107 /* EqualsToken */) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 65 /* ModuleKeyword */ || token.tokenKind === 66 /* RequireKeyword */) { - token = scanner.scan(scannerDiagnostics, false); - - if (token.tokenKind === 72 /* OpenParenToken */) { - var afterOpenParenPosition = scanner.absoluteIndex(); - token = scanner.scan(scannerDiagnostics, false); - - lineMap.fillLineAndCharacterFromPosition(importStart, lineChar); - - if (token.tokenKind === 14 /* StringLiteral */) { - var ref = { - line: lineChar.line, - character: lineChar.character, - position: afterOpenParenPosition + token.leadingTriviaWidth(), - length: token.width(), - path: TypeScript.stripStartAndEndQuotes(TypeScript.switchToForwardSlashes(token.text())), - isResident: false - }; - importedFiles.push(ref); - } - } - } - } - } - } - - position = scanner.absoluteIndex(); - token = scanner.scan(scannerDiagnostics, false); - } - - var totalTime = new Date().getTime() - start; - TypeScript.fileResolutionScanImportsTime += totalTime; - } - - function processTripleSlashDirectives(fileName, lineMap, firstToken) { - var leadingTrivia = firstToken.leadingTrivia(); - - var position = 0; - var lineChar = { line: -1, character: -1 }; - var noDefaultLib = false; - var diagnostics = []; - var referencedFiles = []; - - for (var i = 0, n = leadingTrivia.count(); i < n; i++) { - var trivia = leadingTrivia.syntaxTriviaAt(i); - - if (trivia.kind() === 7 /* SingleLineCommentTrivia */) { - var triviaText = trivia.fullText(); - var referencedCode = getFileReferenceFromReferencePath(fileName, lineMap, position, triviaText, diagnostics); - - if (referencedCode) { - lineMap.fillLineAndCharacterFromPosition(position, lineChar); - referencedCode.position = position; - referencedCode.length = trivia.fullWidth(); - referencedCode.line = lineChar.line; - referencedCode.character = lineChar.character; - - referencedFiles.push(referencedCode); - } - - var isNoDefaultLib = isNoDefaultLibMatch(triviaText); - if (isNoDefaultLib) { - noDefaultLib = isNoDefaultLib[3] === "true"; - } - } - - position += trivia.fullWidth(); - } - - return { noDefaultLib: noDefaultLib, diagnostics: diagnostics, referencedFiles: referencedFiles }; - } - - function preProcessFile(fileName, sourceText, readImportFiles) { - if (typeof readImportFiles === "undefined") { readImportFiles = true; } - var text = TypeScript.SimpleText.fromScriptSnapshot(sourceText); - var scanner = new TypeScript.Scanner(fileName, text, 1 /* EcmaScript5 */, scannerWindow); - - var firstToken = scanner.scan(scannerDiagnostics, false); - - var importedFiles = []; - if (readImportFiles) { - processImports(text.lineMap(), scanner, firstToken, importedFiles); - } - - var properties = processTripleSlashDirectives(fileName, text.lineMap(), firstToken); - - scannerDiagnostics.length = 0; - return { referencedFiles: properties.referencedFiles, importedFiles: importedFiles, isLibFile: properties.noDefaultLib, diagnostics: properties.diagnostics }; - } - TypeScript.preProcessFile = preProcessFile; - - function getParseOptions(settings) { - return new TypeScript.ParseOptions(settings.codeGenTarget(), settings.allowAutomaticSemicolonInsertion()); - } - TypeScript.getParseOptions = getParseOptions; - - function getReferencedFiles(fileName, sourceText) { - return preProcessFile(fileName, sourceText, false).referencedFiles; - } - TypeScript.getReferencedFiles = getReferencedFiles; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ReferenceResolutionResult = (function () { - function ReferenceResolutionResult() { - this.resolvedFiles = []; - this.diagnostics = []; - this.seenNoDefaultLibTag = false; - } - return ReferenceResolutionResult; - })(); - TypeScript.ReferenceResolutionResult = ReferenceResolutionResult; - - var ReferenceLocation = (function () { - function ReferenceLocation(filePath, lineMap, position, length, isImported) { - this.filePath = filePath; - this.lineMap = lineMap; - this.position = position; - this.length = length; - this.isImported = isImported; - } - return ReferenceLocation; - })(); - - var ReferenceResolver = (function () { - function ReferenceResolver(inputFileNames, host, useCaseSensitiveFileResolution) { - this.useCaseSensitiveFileResolution = useCaseSensitiveFileResolution; - this.inputFileNames = inputFileNames; - this.host = host; - this.visited = {}; - } - ReferenceResolver.resolve = function (inputFileNames, host, useCaseSensitiveFileResolution) { - var resolver = new ReferenceResolver(inputFileNames, host, useCaseSensitiveFileResolution); - return resolver.resolveInputFiles(); - }; - - ReferenceResolver.prototype.resolveInputFiles = function () { - var _this = this; - var result = new ReferenceResolutionResult(); - - if (!this.inputFileNames || this.inputFileNames.length <= 0) { - return result; - } - - var referenceLocation = new ReferenceLocation(null, null, 0, 0, false); - this.inputFileNames.forEach(function (fileName) { - return _this.resolveIncludedFile(fileName, referenceLocation, result); - }); - - return result; - }; - - ReferenceResolver.prototype.resolveIncludedFile = function (path, referenceLocation, resolutionResult) { - var normalizedPath = this.getNormalizedFilePath(path, referenceLocation.filePath); - - if (this.isSameFile(normalizedPath, referenceLocation.filePath)) { - if (!referenceLocation.isImported) { - resolutionResult.diagnostics.push(new TypeScript.Diagnostic(referenceLocation.filePath, referenceLocation.lineMap, referenceLocation.position, referenceLocation.length, TypeScript.DiagnosticCode.A_file_cannot_have_a_reference_to_itself, null)); - } - - return normalizedPath; - } - - if (!TypeScript.isTSFile(normalizedPath) && !TypeScript.isDTSFile(normalizedPath)) { - var dtsFile = normalizedPath + ".d.ts"; - var tsFile = normalizedPath + ".ts"; - - if (this.host.fileExists(tsFile)) { - normalizedPath = tsFile; - } else { - normalizedPath = dtsFile; - } - } - - if (!this.host.fileExists(normalizedPath)) { - if (!referenceLocation.isImported) { - resolutionResult.diagnostics.push(new TypeScript.Diagnostic(referenceLocation.filePath, referenceLocation.lineMap, referenceLocation.position, referenceLocation.length, TypeScript.DiagnosticCode.Cannot_resolve_referenced_file_0, [path])); - } - - return normalizedPath; - } - - return this.resolveFile(normalizedPath, resolutionResult); - }; - - ReferenceResolver.prototype.resolveImportedFile = function (path, referenceLocation, resolutionResult) { - var isRelativePath = TypeScript.isRelative(path); - var isRootedPath = isRelativePath ? false : TypeScript.isRooted(path); - - if (isRelativePath || isRootedPath) { - return this.resolveIncludedFile(path, referenceLocation, resolutionResult); - } else { - var parentDirectory = this.host.getParentDirectory(referenceLocation.filePath); - var searchFilePath = null; - var dtsFileName = path + ".d.ts"; - var tsFilePath = path + ".ts"; - - var start = new Date().getTime(); - - do { - currentFilePath = this.host.resolveRelativePath(tsFilePath, parentDirectory); - if (this.host.fileExists(currentFilePath)) { - searchFilePath = currentFilePath; - break; - } - - var currentFilePath = this.host.resolveRelativePath(dtsFileName, parentDirectory); - if (this.host.fileExists(currentFilePath)) { - searchFilePath = currentFilePath; - break; - } - - parentDirectory = this.host.getParentDirectory(parentDirectory); - } while(parentDirectory); - - TypeScript.fileResolutionImportFileSearchTime += new Date().getTime() - start; - - if (!searchFilePath) { - return path; - } - - return this.resolveFile(searchFilePath, resolutionResult); - } - }; - - ReferenceResolver.prototype.resolveFile = function (normalizedPath, resolutionResult) { - var _this = this; - var visitedPath = this.isVisited(normalizedPath); - if (!visitedPath) { - this.recordVisitedFile(normalizedPath); - - var start = new Date().getTime(); - var scriptSnapshot = this.host.getScriptSnapshot(normalizedPath); - var totalTime = new Date().getTime() - start; - TypeScript.fileResolutionIOTime += totalTime; - - var lineMap = TypeScript.LineMap1.fromScriptSnapshot(scriptSnapshot); - var preprocessedFileInformation = TypeScript.preProcessFile(normalizedPath, scriptSnapshot); - resolutionResult.diagnostics.push.apply(resolutionResult.diagnostics, preprocessedFileInformation.diagnostics); - - if (preprocessedFileInformation.isLibFile) { - resolutionResult.seenNoDefaultLibTag = true; - } - - var normalizedReferencePaths = []; - preprocessedFileInformation.referencedFiles.forEach(function (fileReference) { - var currentReferenceLocation = new ReferenceLocation(normalizedPath, lineMap, fileReference.position, fileReference.length, false); - var normalizedReferencePath = _this.resolveIncludedFile(fileReference.path, currentReferenceLocation, resolutionResult); - normalizedReferencePaths.push(normalizedReferencePath); - }); - - var normalizedImportPaths = []; - for (var i = 0; i < preprocessedFileInformation.importedFiles.length; i++) { - var fileImport = preprocessedFileInformation.importedFiles[i]; - var currentReferenceLocation = new ReferenceLocation(normalizedPath, lineMap, fileImport.position, fileImport.length, true); - var normalizedImportPath = this.resolveImportedFile(fileImport.path, currentReferenceLocation, resolutionResult); - normalizedImportPaths.push(normalizedImportPath); - } - - resolutionResult.resolvedFiles.push({ - path: normalizedPath, - referencedFiles: normalizedReferencePaths, - importedFiles: normalizedImportPaths - }); - } else { - normalizedPath = visitedPath; - } - - return normalizedPath; - }; - - ReferenceResolver.prototype.getNormalizedFilePath = function (path, parentFilePath) { - var parentFileDirectory = parentFilePath ? this.host.getParentDirectory(parentFilePath) : ""; - var normalizedPath = this.host.resolveRelativePath(path, parentFileDirectory); - return normalizedPath; - }; - - ReferenceResolver.prototype.getUniqueFileId = function (filePath) { - return this.useCaseSensitiveFileResolution ? filePath : filePath.toLocaleUpperCase(); - }; - - ReferenceResolver.prototype.recordVisitedFile = function (filePath) { - this.visited[this.getUniqueFileId(filePath)] = filePath; - }; - - ReferenceResolver.prototype.isVisited = function (filePath) { - return this.visited[this.getUniqueFileId(filePath)]; - }; - - ReferenceResolver.prototype.isSameFile = function (filePath1, filePath2) { - if (!filePath1 || !filePath2) { - return false; - } - - if (this.useCaseSensitiveFileResolution) { - return filePath1 === filePath2; - } else { - return filePath1.toLocaleUpperCase() === filePath2.toLocaleUpperCase(); - } - }; - return ReferenceResolver; - })(); - TypeScript.ReferenceResolver = ReferenceResolver; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var TextWriter = (function () { - function TextWriter(name, writeByteOrderMark, outputFileType) { - this.name = name; - this.writeByteOrderMark = writeByteOrderMark; - this.outputFileType = outputFileType; - this.contents = ""; - this.onNewLine = true; - } - TextWriter.prototype.Write = function (s) { - this.contents += s; - this.onNewLine = false; - }; - - TextWriter.prototype.WriteLine = function (s) { - this.contents += s; - this.contents += TypeScript.newLine(); - this.onNewLine = true; - }; - - TextWriter.prototype.Close = function () { - }; - - TextWriter.prototype.getOutputFile = function () { - return new TypeScript.OutputFile(this.name, this.writeByteOrderMark, this.contents, this.outputFileType); - }; - return TextWriter; - })(); - TypeScript.TextWriter = TextWriter; - - var DeclarationEmitter = (function () { - function DeclarationEmitter(emittingFileName, document, compiler, emitOptions, semanticInfoChain) { - this.emittingFileName = emittingFileName; - this.document = document; - this.compiler = compiler; - this.emitOptions = emitOptions; - this.semanticInfoChain = semanticInfoChain; - this.declFile = null; - this.indenter = new TypeScript.Indenter(); - this.emittedReferencePaths = false; - this.declFile = new TextWriter(emittingFileName, this.document.byteOrderMark !== 0 /* None */, 2 /* Declaration */); - } - DeclarationEmitter.prototype.getOutputFile = function () { - return this.declFile.getOutputFile(); - }; - - DeclarationEmitter.prototype.emitDeclarations = function (sourceUnit) { - this.emitDeclarationsForSourceUnit(sourceUnit); - }; - - DeclarationEmitter.prototype.emitDeclarationsForList = function (list) { - for (var i = 0, n = list.childCount(); i < n; i++) { - this.emitDeclarationsForAST(list.childAt(i)); - } - }; - - DeclarationEmitter.prototype.emitSeparatedList = function (list) { - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - this.emitDeclarationsForAST(list.nonSeparatorAt(i)); - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForAST = function (ast) { - switch (ast.kind()) { - case 148 /* VariableStatement */: - return this.emitDeclarationsForVariableStatement(ast); - case 141 /* PropertySignature */: - return this.emitPropertySignature(ast); - case 225 /* VariableDeclarator */: - return this.emitVariableDeclarator(ast, true, true); - case 136 /* MemberVariableDeclaration */: - return this.emitDeclarationsForMemberVariableDeclaration(ast); - case 137 /* ConstructorDeclaration */: - return this.emitDeclarationsForConstructorDeclaration(ast); - case 139 /* GetAccessor */: - return this.emitDeclarationsForGetAccessor(ast); - case 140 /* SetAccessor */: - return this.emitDeclarationsForSetAccessor(ast); - case 138 /* IndexMemberDeclaration */: - return this.emitIndexMemberDeclaration(ast); - case 144 /* IndexSignature */: - return this.emitIndexSignature(ast); - case 142 /* CallSignature */: - return this.emitCallSignature(ast); - case 143 /* ConstructSignature */: - return this.emitConstructSignature(ast); - case 145 /* MethodSignature */: - return this.emitMethodSignature(ast); - case 129 /* FunctionDeclaration */: - return this.emitDeclarationsForFunctionDeclaration(ast); - case 135 /* MemberFunctionDeclaration */: - return this.emitMemberFunctionDeclaration(ast); - case 131 /* ClassDeclaration */: - return this.emitDeclarationsForClassDeclaration(ast); - case 128 /* InterfaceDeclaration */: - return this.emitDeclarationsForInterfaceDeclaration(ast); - case 133 /* ImportDeclaration */: - return this.emitDeclarationsForImportDeclaration(ast); - case 130 /* ModuleDeclaration */: - return this.emitDeclarationsForModuleDeclaration(ast); - case 132 /* EnumDeclaration */: - return this.emitDeclarationsForEnumDeclaration(ast); - case 134 /* ExportAssignment */: - return this.emitDeclarationsForExportAssignment(ast); - } - }; - - DeclarationEmitter.prototype.getIndentString = function (declIndent) { - if (typeof declIndent === "undefined") { declIndent = false; } - return this.indenter.getIndent(); - }; - - DeclarationEmitter.prototype.emitIndent = function () { - this.declFile.Write(this.getIndentString()); - }; - - DeclarationEmitter.prototype.canEmitDeclarations = function (declAST) { - var container = this.getEnclosingContainer(declAST); - if (container.kind() === 130 /* ModuleDeclaration */ || container.kind() === 120 /* SourceUnit */) { - var pullDecl = this.semanticInfoChain.getDeclForAST(declAST); - if (!TypeScript.hasFlag(pullDecl.flags, 1 /* Exported */)) { - var start = new Date().getTime(); - var declSymbol = this.semanticInfoChain.getSymbolForAST(declAST); - var result = declSymbol && declSymbol.isExternallyVisible(); - TypeScript.declarationEmitIsExternallyVisibleTime += new Date().getTime() - start; - - return result; - } - } - - return true; - }; - - DeclarationEmitter.prototype.getDeclFlagsString = function (pullDecl, typeString) { - var result = this.getIndentString(); - var pullFlags = pullDecl.flags; - - if (TypeScript.hasFlag(pullFlags, 16 /* Static */)) { - if (TypeScript.hasFlag(pullFlags, 2 /* Private */)) { - result += "private "; - } - result += "static "; - } else { - if (TypeScript.hasFlag(pullFlags, 2 /* Private */)) { - result += "private "; - } else if (TypeScript.hasFlag(pullFlags, 4 /* Public */)) { - result += "public "; - } else { - var emitDeclare = !TypeScript.hasFlag(pullFlags, 1 /* Exported */); - - var declAST = this.semanticInfoChain.getASTForDecl(pullDecl); - var container = this.getEnclosingContainer(declAST); - - if (container.kind() === 130 /* ModuleDeclaration */ && TypeScript.ASTHelpers.isAnyNameOfModule(container, declAST)) { - container = this.getEnclosingContainer(container); - } - - var isExternalModule = container.kind() === 120 /* SourceUnit */ && this.document.isExternalModule(); - - if (isExternalModule && TypeScript.hasFlag(pullFlags, 1 /* Exported */)) { - result += "export "; - emitDeclare = true; - } - - if (isExternalModule || container.kind() === 120 /* SourceUnit */) { - if (emitDeclare && typeString !== "interface" && typeString !== "import") { - result += "declare "; - } - } - - result += typeString + " "; - } - } - - return result; - }; - - DeclarationEmitter.prototype.emitDeclFlags = function (declarationAST, typeString) { - this.declFile.Write(this.getDeclFlagsString(this.semanticInfoChain.getDeclForAST(declarationAST), typeString)); - }; - - DeclarationEmitter.prototype.emitTypeNamesMember = function (memberName, emitIndent) { - if (typeof emitIndent === "undefined") { emitIndent = false; } - if (memberName.prefix === "{ ") { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.WriteLine("{"); - this.indenter.increaseIndent(); - emitIndent = true; - } else if (memberName.prefix !== "") { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.Write(memberName.prefix); - emitIndent = false; - } - - if (memberName.isString()) { - if (emitIndent) { - this.emitIndent(); - } - - this.declFile.Write(memberName.text); - } else if (memberName.isArray()) { - var ar = memberName; - for (var index = 0; index < ar.entries.length; index++) { - this.emitTypeNamesMember(ar.entries[index], emitIndent); - if (ar.delim === "; ") { - this.declFile.WriteLine(";"); - } - } - } - - if (memberName.suffix === "}") { - this.indenter.decreaseIndent(); - this.emitIndent(); - this.declFile.Write(memberName.suffix); - } else { - this.declFile.Write(memberName.suffix); - } - }; - - DeclarationEmitter.prototype.emitTypeSignature = function (ast, type) { - var declarationContainerAst = this.getEnclosingContainer(ast); - - var start = new Date().getTime(); - var declarationContainerDecl = this.semanticInfoChain.getDeclForAST(declarationContainerAst); - - var declarationPullSymbol = declarationContainerDecl.getSymbol(); - TypeScript.declarationEmitTypeSignatureTime += new Date().getTime() - start; - - var isNotAGenericType = ast.kind() !== 126 /* GenericType */; - - var typeNameMembers = type.getScopedNameEx(declarationPullSymbol, false, false, false, false, false, isNotAGenericType); - this.emitTypeNamesMember(typeNameMembers); - }; - - DeclarationEmitter.prototype.emitComment = function (comment) { - var text = TypeScript.getTrimmedTextLines(comment); - if (this.declFile.onNewLine) { - this.emitIndent(); - } else if (comment.kind() !== 6 /* MultiLineCommentTrivia */) { - this.declFile.WriteLine(""); - this.emitIndent(); - } - - this.declFile.Write(text[0]); - - for (var i = 1; i < text.length; i++) { - this.declFile.WriteLine(""); - this.emitIndent(); - this.declFile.Write(text[i]); - } - - if (comment.endsLine || comment.kind() !== 6 /* MultiLineCommentTrivia */) { - this.declFile.WriteLine(""); - } else { - this.declFile.Write(" "); - } - }; - - DeclarationEmitter.prototype.emitDeclarationComments = function (astOrSymbol, endLine) { - if (typeof endLine === "undefined") { endLine = true; } - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var declComments = astOrSymbol.docComments ? astOrSymbol.docComments() : TypeScript.ASTHelpers.docComments(astOrSymbol); - this.writeDeclarationComments(declComments, endLine); - }; - - DeclarationEmitter.prototype.writeDeclarationComments = function (declComments, endLine) { - if (typeof endLine === "undefined") { endLine = true; } - if (declComments.length > 0) { - for (var i = 0; i < declComments.length; i++) { - this.emitComment(declComments[i]); - } - - if (endLine) { - if (!this.declFile.onNewLine) { - this.declFile.WriteLine(""); - } - } else { - if (this.declFile.onNewLine) { - this.emitIndent(); - } - } - } - }; - - DeclarationEmitter.prototype.emitTypeOfVariableDeclaratorOrParameter = function (boundDecl) { - var start = new Date().getTime(); - var decl = this.semanticInfoChain.getDeclForAST(boundDecl); - var pullSymbol = decl.getSymbol(); - TypeScript.declarationEmitGetBoundDeclTypeTime += new Date().getTime() - start; - - var type = pullSymbol.type; - TypeScript.Debug.assert(type); - - this.declFile.Write(": "); - this.emitTypeSignature(boundDecl, type); - }; - - DeclarationEmitter.prototype.emitPropertySignature = function (varDecl) { - this.emitDeclarationComments(varDecl); - this.emitIndent(); - this.declFile.Write(varDecl.propertyName.text()); - if (varDecl.questionToken) { - this.declFile.Write("?"); - } - - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitVariableDeclarator = function (varDecl, isFirstVarInList, isLastVarInList) { - if (this.canEmitDeclarations(varDecl)) { - this.emitDeclarationComments(varDecl); - - if (isFirstVarInList) { - this.emitDeclFlags(varDecl, "var"); - } - - this.declFile.Write(varDecl.propertyName.text()); - - if (!TypeScript.hasModifier(TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - } - - if (isLastVarInList) { - this.declFile.WriteLine(";"); - } else { - this.declFile.Write(", "); - } - } - }; - - DeclarationEmitter.prototype.emitClassElementModifiers = function (modifiers) { - if (TypeScript.hasModifier(modifiers, 16 /* Static */)) { - if (TypeScript.hasModifier(modifiers, 2 /* Private */)) { - this.declFile.Write("private "); - } - this.declFile.Write("static "); - } else { - if (TypeScript.hasModifier(modifiers, 2 /* Private */)) { - this.declFile.Write("private "); - } else { - this.declFile.Write("public "); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForMemberVariableDeclaration = function (varDecl) { - if (this.canEmitDeclarations(varDecl)) { - this.emitDeclarationComments(varDecl); - - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(varDecl.modifiers); - ; - - this.declFile.Write(varDecl.variableDeclarator.propertyName.text()); - - if (!TypeScript.hasModifier(varDecl.modifiers, 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(varDecl); - } - - this.declFile.WriteLine(";"); - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForVariableStatement = function (variableStatement) { - this.emitDeclarationsForVariableDeclaration(variableStatement.declaration); - }; - - DeclarationEmitter.prototype.emitDeclarationsForVariableDeclaration = function (variableDeclaration) { - var varListCount = variableDeclaration.declarators.nonSeparatorCount(); - for (var i = 0; i < varListCount; i++) { - this.emitVariableDeclarator(variableDeclaration.declarators.nonSeparatorAt(i), i === 0, i === varListCount - 1); - } - }; - - DeclarationEmitter.prototype.emitArgDecl = function (argDecl, id, isOptional, isPrivate) { - this.indenter.increaseIndent(); - - this.emitDeclarationComments(argDecl, false); - this.declFile.Write(id.text()); - if (isOptional) { - this.declFile.Write("?"); - } - - this.indenter.decreaseIndent(); - - if (!isPrivate) { - this.emitTypeOfVariableDeclaratorOrParameter(argDecl); - } - }; - - DeclarationEmitter.prototype.isOverloadedCallSignature = function (funcDecl) { - var start = new Date().getTime(); - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSymbol = functionDecl.getSymbol(); - TypeScript.declarationEmitIsOverloadedCallSignatureTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - var signatures = funcTypeSymbol.getCallSignatures(); - var result = signatures && signatures.length > 1; - - return result; - }; - - DeclarationEmitter.prototype.emitDeclarationsForConstructorDeclaration = function (funcDecl) { - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - if (funcDecl.block) { - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } - } - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("constructor"); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitParameterList = function (isPrivate, parameterList) { - this.declFile.Write("("); - this.emitParameters(isPrivate, TypeScript.ASTHelpers.parametersFromParameterList(parameterList)); - this.declFile.Write(")"); - }; - - DeclarationEmitter.prototype.emitParameters = function (isPrivate, parameterList) { - var hasLastParameterRestParameter = parameterList.lastParameterIsRest(); - var argsLen = parameterList.length; - if (hasLastParameterRestParameter) { - argsLen--; - } - - for (var i = 0; i < argsLen; i++) { - this.emitArgDecl(parameterList.astAt(i), parameterList.identifierAt(i), parameterList.isOptionalAt(i), isPrivate); - if (i < (argsLen - 1)) { - this.declFile.Write(", "); - } - } - - if (hasLastParameterRestParameter) { - if (parameterList.length > 1) { - this.declFile.Write(", ..."); - } else { - this.declFile.Write("..."); - } - - var index = parameterList.length - 1; - this.emitArgDecl(parameterList.astAt(index), parameterList.identifierAt(index), parameterList.isOptionalAt(index), isPrivate); - } - }; - - DeclarationEmitter.prototype.emitMemberFunctionDeclaration = function (funcDecl) { - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - var funcTypeSymbol = funcSymbol.type; - if (funcDecl.block) { - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } else if (this.isOverloadedCallSignature(funcDecl)) { - return; - } - } else if (TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */) && this.isOverloadedCallSignature(funcDecl)) { - var callSignatures = funcTypeSymbol.getCallSignatures(); - TypeScript.Debug.assert(callSignatures && callSignatures.length > 1); - var firstSignature = callSignatures[0].isDefinition() ? callSignatures[1] : callSignatures[0]; - var firstSignatureDecl = firstSignature.getDeclarations()[0]; - var firstFuncDecl = this.semanticInfoChain.getASTForDecl(firstSignatureDecl); - if (firstFuncDecl !== funcDecl) { - return; - } - } - - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitDeclarationComments(funcDecl); - - this.emitDeclFlags(funcDecl, "function"); - var id = funcDecl.propertyName.text(); - this.declFile.Write(id); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - var isPrivate = TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */); - - this.emitParameterList(isPrivate, funcDecl.callSignature.parameterList); - - if (!isPrivate) { - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - this.emitTypeSignature(funcDecl, returnType); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitCallSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - this.emitDeclarationComments(funcDecl); - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.typeParameterList, funcSignature); - - this.emitIndent(); - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitConstructSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("new"); - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitMethodSignature = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write(funcDecl.propertyName.text()); - if (funcDecl.questionToken) { - this.declFile.Write("? "); - } - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForFunctionDeclaration = function (funcDecl) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - - var start = new Date().getTime(); - var funcSymbol = this.semanticInfoChain.getSymbolForAST(funcDecl); - - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime += new Date().getTime() - start; - - if (funcDecl.block) { - var funcTypeSymbol = funcSymbol.type; - var constructSignatures = funcTypeSymbol.getConstructSignatures(); - if (constructSignatures && constructSignatures.length > 1) { - return; - } else if (this.isOverloadedCallSignature(funcDecl)) { - return; - } - } - - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - this.emitDeclarationComments(funcDecl); - - var id = funcDecl.identifier.text(); - this.emitDeclFlags(funcDecl, "function"); - if (id !== "" || !funcDecl.identifier || funcDecl.identifier.text().length > 0) { - this.declFile.Write(id); - } else if (funcPullDecl.kind === 2097152 /* ConstructSignature */) { - this.declFile.Write("new"); - } - - var funcSignature = funcPullDecl.getSignatureSymbol(); - this.emitTypeParameters(funcDecl.callSignature.typeParameterList, funcSignature); - - this.declFile.Write("("); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList)); - this.declFile.Write(")"); - - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - if (returnType) { - this.emitTypeSignature(funcDecl, returnType); - } else { - this.declFile.Write("any"); - } - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitIndexMemberDeclaration = function (funcDecl) { - this.emitDeclarationsForAST(funcDecl.indexSignature); - }; - - DeclarationEmitter.prototype.emitIndexSignature = function (funcDecl) { - if (!this.canEmitDeclarations(funcDecl)) { - return; - } - - this.emitDeclarationComments(funcDecl); - - this.emitIndent(); - this.declFile.Write("["); - this.emitParameters(false, TypeScript.ASTHelpers.parametersFromParameter(funcDecl.parameter)); - this.declFile.Write("]"); - - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSignature = funcPullDecl.getSignatureSymbol(); - var returnType = funcSignature.returnType; - this.declFile.Write(": "); - this.emitTypeSignature(funcDecl, returnType); - - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitBaseList = function (bases, useExtendsList) { - if (bases && (bases.nonSeparatorCount() > 0)) { - var qual = useExtendsList ? "extends" : "implements"; - this.declFile.Write(" " + qual + " "); - var basesLen = bases.nonSeparatorCount(); - for (var i = 0; i < basesLen; i++) { - if (i > 0) { - this.declFile.Write(", "); - } - var base = bases.nonSeparatorAt(i); - var baseType = this.semanticInfoChain.getSymbolForAST(base); - this.emitTypeSignature(base, baseType); - } - } - }; - - DeclarationEmitter.prototype.emitAccessorDeclarationComments = function (funcDecl) { - if (this.emitOptions.compilationSettings().removeComments()) { - return; - } - - var start = new Date().getTime(); - var accessors = TypeScript.PullHelpers.getGetterAndSetterFunction(funcDecl, this.semanticInfoChain); - TypeScript.declarationEmitGetAccessorFunctionTime += new Date().getTime(); - - var comments = []; - if (accessors.getter) { - comments = comments.concat(TypeScript.ASTHelpers.docComments(accessors.getter)); - } - if (accessors.setter) { - comments = comments.concat(TypeScript.ASTHelpers.docComments(accessors.setter)); - } - - this.writeDeclarationComments(comments); - }; - - DeclarationEmitter.prototype.emitDeclarationsForGetAccessor = function (funcDecl) { - this.emitMemberAccessorDeclaration(funcDecl, funcDecl.modifiers, funcDecl.propertyName); - }; - - DeclarationEmitter.prototype.emitDeclarationsForSetAccessor = function (funcDecl) { - this.emitMemberAccessorDeclaration(funcDecl, funcDecl.modifiers, funcDecl.propertyName); - }; - - DeclarationEmitter.prototype.emitMemberAccessorDeclaration = function (funcDecl, modifiers, name) { - var start = new Date().getTime(); - var accessorSymbol = TypeScript.PullHelpers.getAccessorSymbol(funcDecl, this.semanticInfoChain); - TypeScript.declarationEmitGetAccessorFunctionTime += new Date().getTime(); - - if (funcDecl.kind() === 140 /* SetAccessor */ && accessorSymbol.getGetter()) { - return; - } - - var isPrivate = TypeScript.hasModifier(modifiers, 2 /* Private */); - this.emitAccessorDeclarationComments(funcDecl); - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(modifiers); - this.declFile.Write(name.text()); - if (!isPrivate) { - this.declFile.Write(" : "); - var type = accessorSymbol.type; - this.emitTypeSignature(funcDecl, type); - } - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.emitClassMembersFromConstructorDefinition = function (funcDecl) { - var argsLen = funcDecl.callSignature.parameterList.parameters.nonSeparatorCount(); - if (TypeScript.lastParameterIsRest(funcDecl.callSignature.parameterList)) { - argsLen--; - } - - for (var i = 0; i < argsLen; i++) { - var parameter = funcDecl.callSignature.parameterList.parameters.nonSeparatorAt(i); - var parameterDecl = this.semanticInfoChain.getDeclForAST(parameter); - if (TypeScript.hasFlag(parameterDecl.flags, 8388608 /* PropertyParameter */)) { - var funcPullDecl = this.semanticInfoChain.getDeclForAST(funcDecl); - this.emitDeclarationComments(parameter); - this.declFile.Write(this.getIndentString()); - this.emitClassElementModifiers(parameter.modifiers); - this.declFile.Write(parameter.identifier.text()); - - if (!TypeScript.hasModifier(parameter.modifiers, 2 /* Private */)) { - this.emitTypeOfVariableDeclaratorOrParameter(parameter); - } - this.declFile.WriteLine(";"); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForClassDeclaration = function (classDecl) { - if (!this.canEmitDeclarations(classDecl)) { - return; - } - - var className = classDecl.identifier.text(); - this.emitDeclarationComments(classDecl); - var classPullDecl = this.semanticInfoChain.getDeclForAST(classDecl); - this.emitDeclFlags(classDecl, "class"); - this.declFile.Write(className); - - this.emitTypeParameters(classDecl.typeParameterList); - this.emitHeritageClauses(classDecl.heritageClauses); - this.declFile.WriteLine(" {"); - - this.indenter.increaseIndent(); - var constructorDecl = TypeScript.getLastConstructor(classDecl); - if (constructorDecl) { - this.emitClassMembersFromConstructorDefinition(constructorDecl); - } - - this.emitDeclarationsForList(classDecl.classElements); - - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitHeritageClauses = function (clauses) { - if (clauses) { - for (var i = 0, n = clauses.childCount(); i < n; i++) { - this.emitHeritageClause(clauses.childAt(i)); - } - } - }; - - DeclarationEmitter.prototype.emitHeritageClause = function (clause) { - this.emitBaseList(clause.typeNames, clause.kind() === 230 /* ExtendsHeritageClause */); - }; - - DeclarationEmitter.prototype.getEnclosingContainer = function (ast) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 131 /* ClassDeclaration */ || ast.kind() === 128 /* InterfaceDeclaration */ || ast.kind() === 130 /* ModuleDeclaration */ || ast.kind() === 120 /* SourceUnit */) { - return ast; - } - - ast = ast.parent; - } - - return null; - }; - - DeclarationEmitter.prototype.emitTypeParameters = function (typeParams, funcSignature) { - if (!typeParams || !typeParams.typeParameters.nonSeparatorCount()) { - return; - } - - this.declFile.Write("<"); - var containerAst = this.getEnclosingContainer(typeParams); - - var start = new Date().getTime(); - var containerDecl = this.semanticInfoChain.getDeclForAST(containerAst); - var containerSymbol = containerDecl.getSymbol(); - TypeScript.declarationEmitGetTypeParameterSymbolTime += new Date().getTime() - start; - - var typars; - if (funcSignature) { - typars = funcSignature.getTypeParameters(); - } else { - typars = containerSymbol.getTypeArgumentsOrTypeParameters(); - } - - for (var i = 0; i < typars.length; i++) { - if (i) { - this.declFile.Write(", "); - } - - var memberName = typars[i].getScopedNameEx(containerSymbol, false, true); - this.emitTypeNamesMember(memberName); - } - - this.declFile.Write(">"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForInterfaceDeclaration = function (interfaceDecl) { - if (!this.canEmitDeclarations(interfaceDecl)) { - return; - } - - var interfaceName = interfaceDecl.identifier.text(); - this.emitDeclarationComments(interfaceDecl); - var interfacePullDecl = this.semanticInfoChain.getDeclForAST(interfaceDecl); - this.emitDeclFlags(interfaceDecl, "interface"); - this.declFile.Write(interfaceName); - - this.emitTypeParameters(interfaceDecl.typeParameterList); - this.emitHeritageClauses(interfaceDecl.heritageClauses); - this.declFile.WriteLine(" {"); - - this.indenter.increaseIndent(); - - this.emitSeparatedList(interfaceDecl.body.typeMembers); - - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForImportDeclaration = function (importDeclAST) { - var importDecl = this.semanticInfoChain.getDeclForAST(importDeclAST); - var importSymbol = importDecl.getSymbol(); - var isExportedImportDecl = TypeScript.hasModifier(importDeclAST.modifiers, 1 /* Exported */); - - if (isExportedImportDecl || importSymbol.typeUsedExternally() || TypeScript.PullContainerSymbol.usedAsSymbol(importSymbol.getContainer(), importSymbol)) { - this.emitDeclarationComments(importDeclAST); - this.emitIndent(); - if (isExportedImportDecl) { - this.declFile.Write("export "); - } - this.declFile.Write("import "); - this.declFile.Write(importDeclAST.identifier.text() + " = "); - if (importDeclAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - this.declFile.WriteLine("require(" + importDeclAST.moduleReference.stringLiteral.text() + ");"); - } else { - this.declFile.WriteLine(TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(importDeclAST.moduleReference.moduleName) + ";"); - } - } - }; - - DeclarationEmitter.prototype.emitDeclarationsForEnumDeclaration = function (moduleDecl) { - if (!this.canEmitDeclarations(moduleDecl)) { - return; - } - - this.emitDeclarationComments(moduleDecl); - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.emitDeclFlags(moduleDecl, "enum"); - this.declFile.WriteLine(moduleDecl.identifier.text() + " {"); - - this.indenter.increaseIndent(); - var membersLen = moduleDecl.enumElements.nonSeparatorCount(); - for (var j = 0; j < membersLen; j++) { - var memberDecl = moduleDecl.enumElements.nonSeparatorAt(j); - var enumElement = memberDecl; - var enumElementDecl = this.semanticInfoChain.getDeclForAST(enumElement); - this.emitDeclarationComments(enumElement); - this.emitIndent(); - this.declFile.Write(enumElement.propertyName.text()); - if (enumElementDecl.constantValue !== null) { - this.declFile.Write(" = " + enumElementDecl.constantValue); - } - this.declFile.WriteLine(","); - } - this.indenter.decreaseIndent(); - - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForModuleDeclaration = function (moduleDecl) { - if (!this.canEmitDeclarations(moduleDecl)) { - return; - } - - var modulePullDecl = this.semanticInfoChain.getDeclForAST(moduleDecl); - this.emitDeclarationComments(moduleDecl); - - var name = moduleDecl.stringLiteral || TypeScript.ArrayUtilities.first(TypeScript.getModuleNames(moduleDecl.name)); - this.emitDeclFlags(name, "module"); - - if (moduleDecl.stringLiteral) { - this.declFile.Write(moduleDecl.stringLiteral.text()); - } else { - this.declFile.Write(TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(moduleDecl.name)); - } - - this.declFile.WriteLine(" {"); - this.indenter.increaseIndent(); - - this.emitDeclarationsForList(moduleDecl.moduleElements); - - this.indenter.decreaseIndent(); - this.emitIndent(); - this.declFile.WriteLine("}"); - }; - - DeclarationEmitter.prototype.emitDeclarationsForExportAssignment = function (ast) { - this.emitIndent(); - this.declFile.Write("export = "); - this.declFile.Write(ast.identifier.text()); - this.declFile.WriteLine(";"); - }; - - DeclarationEmitter.prototype.resolveScriptReference = function (document, reference) { - if (!this.emitOptions.compilationSettings().noResolve() || TypeScript.isRooted(reference)) { - return reference; - } - - var documentDir = TypeScript.convertToDirectoryPath(TypeScript.switchToForwardSlashes(TypeScript.getRootFilePath(document.fileName))); - var resolvedReferencePath = this.emitOptions.resolvePath(documentDir + reference); - return resolvedReferencePath; - }; - - DeclarationEmitter.prototype.emitReferencePaths = function (sourceUnit) { - if (this.emittedReferencePaths) { - return; - } - - var documents = []; - if (this.document.emitToOwnOutputFile()) { - var scriptReferences = this.document.referencedFiles; - var addedGlobalDocument = false; - for (var j = 0; j < scriptReferences.length; j++) { - var currentReference = this.resolveScriptReference(this.document, scriptReferences[j]); - var document = this.compiler.getDocument(currentReference); - - if (document && (document.emitToOwnOutputFile() || document.isDeclareFile() || !addedGlobalDocument)) { - documents = documents.concat(document); - - if (!document.isDeclareFile() && document.isExternalModule()) { - addedGlobalDocument = true; - } - } - } - } else { - var fileNames = this.compiler.fileNames(); - for (var i = 0; i < fileNames.length; i++) { - var doc = this.compiler.getDocument(fileNames[i]); - if (!doc.isDeclareFile() && !doc.isExternalModule()) { - var scriptReferences = doc.referencedFiles; - for (var j = 0; j < scriptReferences.length; j++) { - var currentReference = this.resolveScriptReference(doc, scriptReferences[j]); - var document = this.compiler.getDocument(currentReference); - - if (document && (document.isDeclareFile() || document.isExternalModule())) { - for (var k = 0; k < documents.length; k++) { - if (documents[k] === document) { - break; - } - } - - if (k === documents.length) { - documents = documents.concat(document); - } - } - } - } - } - } - - var emittingFilePath = documents.length ? TypeScript.getRootFilePath(this.emittingFileName) : null; - for (var i = 0; i < documents.length; i++) { - var document = documents[i]; - var declFileName; - if (document.isDeclareFile()) { - declFileName = document.fileName; - } else { - declFileName = this.compiler.mapOutputFileName(document, this.emitOptions, TypeScript.TypeScriptCompiler.mapToDTSFileName); - } - - declFileName = TypeScript.getRelativePathToFixedPath(emittingFilePath, declFileName, false); - this.declFile.WriteLine('/// '); - } - - this.emittedReferencePaths = true; - }; - - DeclarationEmitter.prototype.emitDeclarationsForSourceUnit = function (sourceUnit) { - this.emitReferencePaths(sourceUnit); - this.emitDeclarationsForList(sourceUnit.moduleElements); - }; - return DeclarationEmitter; - })(); - TypeScript.DeclarationEmitter = DeclarationEmitter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var BloomFilter = (function () { - function BloomFilter(expectedCount) { - var m = Math.max(1, BloomFilter.computeM(expectedCount)); - var k = Math.max(1, BloomFilter.computeK(expectedCount)); - ; - - var sizeInEvenBytes = (m + 7) & ~7; - - this.bitArray = []; - for (var i = 0, len = sizeInEvenBytes; i < len; i++) { - this.bitArray[i] = false; - } - this.hashFunctionCount = k; - } - BloomFilter.computeM = function (expectedCount) { - var p = BloomFilter.falsePositiveProbability; - var n = expectedCount; - - var numerator = n * Math.log(p); - var denominator = Math.log(1.0 / Math.pow(2.0, Math.log(2.0))); - return Math.ceil(numerator / denominator); - }; - - BloomFilter.computeK = function (expectedCount) { - var n = expectedCount; - var m = BloomFilter.computeM(expectedCount); - - var temp = Math.log(2.0) * m / n; - return Math.round(temp); - }; - - BloomFilter.prototype.computeHash = function (key, seed) { - return TypeScript.Hash.computeMurmur2StringHashCode(key, seed); - }; - - BloomFilter.prototype.addKeys = function (keys) { - for (var name in keys) { - if (keys[name]) { - this.add(name); - } - } - }; - - BloomFilter.prototype.add = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - this.bitArray[Math.abs(hash)] = true; - } - }; - - BloomFilter.prototype.probablyContains = function (value) { - for (var i = 0; i < this.hashFunctionCount; i++) { - var hash = this.computeHash(value, i); - hash = hash % this.bitArray.length; - if (!this.bitArray[Math.abs(hash)]) { - return false; - } - } - - return true; - }; - - BloomFilter.prototype.isEquivalent = function (filter) { - return BloomFilter.isEquivalent(this.bitArray, filter.bitArray) && this.hashFunctionCount === filter.hashFunctionCount; - }; - - BloomFilter.isEquivalent = function (array1, array2) { - if (array1.length !== array2.length) { - return false; - } - - for (var i = 0; i < array1.length; i++) { - if (array1[i] !== array2[i]) { - return false; - } - } - - return true; - }; - BloomFilter.falsePositiveProbability = 0.0001; - return BloomFilter; - })(); - TypeScript.BloomFilter = BloomFilter; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var IdentifierWalker = (function (_super) { - __extends(IdentifierWalker, _super); - function IdentifierWalker(list) { - _super.call(this); - this.list = list; - } - IdentifierWalker.prototype.visitToken = function (token) { - this.list[token.text()] = true; - }; - return IdentifierWalker; - })(TypeScript.SyntaxWalker); - TypeScript.IdentifierWalker = IdentifierWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CompilationSettings = (function () { - function CompilationSettings() { - this.propagateEnumConstants = false; - this.removeComments = false; - this.watch = false; - this.noResolve = false; - this.allowAutomaticSemicolonInsertion = true; - this.noImplicitAny = false; - this.noLib = false; - this.codeGenTarget = 0 /* EcmaScript3 */; - this.moduleGenTarget = 0 /* Unspecified */; - this.outFileOption = ""; - this.outDirOption = ""; - this.mapSourceFiles = false; - this.mapRoot = ""; - this.sourceRoot = ""; - this.generateDeclarationFiles = false; - this.useCaseSensitiveFileResolution = false; - this.gatherDiagnostics = false; - this.codepage = null; - this.createFileLog = false; - } - return CompilationSettings; - })(); - TypeScript.CompilationSettings = CompilationSettings; - - var ImmutableCompilationSettings = (function () { - function ImmutableCompilationSettings(propagateEnumConstants, removeComments, watch, noResolve, allowAutomaticSemicolonInsertion, noImplicitAny, noLib, codeGenTarget, moduleGenTarget, outFileOption, outDirOption, mapSourceFiles, mapRoot, sourceRoot, generateDeclarationFiles, useCaseSensitiveFileResolution, gatherDiagnostics, codepage, createFileLog) { - this._propagateEnumConstants = propagateEnumConstants; - this._removeComments = removeComments; - this._watch = watch; - this._noResolve = noResolve; - this._allowAutomaticSemicolonInsertion = allowAutomaticSemicolonInsertion; - this._noImplicitAny = noImplicitAny; - this._noLib = noLib; - this._codeGenTarget = codeGenTarget; - this._moduleGenTarget = moduleGenTarget; - this._outFileOption = outFileOption; - this._outDirOption = outDirOption; - this._mapSourceFiles = mapSourceFiles; - this._mapRoot = mapRoot; - this._sourceRoot = sourceRoot; - this._generateDeclarationFiles = generateDeclarationFiles; - this._useCaseSensitiveFileResolution = useCaseSensitiveFileResolution; - this._gatherDiagnostics = gatherDiagnostics; - this._codepage = codepage; - this._createFileLog = createFileLog; - } - ImmutableCompilationSettings.prototype.propagateEnumConstants = function () { - return this._propagateEnumConstants; - }; - ImmutableCompilationSettings.prototype.removeComments = function () { - return this._removeComments; - }; - ImmutableCompilationSettings.prototype.watch = function () { - return this._watch; - }; - ImmutableCompilationSettings.prototype.noResolve = function () { - return this._noResolve; - }; - ImmutableCompilationSettings.prototype.allowAutomaticSemicolonInsertion = function () { - return this._allowAutomaticSemicolonInsertion; - }; - ImmutableCompilationSettings.prototype.noImplicitAny = function () { - return this._noImplicitAny; - }; - ImmutableCompilationSettings.prototype.noLib = function () { - return this._noLib; - }; - ImmutableCompilationSettings.prototype.codeGenTarget = function () { - return this._codeGenTarget; - }; - ImmutableCompilationSettings.prototype.moduleGenTarget = function () { - return this._moduleGenTarget; - }; - ImmutableCompilationSettings.prototype.outFileOption = function () { - return this._outFileOption; - }; - ImmutableCompilationSettings.prototype.outDirOption = function () { - return this._outDirOption; - }; - ImmutableCompilationSettings.prototype.mapSourceFiles = function () { - return this._mapSourceFiles; - }; - ImmutableCompilationSettings.prototype.mapRoot = function () { - return this._mapRoot; - }; - ImmutableCompilationSettings.prototype.sourceRoot = function () { - return this._sourceRoot; - }; - ImmutableCompilationSettings.prototype.generateDeclarationFiles = function () { - return this._generateDeclarationFiles; - }; - ImmutableCompilationSettings.prototype.useCaseSensitiveFileResolution = function () { - return this._useCaseSensitiveFileResolution; - }; - ImmutableCompilationSettings.prototype.gatherDiagnostics = function () { - return this._gatherDiagnostics; - }; - ImmutableCompilationSettings.prototype.codepage = function () { - return this._codepage; - }; - ImmutableCompilationSettings.prototype.createFileLog = function () { - return this._createFileLog; - }; - - ImmutableCompilationSettings.defaultSettings = function () { - if (!ImmutableCompilationSettings._defaultSettings) { - ImmutableCompilationSettings._defaultSettings = ImmutableCompilationSettings.fromCompilationSettings(new CompilationSettings()); - } - - return ImmutableCompilationSettings._defaultSettings; - }; - - ImmutableCompilationSettings.fromCompilationSettings = function (settings) { - return new ImmutableCompilationSettings(settings.propagateEnumConstants, settings.removeComments, settings.watch, settings.noResolve, settings.allowAutomaticSemicolonInsertion, settings.noImplicitAny, settings.noLib, settings.codeGenTarget, settings.moduleGenTarget, settings.outFileOption, settings.outDirOption, settings.mapSourceFiles, settings.mapRoot, settings.sourceRoot, settings.generateDeclarationFiles, settings.useCaseSensitiveFileResolution, settings.gatherDiagnostics, settings.codepage, settings.createFileLog); - }; - - ImmutableCompilationSettings.prototype.toCompilationSettings = function () { - var result = new CompilationSettings(); - - var thisAsIndexable = this; - var resultAsIndexable = result; - for (var name in this) { - if (this.hasOwnProperty(name) && TypeScript.StringUtilities.startsWith(name, "_")) { - resultAsIndexable[name.substr(1)] = thisAsIndexable[name]; - } - } - - return result; - }; - return ImmutableCompilationSettings; - })(); - TypeScript.ImmutableCompilationSettings = ImmutableCompilationSettings; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (PullElementFlags) { - PullElementFlags[PullElementFlags["None"] = 0] = "None"; - PullElementFlags[PullElementFlags["Exported"] = 1] = "Exported"; - PullElementFlags[PullElementFlags["Private"] = 1 << 1] = "Private"; - PullElementFlags[PullElementFlags["Public"] = 1 << 2] = "Public"; - PullElementFlags[PullElementFlags["Ambient"] = 1 << 3] = "Ambient"; - PullElementFlags[PullElementFlags["Static"] = 1 << 4] = "Static"; - PullElementFlags[PullElementFlags["Optional"] = 1 << 7] = "Optional"; - PullElementFlags[PullElementFlags["Signature"] = 1 << 11] = "Signature"; - PullElementFlags[PullElementFlags["Enum"] = 1 << 12] = "Enum"; - PullElementFlags[PullElementFlags["ArrowFunction"] = 1 << 13] = "ArrowFunction"; - - PullElementFlags[PullElementFlags["ClassConstructorVariable"] = 1 << 14] = "ClassConstructorVariable"; - PullElementFlags[PullElementFlags["InitializedModule"] = 1 << 15] = "InitializedModule"; - PullElementFlags[PullElementFlags["InitializedDynamicModule"] = 1 << 16] = "InitializedDynamicModule"; - - PullElementFlags[PullElementFlags["MustCaptureThis"] = 1 << 18] = "MustCaptureThis"; - - PullElementFlags[PullElementFlags["DeclaredInAWithBlock"] = 1 << 21] = "DeclaredInAWithBlock"; - - PullElementFlags[PullElementFlags["HasReturnStatement"] = 1 << 22] = "HasReturnStatement"; - - PullElementFlags[PullElementFlags["PropertyParameter"] = 1 << 23] = "PropertyParameter"; - - PullElementFlags[PullElementFlags["IsAnnotatedWithAny"] = 1 << 24] = "IsAnnotatedWithAny"; - - PullElementFlags[PullElementFlags["HasDefaultArgs"] = 1 << 25] = "HasDefaultArgs"; - - PullElementFlags[PullElementFlags["ConstructorParameter"] = 1 << 26] = "ConstructorParameter"; - - PullElementFlags[PullElementFlags["ImplicitVariable"] = PullElementFlags.ClassConstructorVariable | PullElementFlags.InitializedModule | PullElementFlags.InitializedDynamicModule | PullElementFlags.Enum] = "ImplicitVariable"; - PullElementFlags[PullElementFlags["SomeInitializedModule"] = PullElementFlags.InitializedModule | PullElementFlags.InitializedDynamicModule | PullElementFlags.Enum] = "SomeInitializedModule"; - })(TypeScript.PullElementFlags || (TypeScript.PullElementFlags = {})); - var PullElementFlags = TypeScript.PullElementFlags; - - function hasModifier(modifiers, flag) { - for (var i = 0, n = modifiers.length; i < n; i++) { - if (TypeScript.hasFlag(modifiers[i], flag)) { - return true; - } - } - - return false; - } - TypeScript.hasModifier = hasModifier; - - (function (PullElementKind) { - PullElementKind[PullElementKind["None"] = 0] = "None"; - PullElementKind[PullElementKind["Global"] = 0] = "Global"; - - PullElementKind[PullElementKind["Script"] = 1 << 0] = "Script"; - PullElementKind[PullElementKind["Primitive"] = 1 << 1] = "Primitive"; - - PullElementKind[PullElementKind["Container"] = 1 << 2] = "Container"; - PullElementKind[PullElementKind["Class"] = 1 << 3] = "Class"; - PullElementKind[PullElementKind["Interface"] = 1 << 4] = "Interface"; - PullElementKind[PullElementKind["DynamicModule"] = 1 << 5] = "DynamicModule"; - PullElementKind[PullElementKind["Enum"] = 1 << 6] = "Enum"; - PullElementKind[PullElementKind["TypeAlias"] = 1 << 7] = "TypeAlias"; - PullElementKind[PullElementKind["ObjectLiteral"] = 1 << 8] = "ObjectLiteral"; - - PullElementKind[PullElementKind["Variable"] = 1 << 9] = "Variable"; - PullElementKind[PullElementKind["CatchVariable"] = 1 << 10] = "CatchVariable"; - PullElementKind[PullElementKind["Parameter"] = 1 << 11] = "Parameter"; - PullElementKind[PullElementKind["Property"] = 1 << 12] = "Property"; - PullElementKind[PullElementKind["TypeParameter"] = 1 << 13] = "TypeParameter"; - - PullElementKind[PullElementKind["Function"] = 1 << 14] = "Function"; - PullElementKind[PullElementKind["ConstructorMethod"] = 1 << 15] = "ConstructorMethod"; - PullElementKind[PullElementKind["Method"] = 1 << 16] = "Method"; - PullElementKind[PullElementKind["FunctionExpression"] = 1 << 17] = "FunctionExpression"; - - PullElementKind[PullElementKind["GetAccessor"] = 1 << 18] = "GetAccessor"; - PullElementKind[PullElementKind["SetAccessor"] = 1 << 19] = "SetAccessor"; - - PullElementKind[PullElementKind["CallSignature"] = 1 << 20] = "CallSignature"; - PullElementKind[PullElementKind["ConstructSignature"] = 1 << 21] = "ConstructSignature"; - PullElementKind[PullElementKind["IndexSignature"] = 1 << 22] = "IndexSignature"; - - PullElementKind[PullElementKind["ObjectType"] = 1 << 23] = "ObjectType"; - PullElementKind[PullElementKind["FunctionType"] = 1 << 24] = "FunctionType"; - PullElementKind[PullElementKind["ConstructorType"] = 1 << 25] = "ConstructorType"; - - PullElementKind[PullElementKind["EnumMember"] = 1 << 26] = "EnumMember"; - - PullElementKind[PullElementKind["WithBlock"] = 1 << 27] = "WithBlock"; - PullElementKind[PullElementKind["CatchBlock"] = 1 << 28] = "CatchBlock"; - - PullElementKind[PullElementKind["All"] = PullElementKind.Script | PullElementKind.Global | PullElementKind.Primitive | PullElementKind.Container | PullElementKind.Class | PullElementKind.Interface | PullElementKind.DynamicModule | PullElementKind.Enum | PullElementKind.TypeAlias | PullElementKind.ObjectLiteral | PullElementKind.Variable | PullElementKind.Parameter | PullElementKind.Property | PullElementKind.TypeParameter | PullElementKind.Function | PullElementKind.ConstructorMethod | PullElementKind.Method | PullElementKind.FunctionExpression | PullElementKind.GetAccessor | PullElementKind.SetAccessor | PullElementKind.CallSignature | PullElementKind.ConstructSignature | PullElementKind.IndexSignature | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType | PullElementKind.EnumMember | PullElementKind.WithBlock | PullElementKind.CatchBlock] = "All"; - - PullElementKind[PullElementKind["SomeFunction"] = PullElementKind.Function | PullElementKind.ConstructorMethod | PullElementKind.Method | PullElementKind.FunctionExpression | PullElementKind.GetAccessor | PullElementKind.SetAccessor] = "SomeFunction"; - - PullElementKind[PullElementKind["SomeValue"] = PullElementKind.Variable | PullElementKind.Parameter | PullElementKind.Property | PullElementKind.EnumMember | PullElementKind.SomeFunction] = "SomeValue"; - - PullElementKind[PullElementKind["SomeType"] = PullElementKind.Script | PullElementKind.Global | PullElementKind.Primitive | PullElementKind.Class | PullElementKind.Interface | PullElementKind.Enum | PullElementKind.ObjectLiteral | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType | PullElementKind.TypeParameter] = "SomeType"; - - PullElementKind[PullElementKind["AcceptableAlias"] = PullElementKind.Variable | PullElementKind.SomeFunction | PullElementKind.Class | PullElementKind.Interface | PullElementKind.Enum | PullElementKind.Container | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType] = "AcceptableAlias"; - - PullElementKind[PullElementKind["SomeContainer"] = PullElementKind.Container | PullElementKind.DynamicModule | PullElementKind.TypeAlias] = "SomeContainer"; - - PullElementKind[PullElementKind["SomeSignature"] = PullElementKind.CallSignature | PullElementKind.ConstructSignature | PullElementKind.IndexSignature] = "SomeSignature"; - - PullElementKind[PullElementKind["SomeTypeReference"] = PullElementKind.Interface | PullElementKind.ObjectType | PullElementKind.FunctionType | PullElementKind.ConstructorType] = "SomeTypeReference"; - - PullElementKind[PullElementKind["SomeInstantiatableType"] = PullElementKind.Class | PullElementKind.Interface | PullElementKind.TypeParameter] = "SomeInstantiatableType"; - })(TypeScript.PullElementKind || (TypeScript.PullElementKind = {})); - var PullElementKind = TypeScript.PullElementKind; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var pullDeclID = 0; - var sentinelEmptyPullDeclArray = []; - - var PullDecl = (function () { - function PullDecl(declName, displayName, kind, declFlags, semanticInfoChain) { - this.declID = pullDeclID++; - this.flags = 0 /* None */; - this.declGroups = null; - this.childDecls = null; - this.typeParameters = null; - this.synthesizedValDecl = null; - this.containerDecl = null; - this.childDeclTypeCache = null; - this.childDeclValueCache = null; - this.childDeclNamespaceCache = null; - this.childDeclTypeParameterCache = null; - this.name = declName; - this.kind = kind; - this.flags = declFlags; - this.semanticInfoChain = semanticInfoChain; - - if (displayName !== this.name) { - this.declDisplayName = displayName; - } - } - PullDecl.prototype.fileName = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getParentPath = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getParentDecl = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.isExternalModule = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype.getEnclosingDecl = function () { - throw TypeScript.Errors.abstract(); - }; - - PullDecl.prototype._getEnclosingDeclFromParentDecl = function () { - var decl = this; - while (decl) { - switch (decl.kind) { - default: - return decl; - case 512 /* Variable */: - case 8192 /* TypeParameter */: - case 2048 /* Parameter */: - case 128 /* TypeAlias */: - case 67108864 /* EnumMember */: - } - - decl = decl.getParentDecl(); - } - - TypeScript.Debug.fail(); - }; - - PullDecl.prototype.getDisplayName = function () { - return this.declDisplayName === undefined ? this.name : this.declDisplayName; - }; - - PullDecl.prototype.setSymbol = function (symbol) { - this.semanticInfoChain.setSymbolForDecl(this, symbol); - }; - - PullDecl.prototype.ensureSymbolIsBound = function () { - if (!this.hasBeenBound() && this.kind !== 1 /* Script */) { - var binder = this.semanticInfoChain.getBinder(); - binder.bindDeclToPullSymbol(this); - } - }; - - PullDecl.prototype.getSymbol = function () { - if (this.kind === 1 /* Script */) { - return null; - } - - this.ensureSymbolIsBound(); - - return this.semanticInfoChain.getSymbolForDecl(this); - }; - - PullDecl.prototype.hasSymbol = function () { - var symbol = this.semanticInfoChain.getSymbolForDecl(this); - return !!symbol; - }; - - PullDecl.prototype.setSignatureSymbol = function (signatureSymbol) { - this.semanticInfoChain.setSignatureSymbolForDecl(this, signatureSymbol); - }; - - PullDecl.prototype.getSignatureSymbol = function () { - this.ensureSymbolIsBound(); - return this.semanticInfoChain.getSignatureSymbolForDecl(this); - }; - - PullDecl.prototype.hasSignatureSymbol = function () { - var signatureSymbol = this.semanticInfoChain.getSignatureSymbolForDecl(this); - return !!signatureSymbol; - }; - - PullDecl.prototype.setFlags = function (flags) { - this.flags = flags; - }; - - PullDecl.prototype.setFlag = function (flags) { - this.flags |= flags; - }; - - PullDecl.prototype.setValueDecl = function (valDecl) { - this.synthesizedValDecl = valDecl; - valDecl.containerDecl = this; - }; - - PullDecl.prototype.getValueDecl = function () { - return this.synthesizedValDecl; - }; - - PullDecl.prototype.getContainerDecl = function () { - return this.containerDecl; - }; - - PullDecl.prototype.getChildDeclCache = function (declKind) { - if (declKind === 8192 /* TypeParameter */) { - if (!this.childDeclTypeParameterCache) { - this.childDeclTypeParameterCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclTypeParameterCache; - } else if (TypeScript.hasFlag(declKind, 164 /* SomeContainer */)) { - if (!this.childDeclNamespaceCache) { - this.childDeclNamespaceCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclNamespaceCache; - } else if (TypeScript.hasFlag(declKind, 58728795 /* SomeType */)) { - if (!this.childDeclTypeCache) { - this.childDeclTypeCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclTypeCache; - } else { - if (!this.childDeclValueCache) { - this.childDeclValueCache = TypeScript.createIntrinsicsObject(); - } - - return this.childDeclValueCache; - } - }; - - PullDecl.prototype.addChildDecl = function (childDecl) { - if (childDecl.kind === 8192 /* TypeParameter */) { - if (!this.typeParameters) { - this.typeParameters = []; - } - this.typeParameters[this.typeParameters.length] = childDecl; - } else { - if (!this.childDecls) { - this.childDecls = []; - } - this.childDecls[this.childDecls.length] = childDecl; - } - - var declName = childDecl.name; - - if (!(childDecl.kind & 7340032 /* SomeSignature */)) { - var cache = this.getChildDeclCache(childDecl.kind); - var childrenOfName = cache[declName]; - if (!childrenOfName) { - childrenOfName = []; - } - - childrenOfName.push(childDecl); - cache[declName] = childrenOfName; - } - }; - - PullDecl.prototype.searchChildDecls = function (declName, searchKind) { - var cacheVal = null; - - if (searchKind & 58728795 /* SomeType */) { - cacheVal = this.childDeclTypeCache ? this.childDeclTypeCache[declName] : null; - } else if (searchKind & 164 /* SomeContainer */) { - cacheVal = this.childDeclNamespaceCache ? this.childDeclNamespaceCache[declName] : null; - } else { - cacheVal = this.childDeclValueCache ? this.childDeclValueCache[declName] : null; - } - - if (cacheVal) { - return cacheVal; - } else { - if (searchKind & 58728795 /* SomeType */) { - cacheVal = this.childDeclTypeParameterCache ? this.childDeclTypeParameterCache[declName] : null; - - if (cacheVal) { - return cacheVal; - } - } - - return sentinelEmptyPullDeclArray; - } - }; - - PullDecl.prototype.getChildDecls = function () { - return this.childDecls || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.getTypeParameters = function () { - return this.typeParameters || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.addVariableDeclToGroup = function (decl) { - if (!this.declGroups) { - this.declGroups = TypeScript.createIntrinsicsObject(); - } - - var declGroup = this.declGroups[decl.name]; - if (declGroup) { - declGroup.addDecl(decl); - } else { - declGroup = new PullDeclGroup(decl.name); - declGroup.addDecl(decl); - this.declGroups[decl.name] = declGroup; - } - }; - - PullDecl.prototype.getVariableDeclGroups = function () { - var declGroups = null; - - if (this.declGroups) { - for (var declName in this.declGroups) { - if (this.declGroups[declName]) { - if (declGroups === null) { - declGroups = []; - } - - declGroups.push(this.declGroups[declName].getDecls()); - } - } - } - - return declGroups || sentinelEmptyPullDeclArray; - }; - - PullDecl.prototype.hasBeenBound = function () { - return this.hasSymbol() || this.hasSignatureSymbol(); - }; - - PullDecl.prototype.isSynthesized = function () { - return false; - }; - - PullDecl.prototype.ast = function () { - return this.semanticInfoChain.getASTForDecl(this); - }; - - PullDecl.prototype.isRootDecl = function () { - throw TypeScript.Errors.abstract(); - }; - return PullDecl; - })(); - TypeScript.PullDecl = PullDecl; - - var RootPullDecl = (function (_super) { - __extends(RootPullDecl, _super); - function RootPullDecl(name, fileName, kind, declFlags, semanticInfoChain, isExternalModule) { - _super.call(this, name, name, kind, declFlags, semanticInfoChain); - this.semanticInfoChain = semanticInfoChain; - this._isExternalModule = isExternalModule; - this._fileName = fileName; - } - RootPullDecl.prototype.fileName = function () { - return this._fileName; - }; - - RootPullDecl.prototype.getParentPath = function () { - return [this]; - }; - - RootPullDecl.prototype.getParentDecl = function () { - return null; - }; - - RootPullDecl.prototype.isExternalModule = function () { - return this._isExternalModule; - }; - - RootPullDecl.prototype.getEnclosingDecl = function () { - return this; - }; - RootPullDecl.prototype.isRootDecl = function () { - return true; - }; - return RootPullDecl; - })(PullDecl); - TypeScript.RootPullDecl = RootPullDecl; - - var NormalPullDecl = (function (_super) { - __extends(NormalPullDecl, _super); - function NormalPullDecl(declName, displayName, kind, declFlags, parentDecl, addToParent) { - if (typeof addToParent === "undefined") { addToParent = true; } - _super.call(this, declName, displayName, kind, declFlags, parentDecl ? parentDecl.semanticInfoChain : null); - this.parentDecl = null; - this.parentPath = null; - - this.parentDecl = parentDecl; - if (addToParent) { - parentDecl.addChildDecl(this); - } - - if (this.parentDecl) { - if (this.parentDecl.isRootDecl()) { - this._rootDecl = this.parentDecl; - } else { - this._rootDecl = this.parentDecl._rootDecl; - } - } else { - TypeScript.Debug.assert(this.isSynthesized()); - this._rootDecl = null; - } - } - NormalPullDecl.prototype.fileName = function () { - return this._rootDecl.fileName(); - }; - - NormalPullDecl.prototype.getParentDecl = function () { - return this.parentDecl; - }; - - NormalPullDecl.prototype.getParentPath = function () { - if (!this.parentPath) { - var path = [this]; - var parentDecl = this.parentDecl; - - while (parentDecl) { - if (parentDecl && path[path.length - 1] !== parentDecl && !(parentDecl.kind & (256 /* ObjectLiteral */ | 8388608 /* ObjectType */))) { - path.unshift(parentDecl); - } - - parentDecl = parentDecl.getParentDecl(); - } - - this.parentPath = path; - } - - return this.parentPath; - }; - - NormalPullDecl.prototype.isExternalModule = function () { - return false; - }; - - NormalPullDecl.prototype.getEnclosingDecl = function () { - return this.parentDecl && this.parentDecl._getEnclosingDeclFromParentDecl(); - }; - - NormalPullDecl.prototype.isRootDecl = function () { - return false; - }; - return NormalPullDecl; - })(PullDecl); - TypeScript.NormalPullDecl = NormalPullDecl; - - var PullEnumElementDecl = (function (_super) { - __extends(PullEnumElementDecl, _super); - function PullEnumElementDecl(declName, displayName, parentDecl) { - _super.call(this, declName, displayName, 67108864 /* EnumMember */, 4 /* Public */, parentDecl); - this.constantValue = null; - } - return PullEnumElementDecl; - })(NormalPullDecl); - TypeScript.PullEnumElementDecl = PullEnumElementDecl; - - var PullFunctionExpressionDecl = (function (_super) { - __extends(PullFunctionExpressionDecl, _super); - function PullFunctionExpressionDecl(expressionName, declFlags, parentDecl, displayName) { - if (typeof displayName === "undefined") { displayName = ""; } - _super.call(this, "", displayName, 131072 /* FunctionExpression */, declFlags, parentDecl); - this.functionExpressionName = expressionName; - } - PullFunctionExpressionDecl.prototype.getFunctionExpressionName = function () { - return this.functionExpressionName; - }; - return PullFunctionExpressionDecl; - })(NormalPullDecl); - TypeScript.PullFunctionExpressionDecl = PullFunctionExpressionDecl; - - var PullSynthesizedDecl = (function (_super) { - __extends(PullSynthesizedDecl, _super); - function PullSynthesizedDecl(declName, displayName, kind, declFlags, parentDecl, semanticInfoChain) { - _super.call(this, declName, displayName, kind, declFlags, parentDecl, false); - this.semanticInfoChain = semanticInfoChain; - } - PullSynthesizedDecl.prototype.isSynthesized = function () { - return true; - }; - - PullSynthesizedDecl.prototype.fileName = function () { - return this._rootDecl ? this._rootDecl.fileName() : ""; - }; - return PullSynthesizedDecl; - })(NormalPullDecl); - TypeScript.PullSynthesizedDecl = PullSynthesizedDecl; - - var PullDeclGroup = (function () { - function PullDeclGroup(name) { - this.name = name; - this._decls = []; - } - PullDeclGroup.prototype.addDecl = function (decl) { - if (decl.name === this.name) { - this._decls[this._decls.length] = decl; - } - }; - - PullDeclGroup.prototype.getDecls = function () { - return this._decls; - }; - return PullDeclGroup; - })(); - TypeScript.PullDeclGroup = PullDeclGroup; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.pullSymbolID = 0; - TypeScript.sentinelEmptyArray = []; - - var PullSymbol = (function () { - function PullSymbol(name, declKind) { - this.pullSymbolID = ++TypeScript.pullSymbolID; - this._container = null; - this.type = null; - this._declarations = null; - this.isResolved = false; - this.isOptional = false; - this.inResolution = false; - this.isSynthesized = false; - this.isVarArg = false; - this.rootSymbol = null; - this._enclosingSignature = null; - this._docComments = null; - this.isPrinting = false; - this.name = name; - this.kind = declKind; - } - PullSymbol.prototype.isAny = function () { - return false; - }; - - PullSymbol.prototype.isType = function () { - return (this.kind & 58728795 /* SomeType */) !== 0; - }; - - PullSymbol.prototype.isTypeReference = function () { - return false; - }; - - PullSymbol.prototype.isSignature = function () { - return (this.kind & 7340032 /* SomeSignature */) !== 0; - }; - - PullSymbol.prototype.isArrayNamedTypeReference = function () { - return false; - }; - - PullSymbol.prototype.isPrimitive = function () { - return this.kind === 2 /* Primitive */; - }; - - PullSymbol.prototype.isAccessor = function () { - return false; - }; - - PullSymbol.prototype.isError = function () { - return false; - }; - - PullSymbol.prototype.isInterface = function () { - return this.kind === 16 /* Interface */; - }; - - PullSymbol.prototype.isMethod = function () { - return this.kind === 65536 /* Method */; - }; - - PullSymbol.prototype.isProperty = function () { - return this.kind === 4096 /* Property */; - }; - - PullSymbol.prototype.isAlias = function () { - return false; - }; - - PullSymbol.prototype.isContainer = function () { - return false; - }; - - PullSymbol.prototype.findAliasedType = function (scopeSymbol, skipScopeSymbolAliasesLookIn, lookIntoOnlyExportedAlias, aliasSymbols, visitedScopeDeclarations) { - if (typeof aliasSymbols === "undefined") { aliasSymbols = []; } - if (typeof visitedScopeDeclarations === "undefined") { visitedScopeDeclarations = []; } - var scopeDeclarations = scopeSymbol.getDeclarations(); - var scopeSymbolAliasesToLookIn = []; - - for (var i = 0; i < scopeDeclarations.length; i++) { - var scopeDecl = scopeDeclarations[i]; - if (!TypeScript.ArrayUtilities.contains(visitedScopeDeclarations, scopeDecl)) { - visitedScopeDeclarations.push(scopeDecl); - - var childDecls = scopeDecl.getChildDecls(); - for (var j = 0; j < childDecls.length; j++) { - var childDecl = childDecls[j]; - if (childDecl.kind === 128 /* TypeAlias */ && (!lookIntoOnlyExportedAlias || (childDecl.flags & 1 /* Exported */))) { - var symbol = childDecl.getSymbol(); - - if (PullContainerSymbol.usedAsSymbol(symbol, this) || (this.rootSymbol && PullContainerSymbol.usedAsSymbol(symbol, this.rootSymbol))) { - aliasSymbols.push(symbol); - return aliasSymbols; - } - - if (!skipScopeSymbolAliasesLookIn && this.isExternalModuleReferenceAlias(symbol) && (!symbol.assignedContainer().hasExportAssignment() || (symbol.assignedContainer().getExportAssignedContainerSymbol() && symbol.assignedContainer().getExportAssignedContainerSymbol().kind === 32 /* DynamicModule */))) { - scopeSymbolAliasesToLookIn.push(symbol); - } - } - } - } - } - - for (var i = 0; i < scopeSymbolAliasesToLookIn.length; i++) { - var scopeSymbolAlias = scopeSymbolAliasesToLookIn[i]; - - aliasSymbols.push(scopeSymbolAlias); - var result = this.findAliasedType(scopeSymbolAlias.assignedContainer().hasExportAssignment() ? scopeSymbolAlias.assignedContainer().getExportAssignedContainerSymbol() : scopeSymbolAlias.assignedContainer(), false, true, aliasSymbols, visitedScopeDeclarations); - if (result) { - return result; - } - - aliasSymbols.pop(); - } - - return null; - }; - - PullSymbol.prototype.getExternalAliasedSymbols = function (scopeSymbol) { - if (!scopeSymbol) { - return null; - } - - var scopePath = scopeSymbol.pathToRoot(); - if (scopePath.length && scopePath[scopePath.length - 1].kind === 32 /* DynamicModule */) { - var symbols = this.findAliasedType(scopePath[scopePath.length - 1]); - return symbols; - } - - return null; - }; - - PullSymbol.prototype.isExternalModuleReferenceAlias = function (aliasSymbol) { - if (aliasSymbol) { - if (aliasSymbol.assignedValue()) { - return false; - } - - if (aliasSymbol.assignedType() && aliasSymbol.assignedType() !== aliasSymbol.assignedContainer()) { - return false; - } - - if (aliasSymbol.assignedContainer() && aliasSymbol.assignedContainer().kind !== 32 /* DynamicModule */) { - return false; - } - - return true; - } - - return false; - }; - - PullSymbol.prototype.getExportedInternalAliasSymbol = function (scopeSymbol) { - if (scopeSymbol) { - if (this.kind !== 128 /* TypeAlias */) { - var scopePath = scopeSymbol.pathToRoot(); - for (var i = 0; i < scopePath.length; i++) { - var internalAliases = this.findAliasedType(scopeSymbol, true, true); - if (internalAliases) { - TypeScript.Debug.assert(internalAliases.length === 1); - return internalAliases[0]; - } - } - } - } - - return null; - }; - - PullSymbol.prototype.getAliasSymbolName = function (scopeSymbol, aliasNameGetter, aliasPartsNameGetter, skipInternalAlias) { - if (!skipInternalAlias) { - var internalAlias = this.getExportedInternalAliasSymbol(scopeSymbol); - if (internalAlias) { - return aliasNameGetter(internalAlias); - } - } - - var externalAliases = this.getExternalAliasedSymbols(scopeSymbol); - - if (externalAliases && this.isExternalModuleReferenceAlias(externalAliases[externalAliases.length - 1])) { - var aliasFullName = aliasNameGetter(externalAliases[0]); - if (!aliasFullName) { - return null; - } - for (var i = 1, symbolsLen = externalAliases.length; i < symbolsLen; i++) { - aliasFullName = aliasFullName + "." + aliasPartsNameGetter(externalAliases[i]); - } - return aliasFullName; - } - - return null; - }; - - PullSymbol.prototype._getResolver = function () { - TypeScript.Debug.assert(this._declarations && this._declarations.length > 0); - return this._declarations[0].semanticInfoChain.getResolver(); - }; - - PullSymbol.prototype._resolveDeclaredSymbol = function () { - return this._getResolver().resolveDeclaredSymbol(this); - }; - - PullSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - var aliasName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getName(scopeSymbol, useConstraintInName); - }, function (symbol) { - return symbol.getName(); - }); - return aliasName || this.name; - }; - - PullSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - var aliasDisplayName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getDisplayName(scopeSymbol, useConstraintInName); - }, function (symbol) { - return symbol.getDisplayName(); - }, skipInternalAliasName); - if (aliasDisplayName) { - return aliasDisplayName; - } - - var decls = this.getDeclarations(); - var name = decls.length && decls[0].getDisplayName(); - - return (name && name.length) ? name : this.name; - }; - - PullSymbol.prototype.getIsSpecialized = function () { - return false; - }; - - PullSymbol.prototype.getRootSymbol = function () { - if (!this.rootSymbol) { - return this; - } - return this.rootSymbol; - }; - PullSymbol.prototype.setRootSymbol = function (symbol) { - this.rootSymbol = symbol; - }; - - PullSymbol.prototype.setIsSynthesized = function (value) { - if (typeof value === "undefined") { value = true; } - TypeScript.Debug.assert(this.rootSymbol == null); - this.isSynthesized = value; - }; - - PullSymbol.prototype.getIsSynthesized = function () { - if (this.rootSymbol) { - return this.rootSymbol.getIsSynthesized(); - } - return this.isSynthesized; - }; - - PullSymbol.prototype.setEnclosingSignature = function (signature) { - this._enclosingSignature = signature; - }; - - PullSymbol.prototype.getEnclosingSignature = function () { - return this._enclosingSignature; - }; - - PullSymbol.prototype.addDeclaration = function (decl) { - TypeScript.Debug.assert(!!decl); - - if (this.rootSymbol) { - return; - } - - if (!this._declarations) { - this._declarations = [decl]; - } else { - this._declarations[this._declarations.length] = decl; - } - }; - - PullSymbol.prototype.getDeclarations = function () { - if (this.rootSymbol) { - return this.rootSymbol.getDeclarations(); - } - - if (!this._declarations) { - this._declarations = []; - } - - return this._declarations; - }; - - PullSymbol.prototype.hasDeclaration = function (decl) { - if (!this._declarations) { - return false; - } - - return TypeScript.ArrayUtilities.any(this._declarations, function (eachDecl) { - return eachDecl === decl; - }); - }; - - PullSymbol.prototype.setContainer = function (containerSymbol) { - if (this.rootSymbol) { - return; - } - - this._container = containerSymbol; - }; - - PullSymbol.prototype.getContainer = function () { - if (this.rootSymbol) { - return this.rootSymbol.getContainer(); - } - - return this._container; - }; - - PullSymbol.prototype.setResolved = function () { - this.isResolved = true; - this.inResolution = false; - }; - - PullSymbol.prototype.startResolving = function () { - this.inResolution = true; - }; - - PullSymbol.prototype.setUnresolved = function () { - this.isResolved = false; - this.inResolution = false; - }; - - PullSymbol.prototype.anyDeclHasFlag = function (flag) { - var declarations = this.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - if (TypeScript.hasFlag(declarations[i].flags, flag)) { - return true; - } - } - return false; - }; - - PullSymbol.prototype.allDeclsHaveFlag = function (flag) { - var declarations = this.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - if (!TypeScript.hasFlag(declarations[i].flags, flag)) { - return false; - } - } - return true; - }; - - PullSymbol.prototype.pathToRoot = function () { - var path = []; - var node = this; - while (node) { - if (node.isType()) { - var associatedContainerSymbol = node.getAssociatedContainerType(); - if (associatedContainerSymbol) { - node = associatedContainerSymbol; - } - } - path[path.length] = node; - var nodeKind = node.kind; - if (nodeKind === 2048 /* Parameter */) { - break; - } else { - node = node.getContainer(); - } - } - return path; - }; - - PullSymbol.unqualifiedNameReferencesDifferentSymbolInScope = function (symbol, scopePath, endScopePathIndex) { - var declPath = scopePath[0].getDeclarations()[0].getParentPath(); - for (var i = 0, declIndex = declPath.length - 1; i <= endScopePathIndex; i++, declIndex--) { - if (symbol.isContainer() && scopePath[i].isContainer()) { - var scopeType = scopePath[i]; - - var memberSymbol = scopeType.findContainedNonMemberContainer(symbol.name, 164 /* SomeContainer */); - if (memberSymbol && memberSymbol != symbol && memberSymbol.getDeclarations()[0].getParentDecl() == declPath[declIndex]) { - return true; - } - - var memberSymbol = scopeType.findNestedContainer(symbol.name, 164 /* SomeContainer */); - if (memberSymbol && memberSymbol != symbol) { - return true; - } - } - } - - return false; - }; - - PullSymbol.prototype.findQualifyingSymbolPathInScopeSymbol = function (scopeSymbol) { - var thisPath = this.pathToRoot(); - if (thisPath.length === 1) { - return thisPath; - } - - var scopeSymbolPath; - if (scopeSymbol) { - scopeSymbolPath = scopeSymbol.pathToRoot(); - } else { - return thisPath; - } - - var thisCommonAncestorIndex = TypeScript.ArrayUtilities.indexOf(thisPath, function (thisNode) { - return TypeScript.ArrayUtilities.contains(scopeSymbolPath, thisNode); - }); - if (thisCommonAncestorIndex > 0) { - var thisCommonAncestor = thisPath[thisCommonAncestorIndex]; - var scopeCommonAncestorIndex = TypeScript.ArrayUtilities.indexOf(scopeSymbolPath, function (scopeNode) { - return scopeNode === thisCommonAncestor; - }); - TypeScript.Debug.assert(thisPath.length - thisCommonAncestorIndex === scopeSymbolPath.length - scopeCommonAncestorIndex); - - for (; thisCommonAncestorIndex < thisPath.length; thisCommonAncestorIndex++, scopeCommonAncestorIndex++) { - if (!PullSymbol.unqualifiedNameReferencesDifferentSymbolInScope(thisPath[thisCommonAncestorIndex - 1], scopeSymbolPath, scopeCommonAncestorIndex)) { - break; - } - } - } - - if (thisCommonAncestorIndex >= 0 && thisCommonAncestorIndex < thisPath.length) { - return thisPath.slice(0, thisCommonAncestorIndex); - } else { - return thisPath; - } - }; - - PullSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var str = this.getNameAndTypeName(scopeSymbol); - return str; - }; - - PullSymbol.prototype.getNamePartForFullName = function () { - return this.getDisplayName(null, true); - }; - - PullSymbol.prototype.fullName = function (scopeSymbol) { - var _this = this; - var path = this.pathToRoot(); - var fullName = ""; - - var aliasFullName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.fullName(scopeSymbol); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }); - if (aliasFullName) { - return aliasFullName; - } - - for (var i = 1; i < path.length; i++) { - var aliasFullName = path[i].getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol === _this ? null : symbol.fullName(scopeSymbol); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }); - if (aliasFullName) { - fullName = aliasFullName + "." + fullName; - break; - } - - var scopedName = path[i].getNamePartForFullName(); - if (path[i].kind === 32 /* DynamicModule */ && !TypeScript.isQuoted(scopedName)) { - break; - } - - if (scopedName === "") { - break; - } - - fullName = scopedName + "." + fullName; - } - - fullName = fullName + this.getNamePartForFullName(); - return fullName; - }; - - PullSymbol.prototype.getScopedName = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName) { - var path = this.findQualifyingSymbolPathInScopeSymbol(scopeSymbol); - var fullName = ""; - - var aliasFullName = this.getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getScopedName(scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }, skipInternalAliasName); - if (aliasFullName) { - return aliasFullName; - } - - for (var i = 1; i < path.length; i++) { - var kind = path[i].kind; - if (kind === 4 /* Container */ || kind === 32 /* DynamicModule */) { - var aliasFullName = path[i].getAliasSymbolName(scopeSymbol, function (symbol) { - return symbol.getScopedName(scopeSymbol, skipTypeParametersInName, false, skipInternalAliasName); - }, function (symbol) { - return symbol.getNamePartForFullName(); - }, skipInternalAliasName); - if (aliasFullName) { - fullName = aliasFullName + "." + fullName; - break; - } - - if (kind === 4 /* Container */) { - fullName = path[i].getDisplayName() + "." + fullName; - } else { - var displayName = path[i].getDisplayName(); - if (TypeScript.isQuoted(displayName)) { - fullName = displayName + "." + fullName; - } - break; - } - } else { - break; - } - } - fullName = fullName + this.getDisplayName(scopeSymbol, useConstraintInName, skipInternalAliasName); - return fullName; - }; - - PullSymbol.prototype.getScopedNameEx = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName) { - var name = this.getScopedName(scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - return TypeScript.MemberName.create(name); - }; - - PullSymbol.prototype.getTypeName = function (scopeSymbol, getPrettyTypeName) { - var memberName = this.getTypeNameEx(scopeSymbol, getPrettyTypeName); - return memberName.toString(); - }; - - PullSymbol.prototype.getTypeNameEx = function (scopeSymbol, getPrettyTypeName) { - var type = this.type; - if (type) { - var memberName = getPrettyTypeName ? this.getTypeNameForFunctionSignature("", scopeSymbol, getPrettyTypeName) : null; - if (!memberName) { - memberName = type.getScopedNameEx(scopeSymbol, false, true, getPrettyTypeName); - } - - return memberName; - } - return TypeScript.MemberName.create(""); - }; - - PullSymbol.prototype.getTypeNameForFunctionSignature = function (prefix, scopeSymbol, getPrettyTypeName) { - var type = this.type; - if (type && !type.isNamedTypeSymbol() && this.kind !== 4096 /* Property */ && this.kind !== 512 /* Variable */ && this.kind !== 2048 /* Parameter */) { - var signatures = type.getCallSignatures(); - if (signatures.length === 1 || (getPrettyTypeName && signatures.length)) { - var typeName = new TypeScript.MemberNameArray(); - var signatureName = PullSignatureSymbol.getSignaturesTypeNameEx(signatures, prefix, false, false, scopeSymbol, getPrettyTypeName); - typeName.addAll(signatureName); - return typeName; - } - } - - return null; - }; - - PullSymbol.prototype.getNameAndTypeName = function (scopeSymbol) { - var nameAndTypeName = this.getNameAndTypeNameEx(scopeSymbol); - return nameAndTypeName.toString(); - }; - - PullSymbol.prototype.getNameAndTypeNameEx = function (scopeSymbol) { - var type = this.type; - var nameStr = this.getDisplayName(scopeSymbol); - if (type) { - nameStr = nameStr + (this.isOptional ? "?" : ""); - var memberName = this.getTypeNameForFunctionSignature(nameStr, scopeSymbol); - if (!memberName) { - var typeNameEx = type.getScopedNameEx(scopeSymbol); - memberName = TypeScript.MemberName.create(typeNameEx, nameStr + ": ", ""); - } - return memberName; - } - return TypeScript.MemberName.create(nameStr); - }; - - PullSymbol.getTypeParameterString = function (typars, scopeSymbol, useContraintInName) { - return PullSymbol.getTypeParameterStringEx(typars, scopeSymbol, undefined, useContraintInName).toString(); - }; - - PullSymbol.getTypeParameterStringEx = function (typeParameters, scopeSymbol, getTypeParamMarkerInfo, useContraintInName) { - var builder = new TypeScript.MemberNameArray(); - builder.prefix = ""; - - if (typeParameters && typeParameters.length) { - builder.add(TypeScript.MemberName.create("<")); - - for (var i = 0; i < typeParameters.length; i++) { - if (i) { - builder.add(TypeScript.MemberName.create(", ")); - } - - if (getTypeParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - - builder.add(typeParameters[i].getScopedNameEx(scopeSymbol, false, useContraintInName)); - - if (getTypeParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - } - - builder.add(TypeScript.MemberName.create(">")); - } - - return builder; - }; - - PullSymbol.getIsExternallyVisible = function (symbol, fromIsExternallyVisibleSymbol, inIsExternallyVisibleSymbols) { - if (inIsExternallyVisibleSymbols) { - for (var i = 0; i < inIsExternallyVisibleSymbols.length; i++) { - if (inIsExternallyVisibleSymbols[i] === symbol) { - return true; - } - } - } else { - inIsExternallyVisibleSymbols = []; - } - - if (fromIsExternallyVisibleSymbol === symbol) { - return true; - } - - inIsExternallyVisibleSymbols.push(fromIsExternallyVisibleSymbol); - - var result = symbol.isExternallyVisible(inIsExternallyVisibleSymbols); - - TypeScript.Debug.assert(TypeScript.ArrayUtilities.last(inIsExternallyVisibleSymbols) === fromIsExternallyVisibleSymbol); - inIsExternallyVisibleSymbols.pop(); - - return result; - }; - - PullSymbol.prototype.isExternallyVisible = function (inIsExternallyVisibleSymbols) { - var kind = this.kind; - if (kind === 2 /* Primitive */) { - return true; - } - - if (this.rootSymbol) { - return PullSymbol.getIsExternallyVisible(this.rootSymbol, this, inIsExternallyVisibleSymbols); - } - - if (this.isType()) { - var associatedContainerSymbol = this.getAssociatedContainerType(); - if (associatedContainerSymbol) { - return PullSymbol.getIsExternallyVisible(associatedContainerSymbol, this, inIsExternallyVisibleSymbols); - } - } - - if (this.anyDeclHasFlag(2 /* Private */)) { - return false; - } - - var container = this.getContainer(); - if (container === null) { - var decls = this.getDeclarations(); - if (decls.length) { - var parentDecl = decls[0].getParentDecl(); - if (parentDecl) { - var parentSymbol = parentDecl.getSymbol(); - if (!parentSymbol || parentDecl.kind === 1 /* Script */) { - return true; - } - - return PullSymbol.getIsExternallyVisible(parentSymbol, this, inIsExternallyVisibleSymbols); - } - } - - return true; - } - - if (container.kind === 32 /* DynamicModule */ || (container.getAssociatedContainerType() && container.getAssociatedContainerType().kind === 32 /* DynamicModule */)) { - var containerSymbol = container.kind === 32 /* DynamicModule */ ? container : container.getAssociatedContainerType(); - if (PullContainerSymbol.usedAsSymbol(containerSymbol, this)) { - return true; - } - } - - if (!this.anyDeclHasFlag(1 /* Exported */) && kind !== 4096 /* Property */ && kind !== 65536 /* Method */) { - return false; - } - - return PullSymbol.getIsExternallyVisible(container, this, inIsExternallyVisibleSymbols); - }; - - PullSymbol.prototype.getDocCommentsOfDecl = function (decl) { - var ast = decl.ast(); - - if (ast) { - var enclosingModuleDeclaration = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast); - if (TypeScript.ASTHelpers.isLastNameOfModule(enclosingModuleDeclaration, ast)) { - return TypeScript.ASTHelpers.docComments(enclosingModuleDeclaration); - } - - if (ast.kind() !== 130 /* ModuleDeclaration */ || decl.kind !== 512 /* Variable */) { - return TypeScript.ASTHelpers.docComments(ast); - } - } - - return []; - }; - - PullSymbol.prototype.getDocCommentArray = function (symbol) { - var docComments = []; - if (!symbol) { - return docComments; - } - - var isParameter = symbol.kind === 2048 /* Parameter */; - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - if (isParameter && decls[i].kind === 4096 /* Property */) { - continue; - } - docComments = docComments.concat(this.getDocCommentsOfDecl(decls[i])); - } - return docComments; - }; - - PullSymbol.getDefaultConstructorSymbolForDocComments = function (classSymbol) { - if (classSymbol.getHasDefaultConstructor()) { - var extendedTypes = classSymbol.getExtendedTypes(); - if (extendedTypes.length) { - return PullSymbol.getDefaultConstructorSymbolForDocComments(extendedTypes[0]); - } - } - - return classSymbol.type.getConstructSignatures()[0]; - }; - - PullSymbol.prototype.getDocCommentText = function (comments) { - var docCommentText = new Array(); - for (var c = 0; c < comments.length; c++) { - var commentText = this.getDocCommentTextValue(comments[c]); - if (commentText !== "") { - docCommentText.push(commentText); - } - } - return docCommentText.join("\n"); - }; - - PullSymbol.prototype.getDocCommentTextValue = function (comment) { - return this.cleanJSDocComment(comment.fullText()); - }; - - PullSymbol.prototype.docComments = function (useConstructorAsClass) { - var decls = this.getDeclarations(); - if (useConstructorAsClass && decls.length && decls[0].kind === 32768 /* ConstructorMethod */) { - var classDecl = decls[0].getParentDecl(); - return this.getDocCommentText(this.getDocCommentsOfDecl(classDecl)); - } - - if (this._docComments === null) { - var docComments = ""; - if (!useConstructorAsClass && this.kind === 2097152 /* ConstructSignature */ && decls.length && decls[0].kind === 8 /* Class */) { - var classSymbol = this.returnType; - var extendedTypes = classSymbol.getExtendedTypes(); - if (extendedTypes.length) { - docComments = extendedTypes[0].getConstructorMethod().docComments(); - } else { - docComments = ""; - } - } else if (this.kind === 2048 /* Parameter */) { - var parameterComments = []; - - var funcContainer = this.getEnclosingSignature(); - var funcDocComments = this.getDocCommentArray(funcContainer); - var paramComment = this.getParameterDocCommentText(this.getDisplayName(), funcDocComments); - if (paramComment != "") { - parameterComments.push(paramComment); - } - - var paramSelfComment = this.getDocCommentText(this.getDocCommentArray(this)); - if (paramSelfComment != "") { - parameterComments.push(paramSelfComment); - } - docComments = parameterComments.join("\n"); - } else { - var getSymbolComments = true; - if (this.kind === 16777216 /* FunctionType */) { - var functionSymbol = this.getFunctionSymbol(); - - if (functionSymbol) { - docComments = functionSymbol._docComments || ""; - getSymbolComments = false; - } else { - var declarationList = this.getDeclarations(); - if (declarationList.length > 0) { - docComments = declarationList[0].getSymbol()._docComments || ""; - getSymbolComments = false; - } - } - } - if (getSymbolComments) { - docComments = this.getDocCommentText(this.getDocCommentArray(this)); - if (docComments === "") { - if (this.kind === 1048576 /* CallSignature */) { - var callTypeSymbol = this.functionType; - if (callTypeSymbol && callTypeSymbol.getCallSignatures().length === 1) { - docComments = callTypeSymbol.docComments(); - } - } - } - } - } - - this._docComments = docComments; - } - - return this._docComments; - }; - - PullSymbol.prototype.getParameterDocCommentText = function (param, fncDocComments) { - if (fncDocComments.length === 0 || fncDocComments[0].kind() !== 6 /* MultiLineCommentTrivia */) { - return ""; - } - - for (var i = 0; i < fncDocComments.length; i++) { - var commentContents = fncDocComments[i].fullText(); - for (var j = commentContents.indexOf("@param", 0); 0 <= j; j = commentContents.indexOf("@param", j)) { - j += 6; - if (!this.isSpaceChar(commentContents, j)) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j); - if (j === -1) { - break; - } - - if (commentContents.charCodeAt(j) === 123 /* openBrace */) { - j++; - - var charCode = 0; - for (var curlies = 1; j < commentContents.length; j++) { - charCode = commentContents.charCodeAt(j); - - if (charCode === 123 /* openBrace */) { - curlies++; - continue; - } - - if (charCode === 125 /* closeBrace */) { - curlies--; - if (curlies === 0) { - break; - } else { - continue; - } - } - - if (charCode === 64 /* at */) { - break; - } - } - - if (j === commentContents.length) { - break; - } - - if (charCode === 64 /* at */) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j + 1); - if (j === -1) { - break; - } - } - - if (param !== commentContents.substr(j, param.length) || !this.isSpaceChar(commentContents, j + param.length)) { - continue; - } - - j = this.consumeLeadingSpace(commentContents, j + param.length); - if (j === -1) { - return ""; - } - - var endOfParam = commentContents.indexOf("@", j); - var paramHelpString = commentContents.substring(j, endOfParam < 0 ? commentContents.length : endOfParam); - - var paramSpacesToRemove = undefined; - var paramLineIndex = commentContents.substring(0, j).lastIndexOf("\n") + 1; - if (paramLineIndex !== 0) { - if (paramLineIndex < j && commentContents.charAt(paramLineIndex + 1) === "\r") { - paramLineIndex++; - } - } - var startSpaceRemovalIndex = this.consumeLeadingSpace(commentContents, paramLineIndex); - if (startSpaceRemovalIndex !== j && commentContents.charAt(startSpaceRemovalIndex) === "*") { - paramSpacesToRemove = j - startSpaceRemovalIndex - 1; - } - - return this.cleanJSDocComment(paramHelpString, paramSpacesToRemove); - } - } - - return ""; - }; - - PullSymbol.prototype.cleanJSDocComment = function (content, spacesToRemove) { - var docCommentLines = new Array(); - content = content.replace("/**", ""); - if (content.length >= 2 && content.charAt(content.length - 1) === "/" && content.charAt(content.length - 2) === "*") { - content = content.substring(0, content.length - 2); - } - var lines = content.split("\n"); - var inParamTag = false; - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - var cleanLinePos = this.cleanDocCommentLine(line, true, spacesToRemove); - if (!cleanLinePos) { - continue; - } - - var docCommentText = ""; - var prevPos = cleanLinePos.start; - for (var i = line.indexOf("@", cleanLinePos.start); 0 <= i && i < cleanLinePos.end; i = line.indexOf("@", i + 1)) { - var wasInParamtag = inParamTag; - - if (line.indexOf("param", i + 1) === i + 1 && this.isSpaceChar(line, i + 6)) { - if (!wasInParamtag) { - docCommentText += line.substring(prevPos, i); - } - - prevPos = i; - inParamTag = true; - } else if (wasInParamtag) { - prevPos = i; - inParamTag = false; - } - } - - if (!inParamTag) { - docCommentText += line.substring(prevPos, cleanLinePos.end); - } - - var newCleanPos = this.cleanDocCommentLine(docCommentText, false); - if (newCleanPos) { - if (spacesToRemove === undefined) { - spacesToRemove = cleanLinePos.jsDocSpacesRemoved; - } - docCommentLines.push(docCommentText); - } - } - - return docCommentLines.join("\n"); - }; - - PullSymbol.prototype.consumeLeadingSpace = function (line, startIndex, maxSpacesToRemove) { - var endIndex = line.length; - if (maxSpacesToRemove !== undefined) { - endIndex = TypeScript.MathPrototype.min(startIndex + maxSpacesToRemove, endIndex); - } - - for (; startIndex < endIndex; startIndex++) { - var charCode = line.charCodeAt(startIndex); - if (charCode !== 32 /* space */ && charCode !== 9 /* tab */) { - return startIndex; - } - } - - if (endIndex !== line.length) { - return endIndex; - } - - return -1; - }; - - PullSymbol.prototype.isSpaceChar = function (line, index) { - var length = line.length; - if (index < length) { - var charCode = line.charCodeAt(index); - - return charCode === 32 /* space */ || charCode === 9 /* tab */; - } - - return index === length; - }; - - PullSymbol.prototype.cleanDocCommentLine = function (line, jsDocStyleComment, jsDocLineSpaceToRemove) { - var nonSpaceIndex = this.consumeLeadingSpace(line, 0); - if (nonSpaceIndex !== -1) { - var jsDocSpacesRemoved = nonSpaceIndex; - if (jsDocStyleComment && line.charAt(nonSpaceIndex) === '*') { - var startIndex = nonSpaceIndex + 1; - nonSpaceIndex = this.consumeLeadingSpace(line, startIndex, jsDocLineSpaceToRemove); - - if (nonSpaceIndex !== -1) { - jsDocSpacesRemoved = nonSpaceIndex - startIndex; - } else { - return null; - } - } - - return { - start: nonSpaceIndex, - end: line.charAt(line.length - 1) === "\r" ? line.length - 1 : line.length, - jsDocSpacesRemoved: jsDocSpacesRemoved - }; - } - - return null; - }; - return PullSymbol; - })(); - TypeScript.PullSymbol = PullSymbol; - - - - var PullSignatureSymbol = (function (_super) { - __extends(PullSignatureSymbol, _super); - function PullSignatureSymbol(kind, _isDefinition) { - if (typeof _isDefinition === "undefined") { _isDefinition = false; } - _super.call(this, "", kind); - this._isDefinition = _isDefinition; - this._memberTypeParameterNameCache = null; - this._stringConstantOverload = undefined; - this.parameters = TypeScript.sentinelEmptyArray; - this._typeParameters = null; - this.returnType = null; - this.functionType = null; - this.hasOptionalParam = false; - this.nonOptionalParamCount = 0; - this.hasVarArgs = false; - this._allowedToReferenceTypeParameters = null; - this._instantiationCache = null; - this.hasBeenChecked = false; - this.inWrapCheck = false; - this.inWrapInfiniteExpandingReferenceCheck = false; - } - PullSignatureSymbol.prototype.isDefinition = function () { - return this._isDefinition; - }; - - PullSignatureSymbol.prototype.isGeneric = function () { - var typeParameters = this.getTypeParameters(); - return !!typeParameters && typeParameters.length !== 0; - }; - - PullSignatureSymbol.prototype.addParameter = function (parameter, isOptional) { - if (typeof isOptional === "undefined") { isOptional = false; } - if (this.parameters === TypeScript.sentinelEmptyArray) { - this.parameters = []; - } - - this.parameters[this.parameters.length] = parameter; - this.hasOptionalParam = isOptional; - - if (!parameter.getEnclosingSignature()) { - parameter.setEnclosingSignature(this); - } - - if (!isOptional) { - this.nonOptionalParamCount++; - } - }; - - PullSignatureSymbol.prototype.addTypeParameter = function (typeParameter) { - if (!this._typeParameters) { - this._typeParameters = []; - } - - if (!this._memberTypeParameterNameCache) { - this._memberTypeParameterNameCache = TypeScript.createIntrinsicsObject(); - } - - this._typeParameters[this._typeParameters.length] = typeParameter; - - this._memberTypeParameterNameCache[typeParameter.getName()] = typeParameter; - }; - - PullSignatureSymbol.prototype.addTypeParametersFromReturnType = function () { - var typeParameters = this.returnType.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - this.addTypeParameter(typeParameters[i]); - } - }; - - PullSignatureSymbol.prototype.getTypeParameters = function () { - if (!this._typeParameters) { - this._typeParameters = []; - } - - return this._typeParameters; - }; - - PullSignatureSymbol.prototype.findTypeParameter = function (name) { - var memberSymbol; - - if (!this._memberTypeParameterNameCache) { - this._memberTypeParameterNameCache = TypeScript.createIntrinsicsObject(); - - for (var i = 0; i < this.getTypeParameters().length; i++) { - this._memberTypeParameterNameCache[this._typeParameters[i].getName()] = this._typeParameters[i]; - } - } - - memberSymbol = this._memberTypeParameterNameCache[name]; - - return memberSymbol; - }; - - PullSignatureSymbol.prototype.getTypeParameterArgumentMap = function () { - return null; - }; - - PullSignatureSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._allowedToReferenceTypeParameters) { - this._allowedToReferenceTypeParameters = TypeScript.PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl(this.getDeclarations()[0]); - } - - return this._allowedToReferenceTypeParameters; - }; - - PullSignatureSymbol.prototype.addSpecialization = function (specializedVersionOfThisSignature, typeArgumentMap) { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._instantiationCache) { - this._instantiationCache = TypeScript.createIntrinsicsObject(); - } - - this._instantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)] = specializedVersionOfThisSignature; - }; - - PullSignatureSymbol.prototype.getSpecialization = function (typeArgumentMap) { - TypeScript.Debug.assert(this.getRootSymbol() == this); - if (!this._instantiationCache) { - return null; - } - - var result = this._instantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)]; - return result || null; - }; - - PullSignatureSymbol.prototype.isStringConstantOverloadSignature = function () { - if (this._stringConstantOverload === undefined) { - var params = this.parameters; - this._stringConstantOverload = false; - for (var i = 0; i < params.length; i++) { - var paramType = params[i].type; - if (paramType && paramType.isPrimitive() && paramType.isStringConstant()) { - this._stringConstantOverload = true; - } - } - } - - return this._stringConstantOverload; - }; - - PullSignatureSymbol.prototype.getParameterTypeAtIndex = function (iParam) { - if (iParam < this.parameters.length - 1 || (iParam < this.parameters.length && !this.hasVarArgs)) { - return this.parameters[iParam].type; - } else if (this.hasVarArgs) { - var paramType = this.parameters[this.parameters.length - 1].type; - if (paramType.isArrayNamedTypeReference()) { - paramType = paramType.getElementType(); - } - return paramType; - } - - return null; - }; - - PullSignatureSymbol.getSignatureTypeMemberName = function (candidateSignature, signatures, scopeSymbol) { - var allMemberNames = new TypeScript.MemberNameArray(); - var signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(signatures, "", false, false, scopeSymbol, true, candidateSignature); - allMemberNames.addAll(signatureMemberName); - return allMemberNames; - }; - - PullSignatureSymbol.getSignaturesTypeNameEx = function (signatures, prefix, shortform, brackets, scopeSymbol, getPrettyTypeName, candidateSignature) { - var result = []; - if (!signatures) { - return result; - } - - var len = signatures.length; - if (!getPrettyTypeName && len > 1) { - shortform = false; - } - - var foundDefinition = false; - if (candidateSignature && candidateSignature.isDefinition() && len > 1) { - candidateSignature = null; - } - - for (var i = 0; i < len; i++) { - if (len > 1 && signatures[i].isDefinition()) { - foundDefinition = true; - continue; - } - - var signature = signatures[i]; - if (getPrettyTypeName && candidateSignature) { - signature = candidateSignature; - } - - result.push(signature.getSignatureTypeNameEx(prefix, shortform, brackets, scopeSymbol)); - if (getPrettyTypeName) { - break; - } - } - - if (getPrettyTypeName && result.length && len > 1) { - var lastMemberName = result[result.length - 1]; - for (var i = i + 1; i < len; i++) { - if (signatures[i].isDefinition()) { - foundDefinition = true; - break; - } - } - var overloadString = TypeScript.getLocalizedText(TypeScript.DiagnosticCode._0_overload_s, [foundDefinition ? len - 2 : len - 1]); - lastMemberName.add(TypeScript.MemberName.create(overloadString)); - } - - return result; - }; - - PullSignatureSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var s = this.getSignatureTypeNameEx(this.getScopedNameEx().toString(), false, false, scopeSymbol, undefined, useConstraintInName).toString(); - return s; - }; - - PullSignatureSymbol.prototype.getSignatureTypeNameEx = function (prefix, shortform, brackets, scopeSymbol, getParamMarkerInfo, getTypeParamMarkerInfo) { - var typeParamterBuilder = new TypeScript.MemberNameArray(); - - typeParamterBuilder.add(PullSymbol.getTypeParameterStringEx(this.getTypeParameters(), scopeSymbol, getTypeParamMarkerInfo, true)); - - if (brackets) { - typeParamterBuilder.add(TypeScript.MemberName.create("[")); - } else { - typeParamterBuilder.add(TypeScript.MemberName.create("(")); - } - - var builder = new TypeScript.MemberNameArray(); - builder.prefix = prefix; - - if (getTypeParamMarkerInfo) { - builder.prefix = prefix; - builder.addAll(typeParamterBuilder.entries); - } else { - builder.prefix = prefix + typeParamterBuilder.toString(); - } - - var params = this.parameters; - var paramLen = params.length; - for (var i = 0; i < paramLen; i++) { - var paramType = params[i].type; - var typeString = paramType ? ": " : ""; - var paramIsVarArg = params[i].isVarArg; - var varArgPrefix = paramIsVarArg ? "..." : ""; - var optionalString = (!paramIsVarArg && params[i].isOptional) ? "?" : ""; - if (getParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - builder.add(TypeScript.MemberName.create(varArgPrefix + params[i].getScopedNameEx(scopeSymbol).toString() + optionalString + typeString)); - if (paramType) { - builder.add(paramType.getScopedNameEx(scopeSymbol)); - } - if (getParamMarkerInfo) { - builder.add(new TypeScript.MemberName()); - } - if (i < paramLen - 1) { - builder.add(TypeScript.MemberName.create(", ")); - } - } - - if (shortform) { - if (brackets) { - builder.add(TypeScript.MemberName.create("] => ")); - } else { - builder.add(TypeScript.MemberName.create(") => ")); - } - } else { - if (brackets) { - builder.add(TypeScript.MemberName.create("]: ")); - } else { - builder.add(TypeScript.MemberName.create("): ")); - } - } - - if (this.returnType) { - builder.add(this.returnType.getScopedNameEx(scopeSymbol)); - } else { - builder.add(TypeScript.MemberName.create("any")); - } - - return builder; - }; - - PullSignatureSymbol.prototype.forAllParameterTypes = function (length, predicate) { - if (this.parameters.length < length && !this.hasVarArgs) { - length = this.parameters.length; - } - - for (var i = 0; i < length; i++) { - var paramType = this.getParameterTypeAtIndex(i); - if (!predicate(paramType, i)) { - return false; - } - } - - return true; - }; - - PullSignatureSymbol.prototype.forAllCorrespondingParameterTypesInThisAndOtherSignature = function (otherSignature, predicate) { - var length; - if (this.hasVarArgs) { - length = otherSignature.hasVarArgs ? Math.max(this.parameters.length, otherSignature.parameters.length) : otherSignature.parameters.length; - } else { - length = otherSignature.hasVarArgs ? this.parameters.length : Math.min(this.parameters.length, otherSignature.parameters.length); - } - - for (var i = 0; i < length; i++) { - var thisParamType = this.getParameterTypeAtIndex(i); - var otherParamType = otherSignature.getParameterTypeAtIndex(i); - if (!predicate(thisParamType, otherParamType, i)) { - return false; - } - } - - return true; - }; - - PullSignatureSymbol.prototype.wrapsSomeTypeParameter = function (typeParameterArgumentMap) { - return this.getWrappingTypeParameterID(typeParameterArgumentMap) !== 0; - }; - - PullSignatureSymbol.prototype.getWrappingTypeParameterID = function (typeParameterArgumentMap) { - var signature = this; - if (signature.inWrapCheck) { - return 0; - } - - this._wrapsTypeParameterCache = this._wrapsTypeParameterCache || new TypeScript.WrapsTypeParameterCache(); - - var wrappingTypeParameterID = this._wrapsTypeParameterCache.getWrapsTypeParameter(typeParameterArgumentMap); - if (wrappingTypeParameterID === undefined) { - wrappingTypeParameterID = this.getWrappingTypeParameterIDWorker(typeParameterArgumentMap); - this._wrapsTypeParameterCache.setWrapsTypeParameter(typeParameterArgumentMap, wrappingTypeParameterID); - } - - return wrappingTypeParameterID; - }; - - PullSignatureSymbol.prototype.getWrappingTypeParameterIDWorker = function (typeParameterArgumentMap) { - var signature = this; - signature.inWrapCheck = true; - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(signature); - var wrappingTypeParameterID = signature.returnType ? signature.returnType.getWrappingTypeParameterID(typeParameterArgumentMap) : 0; - - var parameters = signature.parameters; - for (var i = 0; !wrappingTypeParameterID && i < parameters.length; i++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(parameters[i]); - wrappingTypeParameterID = parameters[i].type.getWrappingTypeParameterID(typeParameterArgumentMap); - } - - signature.inWrapCheck = false; - - return wrappingTypeParameterID; - }; - - PullSignatureSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference = function (enclosingType, knownWrapMap) { - var wrapsIntoInfinitelyExpandingTypeReference = knownWrapMap.valueAt(this.pullSymbolID, enclosingType.pullSymbolID); - if (wrapsIntoInfinitelyExpandingTypeReference != undefined) { - return wrapsIntoInfinitelyExpandingTypeReference; - } - - if (this.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - this.inWrapInfiniteExpandingReferenceCheck = true; - wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType, knownWrapMap); - knownWrapMap.setValueAt(this.pullSymbolID, enclosingType.pullSymbolID, wrapsIntoInfinitelyExpandingTypeReference); - this.inWrapInfiniteExpandingReferenceCheck = false; - - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullSignatureSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker = function (enclosingType, knownWrapMap) { - if (this.returnType && this.returnType._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - - var parameters = this.parameters; - - for (var i = 0; i < parameters.length; i++) { - if (parameters[i].type && parameters[i].type._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - } - - return false; - }; - return PullSignatureSymbol; - })(PullSymbol); - TypeScript.PullSignatureSymbol = PullSignatureSymbol; - - var PullTypeSymbol = (function (_super) { - __extends(PullTypeSymbol, _super); - function PullTypeSymbol(name, kind) { - _super.call(this, name, kind); - this._members = TypeScript.sentinelEmptyArray; - this._enclosedMemberTypes = null; - this._enclosedMemberContainers = null; - this._typeParameters = null; - this._allowedToReferenceTypeParameters = null; - this._specializedVersionsOfThisType = null; - this._arrayVersionOfThisType = null; - this._implementedTypes = null; - this._extendedTypes = null; - this._typesThatExplicitlyImplementThisType = null; - this._typesThatExtendThisType = null; - this._callSignatures = null; - this._allCallSignatures = null; - this._constructSignatures = null; - this._indexSignatures = null; - this._allIndexSignatures = null; - this._allIndexSignaturesOfAugmentedType = null; - this._memberNameCache = null; - this._enclosedTypeNameCache = null; - this._enclosedContainerCache = null; - this._typeParameterNameCache = null; - this._containedNonMemberNameCache = null; - this._containedNonMemberTypeNameCache = null; - this._containedNonMemberContainerCache = null; - this._simpleInstantiationCache = null; - this._complexInstantiationCache = null; - this._hasGenericSignature = false; - this._hasGenericMember = false; - this._hasBaseTypeConflict = false; - this._knownBaseTypeCount = 0; - this._associatedContainerTypeSymbol = null; - this._constructorMethod = null; - this._hasDefaultConstructor = false; - this._functionSymbol = null; - this._inMemberTypeNameEx = false; - this.inSymbolPrivacyCheck = false; - this.inWrapCheck = false; - this.inWrapInfiniteExpandingReferenceCheck = false; - this.typeReference = null; - this._widenedType = null; - this._isArrayNamedTypeReference = undefined; - this.type = this; - } - PullTypeSymbol.prototype.isArrayNamedTypeReference = function () { - if (this._isArrayNamedTypeReference === undefined) { - this._isArrayNamedTypeReference = this.computeIsArrayNamedTypeReference(); - } - - return this._isArrayNamedTypeReference; - }; - - PullTypeSymbol.prototype.computeIsArrayNamedTypeReference = function () { - var typeArgs = this.getTypeArguments(); - if (typeArgs && this.getTypeArguments().length === 1 && this.name === "Array") { - var declaration = this.getDeclarations()[0]; - - if (declaration && declaration.getParentDecl() && declaration.getParentDecl().getParentDecl() === null) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.isType = function () { - return true; - }; - PullTypeSymbol.prototype.isClass = function () { - return this.kind === 8 /* Class */ || (this._constructorMethod !== null); - }; - PullTypeSymbol.prototype.isFunction = function () { - return (this.kind & (33554432 /* ConstructorType */ | 16777216 /* FunctionType */)) !== 0; - }; - PullTypeSymbol.prototype.isConstructor = function () { - return this.kind === 33554432 /* ConstructorType */; - }; - PullTypeSymbol.prototype.isTypeParameter = function () { - return false; - }; - PullTypeSymbol.prototype.isTypeVariable = function () { - return false; - }; - PullTypeSymbol.prototype.isError = function () { - return false; - }; - PullTypeSymbol.prototype.isEnum = function () { - return this.kind === 64 /* Enum */; - }; - - PullTypeSymbol.prototype.getTypeParameterArgumentMap = function () { - return null; - }; - - PullTypeSymbol.prototype.isObject = function () { - return TypeScript.hasFlag(this.kind, 8 /* Class */ | 33554432 /* ConstructorType */ | 64 /* Enum */ | 16777216 /* FunctionType */ | 16 /* Interface */ | 8388608 /* ObjectType */ | 256 /* ObjectLiteral */); - }; - - PullTypeSymbol.prototype.isFunctionType = function () { - return this.getCallSignatures().length > 0 || this.getConstructSignatures().length > 0; - }; - - PullTypeSymbol.prototype.getKnownBaseTypeCount = function () { - return this._knownBaseTypeCount; - }; - PullTypeSymbol.prototype.resetKnownBaseTypeCount = function () { - this._knownBaseTypeCount = 0; - }; - PullTypeSymbol.prototype.incrementKnownBaseCount = function () { - this._knownBaseTypeCount++; - }; - - PullTypeSymbol.prototype.setHasBaseTypeConflict = function () { - this._hasBaseTypeConflict = true; - }; - PullTypeSymbol.prototype.hasBaseTypeConflict = function () { - return this._hasBaseTypeConflict; - }; - - PullTypeSymbol.prototype.hasMembers = function () { - if (this._members !== TypeScript.sentinelEmptyArray) { - return true; - } - - var parents = this.getExtendedTypes(); - - for (var i = 0; i < parents.length; i++) { - if (parents[i].hasMembers()) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.setHasGenericSignature = function () { - this._hasGenericSignature = true; - }; - PullTypeSymbol.prototype.getHasGenericSignature = function () { - return this._hasGenericSignature; - }; - - PullTypeSymbol.prototype.setHasGenericMember = function () { - this._hasGenericMember = true; - }; - PullTypeSymbol.prototype.getHasGenericMember = function () { - return this._hasGenericMember; - }; - - PullTypeSymbol.prototype.setAssociatedContainerType = function (type) { - this._associatedContainerTypeSymbol = type; - }; - - PullTypeSymbol.prototype.getAssociatedContainerType = function () { - return this._associatedContainerTypeSymbol; - }; - - PullTypeSymbol.prototype.getArrayType = function () { - return this._arrayVersionOfThisType; - }; - - PullTypeSymbol.prototype.getElementType = function () { - return null; - }; - - PullTypeSymbol.prototype.setArrayType = function (arrayType) { - this._arrayVersionOfThisType = arrayType; - }; - - PullTypeSymbol.prototype.getFunctionSymbol = function () { - return this._functionSymbol; - }; - - PullTypeSymbol.prototype.setFunctionSymbol = function (symbol) { - if (symbol) { - this._functionSymbol = symbol; - } - }; - - PullTypeSymbol.prototype.findContainedNonMember = function (name) { - if (!this._containedNonMemberNameCache) { - return null; - } - - return this._containedNonMemberNameCache[name]; - }; - - PullTypeSymbol.prototype.findContainedNonMemberType = function (typeName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - if (!this._containedNonMemberTypeNameCache) { - return null; - } - - var nonMemberSymbol = this._containedNonMemberTypeNameCache[typeName]; - - if (nonMemberSymbol && kind !== 0 /* None */) { - nonMemberSymbol = TypeScript.hasFlag(nonMemberSymbol.kind, kind) ? nonMemberSymbol : null; - } - - return nonMemberSymbol; - }; - - PullTypeSymbol.prototype.findContainedNonMemberContainer = function (containerName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - if (!this._containedNonMemberContainerCache) { - return null; - } - - var nonMemberSymbol = this._containedNonMemberContainerCache[containerName]; - - if (nonMemberSymbol && kind !== 0 /* None */) { - nonMemberSymbol = TypeScript.hasFlag(nonMemberSymbol.kind, kind) ? nonMemberSymbol : null; - } - - return nonMemberSymbol; - }; - - PullTypeSymbol.prototype.addMember = function (memberSymbol) { - if (!memberSymbol) { - return; - } - - memberSymbol.setContainer(this); - - if (!this._memberNameCache) { - this._memberNameCache = TypeScript.createIntrinsicsObject(); - } - - if (this._members === TypeScript.sentinelEmptyArray) { - this._members = []; - } - - this._members.push(memberSymbol); - this._memberNameCache[memberSymbol.name] = memberSymbol; - }; - - PullTypeSymbol.prototype.addEnclosedMemberType = function (enclosedType) { - if (!enclosedType) { - return; - } - - enclosedType.setContainer(this); - - if (!this._enclosedTypeNameCache) { - this._enclosedTypeNameCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._enclosedMemberTypes) { - this._enclosedMemberTypes = []; - } - - this._enclosedMemberTypes[this._enclosedMemberTypes.length] = enclosedType; - this._enclosedTypeNameCache[enclosedType.name] = enclosedType; - }; - - PullTypeSymbol.prototype.addEnclosedMemberContainer = function (enclosedContainer) { - if (!enclosedContainer) { - return; - } - - enclosedContainer.setContainer(this); - - if (!this._enclosedContainerCache) { - this._enclosedContainerCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._enclosedMemberContainers) { - this._enclosedMemberContainers = []; - } - - this._enclosedMemberContainers[this._enclosedMemberContainers.length] = enclosedContainer; - this._enclosedContainerCache[enclosedContainer.name] = enclosedContainer; - }; - - PullTypeSymbol.prototype.addEnclosedNonMember = function (enclosedNonMember) { - if (!enclosedNonMember) { - return; - } - - enclosedNonMember.setContainer(this); - - if (!this._containedNonMemberNameCache) { - this._containedNonMemberNameCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberNameCache[enclosedNonMember.name] = enclosedNonMember; - }; - - PullTypeSymbol.prototype.addEnclosedNonMemberType = function (enclosedNonMemberType) { - if (!enclosedNonMemberType) { - return; - } - - enclosedNonMemberType.setContainer(this); - - if (!this._containedNonMemberTypeNameCache) { - this._containedNonMemberTypeNameCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberTypeNameCache[enclosedNonMemberType.name] = enclosedNonMemberType; - }; - - PullTypeSymbol.prototype.addEnclosedNonMemberContainer = function (enclosedNonMemberContainer) { - if (!enclosedNonMemberContainer) { - return; - } - - enclosedNonMemberContainer.setContainer(this); - - if (!this._containedNonMemberContainerCache) { - this._containedNonMemberContainerCache = TypeScript.createIntrinsicsObject(); - } - - this._containedNonMemberContainerCache[enclosedNonMemberContainer.name] = enclosedNonMemberContainer; - }; - - PullTypeSymbol.prototype.addTypeParameter = function (typeParameter) { - if (!typeParameter) { - return; - } - - if (!typeParameter.getContainer()) { - typeParameter.setContainer(this); - } - - if (!this._typeParameterNameCache) { - this._typeParameterNameCache = TypeScript.createIntrinsicsObject(); - } - - if (!this._typeParameters) { - this._typeParameters = []; - } - - this._typeParameters[this._typeParameters.length] = typeParameter; - this._typeParameterNameCache[typeParameter.getName()] = typeParameter; - }; - - PullTypeSymbol.prototype.getMembers = function () { - return this._members; - }; - - PullTypeSymbol.prototype.setHasDefaultConstructor = function (hasOne) { - if (typeof hasOne === "undefined") { hasOne = true; } - this._hasDefaultConstructor = hasOne; - }; - - PullTypeSymbol.prototype.getHasDefaultConstructor = function () { - return this._hasDefaultConstructor; - }; - - PullTypeSymbol.prototype.getConstructorMethod = function () { - return this._constructorMethod; - }; - - PullTypeSymbol.prototype.setConstructorMethod = function (constructorMethod) { - this._constructorMethod = constructorMethod; - }; - - PullTypeSymbol.prototype.getTypeParameters = function () { - if (!this._typeParameters) { - return TypeScript.sentinelEmptyArray; - } - - return this._typeParameters; - }; - - PullTypeSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - if (!!(this.kind && 8216 /* SomeInstantiatableType */) && this.isNamedTypeSymbol() && !this.isTypeParameter()) { - return this.getTypeParameters(); - } - - if (!this._allowedToReferenceTypeParameters) { - this._allowedToReferenceTypeParameters = TypeScript.PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl(this.getDeclarations()[0]); - } - - return this._allowedToReferenceTypeParameters; - }; - - PullTypeSymbol.prototype.isGeneric = function () { - return (this._typeParameters && this._typeParameters.length > 0) || this._hasGenericSignature || this._hasGenericMember || this.isArrayNamedTypeReference(); - }; - - PullTypeSymbol.prototype.canUseSimpleInstantiationCache = function (typeArgumentMap) { - if (this.isTypeParameter()) { - return true; - } - - var typeParameters = this.getTypeParameters(); - return typeArgumentMap && this.isNamedTypeSymbol() && typeParameters.length === 1 && typeArgumentMap[typeParameters[0].pullSymbolID].kind !== 8388608 /* ObjectType */; - }; - - PullTypeSymbol.prototype.getSimpleInstantiationCacheId = function (typeArgumentMap) { - if (this.isTypeParameter()) { - return typeArgumentMap[0].pullSymbolID; - } - - return typeArgumentMap[this.getTypeParameters()[0].pullSymbolID].pullSymbolID; - }; - - PullTypeSymbol.prototype.addSpecialization = function (specializedVersionOfThisType, typeArgumentMap) { - if (this.canUseSimpleInstantiationCache(typeArgumentMap)) { - if (!this._simpleInstantiationCache) { - this._simpleInstantiationCache = []; - } - - this._simpleInstantiationCache[this.getSimpleInstantiationCacheId(typeArgumentMap)] = specializedVersionOfThisType; - } else { - if (!this._complexInstantiationCache) { - this._complexInstantiationCache = TypeScript.createIntrinsicsObject(); - } - - this._complexInstantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)] = specializedVersionOfThisType; - } - - if (!this._specializedVersionsOfThisType) { - this._specializedVersionsOfThisType = []; - } - - this._specializedVersionsOfThisType.push(specializedVersionOfThisType); - }; - - PullTypeSymbol.prototype.getSpecialization = function (typeArgumentMap) { - if (this.canUseSimpleInstantiationCache(typeArgumentMap)) { - if (!this._simpleInstantiationCache) { - return null; - } - - var result = this._simpleInstantiationCache[this.getSimpleInstantiationCacheId(typeArgumentMap)]; - return result || null; - } else { - if (!this._complexInstantiationCache) { - return null; - } - - if (this.getAllowedToReferenceTypeParameters().length == 0) { - return this; - } - - var result = this._complexInstantiationCache[getIDForTypeSubstitutions(this, typeArgumentMap)]; - return result || null; - } - }; - - PullTypeSymbol.prototype.getKnownSpecializations = function () { - if (!this._specializedVersionsOfThisType) { - return TypeScript.sentinelEmptyArray; - } - - return this._specializedVersionsOfThisType; - }; - - PullTypeSymbol.prototype.getTypeArguments = function () { - return null; - }; - - PullTypeSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - return this.getTypeParameters(); - }; - - PullTypeSymbol.prototype.addCallSignaturePrerequisite = function (callSignature) { - if (!this._callSignatures) { - this._callSignatures = []; - } - - if (callSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - callSignature.functionType = this; - }; - - PullTypeSymbol.prototype.appendCallSignature = function (callSignature) { - this.addCallSignaturePrerequisite(callSignature); - this._callSignatures.push(callSignature); - }; - - PullTypeSymbol.prototype.insertCallSignatureAtIndex = function (callSignature, index) { - this.addCallSignaturePrerequisite(callSignature); - TypeScript.Debug.assert(index <= this._callSignatures.length); - if (index === this._callSignatures.length) { - this._callSignatures.push(callSignature); - } else { - this._callSignatures.splice(index, 0, callSignature); - } - }; - - PullTypeSymbol.prototype.addConstructSignaturePrerequisite = function (constructSignature) { - if (!this._constructSignatures) { - this._constructSignatures = []; - } - - if (constructSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - constructSignature.functionType = this; - }; - - PullTypeSymbol.prototype.appendConstructSignature = function (constructSignature) { - this.addConstructSignaturePrerequisite(constructSignature); - this._constructSignatures.push(constructSignature); - }; - - PullTypeSymbol.prototype.insertConstructSignatureAtIndex = function (constructSignature, index) { - this.addConstructSignaturePrerequisite(constructSignature); - TypeScript.Debug.assert(index <= this._constructSignatures.length); - if (index === this._constructSignatures.length) { - this._constructSignatures.push(constructSignature); - } else { - this._constructSignatures.splice(index, 0, constructSignature); - } - }; - - PullTypeSymbol.prototype.addIndexSignature = function (indexSignature) { - if (!this._indexSignatures) { - this._indexSignatures = []; - } - - this._indexSignatures[this._indexSignatures.length] = indexSignature; - - if (indexSignature.isGeneric()) { - this._hasGenericSignature = true; - } - - indexSignature.functionType = this; - }; - - PullTypeSymbol.prototype.hasOwnCallSignatures = function () { - return this._callSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnCallSignatures = function () { - return this._callSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getCallSignatures = function () { - if (this._allCallSignatures) { - return this._allCallSignatures; - } - - var signatures = []; - - if (this._callSignatures) { - signatures = signatures.concat(this._callSignatures); - } - - if (this._extendedTypes && this.kind === 16 /* Interface */) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._callSignatures, this._extendedTypes[i].getCallSignatures(), signatures); - } - } - - this._allCallSignatures = signatures; - - return signatures; - }; - - PullTypeSymbol.prototype.hasOwnConstructSignatures = function () { - return this._constructSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnConstructSignatures = function () { - return this._constructSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getConstructSignatures = function () { - var signatures = []; - - if (this._constructSignatures) { - signatures = signatures.concat(this._constructSignatures); - } - - if (this._extendedTypes && this.kind === 16 /* Interface */) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._constructSignatures, this._extendedTypes[i].getConstructSignatures(), signatures); - } - } - - return signatures; - }; - - PullTypeSymbol.prototype.hasOwnIndexSignatures = function () { - return this._indexSignatures !== null; - }; - - PullTypeSymbol.prototype.getOwnIndexSignatures = function () { - return this._indexSignatures || TypeScript.sentinelEmptyArray; - }; - - PullTypeSymbol.prototype.getIndexSignatures = function () { - if (this._allIndexSignatures) { - return this._allIndexSignatures; - } - - var signatures = []; - - if (this._indexSignatures) { - signatures = signatures.concat(this._indexSignatures); - } - - if (this._extendedTypes) { - for (var i = 0; i < this._extendedTypes.length; i++) { - if (this._extendedTypes[i].hasBase(this)) { - continue; - } - - this._getResolver()._addUnhiddenSignaturesFromBaseType(this._indexSignatures, this._extendedTypes[i].getIndexSignatures(), signatures); - } - } - - this._allIndexSignatures = signatures; - - return signatures; - }; - - PullTypeSymbol.prototype.getIndexSignaturesOfAugmentedType = function (resolver, globalFunctionInterface, globalObjectInterface) { - if (!this._allIndexSignaturesOfAugmentedType) { - var initialIndexSignatures = this.getIndexSignatures(); - var shouldAddFunctionSignatures = false; - var shouldAddObjectSignatures = false; - - if (globalFunctionInterface && this.isFunctionType() && this !== globalFunctionInterface) { - var functionIndexSignatures = globalFunctionInterface.getIndexSignatures(); - if (functionIndexSignatures.length) { - shouldAddFunctionSignatures = true; - } - } - - if (globalObjectInterface && this !== globalObjectInterface) { - var objectIndexSignatures = globalObjectInterface.getIndexSignatures(); - if (objectIndexSignatures.length) { - shouldAddObjectSignatures = true; - } - } - - if (shouldAddFunctionSignatures || shouldAddObjectSignatures) { - this._allIndexSignaturesOfAugmentedType = initialIndexSignatures.slice(0); - if (shouldAddFunctionSignatures) { - resolver._addUnhiddenSignaturesFromBaseType(initialIndexSignatures, functionIndexSignatures, this._allIndexSignaturesOfAugmentedType); - } - if (shouldAddObjectSignatures) { - if (shouldAddFunctionSignatures) { - initialIndexSignatures = initialIndexSignatures.concat(functionIndexSignatures); - } - resolver._addUnhiddenSignaturesFromBaseType(initialIndexSignatures, objectIndexSignatures, this._allIndexSignaturesOfAugmentedType); - } - } else { - this._allIndexSignaturesOfAugmentedType = initialIndexSignatures; - } - } - - return this._allIndexSignaturesOfAugmentedType; - }; - - PullTypeSymbol.prototype.addImplementedType = function (implementedType) { - if (!implementedType) { - return; - } - - if (!this._implementedTypes) { - this._implementedTypes = []; - } - - this._implementedTypes[this._implementedTypes.length] = implementedType; - - implementedType.addTypeThatExplicitlyImplementsThisType(this); - }; - - PullTypeSymbol.prototype.getImplementedTypes = function () { - if (!this._implementedTypes) { - return TypeScript.sentinelEmptyArray; - } - - return this._implementedTypes; - }; - - PullTypeSymbol.prototype.addExtendedType = function (extendedType) { - if (!extendedType) { - return; - } - - if (!this._extendedTypes) { - this._extendedTypes = []; - } - - this._extendedTypes[this._extendedTypes.length] = extendedType; - - extendedType.addTypeThatExtendsThisType(this); - }; - - PullTypeSymbol.prototype.getExtendedTypes = function () { - if (!this._extendedTypes) { - return TypeScript.sentinelEmptyArray; - } - - return this._extendedTypes; - }; - - PullTypeSymbol.prototype.addTypeThatExtendsThisType = function (type) { - if (!type) { - return; - } - - if (!this._typesThatExtendThisType) { - this._typesThatExtendThisType = []; - } - - this._typesThatExtendThisType[this._typesThatExtendThisType.length] = type; - }; - - PullTypeSymbol.prototype.getTypesThatExtendThisType = function () { - if (!this._typesThatExtendThisType) { - this._typesThatExtendThisType = []; - } - - return this._typesThatExtendThisType; - }; - - PullTypeSymbol.prototype.addTypeThatExplicitlyImplementsThisType = function (type) { - if (!type) { - return; - } - - if (!this._typesThatExplicitlyImplementThisType) { - this._typesThatExplicitlyImplementThisType = []; - } - - this._typesThatExplicitlyImplementThisType[this._typesThatExplicitlyImplementThisType.length] = type; - }; - - PullTypeSymbol.prototype.getTypesThatExplicitlyImplementThisType = function () { - if (!this._typesThatExplicitlyImplementThisType) { - this._typesThatExplicitlyImplementThisType = []; - } - - return this._typesThatExplicitlyImplementThisType; - }; - - PullTypeSymbol.prototype.hasBase = function (potentialBase, visited) { - if (typeof visited === "undefined") { visited = []; } - if (this === potentialBase || this.getRootSymbol() === potentialBase || this === potentialBase.getRootSymbol()) { - return true; - } - - if (TypeScript.ArrayUtilities.contains(visited, this)) { - return true; - } - - visited.push(this); - - var extendedTypes = this.getExtendedTypes(); - - for (var i = 0; i < extendedTypes.length; i++) { - if (extendedTypes[i].hasBase(potentialBase, visited)) { - return true; - } - } - - var implementedTypes = this.getImplementedTypes(); - - for (var i = 0; i < implementedTypes.length; i++) { - if (implementedTypes[i].hasBase(potentialBase, visited)) { - return true; - } - } - - visited.pop(); - - return false; - }; - - PullTypeSymbol.prototype.isValidBaseKind = function (baseType, isExtendedType) { - if (baseType.isError()) { - return false; - } - - var thisIsClass = this.isClass(); - if (isExtendedType) { - if (thisIsClass) { - return baseType.kind === 8 /* Class */; - } - } else { - if (!thisIsClass) { - return false; - } - } - - return !!(baseType.kind & (16 /* Interface */ | 8 /* Class */)); - }; - - PullTypeSymbol.prototype.findMember = function (name, lookInParent) { - var memberSymbol = null; - - if (this._memberNameCache) { - memberSymbol = this._memberNameCache[name]; - } - - if (memberSymbol || !lookInParent) { - return memberSymbol; - } - - if (this._extendedTypes) { - for (var i = 0; i < this._extendedTypes.length; i++) { - memberSymbol = this._extendedTypes[i].findMember(name, lookInParent); - - if (memberSymbol) { - return memberSymbol; - } - } - } - - return null; - }; - - PullTypeSymbol.prototype.findNestedType = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - var memberSymbol; - - if (!this._enclosedTypeNameCache) { - return null; - } - - memberSymbol = this._enclosedTypeNameCache[name]; - - if (memberSymbol && kind !== 0 /* None */) { - memberSymbol = TypeScript.hasFlag(memberSymbol.kind, kind) ? memberSymbol : null; - } - - return memberSymbol; - }; - - PullTypeSymbol.prototype.findNestedContainer = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - var memberSymbol; - - if (!this._enclosedContainerCache) { - return null; - } - - memberSymbol = this._enclosedContainerCache[name]; - - if (memberSymbol && kind !== 0 /* None */) { - memberSymbol = TypeScript.hasFlag(memberSymbol.kind, kind) ? memberSymbol : null; - } - - return memberSymbol; - }; - - PullTypeSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - var allMembers = []; - - if (this._members !== TypeScript.sentinelEmptyArray) { - for (var i = 0, n = this._members.length; i < n; i++) { - var member = this._members[i]; - if ((member.kind & searchDeclKind) && (memberVisiblity !== 2 /* externallyVisible */ || !member.anyDeclHasFlag(2 /* Private */))) { - allMembers[allMembers.length] = member; - } - } - } - - if (this._extendedTypes) { - var extenedMembersVisibility = memberVisiblity !== 0 /* all */ ? 2 /* externallyVisible */ : 0 /* all */; - - for (var i = 0, n = this._extendedTypes.length; i < n; i++) { - var extendedMembers = this._extendedTypes[i].getAllMembers(searchDeclKind, extenedMembersVisibility); - - for (var j = 0, m = extendedMembers.length; j < m; j++) { - var extendedMember = extendedMembers[j]; - if (!(this._memberNameCache && this._memberNameCache[extendedMember.name])) { - allMembers[allMembers.length] = extendedMember; - } - } - } - } - - if (this.isContainer()) { - if (this._enclosedMemberTypes) { - for (var i = 0; i < this._enclosedMemberTypes.length; i++) { - allMembers[allMembers.length] = this._enclosedMemberTypes[i]; - } - } - if (this._enclosedMemberContainers) { - for (var i = 0; i < this._enclosedMemberContainers.length; i++) { - allMembers[allMembers.length] = this._enclosedMemberContainers[i]; - } - } - } - - return allMembers; - }; - - PullTypeSymbol.prototype.findTypeParameter = function (name) { - if (!this._typeParameterNameCache) { - return null; - } - - return this._typeParameterNameCache[name]; - }; - - PullTypeSymbol.prototype.setResolved = function () { - _super.prototype.setResolved.call(this); - }; - - PullTypeSymbol.prototype.getNamePartForFullName = function () { - var name = _super.prototype.getNamePartForFullName.call(this); - - var typars = this.getTypeArgumentsOrTypeParameters(); - var typarString = PullSymbol.getTypeParameterString(typars, this, true); - return name + typarString; - }; - - PullTypeSymbol.prototype.getScopedName = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName) { - return this.getScopedNameEx(scopeSymbol, skipTypeParametersInName, useConstraintInName, false, false, skipInternalAliasName).toString(); - }; - - PullTypeSymbol.prototype.isNamedTypeSymbol = function () { - var kind = this.kind; - if (kind === 2 /* Primitive */ || kind === 8 /* Class */ || kind === 4 /* Container */ || kind === 32 /* DynamicModule */ || kind === 128 /* TypeAlias */ || kind === 64 /* Enum */ || kind === 8192 /* TypeParameter */ || ((kind === 16 /* Interface */ || kind === 8388608 /* ObjectType */) && this.name !== "")) { - return true; - } - - return false; - }; - - PullTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - var s = this.getScopedNameEx(scopeSymbol, false, useConstraintInName).toString(); - return s; - }; - - PullTypeSymbol.prototype.getScopedNameEx = function (scopeSymbol, skipTypeParametersInName, useConstraintInName, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName, shouldAllowArrayType) { - if (typeof shouldAllowArrayType === "undefined") { shouldAllowArrayType = true; } - if (this.isArrayNamedTypeReference() && shouldAllowArrayType) { - var elementType = this.getElementType(); - var elementMemberName = elementType ? (elementType.isArrayNamedTypeReference() || elementType.isNamedTypeSymbol() ? elementType.getScopedNameEx(scopeSymbol, false, false, getPrettyTypeName, getTypeParamMarkerInfo, skipInternalAliasName) : elementType.getMemberTypeNameEx(false, scopeSymbol, getPrettyTypeName)) : TypeScript.MemberName.create("any"); - return TypeScript.MemberName.create(elementMemberName, "", "[]"); - } - - if (!this.isNamedTypeSymbol()) { - return this.getMemberTypeNameEx(true, scopeSymbol, getPrettyTypeName); - } - - if (skipTypeParametersInName) { - return TypeScript.MemberName.create(_super.prototype.getScopedName.call(this, scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName)); - } else { - var builder = new TypeScript.MemberNameArray(); - builder.prefix = _super.prototype.getScopedName.call(this, scopeSymbol, skipTypeParametersInName, useConstraintInName, skipInternalAliasName); - - var typars = this.getTypeArgumentsOrTypeParameters(); - builder.add(PullSymbol.getTypeParameterStringEx(typars, scopeSymbol, getTypeParamMarkerInfo, useConstraintInName)); - - return builder; - } - }; - - PullTypeSymbol.prototype.hasOnlyOverloadCallSignatures = function () { - var members = this.getMembers(); - var callSignatures = this.getCallSignatures(); - var constructSignatures = this.getConstructSignatures(); - return members.length === 0 && constructSignatures.length === 0 && callSignatures.length > 1; - }; - - PullTypeSymbol.prototype.getTypeOfSymbol = function () { - var associatedContainerType = this.getAssociatedContainerType(); - if (associatedContainerType && associatedContainerType.isNamedTypeSymbol()) { - return associatedContainerType; - } - - var functionSymbol = this.getFunctionSymbol(); - if (functionSymbol && functionSymbol.kind === 16384 /* Function */ && !TypeScript.PullHelpers.isSymbolLocal(functionSymbol)) { - return TypeScript.PullHelpers.isExportedSymbolInClodule(functionSymbol) ? null : functionSymbol; - } - - return null; - }; - - PullTypeSymbol.prototype.getMemberTypeNameEx = function (topLevel, scopeSymbol, getPrettyTypeName) { - var members = this.getMembers(); - var callSignatures = this.getCallSignatures(); - var constructSignatures = this.getConstructSignatures(); - var indexSignatures = this.getIndexSignatures(); - - if (members.length > 0 || callSignatures.length > 0 || constructSignatures.length > 0 || indexSignatures.length > 0) { - var typeOfSymbol = this.getTypeOfSymbol(); - if (typeOfSymbol) { - var nameForTypeOf = typeOfSymbol.getScopedNameEx(scopeSymbol, true); - return TypeScript.MemberName.create(nameForTypeOf, "typeof ", ""); - } - - if (this._inMemberTypeNameEx) { - return TypeScript.MemberName.create("any"); - } - - this._inMemberTypeNameEx = true; - - var allMemberNames = new TypeScript.MemberNameArray(); - var curlies = !topLevel || indexSignatures.length !== 0; - var delim = "; "; - for (var i = 0; i < members.length; i++) { - if (members[i].kind === 65536 /* Method */ && members[i].type.hasOnlyOverloadCallSignatures()) { - var methodCallSignatures = members[i].type.getCallSignatures(); - var nameStr = members[i].getDisplayName(scopeSymbol) + (members[i].isOptional ? "?" : ""); - ; - var methodMemberNames = PullSignatureSymbol.getSignaturesTypeNameEx(methodCallSignatures, nameStr, false, false, scopeSymbol); - allMemberNames.addAll(methodMemberNames); - } else { - var memberTypeName = members[i].getNameAndTypeNameEx(scopeSymbol); - if (memberTypeName.isArray() && memberTypeName.delim === delim) { - allMemberNames.addAll(memberTypeName.entries); - } else { - allMemberNames.add(memberTypeName); - } - } - curlies = true; - } - - var getPrettyFunctionOverload = getPrettyTypeName && !curlies && this.hasOnlyOverloadCallSignatures(); - - var signatureCount = callSignatures.length + constructSignatures.length + indexSignatures.length; - var useShortFormSignature = !curlies && (signatureCount === 1); - var signatureMemberName; - - if (callSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(callSignatures, "", useShortFormSignature, false, scopeSymbol, getPrettyFunctionOverload); - allMemberNames.addAll(signatureMemberName); - } - - if (constructSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(constructSignatures, "new", useShortFormSignature, false, scopeSymbol); - allMemberNames.addAll(signatureMemberName); - } - - if (indexSignatures.length > 0) { - signatureMemberName = PullSignatureSymbol.getSignaturesTypeNameEx(indexSignatures, "", useShortFormSignature, true, scopeSymbol); - allMemberNames.addAll(signatureMemberName); - } - - if ((curlies) || (!getPrettyFunctionOverload && (signatureCount > 1) && topLevel)) { - allMemberNames.prefix = "{ "; - allMemberNames.suffix = "}"; - allMemberNames.delim = delim; - } else if (allMemberNames.entries.length > 1) { - allMemberNames.delim = delim; - } - - this._inMemberTypeNameEx = false; - - return allMemberNames; - } - - return TypeScript.MemberName.create("{}"); - }; - - PullTypeSymbol.prototype.getGenerativeTypeClassification = function (enclosingType) { - return 2 /* Closed */; - }; - - PullTypeSymbol.prototype.wrapsSomeTypeParameter = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - return this.getWrappingTypeParameterID(typeParameterArgumentMap, skipTypeArgumentCheck) != 0; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterID = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - var type = this; - - if (type.isTypeParameter()) { - if (typeParameterArgumentMap[type.pullSymbolID] || typeParameterArgumentMap[type.getRootSymbol().pullSymbolID]) { - return type.pullSymbolID; - } - - var constraint = type.getConstraint(); - var wrappingTypeParameterID = constraint ? constraint.getWrappingTypeParameterID(typeParameterArgumentMap) : 0; - return wrappingTypeParameterID; - } - - if (type.inWrapCheck) { - return 0; - } - - this._wrapsTypeParameterCache = this._wrapsTypeParameterCache || new TypeScript.WrapsTypeParameterCache(); - var wrappingTypeParameterID = this._wrapsTypeParameterCache.getWrapsTypeParameter(typeParameterArgumentMap); - if (wrappingTypeParameterID === undefined) { - wrappingTypeParameterID = this.getWrappingTypeParameterIDWorker(typeParameterArgumentMap, skipTypeArgumentCheck); - - this._wrapsTypeParameterCache.setWrapsTypeParameter(typeParameterArgumentMap, wrappingTypeParameterID); - } - return wrappingTypeParameterID; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterIDFromSignatures = function (signatures, typeParameterArgumentMap) { - for (var i = 0; i < signatures.length; i++) { - var wrappingTypeParameterID = signatures[i].getWrappingTypeParameterID(typeParameterArgumentMap); - if (wrappingTypeParameterID !== 0) { - return wrappingTypeParameterID; - } - } - - return 0; - }; - - PullTypeSymbol.prototype.getWrappingTypeParameterIDWorker = function (typeParameterArgumentMap, skipTypeArgumentCheck) { - var type = this; - var wrappingTypeParameterID = 0; - - if (!skipTypeArgumentCheck) { - type.inWrapCheck = true; - - var typeArguments = type.getTypeArguments(); - - if (type.isGeneric() && !typeArguments) { - typeArguments = type.getTypeParameters(); - } - - if (typeArguments) { - for (var i = 0; !wrappingTypeParameterID && i < typeArguments.length; i++) { - wrappingTypeParameterID = typeArguments[i].getWrappingTypeParameterID(typeParameterArgumentMap); - } - } - } - - if (skipTypeArgumentCheck || !(type.kind & 8216 /* SomeInstantiatableType */) || !type.name) { - var members = type.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - for (var i = 0; !wrappingTypeParameterID && i < members.length; i++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(members[i]); - wrappingTypeParameterID = members[i].type.getWrappingTypeParameterID(typeParameterArgumentMap); - } - - wrappingTypeParameterID = wrappingTypeParameterID || this.getWrappingTypeParameterIDFromSignatures(type.getCallSignatures(), typeParameterArgumentMap) || this.getWrappingTypeParameterIDFromSignatures(type.getConstructSignatures(), typeParameterArgumentMap) || this.getWrappingTypeParameterIDFromSignatures(type.getIndexSignatures(), typeParameterArgumentMap); - } - - if (!skipTypeArgumentCheck) { - type.inWrapCheck = false; - } - - return wrappingTypeParameterID; - }; - - PullTypeSymbol.prototype.wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference = function (enclosingType) { - TypeScript.Debug.assert(this.isNamedTypeSymbol()); - TypeScript.Debug.assert(TypeScript.PullHelpers.getRootType(enclosingType) == enclosingType); - var knownWrapMap = TypeScript.BitMatrix.getBitMatrix(true); - var wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap); - knownWrapMap.release(); - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse = function (enclosingType, knownWrapMap) { - var wrapsIntoInfinitelyExpandingTypeReference = knownWrapMap.valueAt(this.pullSymbolID, enclosingType.pullSymbolID); - if (wrapsIntoInfinitelyExpandingTypeReference != undefined) { - return wrapsIntoInfinitelyExpandingTypeReference; - } - - if (this.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - this.inWrapInfiniteExpandingReferenceCheck = true; - wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker(enclosingType, knownWrapMap); - knownWrapMap.setValueAt(this.pullSymbolID, enclosingType.pullSymbolID, wrapsIntoInfinitelyExpandingTypeReference); - this.inWrapInfiniteExpandingReferenceCheck = false; - - return wrapsIntoInfinitelyExpandingTypeReference; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceWorker = function (enclosingType, knownWrapMap) { - var thisRootType = TypeScript.PullHelpers.getRootType(this); - - if (thisRootType != enclosingType) { - var thisIsNamedType = this.isNamedTypeSymbol(); - - if (thisIsNamedType) { - if (thisRootType.inWrapInfiniteExpandingReferenceCheck) { - return false; - } - - thisRootType.inWrapInfiniteExpandingReferenceCheck = true; - } - - var wrapsIntoInfinitelyExpandingTypeReference = this._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceStructure(enclosingType, knownWrapMap); - - if (thisIsNamedType) { - thisRootType.inWrapInfiniteExpandingReferenceCheck = false; - } - - return wrapsIntoInfinitelyExpandingTypeReference; - } - - var enclosingTypeParameters = enclosingType.getTypeParameters(); - var typeArguments = this.getTypeArguments(); - for (var i = 0; i < typeArguments.length; i++) { - if (TypeScript.ArrayUtilities.contains(enclosingTypeParameters, typeArguments[i])) { - continue; - } - - if (typeArguments[i].wrapsSomeTypeParameter(this.getTypeParameterArgumentMap())) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceStructure = function (enclosingType, knownWrapMap) { - var members = this.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - for (var i = 0; i < members.length; i++) { - if (members[i].type && members[i].type._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReferenceRecurse(enclosingType, knownWrapMap)) { - return true; - } - } - - var sigs = this.getCallSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - sigs = this.getConstructSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - sigs = this.getIndexSignatures(); - for (var i = 0; i < sigs.length; i++) { - if (sigs[i]._wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType, knownWrapMap)) { - return true; - } - } - - return false; - }; - - PullTypeSymbol.prototype.widenedType = function (resolver, ast, context) { - if (!this._widenedType) { - this._widenedType = resolver.widenType(this, ast, context); - } - return this._widenedType; - }; - return PullTypeSymbol; - })(PullSymbol); - TypeScript.PullTypeSymbol = PullTypeSymbol; - - var PullPrimitiveTypeSymbol = (function (_super) { - __extends(PullPrimitiveTypeSymbol, _super); - function PullPrimitiveTypeSymbol(name) { - _super.call(this, name, 2 /* Primitive */); - - this.isResolved = true; - } - PullPrimitiveTypeSymbol.prototype.isAny = function () { - return !this.isStringConstant() && this.name === "any"; - }; - - PullPrimitiveTypeSymbol.prototype.isNull = function () { - return !this.isStringConstant() && this.name === "null"; - }; - - PullPrimitiveTypeSymbol.prototype.isUndefined = function () { - return !this.isStringConstant() && this.name === "undefined"; - }; - - PullPrimitiveTypeSymbol.prototype.isStringConstant = function () { - return false; - }; - - PullPrimitiveTypeSymbol.prototype.setUnresolved = function () { - }; - - PullPrimitiveTypeSymbol.prototype.getDisplayName = function () { - if (this.isNull() || this.isUndefined()) { - return "any"; - } else { - return _super.prototype.getDisplayName.call(this); - } - }; - return PullPrimitiveTypeSymbol; - })(PullTypeSymbol); - TypeScript.PullPrimitiveTypeSymbol = PullPrimitiveTypeSymbol; - - var PullStringConstantTypeSymbol = (function (_super) { - __extends(PullStringConstantTypeSymbol, _super); - function PullStringConstantTypeSymbol(name) { - _super.call(this, name); - } - PullStringConstantTypeSymbol.prototype.isStringConstant = function () { - return true; - }; - return PullStringConstantTypeSymbol; - })(PullPrimitiveTypeSymbol); - TypeScript.PullStringConstantTypeSymbol = PullStringConstantTypeSymbol; - - var PullErrorTypeSymbol = (function (_super) { - __extends(PullErrorTypeSymbol, _super); - function PullErrorTypeSymbol(_anyType, name) { - _super.call(this, name); - this._anyType = _anyType; - - TypeScript.Debug.assert(this._anyType); - this.isResolved = true; - } - PullErrorTypeSymbol.prototype.isError = function () { - return true; - }; - - PullErrorTypeSymbol.prototype._getResolver = function () { - return this._anyType._getResolver(); - }; - - PullErrorTypeSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - - PullErrorTypeSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - - PullErrorTypeSymbol.prototype.toString = function (scopeSymbol, useConstraintInName) { - return this._anyType.getName(scopeSymbol, useConstraintInName); - }; - return PullErrorTypeSymbol; - })(PullPrimitiveTypeSymbol); - TypeScript.PullErrorTypeSymbol = PullErrorTypeSymbol; - - var PullContainerSymbol = (function (_super) { - __extends(PullContainerSymbol, _super); - function PullContainerSymbol(name, kind) { - _super.call(this, name, kind); - this.instanceSymbol = null; - this.assignedValue = null; - this.assignedType = null; - this.assignedContainer = null; - } - PullContainerSymbol.prototype.isContainer = function () { - return true; - }; - - PullContainerSymbol.prototype.setInstanceSymbol = function (symbol) { - this.instanceSymbol = symbol; - }; - - PullContainerSymbol.prototype.getInstanceSymbol = function () { - return this.instanceSymbol; - }; - - PullContainerSymbol.prototype.setExportAssignedValueSymbol = function (symbol) { - this.assignedValue = symbol; - }; - - PullContainerSymbol.prototype.getExportAssignedValueSymbol = function () { - return this.assignedValue; - }; - - PullContainerSymbol.prototype.setExportAssignedTypeSymbol = function (type) { - this.assignedType = type; - }; - - PullContainerSymbol.prototype.getExportAssignedTypeSymbol = function () { - return this.assignedType; - }; - - PullContainerSymbol.prototype.setExportAssignedContainerSymbol = function (container) { - this.assignedContainer = container; - }; - - PullContainerSymbol.prototype.getExportAssignedContainerSymbol = function () { - return this.assignedContainer; - }; - - PullContainerSymbol.prototype.hasExportAssignment = function () { - return !!this.assignedValue || !!this.assignedType || !!this.assignedContainer; - }; - - PullContainerSymbol.usedAsSymbol = function (containerSymbol, symbol) { - if (!containerSymbol || !containerSymbol.isContainer()) { - return false; - } - - if (!containerSymbol.isAlias() && containerSymbol.type === symbol) { - return true; - } - - var moduleSymbol = containerSymbol; - var valueExportSymbol = moduleSymbol.getExportAssignedValueSymbol(); - var typeExportSymbol = moduleSymbol.getExportAssignedTypeSymbol(); - var containerExportSymbol = moduleSymbol.getExportAssignedContainerSymbol(); - if (valueExportSymbol || typeExportSymbol || containerExportSymbol) { - return valueExportSymbol === symbol || typeExportSymbol == symbol || containerExportSymbol == symbol || PullContainerSymbol.usedAsSymbol(containerExportSymbol, symbol); - } - - return false; - }; - - PullContainerSymbol.prototype.getInstanceType = function () { - return this.instanceSymbol ? this.instanceSymbol.type : null; - }; - return PullContainerSymbol; - })(PullTypeSymbol); - TypeScript.PullContainerSymbol = PullContainerSymbol; - - var PullTypeAliasSymbol = (function (_super) { - __extends(PullTypeAliasSymbol, _super); - function PullTypeAliasSymbol(name) { - _super.call(this, name, 128 /* TypeAlias */); - this._assignedValue = null; - this._assignedType = null; - this._assignedContainer = null; - this._isUsedAsValue = false; - this._typeUsedExternally = false; - this._isUsedInExportAlias = false; - this.retrievingExportAssignment = false; - this.linkedAliasSymbols = null; - } - PullTypeAliasSymbol.prototype.isUsedInExportedAlias = function () { - this._resolveDeclaredSymbol(); - return this._isUsedInExportAlias; - }; - - PullTypeAliasSymbol.prototype.typeUsedExternally = function () { - this._resolveDeclaredSymbol(); - return this._typeUsedExternally; - }; - - PullTypeAliasSymbol.prototype.isUsedAsValue = function () { - this._resolveDeclaredSymbol(); - return this._isUsedAsValue; - }; - - PullTypeAliasSymbol.prototype.setTypeUsedExternally = function () { - this._typeUsedExternally = true; - }; - - PullTypeAliasSymbol.prototype.setIsUsedInExportedAlias = function () { - this._isUsedInExportAlias = true; - if (this.linkedAliasSymbols) { - this.linkedAliasSymbols.forEach(function (s) { - return s.setIsUsedInExportedAlias(); - }); - } - }; - - PullTypeAliasSymbol.prototype.addLinkedAliasSymbol = function (contingentValueSymbol) { - if (!this.linkedAliasSymbols) { - this.linkedAliasSymbols = [contingentValueSymbol]; - } else { - this.linkedAliasSymbols.push(contingentValueSymbol); - } - }; - - PullTypeAliasSymbol.prototype.setIsUsedAsValue = function () { - this._isUsedAsValue = true; - if (this.linkedAliasSymbols) { - this.linkedAliasSymbols.forEach(function (s) { - return s.setIsUsedAsValue(); - }); - } - }; - - PullTypeAliasSymbol.prototype.assignedValue = function () { - this._resolveDeclaredSymbol(); - return this._assignedValue; - }; - - PullTypeAliasSymbol.prototype.assignedType = function () { - this._resolveDeclaredSymbol(); - return this._assignedType; - }; - - PullTypeAliasSymbol.prototype.assignedContainer = function () { - this._resolveDeclaredSymbol(); - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.isAlias = function () { - return true; - }; - PullTypeAliasSymbol.prototype.isContainer = function () { - return true; - }; - - PullTypeAliasSymbol.prototype.setAssignedValueSymbol = function (symbol) { - this._assignedValue = symbol; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedValueSymbol = function () { - if (this._assignedValue) { - return this._assignedValue; - } - - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedValueSymbol(); - this.retrievingExportAssignment = false; - return sym; - } - - return null; - }; - - PullTypeAliasSymbol.prototype.setAssignedTypeSymbol = function (type) { - this._assignedType = type; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedTypeSymbol = function () { - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedType) { - if (this._assignedType.isAlias()) { - this.retrievingExportAssignment = true; - var sym = this._assignedType.getExportAssignedTypeSymbol(); - this.retrievingExportAssignment = false; - } else if (this._assignedType !== this._assignedContainer) { - return this._assignedType; - } - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedTypeSymbol(); - this.retrievingExportAssignment = false; - if (sym) { - return sym; - } - } - - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.setAssignedContainerSymbol = function (container) { - this._assignedContainer = container; - }; - - PullTypeAliasSymbol.prototype.getExportAssignedContainerSymbol = function () { - if (this.retrievingExportAssignment) { - return null; - } - - if (this._assignedContainer) { - this.retrievingExportAssignment = true; - var sym = this._assignedContainer.getExportAssignedContainerSymbol(); - this.retrievingExportAssignment = false; - if (sym) { - return sym; - } - } - - return this._assignedContainer; - }; - - PullTypeAliasSymbol.prototype.getMembers = function () { - if (this._assignedType) { - return this._assignedType.getMembers(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getCallSignatures = function () { - if (this._assignedType) { - return this._assignedType.getCallSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getConstructSignatures = function () { - if (this._assignedType) { - return this._assignedType.getConstructSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.getIndexSignatures = function () { - if (this._assignedType) { - return this._assignedType.getIndexSignatures(); - } - - return TypeScript.sentinelEmptyArray; - }; - - PullTypeAliasSymbol.prototype.findMember = function (name) { - if (this._assignedType) { - return this._assignedType.findMember(name, true); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.findNestedType = function (name) { - if (this._assignedType) { - return this._assignedType.findNestedType(name); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.findNestedContainer = function (name) { - if (this._assignedType) { - return this._assignedType.findNestedContainer(name); - } - - return null; - }; - - PullTypeAliasSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisibility) { - if (this._assignedType) { - return this._assignedType.getAllMembers(searchDeclKind, memberVisibility); - } - - return TypeScript.sentinelEmptyArray; - }; - return PullTypeAliasSymbol; - })(PullTypeSymbol); - TypeScript.PullTypeAliasSymbol = PullTypeAliasSymbol; - - var PullTypeParameterSymbol = (function (_super) { - __extends(PullTypeParameterSymbol, _super); - function PullTypeParameterSymbol(name) { - _super.call(this, name, 8192 /* TypeParameter */); - this._constraint = null; - } - PullTypeParameterSymbol.prototype.isTypeParameter = function () { - return true; - }; - - PullTypeParameterSymbol.prototype.setConstraint = function (constraintType) { - this._constraint = constraintType; - }; - - PullTypeParameterSymbol.prototype.getConstraint = function () { - return this._constraint; - }; - - PullTypeParameterSymbol.prototype.getBaseConstraint = function (semanticInfoChain) { - var preBaseConstraint = this.getConstraintRecursively({}); - TypeScript.Debug.assert(preBaseConstraint === null || !preBaseConstraint.isTypeParameter()); - return preBaseConstraint || semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeParameterSymbol.prototype.getConstraintRecursively = function (visitedTypeParameters) { - var constraint = this.getConstraint(); - - if (constraint) { - if (constraint.isTypeParameter()) { - var constraintAsTypeParameter = constraint; - if (!visitedTypeParameters[constraintAsTypeParameter.pullSymbolID]) { - visitedTypeParameters[constraintAsTypeParameter.pullSymbolID] = constraintAsTypeParameter; - return constraintAsTypeParameter.getConstraintRecursively(visitedTypeParameters); - } - } else { - return constraint; - } - } - - return null; - }; - - PullTypeParameterSymbol.prototype.getDefaultConstraint = function (semanticInfoChain) { - return this._constraint || semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeParameterSymbol.prototype.getCallSignatures = function () { - if (this._constraint) { - return this._constraint.getCallSignatures(); - } - - return _super.prototype.getCallSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.getConstructSignatures = function () { - if (this._constraint) { - return this._constraint.getConstructSignatures(); - } - - return _super.prototype.getConstructSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.getIndexSignatures = function () { - if (this._constraint) { - return this._constraint.getIndexSignatures(); - } - - return _super.prototype.getIndexSignatures.call(this); - }; - - PullTypeParameterSymbol.prototype.isGeneric = function () { - return true; - }; - - PullTypeParameterSymbol.prototype.fullName = function (scopeSymbol) { - var name = this.getDisplayName(scopeSymbol); - var container = this.getContainer(); - if (container) { - var containerName = container.fullName(scopeSymbol); - name = name + " in " + containerName; - } - - return name; - }; - - PullTypeParameterSymbol.prototype.getName = function (scopeSymbol, useConstraintInName) { - var name = _super.prototype.getName.call(this, scopeSymbol); - - if (this.isPrinting) { - return name; - } - - this.isPrinting = true; - - if (useConstraintInName && this._constraint) { - name += " extends " + this._constraint.toString(scopeSymbol); - } - - this.isPrinting = false; - - return name; - }; - - PullTypeParameterSymbol.prototype.getDisplayName = function (scopeSymbol, useConstraintInName, skipInternalAliasName) { - var name = _super.prototype.getDisplayName.call(this, scopeSymbol, useConstraintInName, skipInternalAliasName); - - if (this.isPrinting) { - return name; - } - - this.isPrinting = true; - - if (useConstraintInName && this._constraint) { - name += " extends " + this._constraint.toString(scopeSymbol); - } - - this.isPrinting = false; - - return name; - }; - - PullTypeParameterSymbol.prototype.isExternallyVisible = function (inIsExternallyVisibleSymbols) { - return true; - }; - return PullTypeParameterSymbol; - })(PullTypeSymbol); - TypeScript.PullTypeParameterSymbol = PullTypeParameterSymbol; - - var PullAccessorSymbol = (function (_super) { - __extends(PullAccessorSymbol, _super); - function PullAccessorSymbol(name) { - _super.call(this, name, 4096 /* Property */); - this._getterSymbol = null; - this._setterSymbol = null; - } - PullAccessorSymbol.prototype.isAccessor = function () { - return true; - }; - - PullAccessorSymbol.prototype.setSetter = function (setter) { - if (!setter) { - return; - } - - this._setterSymbol = setter; - }; - - PullAccessorSymbol.prototype.getSetter = function () { - return this._setterSymbol; - }; - - PullAccessorSymbol.prototype.setGetter = function (getter) { - if (!getter) { - return; - } - - this._getterSymbol = getter; - }; - - PullAccessorSymbol.prototype.getGetter = function () { - return this._getterSymbol; - }; - return PullAccessorSymbol; - })(PullSymbol); - TypeScript.PullAccessorSymbol = PullAccessorSymbol; - - function getIDForTypeSubstitutions(instantiatingTypeOrSignature, typeArgumentMap) { - var substitution = ""; - var members = null; - - var allowedToReferenceTypeParameters = instantiatingTypeOrSignature.getAllowedToReferenceTypeParameters(); - for (var i = 0; i < allowedToReferenceTypeParameters.length; i++) { - var typeParameter = allowedToReferenceTypeParameters[i]; - var typeParameterID = typeParameter.pullSymbolID; - var typeArg = typeArgumentMap[typeParameterID]; - if (!typeArg) { - typeArg = typeParameter; - } - substitution += typeParameterID + ":" + getIDForTypeSubstitutionsOfType(typeArg); - } - - return substitution; - } - TypeScript.getIDForTypeSubstitutions = getIDForTypeSubstitutions; - - function getIDForTypeSubstitutionsOfType(type) { - var structure; - if (type.isError()) { - structure = "E" + getIDForTypeSubstitutionsOfType(type._anyType); - } else if (!type.isNamedTypeSymbol()) { - structure = getIDForTypeSubstitutionsFromObjectType(type); - } - - if (!structure) { - structure = type.pullSymbolID + "#"; - } - - return structure; - } - - function getIDForTypeSubstitutionsFromObjectType(type) { - if (type.isResolved) { - var getIDForTypeSubStitutionWalker = new GetIDForTypeSubStitutionWalker(); - TypeScript.PullHelpers.walkPullTypeSymbolStructure(type, getIDForTypeSubStitutionWalker); - } - - return null; - } - - var GetIDForTypeSubStitutionWalker = (function () { - function GetIDForTypeSubStitutionWalker() { - this.structure = ""; - } - GetIDForTypeSubStitutionWalker.prototype.memberSymbolWalk = function (memberSymbol) { - this.structure += memberSymbol.name + "@" + getIDForTypeSubstitutionsOfType(memberSymbol.type); - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.callSignatureWalk = function (signatureSymbol) { - this.structure += "("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.constructSignatureWalk = function (signatureSymbol) { - this.structure += "new("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.indexSignatureWalk = function (signatureSymbol) { - this.structure += "[]("; - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.signatureParameterWalk = function (parameterSymbol) { - this.structure += parameterSymbol.name + "@" + getIDForTypeSubstitutionsOfType(parameterSymbol.type); - return true; - }; - GetIDForTypeSubStitutionWalker.prototype.signatureReturnTypeWalk = function (returnType) { - this.structure += ")" + getIDForTypeSubstitutionsOfType(returnType); - return true; - }; - return GetIDForTypeSubStitutionWalker; - })(); - - (function (GetAllMembersVisiblity) { - GetAllMembersVisiblity[GetAllMembersVisiblity["all"] = 0] = "all"; - - GetAllMembersVisiblity[GetAllMembersVisiblity["internallyVisible"] = 1] = "internallyVisible"; - - GetAllMembersVisiblity[GetAllMembersVisiblity["externallyVisible"] = 2] = "externallyVisible"; - })(TypeScript.GetAllMembersVisiblity || (TypeScript.GetAllMembersVisiblity = {})); - var GetAllMembersVisiblity = TypeScript.GetAllMembersVisiblity; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PullTypeEnclosingTypeWalker = (function () { - function PullTypeEnclosingTypeWalker() { - this.currentSymbols = null; - } - PullTypeEnclosingTypeWalker.prototype.getEnclosingType = function () { - if (this.currentSymbols && this.currentSymbols.length > 0) { - return this.currentSymbols[0]; - } - - return null; - }; - - PullTypeEnclosingTypeWalker.prototype._canWalkStructure = function () { - var enclosingType = this.getEnclosingType(); - return !!enclosingType && enclosingType.isGeneric(); - }; - - PullTypeEnclosingTypeWalker.prototype._getCurrentSymbol = function () { - if (this.currentSymbols && this.currentSymbols.length) { - return this.currentSymbols[this.currentSymbols.length - 1]; - } - - return null; - }; - - PullTypeEnclosingTypeWalker.prototype.getGenerativeClassification = function () { - if (this._canWalkStructure()) { - var currentType = this.currentSymbols[this.currentSymbols.length - 1]; - if (!currentType) { - return 0 /* Unknown */; - } - - var variableNeededToFixNodeJitterBug = this.getEnclosingType(); - - return currentType.getGenerativeTypeClassification(variableNeededToFixNodeJitterBug); - } - - return 2 /* Closed */; - }; - - PullTypeEnclosingTypeWalker.prototype._pushSymbol = function (symbol) { - return this.currentSymbols.push(symbol); - }; - - PullTypeEnclosingTypeWalker.prototype._popSymbol = function () { - return this.currentSymbols.pop(); - }; - - PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeOfParentDecl = function (decl, setSignature) { - var parentDecl = decl.getParentDecl(); - if (parentDecl) { - if (parentDecl.kind & 8216 /* SomeInstantiatableType */) { - this._setEnclosingTypeWorker(parentDecl.getSymbol(), true); - } else { - this._setEnclosingTypeOfParentDecl(parentDecl, true); - } - - if (this._canWalkStructure()) { - var symbol = decl.getSymbol(); - if (symbol) { - if (symbol.kind == 2048 /* Parameter */ || symbol.kind == 4096 /* Property */ || symbol.kind == 65536 /* Method */ || symbol.kind == 32768 /* ConstructorMethod */ || symbol.kind == 131072 /* FunctionExpression */) { - symbol = symbol.type; - } - - this._pushSymbol(symbol); - } - - if (setSignature) { - var signature = decl.getSignatureSymbol(); - if (signature) { - this._pushSymbol(signature); - } - } - } - } - }; - - PullTypeEnclosingTypeWalker.prototype._setEnclosingTypeWorker = function (symbol, setSignature) { - if (symbol.isType() && symbol.isNamedTypeSymbol()) { - this.currentSymbols = [TypeScript.PullHelpers.getRootType(symbol)]; - return; - } - - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - var decl = decls[i]; - this._setEnclosingTypeOfParentDecl(decl, setSignature); - if (this._canWalkStructure()) { - return; - } - } - }; - - PullTypeEnclosingTypeWalker.prototype.setCurrentSymbol = function (symbol) { - TypeScript.Debug.assert(this._canWalkStructure()); - this.currentSymbols[this.currentSymbols.length - 1] = symbol; - }; - - PullTypeEnclosingTypeWalker.prototype.startWalkingType = function (symbol) { - var currentSymbols = this.currentSymbols; - - var setEnclosingType = !this.getEnclosingType() || symbol.isNamedTypeSymbol(); - if (setEnclosingType) { - this.currentSymbols = null; - this.setEnclosingType(symbol); - } - return currentSymbols; - }; - - PullTypeEnclosingTypeWalker.prototype.endWalkingType = function (currentSymbolsWhenStartedWalkingTypes) { - this.currentSymbols = currentSymbolsWhenStartedWalkingTypes; - }; - - PullTypeEnclosingTypeWalker.prototype.setEnclosingType = function (symbol) { - TypeScript.Debug.assert(!this.getEnclosingType()); - this._setEnclosingTypeWorker(symbol, symbol.isSignature()); - }; - - PullTypeEnclosingTypeWalker.prototype.walkMemberType = function (memberName, resolver) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - var memberSymbol = currentType ? resolver._getNamedPropertySymbolOfAugmentedType(memberName, currentType) : null; - this._pushSymbol(memberSymbol ? memberSymbol.type : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkMemberType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkSignature = function (kind, index) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - var signatures; - if (currentType) { - if (kind == 1048576 /* CallSignature */) { - signatures = currentType.getCallSignatures(); - } else if (kind == 2097152 /* ConstructSignature */) { - signatures = currentType.getConstructSignatures(); - } else { - signatures = currentType.getIndexSignatures(); - } - } - - this._pushSymbol(signatures ? signatures[index] : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkSignature = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkTypeArgument = function (index) { - if (this._canWalkStructure()) { - var typeArgument = null; - var currentType = this._getCurrentSymbol(); - if (currentType) { - var typeArguments = currentType.getTypeArguments(); - typeArgument = typeArguments ? typeArguments[index] : null; - } - this._pushSymbol(typeArgument); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkTypeArgument = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkTypeParameterConstraint = function (index) { - if (this._canWalkStructure()) { - var typeParameters; - var currentSymbol = this._getCurrentSymbol(); - if (currentSymbol) { - if (currentSymbol.isSignature()) { - typeParameters = currentSymbol.getTypeParameters(); - } else { - TypeScript.Debug.assert(currentSymbol.isType()); - typeParameters = currentSymbol.getTypeParameters(); - } - } - this._pushSymbol(typeParameters ? typeParameters[index].getConstraint() : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkTypeParameterConstraint = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkReturnType = function () { - if (this._canWalkStructure()) { - var currentSignature = this._getCurrentSymbol(); - this._pushSymbol(currentSignature ? currentSignature.returnType : null); - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkReturnType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.walkParameterType = function (iParam) { - if (this._canWalkStructure()) { - var currentSignature = this._getCurrentSymbol(); - this._pushSymbol(currentSignature ? currentSignature.getParameterTypeAtIndex(iParam) : null); - } - }; - PullTypeEnclosingTypeWalker.prototype.postWalkParameterType = function () { - if (this._canWalkStructure()) { - this._popSymbol(); - } - }; - - PullTypeEnclosingTypeWalker.prototype.getBothKindOfIndexSignatures = function (resolver, context, includeAugmentedType) { - if (this._canWalkStructure()) { - var currentType = this._getCurrentSymbol(); - if (currentType) { - return resolver._getBothKindsOfIndexSignatures(currentType, context, includeAugmentedType); - } - } - return null; - }; - - PullTypeEnclosingTypeWalker.prototype.walkIndexSignatureReturnType = function (indexSigInfo, useStringIndexSignature, onlySignature) { - if (this._canWalkStructure()) { - var indexSig = indexSigInfo ? (useStringIndexSignature ? indexSigInfo.stringSignature : indexSigInfo.numericSignature) : null; - this._pushSymbol(indexSig); - if (!onlySignature) { - this._pushSymbol(indexSig ? indexSig.returnType : null); - } - } - }; - - PullTypeEnclosingTypeWalker.prototype.postWalkIndexSignatureReturnType = function (onlySignature) { - if (this._canWalkStructure()) { - if (!onlySignature) { - this._popSymbol(); - } - this._popSymbol(); - } - }; - return PullTypeEnclosingTypeWalker; - })(); - TypeScript.PullTypeEnclosingTypeWalker = PullTypeEnclosingTypeWalker; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var CandidateInferenceInfo = (function () { - function CandidateInferenceInfo() { - this.typeParameter = null; - this._inferredTypeAfterFixing = null; - this.inferenceCandidates = []; - } - CandidateInferenceInfo.prototype.addCandidate = function (candidate) { - if (!this._inferredTypeAfterFixing) { - this.inferenceCandidates[this.inferenceCandidates.length] = candidate; - } - }; - - CandidateInferenceInfo.prototype.isFixed = function () { - return !!this._inferredTypeAfterFixing; - }; - - CandidateInferenceInfo.prototype.fixTypeParameter = function (resolver, context) { - var _this = this; - if (!this._inferredTypeAfterFixing) { - var collection = { - getLength: function () { - return _this.inferenceCandidates.length; - }, - getTypeAtIndex: function (index) { - return _this.inferenceCandidates[index].type; - } - }; - - var bestCommonType = resolver.findBestCommonType(collection, context, new TypeScript.TypeComparisonInfo()); - this._inferredTypeAfterFixing = bestCommonType.widenedType(resolver, null, context); - } - }; - return CandidateInferenceInfo; - })(); - TypeScript.CandidateInferenceInfo = CandidateInferenceInfo; - - var TypeArgumentInferenceContext = (function () { - function TypeArgumentInferenceContext(resolver, context, signatureBeingInferred) { - this.resolver = resolver; - this.context = context; - this.signatureBeingInferred = signatureBeingInferred; - this.inferenceCache = TypeScript.BitMatrix.getBitMatrix(false); - this.candidateCache = []; - var typeParameters = signatureBeingInferred.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - this.addInferenceRoot(typeParameters[i]); - } - } - TypeArgumentInferenceContext.prototype.alreadyRelatingTypes = function (objectType, parameterType) { - if (this.inferenceCache.valueAt(objectType.pullSymbolID, parameterType.pullSymbolID)) { - return true; - } else { - this.inferenceCache.setValueAt(objectType.pullSymbolID, parameterType.pullSymbolID, true); - return false; - } - }; - - TypeArgumentInferenceContext.prototype.resetRelationshipCache = function () { - this.inferenceCache.release(); - this.inferenceCache = TypeScript.BitMatrix.getBitMatrix(false); - }; - - TypeArgumentInferenceContext.prototype.addInferenceRoot = function (param) { - var info = this.candidateCache[param.pullSymbolID]; - - if (!info) { - info = new CandidateInferenceInfo(); - info.typeParameter = param; - this.candidateCache[param.pullSymbolID] = info; - } - }; - - TypeArgumentInferenceContext.prototype.getInferenceInfo = function (param) { - return this.candidateCache[param.pullSymbolID]; - }; - - TypeArgumentInferenceContext.prototype.addCandidateForInference = function (param, candidate) { - var info = this.getInferenceInfo(param); - - if (info && candidate && info.inferenceCandidates.indexOf(candidate) < 0) { - info.addCandidate(candidate); - } - }; - - TypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - throw TypeScript.Errors.abstract(); - }; - - TypeArgumentInferenceContext.prototype.fixTypeParameter = function (typeParameter) { - var candidateInfo = this.candidateCache[typeParameter.pullSymbolID]; - if (candidateInfo) { - candidateInfo.fixTypeParameter(this.resolver, this.context); - } - }; - - TypeArgumentInferenceContext.prototype._finalizeInferredTypeArguments = function () { - var results = []; - var typeParameters = this.signatureBeingInferred.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - var info = this.candidateCache[typeParameters[i].pullSymbolID]; - - info.fixTypeParameter(this.resolver, this.context); - - for (var i = 0; i < results.length; i++) { - if (results[i].type === info.typeParameter) { - results[i].type = info._inferredTypeAfterFixing; - } - } - - results.push(info._inferredTypeAfterFixing); - } - - return results; - }; - - TypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - throw TypeScript.Errors.abstract(); - }; - return TypeArgumentInferenceContext; - })(); - TypeScript.TypeArgumentInferenceContext = TypeArgumentInferenceContext; - - var InvocationTypeArgumentInferenceContext = (function (_super) { - __extends(InvocationTypeArgumentInferenceContext, _super); - function InvocationTypeArgumentInferenceContext(resolver, context, signatureBeingInferred, argumentASTs) { - _super.call(this, resolver, context, signatureBeingInferred); - this.argumentASTs = argumentASTs; - } - InvocationTypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - return true; - }; - - InvocationTypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - var _this = this; - this.signatureBeingInferred.forAllParameterTypes(this.argumentASTs.nonSeparatorCount(), function (parameterType, argumentIndex) { - var argumentAST = _this.argumentASTs.nonSeparatorAt(argumentIndex); - - _this.context.pushInferentialType(parameterType, _this); - var argumentType = _this.resolver.resolveAST(argumentAST, true, _this.context).type; - _this.resolver.relateTypeToTypeParametersWithNewEnclosingTypes(argumentType, parameterType, _this, _this.context); - _this.context.popAnyContextualType(); - - return true; - }); - - return this._finalizeInferredTypeArguments(); - }; - return InvocationTypeArgumentInferenceContext; - })(TypeArgumentInferenceContext); - TypeScript.InvocationTypeArgumentInferenceContext = InvocationTypeArgumentInferenceContext; - - var ContextualSignatureInstantiationTypeArgumentInferenceContext = (function (_super) { - __extends(ContextualSignatureInstantiationTypeArgumentInferenceContext, _super); - function ContextualSignatureInstantiationTypeArgumentInferenceContext(resolver, context, signatureBeingInferred, contextualSignature, shouldFixContextualSignatureParameterTypes) { - _super.call(this, resolver, context, signatureBeingInferred); - this.contextualSignature = contextualSignature; - this.shouldFixContextualSignatureParameterTypes = shouldFixContextualSignatureParameterTypes; - } - ContextualSignatureInstantiationTypeArgumentInferenceContext.prototype.isInvocationInferenceContext = function () { - return false; - }; - - ContextualSignatureInstantiationTypeArgumentInferenceContext.prototype.inferTypeArguments = function () { - var _this = this; - var relateTypesCallback = function (parameterTypeBeingInferred, contextualParameterType) { - if (_this.shouldFixContextualSignatureParameterTypes) { - contextualParameterType = _this.context.fixAllTypeParametersReferencedByType(contextualParameterType, _this.resolver, _this); - } - _this.resolver.relateTypeToTypeParametersWithNewEnclosingTypes(contextualParameterType, parameterTypeBeingInferred, _this, _this.context); - - return true; - }; - - this.signatureBeingInferred.forAllCorrespondingParameterTypesInThisAndOtherSignature(this.contextualSignature, relateTypesCallback); - - return this._finalizeInferredTypeArguments(); - }; - return ContextualSignatureInstantiationTypeArgumentInferenceContext; - })(TypeArgumentInferenceContext); - TypeScript.ContextualSignatureInstantiationTypeArgumentInferenceContext = ContextualSignatureInstantiationTypeArgumentInferenceContext; - - var PullContextualTypeContext = (function () { - function PullContextualTypeContext(contextualType, provisional, isInferentiallyTyping, typeArgumentInferenceContext) { - this.contextualType = contextualType; - this.provisional = provisional; - this.isInferentiallyTyping = isInferentiallyTyping; - this.typeArgumentInferenceContext = typeArgumentInferenceContext; - this.provisionallyTypedSymbols = []; - this.hasProvisionalErrors = false; - this.astSymbolMap = []; - } - PullContextualTypeContext.prototype.recordProvisionallyTypedSymbol = function (symbol) { - this.provisionallyTypedSymbols[this.provisionallyTypedSymbols.length] = symbol; - }; - - PullContextualTypeContext.prototype.invalidateProvisionallyTypedSymbols = function () { - for (var i = 0; i < this.provisionallyTypedSymbols.length; i++) { - this.provisionallyTypedSymbols[i].setUnresolved(); - } - }; - - PullContextualTypeContext.prototype.setSymbolForAST = function (ast, symbol) { - this.astSymbolMap[ast.syntaxID()] = symbol; - }; - - PullContextualTypeContext.prototype.getSymbolForAST = function (ast) { - return this.astSymbolMap[ast.syntaxID()]; - }; - return PullContextualTypeContext; - })(); - TypeScript.PullContextualTypeContext = PullContextualTypeContext; - - var PullTypeResolutionContext = (function () { - function PullTypeResolutionContext(resolver, inTypeCheck, fileName) { - if (typeof inTypeCheck === "undefined") { inTypeCheck = false; } - if (typeof fileName === "undefined") { fileName = null; } - this.resolver = resolver; - this.inTypeCheck = inTypeCheck; - this.fileName = fileName; - this.contextStack = []; - this.typeCheckedNodes = null; - this.enclosingTypeWalker1 = null; - this.enclosingTypeWalker2 = null; - this.inBaseTypeResolution = false; - if (inTypeCheck) { - TypeScript.Debug.assert(fileName, "A file name must be provided if you are typechecking"); - this.typeCheckedNodes = TypeScript.BitVector.getBitVector(false); - } - } - PullTypeResolutionContext.prototype.setTypeChecked = function (ast) { - if (!this.inProvisionalResolution()) { - this.typeCheckedNodes.setValueAt(ast.syntaxID(), true); - } - }; - - PullTypeResolutionContext.prototype.canTypeCheckAST = function (ast) { - return this.typeCheck() && !this.typeCheckedNodes.valueAt(ast.syntaxID()) && this.fileName === ast.fileName(); - }; - - PullTypeResolutionContext.prototype._pushAnyContextualType = function (type, provisional, isInferentiallyTyping, argContext) { - this.contextStack.push(new PullContextualTypeContext(type, provisional, isInferentiallyTyping, argContext)); - }; - - PullTypeResolutionContext.prototype.pushNewContextualType = function (type) { - this._pushAnyContextualType(type, this.inProvisionalResolution(), false, null); - }; - - PullTypeResolutionContext.prototype.propagateContextualType = function (type) { - this._pushAnyContextualType(type, this.inProvisionalResolution(), this.isInferentiallyTyping(), this.getCurrentTypeArgumentInferenceContext()); - }; - - PullTypeResolutionContext.prototype.pushInferentialType = function (type, typeArgumentInferenceContext) { - this._pushAnyContextualType(type, true, true, typeArgumentInferenceContext); - }; - - PullTypeResolutionContext.prototype.pushProvisionalType = function (type) { - this._pushAnyContextualType(type, true, false, null); - }; - - PullTypeResolutionContext.prototype.popAnyContextualType = function () { - var tc = this.contextStack.pop(); - - tc.invalidateProvisionallyTypedSymbols(); - - if (tc.hasProvisionalErrors && this.inProvisionalResolution()) { - this.contextStack[this.contextStack.length - 1].hasProvisionalErrors = true; - } - - return tc; - }; - - PullTypeResolutionContext.prototype.hasProvisionalErrors = function () { - return this.contextStack.length ? this.contextStack[this.contextStack.length - 1].hasProvisionalErrors : false; - }; - - PullTypeResolutionContext.prototype.getContextualType = function () { - var context = !this.contextStack.length ? null : this.contextStack[this.contextStack.length - 1]; - - if (context) { - var type = context.contextualType; - - if (!type) { - return null; - } - - return type; - } - - return null; - }; - - PullTypeResolutionContext.prototype.fixAllTypeParametersReferencedByType = function (type, resolver, argContext) { - var argContext = this.getCurrentTypeArgumentInferenceContext(); - if (type.wrapsSomeTypeParameter(argContext.candidateCache)) { - var typeParameterArgumentMap = []; - - for (var n in argContext.candidateCache) { - var typeParameter = argContext.candidateCache[n] && argContext.candidateCache[n].typeParameter; - if (typeParameter) { - var dummyMap = []; - dummyMap[typeParameter.pullSymbolID] = typeParameter; - if (type.wrapsSomeTypeParameter(dummyMap)) { - argContext.fixTypeParameter(typeParameter); - TypeScript.Debug.assert(argContext.candidateCache[n]._inferredTypeAfterFixing); - typeParameterArgumentMap[typeParameter.pullSymbolID] = argContext.candidateCache[n]._inferredTypeAfterFixing; - } - } - } - - return resolver.instantiateType(type, typeParameterArgumentMap); - } - - return type; - }; - - PullTypeResolutionContext.prototype.getCurrentTypeArgumentInferenceContext = function () { - return this.contextStack.length ? this.contextStack[this.contextStack.length - 1].typeArgumentInferenceContext : null; - }; - - PullTypeResolutionContext.prototype.isInferentiallyTyping = function () { - return this.contextStack.length > 0 && this.contextStack[this.contextStack.length - 1].isInferentiallyTyping; - }; - - PullTypeResolutionContext.prototype.inProvisionalResolution = function () { - return (!this.contextStack.length ? false : this.contextStack[this.contextStack.length - 1].provisional); - }; - - PullTypeResolutionContext.prototype.isInBaseTypeResolution = function () { - return this.inBaseTypeResolution; - }; - - PullTypeResolutionContext.prototype.startBaseTypeResolution = function () { - var wasInBaseTypeResoltion = this.inBaseTypeResolution; - this.inBaseTypeResolution = true; - return wasInBaseTypeResoltion; - }; - - PullTypeResolutionContext.prototype.doneBaseTypeResolution = function (wasInBaseTypeResolution) { - this.inBaseTypeResolution = wasInBaseTypeResolution; - }; - - PullTypeResolutionContext.prototype.setTypeInContext = function (symbol, type) { - if (symbol.type && symbol.type.isError() && !type.isError()) { - return; - } - symbol.type = type; - - if (this.contextStack.length && this.inProvisionalResolution()) { - this.contextStack[this.contextStack.length - 1].recordProvisionallyTypedSymbol(symbol); - } - }; - - PullTypeResolutionContext.prototype.postDiagnostic = function (diagnostic) { - if (diagnostic) { - if (this.inProvisionalResolution()) { - (this.contextStack[this.contextStack.length - 1]).hasProvisionalErrors = true; - } else if (this.inTypeCheck && this.resolver) { - this.resolver.semanticInfoChain.addDiagnostic(diagnostic); - } - } - }; - - PullTypeResolutionContext.prototype.typeCheck = function () { - return this.inTypeCheck && !this.inProvisionalResolution(); - }; - - PullTypeResolutionContext.prototype.setSymbolForAST = function (ast, symbol) { - this.contextStack[this.contextStack.length - 1].setSymbolForAST(ast, symbol); - }; - - PullTypeResolutionContext.prototype.getSymbolForAST = function (ast) { - for (var i = this.contextStack.length - 1; i >= 0; i--) { - var typeContext = this.contextStack[i]; - if (!typeContext.provisional) { - break; - } - - var symbol = typeContext.getSymbolForAST(ast); - if (symbol) { - return symbol; - } - } - - return null; - }; - - PullTypeResolutionContext.prototype.startWalkingTypes = function (symbol1, symbol2) { - if (!this.enclosingTypeWalker1) { - this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - var symbolsWhenStartedWalkingTypes1 = this.enclosingTypeWalker1.startWalkingType(symbol1); - if (!this.enclosingTypeWalker2) { - this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - var symbolsWhenStartedWalkingTypes2 = this.enclosingTypeWalker2.startWalkingType(symbol2); - return { symbolsWhenStartedWalkingTypes1: symbolsWhenStartedWalkingTypes1, symbolsWhenStartedWalkingTypes2: symbolsWhenStartedWalkingTypes2 }; - }; - - PullTypeResolutionContext.prototype.endWalkingTypes = function (symbolsWhenStartedWalkingTypes) { - this.enclosingTypeWalker1.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes1); - this.enclosingTypeWalker2.endWalkingType(symbolsWhenStartedWalkingTypes.symbolsWhenStartedWalkingTypes2); - }; - - PullTypeResolutionContext.prototype.setEnclosingTypes = function (symbol1, symbol2) { - if (!this.enclosingTypeWalker1) { - this.enclosingTypeWalker1 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - this.enclosingTypeWalker1.setEnclosingType(symbol1); - if (!this.enclosingTypeWalker2) { - this.enclosingTypeWalker2 = new TypeScript.PullTypeEnclosingTypeWalker(); - } - this.enclosingTypeWalker2.setEnclosingType(symbol2); - }; - - PullTypeResolutionContext.prototype.walkMemberTypes = function (memberName) { - this.enclosingTypeWalker1.walkMemberType(memberName, this.resolver); - this.enclosingTypeWalker2.walkMemberType(memberName, this.resolver); - }; - - PullTypeResolutionContext.prototype.postWalkMemberTypes = function () { - this.enclosingTypeWalker1.postWalkMemberType(); - this.enclosingTypeWalker2.postWalkMemberType(); - }; - - PullTypeResolutionContext.prototype.walkSignatures = function (kind, index, index2) { - this.enclosingTypeWalker1.walkSignature(kind, index); - this.enclosingTypeWalker2.walkSignature(kind, index2 == undefined ? index : index2); - }; - - PullTypeResolutionContext.prototype.postWalkSignatures = function () { - this.enclosingTypeWalker1.postWalkSignature(); - this.enclosingTypeWalker2.postWalkSignature(); - }; - - PullTypeResolutionContext.prototype.walkTypeParameterConstraints = function (index) { - this.enclosingTypeWalker1.walkTypeParameterConstraint(index); - this.enclosingTypeWalker2.walkTypeParameterConstraint(index); - }; - - PullTypeResolutionContext.prototype.postWalkTypeParameterConstraints = function () { - this.enclosingTypeWalker1.postWalkTypeParameterConstraint(); - this.enclosingTypeWalker2.postWalkTypeParameterConstraint(); - }; - - PullTypeResolutionContext.prototype.walkTypeArgument = function (index) { - this.enclosingTypeWalker1.walkTypeArgument(index); - this.enclosingTypeWalker2.walkTypeArgument(index); - }; - - PullTypeResolutionContext.prototype.postWalkTypeArgument = function () { - this.enclosingTypeWalker1.postWalkTypeArgument(); - this.enclosingTypeWalker2.postWalkTypeArgument(); - }; - - PullTypeResolutionContext.prototype.walkReturnTypes = function () { - this.enclosingTypeWalker1.walkReturnType(); - this.enclosingTypeWalker2.walkReturnType(); - }; - - PullTypeResolutionContext.prototype.postWalkReturnTypes = function () { - this.enclosingTypeWalker1.postWalkReturnType(); - this.enclosingTypeWalker2.postWalkReturnType(); - }; - - PullTypeResolutionContext.prototype.walkParameterTypes = function (iParam) { - this.enclosingTypeWalker1.walkParameterType(iParam); - this.enclosingTypeWalker2.walkParameterType(iParam); - }; - - PullTypeResolutionContext.prototype.postWalkParameterTypes = function () { - this.enclosingTypeWalker1.postWalkParameterType(); - this.enclosingTypeWalker2.postWalkParameterType(); - }; - - PullTypeResolutionContext.prototype.getBothKindOfIndexSignatures = function (includeAugmentedType1, includeAugmentedType2) { - var indexSigs1 = this.enclosingTypeWalker1.getBothKindOfIndexSignatures(this.resolver, this, includeAugmentedType1); - var indexSigs2 = this.enclosingTypeWalker2.getBothKindOfIndexSignatures(this.resolver, this, includeAugmentedType2); - return { indexSigs1: indexSigs1, indexSigs2: indexSigs2 }; - }; - - PullTypeResolutionContext.prototype.walkIndexSignatureReturnTypes = function (indexSigs, useStringIndexSignature1, useStringIndexSignature2, onlySignature) { - this.enclosingTypeWalker1.walkIndexSignatureReturnType(indexSigs.indexSigs1, useStringIndexSignature1, onlySignature); - this.enclosingTypeWalker2.walkIndexSignatureReturnType(indexSigs.indexSigs2, useStringIndexSignature2, onlySignature); - }; - - PullTypeResolutionContext.prototype.postWalkIndexSignatureReturnTypes = function (onlySignature) { - this.enclosingTypeWalker1.postWalkIndexSignatureReturnType(onlySignature); - this.enclosingTypeWalker2.postWalkIndexSignatureReturnType(onlySignature); - }; - - PullTypeResolutionContext.prototype.swapEnclosingTypeWalkers = function () { - var tempEnclosingWalker1 = this.enclosingTypeWalker1; - this.enclosingTypeWalker1 = this.enclosingTypeWalker2; - this.enclosingTypeWalker2 = tempEnclosingWalker1; - }; - - PullTypeResolutionContext.prototype.oneOfClassificationsIsInfinitelyExpanding = function () { - var generativeClassification1 = this.enclosingTypeWalker1.getGenerativeClassification(); - if (generativeClassification1 === 3 /* InfinitelyExpanding */) { - return true; - } - var generativeClassification2 = this.enclosingTypeWalker2.getGenerativeClassification(); - if (generativeClassification2 === 3 /* InfinitelyExpanding */) { - return true; - } - - return false; - }; - - PullTypeResolutionContext.prototype.resetEnclosingTypeWalkers = function () { - var enclosingTypeWalker1 = this.enclosingTypeWalker1; - var enclosingTypeWalker2 = this.enclosingTypeWalker2; - this.enclosingTypeWalker1 = null; - this.enclosingTypeWalker2 = null; - return { - enclosingTypeWalker1: enclosingTypeWalker1, - enclosingTypeWalker2: enclosingTypeWalker2 - }; - }; - - PullTypeResolutionContext.prototype.setEnclosingTypeWalkers = function (enclosingTypeWalkers) { - this.enclosingTypeWalker1 = enclosingTypeWalkers.enclosingTypeWalker1; - this.enclosingTypeWalker2 = enclosingTypeWalkers.enclosingTypeWalker2; - }; - return PullTypeResolutionContext; - })(); - TypeScript.PullTypeResolutionContext = PullTypeResolutionContext; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var OverloadApplicabilityStatus; - (function (OverloadApplicabilityStatus) { - OverloadApplicabilityStatus[OverloadApplicabilityStatus["NotAssignable"] = 0] = "NotAssignable"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["AssignableButWithProvisionalErrors"] = 1] = "AssignableButWithProvisionalErrors"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["AssignableWithNoProvisionalErrors"] = 2] = "AssignableWithNoProvisionalErrors"; - OverloadApplicabilityStatus[OverloadApplicabilityStatus["Subtype"] = 3] = "Subtype"; - })(OverloadApplicabilityStatus || (OverloadApplicabilityStatus = {})); - - var PullAdditionalCallResolutionData = (function () { - function PullAdditionalCallResolutionData() { - this.targetSymbol = null; - this.resolvedSignatures = null; - this.candidateSignature = null; - this.actualParametersContextTypeSymbols = null; - this.diagnosticsFromOverloadResolution = []; - } - return PullAdditionalCallResolutionData; - })(); - TypeScript.PullAdditionalCallResolutionData = PullAdditionalCallResolutionData; - - var PullAdditionalObjectLiteralResolutionData = (function () { - function PullAdditionalObjectLiteralResolutionData() { - this.membersContextTypeSymbols = null; - } - return PullAdditionalObjectLiteralResolutionData; - })(); - TypeScript.PullAdditionalObjectLiteralResolutionData = PullAdditionalObjectLiteralResolutionData; - - var MemberWithBaseOrigin = (function () { - function MemberWithBaseOrigin(memberSymbol, baseOrigin) { - this.memberSymbol = memberSymbol; - this.baseOrigin = baseOrigin; - } - return MemberWithBaseOrigin; - })(); - - var SignatureWithBaseOrigin = (function () { - function SignatureWithBaseOrigin(signature, baseOrigin) { - this.signature = signature; - this.baseOrigin = baseOrigin; - } - return SignatureWithBaseOrigin; - })(); - - var InheritedIndexSignatureInfo = (function () { - function InheritedIndexSignatureInfo() { - } - return InheritedIndexSignatureInfo; - })(); - - var CompilerReservedName; - (function (CompilerReservedName) { - CompilerReservedName[CompilerReservedName["_this"] = 1] = "_this"; - CompilerReservedName[CompilerReservedName["_super"] = 2] = "_super"; - CompilerReservedName[CompilerReservedName["arguments"] = 3] = "arguments"; - CompilerReservedName[CompilerReservedName["_i"] = 4] = "_i"; - CompilerReservedName[CompilerReservedName["require"] = 5] = "require"; - CompilerReservedName[CompilerReservedName["exports"] = 6] = "exports"; - })(CompilerReservedName || (CompilerReservedName = {})); - - function getCompilerReservedName(name) { - var nameText = name.valueText(); - return CompilerReservedName[nameText]; - } - - var PullTypeResolver = (function () { - function PullTypeResolver(compilationSettings, semanticInfoChain) { - this.compilationSettings = compilationSettings; - this.semanticInfoChain = semanticInfoChain; - this._cachedArrayInterfaceType = null; - this._cachedNumberInterfaceType = null; - this._cachedStringInterfaceType = null; - this._cachedBooleanInterfaceType = null; - this._cachedObjectInterfaceType = null; - this._cachedFunctionInterfaceType = null; - this._cachedIArgumentsInterfaceType = null; - this._cachedRegExpInterfaceType = null; - this._cachedAnyTypeArgs = null; - this.typeCheckCallBacks = []; - this.postTypeCheckWorkitems = []; - this._cachedFunctionArgumentsSymbol = null; - this.assignableCache = TypeScript.BitMatrix.getBitMatrix(true); - this.subtypeCache = TypeScript.BitMatrix.getBitMatrix(true); - this.identicalCache = TypeScript.BitMatrix.getBitMatrix(true); - this.inResolvingOtherDeclsWalker = new TypeScript.PullHelpers.OtherPullDeclsWalker(); - } - PullTypeResolver.prototype.cachedArrayInterfaceType = function () { - if (!this._cachedArrayInterfaceType) { - this._cachedArrayInterfaceType = this.getSymbolFromDeclPath("Array", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (!this._cachedArrayInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedArrayInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedArrayInterfaceType; - }; - - PullTypeResolver.prototype.getArrayNamedType = function () { - return this.cachedArrayInterfaceType(); - }; - - PullTypeResolver.prototype.cachedNumberInterfaceType = function () { - if (!this._cachedNumberInterfaceType) { - this._cachedNumberInterfaceType = this.getSymbolFromDeclPath("Number", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedNumberInterfaceType && !this._cachedNumberInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedNumberInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedNumberInterfaceType; - }; - - PullTypeResolver.prototype.cachedStringInterfaceType = function () { - if (!this._cachedStringInterfaceType) { - this._cachedStringInterfaceType = this.getSymbolFromDeclPath("String", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedStringInterfaceType && !this._cachedStringInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedStringInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedStringInterfaceType; - }; - - PullTypeResolver.prototype.cachedBooleanInterfaceType = function () { - if (!this._cachedBooleanInterfaceType) { - this._cachedBooleanInterfaceType = this.getSymbolFromDeclPath("Boolean", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedBooleanInterfaceType && !this._cachedBooleanInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedBooleanInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedBooleanInterfaceType; - }; - - PullTypeResolver.prototype.cachedObjectInterfaceType = function () { - if (!this._cachedObjectInterfaceType) { - this._cachedObjectInterfaceType = this.getSymbolFromDeclPath("Object", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (!this._cachedObjectInterfaceType) { - this._cachedObjectInterfaceType = this.semanticInfoChain.anyTypeSymbol; - } - - if (!this._cachedObjectInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedObjectInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedObjectInterfaceType; - }; - - PullTypeResolver.prototype.cachedFunctionInterfaceType = function () { - if (!this._cachedFunctionInterfaceType) { - this._cachedFunctionInterfaceType = this.getSymbolFromDeclPath("Function", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedFunctionInterfaceType && !this._cachedFunctionInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedFunctionInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedFunctionInterfaceType; - }; - - PullTypeResolver.prototype.cachedIArgumentsInterfaceType = function () { - if (!this._cachedIArgumentsInterfaceType) { - this._cachedIArgumentsInterfaceType = this.getSymbolFromDeclPath("IArguments", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedIArgumentsInterfaceType && !this._cachedIArgumentsInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedIArgumentsInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedIArgumentsInterfaceType; - }; - - PullTypeResolver.prototype.cachedRegExpInterfaceType = function () { - if (!this._cachedRegExpInterfaceType) { - this._cachedRegExpInterfaceType = this.getSymbolFromDeclPath("RegExp", [], 16 /* Interface */) || this.semanticInfoChain.emptyTypeSymbol; - } - - if (this._cachedRegExpInterfaceType && !this._cachedRegExpInterfaceType.isResolved) { - this.resolveDeclaredSymbol(this._cachedRegExpInterfaceType, new TypeScript.PullTypeResolutionContext(this)); - } - - return this._cachedRegExpInterfaceType; - }; - - PullTypeResolver.prototype.cachedFunctionArgumentsSymbol = function () { - if (!this._cachedFunctionArgumentsSymbol) { - this._cachedFunctionArgumentsSymbol = new TypeScript.PullSymbol("arguments", 512 /* Variable */); - this._cachedFunctionArgumentsSymbol.type = this.cachedIArgumentsInterfaceType() || this.semanticInfoChain.anyTypeSymbol; - this._cachedFunctionArgumentsSymbol.setResolved(); - - var functionArgumentsDecl = new TypeScript.PullSynthesizedDecl("arguments", "arguments", 2048 /* Parameter */, 0 /* None */, null, this.semanticInfoChain); - functionArgumentsDecl.setSymbol(this._cachedFunctionArgumentsSymbol); - this._cachedFunctionArgumentsSymbol.addDeclaration(functionArgumentsDecl); - } - - return this._cachedFunctionArgumentsSymbol; - }; - - PullTypeResolver.prototype.getApparentType = function (type) { - if (type.isTypeParameter()) { - var baseConstraint = type.getBaseConstraint(this.semanticInfoChain); - if (baseConstraint === this.semanticInfoChain.anyTypeSymbol) { - return this.semanticInfoChain.emptyTypeSymbol; - } else { - type = baseConstraint; - } - } - if (type.isPrimitive()) { - if (type === this.semanticInfoChain.numberTypeSymbol) { - return this.cachedNumberInterfaceType(); - } - if (type === this.semanticInfoChain.booleanTypeSymbol) { - return this.cachedBooleanInterfaceType(); - } - if (type === this.semanticInfoChain.stringTypeSymbol) { - return this.cachedStringInterfaceType(); - } - return type; - } - if (type.isEnum()) { - return this.cachedNumberInterfaceType(); - } - return type; - }; - - PullTypeResolver.prototype.setTypeChecked = function (ast, context) { - context.setTypeChecked(ast); - }; - - PullTypeResolver.prototype.canTypeCheckAST = function (ast, context) { - return context.canTypeCheckAST(ast); - }; - - PullTypeResolver.prototype.setSymbolForAST = function (ast, symbol, context) { - if (context && context.inProvisionalResolution()) { - context.setSymbolForAST(ast, symbol); - } else { - this.semanticInfoChain.setSymbolForAST(ast, symbol); - } - }; - - PullTypeResolver.prototype.getSymbolForAST = function (ast, context) { - var symbol = this.semanticInfoChain.getSymbolForAST(ast); - - if (!symbol) { - if (context && context.inProvisionalResolution()) { - symbol = context.getSymbolForAST(ast); - } - } - - return symbol; - }; - - PullTypeResolver.prototype.getASTForDecl = function (decl) { - return this.semanticInfoChain.getASTForDecl(decl); - }; - - PullTypeResolver.prototype.getNewErrorTypeSymbol = function (name) { - if (typeof name === "undefined") { name = null; } - return new TypeScript.PullErrorTypeSymbol(this.semanticInfoChain.anyTypeSymbol, name); - }; - - PullTypeResolver.prototype.getEnclosingDecl = function (decl) { - var declPath = decl.getParentPath(); - - if (declPath.length > 1 && declPath[declPath.length - 1] === decl) { - return declPath[declPath.length - 2]; - } else { - return declPath[declPath.length - 1]; - } - }; - - PullTypeResolver.prototype.getExportedMemberSymbol = function (symbol, parent) { - if (!(symbol.kind & (65536 /* Method */ | 4096 /* Property */))) { - var isContainer = (parent.kind & (4 /* Container */ | 32 /* DynamicModule */)) !== 0; - var containerType = !isContainer ? parent.getAssociatedContainerType() : parent; - - if (isContainer && containerType) { - if (symbol.anyDeclHasFlag(1 /* Exported */)) { - return symbol; - } - - return null; - } - } - - return symbol; - }; - - PullTypeResolver.prototype._getNamedPropertySymbolOfAugmentedType = function (symbolName, parent) { - var memberSymbol = this.getNamedPropertySymbol(symbolName, 68147712 /* SomeValue */, parent); - if (memberSymbol) { - return memberSymbol; - } - - if (this.cachedFunctionInterfaceType() && parent.isFunctionType()) { - memberSymbol = this.cachedFunctionInterfaceType().findMember(symbolName, true); - if (memberSymbol) { - return memberSymbol; - } - } - - if (this.cachedObjectInterfaceType()) { - return this.cachedObjectInterfaceType().findMember(symbolName, true); - } - - return null; - }; - - PullTypeResolver.prototype.getNamedPropertySymbol = function (symbolName, declSearchKind, parent) { - var member = null; - - if (declSearchKind & 68147712 /* SomeValue */) { - member = parent.findMember(symbolName, true); - } else if (declSearchKind & 58728795 /* SomeType */) { - member = parent.findNestedType(symbolName); - } else if (declSearchKind & 164 /* SomeContainer */) { - member = parent.findNestedContainer(symbolName); - } - - if (member) { - return this.getExportedMemberSymbol(member, parent); - } - - var containerType = parent.getAssociatedContainerType(); - - if (containerType) { - if (containerType.isClass()) { - return null; - } - - parent = containerType; - - if (declSearchKind & 68147712 /* SomeValue */) { - member = parent.findMember(symbolName, true); - } else if (declSearchKind & 58728795 /* SomeType */) { - member = parent.findNestedType(symbolName); - } else if (declSearchKind & 164 /* SomeContainer */) { - member = parent.findNestedContainer(symbolName); - } - - if (member) { - return this.getExportedMemberSymbol(member, parent); - } - } - - if (parent.kind & 164 /* SomeContainer */) { - var typeDeclarations = parent.getDeclarations(); - var childDecls = null; - - for (var j = 0; j < typeDeclarations.length; j++) { - childDecls = typeDeclarations[j].searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - member = childDecls[0].getSymbol(); - - if (!member) { - member = childDecls[0].getSignatureSymbol(); - } - return this.getExportedMemberSymbol(member, parent); - } - - if ((declSearchKind & 58728795 /* SomeType */) !== 0 || (declSearchKind & 68147712 /* SomeValue */) !== 0) { - childDecls = typeDeclarations[j].searchChildDecls(symbolName, 128 /* TypeAlias */); - if (childDecls.length && childDecls[0].kind === 128 /* TypeAlias */) { - var aliasSymbol = this.getExportedMemberSymbol(childDecls[0].getSymbol(), parent); - if (aliasSymbol) { - if ((declSearchKind & 58728795 /* SomeType */) !== 0) { - var typeSymbol = aliasSymbol.getExportAssignedTypeSymbol(); - if (typeSymbol) { - return typeSymbol; - } - } else { - var valueSymbol = aliasSymbol.getExportAssignedValueSymbol(); - if (valueSymbol) { - aliasSymbol.setIsUsedAsValue(); - return valueSymbol; - } - } - - return aliasSymbol; - } - } - } - } - } - }; - - PullTypeResolver.prototype.getSymbolFromDeclPath = function (symbolName, declPath, declSearchKind) { - var _this = this; - var symbol = null; - - var decl = null; - var childDecls; - var declSymbol = null; - var declMembers; - var pathDeclKind; - var valDecl = null; - var kind; - var instanceSymbol = null; - var instanceType = null; - var childSymbol = null; - - var allowedContainerDeclKind = 4 /* Container */ | 32 /* DynamicModule */; - if (TypeScript.hasFlag(declSearchKind, 67108864 /* EnumMember */)) { - allowedContainerDeclKind |= 64 /* Enum */; - } - - var isAcceptableAlias = function (symbol) { - if (symbol.isAlias()) { - _this.resolveDeclaredSymbol(symbol); - if (TypeScript.hasFlag(declSearchKind, 164 /* SomeContainer */)) { - if (symbol.assignedContainer() || symbol.getExportAssignedContainerSymbol()) { - return true; - } - } else if (TypeScript.hasFlag(declSearchKind, 58728795 /* SomeType */)) { - var type = symbol.getExportAssignedTypeSymbol(); - if (type && type.kind !== 32 /* DynamicModule */) { - return true; - } - - var type = symbol.assignedType(); - if (type && type.kind !== 32 /* DynamicModule */) { - return true; - } - } else if (TypeScript.hasFlag(declSearchKind, 68147712 /* SomeValue */ & ~67108864 /* EnumMember */)) { - if (symbol.assignedType() && symbol.assignedType().isError()) { - return true; - } else if (symbol.assignedValue() || symbol.getExportAssignedValueSymbol()) { - return true; - } else { - var assignedType = symbol.assignedType(); - if (assignedType && assignedType.isContainer() && assignedType.getInstanceType()) { - return true; - } - - var decls = symbol.getDeclarations(); - var ast = decls[0].ast(); - return ast.moduleReference.kind() === 245 /* ExternalModuleReference */; - } - } - } - - return false; - }; - - var tryFindAlias = function (decl) { - var childDecls = decl.searchChildDecls(symbolName, 128 /* TypeAlias */); - - if (childDecls.length) { - var sym = childDecls[0].getSymbol(); - if (isAcceptableAlias(sym)) { - return sym; - } - } - return null; - }; - - for (var i = declPath.length - 1; i >= 0; i--) { - decl = declPath[i]; - pathDeclKind = decl.kind; - - if (decl.flags & 2097152 /* DeclaredInAWithBlock */) { - return this.semanticInfoChain.anyTypeSymbol; - } - - if (pathDeclKind & allowedContainerDeclKind) { - childDecls = decl.searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - return childDecls[0].getSymbol(); - } - - var alias = tryFindAlias(decl); - if (alias) { - return alias; - } - - if (declSearchKind & 68147712 /* SomeValue */) { - instanceSymbol = decl.getSymbol().getInstanceSymbol(); - - if (instanceSymbol) { - instanceType = instanceSymbol.type; - - childSymbol = this.getNamedPropertySymbol(symbolName, declSearchKind, instanceType); - - if (childSymbol && (childSymbol.kind & declSearchKind) && !childSymbol.anyDeclHasFlag(16 /* Static */)) { - return childSymbol; - } - } - - valDecl = decl.getValueDecl(); - - if (valDecl) { - decl = valDecl; - } - } - - declSymbol = decl.getSymbol().type; - - var childSymbol = this.getNamedPropertySymbol(symbolName, declSearchKind, declSymbol); - - if (childSymbol && (childSymbol.kind & declSearchKind) && !childSymbol.anyDeclHasFlag(16 /* Static */)) { - return childSymbol; - } - } else if ((declSearchKind & (58728795 /* SomeType */ | 164 /* SomeContainer */)) || !(pathDeclKind & 8 /* Class */)) { - var candidateSymbol = null; - - if (pathDeclKind === 131072 /* FunctionExpression */ && symbolName === decl.getFunctionExpressionName()) { - candidateSymbol = decl.getSymbol(); - } - - childDecls = decl.searchChildDecls(symbolName, declSearchKind); - - if (childDecls.length) { - if (decl.kind & 1032192 /* SomeFunction */) { - decl.ensureSymbolIsBound(); - } - return childDecls[0].getSymbol(); - } - - if (candidateSymbol) { - return candidateSymbol; - } - - var alias = tryFindAlias(decl); - if (alias) { - return alias; - } - } - } - - symbol = this.semanticInfoChain.findSymbol([symbolName], declSearchKind); - if (symbol) { - return symbol; - } - - if (!TypeScript.hasFlag(declSearchKind, 128 /* TypeAlias */)) { - symbol = this.semanticInfoChain.findSymbol([symbolName], 128 /* TypeAlias */); - if (symbol && isAcceptableAlias(symbol)) { - return symbol; - } - } - - return null; - }; - - PullTypeResolver.prototype.getVisibleDeclsFromDeclPath = function (declPath, declSearchKind) { - var result = []; - var decl = null; - var childDecls; - var pathDeclKind; - - for (var i = declPath.length - 1; i >= 0; i--) { - decl = declPath[i]; - pathDeclKind = decl.kind; - - var declKind = decl.kind; - - if (declKind !== 8 /* Class */ && declKind !== 16 /* Interface */) { - this.addFilteredDecls(decl.getChildDecls(), declSearchKind, result); - } - - switch (declKind) { - case 4 /* Container */: - case 32 /* DynamicModule */: - var otherDecls = this.semanticInfoChain.findDeclsFromPath(declPath.slice(0, i + 1), 164 /* SomeContainer */); - for (var j = 0, m = otherDecls.length; j < m; j++) { - var otherDecl = otherDecls[j]; - if (otherDecl === decl) { - continue; - } - - var otherDeclChildren = otherDecl.getChildDecls(); - for (var k = 0, s = otherDeclChildren.length; k < s; k++) { - var otherDeclChild = otherDeclChildren[k]; - if ((otherDeclChild.flags & 1 /* Exported */) && (otherDeclChild.kind & declSearchKind)) { - result.push(otherDeclChild); - } - } - } - - break; - - case 8 /* Class */: - case 16 /* Interface */: - var parameters = decl.getTypeParameters(); - if (parameters && parameters.length) { - this.addFilteredDecls(parameters, declSearchKind, result); - } - - break; - - case 131072 /* FunctionExpression */: - var functionExpressionName = decl.getFunctionExpressionName(); - if (functionExpressionName) { - result.push(decl); - } - - case 16384 /* Function */: - case 32768 /* ConstructorMethod */: - case 65536 /* Method */: - var parameters = decl.getTypeParameters(); - if (parameters && parameters.length) { - this.addFilteredDecls(parameters, declSearchKind, result); - } - - break; - } - } - - var topLevelDecls = this.semanticInfoChain.topLevelDecls(); - for (var i = 0, n = topLevelDecls.length; i < n; i++) { - var topLevelDecl = topLevelDecls[i]; - if (declPath.length > 0 && topLevelDecl.fileName() === declPath[0].fileName()) { - continue; - } - - if (!topLevelDecl.isExternalModule()) { - this.addFilteredDecls(topLevelDecl.getChildDecls(), declSearchKind, result); - } - } - - return result; - }; - - PullTypeResolver.prototype.addFilteredDecls = function (decls, declSearchKind, result) { - if (decls.length) { - for (var i = 0, n = decls.length; i < n; i++) { - var decl = decls[i]; - if (decl.kind & declSearchKind) { - result.push(decl); - } - } - } - }; - - PullTypeResolver.prototype.getVisibleDecls = function (enclosingDecl) { - var declPath = enclosingDecl.getParentPath(); - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - - return this.getVisibleDeclsFromDeclPath(declPath, declSearchKind); - }; - - PullTypeResolver.prototype.getVisibleContextSymbols = function (enclosingDecl, context) { - var contextualTypeSymbol = context.getContextualType(); - if (!contextualTypeSymbol || this.isAnyOrEquivalent(contextualTypeSymbol)) { - return null; - } - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - var members = contextualTypeSymbol.getAllMembers(declSearchKind, 2 /* externallyVisible */); - - for (var i = 0; i < members.length; i++) { - members[i].setUnresolved(); - } - - return members; - }; - - PullTypeResolver.prototype.getVisibleMembersFromExpression = function (expression, enclosingDecl, context) { - var lhs = this.resolveAST(expression, false, context); - - if (isTypesOnlyLocation(expression) && (lhs.kind === 8 /* Class */ || lhs.kind === 16 /* Interface */ || lhs.kind === 64 /* Enum */)) { - return null; - } - - var lhsType = lhs.type; - if (!lhsType) { - return null; - } - - this.resolveDeclaredSymbol(lhsType, context); - - if (lhsType.isContainer() && lhsType.isAlias()) { - lhsType = lhsType.getExportAssignedTypeSymbol(); - } - - if (this.isAnyOrEquivalent(lhsType)) { - return null; - } - - var memberVisibilty = 2 /* externallyVisible */; - var containerSymbol = lhsType; - if (containerSymbol.kind === 33554432 /* ConstructorType */) { - containerSymbol = containerSymbol.getConstructSignatures()[0].returnType; - } - - if (containerSymbol && containerSymbol.isClass()) { - var declPath = enclosingDecl.getParentPath(); - if (declPath && declPath.length) { - var declarations = containerSymbol.getDeclarations(); - for (var i = 0, n = declarations.length; i < n; i++) { - var declaration = declarations[i]; - if (TypeScript.ArrayUtilities.contains(declPath, declaration)) { - memberVisibilty = 1 /* internallyVisible */; - break; - } - } - } - } - - var declSearchKind = 58728795 /* SomeType */ | 164 /* SomeContainer */ | 68147712 /* SomeValue */; - - var members = []; - - if (lhsType.isContainer()) { - var exportedAssignedContainerSymbol = lhsType.getExportAssignedContainerSymbol(); - if (exportedAssignedContainerSymbol) { - lhsType = exportedAssignedContainerSymbol; - } - } - - lhsType = this.getApparentType(lhsType); - - if (!lhsType.isResolved) { - var potentiallySpecializedType = this.resolveDeclaredSymbol(lhsType, context); - - if (potentiallySpecializedType !== lhsType) { - if (!lhs.isType()) { - context.setTypeInContext(lhs, potentiallySpecializedType); - } - - lhsType = potentiallySpecializedType; - } - } - - members = lhsType.getAllMembers(declSearchKind, memberVisibilty); - - if (lhsType.isContainer()) { - var associatedInstance = lhsType.getInstanceSymbol(); - if (associatedInstance) { - var instanceType = associatedInstance.type; - this.resolveDeclaredSymbol(instanceType, context); - var instanceMembers = instanceType.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(instanceMembers); - } - - var exportedContainer = lhsType.getExportAssignedContainerSymbol(); - if (exportedContainer) { - var exportedContainerMembers = exportedContainer.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(exportedContainerMembers); - } - } else if (!lhsType.isConstructor() && !lhsType.isEnum()) { - var associatedContainerSymbol = lhsType.getAssociatedContainerType(); - if (associatedContainerSymbol) { - var containerType = associatedContainerSymbol.type; - this.resolveDeclaredSymbol(containerType, context); - var containerMembers = containerType.getAllMembers(declSearchKind, memberVisibilty); - members = members.concat(containerMembers); - } - } - - if (lhsType.isFunctionType() && this.cachedFunctionInterfaceType()) { - members = members.concat(this.cachedFunctionInterfaceType().getAllMembers(declSearchKind, 2 /* externallyVisible */)); - } - - return members; - }; - - PullTypeResolver.prototype.isAnyOrEquivalent = function (type) { - return (type === this.semanticInfoChain.anyTypeSymbol) || type.isError(); - }; - - PullTypeResolver.prototype.resolveExternalModuleReference = function (idText, currentFileName) { - var originalIdText = idText; - var symbol = null; - - if (TypeScript.isRelative(originalIdText)) { - var path = TypeScript.getRootFilePath(TypeScript.switchToForwardSlashes(currentFileName)); - symbol = this.semanticInfoChain.findExternalModule(path + idText); - } else { - idText = originalIdText; - - symbol = this.semanticInfoChain.findAmbientExternalModuleInGlobalContext(TypeScript.quoteStr(originalIdText)); - - if (!symbol) { - var path = TypeScript.getRootFilePath(TypeScript.switchToForwardSlashes(currentFileName)); - - while (symbol === null && path != "") { - symbol = this.semanticInfoChain.findExternalModule(path + idText); - if (symbol === null) { - if (path === '/') { - path = ''; - } else { - path = TypeScript.normalizePath(path + ".."); - path = path && path != '/' ? path + '/' : path; - } - } - } - } - } - - return symbol; - }; - - PullTypeResolver.prototype.resolveDeclaredSymbol = function (symbol, context) { - if (!symbol || symbol.isResolved || symbol.isTypeReference()) { - return symbol; - } - - if (!context) { - context = new TypeScript.PullTypeResolutionContext(this); - } - - return this.resolveDeclaredSymbolWorker(symbol, context); - }; - - PullTypeResolver.prototype.resolveDeclaredSymbolWorker = function (symbol, context) { - if (!symbol || symbol.isResolved) { - return symbol; - } - - if (symbol.inResolution) { - if (!symbol.type && !symbol.isType()) { - symbol.type = this.semanticInfoChain.anyTypeSymbol; - } - - return symbol; - } - - var decls = symbol.getDeclarations(); - - for (var i = 0; i < decls.length; i++) { - var decl = decls[i]; - - var ast = this.semanticInfoChain.getASTForDecl(decl); - - if (!ast || (ast.kind() === 139 /* GetAccessor */ && ast.parent.parent.kind() === 215 /* ObjectLiteralExpression */) || (ast.kind() === 140 /* SetAccessor */ && ast.parent.parent.kind() === 215 /* ObjectLiteralExpression */)) { - return symbol; - } - - if (ast.parent && ast.parent.kind() === 236 /* CatchClause */ && ast.parent.identifier === ast) { - return symbol; - } - - if (ast.parent && ast.parent.kind() === 219 /* SimpleArrowFunctionExpression */ && ast.parent.identifier === ast) { - return symbol; - } - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(ast); - var resolvedSymbol; - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, ast)) { - resolvedSymbol = this.resolveSingleModuleDeclaration(enclosingModule, ast, context); - } else if (ast.kind() === 120 /* SourceUnit */ && decl.kind === 32 /* DynamicModule */) { - resolvedSymbol = this.resolveModuleSymbol(decl.getSymbol(), context, null, null, ast); - } else { - TypeScript.Debug.assert(ast.kind() !== 11 /* IdentifierName */ && ast.kind() !== 212 /* MemberAccessExpression */); - resolvedSymbol = this.resolveAST(ast, false, context); - } - - if (decl.kind === 2048 /* Parameter */ && !symbol.isResolved && !symbol.type && resolvedSymbol && symbol.anyDeclHasFlag(8388608 /* PropertyParameter */ | 67108864 /* ConstructorParameter */)) { - symbol.type = resolvedSymbol.type; - symbol.setResolved(); - } - } - - return symbol; - }; - - PullTypeResolver.prototype.resolveOtherDecl = function (otherDecl, context) { - var astForOtherDecl = this.getASTForDecl(otherDecl); - var moduleDecl = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(astForOtherDecl); - if (TypeScript.ASTHelpers.isAnyNameOfModule(moduleDecl, astForOtherDecl)) { - this.resolveSingleModuleDeclaration(moduleDecl, astForOtherDecl, context); - } else { - this.resolveAST(astForOtherDecl, false, context); - } - }; - - PullTypeResolver.prototype.resolveOtherDeclarations = function (astName, context) { - var _this = this; - var resolvedDecl = this.semanticInfoChain.getDeclForAST(astName); - var symbol = resolvedDecl.getSymbol(); - - var allDecls = symbol.getDeclarations(); - this.inResolvingOtherDeclsWalker.walkOtherPullDecls(resolvedDecl, symbol.getDeclarations(), function (otherDecl) { - return _this.resolveOtherDecl(otherDecl, context); - }); - }; - - PullTypeResolver.prototype.resolveSourceUnit = function (sourceUnit, context) { - var enclosingDecl = this.getEnclosingDeclForAST(sourceUnit); - var moduleSymbol = enclosingDecl.getSymbol(); - this.ensureAllSymbolsAreBound(moduleSymbol); - - this.resolveFirstExportAssignmentStatement(sourceUnit.moduleElements, context); - this.resolveAST(sourceUnit.moduleElements, false, context); - - if (this.canTypeCheckAST(sourceUnit, context)) { - this.typeCheckSourceUnit(sourceUnit, context); - } - - return moduleSymbol; - }; - - PullTypeResolver.prototype.typeCheckSourceUnit = function (sourceUnit, context) { - var _this = this; - this.setTypeChecked(sourceUnit, context); - - this.resolveAST(sourceUnit.moduleElements, false, context); - - this.typeCheckCallBacks.push(function (context) { - return _this.verifyUniquenessOfImportNamesInSourceUnit(sourceUnit); - }); - }; - - PullTypeResolver.prototype.verifyUniquenessOfImportNamesInSourceUnit = function (sourceUnit) { - var _this = this; - var enclosingDecl = this.semanticInfoChain.getDeclForAST(sourceUnit); - - var doesImportNameExistInOtherFiles = function (name) { - var importSymbol = _this.semanticInfoChain.findTopLevelSymbol(name, 128 /* TypeAlias */, null); - return importSymbol && importSymbol.isAlias(); - }; - - this.checkUniquenessOfImportNames([enclosingDecl], doesImportNameExistInOtherFiles); - }; - - PullTypeResolver.prototype.resolveEnumDeclaration = function (ast, context) { - var containerDecl = this.semanticInfoChain.getDeclForAST(ast); - var containerSymbol = containerDecl.getSymbol(); - - if (containerSymbol.isResolved || containerSymbol.inResolution) { - return containerSymbol; - } - - containerSymbol.inResolution = true; - - var containerDecls = containerSymbol.getDeclarations(); - - for (var i = 0; i < containerDecls.length; i++) { - var childDecls = containerDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - - containerSymbol.setResolved(); - - this.resolveOtherDeclarations(ast, context); - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckEnumDeclaration(ast, context); - } - - return containerSymbol; - }; - - PullTypeResolver.prototype.typeCheckEnumDeclaration = function (ast, context) { - var _this = this; - this.setTypeChecked(ast, context); - - this.resolveAST(ast.enumElements, false, context); - var containerDecl = this.semanticInfoChain.getDeclForAST(ast); - this.validateVariableDeclarationGroups(containerDecl, context); - - this.typeCheckCallBacks.push(function (context) { - return _this.checkInitializersInEnumDeclarations(containerDecl, context); - }); - - if (!TypeScript.ASTHelpers.enumIsElided(ast)) { - this.checkNameForCompilerGeneratedDeclarationCollision(ast, true, ast.identifier, context); - } - }; - - PullTypeResolver.prototype.postTypeCheckEnumDeclaration = function (ast, context) { - this.checkThisCaptureVariableCollides(ast, true, context); - }; - - PullTypeResolver.prototype.checkInitializersInEnumDeclarations = function (decl, context) { - var symbol = decl.getSymbol(); - - var declarations = symbol.getDeclarations(); - if (decl !== declarations[0]) { - return; - } - - var seenEnumDeclWithNoFirstMember = false; - for (var i = 0; i < declarations.length; ++i) { - var currentDecl = declarations[i]; - - var ast = currentDecl.ast(); - if (ast.enumElements.nonSeparatorCount() === 0) { - continue; - } - - var firstVariable = ast.enumElements.nonSeparatorAt(0); - if (!firstVariable.equalsValueClause) { - if (!seenEnumDeclWithNoFirstMember) { - seenEnumDeclWithNoFirstMember = true; - } else { - this.semanticInfoChain.addDiagnosticFromAST(firstVariable, TypeScript.DiagnosticCode.In_enums_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_the_first_enum_element); - } - } - } - }; - - PullTypeResolver.prototype.resolveModuleDeclaration = function (ast, context) { - var result; - - if (ast.stringLiteral) { - result = this.resolveSingleModuleDeclaration(ast, ast.stringLiteral, context); - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - result = this.resolveSingleModuleDeclaration(ast, moduleNames[i], context); - } - } - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckModuleDeclaration(ast, context); - } - - return result; - }; - - PullTypeResolver.prototype.ensureAllSymbolsAreBound = function (containerSymbol) { - if (containerSymbol) { - var containerDecls = containerSymbol.getDeclarations(); - - for (var i = 0; i < containerDecls.length; i++) { - var childDecls = containerDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - } - }; - - PullTypeResolver.prototype.resolveModuleSymbol = function (containerSymbol, context, moduleDeclAST, moduleDeclNameAST, sourceUnitAST) { - if (containerSymbol.isResolved || containerSymbol.inResolution) { - return containerSymbol; - } - - containerSymbol.inResolution = true; - this.ensureAllSymbolsAreBound(containerSymbol); - - var instanceSymbol = containerSymbol.getInstanceSymbol(); - - if (instanceSymbol) { - this.resolveDeclaredSymbol(instanceSymbol, context); - } - - var isLastName = TypeScript.ASTHelpers.isLastNameOfModule(moduleDeclAST, moduleDeclNameAST); - if (isLastName) { - this.resolveFirstExportAssignmentStatement(moduleDeclAST.moduleElements, context); - } else if (sourceUnitAST) { - this.resolveFirstExportAssignmentStatement(sourceUnitAST.moduleElements, context); - } - - containerSymbol.setResolved(); - - if (moduleDeclNameAST) { - this.resolveOtherDeclarations(moduleDeclNameAST, context); - } - - return containerSymbol; - }; - - PullTypeResolver.prototype.resolveFirstExportAssignmentStatement = function (moduleElements, context) { - for (var i = 0, n = moduleElements.childCount(); i < n; i++) { - var moduleElement = moduleElements.childAt(i); - if (moduleElement.kind() === 134 /* ExportAssignment */) { - this.resolveExportAssignmentStatement(moduleElement, context); - return; - } - } - }; - - PullTypeResolver.prototype.resolveSingleModuleDeclaration = function (ast, astName, context) { - var containerDecl = this.semanticInfoChain.getDeclForAST(astName); - var containerSymbol = containerDecl.getSymbol(); - - return this.resolveModuleSymbol(containerSymbol, context, ast, astName, null); - }; - - PullTypeResolver.prototype.typeCheckModuleDeclaration = function (ast, context) { - if (ast.stringLiteral) { - this.typeCheckSingleModuleDeclaration(ast, ast.stringLiteral, context); - } else { - var moduleNames = TypeScript.getModuleNames(ast.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - this.typeCheckSingleModuleDeclaration(ast, moduleNames[i], context); - } - } - }; - - PullTypeResolver.prototype.typeCheckSingleModuleDeclaration = function (ast, astName, context) { - var _this = this; - this.setTypeChecked(ast, context); - - if (TypeScript.ASTHelpers.isLastNameOfModule(ast, astName)) { - this.resolveAST(ast.moduleElements, false, context); - } - - var containerDecl = this.semanticInfoChain.getDeclForAST(astName); - this.validateVariableDeclarationGroups(containerDecl, context); - - if (ast.stringLiteral) { - if (TypeScript.isRelative(ast.stringLiteral.valueText())) { - this.semanticInfoChain.addDiagnosticFromAST(ast.stringLiteral, TypeScript.DiagnosticCode.Ambient_external_module_declaration_cannot_specify_relative_module_name); - } - } - - if (!TypeScript.ASTHelpers.moduleIsElided(ast) && !ast.stringLiteral) { - this.checkNameForCompilerGeneratedDeclarationCollision(astName, true, astName, context); - } - - this.typeCheckCallBacks.push(function (context) { - return _this.verifyUniquenessOfImportNamesInModule(containerDecl); - }); - }; - - PullTypeResolver.prototype.verifyUniquenessOfImportNamesInModule = function (decl) { - var symbol = decl.getSymbol(); - if (!symbol) { - return; - } - - var decls = symbol.getDeclarations(); - - if (decls[0] !== decl) { - return; - } - - this.checkUniquenessOfImportNames(decls); - }; - - PullTypeResolver.prototype.checkUniquenessOfImportNames = function (decls, doesNameExistOutside) { - var _this = this; - var importDeclarationNames; - - for (var i = 0; i < decls.length; ++i) { - var childDecls = decls[i].getChildDecls(); - for (var j = 0; j < childDecls.length; ++j) { - var childDecl = childDecls[j]; - if (childDecl.kind === 128 /* TypeAlias */) { - importDeclarationNames = importDeclarationNames || TypeScript.createIntrinsicsObject(); - importDeclarationNames[childDecl.name] = true; - } - } - } - - if (!importDeclarationNames && !doesNameExistOutside) { - return; - } - - for (var i = 0; i < decls.length; ++i) { - this.scanVariableDeclarationGroups(decls[i], function (firstDeclInGroup) { - var nameConflict = importDeclarationNames && importDeclarationNames[firstDeclInGroup.name]; - if (!nameConflict) { - nameConflict = doesNameExistOutside && doesNameExistOutside(firstDeclInGroup.name); - if (nameConflict) { - importDeclarationNames = importDeclarationNames || TypeScript.createIntrinsicsObject(); - importDeclarationNames[firstDeclInGroup.name] = true; - } - } - - if (nameConflict) { - _this.semanticInfoChain.addDiagnosticFromAST(firstDeclInGroup.ast(), TypeScript.DiagnosticCode.Variable_declaration_cannot_have_the_same_name_as_an_import_declaration); - } - }); - } - }; - - PullTypeResolver.prototype.scanVariableDeclarationGroups = function (enclosingDecl, firstDeclHandler, subsequentDeclHandler) { - var declGroups = enclosingDecl.getVariableDeclGroups(); - - for (var i = 0; i < declGroups.length; i++) { - var firstSymbol = null; - var enclosingDeclForFirstSymbol = null; - - if (enclosingDecl.kind === 1 /* Script */ && declGroups[i].length) { - var name = declGroups[i][0].name; - var candidateSymbol = this.semanticInfoChain.findTopLevelSymbol(name, 512 /* Variable */, enclosingDecl); - if (candidateSymbol && candidateSymbol.isResolved) { - if (!candidateSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */)) { - firstSymbol = candidateSymbol; - } - } - } - - for (var j = 0; j < declGroups[i].length; j++) { - var decl = declGroups[i][j]; - - var name = decl.name; - - var symbol = decl.getSymbol(); - - if (j === 0) { - firstDeclHandler(decl); - if (!subsequentDeclHandler) { - break; - } - - if (!firstSymbol || !firstSymbol.type) { - firstSymbol = symbol; - continue; - } - } - - subsequentDeclHandler(decl, firstSymbol); - } - } - }; - - PullTypeResolver.prototype.postTypeCheckModuleDeclaration = function (ast, context) { - this.checkThisCaptureVariableCollides(ast, true, context); - }; - - PullTypeResolver.prototype.isTypeRefWithoutTypeArgs = function (term) { - if (term.kind() === 11 /* IdentifierName */) { - return true; - } else if (term.kind() === 121 /* QualifiedName */) { - var binex = term; - - if (binex.right.kind() === 11 /* IdentifierName */) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.createInstantiatedType = function (type, typeArguments) { - if (!type.isGeneric()) { - return type; - } - - var typeParameters = type.getTypeArgumentsOrTypeParameters(); - - var typeParameterArgumentMap = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameterArgumentMap[typeParameters[i].pullSymbolID] = typeArguments[i] || new TypeScript.PullErrorTypeSymbol(this.semanticInfoChain.anyTypeSymbol, typeParameters[i].name); - } - - return TypeScript.PullInstantiatedTypeReferenceSymbol.create(this, type, typeParameterArgumentMap); - }; - - PullTypeResolver.prototype.resolveReferenceTypeDeclaration = function (classOrInterface, name, heritageClauses, context) { - var _this = this; - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(typeDecl); - var typeDeclSymbol = typeDecl.getSymbol(); - var typeDeclIsClass = classOrInterface.kind() === 131 /* ClassDeclaration */; - var hasVisited = this.getSymbolForAST(classOrInterface, context) !== null; - - if ((typeDeclSymbol.isResolved && hasVisited) || (typeDeclSymbol.inResolution && !context.isInBaseTypeResolution())) { - return typeDeclSymbol; - } - - var wasResolving = typeDeclSymbol.inResolution; - typeDeclSymbol.startResolving(); - - var typeRefDecls = typeDeclSymbol.getDeclarations(); - - for (var i = 0; i < typeRefDecls.length; i++) { - var childDecls = typeRefDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - - if (!typeDeclSymbol.isResolved) { - var typeDeclTypeParameters = typeDeclSymbol.getTypeParameters(); - for (var i = 0; i < typeDeclTypeParameters.length; i++) { - this.resolveDeclaredSymbol(typeDeclTypeParameters[i], context); - } - } - - var wasInBaseTypeResolution = context.startBaseTypeResolution(); - - if (!typeDeclIsClass && !hasVisited) { - typeDeclSymbol.resetKnownBaseTypeCount(); - } - - var extendsClause = TypeScript.ASTHelpers.getExtendsHeritageClause(heritageClauses); - if (extendsClause) { - for (var i = typeDeclSymbol.getKnownBaseTypeCount(); i < extendsClause.typeNames.nonSeparatorCount(); i = typeDeclSymbol.getKnownBaseTypeCount()) { - typeDeclSymbol.incrementKnownBaseCount(); - var parentType = this.resolveTypeReference(extendsClause.typeNames.nonSeparatorAt(i), context); - - if (typeDeclSymbol.isValidBaseKind(parentType, true)) { - this.setSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), parentType, null); - - if (!typeDeclSymbol.hasBase(parentType) && !parentType.hasBase(typeDeclSymbol)) { - typeDeclSymbol.addExtendedType(parentType); - - var specializations = typeDeclSymbol.getKnownSpecializations(); - - for (var j = 0; j < specializations.length; j++) { - specializations[j].addExtendedType(parentType); - } - } - } else if (parentType && !this.getSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), context)) { - this.setSymbolForAST(extendsClause.typeNames.nonSeparatorAt(i), parentType, null); - } - } - } - - var implementsClause = TypeScript.ASTHelpers.getImplementsHeritageClause(heritageClauses); - if (implementsClause && typeDeclIsClass) { - var extendsCount = extendsClause ? extendsClause.typeNames.nonSeparatorCount() : 0; - for (var i = typeDeclSymbol.getKnownBaseTypeCount(); ((i - extendsCount) >= 0) && ((i - extendsCount) < implementsClause.typeNames.nonSeparatorCount()); i = typeDeclSymbol.getKnownBaseTypeCount()) { - typeDeclSymbol.incrementKnownBaseCount(); - var implementedTypeAST = implementsClause.typeNames.nonSeparatorAt(i - extendsCount); - var implementedType = this.resolveTypeReference(implementedTypeAST, context); - - if (typeDeclSymbol.isValidBaseKind(implementedType, false)) { - this.setSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), implementedType, null); - - if (!typeDeclSymbol.hasBase(implementedType) && !implementedType.hasBase(typeDeclSymbol)) { - typeDeclSymbol.addImplementedType(implementedType); - } - } else if (implementedType && !this.getSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), context)) { - this.setSymbolForAST(implementsClause.typeNames.nonSeparatorAt(i - extendsCount), implementedType, null); - } - } - } - - context.doneBaseTypeResolution(wasInBaseTypeResolution); - - if (wasInBaseTypeResolution) { - typeDeclSymbol.inResolution = false; - - this.typeCheckCallBacks.push(function (context) { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - _this.resolveClassDeclaration(classOrInterface, context); - } else { - _this.resolveInterfaceDeclaration(classOrInterface, context); - } - }); - - return typeDeclSymbol; - } - - this.setSymbolForAST(name, typeDeclSymbol, context); - this.setSymbolForAST(classOrInterface, typeDeclSymbol, context); - - typeDeclSymbol.setResolved(); - - return typeDeclSymbol; - }; - - PullTypeResolver.prototype.resolveClassDeclaration = function (classDeclAST, context) { - var classDecl = this.semanticInfoChain.getDeclForAST(classDeclAST); - var classDeclSymbol = classDecl.getSymbol(); - - if (!classDeclSymbol.isResolved) { - this.resolveReferenceTypeDeclaration(classDeclAST, classDeclAST.identifier, classDeclAST.heritageClauses, context); - - var constructorMethod = classDeclSymbol.getConstructorMethod(); - var extendedTypes = classDeclSymbol.getExtendedTypes(); - var parentType = extendedTypes.length ? extendedTypes[0] : null; - - if (constructorMethod) { - var constructorTypeSymbol = constructorMethod.type; - - var constructSignatures = constructorTypeSymbol.getConstructSignatures(); - - if (!constructSignatures.length) { - var constructorSignature; - - var parentConstructor = parentType ? parentType.getConstructorMethod() : null; - - if (parentConstructor) { - this.resolveDeclaredSymbol(parentConstructor, context); - var parentConstructorType = parentConstructor.type; - var parentConstructSignatures = parentConstructorType.getConstructSignatures(); - - var parentConstructSignature; - var parentParameters; - - if (!parentConstructSignatures.length) { - parentConstructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - parentConstructSignature.returnType = parentType; - parentConstructSignature.addTypeParametersFromReturnType(); - parentConstructorType.appendConstructSignature(parentConstructSignature); - parentConstructSignature.addDeclaration(parentType.getDeclarations()[0]); - parentConstructSignatures = [parentConstructSignature]; - } - - for (var i = 0; i < parentConstructSignatures.length; i++) { - parentConstructSignature = parentConstructSignatures[i]; - parentParameters = parentConstructSignature.parameters; - - constructorSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */, parentConstructSignature.isDefinition()); - constructorSignature.returnType = classDeclSymbol; - constructorSignature.addTypeParametersFromReturnType(); - - for (var j = 0; j < parentParameters.length; j++) { - constructorSignature.addParameter(parentParameters[j], parentParameters[j].isOptional); - } - - constructorTypeSymbol.appendConstructSignature(constructorSignature); - constructorSignature.addDeclaration(classDecl); - } - } else { - constructorSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - constructorSignature.returnType = classDeclSymbol; - constructorSignature.addTypeParametersFromReturnType(); - constructorTypeSymbol.appendConstructSignature(constructorSignature); - constructorSignature.addDeclaration(classDecl); - } - } - - if (!classDeclSymbol.isResolved) { - return classDeclSymbol; - } - - if (parentType) { - var parentConstructorSymbol = parentType.getConstructorMethod(); - - if (parentConstructorSymbol) { - var parentConstructorTypeSymbol = parentConstructorSymbol.type; - - if (!constructorTypeSymbol.hasBase(parentConstructorTypeSymbol)) { - constructorTypeSymbol.addExtendedType(parentConstructorTypeSymbol); - } - } - } - } - - this.resolveOtherDeclarations(classDeclAST, context); - } - - if (this.canTypeCheckAST(classDeclAST, context)) { - this.typeCheckClassDeclaration(classDeclAST, context); - } - - return classDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckTypeParametersOfTypeDeclaration = function (classOrInterface, context) { - var _this = this; - var typeParametersList = classOrInterface.kind() == 131 /* ClassDeclaration */ ? classOrInterface.typeParameterList : classOrInterface.typeParameterList; - - if (typeParametersList) { - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var typeDeclSymbol = typeDecl.getSymbol(); - - for (var i = 0; i < typeParametersList.typeParameters.nonSeparatorCount(); i++) { - var typeParameterAST = typeParametersList.typeParameters.nonSeparatorAt(i); - this.resolveTypeParameterDeclaration(typeParameterAST, context); - - var typeParameterDecl = this.semanticInfoChain.getDeclForAST(typeParameterAST); - var typeParameterSymbol = typeParameterDecl.getSymbol(); - - this.checkSymbolPrivacy(typeDeclSymbol, typeParameterSymbol, function (symbol) { - return _this.typeParameterOfTypeDeclarationPrivacyErrorReporter(classOrInterface, typeParameterAST, typeParameterSymbol, symbol, context); - }); - } - } - }; - - PullTypeResolver.prototype.typeCheckClassDeclaration = function (classDeclAST, context) { - this.setTypeChecked(classDeclAST, context); - - var classDecl = this.semanticInfoChain.getDeclForAST(classDeclAST); - var classDeclSymbol = classDecl.getSymbol(); - - this.checkNameForCompilerGeneratedDeclarationCollision(classDeclAST, true, classDeclAST.identifier, context); - this.resolveAST(classDeclAST.classElements, false, context); - - this.typeCheckTypeParametersOfTypeDeclaration(classDeclAST, context); - this.typeCheckBases(classDeclAST, classDeclAST.identifier, classDeclAST.heritageClauses, classDeclSymbol, this.getEnclosingDecl(classDecl), context); - - if (!classDeclSymbol.hasBaseTypeConflict()) { - this.typeCheckMembersAgainstIndexer(classDeclSymbol, classDecl, context); - } - - this.checkTypeForDuplicateIndexSignatures(classDeclSymbol); - }; - - PullTypeResolver.prototype.postTypeCheckClassDeclaration = function (classDeclAST, context) { - this.checkThisCaptureVariableCollides(classDeclAST, true, context); - }; - - PullTypeResolver.prototype.resolveTypeSymbolSignatures = function (typeSymbol, context) { - var callSignatures = typeSymbol.getCallSignatures(); - for (var i = 0; i < callSignatures.length; i++) { - this.resolveDeclaredSymbol(callSignatures[i], context); - } - - var constructSignatures = typeSymbol.getConstructSignatures(); - for (var i = 0; i < constructSignatures.length; i++) { - this.resolveDeclaredSymbol(constructSignatures[i], context); - } - - var indexSignatures = typeSymbol.getIndexSignatures(); - for (var i = 0; i < indexSignatures.length; i++) { - this.resolveDeclaredSymbol(indexSignatures[i], context); - } - }; - - PullTypeResolver.prototype.resolveInterfaceDeclaration = function (interfaceDeclAST, context) { - this.resolveReferenceTypeDeclaration(interfaceDeclAST, interfaceDeclAST.identifier, interfaceDeclAST.heritageClauses, context); - - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - this.resolveTypeSymbolSignatures(interfaceDeclSymbol, context); - - if (interfaceDeclSymbol.isResolved) { - this.resolveOtherDeclarations(interfaceDeclAST, context); - - if (this.canTypeCheckAST(interfaceDeclAST, context)) { - this.typeCheckInterfaceDeclaration(interfaceDeclAST, context); - } - } - - return interfaceDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckInterfaceDeclaration = function (interfaceDeclAST, context) { - this.setTypeChecked(interfaceDeclAST, context); - - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - this.resolveAST(interfaceDeclAST.body.typeMembers, false, context); - - this.typeCheckTypeParametersOfTypeDeclaration(interfaceDeclAST, context); - this.typeCheckBases(interfaceDeclAST, interfaceDeclAST.identifier, interfaceDeclAST.heritageClauses, interfaceDeclSymbol, this.getEnclosingDecl(interfaceDecl), context); - - if (!interfaceDeclSymbol.hasBaseTypeConflict()) { - this.typeCheckMembersAgainstIndexer(interfaceDeclSymbol, interfaceDecl, context); - } - - var allInterfaceDecls = interfaceDeclSymbol.getDeclarations(); - if (interfaceDecl === allInterfaceDecls[allInterfaceDecls.length - 1]) { - this.checkTypeForDuplicateIndexSignatures(interfaceDeclSymbol); - } - - if (!this.checkInterfaceDeclForIdenticalTypeParameters(interfaceDeclAST, context)) { - this.semanticInfoChain.addDiagnosticFromAST(interfaceDeclAST.identifier, TypeScript.DiagnosticCode.All_declarations_of_an_interface_must_have_identical_type_parameters); - } - }; - - PullTypeResolver.prototype.checkInterfaceDeclForIdenticalTypeParameters = function (interfaceDeclAST, context) { - var interfaceDecl = this.semanticInfoChain.getDeclForAST(interfaceDeclAST); - var interfaceDeclSymbol = interfaceDecl.getSymbol(); - - if (!interfaceDeclSymbol.isGeneric()) { - return true; - } - - var firstInterfaceDecl = interfaceDeclSymbol.getDeclarations()[0]; - if (firstInterfaceDecl == interfaceDecl) { - return true; - } - - var typeParameters = interfaceDecl.getTypeParameters(); - var firstInterfaceDeclTypeParameters = firstInterfaceDecl.getTypeParameters(); - - if (typeParameters.length != firstInterfaceDeclTypeParameters.length) { - return false; - } - - for (var i = 0; i < typeParameters.length; i++) { - var typeParameter = typeParameters[i]; - var firstInterfaceDeclTypeParameter = firstInterfaceDeclTypeParameters[i]; - - if (typeParameter.name != firstInterfaceDeclTypeParameter.name) { - return false; - } - - var typeParameterSymbol = typeParameter.getSymbol(); - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter); - var firstInterfaceDeclTypeParameterAST = this.semanticInfoChain.getASTForDecl(firstInterfaceDeclTypeParameter); - - if (!!typeParameterAST.constraint != !!firstInterfaceDeclTypeParameterAST.constraint) { - return false; - } - - if (typeParameterAST.constraint) { - var typeParameterConstraint = this.resolveAST(typeParameterAST.constraint, false, context); - if (!this.typesAreIdenticalWithNewEnclosingTypes(typeParameterConstraint, typeParameterSymbol.getConstraint(), context)) { - return false; - } - } - } - - return true; - }; - - PullTypeResolver.prototype.checkTypeForDuplicateIndexSignatures = function (enclosingTypeSymbol) { - var indexSignatures = enclosingTypeSymbol.getOwnIndexSignatures(); - var firstStringIndexer = null; - var firstNumberIndexer = null; - for (var i = 0; i < indexSignatures.length; i++) { - var currentIndexer = indexSignatures[i]; - var currentParameterType = currentIndexer.parameters[0].type; - TypeScript.Debug.assert(currentParameterType); - if (currentParameterType === this.semanticInfoChain.stringTypeSymbol) { - if (firstStringIndexer) { - this.semanticInfoChain.addDiagnosticFromAST(currentIndexer.getDeclarations()[0].ast(), TypeScript.DiagnosticCode.Duplicate_string_index_signature, null, [this.semanticInfoChain.locationFromAST(firstStringIndexer.getDeclarations()[0].ast())]); - return; - } else { - firstStringIndexer = currentIndexer; - } - } else if (currentParameterType === this.semanticInfoChain.numberTypeSymbol) { - if (firstNumberIndexer) { - this.semanticInfoChain.addDiagnosticFromAST(currentIndexer.getDeclarations()[0].ast(), TypeScript.DiagnosticCode.Duplicate_number_index_signature, null, [this.semanticInfoChain.locationFromAST(firstNumberIndexer.getDeclarations()[0].ast())]); - return; - } else { - firstNumberIndexer = currentIndexer; - } - } - } - }; - - PullTypeResolver.prototype.filterSymbol = function (symbol, kind, enclosingDecl, context) { - if (symbol) { - if (symbol.kind & kind) { - return symbol; - } - - if (symbol.isAlias()) { - this.resolveDeclaredSymbol(symbol, context); - - var alias = symbol; - if (kind & 164 /* SomeContainer */) { - return alias.getExportAssignedContainerSymbol(); - } else if (kind & 58728795 /* SomeType */) { - return alias.getExportAssignedTypeSymbol(); - } else if (kind & 68147712 /* SomeValue */) { - return alias.getExportAssignedValueSymbol(); - } - } - } - return null; - }; - - PullTypeResolver.prototype.getMemberSymbolOfKind = function (symbolName, kind, pullTypeSymbol, enclosingDecl, context) { - var memberSymbol = this.getNamedPropertySymbol(symbolName, kind, pullTypeSymbol); - - return { - symbol: this.filterSymbol(memberSymbol, kind, enclosingDecl, context), - aliasSymbol: memberSymbol && memberSymbol.isAlias() ? memberSymbol : null - }; - }; - - PullTypeResolver.prototype.resolveIdentifierOfInternalModuleReference = function (importDecl, identifier, moduleSymbol, enclosingDecl, context) { - var rhsName = identifier.valueText(); - if (rhsName.length === 0) { - return null; - } - - var moduleTypeSymbol = moduleSymbol.type; - var memberSymbol = this.getMemberSymbolOfKind(rhsName, 164 /* SomeContainer */, moduleTypeSymbol, enclosingDecl, context); - var containerSymbol = memberSymbol.symbol; - var valueSymbol = null; - var typeSymbol = null; - var aliasSymbol = null; - - var acceptableAlias = true; - - if (containerSymbol) { - acceptableAlias = (containerSymbol.kind & 59753052 /* AcceptableAlias */) !== 0; - aliasSymbol = memberSymbol.aliasSymbol; - } - - if (!acceptableAlias && containerSymbol && containerSymbol.kind === 128 /* TypeAlias */) { - this.resolveDeclaredSymbol(containerSymbol, context); - var aliasedAssignedValue = containerSymbol.getExportAssignedValueSymbol(); - var aliasedAssignedType = containerSymbol.getExportAssignedTypeSymbol(); - var aliasedAssignedContainer = containerSymbol.getExportAssignedContainerSymbol(); - - if (aliasedAssignedValue || aliasedAssignedType || aliasedAssignedContainer) { - aliasSymbol = containerSymbol; - valueSymbol = aliasedAssignedValue; - typeSymbol = aliasedAssignedType; - containerSymbol = aliasedAssignedContainer; - acceptableAlias = true; - } - } - - if (!acceptableAlias) { - this.semanticInfoChain.addDiagnosticFromAST(identifier, TypeScript.DiagnosticCode.Import_declaration_referencing_identifier_from_internal_module_can_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules); - return null; - } - - if (!valueSymbol) { - if (moduleTypeSymbol.getInstanceSymbol()) { - memberSymbol = this.getMemberSymbolOfKind(rhsName, 68147712 /* SomeValue */, moduleTypeSymbol.getInstanceSymbol().type, enclosingDecl, context); - valueSymbol = memberSymbol.symbol; - if (valueSymbol && memberSymbol.aliasSymbol) { - aliasSymbol = memberSymbol.aliasSymbol; - } - } - } - - if (!typeSymbol) { - memberSymbol = this.getMemberSymbolOfKind(rhsName, 58728795 /* SomeType */, moduleTypeSymbol, enclosingDecl, context); - typeSymbol = memberSymbol.symbol; - if (typeSymbol && memberSymbol.aliasSymbol) { - aliasSymbol = memberSymbol.aliasSymbol; - } - } - - if (!valueSymbol && !typeSymbol && !containerSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(identifier, TypeScript.DiagnosticCode.Could_not_find_symbol_0_in_module_1, [rhsName, moduleSymbol.toString()]); - return null; - } - - if (!typeSymbol && containerSymbol) { - typeSymbol = containerSymbol; - } - - return { - valueSymbol: valueSymbol, - typeSymbol: typeSymbol, - containerSymbol: containerSymbol, - aliasSymbol: aliasSymbol - }; - }; - - PullTypeResolver.prototype.resolveModuleReference = function (importDecl, moduleNameExpr, enclosingDecl, context, declPath) { - TypeScript.Debug.assert(moduleNameExpr.kind() === 121 /* QualifiedName */ || moduleNameExpr.kind() === 11 /* IdentifierName */ || moduleNameExpr.kind() === 14 /* StringLiteral */, "resolving module reference should always be either name or member reference"); - - var moduleSymbol = null; - var moduleName; - - if (moduleNameExpr.kind() === 121 /* QualifiedName */) { - var dottedNameAST = moduleNameExpr; - var moduleContainer = this.resolveModuleReference(importDecl, dottedNameAST.left, enclosingDecl, context, declPath); - if (moduleContainer) { - moduleName = dottedNameAST.right.valueText(); - - moduleSymbol = this.getMemberSymbolOfKind(moduleName, 4 /* Container */, moduleContainer.type, enclosingDecl, context).symbol; - if (!moduleSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(dottedNameAST.right, TypeScript.DiagnosticCode.Could_not_find_module_0_in_module_1, [moduleName, moduleContainer.toString()]); - } - } - } else { - var valueText = moduleNameExpr.kind() === 11 /* IdentifierName */ ? moduleNameExpr.valueText() : moduleNameExpr.valueText(); - var text = moduleNameExpr.kind() === 11 /* IdentifierName */ ? moduleNameExpr.text() : moduleNameExpr.text(); - - if (text.length > 0) { - var resolvedModuleNameSymbol = this.getSymbolFromDeclPath(valueText, declPath, 4 /* Container */); - moduleSymbol = this.filterSymbol(resolvedModuleNameSymbol, 4 /* Container */, enclosingDecl, context); - if (moduleSymbol) { - this.semanticInfoChain.setSymbolForAST(moduleNameExpr, moduleSymbol); - if (resolvedModuleNameSymbol.isAlias()) { - this.semanticInfoChain.setAliasSymbolForAST(moduleNameExpr, resolvedModuleNameSymbol); - var importDeclSymbol = importDecl.getSymbol(); - importDeclSymbol.addLinkedAliasSymbol(resolvedModuleNameSymbol); - } - } else { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameExpr, TypeScript.DiagnosticCode.Unable_to_resolve_module_reference_0, [valueText]); - } - } - } - - return moduleSymbol; - }; - - PullTypeResolver.prototype.resolveInternalModuleReference = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - - var moduleReference = importStatementAST.moduleReference; - - var aliasExpr = moduleReference.kind() === 245 /* ExternalModuleReference */ ? moduleReference.stringLiteral : moduleReference.moduleName; - - var declPath = enclosingDecl.getParentPath(); - var aliasedType = null; - var importDeclSymbol = importDecl.getSymbol(); - - if (aliasExpr.kind() === 11 /* IdentifierName */ || aliasExpr.kind() === 14 /* StringLiteral */) { - var moduleSymbol = this.resolveModuleReference(importDecl, aliasExpr, enclosingDecl, context, declPath); - if (moduleSymbol) { - aliasedType = moduleSymbol.type; - this.semanticInfoChain.setAliasSymbolForAST(moduleReference, this.semanticInfoChain.getAliasSymbolForAST(aliasExpr)); - if (aliasedType.anyDeclHasFlag(32768 /* InitializedModule */)) { - var moduleName = aliasExpr.kind() === 11 /* IdentifierName */ ? aliasExpr.valueText() : aliasExpr.valueText(); - var valueSymbol = this.getSymbolFromDeclPath(moduleName, declPath, 68147712 /* SomeValue */); - var instanceSymbol = aliasedType.getInstanceSymbol(); - - if (valueSymbol && (instanceSymbol != valueSymbol || valueSymbol.type === aliasedType)) { - var text = aliasExpr.kind() === 11 /* IdentifierName */ ? aliasExpr.text() : aliasExpr.text(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(aliasExpr, TypeScript.DiagnosticCode.Internal_module_reference_0_in_import_declaration_does_not_reference_module_instance_for_1, [text, moduleSymbol.type.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - } else { - importDeclSymbol.setAssignedValueSymbol(valueSymbol); - } - } - } else { - aliasedType = this.getNewErrorTypeSymbol(); - } - } else if (aliasExpr.kind() === 121 /* QualifiedName */) { - var dottedNameAST = aliasExpr; - var moduleSymbol = this.resolveModuleReference(importDecl, dottedNameAST.left, enclosingDecl, context, declPath); - if (moduleSymbol) { - var identifierResolution = this.resolveIdentifierOfInternalModuleReference(importDecl, dottedNameAST.right, moduleSymbol, enclosingDecl, context); - if (identifierResolution) { - importDeclSymbol.setAssignedValueSymbol(identifierResolution.valueSymbol); - importDeclSymbol.setAssignedTypeSymbol(identifierResolution.typeSymbol); - importDeclSymbol.setAssignedContainerSymbol(identifierResolution.containerSymbol); - this.semanticInfoChain.setAliasSymbolForAST(moduleReference, identifierResolution.aliasSymbol); - return null; - } - } - } - - if (!aliasedType) { - importDeclSymbol.setAssignedTypeSymbol(this.getNewErrorTypeSymbol()); - } - - return aliasedType; - }; - - PullTypeResolver.prototype.resolveImportDeclaration = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - var importDeclSymbol = importDecl.getSymbol(); - - var aliasedType = null; - - if (importDeclSymbol.isResolved) { - return importDeclSymbol; - } - - importDeclSymbol.startResolving(); - - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var modPath = importStatementAST.moduleReference.stringLiteral.valueText(); - var declPath = enclosingDecl.getParentPath(); - - aliasedType = this.resolveExternalModuleReference(modPath, importDecl.fileName()); - - if (!aliasedType) { - var path = importStatementAST.moduleReference.stringLiteral.text(); - this.semanticInfoChain.addDiagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Unable_to_resolve_external_module_0, [path]); - aliasedType = this.getNewErrorTypeSymbol(); - } - } else { - aliasedType = this.resolveInternalModuleReference(importStatementAST, context); - } - - if (aliasedType) { - if (!aliasedType.isContainer()) { - this.semanticInfoChain.addDiagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Module_cannot_be_aliased_to_a_non_module_type); - if (!aliasedType.isError()) { - aliasedType = this.getNewErrorTypeSymbol(); - } - } - - if (aliasedType.isContainer()) { - importDeclSymbol.setAssignedContainerSymbol(aliasedType); - } - importDeclSymbol.setAssignedTypeSymbol(aliasedType); - - this.setSymbolForAST(importStatementAST.moduleReference, aliasedType, null); - } - - importDeclSymbol.setResolved(); - - this.resolveDeclaredSymbol(importDeclSymbol.assignedValue(), context); - this.resolveDeclaredSymbol(importDeclSymbol.assignedType(), context); - this.resolveDeclaredSymbol(importDeclSymbol.assignedContainer(), context); - - if (aliasedType && importDeclSymbol.anyDeclHasFlag(1 /* Exported */)) { - importDeclSymbol.setIsUsedInExportedAlias(); - - if (aliasedType.isContainer() && aliasedType.getExportAssignedValueSymbol()) { - importDeclSymbol.setIsUsedAsValue(); - } - } - - if (this.canTypeCheckAST(importStatementAST, context)) { - this.typeCheckImportDeclaration(importStatementAST, context); - } - - return importDeclSymbol; - }; - - PullTypeResolver.prototype.typeCheckImportDeclaration = function (importStatementAST, context) { - var _this = this; - this.setTypeChecked(importStatementAST, context); - - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var enclosingDecl = this.getEnclosingDecl(importDecl); - var importDeclSymbol = importDecl.getSymbol(); - - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - if (this.compilationSettings.noResolve()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Import_declaration_cannot_refer_to_external_module_reference_when_noResolve_option_is_set, null)); - } - - var modPath = importStatementAST.moduleReference.stringLiteral.valueText(); - if (enclosingDecl.kind === 32 /* DynamicModule */) { - var ast = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(this.getASTForDecl(enclosingDecl)); - if (ast && ast.kind() === 130 /* ModuleDeclaration */) { - if (TypeScript.isRelative(modPath)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(importStatementAST, TypeScript.DiagnosticCode.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name)); - } - } - } - } - - var checkPrivacy; - if (importStatementAST.moduleReference.kind() === 245 /* ExternalModuleReference */) { - var containerSymbol = importDeclSymbol.getExportAssignedContainerSymbol(); - var container = containerSymbol ? containerSymbol.getContainer() : null; - if (container && container.kind === 32 /* DynamicModule */) { - checkPrivacy = true; - } - } else { - checkPrivacy = true; - } - - if (checkPrivacy) { - var typeSymbol = importDeclSymbol.getExportAssignedTypeSymbol(); - var containerSymbol = importDeclSymbol.getExportAssignedContainerSymbol(); - var valueSymbol = importDeclSymbol.getExportAssignedValueSymbol(); - - this.checkSymbolPrivacy(importDeclSymbol, containerSymbol, function (symbol) { - var messageCode = TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_container_that_is_or_is_using_inaccessible_module_1; - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - - if (typeSymbol !== containerSymbol) { - this.checkSymbolPrivacy(importDeclSymbol, typeSymbol, function (symbol) { - var messageCode = symbol.isContainer() && !symbol.isEnum() ? TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_type_that_is_using_inaccessible_module_1 : TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_type_that_has_or_is_using_private_type_1; - - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - } - - if (valueSymbol) { - this.checkSymbolPrivacy(importDeclSymbol, valueSymbol.type, function (symbol) { - var messageCode = symbol.isContainer() && !symbol.isEnum() ? TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_value_with_type_that_is_using_inaccessible_module_1 : TypeScript.DiagnosticCode.Exported_import_declaration_0_is_assigned_value_with_type_that_has_or_is_using_private_type_1; - var messageArguments = [importDeclSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null), symbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null, false, false, true)]; - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(importStatementAST, messageCode, messageArguments)); - }); - } - } - - this.checkNameForCompilerGeneratedDeclarationCollision(importStatementAST, true, importStatementAST.identifier, context); - }; - - PullTypeResolver.prototype.postTypeCheckImportDeclaration = function (importStatementAST, context) { - var importDecl = this.semanticInfoChain.getDeclForAST(importStatementAST); - var importSymbol = importDecl.getSymbol(); - - var isUsedAsValue = importSymbol.isUsedAsValue(); - var hasAssignedValue = importStatementAST.moduleReference.kind() !== 245 /* ExternalModuleReference */ && importSymbol.getExportAssignedValueSymbol() !== null; - - if (isUsedAsValue || hasAssignedValue) { - this.checkThisCaptureVariableCollides(importStatementAST, true, context); - } - }; - - PullTypeResolver.prototype.resolveExportAssignmentStatement = function (exportAssignmentAST, context) { - var id = exportAssignmentAST.identifier.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var valueSymbol = null; - var typeSymbol = null; - var containerSymbol = null; - - var enclosingDecl = this.getEnclosingDeclForAST(exportAssignmentAST); - var parentSymbol = enclosingDecl.getSymbol(); - - if (!parentSymbol.isType() && parentSymbol.isContainer()) { - this.semanticInfoChain.addDiagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Export_assignments_may_only_be_used_at_the_top_level_of_external_modules); - return this.semanticInfoChain.anyTypeSymbol; - } - - var declPath = enclosingDecl !== null ? [enclosingDecl] : []; - - containerSymbol = this.getSymbolFromDeclPath(id, declPath, 164 /* SomeContainer */); - - var acceptableAlias = true; - - if (containerSymbol) { - acceptableAlias = (containerSymbol.kind & 59753052 /* AcceptableAlias */) !== 0; - } - - if (!acceptableAlias && containerSymbol && containerSymbol.kind === 128 /* TypeAlias */) { - this.resolveDeclaredSymbol(containerSymbol, context); - - var aliasSymbol = containerSymbol; - var aliasedAssignedValue = aliasSymbol.getExportAssignedValueSymbol(); - var aliasedAssignedType = aliasSymbol.getExportAssignedTypeSymbol(); - var aliasedAssignedContainer = aliasSymbol.getExportAssignedContainerSymbol(); - - if (aliasedAssignedValue || aliasedAssignedType || aliasedAssignedContainer) { - valueSymbol = aliasedAssignedValue; - typeSymbol = aliasedAssignedType; - containerSymbol = aliasedAssignedContainer; - aliasSymbol.setTypeUsedExternally(); - if (valueSymbol) { - aliasSymbol.setIsUsedAsValue(); - } - acceptableAlias = true; - } - } - - if (!acceptableAlias) { - this.semanticInfoChain.addDiagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Export_assignments_may_only_be_made_with_variables_functions_classes_interfaces_enums_and_internal_modules); - return this.semanticInfoChain.voidTypeSymbol; - } - - if (!valueSymbol) { - valueSymbol = this.getSymbolFromDeclPath(id, declPath, 68147712 /* SomeValue */); - } - if (!typeSymbol) { - typeSymbol = this.getSymbolFromDeclPath(id, declPath, 58728795 /* SomeType */); - } - - if (!valueSymbol && !typeSymbol && !containerSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(exportAssignmentAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [id])); - return this.semanticInfoChain.voidTypeSymbol; - } - - if (valueSymbol) { - parentSymbol.setExportAssignedValueSymbol(valueSymbol); - } - if (typeSymbol) { - parentSymbol.setExportAssignedTypeSymbol(typeSymbol); - } - if (containerSymbol) { - parentSymbol.setExportAssignedContainerSymbol(containerSymbol); - } - - this.resolveDeclaredSymbol(valueSymbol, context); - this.resolveDeclaredSymbol(typeSymbol, context); - this.resolveDeclaredSymbol(containerSymbol, context); - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveAnyFunctionTypeSignature = function (funcDeclAST, typeParameters, parameterList, returnTypeAnnotation, context) { - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - TypeScript.Debug.assert(functionDecl); - - var funcDeclSymbol = functionDecl.getSymbol(); - - var signature = funcDeclSymbol.kind === 33554432 /* ConstructorType */ ? funcDeclSymbol.getConstructSignatures()[0] : funcDeclSymbol.getCallSignatures()[0]; - - if (returnTypeAnnotation) { - signature.returnType = this.resolveTypeReference(returnTypeAnnotation, context); - } - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - if (parameterList) { - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveFunctionTypeSignatureParameter(parameterList.parameters.nonSeparatorAt(i), signature, functionDecl, context); - } - } - - funcDeclSymbol.setResolved(); - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.setTypeChecked(funcDeclAST, context); - this.typeCheckFunctionOverloads(funcDeclAST, context); - } - - return funcDeclSymbol; - }; - - PullTypeResolver.prototype.resolveFunctionTypeSignatureParameter = function (argDeclAST, signature, enclosingDecl, context) { - var paramDecl = this.semanticInfoChain.getDeclForAST(argDeclAST); - var paramSymbol = paramDecl.getSymbol(); - - if (argDeclAST.typeAnnotation) { - var typeRef = this.resolveTypeReference(TypeScript.ASTHelpers.getType(argDeclAST), context); - - if (paramSymbol.isVarArg && !typeRef.isArrayNamedTypeReference()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeRef = this.getNewErrorTypeSymbol(); - } - - context.setTypeInContext(paramSymbol, typeRef); - } else { - if (paramSymbol.isVarArg) { - if (this.cachedArrayInterfaceType()) { - context.setTypeInContext(paramSymbol, this.createInstantiatedType(this.cachedArrayInterfaceType(), [this.semanticInfoChain.anyTypeSymbol])); - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_function_type_implicitly_has_an_any_type, [argDeclAST.identifier.text()])); - } - } - - if (TypeScript.hasFlag(paramDecl.flags, 128 /* Optional */) && argDeclAST.equalsValueClause && isTypesOnlyLocation(argDeclAST)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Default_arguments_are_only_allowed_in_implementation)); - } - - paramSymbol.setResolved(); - }; - - PullTypeResolver.prototype.resolveFunctionExpressionParameter = function (argDeclAST, id, typeExpr, equalsValueClause, contextParam, enclosingDecl, context) { - var paramDecl = this.semanticInfoChain.getDeclForAST(argDeclAST); - var paramSymbol = paramDecl.getSymbol(); - var contextualType = contextParam && contextParam.type; - var isImplicitAny = false; - - if (typeExpr) { - var typeRef = this.resolveTypeReference(typeExpr, context); - - if (paramSymbol.isVarArg && !typeRef.isArrayNamedTypeReference()) { - var diagnostic = context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeRef = this.getNewErrorTypeSymbol(); - } - - contextualType = typeRef || contextualType; - } - if (contextualType) { - if (context.isInferentiallyTyping()) { - contextualType = context.fixAllTypeParametersReferencedByType(contextualType, this); - } - context.setTypeInContext(paramSymbol, contextualType); - } else if (paramSymbol.isVarArg) { - if (this.cachedArrayInterfaceType()) { - context.setTypeInContext(paramSymbol, this.createInstantiatedType(this.cachedArrayInterfaceType(), [this.semanticInfoChain.anyTypeSymbol])); - } else { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - } - isImplicitAny = true; - } - - var canTypeCheckAST = this.canTypeCheckAST(argDeclAST, context); - if (equalsValueClause && (canTypeCheckAST || !contextualType)) { - if (contextualType) { - context.propagateContextualType(contextualType); - } - - var initExprSymbol = this.resolveAST(equalsValueClause, contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - } - - if (!initExprSymbol || !initExprSymbol.type) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [id.text()])); - - if (!contextualType) { - context.setTypeInContext(paramSymbol, this.getNewErrorTypeSymbol(paramSymbol.name)); - } - } else { - var initTypeSymbol = this.getInstanceTypeForAssignment(argDeclAST, initExprSymbol.type, context); - if (!contextualType) { - context.setTypeInContext(paramSymbol, initTypeSymbol.widenedType(this, equalsValueClause, context)); - isImplicitAny = initTypeSymbol !== paramSymbol.type; - } else { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(initTypeSymbol, contextualType, argDeclAST, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(argDeclAST); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [initTypeSymbol.toString(enclosingSymbol), contextualType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [initTypeSymbol.toString(enclosingSymbol), contextualType.toString(enclosingSymbol)])); - } - } - } - } - } - - if (!contextualType && !paramSymbol.isVarArg && !initTypeSymbol) { - context.setTypeInContext(paramSymbol, this.semanticInfoChain.anyTypeSymbol); - isImplicitAny = true; - } - - if (isImplicitAny && this.compilationSettings.noImplicitAny()) { - var functionExpressionName = paramDecl.getParentDecl().getFunctionExpressionName(); - if (functionExpressionName) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [id.text(), functionExpressionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(argDeclAST, TypeScript.DiagnosticCode.Parameter_0_of_lambda_function_implicitly_has_an_any_type, [id.text()])); - } - } - - if (canTypeCheckAST) { - this.checkNameForCompilerGeneratedDeclarationCollision(argDeclAST, true, id, context); - } - - paramSymbol.setResolved(); - }; - - PullTypeResolver.prototype.checkNameForCompilerGeneratedDeclarationCollision = function (astWithName, isDeclaration, name, context) { - var compilerReservedName = getCompilerReservedName(name); - switch (compilerReservedName) { - case 1 /* _this */: - this.postTypeCheckWorkitems.push(astWithName); - return; - - case 2 /* _super */: - this.checkSuperCaptureVariableCollides(astWithName, isDeclaration, context); - return; - - case 3 /* arguments */: - this.checkArgumentsCollides(astWithName, context); - return; - - case 4 /* _i */: - this.checkIndexOfRestArgumentInitializationCollides(astWithName, isDeclaration, context); - return; - - case 5 /* require */: - case 6 /* exports */: - if (isDeclaration) { - this.checkExternalModuleRequireExportsCollides(astWithName, name, context); - } - return; - } - }; - - PullTypeResolver.prototype.hasRestParameterCodeGen = function (someFunctionDecl) { - var enclosingAST = this.getASTForDecl(someFunctionDecl); - var nodeType = enclosingAST.kind(); - - if (nodeType === 129 /* FunctionDeclaration */) { - var functionDeclaration = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.kind === 65536 /* Method */ ? someFunctionDecl.getParentDecl().flags : someFunctionDecl.flags, 8 /* Ambient */) && functionDeclaration.block && TypeScript.lastParameterIsRest(functionDeclaration.callSignature.parameterList); - } else if (nodeType === 135 /* MemberFunctionDeclaration */) { - var memberFunction = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.kind === 65536 /* Method */ ? someFunctionDecl.getParentDecl().flags : someFunctionDecl.flags, 8 /* Ambient */) && memberFunction.block && TypeScript.lastParameterIsRest(memberFunction.callSignature.parameterList); - } else if (nodeType === 137 /* ConstructorDeclaration */) { - var constructorDeclaration = enclosingAST; - return !TypeScript.hasFlag(someFunctionDecl.getParentDecl().flags, 8 /* Ambient */) && constructorDeclaration.block && TypeScript.lastParameterIsRest(constructorDeclaration.callSignature.parameterList); - } else if (nodeType === 218 /* ParenthesizedArrowFunctionExpression */) { - var arrowFunctionExpression = enclosingAST; - return TypeScript.lastParameterIsRest(arrowFunctionExpression.callSignature.parameterList); - } else if (nodeType === 222 /* FunctionExpression */) { - var functionExpression = enclosingAST; - return TypeScript.lastParameterIsRest(functionExpression.callSignature.parameterList); - } - - return false; - }; - - PullTypeResolver.prototype.checkArgumentsCollides = function (ast, context) { - if (ast.kind() === 242 /* Parameter */) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - if (TypeScript.hasFlag(enclosingDecl.kind, 1032192 /* SomeFunction */)) { - if (this.hasRestParameterCodeGen(enclosingDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters)); - } - } - } - }; - - PullTypeResolver.prototype.checkIndexOfRestArgumentInitializationCollides = function (ast, isDeclaration, context) { - if (!isDeclaration || ast.kind() === 242 /* Parameter */) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - var declPath = isDeclaration ? [enclosingDecl] : (enclosingDecl ? enclosingDecl.getParentPath() : []); - var resolvedSymbol = null; - var resolvedSymbolContainer; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - if (!isDeclaration) { - if (!resolvedSymbol) { - resolvedSymbol = this.resolveNameExpression(ast, context); - if (resolvedSymbol.isError()) { - return; - } - - resolvedSymbolContainer = resolvedSymbol.getContainer(); - } - - if (resolvedSymbolContainer && TypeScript.ArrayUtilities.contains(resolvedSymbolContainer.getDeclarations(), decl)) { - break; - } - } - - if (TypeScript.hasFlag(decl.kind, 1032192 /* SomeFunction */)) { - if (this.hasRestParameterCodeGen(decl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter : TypeScript.DiagnosticCode.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter)); - } - } - } - } - }; - - PullTypeResolver.prototype.checkExternalModuleRequireExportsCollides = function (ast, name, context) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(name); - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, name)) { - enclosingDecl = this.getEnclosingDeclForAST(enclosingModule); - } - - if (enclosingDecl && enclosingDecl.kind === 32 /* DynamicModule */) { - var decl = this.semanticInfoChain.getDeclForAST(ast); - - if (!TypeScript.hasFlag(decl.flags, 8 /* Ambient */)) { - var nameText = name.valueText(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, [nameText, nameText])); - } - } - }; - - PullTypeResolver.prototype.resolveObjectTypeTypeReference = function (objectType, context) { - var interfaceDecl = this.semanticInfoChain.getDeclForAST(objectType); - TypeScript.Debug.assert(interfaceDecl); - - var interfaceSymbol = interfaceDecl.getSymbol(); - TypeScript.Debug.assert(interfaceSymbol); - - if (objectType.typeMembers) { - var memberDecl = null; - var memberSymbol = null; - var memberType = null; - var typeMembers = objectType.typeMembers; - - for (var i = 0; i < typeMembers.nonSeparatorCount(); i++) { - memberDecl = this.semanticInfoChain.getDeclForAST(typeMembers.nonSeparatorAt(i)); - memberSymbol = (memberDecl.kind & 7340032 /* SomeSignature */) ? memberDecl.getSignatureSymbol() : memberDecl.getSymbol(); - - this.resolveAST(typeMembers.nonSeparatorAt(i), false, context); - - memberType = memberSymbol.type; - - if ((memberType && memberType.isGeneric()) || (memberSymbol.isSignature() && memberSymbol.isGeneric())) { - interfaceSymbol.setHasGenericMember(); - } - } - } - - interfaceSymbol.setResolved(); - - if (this.canTypeCheckAST(objectType, context)) { - this.typeCheckObjectTypeTypeReference(objectType, context); - } - - return interfaceSymbol; - }; - - PullTypeResolver.prototype.typeCheckObjectTypeTypeReference = function (objectType, context) { - this.setTypeChecked(objectType, context); - var objectTypeDecl = this.semanticInfoChain.getDeclForAST(objectType); - var objectTypeSymbol = objectTypeDecl.getSymbol(); - - this.typeCheckMembersAgainstIndexer(objectTypeSymbol, objectTypeDecl, context); - this.checkTypeForDuplicateIndexSignatures(objectTypeSymbol); - }; - - PullTypeResolver.prototype.resolveTypeAnnotation = function (typeAnnotation, context) { - return this.resolveTypeReference(typeAnnotation.type, context); - }; - - PullTypeResolver.prototype.resolveTypeReference = function (typeRef, context) { - if (typeRef === null) { - return null; - } - - TypeScript.Debug.assert(typeRef.kind() !== 244 /* TypeAnnotation */); - - var aliasType = null; - var type = this.computeTypeReferenceSymbol(typeRef, context); - - if (type.kind === 4 /* Container */) { - var container = type; - var instanceSymbol = container.getInstanceSymbol(); - - if (instanceSymbol && (instanceSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */) || instanceSymbol.kind === 32768 /* ConstructorMethod */)) { - type = instanceSymbol.type.getAssociatedContainerType(); - } - } - - if (type && type.isAlias()) { - aliasType = type; - type = aliasType.getExportAssignedTypeSymbol(); - } - - if (type && !type.isGeneric()) { - if (aliasType) { - this.semanticInfoChain.setAliasSymbolForAST(typeRef, aliasType); - } - } - - if (type && !type.isError()) { - if ((type.kind & 58728795 /* SomeType */) === 0) { - if (type.kind & 164 /* SomeContainer */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeRef, TypeScript.DiagnosticCode.Type_reference_cannot_refer_to_container_0, [aliasType ? aliasType.toString() : type.toString()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeRef, TypeScript.DiagnosticCode.Type_reference_must_refer_to_type)); - } - } - } - - if (this.canTypeCheckAST(typeRef, context)) { - this.setTypeChecked(typeRef, context); - } - - return type; - }; - - PullTypeResolver.prototype.getArrayType = function (elementType) { - var arraySymbol = elementType.getArrayType(); - - if (!arraySymbol) { - arraySymbol = this.createInstantiatedType(this.cachedArrayInterfaceType(), [elementType]); - - if (!arraySymbol) { - arraySymbol = this.semanticInfoChain.anyTypeSymbol; - } - - elementType.setArrayType(arraySymbol); - } - - return arraySymbol; - }; - - PullTypeResolver.prototype.computeTypeReferenceSymbol = function (term, context) { - switch (term.kind()) { - case 60 /* AnyKeyword */: - return this.semanticInfoChain.anyTypeSymbol; - case 61 /* BooleanKeyword */: - return this.semanticInfoChain.booleanTypeSymbol; - case 67 /* NumberKeyword */: - return this.semanticInfoChain.numberTypeSymbol; - case 69 /* StringKeyword */: - return this.semanticInfoChain.stringTypeSymbol; - case 41 /* VoidKeyword */: - return this.semanticInfoChain.voidTypeSymbol; - } - - var typeDeclSymbol = null; - - if (term.kind() === 11 /* IdentifierName */) { - typeDeclSymbol = this.resolveTypeNameExpression(term, context); - } else if (term.kind() === 123 /* FunctionType */) { - var functionType = term; - typeDeclSymbol = this.resolveAnyFunctionTypeSignature(functionType, functionType.typeParameterList, functionType.parameterList, functionType.type, context); - } else if (term.kind() === 125 /* ConstructorType */) { - var constructorType = term; - typeDeclSymbol = this.resolveAnyFunctionTypeSignature(constructorType, constructorType.typeParameterList, constructorType.parameterList, constructorType.type, context); - } else if (term.kind() === 122 /* ObjectType */) { - typeDeclSymbol = this.resolveObjectTypeTypeReference(term, context); - } else if (term.kind() === 126 /* GenericType */) { - typeDeclSymbol = this.resolveGenericTypeReference(term, context); - } else if (term.kind() === 121 /* QualifiedName */) { - typeDeclSymbol = this.resolveQualifiedName(term, context); - } else if (term.kind() === 14 /* StringLiteral */) { - var stringConstantAST = term; - var enclosingDecl = this.getEnclosingDeclForAST(term); - typeDeclSymbol = new TypeScript.PullStringConstantTypeSymbol(stringConstantAST.text()); - var decl = new TypeScript.PullSynthesizedDecl(stringConstantAST.text(), stringConstantAST.text(), typeDeclSymbol.kind, null, enclosingDecl, enclosingDecl.semanticInfoChain); - typeDeclSymbol.addDeclaration(decl); - } else if (term.kind() === 127 /* TypeQuery */) { - var typeQuery = term; - - var typeQueryTerm = typeQuery.name; - - var valueSymbol = this.resolveAST(typeQueryTerm, false, context); - - if (valueSymbol && valueSymbol.isAlias()) { - if (valueSymbol.assignedValue()) { - valueSymbol = valueSymbol.assignedValue(); - } else { - var containerSymbol = valueSymbol.getExportAssignedContainerSymbol(); - valueSymbol = (containerSymbol && containerSymbol.isContainer() && !containerSymbol.isEnum()) ? containerSymbol.getInstanceSymbol() : null; - } - } - - if (valueSymbol) { - typeDeclSymbol = valueSymbol.type.widenedType(this, typeQueryTerm, context); - } else { - typeDeclSymbol = this.getNewErrorTypeSymbol(); - } - } else if (term.kind() === 124 /* ArrayType */) { - var arrayType = term; - var underlying = this.resolveTypeReference(arrayType.type, context); - typeDeclSymbol = this.getArrayType(underlying); - } else { - throw TypeScript.Errors.invalidOperation("unknown type"); - } - - if (!typeDeclSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(term, TypeScript.DiagnosticCode.Unable_to_resolve_type)); - return this.getNewErrorTypeSymbol(); - } - - if (typeDeclSymbol.isError()) { - return typeDeclSymbol; - } - - if (this.genericTypeIsUsedWithoutRequiredTypeArguments(typeDeclSymbol, term, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(term, TypeScript.DiagnosticCode.Generic_type_references_must_include_all_type_arguments)); - typeDeclSymbol = this.instantiateTypeToAny(typeDeclSymbol, context); - } - - return typeDeclSymbol; - }; - - PullTypeResolver.prototype.genericTypeIsUsedWithoutRequiredTypeArguments = function (typeSymbol, term, context) { - if (!typeSymbol) { - return false; - } - - if (typeSymbol.isAlias()) { - return this.genericTypeIsUsedWithoutRequiredTypeArguments(typeSymbol.getExportAssignedTypeSymbol(), term, context); - } - - return typeSymbol.isNamedTypeSymbol() && typeSymbol.isGeneric() && !typeSymbol.isTypeParameter() && (typeSymbol.isResolved || typeSymbol.inResolution) && !typeSymbol.getIsSpecialized() && typeSymbol.getTypeParameters().length && typeSymbol.getTypeArguments() === null && this.isTypeRefWithoutTypeArgs(term); - }; - - PullTypeResolver.prototype.resolveMemberVariableDeclaration = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, varDecl.modifiers, varDecl.variableDeclarator.propertyName, TypeScript.ASTHelpers.getType(varDecl.variableDeclarator), varDecl.variableDeclarator.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolvePropertySignature = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.sentinelEmptyArray, varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), null, context); - }; - - PullTypeResolver.prototype.resolveVariableDeclarator = function (varDecl, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolveParameterList = function (list, context) { - return this.resolveSeparatedList(list.parameters, context); - }; - - PullTypeResolver.prototype.resolveParameter = function (parameter, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(parameter, parameter.modifiers, parameter.identifier, TypeScript.ASTHelpers.getType(parameter), parameter.equalsValueClause, context); - }; - - PullTypeResolver.prototype.getEnumTypeSymbol = function (enumElement, context) { - var enumDeclaration = enumElement.parent.parent; - var decl = this.semanticInfoChain.getDeclForAST(enumDeclaration); - var symbol = decl.getSymbol(); - this.resolveDeclaredSymbol(symbol, context); - - return symbol; - }; - - PullTypeResolver.prototype.resolveEnumElement = function (enumElement, context) { - return this.resolveVariableDeclaratorOrParameterOrEnumElement(enumElement, TypeScript.sentinelEmptyArray, enumElement.propertyName, null, enumElement.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckEnumElement = function (enumElement, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(enumElement, TypeScript.sentinelEmptyArray, enumElement.propertyName, null, enumElement.equalsValueClause, context); - }; - - PullTypeResolver.prototype.resolveEqualsValueClause = function (clause, isContextuallyTyped, context) { - if (this.canTypeCheckAST(clause, context)) { - this.setTypeChecked(clause, context); - } - - return this.resolveAST(clause.value, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveVariableDeclaratorOrParameterOrEnumElement = function (varDeclOrParameter, modifiers, name, typeExpr, init, context) { - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - - if (enclosingDecl && decl.kind === 2048 /* Parameter */) { - enclosingDecl.ensureSymbolIsBound(); - } - - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - if (declSymbol.isResolved) { - var declType = declSymbol.type; - var valDecl = decl.getValueDecl(); - - if (valDecl) { - var valSymbol = valDecl.getSymbol(); - - if (valSymbol && !valSymbol.isResolved) { - valSymbol.type = declType; - valSymbol.setResolved(); - } - } - } else { - if (declSymbol.inResolution) { - declSymbol.type = this.semanticInfoChain.anyTypeSymbol; - declSymbol.setResolved(); - return declSymbol; - } - - if (!declSymbol.type || !declSymbol.type.isError()) { - declSymbol.startResolving(); - - var typeExprSymbol = this.resolveAndTypeCheckVariableDeclarationTypeExpr(varDeclOrParameter, name, typeExpr, context); - - if (!hasTypeExpr) { - this.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr(varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol); - } - - if (!(hasTypeExpr || init)) { - var defaultType = this.semanticInfoChain.anyTypeSymbol; - - if (declSymbol.isVarArg && this.cachedArrayInterfaceType()) { - defaultType = this.createInstantiatedType(this.cachedArrayInterfaceType(), [defaultType]); - } - - context.setTypeInContext(declSymbol, defaultType); - - if (declParameterSymbol) { - declParameterSymbol.type = defaultType; - } - } - declSymbol.setResolved(); - - if (declParameterSymbol) { - declParameterSymbol.setResolved(); - } - } - } - - if (this.canTypeCheckAST(varDeclOrParameter, context)) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDeclOrParameter, modifiers, name, typeExpr, init, context); - } - - return declSymbol; - }; - - PullTypeResolver.prototype.resolveAndTypeCheckVariableDeclarationTypeExpr = function (varDeclOrParameter, name, typeExpr, context) { - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - if (varDeclOrParameter.kind() === 243 /* EnumElement */) { - var result = this.getEnumTypeSymbol(varDeclOrParameter, context); - declSymbol.type = result; - return result; - } - - if (!typeExpr) { - return null; - } - - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - var typeExprSymbol = this.resolveTypeReference(typeExpr, context); - - if (!typeExprSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [name.text()])); - declSymbol.type = this.getNewErrorTypeSymbol(); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } else if (typeExprSymbol.isError()) { - context.setTypeInContext(declSymbol, typeExprSymbol); - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, typeExprSymbol); - } - } else { - if (typeExprSymbol === this.semanticInfoChain.anyTypeSymbol) { - decl.setFlag(16777216 /* IsAnnotatedWithAny */); - } - - if (typeExprSymbol.isContainer()) { - var exportedTypeSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - - if (exportedTypeSymbol) { - typeExprSymbol = exportedTypeSymbol; - } else { - typeExprSymbol = typeExprSymbol.type; - - if (typeExprSymbol.isAlias()) { - typeExprSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - } - - if (typeExprSymbol && typeExprSymbol.isContainer() && !typeExprSymbol.isEnum()) { - var instanceSymbol = typeExprSymbol.getInstanceSymbol(); - - if (!instanceSymbol || !TypeScript.PullHelpers.symbolIsEnum(instanceSymbol)) { - typeExprSymbol = this.getNewErrorTypeSymbol(); - } else { - typeExprSymbol = instanceSymbol.type; - } - } - } - } else if (declSymbol.isVarArg && !(typeExprSymbol.isArrayNamedTypeReference() || typeExprSymbol === this.cachedArrayInterfaceType())) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Rest_parameters_must_be_array_types)); - typeExprSymbol = this.getNewErrorTypeSymbol(); - } - - context.setTypeInContext(declSymbol, typeExprSymbol); - - if (declParameterSymbol) { - declParameterSymbol.type = typeExprSymbol; - } - - if (typeExprSymbol.kind === 16777216 /* FunctionType */ && !typeExprSymbol.getFunctionSymbol()) { - typeExprSymbol.setFunctionSymbol(declSymbol); - } - } - - return typeExprSymbol; - }; - - PullTypeResolver.prototype.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr = function (varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol) { - if (!init) { - return null; - } - - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - if (typeExprSymbol) { - context.pushNewContextualType(typeExprSymbol); - } - - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - var declParameterSymbol = decl.getValueDecl() ? decl.getValueDecl().getSymbol() : null; - - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - var initExprSymbol = this.resolveAST(init, typeExprSymbol !== null, context); - - if (typeExprSymbol) { - context.popAnyContextualType(); - } - - if (!initExprSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Unable_to_resolve_type_of_0, [name.text()])); - - if (!hasTypeExpr) { - context.setTypeInContext(declSymbol, this.getNewErrorTypeSymbol()); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, this.semanticInfoChain.anyTypeSymbol); - } - } - } else { - var initTypeSymbol = initExprSymbol.type; - - if (!hasTypeExpr) { - var widenedInitTypeSymbol = initTypeSymbol.widenedType(this, init.value, context); - context.setTypeInContext(declSymbol, widenedInitTypeSymbol); - - if (declParameterSymbol) { - context.setTypeInContext(declParameterSymbol, widenedInitTypeSymbol); - } - - if (this.compilationSettings.noImplicitAny()) { - if ((widenedInitTypeSymbol !== initTypeSymbol) && (widenedInitTypeSymbol === this.semanticInfoChain.anyTypeSymbol)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } - } - - return widenedInitTypeSymbol; - } - } - - return initTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckPropertySignature = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.sentinelEmptyArray, varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMemberVariableDeclaration = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, varDecl.modifiers, varDecl.variableDeclarator.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.variableDeclarator.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckVariableDeclarator = function (varDecl, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(varDecl, TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl), varDecl.propertyName, TypeScript.ASTHelpers.getType(varDecl), varDecl.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckParameter = function (parameter, context) { - this.typeCheckVariableDeclaratorOrParameterOrEnumElement(parameter, parameter.modifiers, parameter.identifier, TypeScript.ASTHelpers.getType(parameter), parameter.equalsValueClause, context); - }; - - PullTypeResolver.prototype.typeCheckVariableDeclaratorOrParameterOrEnumElement = function (varDeclOrParameter, modifiers, name, typeExpr, init, context) { - var _this = this; - this.setTypeChecked(varDeclOrParameter, context); - - var hasTypeExpr = typeExpr !== null || varDeclOrParameter.kind() === 243 /* EnumElement */; - var enclosingDecl = this.getEnclosingDeclForAST(varDeclOrParameter); - var decl = this.semanticInfoChain.getDeclForAST(varDeclOrParameter); - var declSymbol = decl.getSymbol(); - - var typeExprSymbol = this.resolveAndTypeCheckVariableDeclarationTypeExpr(varDeclOrParameter, name, typeExpr, context); - - var initTypeSymbol = this.resolveAndTypeCheckVariableDeclaratorOrParameterInitExpr(varDeclOrParameter, name, typeExpr, init, context, typeExprSymbol); - - if (hasTypeExpr || init) { - if (typeExprSymbol && typeExprSymbol.isAlias()) { - typeExprSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - } - - if (typeExprSymbol && typeExprSymbol.kind === 32 /* DynamicModule */) { - var exportedTypeSymbol = typeExprSymbol.getExportAssignedTypeSymbol(); - - if (exportedTypeSymbol) { - typeExprSymbol = exportedTypeSymbol; - } else { - var instanceTypeSymbol = typeExprSymbol.getInstanceType(); - - if (!instanceTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Tried_to_set_variable_type_to_uninitialized_module_type_0, [typeExprSymbol.toString()])); - typeExprSymbol = null; - } else { - typeExprSymbol = instanceTypeSymbol; - } - } - } - - initTypeSymbol = this.getInstanceTypeForAssignment(varDeclOrParameter, initTypeSymbol, context); - - if (initTypeSymbol && typeExprSymbol) { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(initTypeSymbol, typeExprSymbol, varDeclOrParameter, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(varDeclOrParameter); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [initTypeSymbol.toString(enclosingSymbol), typeExprSymbol.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [initTypeSymbol.toString(enclosingSymbol), typeExprSymbol.toString(enclosingSymbol)])); - } - } - } - } else if (varDeclOrParameter.kind() !== 243 /* EnumElement */ && this.compilationSettings.noImplicitAny() && !this.isForInVariableDeclarator(varDeclOrParameter)) { - var wrapperDecl = this.getEnclosingDecl(decl); - wrapperDecl = wrapperDecl || enclosingDecl; - - if ((wrapperDecl.kind === 16384 /* Function */ || wrapperDecl.kind === 32768 /* ConstructorMethod */ || wrapperDecl.kind === 2097152 /* ConstructSignature */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } else if (wrapperDecl.kind === 65536 /* Method */) { - var parentDecl = wrapperDecl.getParentDecl(); - - if (!TypeScript.hasFlag(parentDecl.flags, 8 /* Ambient */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } else if (TypeScript.hasFlag(parentDecl.flags, 8 /* Ambient */) && !TypeScript.hasFlag(wrapperDecl.flags, 2 /* Private */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Parameter_0_of_1_implicitly_has_an_any_type, [name.text(), enclosingDecl.name])); - } - } else if (decl.kind === 4096 /* Property */ && !declSymbol.getContainer().isNamedTypeSymbol()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Member_0_of_object_type_implicitly_has_an_any_type, [name.text()])); - } else if (wrapperDecl.kind !== 268435456 /* CatchBlock */) { - if (!TypeScript.hasFlag(wrapperDecl.flags, 8 /* Ambient */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } else if (TypeScript.hasFlag(wrapperDecl.flags, 8 /* Ambient */) && !TypeScript.hasModifier(modifiers, 2 /* Private */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Variable_0_implicitly_has_an_any_type, [name.text()])); - } - } - } - - if (init && varDeclOrParameter.kind() === 242 /* Parameter */) { - var containerSignature = enclosingDecl.getSignatureSymbol(); - if (containerSignature && !containerSignature.isDefinition()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(varDeclOrParameter, TypeScript.DiagnosticCode.Default_arguments_are_only_allowed_in_implementation)); - } - } - if (declSymbol.kind !== 2048 /* Parameter */ && (declSymbol.kind !== 4096 /* Property */ || declSymbol.getContainer().isNamedTypeSymbol())) { - this.checkSymbolPrivacy(declSymbol, declSymbol.type, function (symbol) { - return _this.variablePrivacyErrorReporter(varDeclOrParameter, declSymbol, symbol, context); - }); - } - - if ((declSymbol.kind !== 4096 /* Property */ && declSymbol.kind !== 67108864 /* EnumMember */) || declSymbol.anyDeclHasFlag(8388608 /* PropertyParameter */)) { - this.checkNameForCompilerGeneratedDeclarationCollision(varDeclOrParameter, true, name, context); - } - }; - - PullTypeResolver.prototype.isForInVariableDeclarator = function (ast) { - return ast.kind() === 225 /* VariableDeclarator */ && ast.parent && ast.parent.parent && ast.parent.parent.parent && ast.parent.kind() === 2 /* SeparatedList */ && ast.parent.parent.kind() === 224 /* VariableDeclaration */ && ast.parent.parent.parent.kind() === 155 /* ForInStatement */ && ast.parent.parent.parent.variableDeclaration === ast.parent.parent; - }; - - PullTypeResolver.prototype.checkSuperCaptureVariableCollides = function (superAST, isDeclaration, context) { - var enclosingDecl = this.getEnclosingDeclForAST(superAST); - - var classSymbol = this.getContextualClassSymbolForEnclosingDecl(superAST, enclosingDecl); - - if (classSymbol && !classSymbol.anyDeclHasFlag(8 /* Ambient */)) { - if (superAST.kind() === 242 /* Parameter */) { - var enclosingAST = this.getASTForDecl(enclosingDecl); - if (enclosingAST.kind() !== 218 /* ParenthesizedArrowFunctionExpression */ && enclosingAST.kind() !== 219 /* SimpleArrowFunctionExpression */) { - var block = enclosingDecl.kind === 65536 /* Method */ ? enclosingAST.block : enclosingAST.block; - if (!block) { - return; - } - } - } - - this.resolveDeclaredSymbol(classSymbol, context); - - var parents = classSymbol.getExtendedTypes(); - if (parents.length) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(superAST, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference : TypeScript.DiagnosticCode.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference)); - } - } - }; - - PullTypeResolver.prototype.checkThisCaptureVariableCollides = function (_thisAST, isDeclaration, context) { - if (isDeclaration) { - var decl = this.semanticInfoChain.getDeclForAST(_thisAST); - if (TypeScript.hasFlag(decl.flags, 8 /* Ambient */)) { - return; - } - } - - var enclosingDecl = this.getEnclosingDeclForAST(_thisAST); - - var enclosingModule = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(_thisAST); - if (TypeScript.ASTHelpers.isAnyNameOfModule(enclosingModule, _thisAST)) { - enclosingDecl = this.getEnclosingDeclForAST(enclosingModule); - } - - var declPath = enclosingDecl.getParentPath(); - - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - if (declKind === 131072 /* FunctionExpression */ && TypeScript.hasFlag(decl.flags, 8192 /* ArrowFunction */)) { - continue; - } - - if (declKind === 16384 /* Function */ || declKind === 65536 /* Method */ || declKind === 32768 /* ConstructorMethod */ || declKind === 262144 /* GetAccessor */ || declKind === 524288 /* SetAccessor */ || declKind === 131072 /* FunctionExpression */ || declKind === 8 /* Class */ || declKind === 4 /* Container */ || declKind === 32 /* DynamicModule */ || declKind === 1 /* Script */) { - if (TypeScript.hasFlag(decl.flags, 262144 /* MustCaptureThis */)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(_thisAST, isDeclaration ? TypeScript.DiagnosticCode.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference : TypeScript.DiagnosticCode.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference)); - } - break; - } - } - }; - - PullTypeResolver.prototype.postTypeCheckVariableDeclaratorOrParameter = function (varDeclOrParameter, context) { - this.checkThisCaptureVariableCollides(varDeclOrParameter, true, context); - }; - - PullTypeResolver.prototype.resolveTypeParameterDeclaration = function (typeParameterAST, context) { - var typeParameterDecl = this.semanticInfoChain.getDeclForAST(typeParameterAST); - var typeParameterSymbol = typeParameterDecl.getSymbol(); - - this.resolveFirstTypeParameterDeclaration(typeParameterSymbol, context); - - if (typeParameterSymbol.isResolved && this.canTypeCheckAST(typeParameterAST, context)) { - this.typeCheckTypeParameterDeclaration(typeParameterAST, context); - } - - return typeParameterSymbol; - }; - - PullTypeResolver.prototype.resolveFirstTypeParameterDeclaration = function (typeParameterSymbol, context) { - var typeParameterDecl = typeParameterSymbol.getDeclarations()[0]; - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterDecl); - - if (typeParameterSymbol.isResolved || typeParameterSymbol.inResolution) { - return; - } - - typeParameterSymbol.startResolving(); - - if (typeParameterAST.constraint) { - var constraintTypeSymbol = this.resolveTypeReference(typeParameterAST.constraint.type, context); - - if (constraintTypeSymbol) { - typeParameterSymbol.setConstraint(constraintTypeSymbol); - } - } - - typeParameterSymbol.setResolved(); - }; - - PullTypeResolver.prototype.typeCheckTypeParameterDeclaration = function (typeParameterAST, context) { - this.setTypeChecked(typeParameterAST, context); - - var constraint = this.resolveAST(typeParameterAST.constraint, false, context); - - if (constraint) { - var typeParametersAST = typeParameterAST.parent; - var typeParameters = []; - for (var i = 0; i < typeParametersAST.nonSeparatorCount(); i++) { - var currentTypeParameterAST = typeParametersAST.nonSeparatorAt(i); - var currentTypeParameterDecl = this.semanticInfoChain.getDeclForAST(currentTypeParameterAST); - var currentTypeParameter = this.semanticInfoChain.getSymbolForDecl(currentTypeParameterDecl); - typeParameters[currentTypeParameter.pullSymbolID] = currentTypeParameter; - } - - if (constraint.wrapsSomeTypeParameter(typeParameters)) { - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - }; - - PullTypeResolver.prototype.resolveConstraint = function (constraint, context) { - if (this.canTypeCheckAST(constraint, context)) { - this.setTypeChecked(constraint, context); - } - - return this.resolveTypeReference(constraint.type, context); - }; - - PullTypeResolver.prototype.resolveFunctionBodyReturnTypes = function (funcDeclAST, block, bodyExpression, signature, useContextualType, enclosingDecl, context) { - var _this = this; - var returnStatementsExpressions = []; - - var enclosingDeclStack = [enclosingDecl]; - - var preFindReturnExpressionTypes = function (ast, walker) { - var go = true; - - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 215 /* ObjectLiteralExpression */: - go = false; - break; - - case 150 /* ReturnStatement */: - var returnStatement = ast; - enclosingDecl.setFlag(4194304 /* HasReturnStatement */); - returnStatementsExpressions.push({ expression: returnStatement.expression, enclosingDecl: enclosingDeclStack[enclosingDeclStack.length - 1] }); - go = false; - break; - - case 236 /* CatchClause */: - case 163 /* WithStatement */: - enclosingDeclStack[enclosingDeclStack.length] = _this.semanticInfoChain.getDeclForAST(ast); - break; - - default: - break; - } - - walker.options.goChildren = go; - - return ast; - }; - - var postFindReturnExpressionEnclosingDecls = function (ast, walker) { - switch (ast.kind()) { - case 236 /* CatchClause */: - case 163 /* WithStatement */: - enclosingDeclStack.length--; - break; - default: - break; - } - - walker.options.goChildren = true; - - return ast; - }; - - if (block) { - TypeScript.getAstWalkerFactory().walk(block, preFindReturnExpressionTypes, postFindReturnExpressionEnclosingDecls); - } else { - returnStatementsExpressions.push({ expression: bodyExpression, enclosingDecl: enclosingDecl }); - enclosingDecl.setFlag(4194304 /* HasReturnStatement */); - } - - if (!returnStatementsExpressions.length) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - } else { - var returnExpressionSymbols = []; - var returnExpressions = []; - - for (var i = 0; i < returnStatementsExpressions.length; i++) { - var returnExpression = returnStatementsExpressions[i].expression; - if (returnExpression) { - var returnType = this.resolveAST(returnExpression, useContextualType, context).type; - - if (returnType.isError()) { - signature.returnType = returnType; - return; - } else { - if (returnExpression.parent.kind() === 150 /* ReturnStatement */) { - this.setSymbolForAST(returnExpression.parent, returnType, context); - } - } - - returnExpressionSymbols.push(returnType); - returnExpressions.push(returnExpression); - } - } - - if (!returnExpressionSymbols.length) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - } else { - var collection = { - getLength: function () { - return returnExpressionSymbols.length; - }, - getTypeAtIndex: function (index) { - return returnExpressionSymbols[index].type; - } - }; - - var bestCommonReturnType = this.findBestCommonType(collection, context, new TypeComparisonInfo()); - var returnType = bestCommonReturnType; - var returnExpression = returnExpressions[returnExpressionSymbols.indexOf(returnType)]; - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var functionSymbol = functionDecl.getSymbol(); - - if (returnType) { - var previousReturnType = returnType; - var newReturnType = returnType.widenedType(this, returnExpression, context); - signature.returnType = newReturnType; - - if (!TypeScript.ArrayUtilities.contains(returnExpressionSymbols, bestCommonReturnType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Could_not_find_the_best_common_type_of_types_of_all_return_statement_expressions)); - } - - if (this.compilationSettings.noImplicitAny()) { - if (previousReturnType !== newReturnType && newReturnType === this.semanticInfoChain.anyTypeSymbol) { - var functionName = enclosingDecl.name; - if (functionName === "") { - functionName = enclosingDecl.getFunctionExpressionName(); - } - - if (functionName != "") { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [functionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } - } - - if (!functionSymbol.type && functionSymbol.isAccessor()) { - functionSymbol.type = signature.returnType; - } - } - } - }; - - PullTypeResolver.prototype.typeCheckConstructorDeclaration = function (funcDeclAST, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - for (var i = 0; i < funcDeclAST.callSignature.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveAST(funcDeclAST.callSignature.parameterList.parameters.nonSeparatorAt(i), false, context); - } - - this.resolveAST(funcDeclAST.block, false, context); - - if (funcDecl.getSignatureSymbol() && funcDecl.getSignatureSymbol().isDefinition() && this.enclosingClassIsDerived(funcDecl.getParentDecl())) { - if (!this.constructorHasSuperCall(funcDeclAST)) { - context.postDiagnostic(new TypeScript.Diagnostic(funcDeclAST.fileName(), this.semanticInfoChain.lineMap(funcDeclAST.fileName()), funcDeclAST.start(), "constructor".length, TypeScript.DiagnosticCode.Constructors_for_derived_classes_must_contain_a_super_call)); - } else if (this.superCallMustBeFirstStatementInConstructor(funcDecl)) { - var firstStatement = this.getFirstStatementOfBlockOrNull(funcDeclAST.block); - if (!firstStatement || !this.isSuperInvocationExpressionStatement(firstStatement)) { - context.postDiagnostic(new TypeScript.Diagnostic(funcDeclAST.fileName(), this.semanticInfoChain.lineMap(funcDeclAST.fileName()), funcDeclAST.start(), "constructor".length, TypeScript.DiagnosticCode.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties)); - } - } - } - - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, false, null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.callSignature.parameterList), null, funcDeclAST.block, context); - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.constructorHasSuperCall = function (constructorDecl) { - var _this = this; - if (constructorDecl.block) { - var foundSuperCall = false; - var pre = function (ast, walker) { - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 215 /* ObjectLiteralExpression */: - walker.options.goChildren = false; - default: - if (_this.isSuperInvocationExpression(ast)) { - foundSuperCall = true; - walker.options.stopWalking = true; - } - } - }; - - TypeScript.getAstWalkerFactory().walk(constructorDecl.block, pre); - return foundSuperCall; - } - - return false; - }; - - PullTypeResolver.prototype.typeCheckFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - this.typeCheckAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), funcDecl.callSignature.typeAnnotation, funcDecl.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckCallSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, null, funcDecl.typeParameterList, funcDecl.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckConstructSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, null, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMethodSignature = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, false, funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.typeCheckMemberFunctionDeclaration = function (funcDecl, context) { - this.typeCheckAnyFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.containsSingleThrowStatement = function (block) { - return block !== null && block.statements.childCount() === 1 && block.statements.childAt(0).kind() === 157 /* ThrowStatement */; - }; - - PullTypeResolver.prototype.typeCheckAnyFunctionDeclaration = function (funcDeclAST, isStatic, name, typeParameters, parameters, returnTypeAnnotation, block, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - this.resolveAST(parameters, false, context); - - this.resolveAST(block, false, context); - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, isStatic, typeParameters, TypeScript.ASTHelpers.parametersFromParameterList(parameters), returnTypeAnnotation, block, context); - - this.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement(funcDecl, returnTypeAnnotation, funcDecl.getSignatureSymbol().returnType, block, context); - - if (funcDecl.kind === 16384 /* Function */) { - this.checkNameForCompilerGeneratedDeclarationCollision(funcDeclAST, true, name, context); - } - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement = function (functionDecl, returnTypeAnnotation, returnTypeSymbol, block, context) { - var hasReturn = TypeScript.hasFlag(functionDecl.flags, 4194304 /* HasReturnStatement */); - - if (block !== null && returnTypeAnnotation !== null && !hasReturn) { - var isVoidOrAny = this.isAnyOrEquivalent(returnTypeSymbol) || returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol; - - if (!isVoidOrAny && !this.containsSingleThrowStatement(block)) { - var funcName = functionDecl.getDisplayName() || TypeScript.getLocalizedText(TypeScript.DiagnosticCode.expression, null); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Function_declared_a_non_void_return_type_but_has_no_return_expression)); - } - } - }; - - PullTypeResolver.prototype.typeCheckIndexSignature = function (funcDeclAST, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - this.resolveAST(funcDeclAST.parameter, false, context); - - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - this.validateVariableDeclarationGroups(funcDecl, context); - - this.checkFunctionTypePrivacy(funcDeclAST, false, null, TypeScript.ASTHelpers.parametersFromParameter(funcDeclAST.parameter), TypeScript.ASTHelpers.getType(funcDeclAST), null, context); - - var signature = funcDecl.getSignatureSymbol(); - - this.typeCheckCallBacks.push(function (context) { - var parentSymbol = funcDecl.getSignatureSymbol().getContainer(); - var allIndexSignatures = _this.getBothKindsOfIndexSignaturesExcludingAugmentedType(parentSymbol, context); - var stringIndexSignature = allIndexSignatures.stringSignature; - var numberIndexSignature = allIndexSignatures.numericSignature; - var isNumericIndexer = numberIndexSignature === signature; - - if (numberIndexSignature && stringIndexSignature && (isNumericIndexer || stringIndexSignature.getDeclarations()[0].getParentDecl() !== numberIndexSignature.getDeclarations()[0].getParentDecl())) { - var comparisonInfo = new TypeComparisonInfo(); - - if (!_this.sourceIsAssignableToTarget(numberIndexSignature.returnType, stringIndexSignature.returnType, funcDeclAST, context, comparisonInfo)) { - var enclosingSymbol = _this.getEnclosingSymbolForAST(funcDeclAST); - if (comparisonInfo.message) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1_NL_2, [numberIndexSignature.returnType.toString(enclosingSymbol), stringIndexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Numeric_indexer_type_0_must_be_assignable_to_string_indexer_type_1, [numberIndexSignature.returnType.toString(enclosingSymbol), stringIndexSignature.returnType.toString(enclosingSymbol)])); - } - } - } - - var allMembers = parentSymbol.type.getAllMembers(536869887 /* All */, 0 /* all */); - for (var i = 0; i < allMembers.length; i++) { - var member = allMembers[i]; - var name = member.name; - if (name || (member.kind === 4096 /* Property */ && name === "")) { - if (!allMembers[i].isResolved) { - _this.resolveDeclaredSymbol(allMembers[i], context); - } - - if (parentSymbol !== allMembers[i].getContainer()) { - var isMemberNumeric = TypeScript.PullHelpers.isNameNumeric(name); - var indexerKindMatchesMemberNameKind = isNumericIndexer === isMemberNumeric; - var onlyStringIndexerIsPresent = !numberIndexSignature; - - if (indexerKindMatchesMemberNameKind || onlyStringIndexerIsPresent) { - var comparisonInfo = new TypeComparisonInfo(); - if (!_this.sourceIsAssignableToTarget(allMembers[i].type, signature.returnType, funcDeclAST, context, comparisonInfo, false)) { - _this.reportErrorThatMemberIsNotSubtypeOfIndexer(allMembers[i], signature, funcDeclAST, context, comparisonInfo); - } - } - } - } - } - }); - }; - - PullTypeResolver.prototype.postTypeCheckFunctionDeclaration = function (funcDeclAST, context) { - this.checkThisCaptureVariableCollides(funcDeclAST, true, context); - }; - - PullTypeResolver.prototype.resolveReturnTypeAnnotationOfFunctionDeclaration = function (funcDeclAST, returnTypeAnnotation, context) { - var returnTypeSymbol = null; - - if (returnTypeAnnotation) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - returnTypeSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - } else { - var isConstructor = funcDeclAST.kind() === 137 /* ConstructorDeclaration */ || funcDeclAST.kind() === 143 /* ConstructSignature */; - if (isConstructor && returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructors_cannot_have_a_return_type_of_void)); - } - } - } - - return returnTypeSymbol; - }; - - PullTypeResolver.prototype.resolveMemberFunctionDeclaration = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.resolveCallSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, null, funcDecl.typeParameterList, funcDecl.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveConstructSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, null, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveMethodSignature = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, false, funcDecl.propertyName, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), null, context); - }; - - PullTypeResolver.prototype.resolveAnyFunctionDeclaration = function (funcDecl, context) { - return this.resolveFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.identifier, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - }; - - PullTypeResolver.prototype.resolveFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveSimpleArrowFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, null, TypeScript.ASTHelpers.parametersFromIdentifier(funcDecl.identifier), null, funcDecl.block, funcDecl.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveParenthesizedArrowFunctionExpression = function (funcDecl, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcDecl, funcDecl.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, funcDecl.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.getEnclosingClassDeclaration = function (ast) { - while (ast) { - if (ast.kind() === 131 /* ClassDeclaration */) { - return ast; - } - - ast = ast.parent; - } - - return null; - }; - - PullTypeResolver.prototype.resolveConstructorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckConstructorDeclaration(funcDeclAST, context); - } - return funcSymbol; - } - - if (!signature.inResolution) { - var classAST = this.getEnclosingClassDeclaration(funcDeclAST); - - if (classAST) { - var classDecl = this.semanticInfoChain.getDeclForAST(classAST); - var classSymbol = classDecl.getSymbol(); - - if (!classSymbol.isResolved && !classSymbol.inResolution) { - this.resolveDeclaredSymbol(classSymbol, context); - } - } - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - - for (var i = 0; i < funcDeclAST.callSignature.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(funcDeclAST.callSignature.parameterList.parameters.nonSeparatorAt(i), context); - } - - context.inTypeCheck = prevInTypeCheck; - - if (signature.isGeneric()) { - if (funcSymbol) { - funcSymbol.type.setHasGenericSignature(); - } - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckConstructorDeclaration(funcDeclAST, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveIndexMemberDeclaration = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - } - - return this.resolveIndexSignature(ast.indexSignature, context); - }; - - PullTypeResolver.prototype.resolveIndexSignature = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckIndexSignature(funcDeclAST, context); - } - return funcSymbol; - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - if (funcDeclAST.typeAnnotation) { - var returnTypeSymbol = this.resolveTypeReference(TypeScript.ASTHelpers.getType(funcDeclAST), context); - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(TypeScript.ASTHelpers.getType(funcDeclAST), TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - if (funcDeclAST.parameter) { - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - this.resolveParameter(funcDeclAST.parameter, context); - context.inTypeCheck = prevInTypeCheck; - } - - if (funcDeclAST.typeAnnotation) { - returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckIndexSignature(funcDeclAST, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveFunctionDeclaration = function (funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcSymbol = funcDecl.getSymbol(); - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - var isConstructor = funcDeclAST.kind() === 143 /* ConstructSignature */; - - if (signature) { - if (signature.isResolved) { - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context); - } - return funcSymbol; - } - - if (isConstructor && !signature.inResolution) { - var classAST = this.getEnclosingClassDeclaration(funcDeclAST); - - if (classAST) { - var classDecl = this.semanticInfoChain.getDeclForAST(classAST); - var classSymbol = classDecl.getSymbol(); - - if (!classSymbol.isResolved && !classSymbol.inResolution) { - this.resolveDeclaredSymbol(classSymbol, context); - } - } - } - - var functionTypeSymbol = funcSymbol && funcSymbol.type; - - if (signature.inResolution) { - if (returnTypeAnnotation) { - var returnTypeSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - if (!returnTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, TypeScript.DiagnosticCode.Cannot_resolve_return_type_reference)); - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - - if (isConstructor && returnTypeSymbol === this.semanticInfoChain.voidTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructors_cannot_have_a_return_type_of_void)); - } - } - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - } - - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - return funcSymbol; - } - - if (funcSymbol) { - funcSymbol.startResolving(); - } - signature.startResolving(); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - if (parameterList) { - var prevInTypeCheck = context.inTypeCheck; - - context.inTypeCheck = false; - - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(parameterList.parameters.nonSeparatorAt(i), context); - } - - context.inTypeCheck = prevInTypeCheck; - } - - if (returnTypeAnnotation) { - returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else if (funcDecl.kind !== 2097152 /* ConstructSignature */) { - if (TypeScript.hasFlag(funcDecl.flags, 2048 /* Signature */)) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - var parentDeclFlags = 0 /* None */; - if (TypeScript.hasFlag(funcDecl.kind, 65536 /* Method */) || TypeScript.hasFlag(funcDecl.kind, 32768 /* ConstructorMethod */)) { - var parentDecl = funcDecl.getParentDecl(); - parentDeclFlags = parentDecl.flags; - } - - if (this.compilationSettings.noImplicitAny() && (!TypeScript.hasFlag(parentDeclFlags, 8 /* Ambient */) || (TypeScript.hasFlag(parentDeclFlags, 8 /* Ambient */) && !TypeScript.hasFlag(funcDecl.flags, 2 /* Private */)))) { - var funcDeclASTName = name; - if (funcDeclASTName) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [funcDeclASTName.text()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Lambda_Function_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } else { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, null, signature, false, funcDecl, context); - } - } else if (funcDecl.kind === 2097152 /* ConstructSignature */) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Constructor_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - - if (!hadError) { - if (funcSymbol) { - funcSymbol.setUnresolved(); - if (funcSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - funcSymbol.type = functionTypeSymbol; - } - } - signature.setResolved(); - } - } - - if (funcSymbol) { - this.resolveOtherDeclarations(funcDeclAST, context); - } - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionDeclaration(funcDeclAST, isStatic, name, typeParameters, parameterList, returnTypeAnnotation, block, context); - } - - return funcSymbol; - }; - - PullTypeResolver.prototype.resolveGetterReturnTypeAnnotation = function (getterFunctionDeclarationAst, enclosingDecl, context) { - if (getterFunctionDeclarationAst && getterFunctionDeclarationAst.typeAnnotation) { - return this.resolveTypeReference(TypeScript.ASTHelpers.getType(getterFunctionDeclarationAst), context); - } - - return null; - }; - - PullTypeResolver.prototype.resolveSetterArgumentTypeAnnotation = function (setterFunctionDeclarationAst, enclosingDecl, context) { - if (setterFunctionDeclarationAst && setterFunctionDeclarationAst.parameterList && setterFunctionDeclarationAst.parameterList.parameters.nonSeparatorCount() > 0) { - var parameter = setterFunctionDeclarationAst.parameterList.parameters.nonSeparatorAt(0); - return this.resolveTypeReference(TypeScript.ASTHelpers.getType(parameter), context); - } - - return null; - }; - - PullTypeResolver.prototype.resolveAccessorDeclaration = function (funcDeclAst, context) { - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDeclAst); - var accessorSymbol = functionDeclaration.getSymbol(); - - if (accessorSymbol.inResolution) { - accessorSymbol.type = this.semanticInfoChain.anyTypeSymbol; - accessorSymbol.setResolved(); - - return accessorSymbol; - } - - if (accessorSymbol.isResolved) { - if (!accessorSymbol.type) { - accessorSymbol.type = this.semanticInfoChain.anyTypeSymbol; - } - } else { - var getterSymbol = accessorSymbol.getGetter(); - var getterFunctionDeclarationAst = getterSymbol ? getterSymbol.getDeclarations()[0].ast() : null; - var hasGetter = getterSymbol !== null; - - var setterSymbol = accessorSymbol.getSetter(); - var setterFunctionDeclarationAst = setterSymbol ? setterSymbol.getDeclarations()[0].ast() : null; - var hasSetter = setterSymbol !== null; - - var getterAnnotatedType = this.resolveGetterReturnTypeAnnotation(getterFunctionDeclarationAst, functionDeclaration, context); - var getterHasTypeAnnotation = getterAnnotatedType !== null; - - var setterAnnotatedType = this.resolveSetterArgumentTypeAnnotation(setterFunctionDeclarationAst, functionDeclaration, context); - var setterHasTypeAnnotation = setterAnnotatedType !== null; - - accessorSymbol.startResolving(); - - if (hasGetter) { - getterSymbol = this.resolveGetAccessorDeclaration(getterFunctionDeclarationAst, getterFunctionDeclarationAst.parameterList, TypeScript.ASTHelpers.getType(getterFunctionDeclarationAst), getterFunctionDeclarationAst.block, setterAnnotatedType, context); - } - - if (hasSetter) { - setterSymbol = this.resolveSetAccessorDeclaration(setterFunctionDeclarationAst, setterFunctionDeclarationAst.parameterList, context); - } - - if (hasGetter && hasSetter) { - var setterSig = setterSymbol.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - var setterHasParameters = setterParameters.length > 0; - var getterSig = getterSymbol.type.getCallSignatures()[0]; - - var setterSuppliedTypeSymbol = setterHasParameters ? setterParameters[0].type : null; - var getterSuppliedTypeSymbol = getterSig.returnType; - - if (setterHasTypeAnnotation && !getterHasTypeAnnotation) { - getterSuppliedTypeSymbol = setterSuppliedTypeSymbol; - getterSig.returnType = setterSuppliedTypeSymbol; - } else if ((getterHasTypeAnnotation && !setterHasTypeAnnotation) || (!getterHasTypeAnnotation && !setterHasTypeAnnotation)) { - setterSuppliedTypeSymbol = getterSuppliedTypeSymbol; - - if (setterHasParameters) { - setterParameters[0].type = getterSuppliedTypeSymbol; - } - } - - if (!this.typesAreIdentical(setterSuppliedTypeSymbol, getterSuppliedTypeSymbol, context)) { - accessorSymbol.type = this.getNewErrorTypeSymbol(); - } else { - accessorSymbol.type = getterSuppliedTypeSymbol; - } - } else if (hasSetter) { - var setterSig = setterSymbol.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - var setterHasParameters = setterParameters.length > 0; - - accessorSymbol.type = setterHasParameters ? setterParameters[0].type : this.semanticInfoChain.anyTypeSymbol; - } else { - var getterSig = getterSymbol.type.getCallSignatures()[0]; - accessorSymbol.type = getterSig.returnType; - } - - accessorSymbol.setResolved(); - } - - if (this.canTypeCheckAST(funcDeclAst, context)) { - this.typeCheckAccessorDeclaration(funcDeclAst, context); - } - - return accessorSymbol; - }; - - PullTypeResolver.prototype.typeCheckAccessorDeclaration = function (funcDeclAst, context) { - this.setTypeChecked(funcDeclAst, context); - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDeclAst); - var accessorSymbol = functionDeclaration.getSymbol(); - var getterSymbol = accessorSymbol.getGetter(); - var setterSymbol = accessorSymbol.getSetter(); - - var isGetter = funcDeclAst.kind() === 139 /* GetAccessor */; - if (isGetter) { - var getterFunctionDeclarationAst = funcDeclAst; - context.pushNewContextualType(getterSymbol.type); - this.typeCheckGetAccessorDeclaration(getterFunctionDeclarationAst, context); - context.popAnyContextualType(); - } else { - var setterFunctionDeclarationAst = funcDeclAst; - this.typeCheckSetAccessorDeclaration(setterFunctionDeclarationAst, context); - } - }; - - PullTypeResolver.prototype.resolveGetAccessorDeclaration = function (funcDeclAST, parameters, returnTypeAnnotation, block, setterAnnotatedType, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - var getterSymbol = accessorSymbol.getGetter(); - var getterTypeSymbol = getterSymbol.type; - - var signature = getterTypeSymbol.getCallSignatures()[0]; - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - return getterSymbol; - } - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - signature.setResolved(); - - return getterSymbol; - } - - signature.startResolving(); - - if (returnTypeAnnotation) { - var returnTypeSymbol = this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, returnTypeAnnotation, context); - - if (!returnTypeSymbol) { - signature.returnType = this.getNewErrorTypeSymbol(); - - hadError = true; - } else { - signature.returnType = returnTypeSymbol; - } - } else { - if (!setterAnnotatedType) { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, null, signature, false, funcDecl, context); - } else { - signature.returnType = setterAnnotatedType; - } - } - - if (!hadError) { - signature.setResolved(); - } - } - - return getterSymbol; - }; - - PullTypeResolver.prototype.checkIfGetterAndSetterTypeMatch = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - var getter = accessorSymbol.getGetter(); - var setter = accessorSymbol.getSetter(); - - if (getter && setter) { - var getterAST = getter.getDeclarations()[0].ast(); - var setterAST = setter.getDeclarations()[0].ast(); - - if (getterAST.typeAnnotation && PullTypeResolver.hasSetAccessorParameterTypeAnnotation(setterAST)) { - var setterSig = setter.type.getCallSignatures()[0]; - var setterParameters = setterSig.parameters; - - var getter = accessorSymbol.getGetter(); - var getterSig = getter.type.getCallSignatures()[0]; - - var setterSuppliedTypeSymbol = setterParameters[0].type; - var getterSuppliedTypeSymbol = getterSig.returnType; - - if (!this.typesAreIdentical(setterSuppliedTypeSymbol, getterSuppliedTypeSymbol, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.get_and_set_accessor_must_have_the_same_type)); - } - } - } - }; - - PullTypeResolver.prototype.typeCheckGetAccessorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - this.resolveReturnTypeAnnotationOfFunctionDeclaration(funcDeclAST, TypeScript.ASTHelpers.getType(funcDeclAST), context); - - this.resolveAST(funcDeclAST.block, false, context); - - this.validateVariableDeclarationGroups(funcDecl, context); - - var enclosingDecl = this.getEnclosingDecl(funcDecl); - - var hasReturn = (funcDecl.flags & (2048 /* Signature */ | 4194304 /* HasReturnStatement */)) !== 0; - var funcNameAST = funcDeclAST.propertyName; - - if (!hasReturn && !this.containsSingleThrowStatement(funcDeclAST.block)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getters_must_return_a_value)); - } - - var setter = accessorSymbol.getSetter(); - if (setter) { - var setterDecl = setter.getDeclarations()[0]; - var setterIsPrivate = TypeScript.hasFlag(setterDecl.flags, 2 /* Private */); - var getterIsPrivate = TypeScript.hasModifier(funcDeclAST.modifiers, 2 /* Private */); - - if (getterIsPrivate !== setterIsPrivate) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getter_and_setter_accessors_do_not_agree_in_visibility)); - } - - this.checkIfGetterAndSetterTypeMatch(funcDeclAST, context); - } - - this.checkFunctionTypePrivacy(funcDeclAST, TypeScript.hasModifier(funcDeclAST.modifiers, 16 /* Static */), null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), TypeScript.ASTHelpers.getType(funcDeclAST), funcDeclAST.block, context); - }; - - PullTypeResolver.hasSetAccessorParameterTypeAnnotation = function (setAccessor) { - return setAccessor.parameterList && setAccessor.parameterList.parameters.nonSeparatorCount() > 0 && setAccessor.parameterList.parameters.nonSeparatorAt(0).typeAnnotation !== null; - }; - - PullTypeResolver.prototype.resolveSetAccessorDeclaration = function (funcDeclAST, parameterList, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - var setterSymbol = accessorSymbol.getSetter(); - var setterTypeSymbol = setterSymbol.type; - - var signature = funcDecl.getSignatureSymbol(); - - var hadError = false; - - if (signature) { - if (signature.isResolved) { - return setterSymbol; - } - - if (signature.inResolution) { - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - signature.setResolved(); - return setterSymbol; - } - - signature.startResolving(); - - if (parameterList) { - for (var i = 0; i < parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(parameterList.parameters.nonSeparatorAt(i), context); - } - } - - signature.returnType = this.semanticInfoChain.voidTypeSymbol; - - if (!hadError) { - signature.setResolved(); - } - } - - return setterSymbol; - }; - - PullTypeResolver.prototype.typeCheckSetAccessorDeclaration = function (funcDeclAST, context) { - var funcDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var accessorSymbol = funcDecl.getSymbol(); - - if (funcDeclAST.parameterList) { - for (var i = 0; i < funcDeclAST.parameterList.parameters.nonSeparatorCount(); i++) { - this.resolveParameter(funcDeclAST.parameterList.parameters.nonSeparatorAt(i), context); - } - } - - this.resolveAST(funcDeclAST.block, false, context); - - this.validateVariableDeclarationGroups(funcDecl, context); - - var hasReturn = (funcDecl.flags & (2048 /* Signature */ | 4194304 /* HasReturnStatement */)) !== 0; - - var getter = accessorSymbol.getGetter(); - - var funcNameAST = funcDeclAST.propertyName; - - if (getter) { - var getterDecl = getter.getDeclarations()[0]; - var getterIsPrivate = TypeScript.hasFlag(getterDecl.flags, 2 /* Private */); - var setterIsPrivate = TypeScript.hasModifier(funcDeclAST.modifiers, 2 /* Private */); - - if (getterIsPrivate !== setterIsPrivate) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcNameAST, TypeScript.DiagnosticCode.Getter_and_setter_accessors_do_not_agree_in_visibility)); - } - - this.checkIfGetterAndSetterTypeMatch(funcDeclAST, context); - } else { - if (this.compilationSettings.noImplicitAny()) { - var setterFunctionDeclarationAst = funcDeclAST; - if (!PullTypeResolver.hasSetAccessorParameterTypeAnnotation(setterFunctionDeclarationAst) && accessorSymbol.type === this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_get_accessor_and_parameter_type_annotation_on_set_accessor_implicitly_has_an_any_type, [setterFunctionDeclarationAst.propertyName.text()])); - } - } - } - - this.checkFunctionTypePrivacy(funcDeclAST, TypeScript.hasModifier(funcDeclAST.modifiers, 16 /* Static */), null, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), null, funcDeclAST.block, context); - }; - - PullTypeResolver.prototype.resolveList = function (list, context) { - if (this.canTypeCheckAST(list, context)) { - this.setTypeChecked(list, context); - - for (var i = 0, n = list.childCount(); i < n; i++) { - this.resolveAST(list.childAt(i), false, context); - } - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveSeparatedList = function (list, context) { - if (this.canTypeCheckAST(list, context)) { - this.setTypeChecked(list, context); - - for (var i = 0, n = list.nonSeparatorCount(); i < n; i++) { - this.resolveAST(list.nonSeparatorAt(i), false, context); - } - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVoidExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.undefinedTypeSymbol; - }; - - PullTypeResolver.prototype.resolveLogicalOperation = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckLogicalOperation(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckLogicalOperation = function (binex, context) { - this.setTypeChecked(binex, context); - - var leftType = this.resolveAST(binex.left, false, context).type; - var rightType = this.resolveAST(binex.right, false, context).type; - - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(leftType, rightType, binex, context, comparisonInfo) && !this.sourceIsAssignableToTarget(rightType, leftType, binex, context, comparisonInfo)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(binex); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binex, TypeScript.DiagnosticCode.Operator_0_cannot_be_applied_to_types_1_and_2, [ - TypeScript.SyntaxFacts.getText(TypeScript.SyntaxFacts.getOperatorTokenFromBinaryExpression(binex.kind())), - leftType.toString(enclosingSymbol), rightType.toString(enclosingSymbol)])); - } - }; - - PullTypeResolver.prototype.resolveLogicalNotExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.operand, false, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.resolveUnaryArithmeticOperation = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckUnaryArithmeticOperation(ast, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.resolvePostfixUnaryExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckPostfixUnaryExpression(ast, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.isAnyOrNumberOrEnum = function (type) { - return this.isAnyOrEquivalent(type) || type === this.semanticInfoChain.numberTypeSymbol || TypeScript.PullHelpers.symbolIsEnum(type); - }; - - PullTypeResolver.prototype.typeCheckUnaryArithmeticOperation = function (unaryExpression, context) { - this.setTypeChecked(unaryExpression, context); - - var nodeType = unaryExpression.kind(); - var expression = this.resolveAST(unaryExpression.operand, false, context); - - if (nodeType === 164 /* PlusExpression */ || nodeType == 165 /* NegateExpression */ || nodeType == 166 /* BitwiseNotExpression */) { - return; - } - - TypeScript.Debug.assert(nodeType === 168 /* PreIncrementExpression */ || nodeType === 169 /* PreDecrementExpression */); - - var operandType = expression.type; - if (!this.isAnyOrNumberOrEnum(operandType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!this.isReference(unaryExpression.operand, expression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer)); - } - }; - - PullTypeResolver.prototype.typeCheckPostfixUnaryExpression = function (unaryExpression, context) { - this.setTypeChecked(unaryExpression, context); - - var nodeType = unaryExpression.kind(); - var expression = this.resolveAST(unaryExpression.operand, false, context); - - TypeScript.Debug.assert(nodeType === 210 /* PostIncrementExpression */ || nodeType === 211 /* PostDecrementExpression */); - - var operandType = expression.type; - if (!this.isAnyOrNumberOrEnum(operandType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_type_of_a_unary_arithmetic_operation_operand_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!this.isReference(unaryExpression.operand, expression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(unaryExpression.operand, TypeScript.DiagnosticCode.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer)); - } - }; - - PullTypeResolver.prototype.resolveBinaryArithmeticExpression = function (binaryExpression, context) { - if (this.canTypeCheckAST(binaryExpression, context)) { - this.typeCheckBinaryArithmeticExpression(binaryExpression, context); - } - - return this.semanticInfoChain.numberTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckBinaryArithmeticExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsSymbol = this.resolveAST(binaryExpression.left, false, context); - - var lhsType = lhsSymbol.type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - if (lhsType === this.semanticInfoChain.nullTypeSymbol || lhsType === this.semanticInfoChain.undefinedTypeSymbol) { - lhsType = rhsType; - } - - if (rhsType === this.semanticInfoChain.nullTypeSymbol || rhsType === this.semanticInfoChain.undefinedTypeSymbol) { - rhsType = lhsType; - } - - var lhsIsFit = this.isAnyOrNumberOrEnum(lhsType); - var rhsIsFit = this.isAnyOrNumberOrEnum(rhsType); - - if (!rhsIsFit) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type)); - } - - if (!lhsIsFit) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type)); - } - - if (lhsIsFit && rhsIsFit) { - switch (binaryExpression.kind()) { - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - if (!this.isReference(binaryExpression.left, lhsSymbol)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } - - this.checkAssignability(binaryExpression.left, rhsType, lhsType, context); - } - } - }; - - PullTypeResolver.prototype.resolveTypeOfExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.stringTypeSymbol; - }; - - PullTypeResolver.prototype.resolveThrowStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveDeleteExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.resolveInstanceOfExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckInstanceOfExpression(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckInstanceOfExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsType = this.resolveAST(binaryExpression.left, false, context).type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - var enclosingSymbol = this.getEnclosingSymbolForAST(binaryExpression); - var isValidLHS = this.isAnyOrEquivalent(lhsType) || lhsType.isObject() || lhsType.isTypeParameter(); - var isValidRHS = this.isAnyOrEquivalent(rhsType) || this.typeIsAssignableToFunction(rhsType, binaryExpression, context); - - if (!isValidLHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type)); - } - }; - - PullTypeResolver.prototype.resolveCommaExpression = function (commaExpression, context) { - if (this.canTypeCheckAST(commaExpression, context)) { - this.setTypeChecked(commaExpression, context); - - this.resolveAST(commaExpression.left, false, context); - } - - return this.resolveAST(commaExpression.right, false, context).type; - }; - - PullTypeResolver.prototype.resolveInExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckInExpression(ast, context); - } - - return this.semanticInfoChain.booleanTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckInExpression = function (binaryExpression, context) { - this.setTypeChecked(binaryExpression, context); - - var lhsType = this.resolveAST(binaryExpression.left, false, context).type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - var isValidLHS = this.isAnyOrEquivalent(lhsType.type) || lhsType.type === this.semanticInfoChain.stringTypeSymbol || lhsType.type === this.semanticInfoChain.numberTypeSymbol; - - var isValidRHS = this.isAnyOrEquivalent(rhsType) || rhsType.isObject() || rhsType.isTypeParameter(); - - if (!isValidLHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number)); - } - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.right, TypeScript.DiagnosticCode.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - }; - - PullTypeResolver.prototype.resolveForStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.variableDeclaration, false, context); - this.resolveAST(ast.initializer, false, context); - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.incrementor, false, context); - this.resolveAST(ast.statement, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveForInStatement = function (forInStatement, context) { - if (this.canTypeCheckAST(forInStatement, context)) { - this.typeCheckForInStatement(forInStatement, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckForInStatement = function (forInStatement, context) { - this.setTypeChecked(forInStatement, context); - - if (forInStatement.variableDeclaration) { - var declaration = forInStatement.variableDeclaration; - - if (declaration.declarators.nonSeparatorCount() === 1) { - var varDecl = declaration.declarators.nonSeparatorAt(0); - - if (varDecl.typeAnnotation) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declaration, TypeScript.DiagnosticCode.Variable_declarations_of_a_for_statement_cannot_use_a_type_annotation)); - } - } - } else { - var varSym = this.resolveAST(forInStatement.left, false, context); - var isStringOrNumber = varSym.type === this.semanticInfoChain.stringTypeSymbol || this.isAnyOrEquivalent(varSym.type); - - if (!isStringOrNumber) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(forInStatement.left, TypeScript.DiagnosticCode.Variable_declarations_of_a_for_statement_must_be_of_types_string_or_any)); - } - } - - var rhsType = this.resolveAST(forInStatement.expression, false, context).type; - var isValidRHS = rhsType && (this.isAnyOrEquivalent(rhsType) || rhsType.isObject() || rhsType.isTypeParameter()); - - if (!isValidRHS) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(forInStatement.expression, TypeScript.DiagnosticCode.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter)); - } - - this.resolveAST(forInStatement.statement, false, context); - }; - - PullTypeResolver.prototype.resolveWhileStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckWhileStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckWhileStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveDoStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckDoStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckDoStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveIfStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckIfStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckIfStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.condition, false, context); - this.resolveAST(ast.statement, false, context); - this.resolveAST(ast.elseClause, false, context); - }; - - PullTypeResolver.prototype.resolveElseClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckElseClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckElseClause = function (ast, context) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.resolveBlock = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.statements, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVariableStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.declaration, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveVariableDeclarationList = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.declarators, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveWithStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckWithStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckWithStatement = function (ast, context) { - this.setTypeChecked(ast, context); - var withStatement = ast; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(withStatement.condition, TypeScript.DiagnosticCode.All_symbols_within_a_with_block_will_be_resolved_to_any)); - }; - - PullTypeResolver.prototype.resolveTryStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckTryStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckTryStatement = function (ast, context) { - this.setTypeChecked(ast, context); - var tryStatement = ast; - - this.resolveAST(tryStatement.block, false, context); - this.resolveAST(tryStatement.catchClause, false, context); - this.resolveAST(tryStatement.finallyClause, false, context); - }; - - PullTypeResolver.prototype.resolveCatchClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckCatchClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckCatchClause = function (ast, context) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.block, false, context); - - var catchDecl = this.semanticInfoChain.getDeclForAST(ast); - this.validateVariableDeclarationGroups(catchDecl, context); - }; - - PullTypeResolver.prototype.resolveFinallyClause = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckFinallyClause(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckFinallyClause = function (ast, context) { - this.setTypeChecked(ast, context); - this.resolveAST(ast.block, false, context); - }; - - PullTypeResolver.prototype.getEnclosingFunctionDeclaration = function (ast) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - - while (enclosingDecl) { - if (enclosingDecl.kind & 1032192 /* SomeFunction */) { - return enclosingDecl; - } - - enclosingDecl = enclosingDecl.getParentDecl(); - } - - return null; - }; - - PullTypeResolver.prototype.resolveReturnExpression = function (expression, enclosingFunction, context) { - if (enclosingFunction) { - enclosingFunction.setFlag(4194304 /* HasReturnStatement */); - } - - var isContextuallyTyped = false; - - if (enclosingFunction) { - var enclosingDeclAST = this.getASTForDecl(enclosingFunction); - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation) { - var returnTypeAnnotationSymbol = this.resolveTypeReference(typeAnnotation, context); - if (returnTypeAnnotationSymbol) { - isContextuallyTyped = true; - context.pushNewContextualType(returnTypeAnnotationSymbol); - } - } else { - var currentContextualType = context.getContextualType(); - if (currentContextualType && currentContextualType.isFunction()) { - var contextualSignatures = currentContextualType.kind == 33554432 /* ConstructorType */ ? currentContextualType.getConstructSignatures() : currentContextualType.getCallSignatures(); - var currentContextualTypeSignatureSymbol = contextualSignatures[0]; - - var currentContextualTypeReturnTypeSymbol = currentContextualTypeSignatureSymbol.returnType; - if (currentContextualTypeReturnTypeSymbol) { - isContextuallyTyped = true; - context.propagateContextualType(currentContextualTypeReturnTypeSymbol); - } - } - } - } - - var result = this.resolveAST(expression, isContextuallyTyped, context).type; - if (isContextuallyTyped) { - context.popAnyContextualType(); - } - - return result; - }; - - PullTypeResolver.prototype.typeCheckReturnExpression = function (expression, expressionType, enclosingFunction, context) { - if (enclosingFunction && enclosingFunction.kind === 32768 /* ConstructorMethod */) { - var classDecl = enclosingFunction.getParentDecl(); - if (classDecl) { - var classSymbol = classDecl.getSymbol(); - this.resolveDeclaredSymbol(classSymbol, context); - - var comparisonInfo = new TypeComparisonInfo(); - var isAssignable = this.sourceIsAssignableToTarget(expressionType, classSymbol.type, expression, context, comparisonInfo); - if (!isAssignable) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class)); - } - } - } - - if (enclosingFunction && enclosingFunction.kind === 524288 /* SetAccessor */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Setters_cannot_return_a_value)); - } - - if (enclosingFunction) { - var enclosingDeclAST = this.getASTForDecl(enclosingFunction); - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation || enclosingFunction.kind === 262144 /* GetAccessor */) { - var signatureSymbol = enclosingFunction.getSignatureSymbol(); - var sigReturnType = signatureSymbol.returnType; - - if (expressionType && sigReturnType) { - var comparisonInfo = new TypeComparisonInfo(); - var upperBound = null; - - this.resolveDeclaredSymbol(expressionType, context); - this.resolveDeclaredSymbol(sigReturnType, context); - - var isAssignable = this.sourceIsAssignableToTarget(expressionType, sigReturnType, expression, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(expression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [expressionType.toString(enclosingSymbol), sigReturnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [expressionType.toString(enclosingSymbol), sigReturnType.toString(enclosingSymbol)])); - } - } - } - } - } - }; - - PullTypeResolver.prototype.resolveReturnStatement = function (returnAST, context) { - var enclosingFunction = this.getEnclosingFunctionDeclaration(returnAST); - if (enclosingFunction) { - enclosingFunction.setFlag(4194304 /* HasReturnStatement */); - } - - var returnType = this.getSymbolForAST(returnAST, context); - var canTypeCheckAST = this.canTypeCheckAST(returnAST, context); - if (!returnType || canTypeCheckAST) { - var returnExpr = returnAST.expression; - - var resolvedReturnType = returnExpr === null ? this.semanticInfoChain.voidTypeSymbol : this.resolveReturnExpression(returnExpr, enclosingFunction, context); - - if (!returnType) { - returnType = resolvedReturnType; - this.setSymbolForAST(returnAST, resolvedReturnType, context); - } - - if (returnExpr && canTypeCheckAST) { - this.setTypeChecked(returnExpr, context); - this.typeCheckReturnExpression(returnExpr, resolvedReturnType, enclosingFunction, context); - } - } - - return returnType; - }; - - PullTypeResolver.prototype.resolveSwitchStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckSwitchStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckSwitchStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - var expressionType = this.resolveAST(ast.expression, false, context).type; - - for (var i = 0, n = ast.switchClauses.childCount(); i < n; i++) { - var switchClause = ast.switchClauses.childAt(i); - if (switchClause.kind() === 233 /* CaseSwitchClause */) { - var caseSwitchClause = switchClause; - - var caseClauseExpressionType = this.resolveAST(caseSwitchClause.expression, false, context).type; - this.resolveAST(caseSwitchClause.statements, false, context); - - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(expressionType, caseClauseExpressionType, caseSwitchClause.expression, context, comparisonInfo) && !this.sourceIsAssignableToTarget(caseClauseExpressionType, expressionType, caseSwitchClause.expression, context, comparisonInfo)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(caseSwitchClause.expression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(caseSwitchClause.expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [caseClauseExpressionType.toString(enclosingSymbol), expressionType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(caseSwitchClause.expression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [caseClauseExpressionType.toString(enclosingSymbol), expressionType.toString(enclosingSymbol)])); - } - } - } else { - var defaultSwitchClause = switchClause; - this.resolveAST(defaultSwitchClause.statements, false, context); - } - } - }; - - PullTypeResolver.prototype.resolveLabeledStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckLabeledStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckLabeledStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - var labelIdentifier = ast.identifier.valueText(); - - var breakableLabels = this.getEnclosingLabels(ast, true, false); - - var matchingLabel = TypeScript.ArrayUtilities.firstOrDefault(breakableLabels, function (s) { - return s.identifier.valueText() === labelIdentifier; - }); - if (matchingLabel) { - context.postDiagnostic(this.semanticInfoChain.duplicateIdentifierDiagnosticFromAST(ast.identifier, labelIdentifier, matchingLabel)); - } - - this.resolveAST(ast.statement, false, context); - }; - - PullTypeResolver.prototype.labelIsOnContinuableConstruct = function (statement) { - switch (statement.kind()) { - case 160 /* LabeledStatement */: - return this.labelIsOnContinuableConstruct(statement.statement); - - case 158 /* WhileStatement */: - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 161 /* DoStatement */: - return true; - - default: - return false; - } - }; - - PullTypeResolver.prototype.resolveContinueStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckContinueStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.isIterationStatement = function (ast) { - switch (ast.kind()) { - case 154 /* ForStatement */: - case 155 /* ForInStatement */: - case 158 /* WhileStatement */: - case 161 /* DoStatement */: - return true; - } - - return false; - }; - - PullTypeResolver.prototype.isAnyFunctionExpressionOrDeclaration = function (ast) { - switch (ast.kind()) { - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - case 129 /* FunctionDeclaration */: - case 135 /* MemberFunctionDeclaration */: - case 241 /* FunctionPropertyAssignment */: - case 137 /* ConstructorDeclaration */: - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return true; - } - - return false; - }; - - PullTypeResolver.prototype.inSwitchStatement = function (ast) { - while (ast) { - if (ast.kind() === 151 /* SwitchStatement */) { - return true; - } - - if (this.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inIterationStatement = function (ast, crossFunctions) { - while (ast) { - if (this.isIterationStatement(ast)) { - return true; - } - - if (!crossFunctions && this.isAnyFunctionExpressionOrDeclaration(ast)) { - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.getEnclosingLabels = function (ast, breakable, crossFunctions) { - var result = []; - - ast = ast.parent; - while (ast) { - if (ast.kind() === 160 /* LabeledStatement */) { - var labeledStatement = ast; - if (breakable) { - result.push(labeledStatement); - } else { - if (this.labelIsOnContinuableConstruct(labeledStatement.statement)) { - result.push(labeledStatement); - } - } - } - - if (!crossFunctions && this.isAnyFunctionExpressionOrDeclaration(ast)) { - break; - } - - ast = ast.parent; - } - - return result; - }; - - PullTypeResolver.prototype.typeCheckContinueStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - if (!this.inIterationStatement(ast, false)) { - if (this.inIterationStatement(ast, true)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.continue_statement_can_only_be_used_within_an_enclosing_iteration_statement)); - } - } else if (ast.identifier) { - var continuableLabels = this.getEnclosingLabels(ast, false, false); - - if (!TypeScript.ArrayUtilities.any(continuableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - var continuableLabels = this.getEnclosingLabels(ast, false, true); - - if (TypeScript.ArrayUtilities.any(continuableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_not_found)); - } - } - } - }; - - PullTypeResolver.prototype.resolveBreakStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckBreakStatement(ast, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.typeCheckBreakStatement = function (ast, context) { - this.setTypeChecked(ast, context); - - if (ast.identifier) { - var breakableLabels = this.getEnclosingLabels(ast, true, false); - - if (!TypeScript.ArrayUtilities.any(breakableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - var breakableLabels = this.getEnclosingLabels(ast, true, true); - if (TypeScript.ArrayUtilities.any(breakableLabels, function (s) { - return s.identifier.valueText() === ast.identifier.valueText(); - })) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_not_found)); - } - } - } else if (!this.inIterationStatement(ast, false) && !this.inSwitchStatement(ast)) { - if (this.inIterationStatement(ast, true)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Jump_target_cannot_cross_function_boundary)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement)); - } - } - }; - - PullTypeResolver.prototype.resolveAST = function (ast, isContextuallyTyped, context) { - if (!ast) { - return; - } - - var symbol = this.getSymbolForAST(ast, context); - if (symbol && symbol.isResolved) { - this.typeCheckAST(ast, isContextuallyTyped, context); - return symbol; - } - - if (ast.isExpression() && !isTypesOnlyLocation(ast)) { - return this.resolveExpressionAST(ast, isContextuallyTyped, context); - } - - var nodeType = ast.kind(); - - switch (nodeType) { - case 124 /* ArrayType */: - case 126 /* GenericType */: - case 122 /* ObjectType */: - case 127 /* TypeQuery */: - case 125 /* ConstructorType */: - case 123 /* FunctionType */: - return this.resolveTypeReference(ast, context); - - case 1 /* List */: - return this.resolveList(ast, context); - - case 2 /* SeparatedList */: - return this.resolveSeparatedList(ast, context); - - case 120 /* SourceUnit */: - return this.resolveSourceUnit(ast, context); - - case 132 /* EnumDeclaration */: - return this.resolveEnumDeclaration(ast, context); - - case 130 /* ModuleDeclaration */: - return this.resolveModuleDeclaration(ast, context); - - case 128 /* InterfaceDeclaration */: - return this.resolveInterfaceDeclaration(ast, context); - - case 131 /* ClassDeclaration */: - return this.resolveClassDeclaration(ast, context); - - case 224 /* VariableDeclaration */: - return this.resolveVariableDeclarationList(ast, context); - - case 136 /* MemberVariableDeclaration */: - return this.resolveMemberVariableDeclaration(ast, context); - - case 225 /* VariableDeclarator */: - return this.resolveVariableDeclarator(ast, context); - - case 141 /* PropertySignature */: - return this.resolvePropertySignature(ast, context); - - case 227 /* ParameterList */: - return this.resolveParameterList(ast, context); - - case 242 /* Parameter */: - return this.resolveParameter(ast, context); - - case 243 /* EnumElement */: - return this.resolveEnumElement(ast, context); - - case 232 /* EqualsValueClause */: - return this.resolveEqualsValueClause(ast, isContextuallyTyped, context); - - case 238 /* TypeParameter */: - return this.resolveTypeParameterDeclaration(ast, context); - - case 239 /* Constraint */: - return this.resolveConstraint(ast, context); - - case 133 /* ImportDeclaration */: - return this.resolveImportDeclaration(ast, context); - - case 240 /* SimplePropertyAssignment */: - return this.resolveSimplePropertyAssignment(ast, isContextuallyTyped, context); - - case 241 /* FunctionPropertyAssignment */: - return this.resolveFunctionPropertyAssignment(ast, isContextuallyTyped, context); - - case 11 /* IdentifierName */: - TypeScript.Debug.assert(isTypesOnlyLocation(ast)); - return this.resolveTypeNameExpression(ast, context); - - case 121 /* QualifiedName */: - return this.resolveQualifiedName(ast, context); - - case 137 /* ConstructorDeclaration */: - return this.resolveConstructorDeclaration(ast, context); - - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - return this.resolveAccessorDeclaration(ast, context); - - case 138 /* IndexMemberDeclaration */: - return this.resolveIndexMemberDeclaration(ast, context); - - case 144 /* IndexSignature */: - return this.resolveIndexSignature(ast, context); - - case 135 /* MemberFunctionDeclaration */: - return this.resolveMemberFunctionDeclaration(ast, context); - - case 142 /* CallSignature */: - return this.resolveCallSignature(ast, context); - - case 143 /* ConstructSignature */: - return this.resolveConstructSignature(ast, context); - - case 145 /* MethodSignature */: - return this.resolveMethodSignature(ast, context); - - case 129 /* FunctionDeclaration */: - return this.resolveAnyFunctionDeclaration(ast, context); - - case 244 /* TypeAnnotation */: - return this.resolveTypeAnnotation(ast, context); - - case 134 /* ExportAssignment */: - return this.resolveExportAssignmentStatement(ast, context); - - case 157 /* ThrowStatement */: - return this.resolveThrowStatement(ast, context); - - case 149 /* ExpressionStatement */: - return this.resolveExpressionStatement(ast, context); - - case 154 /* ForStatement */: - return this.resolveForStatement(ast, context); - - case 155 /* ForInStatement */: - return this.resolveForInStatement(ast, context); - - case 158 /* WhileStatement */: - return this.resolveWhileStatement(ast, context); - - case 161 /* DoStatement */: - return this.resolveDoStatement(ast, context); - - case 147 /* IfStatement */: - return this.resolveIfStatement(ast, context); - - case 235 /* ElseClause */: - return this.resolveElseClause(ast, context); - - case 146 /* Block */: - return this.resolveBlock(ast, context); - - case 148 /* VariableStatement */: - return this.resolveVariableStatement(ast, context); - - case 163 /* WithStatement */: - return this.resolveWithStatement(ast, context); - - case 159 /* TryStatement */: - return this.resolveTryStatement(ast, context); - - case 236 /* CatchClause */: - return this.resolveCatchClause(ast, context); - - case 237 /* FinallyClause */: - return this.resolveFinallyClause(ast, context); - - case 150 /* ReturnStatement */: - return this.resolveReturnStatement(ast, context); - - case 151 /* SwitchStatement */: - return this.resolveSwitchStatement(ast, context); - - case 153 /* ContinueStatement */: - return this.resolveContinueStatement(ast, context); - - case 152 /* BreakStatement */: - return this.resolveBreakStatement(ast, context); - - case 160 /* LabeledStatement */: - return this.resolveLabeledStatement(ast, context); - } - - return this.semanticInfoChain.anyTypeSymbol; - }; - - PullTypeResolver.prototype.resolveExpressionAST = function (ast, isContextuallyOrInferentiallyTyped, context) { - var expressionSymbol = this.resolveExpressionWorker(ast, isContextuallyOrInferentiallyTyped, context); - - if (isContextuallyOrInferentiallyTyped && context.isInferentiallyTyping()) { - return this.alterPotentialGenericFunctionTypeToInstantiatedFunctionTypeForTypeArgumentInference(expressionSymbol, context); - } else { - return expressionSymbol; - } - }; - - PullTypeResolver.prototype.resolveExpressionWorker = function (ast, isContextuallyTyped, context) { - switch (ast.kind()) { - case 215 /* ObjectLiteralExpression */: - return this.resolveObjectLiteralExpression(ast, isContextuallyTyped, context); - - case 11 /* IdentifierName */: - return this.resolveNameExpression(ast, context); - - case 212 /* MemberAccessExpression */: - return this.resolveMemberAccessExpression(ast, context); - - case 222 /* FunctionExpression */: - return this.resolveFunctionExpression(ast, isContextuallyTyped, context); - - case 219 /* SimpleArrowFunctionExpression */: - return this.resolveSimpleArrowFunctionExpression(ast, isContextuallyTyped, context); - - case 218 /* ParenthesizedArrowFunctionExpression */: - return this.resolveParenthesizedArrowFunctionExpression(ast, isContextuallyTyped, context); - - case 214 /* ArrayLiteralExpression */: - return this.resolveArrayLiteralExpression(ast, isContextuallyTyped, context); - - case 35 /* ThisKeyword */: - return this.resolveThisExpression(ast, context); - - case 50 /* SuperKeyword */: - return this.resolveSuperExpression(ast, context); - - case 213 /* InvocationExpression */: - return this.resolveInvocationExpression(ast, context); - - case 216 /* ObjectCreationExpression */: - return this.resolveObjectCreationExpression(ast, context); - - case 220 /* CastExpression */: - return this.resolveCastExpression(ast, context); - - case 13 /* NumericLiteral */: - return this.semanticInfoChain.numberTypeSymbol; - - case 14 /* StringLiteral */: - return this.semanticInfoChain.stringTypeSymbol; - - case 32 /* NullKeyword */: - return this.semanticInfoChain.nullTypeSymbol; - - case 37 /* TrueKeyword */: - case 24 /* FalseKeyword */: - return this.semanticInfoChain.booleanTypeSymbol; - - case 172 /* VoidExpression */: - return this.resolveVoidExpression(ast, context); - - case 174 /* AssignmentExpression */: - return this.resolveAssignmentExpression(ast, context); - - case 167 /* LogicalNotExpression */: - return this.resolveLogicalNotExpression(ast, context); - - case 193 /* NotEqualsWithTypeConversionExpression */: - case 192 /* EqualsWithTypeConversionExpression */: - case 194 /* EqualsExpression */: - case 195 /* NotEqualsExpression */: - case 196 /* LessThanExpression */: - case 198 /* LessThanOrEqualExpression */: - case 199 /* GreaterThanOrEqualExpression */: - case 197 /* GreaterThanExpression */: - return this.resolveLogicalOperation(ast, context); - - case 208 /* AddExpression */: - case 175 /* AddAssignmentExpression */: - return this.resolveBinaryAdditionOperation(ast, context); - - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - case 166 /* BitwiseNotExpression */: - case 168 /* PreIncrementExpression */: - case 169 /* PreDecrementExpression */: - return this.resolveUnaryArithmeticOperation(ast, context); - - case 210 /* PostIncrementExpression */: - case 211 /* PostDecrementExpression */: - return this.resolvePostfixUnaryExpression(ast, context); - - case 209 /* SubtractExpression */: - case 205 /* MultiplyExpression */: - case 206 /* DivideExpression */: - case 207 /* ModuloExpression */: - case 189 /* BitwiseOrExpression */: - case 191 /* BitwiseAndExpression */: - case 202 /* LeftShiftExpression */: - case 203 /* SignedRightShiftExpression */: - case 204 /* UnsignedRightShiftExpression */: - case 190 /* BitwiseExclusiveOrExpression */: - case 181 /* ExclusiveOrAssignmentExpression */: - case 183 /* LeftShiftAssignmentExpression */: - case 184 /* SignedRightShiftAssignmentExpression */: - case 185 /* UnsignedRightShiftAssignmentExpression */: - case 176 /* SubtractAssignmentExpression */: - case 177 /* MultiplyAssignmentExpression */: - case 178 /* DivideAssignmentExpression */: - case 179 /* ModuloAssignmentExpression */: - case 182 /* OrAssignmentExpression */: - case 180 /* AndAssignmentExpression */: - return this.resolveBinaryArithmeticExpression(ast, context); - - case 221 /* ElementAccessExpression */: - return this.resolveElementAccessExpression(ast, context); - - case 187 /* LogicalOrExpression */: - return this.resolveLogicalOrExpression(ast, isContextuallyTyped, context); - - case 188 /* LogicalAndExpression */: - return this.resolveLogicalAndExpression(ast, context); - - case 171 /* TypeOfExpression */: - return this.resolveTypeOfExpression(ast, context); - - case 170 /* DeleteExpression */: - return this.resolveDeleteExpression(ast, context); - - case 186 /* ConditionalExpression */: - return this.resolveConditionalExpression(ast, isContextuallyTyped, context); - - case 12 /* RegularExpressionLiteral */: - return this.resolveRegularExpressionLiteral(); - - case 217 /* ParenthesizedExpression */: - return this.resolveParenthesizedExpression(ast, context); - - case 200 /* InstanceOfExpression */: - return this.resolveInstanceOfExpression(ast, context); - - case 173 /* CommaExpression */: - return this.resolveCommaExpression(ast, context); - - case 201 /* InExpression */: - return this.resolveInExpression(ast, context); - - case 223 /* OmittedExpression */: - return this.semanticInfoChain.undefinedTypeSymbol; - } - - TypeScript.Debug.fail("resolveExpressionASTWorker: Missing expression kind: " + TypeScript.SyntaxKind[ast.kind()]); - }; - - PullTypeResolver.prototype.typeCheckAST = function (ast, isContextuallyTyped, context) { - if (!this.canTypeCheckAST(ast, context)) { - return; - } - - var nodeType = ast.kind(); - switch (nodeType) { - case 120 /* SourceUnit */: - this.typeCheckSourceUnit(ast, context); - return; - - case 132 /* EnumDeclaration */: - this.typeCheckEnumDeclaration(ast, context); - return; - - case 130 /* ModuleDeclaration */: - this.typeCheckModuleDeclaration(ast, context); - return; - - case 128 /* InterfaceDeclaration */: - this.typeCheckInterfaceDeclaration(ast, context); - return; - - case 131 /* ClassDeclaration */: - this.typeCheckClassDeclaration(ast, context); - return; - - case 243 /* EnumElement */: - this.typeCheckEnumElement(ast, context); - return; - - case 136 /* MemberVariableDeclaration */: - this.typeCheckMemberVariableDeclaration(ast, context); - return; - - case 225 /* VariableDeclarator */: - this.typeCheckVariableDeclarator(ast, context); - return; - - case 141 /* PropertySignature */: - this.typeCheckPropertySignature(ast, context); - return; - - case 242 /* Parameter */: - this.typeCheckParameter(ast, context); - return; - - case 133 /* ImportDeclaration */: - this.typeCheckImportDeclaration(ast, context); - return; - - case 215 /* ObjectLiteralExpression */: - this.resolveObjectLiteralExpression(ast, isContextuallyTyped, context); - return; - - case 241 /* FunctionPropertyAssignment */: - this.typeCheckFunctionPropertyAssignment(ast, isContextuallyTyped, context); - return; - - case 11 /* IdentifierName */: - if (isTypesOnlyLocation(ast)) { - this.resolveTypeNameExpression(ast, context); - } else { - this.resolveNameExpression(ast, context); - } - return; - - case 212 /* MemberAccessExpression */: - this.resolveMemberAccessExpression(ast, context); - return; - - case 121 /* QualifiedName */: - this.resolveQualifiedName(ast, context); - return; - - case 222 /* FunctionExpression */: - this.typeCheckFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 137 /* ConstructorDeclaration */: - this.typeCheckConstructorDeclaration(ast, context); - return; - - case 139 /* GetAccessor */: - case 140 /* SetAccessor */: - this.typeCheckAccessorDeclaration(ast, context); - return; - - case 135 /* MemberFunctionDeclaration */: - this.typeCheckMemberFunctionDeclaration(ast, context); - return; - - case 145 /* MethodSignature */: - this.typeCheckMethodSignature(ast, context); - return; - - case 144 /* IndexSignature */: - this.typeCheckIndexSignature(ast, context); - break; - - case 142 /* CallSignature */: - this.typeCheckCallSignature(ast, context); - return; - - case 143 /* ConstructSignature */: - this.typeCheckConstructSignature(ast, context); - return; - - case 129 /* FunctionDeclaration */: { - var funcDecl = ast; - this.typeCheckAnyFunctionDeclaration(funcDecl, TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */), funcDecl.identifier, funcDecl.callSignature.typeParameterList, funcDecl.callSignature.parameterList, TypeScript.ASTHelpers.getType(funcDecl), funcDecl.block, context); - return; - } - - case 219 /* SimpleArrowFunctionExpression */: - this.typeCheckSimpleArrowFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 218 /* ParenthesizedArrowFunctionExpression */: - this.typeCheckParenthesizedArrowFunctionExpression(ast, isContextuallyTyped, context); - return; - - case 214 /* ArrayLiteralExpression */: - this.resolveArrayLiteralExpression(ast, isContextuallyTyped, context); - return; - - case 213 /* InvocationExpression */: - this.typeCheckInvocationExpression(ast, context); - return; - - case 216 /* ObjectCreationExpression */: - this.typeCheckObjectCreationExpression(ast, context); - return; - - case 150 /* ReturnStatement */: - this.resolveReturnStatement(ast, context); - return; - - default: - TypeScript.Debug.assert(false, "Failure nodeType: " + TypeScript.SyntaxKind[ast.kind()] + ". Implement typeCheck when symbol is set for the ast as part of resolution."); - } - }; - - PullTypeResolver.prototype.processPostTypeCheckWorkItems = function (context) { - while (this.postTypeCheckWorkitems.length) { - var ast = this.postTypeCheckWorkitems.pop(); - this.postTypeCheck(ast, context); - } - }; - - PullTypeResolver.prototype.postTypeCheck = function (ast, context) { - var nodeType = ast.kind(); - - switch (nodeType) { - case 242 /* Parameter */: - case 225 /* VariableDeclarator */: - this.postTypeCheckVariableDeclaratorOrParameter(ast, context); - return; - - case 131 /* ClassDeclaration */: - this.postTypeCheckClassDeclaration(ast, context); - return; - - case 129 /* FunctionDeclaration */: - this.postTypeCheckFunctionDeclaration(ast, context); - return; - - case 130 /* ModuleDeclaration */: - this.postTypeCheckModuleDeclaration(ast, context); - return; - - case 132 /* EnumDeclaration */: - this.postTypeCheckEnumDeclaration(ast, context); - return; - - case 133 /* ImportDeclaration */: - this.postTypeCheckImportDeclaration(ast, context); - return; - - case 11 /* IdentifierName */: - this.postTypeCheckNameExpression(ast, context); - return; - - default: - TypeScript.Debug.assert(false, "Implement postTypeCheck clause to handle the postTypeCheck work, nodeType: " + TypeScript.SyntaxKind[ast.kind()]); - } - }; - - PullTypeResolver.prototype.resolveRegularExpressionLiteral = function () { - if (this.cachedRegExpInterfaceType()) { - return this.cachedRegExpInterfaceType(); - } else { - return this.semanticInfoChain.anyTypeSymbol; - } - }; - - PullTypeResolver.prototype.postTypeCheckNameExpression = function (nameAST, context) { - this.checkThisCaptureVariableCollides(nameAST, false, context); - }; - - PullTypeResolver.prototype.typeCheckNameExpression = function (nameAST, context) { - this.setTypeChecked(nameAST, context); - this.checkNameForCompilerGeneratedDeclarationCollision(nameAST, false, nameAST, context); - }; - - PullTypeResolver.prototype.resolveNameExpression = function (nameAST, context) { - var nameSymbol = this.getSymbolForAST(nameAST, context); - var foundCached = nameSymbol !== null; - - if (!foundCached || this.canTypeCheckAST(nameAST, context)) { - if (this.canTypeCheckAST(nameAST, context)) { - this.typeCheckNameExpression(nameAST, context); - } - nameSymbol = this.computeNameExpression(nameAST, context); - } - - this.resolveDeclaredSymbol(nameSymbol, context); - - if (nameSymbol && (nameSymbol.type !== this.semanticInfoChain.anyTypeSymbol || nameSymbol.anyDeclHasFlag(16777216 /* IsAnnotatedWithAny */ | 1 /* Exported */))) { - this.setSymbolForAST(nameAST, nameSymbol, context); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.isInEnumDecl = function (decl) { - if (decl.kind & 64 /* Enum */) { - return true; - } - - var declPath = decl.getParentPath(); - - var disallowedKinds = 164 /* SomeContainer */ | 58728795 /* SomeType */; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - - if (decl.kind & 64 /* Enum */) { - return true; - } - - if (decl.kind & disallowedKinds) { - return false; - } - } - return false; - }; - - PullTypeResolver.prototype.getSomeInnermostFunctionScopeDecl = function (declPath) { - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - if (decl.kind & 1032192 /* SomeFunction */) { - return decl; - } - } - - return null; - }; - - PullTypeResolver.prototype.isFromFunctionScope = function (nameSymbol, functionScopeDecl) { - var _this = this; - return TypeScript.ArrayUtilities.any(nameSymbol.getDeclarations(), function (nameSymbolDecl) { - return _this.getSomeInnermostFunctionScopeDecl(nameSymbolDecl.getParentPath()) === functionScopeDecl; - }); - }; - - PullTypeResolver.prototype.findConstructorDeclOfEnclosingType = function (decl) { - var current = decl; - while (current) { - if (TypeScript.hasFlag(current.kind, 4096 /* Property */)) { - var parentDecl = current.getParentDecl(); - if (TypeScript.hasFlag(parentDecl.kind, 8 /* Class */)) { - return TypeScript.ArrayUtilities.lastOrDefault(parentDecl.getChildDecls(), function (decl) { - return TypeScript.hasFlag(decl.kind, 32768 /* ConstructorMethod */); - }); - } - } - - if (TypeScript.hasFlag(current.kind, 164 /* SomeContainer */)) { - return null; - } - - current = current.getParentDecl(); - } - return null; - }; - - PullTypeResolver.prototype.checkNameAsPartOfInitializerExpressionForInstanceMemberVariable = function (nameAST) { - var id = nameAST.valueText(); - if (id.length === 0) { - return null; - } - - var memberVariableDeclarationAST = TypeScript.ASTHelpers.getEnclosingMemberVariableDeclaration(nameAST); - if (memberVariableDeclarationAST) { - var memberVariableDecl = this.semanticInfoChain.getDeclForAST(memberVariableDeclarationAST); - if (!TypeScript.hasFlag(memberVariableDecl.flags, 16 /* Static */)) { - var constructorDecl = this.findConstructorDeclOfEnclosingType(memberVariableDecl); - - if (constructorDecl) { - var childDecls = constructorDecl.searchChildDecls(id, 68147712 /* SomeValue */); - - if (childDecls.length) { - var memberVariableSymbol = memberVariableDecl.getSymbol(); - - return this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, [memberVariableSymbol.getScopedName(constructorDecl.getSymbol()), nameAST.text()]); - } - } - } - } - return null; - }; - - PullTypeResolver.prototype.computeNameExpression = function (nameAST, context) { - var id = nameAST.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var nameSymbol = null; - var enclosingDecl = this.getEnclosingDeclForAST(nameAST); - - if (TypeScript.hasFlag(enclosingDecl.flags, 8388608 /* PropertyParameter */)) { - var valueDecl = enclosingDecl.getValueDecl(); - if (valueDecl && TypeScript.hasFlag(valueDecl.kind, 2048 /* Parameter */)) { - enclosingDecl = valueDecl; - } - } - - var diagnosticForInitializer = this.checkNameAsPartOfInitializerExpressionForInstanceMemberVariable(nameAST); - - if (TypeScript.ASTHelpers.isDeclarationASTOrDeclarationNameAST(nameAST)) { - nameSymbol = this.semanticInfoChain.getDeclForAST(nameAST.parent).getSymbol(); - } - - var declPath = enclosingDecl.getParentPath(); - - if (!nameSymbol) { - var searchKind = 68147712 /* SomeValue */; - - if (!this.isInEnumDecl(enclosingDecl)) { - searchKind = searchKind & ~(67108864 /* EnumMember */); - } - - var nameSymbol = this.getSymbolFromDeclPath(id, declPath, searchKind); - } - - if (id === "arguments") { - var functionScopeDecl = this.getSomeInnermostFunctionScopeDecl(declPath); - if (functionScopeDecl) { - if (!nameSymbol || !this.isFromFunctionScope(nameSymbol, functionScopeDecl)) { - nameSymbol = this.cachedFunctionArgumentsSymbol(); - this.resolveDeclaredSymbol(this.cachedIArgumentsInterfaceType(), context); - } - } - } - - if (!nameSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } else if (diagnosticForInitializer) { - context.postDiagnostic(diagnosticForInitializer); - return this.getNewErrorTypeSymbol(id); - } - - var nameDeclaration = nameSymbol.getDeclarations()[0]; - var nameParentDecl = nameDeclaration.getParentDecl(); - if (nameParentDecl && (nameParentDecl.kind & 1032192 /* SomeFunction */) && (nameParentDecl.flags & 33554432 /* HasDefaultArgs */)) { - var enclosingFunctionAST = this.semanticInfoChain.getASTForDecl(nameParentDecl); - var currentParameterIndex = this.getCurrentParameterIndexForFunction(nameAST, enclosingFunctionAST); - - var parameterList = TypeScript.ASTHelpers.getParameterList(enclosingFunctionAST); - - if (currentParameterIndex >= 0) { - var matchingParameter; - if (parameterList) { - for (var i = 0; i <= currentParameterIndex; i++) { - var candidateParameter = parameterList.parameters.nonSeparatorAt(i); - if (candidateParameter && candidateParameter.identifier.valueText() === id) { - matchingParameter = candidateParameter; - break; - } - } - } - - if (!matchingParameter) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, [parameterList.parameters.nonSeparatorAt(currentParameterIndex).identifier.text(), nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } else if (matchingParameter === TypeScript.ASTHelpers.getEnclosingParameterForInitializer(nameAST)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Parameter_0_cannot_be_referenced_in_its_initializer, [parameterList.parameters.nonSeparatorAt(currentParameterIndex).identifier.text()])); - return this.getNewErrorTypeSymbol(id); - } - } - } - - var aliasSymbol = null; - - if (nameSymbol.isType() && nameSymbol.isAlias()) { - aliasSymbol = nameSymbol; - if (!this.inTypeQuery(nameAST)) { - aliasSymbol.setIsUsedAsValue(); - } - - this.resolveDeclaredSymbol(nameSymbol, context); - - this.resolveDeclaredSymbol(aliasSymbol.assignedValue(), context); - this.resolveDeclaredSymbol(aliasSymbol.assignedContainer(), context); - - var exportAssignmentSymbol = nameSymbol.getExportAssignedValueSymbol(); - - if (exportAssignmentSymbol) { - nameSymbol = exportAssignmentSymbol; - } else { - aliasSymbol = null; - } - } - - if (aliasSymbol) { - this.semanticInfoChain.setAliasSymbolForAST(nameAST, aliasSymbol); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.getCurrentParameterIndexForFunction = function (parameter, funcDecl) { - var parameterList = TypeScript.ASTHelpers.getParameterList(funcDecl); - if (parameterList) { - while (parameter && parameter.parent) { - if (parameter.parent.parent === parameterList) { - return parameterList.parameters.nonSeparatorIndexOf(parameter); - } - - parameter = parameter.parent; - } - } - - return -1; - }; - - PullTypeResolver.prototype.resolveMemberAccessExpression = function (dottedNameAST, context) { - return this.resolveDottedNameExpression(dottedNameAST, dottedNameAST.expression, dottedNameAST.name, context); - }; - - PullTypeResolver.prototype.resolveDottedNameExpression = function (dottedNameAST, expression, name, context) { - var symbol = this.getSymbolForAST(dottedNameAST, context); - var foundCached = symbol !== null; - - if (!foundCached || this.canTypeCheckAST(dottedNameAST, context)) { - var canTypeCheckDottedNameAST = this.canTypeCheckAST(dottedNameAST, context); - if (canTypeCheckDottedNameAST) { - this.setTypeChecked(dottedNameAST, context); - } - - symbol = this.computeDottedNameExpression(expression, name, context, canTypeCheckDottedNameAST); - } - - this.resolveDeclaredSymbol(symbol, context); - - if (symbol && (symbol.type !== this.semanticInfoChain.anyTypeSymbol || symbol.anyDeclHasFlag(16777216 /* IsAnnotatedWithAny */ | 1 /* Exported */))) { - this.setSymbolForAST(dottedNameAST, symbol, context); - this.setSymbolForAST(name, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.computeDottedNameExpression = function (expression, name, context, checkSuperPrivateAndStaticAccess) { - var rhsName = name.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var lhs = this.resolveAST(expression, false, context); - return this.computeDottedNameExpressionFromLHS(lhs, expression, name, context, checkSuperPrivateAndStaticAccess); - }; - - PullTypeResolver.prototype.computeDottedNameExpressionFromLHS = function (lhs, expression, name, context, checkSuperPrivateAndStaticAccess) { - var rhsName = name.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var lhsType = lhs.type; - - if (lhs.isAlias()) { - var lhsAlias = lhs; - if (!this.inTypeQuery(expression)) { - lhsAlias.setIsUsedAsValue(); - } - lhsType = lhsAlias.getExportAssignedTypeSymbol(); - } - - if (lhsType.isAlias()) { - lhsType = lhsType.getExportAssignedTypeSymbol(); - } - - if (!lhsType) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.Could_not_find_enclosing_symbol_for_dotted_name_0, [name.text()])); - return this.getNewErrorTypeSymbol(); - } - - if (!lhsType.isResolved) { - var potentiallySpecializedType = this.resolveDeclaredSymbol(lhsType, context); - - if (potentiallySpecializedType !== lhsType) { - if (!lhs.isType()) { - context.setTypeInContext(lhs, potentiallySpecializedType); - } - - lhsType = potentiallySpecializedType; - } - } - - if (lhsType.isContainer() && !lhsType.isAlias() && !lhsType.isEnum()) { - var instanceSymbol = lhsType.getInstanceSymbol(); - - if (instanceSymbol) { - lhsType = instanceSymbol.type; - } - } - - var originalLhsTypeForErrorReporting = lhsType; - - lhsType = this.getApparentType(lhsType).widenedType(this, expression, context); - - if (this.isAnyOrEquivalent(lhsType)) { - return lhsType; - } - - var nameSymbol = this._getNamedPropertySymbolOfAugmentedType(rhsName, lhsType); - - if (!nameSymbol) { - if (lhsType.kind === 32 /* DynamicModule */) { - var container = lhsType; - var associatedInstance = container.getInstanceSymbol(); - - if (associatedInstance) { - var instanceType = associatedInstance.type; - - nameSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, instanceType); - } - } else { - var associatedType = lhsType.getAssociatedContainerType(); - - if (associatedType && !associatedType.isClass()) { - nameSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, associatedType); - } - } - - if (!nameSymbol) { - var enclosingDecl = this.getEnclosingDeclForAST(expression); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.The_property_0_does_not_exist_on_value_of_type_1, [name.text(), originalLhsTypeForErrorReporting.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - return this.getNewErrorTypeSymbol(rhsName); - } - } - - if (checkSuperPrivateAndStaticAccess) { - this.checkForSuperMemberAccess(expression, name, nameSymbol, context) || this.checkForPrivateMemberAccess(name, lhsType, nameSymbol, context); - } - - return nameSymbol; - }; - - PullTypeResolver.prototype.resolveTypeNameExpression = function (nameAST, context) { - var typeNameSymbol = this.getSymbolForAST(nameAST, context); - - if (!typeNameSymbol || !typeNameSymbol.isType() || this.canTypeCheckAST(nameAST, context)) { - if (this.canTypeCheckAST(nameAST, context)) { - this.setTypeChecked(nameAST, context); - } - typeNameSymbol = this.computeTypeNameExpression(nameAST, context); - this.setSymbolForAST(nameAST, typeNameSymbol, context); - } - - this.resolveDeclaredSymbol(typeNameSymbol, context); - - return typeNameSymbol; - }; - - PullTypeResolver.prototype.computeTypeNameExpression = function (nameAST, context) { - var id = nameAST.valueText(); - if (id.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var enclosingDecl = this.getEnclosingDeclForAST(nameAST); - - var declPath = enclosingDecl.getParentPath(); - - var onLeftOfDot = this.isLeftSideOfQualifiedName(nameAST); - - var kindToCheckFirst = onLeftOfDot ? 164 /* SomeContainer */ : 58728795 /* SomeType */; - var kindToCheckSecond = onLeftOfDot ? 58728795 /* SomeType */ : 164 /* SomeContainer */; - - var typeNameSymbol = this.getSymbolFromDeclPath(id, declPath, kindToCheckFirst); - - if (!typeNameSymbol) { - typeNameSymbol = this.getSymbolFromDeclPath(id, declPath, kindToCheckSecond); - } - - if (!typeNameSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Could_not_find_symbol_0, [nameAST.text()])); - return this.getNewErrorTypeSymbol(id); - } - - var typeNameSymbolAlias = null; - if (typeNameSymbol.isAlias()) { - typeNameSymbolAlias = typeNameSymbol; - this.resolveDeclaredSymbol(typeNameSymbol, context); - - var aliasedType = typeNameSymbolAlias.getExportAssignedTypeSymbol(); - - this.resolveDeclaredSymbol(aliasedType, context); - } - - if (typeNameSymbol.isTypeParameter()) { - if (this.isInStaticMemberContext(enclosingDecl)) { - var parentDecl = typeNameSymbol.getDeclarations()[0].getParentDecl(); - - if (parentDecl.kind === 8 /* Class */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(nameAST, TypeScript.DiagnosticCode.Static_members_cannot_reference_class_type_parameters)); - return this.getNewErrorTypeSymbol(); - } - } - } - - if (!typeNameSymbol.isGeneric() && (typeNameSymbol.isClass() || typeNameSymbol.isInterface())) { - typeNameSymbol = TypeScript.PullTypeReferenceSymbol.createTypeReference(typeNameSymbol); - } - - return typeNameSymbol; - }; - - PullTypeResolver.prototype.isInStaticMemberContext = function (decl) { - while (decl) { - if (TypeScript.hasFlag(decl.kind, 1032192 /* SomeFunction */ | 4096 /* Property */) && TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - return true; - } - - if (TypeScript.hasFlag(decl.kind, 164 /* SomeContainer */)) { - return false; - } - - decl = decl.getParentDecl(); - } - - return false; - }; - - PullTypeResolver.prototype.isLeftSideOfQualifiedName = function (ast) { - return ast && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.left === ast; - }; - - PullTypeResolver.prototype.resolveGenericTypeReference = function (genericTypeAST, context) { - var genericTypeSymbol = this.resolveAST(genericTypeAST.name, false, context).type; - - if (genericTypeSymbol.isError()) { - return genericTypeSymbol; - } - - if (!genericTypeSymbol.inResolution && !genericTypeSymbol.isResolved) { - this.resolveDeclaredSymbol(genericTypeSymbol, context); - } - - if (genericTypeSymbol.isAlias()) { - if (this.inClassExtendsHeritageClause(genericTypeAST) && !this.inTypeArgumentList(genericTypeAST)) { - genericTypeSymbol.setIsUsedAsValue(); - } - genericTypeSymbol = genericTypeSymbol.getExportAssignedTypeSymbol(); - } - - var typeParameters = genericTypeSymbol.getTypeParameters(); - if (typeParameters.length === 0) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Type_0_does_not_have_type_parameters, [genericTypeSymbol.toString()])); - return this.getNewErrorTypeSymbol(); - } - - var typeArgs = []; - - if (genericTypeAST.typeArgumentList && genericTypeAST.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < genericTypeAST.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - typeArgs[i] = this.resolveTypeReference(genericTypeAST.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - - if (typeArgs[i].isError()) { - typeArgs[i] = this.semanticInfoChain.anyTypeSymbol; - } - } - } - - if (typeArgs.length && typeArgs.length !== typeParameters.length) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Generic_type_0_requires_1_type_argument_s, [genericTypeSymbol.toString(), genericTypeSymbol.getTypeParameters().length])); - return this.getNewErrorTypeSymbol(); - } - - if (!genericTypeSymbol.isResolved) { - var typeDecls = genericTypeSymbol.getDeclarations(); - var childDecls = null; - - for (var i = 0; i < typeDecls.length; i++) { - childDecls = typeDecls[i].getChildDecls(); - - for (var j = 0; j < childDecls.length; j++) { - childDecls[j].ensureSymbolIsBound(); - } - } - } - - var specializedSymbol = this.createInstantiatedType(genericTypeSymbol, typeArgs); - - var typeConstraint = null; - var upperBound = null; - - typeParameters = specializedSymbol.getTypeParameters(); - - var typeConstraintSubstitutionMap = []; - var typeArg = null; - - var instantiatedSubstitutionMap = specializedSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < typeParameters.length; i++) { - typeConstraintSubstitutionMap[typeParameters[i].pullSymbolID] = typeParameters[i]; - } - - for (var id in instantiatedSubstitutionMap) { - typeConstraintSubstitutionMap[id] = instantiatedSubstitutionMap[id]; - } - - for (var iArg = 0; (iArg < typeArgs.length) && (iArg < typeParameters.length); iArg++) { - typeArg = typeArgs[iArg]; - typeConstraint = typeParameters[iArg].getConstraint(); - - typeConstraintSubstitutionMap[typeParameters[iArg].pullSymbolID] = typeArg; - - if (typeConstraint) { - if (typeConstraint.isTypeParameter()) { - for (var j = 0; j < typeParameters.length && j < typeArgs.length; j++) { - if (typeParameters[j] === typeConstraint) { - typeConstraint = typeArgs[j]; - } - } - } else if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeConstraintSubstitutionMap); - } - - if (typeArg.isTypeParameter()) { - upperBound = typeArg.getConstraint(); - - if (upperBound) { - typeArg = upperBound; - } - } - - if (typeArg.inResolution || (typeArg.isTypeReference() && typeArg.referencedTypeSymbol.inResolution)) { - return specializedSymbol; - } - - if (!this.sourceIsAssignableToTarget(typeArg, typeConstraint, genericTypeAST, context)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(genericTypeAST); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(genericTypeAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [typeArg.toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[iArg].toString(enclosingSymbol, true)])); - } - } - } - - return specializedSymbol; - }; - - PullTypeResolver.prototype.resolveQualifiedName = function (dottedNameAST, context) { - if (this.inTypeQuery(dottedNameAST)) { - return this.resolveDottedNameExpression(dottedNameAST, dottedNameAST.left, dottedNameAST.right, context).type; - } - - var symbol = this.getSymbolForAST(dottedNameAST, context); - if (!symbol || this.canTypeCheckAST(dottedNameAST, context)) { - var canTypeCheck = this.canTypeCheckAST(dottedNameAST, context); - if (canTypeCheck) { - this.setTypeChecked(dottedNameAST, context); - } - - symbol = this.computeQualifiedName(dottedNameAST, context); - this.setSymbolForAST(dottedNameAST, symbol, context); - } - - this.resolveDeclaredSymbol(symbol, context); - - return symbol; - }; - - PullTypeResolver.prototype.isLastNameOfModuleNameModuleReference = function (ast) { - return ast.kind() === 11 /* IdentifierName */ && ast.parent && ast.parent.kind() === 121 /* QualifiedName */ && ast.parent.right === ast && ast.parent.parent && ast.parent.parent.kind() === 246 /* ModuleNameModuleReference */; - }; - - PullTypeResolver.prototype.computeQualifiedName = function (dottedNameAST, context) { - var rhsName = dottedNameAST.right.valueText(); - if (rhsName.length === 0) { - return this.semanticInfoChain.anyTypeSymbol; - } - - var enclosingDecl = this.getEnclosingDeclForAST(dottedNameAST); - var lhs = this.resolveAST(dottedNameAST.left, false, context); - - var lhsType = lhs.isAlias() ? lhs.getExportAssignedContainerSymbol() : lhs.type; - - if (this.inClassExtendsHeritageClause(dottedNameAST) && !this.inTypeArgumentList(dottedNameAST)) { - if (lhs.isAlias()) { - lhs.setIsUsedAsValue(); - } - } - - if (!lhsType) { - return this.getNewErrorTypeSymbol(); - } - - if (this.isAnyOrEquivalent(lhsType)) { - return lhsType; - } - - var onLeftOfDot = this.isLeftSideOfQualifiedName(dottedNameAST); - var isNameOfModule = dottedNameAST.parent.kind() === 130 /* ModuleDeclaration */ && dottedNameAST.parent.name === dottedNameAST; - - var memberKind = (onLeftOfDot || isNameOfModule) ? 164 /* SomeContainer */ : 58728795 /* SomeType */; - - var childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, lhsType); - - if (!childTypeSymbol && !isNameOfModule && this.isLastNameOfModuleNameModuleReference(dottedNameAST.right)) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, 68147712 /* SomeValue */, lhsType); - } - - if (!childTypeSymbol && lhsType.isContainer()) { - var exportedContainer = lhsType.getExportAssignedContainerSymbol(); - - if (exportedContainer) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, exportedContainer); - } - } - - if (!childTypeSymbol && enclosingDecl) { - var parentDecl = enclosingDecl; - - while (parentDecl) { - if (parentDecl.kind & 164 /* SomeContainer */) { - break; - } - - parentDecl = parentDecl.getParentDecl(); - } - - if (parentDecl) { - var enclosingSymbolType = parentDecl.getSymbol().type; - - if (enclosingSymbolType === lhsType) { - childTypeSymbol = this.getNamedPropertySymbol(rhsName, memberKind, lhsType); - } - } - } - - if (!childTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(dottedNameAST.right, TypeScript.DiagnosticCode.The_property_0_does_not_exist_on_value_of_type_1, [dottedNameAST.right.text(), lhsType.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - return this.getNewErrorTypeSymbol(rhsName); - } - - return childTypeSymbol; - }; - - PullTypeResolver.prototype.shouldContextuallyTypeAnyFunctionExpression = function (functionExpressionAST, typeParameters, parameters, returnTypeAnnotation, context) { - if (typeParameters && typeParameters.typeParameters.nonSeparatorCount() > 0) { - return false; - } - - if (returnTypeAnnotation) { - return false; - } - - if (parameters) { - for (var i = 0, n = parameters.length; i < n; i++) { - if (parameters.typeAt(i)) { - return false; - } - } - } - - var contextualFunctionTypeSymbol = context.getContextualType(); - - if (contextualFunctionTypeSymbol) { - this.resolveDeclaredSymbol(contextualFunctionTypeSymbol, context); - var callSignatures = contextualFunctionTypeSymbol.getCallSignatures(); - var exactlyOneCallSignature = callSignatures && callSignatures.length === 1; - if (!exactlyOneCallSignature) { - return false; - } - - var callSignatureIsGeneric = callSignatures[0].getTypeParameters().length > 0; - return !callSignatureIsGeneric; - } - - return false; - }; - - PullTypeResolver.prototype.resolveAnyFunctionExpression = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context) { - var funcDeclSymbol = null; - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - TypeScript.Debug.assert(functionDecl); - - if (functionDecl && functionDecl.hasSymbol()) { - funcDeclSymbol = functionDecl.getSymbol(); - if (funcDeclSymbol.isResolved || funcDeclSymbol.inResolution) { - return funcDeclSymbol; - } - } - - funcDeclSymbol = functionDecl.getSymbol(); - TypeScript.Debug.assert(funcDeclSymbol); - - var funcDeclType = funcDeclSymbol.type; - var signature = funcDeclType.getCallSignatures()[0]; - funcDeclSymbol.startResolving(); - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - var assigningFunctionSignature = null; - if (isContextuallyTyped && this.shouldContextuallyTypeAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, context)) { - assigningFunctionSignature = context.getContextualType().getCallSignatures()[0]; - } - - this.resolveAnyFunctionExpressionParameters(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context); - - if (returnTypeAnnotation) { - signature.returnType = this.resolveTypeReference(returnTypeAnnotation, context); - } else { - if (assigningFunctionSignature) { - var returnType = assigningFunctionSignature.returnType; - - if (returnType) { - context.propagateContextualType(returnType); - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, bodyExpression, signature, true, functionDecl, context); - context.popAnyContextualType(); - } else { - signature.returnType = this.semanticInfoChain.anyTypeSymbol; - - if (this.compilationSettings.noImplicitAny()) { - var functionExpressionName = functionDecl.getFunctionExpressionName(); - - if (functionExpressionName != "") { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode._0_which_lacks_return_type_annotation_implicitly_has_an_any_return_type, [functionExpressionName])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_any_return_type)); - } - } - } - } else { - this.resolveFunctionBodyReturnTypes(funcDeclAST, block, bodyExpression, signature, false, functionDecl, context); - } - } - - context.setTypeInContext(funcDeclSymbol, funcDeclType); - funcDeclSymbol.setResolved(); - - if (this.canTypeCheckAST(funcDeclAST, context)) { - this.typeCheckAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context); - } - - return funcDeclSymbol; - }; - - PullTypeResolver.prototype.resolveAnyFunctionExpressionParameters = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context) { - if (!parameters) { - return; - } - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var contextParams = []; - - var assigningFunctionSignature = null; - if (isContextuallyTyped && this.shouldContextuallyTypeAnyFunctionExpression(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, context)) { - assigningFunctionSignature = context.getContextualType().getCallSignatures()[0]; - } - - if (assigningFunctionSignature) { - contextParams = assigningFunctionSignature.parameters; - } - - var contextualParametersCount = contextParams.length; - for (var i = 0, n = parameters.length; i < n; i++) { - var actualParameterIsVarArgParameter = (i === (n - 1)) && parameters.lastParameterIsRest(); - var correspondingContextualParameter = null; - var contextualParameterType = null; - - if (i < contextualParametersCount) { - correspondingContextualParameter = contextParams[i]; - } else if (contextualParametersCount && contextParams[contextualParametersCount - 1].isVarArg) { - correspondingContextualParameter = contextParams[contextualParametersCount - 1]; - } - - if (correspondingContextualParameter) { - if (correspondingContextualParameter.isVarArg === actualParameterIsVarArgParameter) { - contextualParameterType = correspondingContextualParameter.type; - } else if (correspondingContextualParameter.isVarArg) { - contextualParameterType = correspondingContextualParameter.type.getElementType(); - } - } - - this.resolveFunctionExpressionParameter(parameters.astAt(i), parameters.identifierAt(i), parameters.typeAt(i), parameters.initializerAt(i), contextualParameterType, functionDecl, context); - } - }; - - PullTypeResolver.prototype.typeCheckSimpleArrowFunctionExpression = function (arrowFunction, isContextuallyTyped, context) { - return this.typeCheckAnyFunctionExpression(arrowFunction, null, TypeScript.ASTHelpers.parametersFromIdentifier(arrowFunction.identifier), null, arrowFunction.block, arrowFunction.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckParenthesizedArrowFunctionExpression = function (arrowFunction, isContextuallyTyped, context) { - return this.typeCheckAnyFunctionExpression(arrowFunction, arrowFunction.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), TypeScript.ASTHelpers.getType(arrowFunction), arrowFunction.block, arrowFunction.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckAnyFunctionExpression = function (funcDeclAST, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, isContextuallyTyped, context) { - var _this = this; - this.setTypeChecked(funcDeclAST, context); - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - - var funcDeclSymbol = functionDecl.getSymbol(); - var funcDeclType = funcDeclSymbol.type; - var signature = funcDeclType.getCallSignatures()[0]; - var returnTypeSymbol = signature.returnType; - - if (typeParameters) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - this.resolveTypeParameterDeclaration(typeParameters.typeParameters.nonSeparatorAt(i), context); - } - } - - this.resolveAnyFunctionExpressionParameters(funcDeclAST, typeParameters, parameters, returnTypeAnnotation, isContextuallyTyped, context); - - context.pushNewContextualType(null); - if (block) { - this.resolveAST(block, false, context); - } else { - var bodyExpressionType = this.resolveReturnExpression(bodyExpression, functionDecl, context); - this.typeCheckReturnExpression(bodyExpression, bodyExpressionType, functionDecl, context); - } - - context.popAnyContextualType(); - - this.checkThatNonVoidFunctionHasReturnExpressionOrThrowStatement(functionDecl, returnTypeAnnotation, returnTypeSymbol, block, context); - - this.validateVariableDeclarationGroups(functionDecl, context); - - this.typeCheckCallBacks.push(function (context) { - _this.typeCheckFunctionOverloads(funcDeclAST, context); - }); - }; - - PullTypeResolver.prototype.resolveThisExpression = function (thisExpression, context) { - var enclosingDecl = this.getEnclosingDeclForAST(thisExpression); - var thisTypeSymbol = this.getContextualClassSymbolForEnclosingDecl(thisExpression, enclosingDecl) || this.semanticInfoChain.anyTypeSymbol; - - if (this.canTypeCheckAST(thisExpression, context)) { - this.typeCheckThisExpression(thisExpression, context, enclosingDecl); - } - - return thisTypeSymbol; - }; - - PullTypeResolver.prototype.inTypeArgumentList = function (ast) { - var previous = null; - var current = ast; - - while (current) { - switch (current.kind()) { - case 126 /* GenericType */: - var genericType = current; - if (genericType.typeArgumentList === previous) { - return true; - } - break; - - case 226 /* ArgumentList */: - var argumentList = current; - return argumentList.typeArgumentList === previous; - } - - previous = current; - current = current.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inClassExtendsHeritageClause = function (ast) { - while (ast) { - switch (ast.kind()) { - case 230 /* ExtendsHeritageClause */: - var heritageClause = ast; - - return heritageClause.parent.parent.kind() === 131 /* ClassDeclaration */; - - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inTypeQuery = function (ast) { - while (ast) { - switch (ast.kind()) { - case 127 /* TypeQuery */: - return true; - case 129 /* FunctionDeclaration */: - case 213 /* InvocationExpression */: - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inArgumentListOfSuperInvocation = function (ast) { - var previous = null; - var current = ast; - while (current) { - switch (current.kind()) { - case 213 /* InvocationExpression */: - var invocationExpression = current; - if (previous === invocationExpression.argumentList && invocationExpression.expression.kind() === 50 /* SuperKeyword */) { - return true; - } - break; - - case 137 /* ConstructorDeclaration */: - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - previous = current; - current = current.parent; - } - - return false; - }; - - PullTypeResolver.prototype.inConstructorParameterList = function (ast) { - var previous = null; - var current = ast; - while (current) { - switch (current.kind()) { - case 142 /* CallSignature */: - var callSignature = current; - if (previous === callSignature.parameterList && callSignature.parent.kind() === 137 /* ConstructorDeclaration */) { - return true; - } - - case 131 /* ClassDeclaration */: - case 130 /* ModuleDeclaration */: - return false; - } - - previous = current; - current = current.parent; - } - - return false; - }; - PullTypeResolver.prototype.isFunctionAccessorOrNonArrowFunctionExpression = function (decl) { - if (decl.kind === 262144 /* GetAccessor */ || decl.kind === 524288 /* SetAccessor */) { - return true; - } - - return this.isFunctionOrNonArrowFunctionExpression(decl); - }; - - PullTypeResolver.prototype.isFunctionOrNonArrowFunctionExpression = function (decl) { - if (decl.kind === 16384 /* Function */) { - return true; - } else if (decl.kind === 131072 /* FunctionExpression */ && !TypeScript.hasFlag(decl.flags, 8192 /* ArrowFunction */)) { - return true; - } - - return false; - }; - - PullTypeResolver.prototype.typeCheckThisExpression = function (thisExpression, context, enclosingDecl) { - this.checkForThisCaptureInArrowFunction(thisExpression); - - if (this.inConstructorParameterList(thisExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_constructor_arguments)); - return; - } - - for (var currentDecl = enclosingDecl; currentDecl !== null; currentDecl = currentDecl.getParentDecl()) { - if (this.isFunctionAccessorOrNonArrowFunctionExpression(currentDecl)) { - return; - } else if (currentDecl.kind === 4 /* Container */ || currentDecl.kind === 32 /* DynamicModule */) { - if (currentDecl.getParentDecl() === null) { - return; - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_within_module_bodies)); - return; - } - } else if (currentDecl.kind === 64 /* Enum */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_current_location)); - return; - } else if (currentDecl.kind === 32768 /* ConstructorMethod */) { - if (this.inArgumentListOfSuperInvocation(thisExpression) && this.superCallMustBeFirstStatementInConstructor(currentDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_current_location)); - } - - return; - } else if (currentDecl.kind === 8 /* Class */) { - if (this.inStaticMemberVariableDeclaration(thisExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(thisExpression, TypeScript.DiagnosticCode.this_cannot_be_referenced_in_static_initializers_in_a_class_body)); - } - - return; - } - } - }; - - PullTypeResolver.prototype.getContextualClassSymbolForEnclosingDecl = function (ast, enclosingDecl) { - var declPath = enclosingDecl.getParentPath(); - - if (declPath.length) { - var isStaticContext = false; - - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - var declFlags = decl.flags; - - if (declFlags & 16 /* Static */) { - isStaticContext = true; - } else if (declKind === 131072 /* FunctionExpression */ && !TypeScript.hasFlag(declFlags, 8192 /* ArrowFunction */)) { - return null; - } else if (declKind === 16384 /* Function */) { - return null; - } else if (declKind === 8 /* Class */) { - if (this.inStaticMemberVariableDeclaration(ast)) { - return this.getNewErrorTypeSymbol(); - } else { - var classSymbol = decl.getSymbol(); - if (isStaticContext) { - var constructorSymbol = classSymbol.getConstructorMethod(); - return constructorSymbol.type; - } else { - return classSymbol; - } - } - } - } - } - - return null; - }; - - PullTypeResolver.prototype.inStaticMemberVariableDeclaration = function (ast) { - while (ast) { - if (ast.kind() === 136 /* MemberVariableDeclaration */ && TypeScript.hasModifier(ast.modifiers, 16 /* Static */)) { - return true; - } - - ast = ast.parent; - } - - return false; - }; - - PullTypeResolver.prototype.resolveSuperExpression = function (ast, context) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - var superType = this.semanticInfoChain.anyTypeSymbol; - - var classSymbol = this.getContextualClassSymbolForEnclosingDecl(ast, enclosingDecl); - - if (classSymbol) { - this.resolveDeclaredSymbol(classSymbol, context); - - var parents = classSymbol.getExtendedTypes(); - - if (parents.length) { - superType = parents[0]; - } - } - - if (this.canTypeCheckAST(ast, context)) { - this.typeCheckSuperExpression(ast, context, enclosingDecl); - } - - return superType; - }; - - PullTypeResolver.prototype.typeCheckSuperExpression = function (ast, context, enclosingDecl) { - this.setTypeChecked(ast, context); - - this.checkForThisCaptureInArrowFunction(ast); - - var isSuperCall = ast.parent.kind() === 213 /* InvocationExpression */; - var isSuperPropertyAccess = ast.parent.kind() === 212 /* MemberAccessExpression */; - TypeScript.Debug.assert(isSuperCall || isSuperPropertyAccess); - - if (isSuperPropertyAccess) { - for (var currentDecl = enclosingDecl; currentDecl !== null; currentDecl = currentDecl.getParentDecl()) { - if (this.isFunctionOrNonArrowFunctionExpression(currentDecl)) { - break; - } else if (currentDecl.kind === 8 /* Class */) { - if (!this.enclosingClassIsDerived(currentDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_non_derived_classes)); - return; - } else if (this.inConstructorParameterList(ast)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_constructor_arguments)); - return; - } else if (this.inStaticMemberVariableDeclaration(ast)) { - break; - } - - return; - } - } - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class)); - return; - } else { - if (enclosingDecl.kind === 32768 /* ConstructorMethod */) { - var classDecl = enclosingDecl.getParentDecl(); - - if (!this.enclosingClassIsDerived(classDecl)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_non_derived_classes)); - return; - } else if (this.inConstructorParameterList(ast)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.super_cannot_be_referenced_in_constructor_arguments)); - return; - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors)); - } - } - }; - - PullTypeResolver.prototype.resolveSimplePropertyAssignment = function (propertyAssignment, isContextuallyTyped, context) { - return this.resolveAST(propertyAssignment.expression, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveFunctionPropertyAssignment = function (funcProp, isContextuallyTyped, context) { - return this.resolveAnyFunctionExpression(funcProp, funcProp.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcProp), funcProp.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.typeCheckFunctionPropertyAssignment = function (funcProp, isContextuallyTyped, context) { - this.typeCheckAnyFunctionExpression(funcProp, funcProp.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(funcProp.callSignature.parameterList), TypeScript.ASTHelpers.getType(funcProp), funcProp.block, null, isContextuallyTyped, context); - }; - - PullTypeResolver.prototype.resolveObjectLiteralExpression = function (expressionAST, isContextuallyTyped, context, additionalResults) { - var symbol = this.getSymbolForAST(expressionAST, context); - var hasResolvedSymbol = symbol && symbol.isResolved; - - if (!hasResolvedSymbol || additionalResults || this.canTypeCheckAST(expressionAST, context)) { - if (this.canTypeCheckAST(expressionAST, context)) { - this.setTypeChecked(expressionAST, context); - } - symbol = this.computeObjectLiteralExpression(expressionAST, isContextuallyTyped, context, additionalResults); - this.setSymbolForAST(expressionAST, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.bindObjectLiteralMembers = function (objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralMembers, isUsingExistingSymbol, pullTypeContext) { - var boundMemberSymbols = []; - var memberSymbol; - for (var i = 0, len = objectLiteralMembers.nonSeparatorCount(); i < len; i++) { - var propertyAssignment = objectLiteralMembers.nonSeparatorAt(i); - - var id = this.getPropertyAssignmentName(propertyAssignment); - var assignmentText = getPropertyAssignmentNameTextFromIdentifier(id); - - var isAccessor = propertyAssignment.kind() === 139 /* GetAccessor */ || propertyAssignment.kind() === 140 /* SetAccessor */; - var decl = this.semanticInfoChain.getDeclForAST(propertyAssignment); - TypeScript.Debug.assert(decl); - - if (propertyAssignment.kind() === 240 /* SimplePropertyAssignment */) { - if (!isUsingExistingSymbol) { - memberSymbol = new TypeScript.PullSymbol(assignmentText.memberName, 4096 /* Property */); - memberSymbol.addDeclaration(decl); - decl.setSymbol(memberSymbol); - } else { - memberSymbol = decl.getSymbol(); - } - } else if (propertyAssignment.kind() === 241 /* FunctionPropertyAssignment */) { - memberSymbol = decl.getSymbol(); - } else { - TypeScript.Debug.assert(isAccessor); - memberSymbol = decl.getSymbol(); - } - - if (!isUsingExistingSymbol && !isAccessor) { - var existingMember = objectLiteralTypeSymbol.findMember(memberSymbol.name, true); - if (existingMember) { - pullTypeContext.postDiagnostic(this.semanticInfoChain.duplicateIdentifierDiagnosticFromAST(propertyAssignment, assignmentText.actualText, existingMember.getDeclarations()[0].ast())); - } - - objectLiteralTypeSymbol.addMember(memberSymbol); - } - - boundMemberSymbols.push(memberSymbol); - } - - return boundMemberSymbols; - }; - - PullTypeResolver.prototype.resolveObjectLiteralMembers = function (objectLiteralDeclaration, objectLiteralTypeSymbol, objectLiteralContextualType, objectLiteralMembers, stringIndexerSignature, numericIndexerSignature, allMemberTypes, allNumericMemberTypes, boundMemberSymbols, isUsingExistingSymbol, pullTypeContext, additionalResults) { - for (var i = 0, len = objectLiteralMembers.nonSeparatorCount(); i < len; i++) { - var propertyAssignment = objectLiteralMembers.nonSeparatorAt(i); - - var acceptedContextualType = false; - var assigningSymbol = null; - - var id = this.getPropertyAssignmentName(propertyAssignment); - var memberSymbol = boundMemberSymbols[i]; - var contextualMemberType = null; - - if (objectLiteralContextualType) { - assigningSymbol = this.getNamedPropertySymbol(memberSymbol.name, 68147712 /* SomeValue */, objectLiteralContextualType); - - if (!assigningSymbol) { - if (numericIndexerSignature && TypeScript.PullHelpers.isNameNumeric(memberSymbol.name)) { - assigningSymbol = numericIndexerSignature; - } else if (stringIndexerSignature) { - assigningSymbol = stringIndexerSignature; - } - } - - if (assigningSymbol) { - this.resolveDeclaredSymbol(assigningSymbol, pullTypeContext); - - contextualMemberType = assigningSymbol.kind === 4194304 /* IndexSignature */ ? assigningSymbol.returnType : assigningSymbol.type; - pullTypeContext.propagateContextualType(contextualMemberType); - - acceptedContextualType = true; - - if (additionalResults) { - additionalResults.membersContextTypeSymbols[i] = contextualMemberType; - } - } - } - - var memberSymbolType = this.resolveAST(propertyAssignment, contextualMemberType !== null, pullTypeContext).type; - - if (memberSymbolType) { - if (memberSymbolType.isGeneric()) { - objectLiteralTypeSymbol.setHasGenericMember(); - } - - if (stringIndexerSignature) { - allMemberTypes.push(memberSymbolType); - } - if (numericIndexerSignature && TypeScript.PullHelpers.isNameNumeric(memberSymbol.name)) { - allNumericMemberTypes.push(memberSymbolType); - } - } - - if (acceptedContextualType) { - pullTypeContext.popAnyContextualType(); - } - - var isAccessor = propertyAssignment.kind() === 140 /* SetAccessor */ || propertyAssignment.kind() === 139 /* GetAccessor */; - if (!memberSymbol.isResolved) { - if (isAccessor) { - this.setSymbolForAST(id, memberSymbolType, pullTypeContext); - } else { - pullTypeContext.setTypeInContext(memberSymbol, memberSymbolType); - memberSymbol.setResolved(); - - this.setSymbolForAST(id, memberSymbol, pullTypeContext); - } - } - } - }; - - PullTypeResolver.prototype.computeObjectLiteralExpression = function (objectLitAST, isContextuallyTyped, context, additionalResults) { - var objectLitDecl = this.semanticInfoChain.getDeclForAST(objectLitAST); - TypeScript.Debug.assert(objectLitDecl); - - var typeSymbol = this.getSymbolForAST(objectLitAST, context); - var isUsingExistingSymbol = !!typeSymbol; - - if (!typeSymbol) { - typeSymbol = new TypeScript.PullTypeSymbol("", 256 /* ObjectLiteral */); - typeSymbol.addDeclaration(objectLitDecl); - this.setSymbolForAST(objectLitAST, typeSymbol, context); - objectLitDecl.setSymbol(typeSymbol); - } - - var propertyAssignments = objectLitAST.propertyAssignments; - var contextualType = null; - - if (isContextuallyTyped) { - contextualType = context.getContextualType(); - this.resolveDeclaredSymbol(contextualType, context); - } - - var stringIndexerSignature = null; - var numericIndexerSignature = null; - var allMemberTypes = null; - var allNumericMemberTypes = null; - - if (contextualType) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(contextualType, context); - - stringIndexerSignature = indexSignatures.stringSignature; - numericIndexerSignature = indexSignatures.numericSignature; - - var inInferentialTyping = context.isInferentiallyTyping(); - if (stringIndexerSignature) { - allMemberTypes = inInferentialTyping ? [] : [stringIndexerSignature.returnType]; - } - - if (numericIndexerSignature) { - allNumericMemberTypes = inInferentialTyping ? [] : [numericIndexerSignature.returnType]; - } - } - - if (propertyAssignments) { - if (additionalResults) { - additionalResults.membersContextTypeSymbols = []; - } - - var boundMemberSymbols = this.bindObjectLiteralMembers(objectLitDecl, typeSymbol, propertyAssignments, isUsingExistingSymbol, context); - - this.resolveObjectLiteralMembers(objectLitDecl, typeSymbol, contextualType, propertyAssignments, stringIndexerSignature, numericIndexerSignature, allMemberTypes, allNumericMemberTypes, boundMemberSymbols, isUsingExistingSymbol, context, additionalResults); - - if (!isUsingExistingSymbol) { - this.stampObjectLiteralWithIndexSignature(typeSymbol, allMemberTypes, stringIndexerSignature, context); - this.stampObjectLiteralWithIndexSignature(typeSymbol, allNumericMemberTypes, numericIndexerSignature, context); - } - } - - typeSymbol.setResolved(); - return typeSymbol; - }; - - PullTypeResolver.prototype.getPropertyAssignmentName = function (propertyAssignment) { - if (propertyAssignment.kind() === 240 /* SimplePropertyAssignment */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 241 /* FunctionPropertyAssignment */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 139 /* GetAccessor */) { - return propertyAssignment.propertyName; - } else if (propertyAssignment.kind() === 140 /* SetAccessor */) { - return propertyAssignment.propertyName; - } else { - TypeScript.Debug.assert(false); - } - }; - - PullTypeResolver.prototype.stampObjectLiteralWithIndexSignature = function (objectLiteralSymbol, indexerTypeCandidates, contextualIndexSignature, context) { - if (contextualIndexSignature) { - var typeCollection = { - getLength: function () { - return indexerTypeCandidates.length; - }, - getTypeAtIndex: function (index) { - return indexerTypeCandidates[index]; - } - }; - var decl = objectLiteralSymbol.getDeclarations()[0]; - var indexerReturnType = this.findBestCommonType(typeCollection, context).widenedType(this, null, context); - if (indexerReturnType === contextualIndexSignature.returnType) { - objectLiteralSymbol.addIndexSignature(contextualIndexSignature); - } else { - this.semanticInfoChain.addSyntheticIndexSignature(decl, objectLiteralSymbol, this.getASTForDecl(decl), contextualIndexSignature.parameters[0].name, contextualIndexSignature.parameters[0].type, indexerReturnType); - } - } - }; - - PullTypeResolver.prototype.resolveArrayLiteralExpression = function (arrayLit, isContextuallyTyped, context) { - var symbol = this.getSymbolForAST(arrayLit, context); - if (!symbol || this.canTypeCheckAST(arrayLit, context)) { - if (this.canTypeCheckAST(arrayLit, context)) { - this.setTypeChecked(arrayLit, context); - } - symbol = this.computeArrayLiteralExpressionSymbol(arrayLit, isContextuallyTyped, context); - this.setSymbolForAST(arrayLit, symbol, context); - } - - return symbol; - }; - - PullTypeResolver.prototype.computeArrayLiteralExpressionSymbol = function (arrayLit, isContextuallyTyped, context) { - var elements = arrayLit.expressions; - var elementType = null; - var elementTypes = []; - var comparisonInfo = new TypeComparisonInfo(); - var contextualElementType = null; - comparisonInfo.onlyCaptureFirstError = true; - - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - - this.resolveDeclaredSymbol(contextualType, context); - - if (contextualType) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(contextualType, context); - if (indexSignatures.numericSignature) { - contextualElementType = indexSignatures.numericSignature.returnType; - } - } - } - - if (elements) { - if (contextualElementType) { - context.propagateContextualType(contextualElementType); - } - - for (var i = 0, n = elements.nonSeparatorCount(); i < n; i++) { - elementTypes.push(this.resolveAST(elements.nonSeparatorAt(i), contextualElementType !== null, context).type); - } - - if (contextualElementType) { - context.popAnyContextualType(); - } - } - - if (elementTypes.length) { - elementType = elementTypes[0]; - } - var collection; - - if (contextualElementType && !context.isInferentiallyTyping()) { - if (!elementType) { - elementType = contextualElementType; - } - - collection = { - getLength: function () { - return elements.nonSeparatorCount() + 1; - }, - getTypeAtIndex: function (index) { - return index === 0 ? contextualElementType : elementTypes[index - 1]; - } - }; - } else { - collection = { - getLength: function () { - return elements.nonSeparatorCount(); - }, - getTypeAtIndex: function (index) { - return elementTypes[index]; - } - }; - } - - elementType = elementType ? this.findBestCommonType(collection, context, comparisonInfo) : elementType; - - if (!elementType) { - elementType = this.semanticInfoChain.undefinedTypeSymbol; - } - - return this.getArrayType(elementType); - }; - - PullTypeResolver.prototype.resolveElementAccessExpression = function (callEx, context) { - var symbolAndDiagnostic = this.computeElementAccessExpressionSymbolAndDiagnostic(callEx, context); - - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckElementAccessExpression(callEx, context, symbolAndDiagnostic); - } - - return symbolAndDiagnostic.symbol; - }; - - PullTypeResolver.prototype.typeCheckElementAccessExpression = function (callEx, context, symbolAndDiagnostic) { - this.setTypeChecked(callEx, context); - context.postDiagnostic(symbolAndDiagnostic.diagnostic); - }; - - PullTypeResolver.prototype.computeElementAccessExpressionSymbolAndDiagnostic = function (callEx, context) { - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var indexType = this.resolveAST(callEx.argumentExpression, false, context).type; - - var targetTypeSymbol = targetSymbol.type; - - targetTypeSymbol = this.getApparentType(targetTypeSymbol); - - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - return { symbol: targetTypeSymbol }; - } - - var elementType = targetTypeSymbol.getElementType(); - - var isNumberIndex = indexType === this.semanticInfoChain.numberTypeSymbol || TypeScript.PullHelpers.symbolIsEnum(indexType); - - if (elementType && isNumberIndex) { - return { symbol: elementType }; - } - - if (callEx.argumentExpression.kind() === 14 /* StringLiteral */ || callEx.argumentExpression.kind() === 13 /* NumericLiteral */) { - var memberName = callEx.argumentExpression.kind() === 14 /* StringLiteral */ ? TypeScript.stripStartAndEndQuotes(callEx.argumentExpression.text()) : callEx.argumentExpression.valueText(); - - var member = this._getNamedPropertySymbolOfAugmentedType(memberName, targetTypeSymbol); - - if (member) { - this.resolveDeclaredSymbol(member, context); - - return { symbol: member.type }; - } - } - - var signatures = this.getBothKindsOfIndexSignaturesIncludingAugmentedType(targetTypeSymbol, context); - - var stringSignature = signatures.stringSignature; - var numberSignature = signatures.numericSignature; - - if (numberSignature && (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol)) { - return { symbol: numberSignature.returnType || this.semanticInfoChain.anyTypeSymbol }; - } else if (stringSignature && (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol || indexType === this.semanticInfoChain.stringTypeSymbol)) { - return { symbol: stringSignature.returnType || this.semanticInfoChain.anyTypeSymbol }; - } else if (isNumberIndex || indexType === this.semanticInfoChain.anyTypeSymbol || indexType === this.semanticInfoChain.stringTypeSymbol) { - if (this.compilationSettings.noImplicitAny()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(callEx.argumentExpression, TypeScript.DiagnosticCode.Index_signature_of_object_type_implicitly_has_an_any_type)); - } - return { symbol: this.semanticInfoChain.anyTypeSymbol }; - } else { - return { - symbol: this.getNewErrorTypeSymbol(), - diagnostic: this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Value_of_type_0_is_not_indexable_by_type_1, [targetTypeSymbol.toString(), indexType.toString()]) - }; - } - }; - - PullTypeResolver.prototype.getBothKindsOfIndexSignaturesIncludingAugmentedType = function (enclosingType, context) { - return this._getBothKindsOfIndexSignatures(enclosingType, context, true); - }; - - PullTypeResolver.prototype.getBothKindsOfIndexSignaturesExcludingAugmentedType = function (enclosingType, context) { - return this._getBothKindsOfIndexSignatures(enclosingType, context, false); - }; - - PullTypeResolver.prototype._getBothKindsOfIndexSignatures = function (enclosingType, context, includeAugmentedType) { - var signatures = includeAugmentedType ? enclosingType.getIndexSignaturesOfAugmentedType(this, this.cachedFunctionInterfaceType(), this.cachedObjectInterfaceType()) : enclosingType.getIndexSignatures(); - - var stringSignature = null; - var numberSignature = null; - var signature = null; - var paramSymbols; - var paramType; - - for (var i = 0; i < signatures.length; i++) { - if (stringSignature && numberSignature) { - break; - } - - signature = signatures[i]; - if (!signature.isResolved) { - this.resolveDeclaredSymbol(signature, context); - } - - paramSymbols = signature.parameters; - - if (paramSymbols.length) { - paramType = paramSymbols[0].type; - - if (!stringSignature && paramType === this.semanticInfoChain.stringTypeSymbol) { - stringSignature = signature; - continue; - } else if (!numberSignature && paramType === this.semanticInfoChain.numberTypeSymbol) { - numberSignature = signature; - continue; - } - } - } - - return { - numericSignature: numberSignature, - stringSignature: stringSignature - }; - }; - - PullTypeResolver.prototype._addUnhiddenSignaturesFromBaseType = function (derivedTypeSignatures, baseTypeSignatures, signaturesBeingAggregated) { - var _this = this; - if (!derivedTypeSignatures) { - signaturesBeingAggregated.push.apply(signaturesBeingAggregated, baseTypeSignatures); - return; - } - - var context = new TypeScript.PullTypeResolutionContext(this); - for (var i = 0; i < baseTypeSignatures.length; i++) { - var baseSignature = baseTypeSignatures[i]; - - var signatureIsHidden = TypeScript.ArrayUtilities.any(derivedTypeSignatures, function (sig) { - return _this.signaturesAreIdenticalWithNewEnclosingTypes(baseSignature, sig, context, false); - }); - - if (!signatureIsHidden) { - signaturesBeingAggregated.push(baseSignature); - } - } - }; - - PullTypeResolver.prototype.resolveBinaryAdditionOperation = function (binaryExpression, context) { - var lhsExpression = this.resolveAST(binaryExpression.left, false, context); - var lhsType = lhsExpression.type; - var rhsType = this.resolveAST(binaryExpression.right, false, context).type; - - if (TypeScript.PullHelpers.symbolIsEnum(lhsType)) { - lhsType = this.semanticInfoChain.numberTypeSymbol; - } - - if (TypeScript.PullHelpers.symbolIsEnum(rhsType)) { - rhsType = this.semanticInfoChain.numberTypeSymbol; - } - - var isLhsTypeNullOrUndefined = lhsType === this.semanticInfoChain.nullTypeSymbol || lhsType === this.semanticInfoChain.undefinedTypeSymbol; - var isRhsTypeNullOrUndefined = rhsType === this.semanticInfoChain.nullTypeSymbol || rhsType === this.semanticInfoChain.undefinedTypeSymbol; - - if (isLhsTypeNullOrUndefined) { - if (isRhsTypeNullOrUndefined) { - lhsType = rhsType = this.semanticInfoChain.anyTypeSymbol; - } else { - lhsType = rhsType; - } - } else if (isRhsTypeNullOrUndefined) { - rhsType = lhsType; - } - - var exprType = null; - - if (lhsType === this.semanticInfoChain.stringTypeSymbol || rhsType === this.semanticInfoChain.stringTypeSymbol) { - exprType = this.semanticInfoChain.stringTypeSymbol; - } else if (this.isAnyOrEquivalent(lhsType) || this.isAnyOrEquivalent(rhsType)) { - exprType = this.semanticInfoChain.anyTypeSymbol; - } else if (rhsType === this.semanticInfoChain.numberTypeSymbol && lhsType === this.semanticInfoChain.numberTypeSymbol) { - exprType = this.semanticInfoChain.numberTypeSymbol; - } - - if (this.canTypeCheckAST(binaryExpression, context)) { - this.setTypeChecked(binaryExpression, context); - - if (exprType) { - if (binaryExpression.kind() === 175 /* AddAssignmentExpression */) { - if (!this.isReference(binaryExpression.left, lhsExpression)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } - - this.checkAssignability(binaryExpression.left, exprType, lhsType, context); - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_expression_types_not_known_to_support_the_addition_operator)); - } - } - - if (!exprType) { - exprType = this.semanticInfoChain.anyTypeSymbol; - } - - return exprType; - }; - - PullTypeResolver.prototype.bestCommonTypeOfTwoTypes = function (type1, type2, context) { - return this.findBestCommonType({ - getLength: function () { - return 2; - }, - getTypeAtIndex: function (index) { - switch (index) { - case 0: - return type1; - case 1: - return type2; - } - } - }, context); - }; - - PullTypeResolver.prototype.bestCommonTypeOfThreeTypes = function (type1, type2, type3, context) { - return this.findBestCommonType({ - getLength: function () { - return 3; - }, - getTypeAtIndex: function (index) { - switch (index) { - case 0: - return type1; - case 1: - return type2; - case 2: - return type3; - } - } - }, context); - }; - - PullTypeResolver.prototype.resolveLogicalOrExpression = function (binex, isContextuallyTyped, context) { - if (this.canTypeCheckAST(binex, context)) { - this.setTypeChecked(binex, context); - } - - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - var leftType = this.resolveAST(binex.left, isContextuallyTyped, context).type; - var rightType = this.resolveAST(binex.right, isContextuallyTyped, context).type; - - return context.isInferentiallyTyping() ? this.bestCommonTypeOfTwoTypes(leftType, rightType, context) : this.bestCommonTypeOfThreeTypes(contextualType, leftType, rightType, context); - } else { - var leftType = this.resolveAST(binex.left, false, context).type; - - context.pushNewContextualType(leftType); - var rightType = this.resolveAST(binex.right, true, context).type; - context.popAnyContextualType(); - - return this.bestCommonTypeOfTwoTypes(leftType, rightType, context); - } - }; - - PullTypeResolver.prototype.resolveLogicalAndExpression = function (binex, context) { - if (this.canTypeCheckAST(binex, context)) { - this.setTypeChecked(binex, context); - - this.resolveAST(binex.left, false, context); - } - - return this.resolveAST(binex.right, false, context).type; - }; - - PullTypeResolver.prototype.computeTypeOfConditionalExpression = function (leftType, rightType, isContextuallyTyped, context) { - if (isContextuallyTyped && !context.isInferentiallyTyping()) { - var contextualType = context.getContextualType(); - return this.bestCommonTypeOfThreeTypes(contextualType, leftType, rightType, context); - } else { - return this.bestCommonTypeOfTwoTypes(leftType, rightType, context); - } - }; - - PullTypeResolver.prototype.resolveConditionalExpression = function (trinex, isContextuallyTyped, context) { - var leftType = this.resolveAST(trinex.whenTrue, isContextuallyTyped, context).type; - var rightType = this.resolveAST(trinex.whenFalse, isContextuallyTyped, context).type; - - var expressionType = this.computeTypeOfConditionalExpression(leftType, rightType, isContextuallyTyped, context); - - var conditionalTypesAreValid = this.conditionExpressionTypesAreValid(leftType, rightType, expressionType, isContextuallyTyped, context); - - if (this.canTypeCheckAST(trinex, context)) { - this.setTypeChecked(trinex, context); - this.resolveAST(trinex.condition, false, context); - - if (!this.conditionExpressionTypesAreValid(leftType, rightType, expressionType, isContextuallyTyped, context)) { - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(trinex, TypeScript.DiagnosticCode.Type_of_conditional_0_must_be_identical_to_1_2_or_3, [expressionType.toString(), leftType.toString(), rightType.toString(), contextualType.toString()])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(trinex, TypeScript.DiagnosticCode.Type_of_conditional_0_must_be_identical_to_1_or_2, [expressionType.toString(), leftType.toString(), rightType.toString()])); - } - } - } - - if (!conditionalTypesAreValid) { - return this.getNewErrorTypeSymbol(); - } - - return expressionType; - }; - - PullTypeResolver.prototype.conditionExpressionTypesAreValid = function (leftType, rightType, expressionType, isContextuallyTyped, context) { - if (isContextuallyTyped) { - var contextualType = context.getContextualType(); - if (this.typesAreIdentical(expressionType, leftType, context) || this.typesAreIdentical(expressionType, rightType, context) || this.typesAreIdentical(expressionType, contextualType, context)) { - return true; - } - } else { - if (this.typesAreIdentical(expressionType, leftType, context) || this.typesAreIdentical(expressionType, rightType, context)) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.resolveParenthesizedExpression = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - } - - return this.resolveAST(ast.expression, false, context); - }; - - PullTypeResolver.prototype.resolveExpressionStatement = function (ast, context) { - if (this.canTypeCheckAST(ast, context)) { - this.setTypeChecked(ast, context); - - this.resolveAST(ast.expression, false, context); - } - - return this.semanticInfoChain.voidTypeSymbol; - }; - - PullTypeResolver.prototype.resolveInvocationExpression = function (callEx, context, additionalResults) { - var symbol = this.getSymbolForAST(callEx, context); - - if (!symbol || !symbol.isResolved) { - if (!additionalResults) { - additionalResults = new PullAdditionalCallResolutionData(); - } - symbol = this.computeInvocationExpressionSymbol(callEx, context, additionalResults); - if (this.canTypeCheckAST(callEx, context)) { - this.setTypeChecked(callEx, context); - } - if (symbol !== this.semanticInfoChain.anyTypeSymbol) { - this.setSymbolForAST(callEx, symbol, context); - } - this.semanticInfoChain.setCallResolutionDataForAST(callEx, additionalResults); - } else { - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckInvocationExpression(callEx, context); - } - - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (additionalResults && (callResolutionData !== additionalResults)) { - additionalResults.actualParametersContextTypeSymbols = callResolutionData.actualParametersContextTypeSymbols; - additionalResults.candidateSignature = callResolutionData.candidateSignature; - additionalResults.resolvedSignatures = callResolutionData.resolvedSignatures; - additionalResults.targetSymbol = callResolutionData.targetSymbol; - } - } - - return symbol; - }; - - PullTypeResolver.prototype.typeCheckInvocationExpression = function (callEx, context) { - this.setTypeChecked(callEx, context); - var targetSymbol = this.resolveAST(callEx.expression, false, context); - - if (callEx.argumentList.arguments) { - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - - var len = callEx.argumentList.arguments.nonSeparatorCount(); - for (var i = 0; i < len; i++) { - var contextualType = callResolutionData.actualParametersContextTypeSymbols ? callResolutionData.actualParametersContextTypeSymbols[i] : null; - if (contextualType) { - context.pushNewContextualType(contextualType); - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - for (var i = 0; i < callResolutionData.diagnosticsFromOverloadResolution.length; i++) { - context.postDiagnostic(callResolutionData.diagnosticsFromOverloadResolution[i]); - } - }; - - PullTypeResolver.prototype.computeInvocationExpressionSymbol = function (callEx, context, additionalResults) { - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var targetAST = this.getCallTargetErrorSpanAST(callEx); - - var targetTypeSymbol = targetSymbol.type; - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - this.resolveAST(callEx.argumentList.arguments, false, context); - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - if (targetTypeSymbol === this.semanticInfoChain.anyTypeSymbol) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Untyped_function_calls_may_not_accept_type_arguments), additionalResults, context); - return this.getNewErrorTypeSymbol(); - } - } - - return this.semanticInfoChain.anyTypeSymbol; - } - - var isSuperCall = false; - - if (callEx.expression.kind() === 50 /* SuperKeyword */) { - isSuperCall = true; - - if (targetTypeSymbol.isClass()) { - targetSymbol = targetTypeSymbol.getConstructorMethod(); - this.resolveDeclaredSymbol(targetSymbol, context); - targetTypeSymbol = targetSymbol.type; - } else { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Calls_to_super_are_only_valid_inside_a_class), additionalResults, context); - this.resolveAST(callEx.argumentList.arguments, false, context); - - return this.getNewErrorTypeSymbol(); - } - } - - var signatures = isSuperCall ? targetTypeSymbol.getConstructSignatures() : targetTypeSymbol.getCallSignatures(); - - if (!signatures.length && (targetTypeSymbol.kind === 33554432 /* ConstructorType */)) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, [targetTypeSymbol.toString()]), additionalResults, context); - } - - var explicitTypeArgs = null; - var couldNotFindGenericOverload = false; - var couldNotAssignToConstraint; - var constraintDiagnostic = null; - var typeArgumentCountDiagnostic = null; - var diagnostics = []; - - if (callEx.argumentList.typeArgumentList) { - explicitTypeArgs = []; - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - explicitTypeArgs[i] = this.resolveTypeReference(callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - } - } - } - - var triedToInferTypeArgs = false; - - var resolvedSignatures = []; - var inferredOrExplicitTypeArgs; - var specializedSignature; - var typeParameters; - var typeConstraint = null; - var beforeResolutionSignatures = signatures; - var targetTypeReplacementMap = targetTypeSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < signatures.length; i++) { - typeParameters = signatures[i].getTypeParameters(); - couldNotAssignToConstraint = false; - - if (signatures[i].isGeneric() && typeParameters.length) { - if (isSuperCall && targetTypeSymbol.isGeneric() && !callEx.argumentList.typeArgumentList) { - explicitTypeArgs = signatures[i].returnType.getTypeArguments(); - } - - if (explicitTypeArgs) { - if (explicitTypeArgs.length === typeParameters.length) { - inferredOrExplicitTypeArgs = explicitTypeArgs; - } else { - typeArgumentCountDiagnostic = typeArgumentCountDiagnostic || this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [typeParameters.length, explicitTypeArgs.length]); - continue; - } - } else { - TypeScript.Debug.assert(callEx.argumentList); - var typeArgumentInferenceContext = new TypeScript.InvocationTypeArgumentInferenceContext(this, context, signatures[i], callEx.argumentList.arguments); - inferredOrExplicitTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - triedToInferTypeArgs = true; - } - - TypeScript.Debug.assert(inferredOrExplicitTypeArgs && inferredOrExplicitTypeArgs.length == typeParameters.length); - - var mutableTypeReplacementMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(targetTypeReplacementMap ? targetTypeReplacementMap : []); - TypeScript.PullInstantiationHelpers.updateMutableTypeParameterArgumentMap(typeParameters, inferredOrExplicitTypeArgs, mutableTypeReplacementMap); - var typeReplacementMap = mutableTypeReplacementMap.typeParameterArgumentMap; - - if (explicitTypeArgs) { - for (var j = 0; j < typeParameters.length; j++) { - typeConstraint = typeParameters[j].getConstraint(); - - if (typeConstraint) { - if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeReplacementMap); - } - - if (!this.sourceIsAssignableToTarget(inferredOrExplicitTypeArgs[j], typeConstraint, targetAST, context, null, true)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(targetAST); - constraintDiagnostic = this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [inferredOrExplicitTypeArgs[j].toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[j].toString(enclosingSymbol, true)]); - couldNotAssignToConstraint = true; - } - - if (couldNotAssignToConstraint) { - break; - } - } - } - } - - if (couldNotAssignToConstraint) { - continue; - } - - specializedSignature = this.instantiateSignature(signatures[i], typeReplacementMap); - - if (specializedSignature) { - resolvedSignatures[resolvedSignatures.length] = specializedSignature; - } - } else { - if (!(callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount())) { - resolvedSignatures[resolvedSignatures.length] = signatures[i]; - } - } - } - - if (signatures.length && !resolvedSignatures.length) { - couldNotFindGenericOverload = true; - } - - signatures = resolvedSignatures; - - var errorCondition = null; - if (!signatures.length) { - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = beforeResolutionSignatures; - additionalResults.candidateSignature = beforeResolutionSignatures && beforeResolutionSignatures.length ? beforeResolutionSignatures[0] : null; - - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - this.resolveAST(callEx.argumentList.arguments, false, context); - - if (!couldNotFindGenericOverload) { - if (this.cachedFunctionInterfaceType() && this.sourceIsAssignableToTarget(targetTypeSymbol, this.cachedFunctionInterfaceType(), targetAST, context)) { - if (callEx.argumentList.typeArgumentList) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Non_generic_functions_may_not_accept_type_arguments), additionalResults, context); - } - return this.semanticInfoChain.anyTypeSymbol; - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature), additionalResults, context); - } else if (constraintDiagnostic) { - this.postOverloadResolutionDiagnostics(constraintDiagnostic, additionalResults, context); - } else if (typeArgumentCountDiagnostic) { - this.postOverloadResolutionDiagnostics(typeArgumentCountDiagnostic, additionalResults, context); - } else { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.Could_not_select_overload_for_call_expression), additionalResults, context); - } - - return this.getNewErrorTypeSymbol(); - } - - var signature = this.resolveOverloads(callEx, signatures, callEx.argumentList.typeArgumentList !== null, context, diagnostics); - var useBeforeResolutionSignatures = signature == null; - - if (!signature) { - for (var i = 0; i < diagnostics.length; i++) { - this.postOverloadResolutionDiagnostics(diagnostics[i], additionalResults, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Could_not_select_overload_for_call_expression), additionalResults, context); - - errorCondition = this.getNewErrorTypeSymbol(); - - if (!signatures.length) { - return errorCondition; - } - - signature = signatures[0]; - } - - var rootSignature = signature.getRootSymbol(); - if (!rootSignature.isGeneric() && callEx.argumentList.typeArgumentList) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Non_generic_functions_may_not_accept_type_arguments), additionalResults, context); - } else if (rootSignature.isGeneric() && callEx.argumentList.typeArgumentList && rootSignature.getTypeParameters() && (callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount() !== rootSignature.getTypeParameters().length)) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [rootSignature.getTypeParameters().length, callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()]), additionalResults, context); - } - - var returnType = isSuperCall ? this.semanticInfoChain.voidTypeSymbol : signature.returnType; - - var actualParametersContextTypeSymbols = []; - if (callEx.argumentList.arguments) { - var len = callEx.argumentList.arguments.nonSeparatorCount(); - var params = signature.parameters; - var contextualType = null; - var signatureDecl = signature.getDeclarations()[0]; - - for (var i = 0; i < len; i++) { - if (params.length) { - if (i < params.length - 1 || (i < params.length && !signature.hasVarArgs)) { - this.resolveDeclaredSymbol(params[i], context); - contextualType = params[i].type; - } else if (signature.hasVarArgs) { - contextualType = params[params.length - 1].type; - if (contextualType.isArrayNamedTypeReference()) { - contextualType = contextualType.getElementType(); - } - } - } - - if (contextualType) { - context.pushNewContextualType(contextualType); - actualParametersContextTypeSymbols[i] = contextualType; - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - additionalResults.targetSymbol = targetSymbol; - if (useBeforeResolutionSignatures && beforeResolutionSignatures) { - additionalResults.resolvedSignatures = beforeResolutionSignatures; - additionalResults.candidateSignature = beforeResolutionSignatures[0]; - } else { - additionalResults.resolvedSignatures = signatures; - additionalResults.candidateSignature = signature; - } - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - if (errorCondition) { - return errorCondition; - } - - if (!returnType) { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - - return returnType; - }; - - PullTypeResolver.prototype.resolveObjectCreationExpression = function (callEx, context, additionalResults) { - var symbol = this.getSymbolForAST(callEx, context); - - if (!symbol || !symbol.isResolved) { - if (!additionalResults) { - additionalResults = new PullAdditionalCallResolutionData(); - } - symbol = this.computeObjectCreationExpressionSymbol(callEx, context, additionalResults); - if (this.canTypeCheckAST(callEx, context)) { - this.setTypeChecked(callEx, context); - } - this.setSymbolForAST(callEx, symbol, context); - this.semanticInfoChain.setCallResolutionDataForAST(callEx, additionalResults); - } else { - if (this.canTypeCheckAST(callEx, context)) { - this.typeCheckObjectCreationExpression(callEx, context); - } - - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (additionalResults && (callResolutionData !== additionalResults)) { - additionalResults.actualParametersContextTypeSymbols = callResolutionData.actualParametersContextTypeSymbols; - additionalResults.candidateSignature = callResolutionData.candidateSignature; - additionalResults.resolvedSignatures = callResolutionData.resolvedSignatures; - additionalResults.targetSymbol = callResolutionData.targetSymbol; - } - } - - return symbol; - }; - - PullTypeResolver.prototype.typeCheckObjectCreationExpression = function (callEx, context) { - this.setTypeChecked(callEx, context); - this.resolveAST(callEx.expression, false, context); - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - if (callEx.argumentList) { - var callResolutionData = this.semanticInfoChain.getCallResolutionDataForAST(callEx); - var len = callEx.argumentList.arguments.nonSeparatorCount(); - - for (var i = 0; i < len; i++) { - var contextualType = callResolutionData.actualParametersContextTypeSymbols ? callResolutionData.actualParametersContextTypeSymbols[i] : null; - if (contextualType) { - context.pushNewContextualType(contextualType); - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - for (var i = 0; i < callResolutionData.diagnosticsFromOverloadResolution.length; i++) { - context.postDiagnostic(callResolutionData.diagnosticsFromOverloadResolution[i]); - } - }; - - PullTypeResolver.prototype.postOverloadResolutionDiagnostics = function (diagnostic, additionalResults, context) { - if (!context.inProvisionalResolution()) { - additionalResults.diagnosticsFromOverloadResolution.push(diagnostic); - } - context.postDiagnostic(diagnostic); - }; - - PullTypeResolver.prototype.computeObjectCreationExpressionSymbol = function (callEx, context, additionalResults) { - var _this = this; - var returnType = null; - - var targetSymbol = this.resolveAST(callEx.expression, false, context); - var targetTypeSymbol = targetSymbol.isType() ? targetSymbol : targetSymbol.type; - - var targetAST = this.getCallTargetErrorSpanAST(callEx); - - var constructSignatures = targetTypeSymbol.getConstructSignatures(); - - var explicitTypeArgs = null; - var usedCallSignaturesInstead = false; - var couldNotAssignToConstraint; - var constraintDiagnostic = null; - var typeArgumentCountDiagnostic = null; - var diagnostics = []; - - if (this.isAnyOrEquivalent(targetTypeSymbol)) { - if (callEx.argumentList) { - this.resolveAST(callEx.argumentList.arguments, false, context); - } - - return targetTypeSymbol; - } - - if (!constructSignatures.length) { - constructSignatures = targetTypeSymbol.getCallSignatures(); - usedCallSignaturesInstead = true; - - if (this.compilationSettings.noImplicitAny()) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(callEx, TypeScript.DiagnosticCode.new_expression_which_lacks_a_constructor_signature_implicitly_has_an_any_type), additionalResults, context); - } - } - - if (constructSignatures.length) { - if (callEx.argumentList && callEx.argumentList.typeArgumentList) { - explicitTypeArgs = []; - - if (callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount()) { - for (var i = 0; i < callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount(); i++) { - explicitTypeArgs[i] = this.resolveTypeReference(callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorAt(i), context); - } - } - } - - if (targetTypeSymbol.isGeneric()) { - var resolvedSignatures = []; - var inferredOrExplicitTypeArgs; - var specializedSignature; - var typeParameters; - var typeConstraint = null; - var triedToInferTypeArgs; - var targetTypeReplacementMap = targetTypeSymbol.getTypeParameterArgumentMap(); - - for (var i = 0; i < constructSignatures.length; i++) { - couldNotAssignToConstraint = false; - - if (constructSignatures[i].isGeneric()) { - typeParameters = constructSignatures[i].getTypeParameters(); - - if (explicitTypeArgs) { - if (explicitTypeArgs.length === typeParameters.length) { - inferredOrExplicitTypeArgs = explicitTypeArgs; - } else { - typeArgumentCountDiagnostic = typeArgumentCountDiagnostic || this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Signature_expected_0_type_arguments_got_1_instead, [typeParameters.length, explicitTypeArgs.length]); - continue; - } - } else if (callEx.argumentList) { - var typeArgumentInferenceContext = new TypeScript.InvocationTypeArgumentInferenceContext(this, context, constructSignatures[i], callEx.argumentList.arguments); - inferredOrExplicitTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - triedToInferTypeArgs = true; - } else { - inferredOrExplicitTypeArgs = TypeScript.ArrayUtilities.select(typeParameters, function (typeParameter) { - return typeParameter.getDefaultConstraint(_this.semanticInfoChain); - }); - } - - TypeScript.Debug.assert(inferredOrExplicitTypeArgs && inferredOrExplicitTypeArgs.length == typeParameters.length); - - var mutableTypeReplacementMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(targetTypeReplacementMap ? targetTypeReplacementMap : []); - TypeScript.PullInstantiationHelpers.updateMutableTypeParameterArgumentMap(typeParameters, inferredOrExplicitTypeArgs, mutableTypeReplacementMap); - var typeReplacementMap = mutableTypeReplacementMap.typeParameterArgumentMap; - - if (explicitTypeArgs) { - for (var j = 0; j < typeParameters.length; j++) { - typeConstraint = typeParameters[j].getConstraint(); - - if (typeConstraint) { - if (typeConstraint.isGeneric()) { - typeConstraint = this.instantiateType(typeConstraint, typeReplacementMap); - } - - if (!this.sourceIsAssignableToTarget(inferredOrExplicitTypeArgs[j], typeConstraint, targetAST, context, null, true)) { - var enclosingSymbol = this.getEnclosingSymbolForAST(targetAST); - constraintDiagnostic = this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Type_0_does_not_satisfy_the_constraint_1_for_type_parameter_2, [inferredOrExplicitTypeArgs[j].toString(enclosingSymbol, true), typeConstraint.toString(enclosingSymbol, true), typeParameters[j].toString(enclosingSymbol, true)]); - couldNotAssignToConstraint = true; - } - - if (couldNotAssignToConstraint) { - break; - } - } - } - } - - if (couldNotAssignToConstraint) { - continue; - } - - specializedSignature = this.instantiateSignature(constructSignatures[i], typeReplacementMap); - - if (specializedSignature) { - resolvedSignatures[resolvedSignatures.length] = specializedSignature; - } - } else { - if (!(callEx.argumentList && callEx.argumentList.typeArgumentList && callEx.argumentList.typeArgumentList.typeArguments.nonSeparatorCount())) { - resolvedSignatures[resolvedSignatures.length] = constructSignatures[i]; - } - } - } - - constructSignatures = resolvedSignatures; - } - - var signature = this.resolveOverloads(callEx, constructSignatures, callEx.argumentList && callEx.argumentList.typeArgumentList !== null, context, diagnostics); - - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = constructSignatures; - additionalResults.candidateSignature = signature; - additionalResults.actualParametersContextTypeSymbols = []; - - if (!constructSignatures.length) { - if (constraintDiagnostic) { - this.postOverloadResolutionDiagnostics(constraintDiagnostic, additionalResults, context); - } else if (typeArgumentCountDiagnostic) { - this.postOverloadResolutionDiagnostics(typeArgumentCountDiagnostic, additionalResults, context); - } - - return this.getNewErrorTypeSymbol(); - } - - var errorCondition = null; - - if (!signature) { - for (var i = 0; i < diagnostics.length; i++) { - this.postOverloadResolutionDiagnostics(diagnostics[i], additionalResults, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Could_not_select_overload_for_new_expression), additionalResults, context); - - errorCondition = this.getNewErrorTypeSymbol(); - - if (!constructSignatures.length) { - return errorCondition; - } - - signature = constructSignatures[0]; - } - - returnType = signature.returnType; - - if (returnType && !signature.isGeneric() && returnType.isGeneric() && !returnType.getIsSpecialized()) { - if (explicitTypeArgs && explicitTypeArgs.length) { - returnType = this.createInstantiatedType(returnType, explicitTypeArgs); - } else { - returnType = this.instantiateTypeToAny(returnType, context); - } - } - - if (usedCallSignaturesInstead) { - if (returnType !== this.semanticInfoChain.voidTypeSymbol) { - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Call_signatures_used_in_a_new_expression_must_have_a_void_return_type), additionalResults, context); - - return this.getNewErrorTypeSymbol(); - } else { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - } - - if (!returnType) { - returnType = signature.returnType; - - if (!returnType) { - returnType = targetTypeSymbol; - } - } - - var actualParametersContextTypeSymbols = []; - if (callEx.argumentList && callEx.argumentList.arguments) { - var len = callEx.argumentList.arguments.nonSeparatorCount(); - var params = signature.parameters; - var contextualType = null; - var signatureDecl = signature.getDeclarations()[0]; - - for (var i = 0; i < len; i++) { - if (params.length) { - if (i < params.length - 1 || (i < params.length && !signature.hasVarArgs)) { - this.resolveDeclaredSymbol(params[i], context); - contextualType = params[i].type; - } else if (signature.hasVarArgs) { - contextualType = params[params.length - 1].type; - if (contextualType.isArrayNamedTypeReference()) { - contextualType = contextualType.getElementType(); - } - } - } - - if (contextualType) { - context.pushNewContextualType(contextualType); - actualParametersContextTypeSymbols[i] = contextualType; - } - - this.resolveAST(callEx.argumentList.arguments.nonSeparatorAt(i), contextualType !== null, context); - - if (contextualType) { - context.popAnyContextualType(); - contextualType = null; - } - } - } - - additionalResults.targetSymbol = targetSymbol; - additionalResults.resolvedSignatures = constructSignatures; - additionalResults.candidateSignature = signature; - additionalResults.actualParametersContextTypeSymbols = actualParametersContextTypeSymbols; - - if (errorCondition) { - return errorCondition; - } - - if (!returnType) { - returnType = this.semanticInfoChain.anyTypeSymbol; - } - - return returnType; - } else if (callEx.argumentList) { - this.resolveAST(callEx.argumentList.arguments, false, context); - } - - this.postOverloadResolutionDiagnostics(this.semanticInfoChain.diagnosticFromAST(targetAST, TypeScript.DiagnosticCode.Invalid_new_expression), additionalResults, context); - - return this.getNewErrorTypeSymbol(); - }; - - PullTypeResolver.prototype.instantiateSignatureInContext = function (signatureAToInstantiate, contextualSignatureB, context, shouldFixContextualSignatureParameterTypes) { - var typeReplacementMap = []; - var inferredTypeArgs; - var specializedSignature; - var typeParameters = signatureAToInstantiate.getTypeParameters(); - var typeConstraint = null; - - var typeArgumentInferenceContext = new TypeScript.ContextualSignatureInstantiationTypeArgumentInferenceContext(this, context, signatureAToInstantiate, contextualSignatureB, shouldFixContextualSignatureParameterTypes); - inferredTypeArgs = this.inferArgumentTypesForSignature(typeArgumentInferenceContext, new TypeComparisonInfo(), context); - - var functionTypeA = signatureAToInstantiate.functionType; - var functionTypeB = contextualSignatureB.functionType; - var enclosingTypeParameterMap; - - if (functionTypeA) { - enclosingTypeParameterMap = functionTypeA.getTypeParameterArgumentMap(); - - for (var id in enclosingTypeParameterMap) { - typeReplacementMap[id] = enclosingTypeParameterMap[id]; - } - } - - if (functionTypeB) { - enclosingTypeParameterMap = functionTypeB.getTypeParameterArgumentMap(); - - for (var id in enclosingTypeParameterMap) { - typeReplacementMap[id] = enclosingTypeParameterMap[id]; - } - } - - TypeScript.PullInstantiationHelpers.updateTypeParameterArgumentMap(typeParameters, inferredTypeArgs, typeReplacementMap); - - return this.instantiateSignature(signatureAToInstantiate, typeReplacementMap); - }; - - PullTypeResolver.prototype.resolveCastExpression = function (assertionExpression, context) { - var typeAssertionType = this.resolveTypeReference(assertionExpression.type, context).type; - - if (this.canTypeCheckAST(assertionExpression, context)) { - this.typeCheckCastExpression(assertionExpression, context, typeAssertionType); - } - - return typeAssertionType; - }; - - PullTypeResolver.prototype.typeCheckCastExpression = function (assertionExpression, context, typeAssertionType) { - this.setTypeChecked(assertionExpression, context); - - context.pushNewContextualType(typeAssertionType); - var exprType = this.resolveAST(assertionExpression.expression, true, context).type; - context.popAnyContextualType(); - - this.resolveDeclaredSymbol(typeAssertionType, context); - this.resolveDeclaredSymbol(exprType, context); - - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(exprType, typeAssertionType, assertionExpression, context, comparisonInfo); - - if (!isAssignable) { - var widenedExprType = exprType.widenedType(this, assertionExpression.expression, context); - isAssignable = this.sourceIsAssignableToTarget(typeAssertionType, widenedExprType, assertionExpression, context, comparisonInfo); - } - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(assertionExpression); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(assertionExpression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [exprType.toString(enclosingSymbol), typeAssertionType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(assertionExpression, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [exprType.toString(enclosingSymbol), typeAssertionType.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.resolveAssignmentExpression = function (binaryExpression, context) { - var leftExpr = this.resolveAST(binaryExpression.left, false, context); - var leftType = leftExpr.type; - - context.pushNewContextualType(leftType); - var rightType = this.resolveAST(binaryExpression.right, true, context).type; - context.popAnyContextualType(); - - rightType = this.getInstanceTypeForAssignment(binaryExpression.left, rightType, context); - - if (this.canTypeCheckAST(binaryExpression, context)) { - this.setTypeChecked(binaryExpression, context); - - if (!this.isReference(binaryExpression.left, leftExpr)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(binaryExpression.left, TypeScript.DiagnosticCode.Invalid_left_hand_side_of_assignment_expression)); - } else { - this.checkAssignability(binaryExpression.left, rightType, leftExpr.type, context); - } - } - - return rightType; - }; - - PullTypeResolver.prototype.getInstanceTypeForAssignment = function (lhs, type, context) { - var typeToReturn = type; - if (typeToReturn && typeToReturn.isAlias()) { - typeToReturn = typeToReturn.getExportAssignedTypeSymbol(); - } - - if (typeToReturn && typeToReturn.isContainer() && !typeToReturn.isEnum()) { - var instanceTypeSymbol = typeToReturn.getInstanceType(); - - if (!instanceTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(lhs, TypeScript.DiagnosticCode.Tried_to_set_variable_type_to_uninitialized_module_type_0, [type.toString()])); - typeToReturn = null; - } else { - typeToReturn = instanceTypeSymbol; - } - } - - return typeToReturn; - }; - - PullTypeResolver.prototype.widenType = function (type, ast, context) { - if (type === this.semanticInfoChain.undefinedTypeSymbol || type === this.semanticInfoChain.nullTypeSymbol || type.isError()) { - return this.semanticInfoChain.anyTypeSymbol; - } - - if (type.isArrayNamedTypeReference()) { - return this.widenArrayType(type, ast, context); - } else if (type.kind === 256 /* ObjectLiteral */) { - return this.widenObjectLiteralType(type, ast, context); - } - - return type; - }; - - PullTypeResolver.prototype.widenArrayType = function (type, ast, context) { - var elementType = type.getElementType().widenedType(this, ast, context); - - if (this.compilationSettings.noImplicitAny() && ast) { - if (elementType === this.semanticInfoChain.anyTypeSymbol && type.getElementType() !== this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Array_Literal_implicitly_has_an_any_type_from_widening)); - } - } - - return this.getArrayType(elementType); - }; - - PullTypeResolver.prototype.widenObjectLiteralType = function (type, ast, context) { - if (!this.needsToWidenObjectLiteralType(type, ast, context)) { - return type; - } - - TypeScript.Debug.assert(type.name === ""); - var newObjectTypeSymbol = new TypeScript.PullTypeSymbol(type.name, type.kind); - var declsOfObjectType = type.getDeclarations(); - TypeScript.Debug.assert(declsOfObjectType.length === 1); - newObjectTypeSymbol.addDeclaration(declsOfObjectType[0]); - var members = type.getMembers(); - - for (var i = 0; i < members.length; i++) { - var memberType = members[i].type; - - var widenedMemberType = members[i].type.widenedType(this, ast, context); - var newMember = new TypeScript.PullSymbol(members[i].name, members[i].kind); - - var declsOfMember = members[i].getDeclarations(); - - newMember.addDeclaration(declsOfMember[0]); - newMember.type = widenedMemberType; - newObjectTypeSymbol.addMember(newMember); - newMember.setResolved(); - - if (this.compilationSettings.noImplicitAny() && ast && widenedMemberType === this.semanticInfoChain.anyTypeSymbol && memberType !== this.semanticInfoChain.anyTypeSymbol) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Object_literal_s_property_0_implicitly_has_an_any_type_from_widening, [members[i].name])); - } - } - - var indexers = type.getIndexSignatures(); - for (var i = 0; i < indexers.length; i++) { - var newIndexer = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - var parameter = indexers[i].parameters[0]; - var newParameter = new TypeScript.PullSymbol(parameter.name, parameter.kind); - newParameter.type = parameter.type; - newIndexer.addParameter(newParameter); - newIndexer.returnType = indexers[i].returnType; - newObjectTypeSymbol.addIndexSignature(newIndexer); - } - - return newObjectTypeSymbol; - }; - - PullTypeResolver.prototype.needsToWidenObjectLiteralType = function (type, ast, context) { - var members = type.getMembers(); - for (var i = 0; i < members.length; i++) { - var memberType = members[i].type; - if (memberType !== memberType.widenedType(this, ast, context)) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.findBestCommonType = function (collection, context, comparisonInfo) { - var len = collection.getLength(); - - for (var i = 0; i < len; i++) { - var candidateType = collection.getTypeAtIndex(i); - if (this.typeIsBestCommonTypeCandidate(candidateType, collection, context)) { - return candidateType; - } - } - - return this.semanticInfoChain.emptyTypeSymbol; - }; - - PullTypeResolver.prototype.typeIsBestCommonTypeCandidate = function (candidateType, collection, context) { - for (var i = 0; i < collection.getLength(); i++) { - var otherType = collection.getTypeAtIndex(i); - if (candidateType === otherType) { - continue; - } - - if (!this.sourceIsSubtypeOfTarget(otherType, candidateType, null, context)) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.typesAreIdenticalInEnclosingTypes = function (t1, t2, context) { - t1 = this.getSymbolForRelationshipCheck(t1); - t2 = this.getSymbolForRelationshipCheck(t2); - - if (t1 === t2) { - return true; - } - - if (t1 && t2) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - return this.infinitelyExpandingTypesAreIdentical(t1, t2, context); - } - } - - return this.typesAreIdentical(t1, t2, context); - }; - - PullTypeResolver.prototype.typesAreIdenticalWithNewEnclosingTypes = function (t1, t2, context) { - var enclosingTypeWalkers = context.resetEnclosingTypeWalkers(); - var areTypesIdentical = this.typesAreIdentical(t1, t2, context); - context.setEnclosingTypeWalkers(enclosingTypeWalkers); - return areTypesIdentical; - }; - - PullTypeResolver.prototype.typesAreIdentical = function (t1, t2, context) { - t1 = this.getSymbolForRelationshipCheck(t1); - t2 = this.getSymbolForRelationshipCheck(t2); - - if (t1 === t2) { - return true; - } - - if (!t1 || !t2) { - return false; - } - - if (TypeScript.hasFlag(t1.kind, 64 /* Enum */) || TypeScript.hasFlag(t2.kind, 64 /* Enum */)) { - return false; - } - - if (t1.isPrimitive() && t1.isStringConstant() && t2.isPrimitive() && t2.isStringConstant()) { - return TypeScript.stripStartAndEndQuotes(t1.name) === TypeScript.stripStartAndEndQuotes(t2.name); - } - - if (t1.isPrimitive() || t2.isPrimitive()) { - return false; - } - - if (t1.isError() && t2.isError()) { - return true; - } - - var isIdentical = this.identicalCache.valueAt(t1.pullSymbolID, t2.pullSymbolID); - if (isIdentical != undefined) { - return isIdentical; - } - - if (t1.isTypeParameter() !== t2.isTypeParameter()) { - return false; - } else if (t1.isTypeParameter()) { - var t1ParentDeclaration = t1.getDeclarations()[0].getParentDecl(); - var t2ParentDeclaration = t2.getDeclarations()[0].getParentDecl(); - - if (t1ParentDeclaration === t2ParentDeclaration) { - return this.symbolsShareDeclaration(t1, t2); - } else { - return false; - } - } - - if (t1.isPrimitive() !== t2.isPrimitive()) { - return false; - } - - this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, true); - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(t1, t2); - isIdentical = this.typesAreIdenticalWorker(t1, t2, context); - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - this.identicalCache.setValueAt(t1.pullSymbolID, t2.pullSymbolID, isIdentical); - - return isIdentical; - }; - - PullTypeResolver.prototype.typesAreIdenticalWorker = function (t1, t2, context) { - if (t1.getIsSpecialized() && t2.getIsSpecialized()) { - if (TypeScript.PullHelpers.getRootType(t1) === TypeScript.PullHelpers.getRootType(t2) && TypeScript.PullHelpers.getRootType(t1).isNamedTypeSymbol()) { - var t1TypeArguments = t1.getTypeArguments(); - var t2TypeArguments = t2.getTypeArguments(); - - if (t1TypeArguments && t2TypeArguments) { - for (var i = 0; i < t1TypeArguments.length; i++) { - if (!this.typesAreIdenticalWithNewEnclosingTypes(t1TypeArguments[i], t2TypeArguments[i], context)) { - return false; - } - } - } - - return true; - } - } - - if (t1.hasMembers() && t2.hasMembers()) { - var t1Members = t1.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - var t2Members = t2.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - - if (t1Members.length !== t2Members.length) { - return false; - } - - var t1MemberSymbol = null; - var t2MemberSymbol = null; - - var t1MemberType = null; - var t2MemberType = null; - - for (var iMember = 0; iMember < t1Members.length; iMember++) { - t1MemberSymbol = t1Members[iMember]; - t2MemberSymbol = this.getNamedPropertySymbol(t1MemberSymbol.name, 68147712 /* SomeValue */, t2); - - if (!this.propertiesAreIdentical(t1MemberSymbol, t2MemberSymbol, context)) { - return false; - } - } - } else if (t1.hasMembers() || t2.hasMembers()) { - return false; - } - - var t1CallSigs = t1.getCallSignatures(); - var t2CallSigs = t2.getCallSignatures(); - - var t1ConstructSigs = t1.getConstructSignatures(); - var t2ConstructSigs = t2.getConstructSignatures(); - - var t1IndexSigs = t1.getIndexSignatures(); - var t2IndexSigs = t2.getIndexSignatures(); - - if (!this.signatureGroupsAreIdentical(t1CallSigs, t2CallSigs, context)) { - return false; - } - - if (!this.signatureGroupsAreIdentical(t1ConstructSigs, t2ConstructSigs, context)) { - return false; - } - - if (!this.signatureGroupsAreIdentical(t1IndexSigs, t2IndexSigs, context)) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.propertiesAreIdentical = function (propertySymbol1, propertySymbol2, context) { - if (!propertySymbol2 || (propertySymbol1.isOptional !== propertySymbol2.isOptional)) { - return false; - } - - var t1MemberSymbolIsPrivate = propertySymbol1.anyDeclHasFlag(2 /* Private */); - var t2MemberSymbolIsPrivate = propertySymbol2.anyDeclHasFlag(2 /* Private */); - - if (t1MemberSymbolIsPrivate !== t2MemberSymbolIsPrivate) { - return false; - } else if (t2MemberSymbolIsPrivate && t1MemberSymbolIsPrivate) { - var t1MemberSymbolDecl = propertySymbol1.getDeclarations()[0]; - var sourceDecl = propertySymbol2.getDeclarations()[0]; - if (t1MemberSymbolDecl !== sourceDecl) { - return false; - } - } - - var t1MemberType = propertySymbol1.type; - var t2MemberType = propertySymbol2.type; - - context.walkMemberTypes(propertySymbol1.name); - var areMemberTypesIdentical = this.typesAreIdenticalInEnclosingTypes(t1MemberType, t2MemberType, context); - context.postWalkMemberTypes(); - return areMemberTypesIdentical; - }; - - PullTypeResolver.prototype.propertiesAreIdenticalWithNewEnclosingTypes = function (type1, type2, property1, property2, context) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(type1, type2); - var arePropertiesIdentical = this.propertiesAreIdentical(property1, property2, context); - context.setEnclosingTypeWalkers(enclosingWalkers); - return arePropertiesIdentical; - }; - - PullTypeResolver.prototype.signatureGroupsAreIdentical = function (sg1, sg2, context) { - if (sg1 === sg2) { - return true; - } - - if (!sg1 || !sg2) { - return false; - } - - if (sg1.length !== sg2.length) { - return false; - } - - for (var i = 0; i < sg1.length; i++) { - context.walkSignatures(sg1[i].kind, i); - var areSignaturesIdentical = this.signaturesAreIdentical(sg1[i], sg2[i], context, true); - context.postWalkSignatures(); - if (!areSignaturesIdentical) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.typeParametersAreIdentical = function (tp1, tp2, context) { - var typeParamsAreIdentical = this.typeParametersAreIdenticalWorker(tp1, tp2, context); - - this.setTypeParameterIdentity(tp1, tp2, undefined); - - return typeParamsAreIdentical; - }; - - PullTypeResolver.prototype.typeParametersAreIdenticalWorker = function (tp1, tp2, context) { - if (!!(tp1 && tp1.length) !== !!(tp2 && tp2.length)) { - return false; - } - - if (tp1 && tp2 && (tp1.length !== tp2.length)) { - return false; - } - - if (tp1 && tp2) { - for (var i = 0; i < tp1.length; i++) { - context.walkTypeParameterConstraints(i); - var areConstraintsIdentical = this.typesAreIdentical(tp1[i].getConstraint(), tp2[i].getConstraint(), context); - context.postWalkTypeParameterConstraints(); - if (!areConstraintsIdentical) { - return false; - } - } - } - - return true; - }; - - PullTypeResolver.prototype.setTypeParameterIdentity = function (tp1, tp2, val) { - if (tp1 && tp2 && tp1.length === tp2.length) { - for (var i = 0; i < tp1.length; i++) { - this.identicalCache.setValueAt(tp1[i].pullSymbolID, tp2[i].pullSymbolID, val); - } - } - }; - - PullTypeResolver.prototype.signaturesAreIdenticalWithNewEnclosingTypes = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - var areSignaturesIdentical = this.signaturesAreIdentical(s1, s2, context, includingReturnType); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSignaturesIdentical; - }; - - PullTypeResolver.prototype.signaturesAreIdentical = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - if (s1 === s2) { - return true; - } - - var signaturesIdentical = this.identicalCache.valueAt(s1.pullSymbolID, s2.pullSymbolID); - if (signaturesIdentical || (signaturesIdentical != undefined && includingReturnType)) { - return signaturesIdentical; - } - - var oldValue = signaturesIdentical; - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, true); - - signaturesIdentical = this.signaturesAreIdenticalWorker(s1, s2, context, includingReturnType); - - if (includingReturnType) { - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, signaturesIdentical); - } else { - this.identicalCache.setValueAt(s1.pullSymbolID, s2.pullSymbolID, oldValue); - } - - return signaturesIdentical; - }; - - PullTypeResolver.prototype.signaturesAreIdenticalWorker = function (s1, s2, context, includingReturnType) { - if (typeof includingReturnType === "undefined") { includingReturnType = true; } - if (s1.hasVarArgs !== s2.hasVarArgs) { - return false; - } - - if (s1.nonOptionalParamCount !== s2.nonOptionalParamCount) { - return false; - } - - if (s1.parameters.length !== s2.parameters.length) { - return false; - } - - var s1TypeParameters = s1.getTypeParameters(); - var s2TypeParameters = s2.getTypeParameters(); - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, true); - - var typeParametersParametersAndReturnTypesAreIdentical = this.signatureTypeParametersParametersAndReturnTypesAreIdentical(s1, s2, context, includingReturnType); - - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, undefined); - return typeParametersParametersAndReturnTypesAreIdentical; - }; - - PullTypeResolver.prototype.signatureTypeParametersParametersAndReturnTypesAreIdentical = function (s1, s2, context, includingReturnType) { - if (!this.typeParametersAreIdenticalWorker(s1.getTypeParameters(), s2.getTypeParameters(), context)) { - return false; - } - - if (includingReturnType) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s1); - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s2); - context.walkReturnTypes(); - var areReturnTypesIdentical = this.typesAreIdenticalInEnclosingTypes(s1.returnType, s2.returnType, context); - context.postWalkReturnTypes(); - if (!areReturnTypesIdentical) { - return false; - } - } - - var s1Params = s1.parameters; - var s2Params = s2.parameters; - - for (var iParam = 0; iParam < s1Params.length; iParam++) { - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s1Params[iParam]); - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(s2Params[iParam]); - context.walkParameterTypes(iParam); - var areParameterTypesIdentical = this.typesAreIdenticalInEnclosingTypes(s1Params[iParam].type, s2Params[iParam].type, context); - context.postWalkParameterTypes(); - - if (!areParameterTypesIdentical) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.signatureReturnTypesAreIdentical = function (s1, s2, context) { - var s1TypeParameters = s1.getTypeParameters(); - var s2TypeParameters = s2.getTypeParameters(); - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, true); - - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - context.walkReturnTypes(); - var returnTypeIsIdentical = this.typesAreIdenticalInEnclosingTypes(s1.returnType, s2.returnType, context); - - context.setEnclosingTypeWalkers(enclosingWalkers); - - this.setTypeParameterIdentity(s1TypeParameters, s2TypeParameters, undefined); - - return returnTypeIsIdentical; - }; - - PullTypeResolver.prototype.symbolsShareDeclaration = function (symbol1, symbol2) { - var decls1 = symbol1.getDeclarations(); - var decls2 = symbol2.getDeclarations(); - - if (decls1.length && decls2.length) { - return decls1[0] === decls2[0]; - } - - return false; - }; - - PullTypeResolver.prototype.sourceIsSubtypeOfTarget = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTarget(source, target, false, this.subtypeCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceMembersAreAssignableToTargetMembers = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceMembersAreAssignableToTargetMembers = this.sourceMembersAreRelatableToTargetMembers(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceMembersAreAssignableToTargetMembers; - }; - - PullTypeResolver.prototype.sourcePropertyIsAssignableToTargetProperty = function (source, target, sourceProp, targetProp, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var isSourcePropertyIsAssignableToTargetProperty = this.sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSourcePropertyIsAssignableToTargetProperty; - }; - - PullTypeResolver.prototype.sourceCallSignaturesAreAssignableToTargetCallSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceCallSignaturesAssignableToTargetCallSignatures = this.sourceCallSignaturesAreRelatableToTargetCallSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceCallSignaturesAssignableToTargetCallSignatures; - }; - - PullTypeResolver.prototype.sourceConstructSignaturesAreAssignableToTargetConstructSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceConstructSignaturesAssignableToTargetConstructSignatures = this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceConstructSignaturesAssignableToTargetConstructSignatures; - }; - - PullTypeResolver.prototype.sourceIndexSignaturesAreAssignableToTargetIndexSignatures = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(source, target); - var areSourceIndexSignaturesAssignableToTargetIndexSignatures = this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return areSourceIndexSignaturesAssignableToTargetIndexSignatures; - }; - - PullTypeResolver.prototype.typeIsAssignableToFunction = function (source, ast, context) { - if (source.isFunctionType()) { - return true; - } - - return this.cachedFunctionInterfaceType() && this.sourceIsAssignableToTarget(source, this.cachedFunctionInterfaceType(), ast, context); - }; - - PullTypeResolver.prototype.signatureIsAssignableToTarget = function (s1, s2, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - context.setEnclosingTypes(s1, s2); - var isSignatureIsAssignableToTarget = this.signatureIsRelatableToTarget(s1, s2, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSignatureIsAssignableToTarget; - }; - - PullTypeResolver.prototype.sourceIsAssignableToTarget = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTarget(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceIsAssignableToTargetWithNewEnclosingTypes = function (source, target, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - return this.sourceIsRelatableToTargetWithNewEnclosingTypes(source, target, true, this.assignableCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.getSymbolForRelationshipCheck = function (symbol) { - if (symbol && symbol.isTypeReference()) { - return symbol.getReferencedTypeSymbol(); - } - - return symbol; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetInEnclosingTypes = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - source = this.getSymbolForRelationshipCheck(source); - target = this.getSymbolForRelationshipCheck(target); - - if (source === target) { - return true; - } - - if (source && target) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - return this.infinitelyExpandingSourceTypeIsRelatableToTargetType(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - } - } - - return this.sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetWithNewEnclosingTypes = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var enclosingWalkers = context.resetEnclosingTypeWalkers(); - var isSourceRelatable = this.sourceIsRelatableToTarget(source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.setEnclosingTypeWalkers(enclosingWalkers); - return isSourceRelatable; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetInCache = function (source, target, comparisonCache, comparisonInfo) { - var isRelatable = comparisonCache.valueAt(source.pullSymbolID, target.pullSymbolID); - - if (isRelatable) { - return { isRelatable: isRelatable }; - } - - if (isRelatable != undefined && !comparisonInfo) { - return { isRelatable: isRelatable }; - } - - return null; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTarget = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - source = this.getSymbolForRelationshipCheck(source); - target = this.getSymbolForRelationshipCheck(target); - - if (source === target) { - return true; - } - - if (!(source && target)) { - return true; - } - - var sourceApparentType = this.getApparentType(source); - - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(source, target, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - if (source === this.semanticInfoChain.stringTypeSymbol && target.isPrimitive() && target.isStringConstant()) { - return comparisonInfo && comparisonInfo.stringConstantVal && (comparisonInfo.stringConstantVal.kind() === 14 /* StringLiteral */) && (TypeScript.stripStartAndEndQuotes(comparisonInfo.stringConstantVal.text()) === TypeScript.stripStartAndEndQuotes(target.name)); - } - - if (assignableTo) { - if (this.isAnyOrEquivalent(source) || this.isAnyOrEquivalent(target)) { - return true; - } - } else { - if (this.isAnyOrEquivalent(target)) { - return true; - } - } - - if (target === this.semanticInfoChain.stringTypeSymbol && source.isPrimitive() && source.isStringConstant()) { - return true; - } - - if (source.isPrimitive() && source.isStringConstant() && target.isPrimitive() && target.isStringConstant()) { - return TypeScript.stripStartAndEndQuotes(source.name) === TypeScript.stripStartAndEndQuotes(target.name); - } - - if (source === this.semanticInfoChain.undefinedTypeSymbol) { - return true; - } - - if ((source === this.semanticInfoChain.nullTypeSymbol) && (target !== this.semanticInfoChain.undefinedTypeSymbol && target != this.semanticInfoChain.voidTypeSymbol)) { - return true; - } - - if (target === this.semanticInfoChain.voidTypeSymbol) { - if (source === this.semanticInfoChain.undefinedTypeSymbol || source == this.semanticInfoChain.nullTypeSymbol) { - return true; - } - - return false; - } else if (source === this.semanticInfoChain.voidTypeSymbol) { - if (target === this.semanticInfoChain.anyTypeSymbol) { - return true; - } - - return false; - } - - if (target === this.semanticInfoChain.numberTypeSymbol && TypeScript.PullHelpers.symbolIsEnum(source)) { - return true; - } - - if (source === this.semanticInfoChain.numberTypeSymbol && TypeScript.PullHelpers.symbolIsEnum(target)) { - return assignableTo; - } - - if (TypeScript.PullHelpers.symbolIsEnum(target) && TypeScript.PullHelpers.symbolIsEnum(source)) { - return this.symbolsShareDeclaration(target, source); - } - - if ((source.kind & 64 /* Enum */) || (target.kind & 64 /* Enum */)) { - return false; - } - - if (source.getIsSpecialized() && target.getIsSpecialized()) { - if (TypeScript.PullHelpers.getRootType(source) === TypeScript.PullHelpers.getRootType(target) && TypeScript.PullHelpers.getRootType(source).isNamedTypeSymbol()) { - var sourceTypeArguments = source.getTypeArguments(); - var targetTypeArguments = target.getTypeArguments(); - - if (sourceTypeArguments && targetTypeArguments) { - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, true); - - for (var i = 0; i < sourceTypeArguments.length; i++) { - if (!this.sourceIsRelatableToTargetWithNewEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], assignableTo, comparisonCache, ast, context, null, isComparingInstantiatedSignatures)) { - break; - } - } - - if (i === sourceTypeArguments.length) { - return true; - } else { - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, undefined); - } - } - } - } - - if (target.isTypeParameter()) { - if (source.isTypeParameter()) { - if (!source.getConstraint()) { - return this.typesAreIdentical(target, source, context); - } else { - return this.isSourceTypeParameterConstrainedToTargetTypeParameter(source, target); - } - } else { - if (isComparingInstantiatedSignatures) { - target = target.getBaseConstraint(this.semanticInfoChain); - } else { - return this.typesAreIdentical(target, sourceApparentType, context); - } - } - } - - if (sourceApparentType.isPrimitive() || target.isPrimitive()) { - return false; - } - - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, true); - - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(sourceApparentType, target); - - var needsSourceSubstitutionUpdate = source != sourceApparentType && context.enclosingTypeWalker1._canWalkStructure() && context.enclosingTypeWalker1._getCurrentSymbol() != sourceApparentType; - if (needsSourceSubstitutionUpdate) { - context.enclosingTypeWalker1.setCurrentSymbol(sourceApparentType); - } - - var isRelatable = this.sourceIsRelatableToTargetWorker(source, target, sourceApparentType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - - if (needsSourceSubstitutionUpdate) { - context.enclosingTypeWalker1.setCurrentSymbol(source); - } - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - - comparisonCache.setValueAt(source.pullSymbolID, target.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.isSourceTypeParameterConstrainedToTargetTypeParameter = function (source, target) { - var current = source; - while (current && current.isTypeParameter()) { - if (current === target) { - return true; - } - - current = current.getConstraint(); - } - return false; - }; - - PullTypeResolver.prototype.sourceIsRelatableToTargetWorker = function (source, target, sourceSubstitution, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - if (target.hasMembers() && !this.sourceMembersAreRelatableToTargetMembers(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceCallSignaturesAreRelatableToTargetCallSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceConstructSignaturesAreRelatableToTargetConstructSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - if (!this.sourceIndexSignaturesAreRelatableToTargetIndexSignatures(sourceSubstitution, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.sourceMembersAreRelatableToTargetMembers = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetProps = target.getAllMembers(68147712 /* SomeValue */, 0 /* all */); - - for (var itargetProp = 0; itargetProp < targetProps.length; itargetProp++) { - var targetProp = targetProps[itargetProp]; - - var sourceProp = this._getNamedPropertySymbolOfAugmentedType(targetProp.name, source); - - this.resolveDeclaredSymbol(targetProp, context); - - var targetPropType = targetProp.type; - - if (!sourceProp) { - if (!(targetProp.isOptional)) { - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.flags |= 2 /* RequiredPropertyIsMissing */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_is_missing_property_1_from_type_2, [source.toString(enclosingSymbol), targetProp.getScopedNameEx().toString(), target.toString(enclosingSymbol)])); - } - return false; - } - continue; - } - - if (!this.sourcePropertyIsRelatableToTargetProperty(source, target, sourceProp, targetProp, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures)) { - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.infinitelyExpandingSourceTypeIsRelatableToTargetType = function (sourceType, targetType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var widenedTargetType = targetType.widenedType(this, null, context); - var widenedSourceType = sourceType.widenedType(this, null, context); - - if ((widenedSourceType !== this.semanticInfoChain.anyTypeSymbol) && (widenedTargetType !== this.semanticInfoChain.anyTypeSymbol)) { - var sourceTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(sourceType); - var targetTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(targetType); - - if (sourceTypeNamedTypeReference !== targetTypeNamedTypeReference) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_do_not_refer_to_same_named_type, [sourceType.getScopedNameEx(enclosingSymbol).toString(), targetType.toString(enclosingSymbol)])); - } - return false; - } - - var sourceTypeArguments = sourceType.getTypeArguments(); - var targetTypeArguments = targetType.getTypeArguments(); - - if (!sourceTypeArguments && !targetTypeArguments) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - } - - if (!(sourceTypeArguments && targetTypeArguments) || sourceTypeArguments.length !== targetTypeArguments.length) { - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol)])); - } - return false; - } - - var comparisonInfoTypeArgumentsCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoTypeArgumentsCheck = new TypeComparisonInfo(comparisonInfo); - } - var isRelatable = true; - for (var i = 0; i < sourceTypeArguments.length && isRelatable; i++) { - context.walkTypeArgument(i); - - if (!this.sourceIsRelatableToTargetInEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], assignableTo, comparisonCache, ast, context, comparisonInfoTypeArgumentsCheck, isComparingInstantiatedSignatures)) { - isRelatable = false; - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - - if (comparisonInfoTypeArgumentsCheck && comparisonInfoTypeArgumentsCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments_NL_2, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol), comparisonInfoTypeArgumentsCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_0_and_1_originating_in_infinitely_expanding_type_reference_have_incompatible_type_arguments, [sourceType.toString(enclosingSymbol), targetType.toString(enclosingSymbol)]); - } - comparisonInfo.addMessage(message); - } - } - - context.postWalkTypeArgument(); - } - } - - comparisonCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.infinitelyExpandingTypesAreIdentical = function (sourceType, targetType, context) { - var widenedTargetType = targetType.widenedType(this, null, null); - var widenedSourceType = sourceType.widenedType(this, null, null); - - if ((widenedSourceType !== this.semanticInfoChain.anyTypeSymbol) && (widenedTargetType !== this.semanticInfoChain.anyTypeSymbol)) { - var sourceTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(sourceType); - var targetTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(targetType); - if (sourceTypeNamedTypeReference !== targetTypeNamedTypeReference) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - - var sourceTypeArguments = sourceType.getTypeArguments(); - var targetTypeArguments = targetType.getTypeArguments(); - - if (!sourceTypeArguments && !targetTypeArguments) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - } - - if (!(sourceTypeArguments && targetTypeArguments) || sourceTypeArguments.length !== targetTypeArguments.length) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - - for (var i = 0; i < sourceTypeArguments.length; i++) { - context.walkTypeArgument(i); - var areIdentical = this.typesAreIdenticalInEnclosingTypes(sourceTypeArguments[i], targetTypeArguments[i], context); - context.postWalkTypeArgument(); - - if (!areIdentical) { - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, false); - return false; - } - } - } - - this.identicalCache.setValueAt(sourceType.pullSymbolID, targetType.pullSymbolID, true); - return true; - }; - - PullTypeResolver.prototype.sourcePropertyIsRelatableToTargetProperty = function (source, target, sourceProp, targetProp, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var _this = this; - var sourceAndTargetAreConstructors = source.isConstructor() && target.isConstructor(); - - var getNames = function (takeTypesFromPropertyContainers) { - var enclosingSymbol = _this.getEnclosingSymbolForAST(ast); - var sourceType = takeTypesFromPropertyContainers ? sourceProp.getContainer() : source; - var targetType = takeTypesFromPropertyContainers ? targetProp.getContainer() : target; - if (sourceAndTargetAreConstructors) { - sourceType = sourceType.getAssociatedContainerType(); - targetType = targetType.getAssociatedContainerType(); - } - return { - propertyName: targetProp.getScopedNameEx().toString(), - sourceTypeName: sourceType.toString(enclosingSymbol), - targetTypeName: targetType.toString(enclosingSymbol) - }; - }; - - var targetPropIsPrivate = targetProp.anyDeclHasFlag(2 /* Private */); - var sourcePropIsPrivate = sourceProp.anyDeclHasFlag(2 /* Private */); - - if (targetPropIsPrivate !== sourcePropIsPrivate) { - if (comparisonInfo) { - var names = getNames(true); - var code; - if (targetPropIsPrivate) { - code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Static_property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2 : TypeScript.DiagnosticCode.Property_0_defined_as_public_in_type_1_is_defined_as_private_in_type_2; - } else { - code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Static_property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2 : TypeScript.DiagnosticCode.Property_0_defined_as_private_in_type_1_is_defined_as_public_in_type_2; - } - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName])); - comparisonInfo.flags |= 128 /* InconsistantPropertyAccesibility */; - } - return false; - } else if (sourcePropIsPrivate && targetPropIsPrivate) { - var targetDecl = targetProp.getDeclarations()[0]; - var sourceDecl = sourceProp.getDeclarations()[0]; - - if (targetDecl !== sourceDecl) { - if (comparisonInfo) { - var names = getNames(true); - - comparisonInfo.flags |= 128 /* InconsistantPropertyAccesibility */; - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_0_and_1_define_static_property_2_as_private : TypeScript.DiagnosticCode.Types_0_and_1_define_property_2_as_private; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(code, [names.sourceTypeName, names.targetTypeName, names.propertyName])); - } - - return false; - } - } - - if (sourceProp.isOptional && !targetProp.isOptional) { - if (comparisonInfo) { - var names = getNames(true); - comparisonInfo.flags |= 2 /* RequiredPropertyIsMissing */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Property_0_defined_as_optional_in_type_1_but_is_required_in_type_2, [names.propertyName, names.sourceTypeName, names.targetTypeName])); - } - return false; - } - - this.resolveDeclaredSymbol(sourceProp, context); - - var sourcePropType = sourceProp.type; - var targetPropType = targetProp.type; - - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(sourcePropType, targetPropType, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - var comparisonInfoPropertyTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoPropertyTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - context.walkMemberTypes(targetProp.name); - var isSourcePropertyRelatableToTargetProperty = this.sourceIsRelatableToTargetInEnclosingTypes(sourcePropType, targetPropType, assignableTo, comparisonCache, ast, context, comparisonInfoPropertyTypeCheck, isComparingInstantiatedSignatures); - context.postWalkMemberTypes(); - - if (!isSourcePropertyRelatableToTargetProperty && comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - comparisonInfo.flags |= 32 /* IncompatiblePropertyTypes */; - var message; - var names = getNames(false); - if (comparisonInfoPropertyTypeCheck && comparisonInfoPropertyTypeCheck.message) { - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_of_static_property_0_of_class_1_and_class_2_are_incompatible_NL_3 : TypeScript.DiagnosticCode.Types_of_property_0_of_types_1_and_2_are_incompatible_NL_3; - message = TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName, comparisonInfoPropertyTypeCheck.message]); - } else { - var code = sourceAndTargetAreConstructors ? TypeScript.DiagnosticCode.Types_of_static_property_0_of_class_1_and_class_2_are_incompatible : TypeScript.DiagnosticCode.Types_of_property_0_of_types_1_and_2_are_incompatible; - message = TypeScript.getDiagnosticMessage(code, [names.propertyName, names.sourceTypeName, names.targetTypeName]); - } - comparisonInfo.addMessage(message); - } - - return isSourcePropertyRelatableToTargetProperty; - }; - - PullTypeResolver.prototype.sourceCallSignaturesAreRelatableToTargetCallSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetCallSigs = target.getCallSignatures(); - - if (targetCallSigs.length) { - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - var sourceCallSigs = source.getCallSignatures(); - if (!this.signatureGroupIsRelatableToTarget(source, target, sourceCallSigs, targetCallSigs, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures)) { - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (sourceCallSigs.length && targetCallSigs.length) { - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - } else { - var hasSig = targetCallSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - var lacksSig = !targetCallSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_requires_a_call_signature_but_type_1_lacks_one, [hasSig, lacksSig]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.sourceConstructSignaturesAreRelatableToTargetConstructSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetConstructSigs = target.getConstructSignatures(); - if (targetConstructSigs.length) { - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - var sourceConstructSigs = source.getConstructSignatures(); - if (!this.signatureGroupIsRelatableToTarget(source, target, sourceConstructSigs, targetConstructSigs, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures)) { - if (comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - var message; - if (sourceConstructSigs.length && targetConstructSigs.length) { - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Construct_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Construct_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - } else { - var hasSig = targetConstructSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - var lacksSig = !targetConstructSigs.length ? target.toString(enclosingSymbol) : source.toString(enclosingSymbol); - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_0_requires_a_construct_signature_but_type_1_lacks_one, [hasSig, lacksSig]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.sourceIndexSignaturesAreRelatableToTargetIndexSignatures = function (source, target, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var targetIndexSigs = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(target, context); - var targetStringSig = targetIndexSigs.stringSignature; - var targetNumberSig = targetIndexSigs.numericSignature; - - if (targetStringSig || targetNumberSig) { - var sourceIndexSigs = this.getBothKindsOfIndexSignaturesIncludingAugmentedType(source, context); - var enclosingTypeIndexSigs = context.getBothKindOfIndexSignatures(true, false); - var sourceStringSig = sourceIndexSigs.stringSignature; - var sourceNumberSig = sourceIndexSigs.numericSignature; - - var comparable = true; - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo && !comparisonInfo.onlyCaptureFirstError) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo); - } - - if (targetStringSig) { - if (sourceStringSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, true, true); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceStringSig.returnType, targetStringSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else { - comparable = false; - } - } - - if (comparable && targetNumberSig) { - if (sourceNumberSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, false, false); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceNumberSig.returnType, targetNumberSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else if (sourceStringSig) { - context.walkIndexSignatureReturnTypes(enclosingTypeIndexSigs, true, false); - comparable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceStringSig.returnType, targetNumberSig.returnType, assignableTo, comparisonCache, ast, context, comparisonInfoSignatuesTypeCheck, isComparingInstantiatedSignatures); - context.postWalkIndexSignatureReturnTypes(); - } else { - comparable = false; - } - } - - if (!comparable) { - if (comparisonInfo) { - var message; - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (comparisonInfoSignatuesTypeCheck && comparisonInfoSignatuesTypeCheck.message) { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Index_signatures_of_types_0_and_1_are_incompatible_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfoSignatuesTypeCheck.message]); - } else { - message = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Index_signatures_of_types_0_and_1_are_incompatible, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)]); - } - comparisonInfo.flags |= 4 /* IncompatibleSignatures */; - comparisonInfo.addMessage(message); - } - return false; - } - } - - return true; - }; - - PullTypeResolver.prototype.signatureGroupIsRelatableToTarget = function (source, target, sourceSG, targetSG, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - if (sourceSG === targetSG) { - return true; - } - - if (!(sourceSG.length && targetSG.length)) { - return false; - } - - var foundMatch = false; - - var targetExcludeDefinition = targetSG.length > 1; - var sourceExcludeDefinition = sourceSG.length > 1; - var sigsCompared = 0; - var comparisonInfoSignatuesTypeCheck = null; - if (comparisonInfo) { - comparisonInfoSignatuesTypeCheck = new TypeComparisonInfo(comparisonInfo, true); - comparisonInfoSignatuesTypeCheck.message = comparisonInfo.message; - } - for (var iMSig = 0; iMSig < targetSG.length; iMSig++) { - var mSig = targetSG[iMSig]; - - if (mSig.isStringConstantOverloadSignature() || (targetExcludeDefinition && mSig.isDefinition())) { - continue; - } - - for (var iNSig = 0; iNSig < sourceSG.length; iNSig++) { - var nSig = sourceSG[iNSig]; - - if (nSig.isStringConstantOverloadSignature() || (sourceExcludeDefinition && nSig.isDefinition())) { - continue; - } - - context.walkSignatures(nSig.kind, iNSig, iMSig); - var isSignatureRelatableToTarget = this.signatureIsRelatableToTarget(nSig, mSig, assignableTo, comparisonCache, ast, context, sigsCompared == 0 ? comparisonInfoSignatuesTypeCheck : null, isComparingInstantiatedSignatures); - context.postWalkSignatures(); - - sigsCompared++; - - if (isSignatureRelatableToTarget) { - foundMatch = true; - break; - } - } - - if (foundMatch) { - foundMatch = false; - continue; - } - - if (comparisonInfo && sigsCompared == 1) { - comparisonInfo.message = comparisonInfoSignatuesTypeCheck.message; - } - - return false; - } - - return true; - }; - - PullTypeResolver.prototype.signatureIsRelatableToTarget = function (sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var isRelatableInfo = this.sourceIsRelatableToTargetInCache(sourceSig, targetSig, comparisonCache, comparisonInfo); - if (isRelatableInfo) { - return isRelatableInfo.isRelatable; - } - - comparisonCache.setValueAt(sourceSig.pullSymbolID, targetSig.pullSymbolID, true); - var isRelatable = this.signatureIsRelatableToTargetWorker(sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - comparisonCache.setValueAt(sourceSig.pullSymbolID, targetSig.pullSymbolID, isRelatable); - return isRelatable; - }; - - PullTypeResolver.prototype.signatureIsRelatableToTargetWorker = function (sourceSig, targetSig, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures) { - var _this = this; - var sourceParameters = sourceSig.parameters; - var targetParameters = targetSig.parameters; - - if (!sourceParameters || !targetParameters) { - return false; - } - - var targetNonOptionalParamCount = targetSig.nonOptionalParamCount; - var sourceNonOptionalParamCount = sourceSig.nonOptionalParamCount; - - if (!targetSig.hasVarArgs && sourceNonOptionalParamCount > targetParameters.length) { - if (comparisonInfo) { - comparisonInfo.flags |= 3 /* SourceSignatureHasTooManyParameters */; - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Call_signature_expects_0_or_fewer_parameters, [targetParameters.length])); - } - return false; - } - - if (this.signaturesAreIdentical(sourceSig, targetSig, context)) { - return true; - } - - if (targetSig.isGeneric()) { - targetSig = this.instantiateSignatureToAny(targetSig); - } - - if (sourceSig.isGeneric()) { - sourceSig = this.instantiateSignatureToAny(sourceSig); - } - - var sourceReturnType = sourceSig.returnType; - var targetReturnType = targetSig.returnType; - - if (targetReturnType !== this.semanticInfoChain.voidTypeSymbol) { - context.walkReturnTypes(); - var returnTypesAreRelatable = this.sourceIsRelatableToTargetInEnclosingTypes(sourceReturnType, targetReturnType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.postWalkReturnTypes(); - if (!returnTypesAreRelatable) { - if (comparisonInfo) { - comparisonInfo.flags |= 16 /* IncompatibleReturnTypes */; - } - - return false; - } - } - - return targetSig.forAllCorrespondingParameterTypesInThisAndOtherSignature(sourceSig, function (targetParamType, sourceParamType, iParam) { - context.walkParameterTypes(iParam); - var areParametersRelatable = _this.sourceIsRelatableToTargetInEnclosingTypes(sourceParamType, targetParamType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - if (!areParametersRelatable) { - context.swapEnclosingTypeWalkers(); - areParametersRelatable = _this.sourceIsRelatableToTargetInEnclosingTypes(targetParamType, sourceParamType, assignableTo, comparisonCache, ast, context, comparisonInfo, isComparingInstantiatedSignatures); - context.swapEnclosingTypeWalkers(); - } - context.postWalkParameterTypes(); - - if (!areParametersRelatable) { - if (comparisonInfo) { - comparisonInfo.flags |= 64 /* IncompatibleParameterTypes */; - } - } - - return areParametersRelatable; - }); - }; - - PullTypeResolver.prototype.resolveOverloads = function (application, group, haveTypeArgumentsAtCallSite, context, diagnostics) { - var _this = this; - var hasOverloads = group.length > 1; - var comparisonInfo = new TypeComparisonInfo(); - var args = application.argumentList ? application.argumentList.arguments : null; - - var initialCandidates = TypeScript.ArrayUtilities.where(group, function (signature) { - if (hasOverloads && signature.isDefinition()) { - return false; - } - - var rootSignature = signature.getRootSymbol(); - if (haveTypeArgumentsAtCallSite && !rootSignature.isGeneric()) { - return false; - } - - return _this.overloadHasCorrectArity(signature, args); - }); - - var firstAssignableButNotSupertypeSignature = null; - var firstAssignableWithProvisionalErrorsSignature = null; - - for (var i = 0; i < initialCandidates.length; i++) { - var applicability = this.overloadIsApplicable(initialCandidates[i], args, context, comparisonInfo); - if (applicability === 3 /* Subtype */) { - return initialCandidates[i]; - } else if (applicability === 2 /* AssignableWithNoProvisionalErrors */ && !firstAssignableButNotSupertypeSignature) { - firstAssignableButNotSupertypeSignature = initialCandidates[i]; - } else if (applicability === 1 /* AssignableButWithProvisionalErrors */ && !firstAssignableWithProvisionalErrorsSignature) { - firstAssignableWithProvisionalErrorsSignature = initialCandidates[i]; - } - } - - if (firstAssignableButNotSupertypeSignature || firstAssignableWithProvisionalErrorsSignature) { - return firstAssignableButNotSupertypeSignature || firstAssignableWithProvisionalErrorsSignature; - } else { - var target = this.getCallTargetErrorSpanAST(application); - if (comparisonInfo.message) { - diagnostics.push(this.semanticInfoChain.diagnosticFromAST(target, TypeScript.DiagnosticCode.Supplied_parameters_do_not_match_any_signature_of_call_target_NL_0, [comparisonInfo.message])); - } else { - diagnostics.push(this.semanticInfoChain.diagnosticFromAST(target, TypeScript.DiagnosticCode.Supplied_parameters_do_not_match_any_signature_of_call_target, null)); - } - } - - return null; - }; - - PullTypeResolver.prototype.getCallTargetErrorSpanAST = function (callEx) { - return (callEx.expression.kind() === 212 /* MemberAccessExpression */) ? callEx.expression.name : callEx.expression; - }; - - PullTypeResolver.prototype.overloadHasCorrectArity = function (signature, args) { - if (args == null) { - return signature.nonOptionalParamCount === 0; - } - - var numberOfArgs = (args.nonSeparatorCount() && args.nonSeparatorCount() === args.separatorCount()) ? args.separatorCount() + 1 : args.nonSeparatorCount(); - if (numberOfArgs < signature.nonOptionalParamCount) { - return false; - } - if (!signature.hasVarArgs && numberOfArgs > signature.parameters.length) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.overloadIsApplicable = function (signature, args, context, comparisonInfo) { - if (args === null) { - return 3 /* Subtype */; - } - - var isInVarArg = false; - var parameters = signature.parameters; - var paramType = null; - - var overloadApplicability = 3 /* Subtype */; - - for (var i = 0; i < args.nonSeparatorCount(); i++) { - if (!isInVarArg) { - this.resolveDeclaredSymbol(parameters[i], context); - - if (parameters[i].isVarArg) { - paramType = parameters[i].type.getElementType() || this.getNewErrorTypeSymbol(parameters[i].type.getName()); - isInVarArg = true; - } else { - paramType = parameters[i].type; - } - } - - var statusOfCurrentArgument = this.overloadIsApplicableForArgument(paramType, args.nonSeparatorAt(i), i, context, comparisonInfo); - - if (statusOfCurrentArgument === 0 /* NotAssignable */) { - return 0 /* NotAssignable */; - } else if (statusOfCurrentArgument === 1 /* AssignableButWithProvisionalErrors */) { - overloadApplicability = 1 /* AssignableButWithProvisionalErrors */; - } else if (overloadApplicability !== 1 /* AssignableButWithProvisionalErrors */ && statusOfCurrentArgument === 2 /* AssignableWithNoProvisionalErrors */) { - overloadApplicability = 2 /* AssignableWithNoProvisionalErrors */; - } - } - - return overloadApplicability; - }; - - PullTypeResolver.prototype.overloadIsApplicableForArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (paramType.isAny()) { - return 3 /* Subtype */; - } else if (paramType.isError()) { - return 1 /* AssignableButWithProvisionalErrors */; - } else if (arg.kind() === 219 /* SimpleArrowFunctionExpression */) { - var simpleArrowFunction = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, null, TypeScript.ASTHelpers.parametersFromIdentifier(simpleArrowFunction.identifier), null, simpleArrowFunction.block, simpleArrowFunction.expression, argIndex, context, comparisonInfo); - } else if (arg.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - var arrowFunction = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, arrowFunction.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(arrowFunction.callSignature.parameterList), TypeScript.ASTHelpers.getType(arrowFunction), arrowFunction.block, arrowFunction.expression, argIndex, context, comparisonInfo); - } else if (arg.kind() === 222 /* FunctionExpression */) { - var functionExpression = arg; - return this.overloadIsApplicableForAnyFunctionExpressionArgument(paramType, arg, functionExpression.callSignature.typeParameterList, TypeScript.ASTHelpers.parametersFromParameterList(functionExpression.callSignature.parameterList), TypeScript.ASTHelpers.getType(functionExpression), functionExpression.block, null, argIndex, context, comparisonInfo); - } else if (arg.kind() === 215 /* ObjectLiteralExpression */) { - return this.overloadIsApplicableForObjectLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); - } else if (arg.kind() === 214 /* ArrayLiteralExpression */) { - return this.overloadIsApplicableForArrayLiteralArgument(paramType, arg, argIndex, context, comparisonInfo); - } else { - return this.overloadIsApplicableForOtherArgument(paramType, arg, argIndex, context, comparisonInfo); - } - }; - - PullTypeResolver.prototype.overloadIsApplicableForAnyFunctionExpressionArgument = function (paramType, arg, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, argIndex, context, comparisonInfo) { - if (this.cachedFunctionInterfaceType() && paramType === this.cachedFunctionInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - - var argSym = this.resolveAnyFunctionExpression(arg, typeParameters, parameters, returnTypeAnnotation, block, bodyExpression, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForObjectLiteralArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (this.cachedObjectInterfaceType() && paramType === this.cachedObjectInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - var argSym = this.resolveObjectLiteralExpression(arg, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForArrayLiteralArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - if (paramType === this.cachedArrayInterfaceType()) { - return 2 /* AssignableWithNoProvisionalErrors */; - } - - context.pushProvisionalType(paramType); - var argSym = this.resolveArrayLiteralExpression(arg, true, context); - - var applicabilityStatus = this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - - context.popAnyContextualType(); - - return applicabilityStatus; - }; - - PullTypeResolver.prototype.overloadIsApplicableForOtherArgument = function (paramType, arg, argIndex, context, comparisonInfo) { - var argSym = this.resolveAST(arg, false, context); - - if (argSym.type.isAlias()) { - var aliasSym = argSym.type; - argSym = aliasSym.getExportAssignedTypeSymbol(); - } - - comparisonInfo.stringConstantVal = arg; - return this.overloadIsApplicableForArgumentHelper(paramType, argSym.type, argIndex, comparisonInfo, arg, context); - }; - - PullTypeResolver.prototype.overloadIsApplicableForArgumentHelper = function (paramType, argSym, argumentIndex, comparisonInfo, arg, context) { - var tempComparisonInfo = new TypeComparisonInfo(); - tempComparisonInfo.stringConstantVal = comparisonInfo.stringConstantVal; - if (!context.hasProvisionalErrors() && this.sourceIsSubtypeOfTarget(argSym.type, paramType, arg, context, tempComparisonInfo)) { - return 3 /* Subtype */; - } - - if (this.sourceIsAssignableToTarget(argSym.type, paramType, arg, context, comparisonInfo.message ? tempComparisonInfo : comparisonInfo)) { - return context.hasProvisionalErrors() ? 1 /* AssignableButWithProvisionalErrors */ : 2 /* AssignableWithNoProvisionalErrors */; - } - - if (!comparisonInfo.message) { - var enclosingSymbol = this.getEnclosingSymbolForAST(arg); - comparisonInfo.addMessage(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Could_not_apply_type_0_to_argument_1_which_is_of_type_2, [paramType.toString(enclosingSymbol), (argumentIndex + 1), argSym.getTypeName(enclosingSymbol)])); - } - - return 0 /* NotAssignable */; - }; - - PullTypeResolver.prototype.inferArgumentTypesForSignature = function (argContext, comparisonInfo, context) { - var inferenceResultTypes = argContext.inferTypeArguments(); - var typeParameters = argContext.signatureBeingInferred.getTypeParameters(); - TypeScript.Debug.assert(typeParameters.length == inferenceResultTypes.length); - - var typeReplacementMapForConstraints = null; - for (var i = 0; i < inferenceResultTypes.length; i++) { - if (typeParameters[i].getConstraint()) { - typeReplacementMapForConstraints = typeReplacementMapForConstraints || TypeScript.PullInstantiationHelpers.createTypeParameterArgumentMap(typeParameters, inferenceResultTypes); - var associatedConstraint = this.instantiateType(typeParameters[i].getConstraint(), typeReplacementMapForConstraints); - if (!this.sourceIsAssignableToTargetWithNewEnclosingTypes(inferenceResultTypes[i], associatedConstraint, null, context, null, false)) { - inferenceResultTypes[i] = associatedConstraint; - } - } - } - - if (argContext.isInvocationInferenceContext()) { - var invocationContext = argContext; - if (!this.typeParametersAreInScopeAtArgumentList(typeParameters, invocationContext.argumentASTs)) { - for (var i = 0; i < inferenceResultTypes.length; i++) { - if (inferenceResultTypes[i].wrapsSomeTypeParameter(argContext.candidateCache)) { - inferenceResultTypes[i] = this.semanticInfoChain.anyTypeSymbol; - } - } - } - } - - return inferenceResultTypes; - }; - - PullTypeResolver.prototype.typeParametersAreInScopeAtArgumentList = function (typeParameters, args) { - var enclosingDecl = this.getEnclosingDeclForAST(args); - var typeParameterParentDecl = typeParameters[0].getDeclarations()[0].getParentDecl(); - return enclosingDecl.getParentPath().indexOf(typeParameterParentDecl) > -1; - }; - - PullTypeResolver.prototype.relateTypeToTypeParametersInEnclosingType = function (expressionType, parameterType, argContext, context) { - if (expressionType && parameterType) { - if (context.oneOfClassificationsIsInfinitelyExpanding()) { - this.relateInifinitelyExpandingTypeToTypeParameters(expressionType, parameterType, argContext, context); - return; - } - } - this.relateTypeToTypeParameters(expressionType, parameterType, argContext, context); - }; - - PullTypeResolver.prototype.relateTypeToTypeParametersWithNewEnclosingTypes = function (expressionType, parameterType, argContext, context) { - var enclosingTypeWalkers = context.resetEnclosingTypeWalkers(); - this.relateTypeToTypeParameters(expressionType, parameterType, argContext, context); - context.setEnclosingTypeWalkers(enclosingTypeWalkers); - }; - - PullTypeResolver.prototype.relateTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - if (!expressionType || !parameterType) { - return; - } - - if (expressionType.isError()) { - expressionType = this.semanticInfoChain.anyTypeSymbol; - } - - if (parameterType.isTypeParameter()) { - var typeParameter = parameterType; - argContext.addCandidateForInference(typeParameter, expressionType); - return; - } - - if (parameterType.isNamedTypeSymbol() && !parameterType.isGeneric() && !parameterType.getTypeArguments()) { - return; - } - - if (TypeScript.PullInstantiationHelpers.twoTypesAreInstantiationsOfSameNamedGenericType(expressionType, parameterType)) { - this.relateTypeArgumentsOfTypeToTypeParameters(expressionType, parameterType, argContext, context); - } else { - var symbolsWhenStartedWalkingTypes = context.startWalkingTypes(expressionType, parameterType); - this.relateObjectTypeToTypeParameters(expressionType, parameterType, argContext, context); - context.endWalkingTypes(symbolsWhenStartedWalkingTypes); - } - }; - - PullTypeResolver.prototype.relateTypeArgumentsOfTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - var parameterSideTypeArguments = parameterType.getTypeArguments(); - var argumentSideTypeArguments = expressionType.getTypeArguments(); - - TypeScript.Debug.assert(parameterSideTypeArguments && argumentSideTypeArguments && parameterSideTypeArguments.length === argumentSideTypeArguments.length); - for (var i = 0; i < parameterSideTypeArguments.length; i++) { - this.relateTypeToTypeParametersWithNewEnclosingTypes(argumentSideTypeArguments[i], parameterSideTypeArguments[i], argContext, context); - } - }; - - PullTypeResolver.prototype.relateInifinitelyExpandingTypeToTypeParameters = function (expressionType, parameterType, argContext, context) { - if (!expressionType || !parameterType) { - return; - } - - var expressionTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(expressionType); - var parameterTypeNamedTypeReference = TypeScript.PullHelpers.getRootType(parameterType); - if (expressionTypeNamedTypeReference !== parameterTypeNamedTypeReference) { - return; - } - - var expressionTypeTypeArguments = expressionType.getTypeArguments(); - var parameterTypeArguments = parameterType.getTypeArguments(); - - if (expressionTypeTypeArguments && parameterTypeArguments && expressionTypeTypeArguments.length === parameterTypeArguments.length) { - for (var i = 0; i < expressionTypeTypeArguments.length; i++) { - this.relateTypeArgumentsOfTypeToTypeParameters(expressionType, parameterType, argContext, context); - } - } - }; - - PullTypeResolver.prototype.relateFunctionSignatureToTypeParameters = function (expressionSignature, parameterSignature, argContext, context) { - var _this = this; - var expressionReturnType = expressionSignature.returnType; - var parameterReturnType = parameterSignature.returnType; - - parameterSignature.forAllCorrespondingParameterTypesInThisAndOtherSignature(expressionSignature, function (parameterSignatureParameterType, expressionSignatureParameterType, i) { - context.walkParameterTypes(i); - _this.relateTypeToTypeParametersInEnclosingType(expressionSignatureParameterType, parameterSignatureParameterType, argContext, context); - context.postWalkParameterTypes(); - return true; - }); - - context.walkReturnTypes(); - this.relateTypeToTypeParametersInEnclosingType(expressionReturnType, parameterReturnType, argContext, context); - context.postWalkReturnTypes(); - }; - - PullTypeResolver.prototype.relateObjectTypeToTypeParameters = function (objectType, parameterType, argContext, context) { - var parameterTypeMembers = parameterType.getMembers(); - var parameterSignatures; - - var objectMember; - var objectSignatures; - - if (argContext.alreadyRelatingTypes(objectType, parameterType)) { - return; - } - - for (var i = 0; i < parameterTypeMembers.length; i++) { - objectMember = this.getNamedPropertySymbol(parameterTypeMembers[i].name, 68147712 /* SomeValue */, objectType); - if (objectMember) { - this.resolveDeclaredSymbol(objectMember); - this.resolveDeclaredSymbol(parameterTypeMembers[i]); - context.walkMemberTypes(parameterTypeMembers[i].name); - this.relateTypeToTypeParametersInEnclosingType(objectMember.type, parameterTypeMembers[i].type, argContext, context); - context.postWalkMemberTypes(); - } - } - - this.relateSignatureGroupToTypeParameters(objectType.getCallSignatures(), parameterType.getCallSignatures(), 1048576 /* CallSignature */, argContext, context); - - this.relateSignatureGroupToTypeParameters(objectType.getConstructSignatures(), parameterType.getConstructSignatures(), 2097152 /* ConstructSignature */, argContext, context); - - var parameterIndexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(parameterType, context); - var objectIndexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(objectType, context); - var indexSigInfo = context.getBothKindOfIndexSignatures(false, false); - - if (parameterIndexSignatures.stringSignature && objectIndexSignatures.stringSignature) { - context.walkIndexSignatureReturnTypes(indexSigInfo, true, true, true); - this.relateFunctionSignatureToTypeParameters(objectIndexSignatures.stringSignature, parameterIndexSignatures.stringSignature, argContext, context); - context.postWalkIndexSignatureReturnTypes(true); - } - if (parameterIndexSignatures.numericSignature && objectIndexSignatures.numericSignature) { - context.walkIndexSignatureReturnTypes(indexSigInfo, false, false, true); - this.relateFunctionSignatureToTypeParameters(objectIndexSignatures.numericSignature, parameterIndexSignatures.numericSignature, argContext, context); - context.postWalkIndexSignatureReturnTypes(true); - } - }; - - PullTypeResolver.prototype.relateSignatureGroupToTypeParameters = function (argumentSignatures, parameterSignatures, signatureKind, argContext, context) { - for (var i = 0; i < parameterSignatures.length; i++) { - var paramSignature = parameterSignatures[i]; - if (argumentSignatures.length > 0 && paramSignature.isGeneric()) { - paramSignature = this.instantiateSignatureToAny(paramSignature); - } - for (var j = 0; j < argumentSignatures.length; j++) { - var argumentSignature = argumentSignatures[j]; - if (argumentSignature.nonOptionalParamCount > paramSignature.nonOptionalParamCount) { - continue; - } - - if (argumentSignature.isGeneric()) { - argumentSignature = this.instantiateSignatureToAny(argumentSignature); - } - - context.walkSignatures(signatureKind, j, i); - this.relateFunctionSignatureToTypeParameters(argumentSignature, paramSignature, argContext, context); - context.postWalkSignatures(); - } - } - }; - - PullTypeResolver.prototype.alterPotentialGenericFunctionTypeToInstantiatedFunctionTypeForTypeArgumentInference = function (expressionSymbol, context) { - var inferentialType = context.getContextualType(); - TypeScript.Debug.assert(inferentialType); - var expressionType = expressionSymbol.type; - if (this.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers(expressionType, true) && this.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers(inferentialType, false)) { - var genericExpressionSignature = expressionType.getCallSignatures()[0]; - var contextualSignature = inferentialType.getCallSignatures()[0]; - - var instantiatedSignature = this.instantiateSignatureInContext(genericExpressionSignature, contextualSignature, context, true); - if (instantiatedSignature === null) { - return expressionSymbol; - } - - var newType = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - newType.appendCallSignature(instantiatedSignature); - return newType; - } - - return expressionSymbol; - }; - - PullTypeResolver.prototype.isFunctionTypeWithExactlyOneCallSignatureAndNoOtherMembers = function (type, callSignatureShouldBeGeneric) { - TypeScript.Debug.assert(type); - if (type.getCallSignatures().length !== 1) { - return false; - } - - var callSignatureIsGeneric = type.getCallSignatures()[0].isGeneric(); - if (callSignatureIsGeneric !== callSignatureShouldBeGeneric) { - return false; - } - - var typeHasOtherMembers = type.getConstructSignatures().length || type.getIndexSignatures().length || type.getAllMembers(68147712 /* SomeValue */, 0 /* all */).length; - if (typeHasOtherMembers) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.instantiateTypeToAny = function (typeToSpecialize, context) { - var typeParameters = typeToSpecialize.getTypeParameters(); - - if (!typeParameters.length) { - return typeToSpecialize; - } - - var typeArguments = null; - - if (!this._cachedAnyTypeArgs) { - this._cachedAnyTypeArgs = [ - [this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol] - ]; - } - - if (typeParameters.length < this._cachedAnyTypeArgs.length) { - typeArguments = this._cachedAnyTypeArgs[typeParameters.length - 1]; - } else { - typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArguments[typeArguments.length] = this.semanticInfoChain.anyTypeSymbol; - } - } - - var type = this.createInstantiatedType(typeToSpecialize, typeArguments); - - return type; - }; - - PullTypeResolver.prototype.instantiateSignatureToAny = function (signature) { - var typeParameters = signature.getTypeParameters(); - if (!this._cachedAnyTypeArgs) { - this._cachedAnyTypeArgs = [ - [this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol], - [this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol, this.semanticInfoChain.anyTypeSymbol] - ]; - } - - if (typeParameters.length < this._cachedAnyTypeArgs.length) { - var typeArguments = this._cachedAnyTypeArgs[typeParameters.length - 1]; - } else { - var typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArguments[typeArguments.length] = this.semanticInfoChain.anyTypeSymbol; - } - } - - var typeParameterArgumentMap = TypeScript.PullInstantiationHelpers.createTypeParameterArgumentMap(typeParameters, typeArguments); - return this.instantiateSignature(signature, typeParameterArgumentMap); - }; - - PullTypeResolver.typeCheck = function (compilationSettings, semanticInfoChain, document) { - var sourceUnit = document.sourceUnit(); - - var resolver = semanticInfoChain.getResolver(); - var context = new TypeScript.PullTypeResolutionContext(resolver, true, sourceUnit.fileName()); - - if (resolver.canTypeCheckAST(sourceUnit, context)) { - resolver.resolveAST(sourceUnit, false, context); - resolver.validateVariableDeclarationGroups(semanticInfoChain.getDeclForAST(sourceUnit), context); - - while (resolver.typeCheckCallBacks.length) { - var callBack = resolver.typeCheckCallBacks.pop(); - callBack(context); - } - - resolver.processPostTypeCheckWorkItems(context); - } - }; - - PullTypeResolver.prototype.validateVariableDeclarationGroups = function (enclosingDecl, context) { - var _this = this; - this.scanVariableDeclarationGroups(enclosingDecl, function (_) { - }, function (subsequentDecl, firstSymbol) { - if (TypeScript.hasFlag(subsequentDecl.kind, 2048 /* Parameter */) || TypeScript.hasFlag(subsequentDecl.flags, 8388608 /* PropertyParameter */)) { - return; - } - - var boundDeclAST = _this.semanticInfoChain.getASTForDecl(subsequentDecl); - - var symbol = subsequentDecl.getSymbol(); - var symbolType = symbol.type; - var firstSymbolType = firstSymbol.type; - - if (symbolType && firstSymbolType && symbolType !== firstSymbolType && !_this.typesAreIdentical(symbolType, firstSymbolType, context)) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(boundDeclAST, TypeScript.DiagnosticCode.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, [symbol.getScopedName(), firstSymbolType.toString(firstSymbol), symbolType.toString(symbol)])); - } - }); - }; - - PullTypeResolver.prototype.typeCheckFunctionOverloads = function (funcDecl, context, signature, allSignatures) { - if (!signature) { - var functionSignatureInfo = TypeScript.PullHelpers.getSignatureForFuncDecl(this.semanticInfoChain.getDeclForAST(funcDecl)); - signature = functionSignatureInfo.signature; - allSignatures = functionSignatureInfo.allSignatures; - } - var functionDeclaration = this.semanticInfoChain.getDeclForAST(funcDecl); - var funcSymbol = functionDeclaration.getSymbol(); - - var definitionSignature = null; - for (var i = allSignatures.length - 1; i >= 0; i--) { - if (allSignatures[i].isDefinition()) { - definitionSignature = allSignatures[i]; - break; - } - } - - if (!signature.isDefinition()) { - var signatureParentDecl = signature.getDeclarations()[0].getParentDecl(); - for (var i = 0; i < allSignatures.length; i++) { - if (allSignatures[i] === signature) { - break; - } - - var allSignaturesParentDecl = allSignatures[i].getDeclarations()[0].getParentDecl(); - if (allSignaturesParentDecl !== signatureParentDecl) { - continue; - } - - if (this.signaturesAreIdenticalWithNewEnclosingTypes(allSignatures[i], signature, context, false)) { - if (!this.signatureReturnTypesAreIdentical(allSignatures[i], signature, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overloads_cannot_differ_only_by_return_type)); - } else if (funcDecl.kind() === 137 /* ConstructorDeclaration */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_constructor_overload_signature)); - } else if (functionDeclaration.kind === 2097152 /* ConstructSignature */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_construct_signature)); - } else if (functionDeclaration.kind === 1048576 /* CallSignature */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_call_signature)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Duplicate_overload_signature_for_0, [funcSymbol.getScopedNameEx().toString()])); - } - - break; - } - } - } - - var isConstantOverloadSignature = signature.isStringConstantOverloadSignature(); - if (isConstantOverloadSignature) { - if (signature.isDefinition()) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_implementation_cannot_use_specialized_type)); - } else { - var foundSubtypeSignature = false; - for (var i = 0; i < allSignatures.length; i++) { - if (allSignatures[i].isDefinition() || allSignatures[i] === signature) { - continue; - } - - if (!allSignatures[i].isResolved) { - this.resolveDeclaredSymbol(allSignatures[i], context); - } - - if (allSignatures[i].isStringConstantOverloadSignature()) { - continue; - } - - if (this.signatureIsAssignableToTarget(signature, allSignatures[i], null, context)) { - foundSubtypeSignature = true; - break; - } - } - - if (!foundSubtypeSignature) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature)); - } - } - } else if (definitionSignature && definitionSignature !== signature) { - var comparisonInfo = new TypeComparisonInfo(); - - if (!definitionSignature.isResolved) { - this.resolveDeclaredSymbol(definitionSignature, context); - } - - if (!this.signatureIsAssignableToTarget(definitionSignature, signature, funcDecl, context, comparisonInfo)) { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_is_not_compatible_with_function_definition_NL_0, [comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, TypeScript.DiagnosticCode.Overload_signature_is_not_compatible_with_function_definition)); - } - } - } - - var signatureForVisibilityCheck = definitionSignature; - if (!definitionSignature) { - if (allSignatures[0] === signature) { - return; - } - signatureForVisibilityCheck = allSignatures[0]; - } - - if (funcDecl.kind() !== 137 /* ConstructorDeclaration */ && functionDeclaration.kind !== 2097152 /* ConstructSignature */ && signatureForVisibilityCheck && signature !== signatureForVisibilityCheck) { - var errorCode; - - if (signatureForVisibilityCheck.anyDeclHasFlag(2 /* Private */) !== signature.anyDeclHasFlag(2 /* Private */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_public_or_private; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(1 /* Exported */) !== signature.anyDeclHasFlag(1 /* Exported */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_exported_or_not_exported; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(8 /* Ambient */) !== signature.anyDeclHasFlag(8 /* Ambient */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_ambient_or_non_ambient; - } else if (signatureForVisibilityCheck.anyDeclHasFlag(128 /* Optional */) !== signature.anyDeclHasFlag(128 /* Optional */)) { - errorCode = TypeScript.DiagnosticCode.Overload_signatures_must_all_be_optional_or_required; - } - - if (errorCode) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(funcDecl, errorCode)); - } - } - }; - - PullTypeResolver.prototype.checkSymbolPrivacy = function (declSymbol, symbol, privacyErrorReporter) { - if (!symbol || symbol.kind === 2 /* Primitive */) { - return; - } - - if (symbol.isType()) { - var typeSymbol = symbol; - var isNamedType = typeSymbol.isNamedTypeSymbol(); - - if (typeSymbol.isArrayNamedTypeReference()) { - this.checkSymbolPrivacy(declSymbol, typeSymbol.getElementType(), privacyErrorReporter); - return; - } - - if (!isNamedType) { - var typeOfSymbol = typeSymbol.getTypeOfSymbol(); - if (typeOfSymbol) { - this.checkSymbolPrivacy(declSymbol, typeOfSymbol, privacyErrorReporter); - return; - } - } - - if (typeSymbol.inSymbolPrivacyCheck) { - return; - } - - typeSymbol.inSymbolPrivacyCheck = true; - - var typars = typeSymbol.getTypeArgumentsOrTypeParameters(); - if (typars) { - for (var i = 0; i < typars.length; i++) { - this.checkSymbolPrivacy(declSymbol, typars[i], privacyErrorReporter); - } - } - - if (!isNamedType) { - var members = typeSymbol.getMembers(); - for (var i = 0; i < members.length; i++) { - this.checkSymbolPrivacy(declSymbol, members[i].type, privacyErrorReporter); - } - - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getCallSignatures(), privacyErrorReporter); - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getConstructSignatures(), privacyErrorReporter); - this.checkTypePrivacyOfSignatures(declSymbol, typeSymbol.getIndexSignatures(), privacyErrorReporter); - } else if (typeSymbol.kind === 8192 /* TypeParameter */) { - this.checkSymbolPrivacy(declSymbol, typeSymbol.getConstraint(), privacyErrorReporter); - } - - typeSymbol.inSymbolPrivacyCheck = false; - - if (!isNamedType) { - return; - } - } - - if (declSymbol.isExternallyVisible()) { - var symbolIsVisible = symbol.isExternallyVisible(); - - if (symbolIsVisible && symbol.kind !== 8192 /* TypeParameter */) { - var symbolPath = symbol.pathToRoot(); - var declSymbolPath = declSymbol.pathToRoot(); - - if (symbolPath[symbolPath.length - 1].kind === 32 /* DynamicModule */ && declSymbolPath[declSymbolPath.length - 1].kind === 32 /* DynamicModule */ && declSymbolPath[declSymbolPath.length - 1] !== symbolPath[symbolPath.length - 1]) { - symbolIsVisible = false; - var declSymbolScope = declSymbolPath[declSymbolPath.length - 1]; - for (var i = symbolPath.length - 1; i >= 0; i--) { - var aliasSymbols = symbolPath[i].getExternalAliasedSymbols(declSymbolScope); - if (aliasSymbols) { - symbolIsVisible = true; - aliasSymbols[0].setTypeUsedExternally(); - break; - } - } - symbol = symbolPath[symbolPath.length - 1]; - } - } else if (symbol.kind === 128 /* TypeAlias */) { - var aliasSymbol = symbol; - symbolIsVisible = true; - aliasSymbol.setTypeUsedExternally(); - } - - if (!symbolIsVisible) { - privacyErrorReporter(symbol); - } - } - }; - - PullTypeResolver.prototype.checkTypePrivacyOfSignatures = function (declSymbol, signatures, privacyErrorReporter) { - for (var i = 0; i < signatures.length; i++) { - var signature = signatures[i]; - if (signatures.length > 1 && signature.isDefinition()) { - continue; - } - - var typeParams = signature.getTypeParameters(); - for (var j = 0; j < typeParams.length; j++) { - this.checkSymbolPrivacy(declSymbol, typeParams[j], privacyErrorReporter); - } - - var params = signature.parameters; - for (var j = 0; j < params.length; j++) { - var paramType = params[j].type; - this.checkSymbolPrivacy(declSymbol, paramType, privacyErrorReporter); - } - - var returnType = signature.returnType; - this.checkSymbolPrivacy(declSymbol, returnType, privacyErrorReporter); - } - }; - - PullTypeResolver.prototype.typeParameterOfTypeDeclarationPrivacyErrorReporter = function (classOrInterface, typeParameterAST, typeParameter, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - var messageCode; - - var typeParameters = classOrInterface.kind() === 131 /* ClassDeclaration */ ? classOrInterface.typeParameterList : classOrInterface.typeParameterList; - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_interface_is_using_inaccessible_module_1; - } - } else { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_interface_has_or_is_using_private_type_1; - } - } - - var messageArguments = [typeParameter.getScopedName(enclosingSymbol, false, true), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeParameterAST, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.baseListPrivacyErrorReporter = function (classOrInterface, declSymbol, baseAst, isExtendedType, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(classOrInterface); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - var messageCode; - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - if (isExtendedType) { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_extends_class_from_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_implements_interface_from_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_interface_0_extends_interface_from_inaccessible_module_1; - } - } else { - if (classOrInterface.kind() === 131 /* ClassDeclaration */) { - if (isExtendedType) { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_extends_private_class_1; - } else { - messageCode = TypeScript.DiagnosticCode.Exported_class_0_implements_private_interface_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_interface_0_extends_private_interface_1; - } - } - - var messageArguments = [declSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseAst, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.variablePrivacyErrorReporter = function (declAST, declSymbol, symbol, context) { - var typeSymbol = symbol; - var enclosingDecl = this.getEnclosingDecl(declSymbol.getDeclarations()[0]); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isProperty = declSymbol.kind === 4096 /* Property */; - var isPropertyOfClass = false; - var declParent = declSymbol.getContainer(); - if (declParent && (declParent.kind === 8 /* Class */ || declParent.kind === 32768 /* ConstructorMethod */)) { - isPropertyOfClass = true; - } - - var messageCode; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (declSymbol.anyDeclHasFlag(16 /* Static */)) { - messageCode = TypeScript.DiagnosticCode.Public_static_property_0_of_exported_class_is_using_inaccessible_module_1; - } else if (isProperty) { - if (isPropertyOfClass) { - messageCode = TypeScript.DiagnosticCode.Public_property_0_of_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Property_0_of_exported_interface_is_using_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_variable_0_is_using_inaccessible_module_1; - } - } else { - if (declSymbol.anyDeclHasFlag(16 /* Static */)) { - messageCode = TypeScript.DiagnosticCode.Public_static_property_0_of_exported_class_has_or_is_using_private_type_1; - } else if (isProperty) { - if (isPropertyOfClass) { - messageCode = TypeScript.DiagnosticCode.Public_property_0_of_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Property_0_of_exported_interface_has_or_is_using_private_type_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.Exported_variable_0_has_or_is_using_private_type_1; - } - } - - var messageArguments = [declSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declAST, messageCode, messageArguments)); - }; - - PullTypeResolver.prototype.checkFunctionTypePrivacy = function (funcDeclAST, isStatic, typeParameters, parameters, returnTypeAnnotation, block, context) { - var _this = this; - if (funcDeclAST.kind() === 222 /* FunctionExpression */ || funcDeclAST.kind() === 241 /* FunctionPropertyAssignment */ || (funcDeclAST.kind() === 139 /* GetAccessor */ && funcDeclAST.parent.parent.kind() === 215 /* ObjectLiteralExpression */) || (funcDeclAST.kind() === 140 /* SetAccessor */ && funcDeclAST.parent.parent.kind() === 215 /* ObjectLiteralExpression */)) { - return; - } - - var functionDecl = this.semanticInfoChain.getDeclForAST(funcDeclAST); - var functionSymbol = functionDecl.getSymbol(); - ; - var functionSignature; - - var isGetter = funcDeclAST.kind() === 139 /* GetAccessor */; - var isSetter = funcDeclAST.kind() === 140 /* SetAccessor */; - var isIndexSignature = functionDecl.kind === 4194304 /* IndexSignature */; - - if (isGetter || isSetter) { - var accessorSymbol = functionSymbol; - functionSignature = (isGetter ? accessorSymbol.getGetter() : accessorSymbol.getSetter()).type.getCallSignatures()[0]; - } else { - if (!functionSymbol) { - var parentDecl = functionDecl.getParentDecl(); - functionSymbol = parentDecl.getSymbol(); - if (functionSymbol && functionSymbol.isType() && !functionSymbol.isNamedTypeSymbol()) { - return; - } - } else if (functionSymbol.kind === 65536 /* Method */ && !isStatic && !functionSymbol.getContainer().isNamedTypeSymbol()) { - return; - } - functionSignature = functionDecl.getSignatureSymbol(); - } - - if (typeParameters && !isGetter && !isSetter && !isIndexSignature && funcDeclAST.kind() !== 137 /* ConstructorDeclaration */) { - for (var i = 0; i < typeParameters.typeParameters.nonSeparatorCount(); i++) { - var typeParameterAST = typeParameters.typeParameters.nonSeparatorAt(i); - var typeParameter = this.resolveTypeParameterDeclaration(typeParameterAST, context); - this.checkSymbolPrivacy(functionSymbol, typeParameter, function (symbol) { - return _this.functionTypeArgumentArgumentTypePrivacyErrorReporter(funcDeclAST, isStatic, typeParameterAST, typeParameter, symbol, context); - }); - } - } - - if (!isGetter && !isIndexSignature) { - var funcParams = functionSignature.parameters; - for (var i = 0; i < funcParams.length; i++) { - this.checkSymbolPrivacy(functionSymbol, funcParams[i].type, function (symbol) { - return _this.functionArgumentTypePrivacyErrorReporter(funcDeclAST, isStatic, parameters, i, funcParams[i], symbol, context); - }); - } - } - - if (!isSetter) { - this.checkSymbolPrivacy(functionSymbol, functionSignature.returnType, function (symbol) { - return _this.functionReturnTypePrivacyErrorReporter(funcDeclAST, isStatic, returnTypeAnnotation, block, functionSignature.returnType, symbol, context); - }); - } - }; - - PullTypeResolver.prototype.functionTypeArgumentArgumentTypePrivacyErrorReporter = function (declAST, isStatic, typeParameterAST, typeParameter, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - var messageCode; - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_function_is_using_inaccessible_module_1; - } - } else { - if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1; - } - } else { - messageCode = TypeScript.DiagnosticCode.TypeParameter_0_of_exported_function_has_or_is_using_private_type_1; - } - } - - if (messageCode) { - var messageArgs = [typeParameter.getScopedName(enclosingSymbol, false, true), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(typeParameterAST, messageCode, messageArgs)); - } - }; - - PullTypeResolver.prototype.functionArgumentTypePrivacyErrorReporter = function (declAST, isStatic, parameters, argIndex, paramSymbol, symbol, context) { - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - var enclosingSymbol = enclosingDecl ? enclosingDecl.getSymbol() : null; - - var isGetter = declAST.kind() === 139 /* GetAccessor */; - var isSetter = declAST.kind() === 140 /* SetAccessor */; - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingSymbol); - var messageCode; - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (declAST.kind() === 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_from_exported_class_is_using_inaccessible_module_1; - } else if (isSetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_property_setter_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_property_setter_from_exported_class_is_using_inaccessible_module_1; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_call_signature_from_exported_interface_is_using_inaccessible_module_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_method_from_exported_class_is_using_inaccessible_module_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_method_from_exported_class_is_using_inaccessible_module_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_method_from_exported_interface_is_using_inaccessible_module_1; - } - } else if (!isGetter) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_exported_function_is_using_inaccessible_module_1; - } - } else { - if (declAST.kind() === 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_type_1; - } else if (isSetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_type_1; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_type_1; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_type_1; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_type_1; - } else { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_type_1; - } - } else if (!isGetter && decl.kind !== 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Parameter_0_of_exported_function_has_or_is_using_private_type_1; - } - } - - if (messageCode) { - var parameter = parameters.astAt(argIndex); - - var messageArgs = [paramSymbol.getScopedName(enclosingSymbol), typeSymbolName]; - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(parameter, messageCode, messageArgs)); - } - }; - - PullTypeResolver.prototype.functionReturnTypePrivacyErrorReporter = function (declAST, isStatic, returnTypeAnnotation, block, funcReturnType, symbol, context) { - var _this = this; - var decl = this.semanticInfoChain.getDeclForAST(declAST); - var enclosingDecl = this.getEnclosingDecl(decl); - - var isGetter = declAST.kind() === 139 /* GetAccessor */; - var isSetter = declAST.kind() === 140 /* SetAccessor */; - var isMethod = decl.kind === 65536 /* Method */; - var isMethodOfClass = false; - var declParent = decl.getParentDecl(); - if (declParent && (declParent.kind === 8 /* Class */ || isStatic)) { - isMethodOfClass = true; - } - - var messageCode = null; - var typeSymbol = symbol; - var typeSymbolName = typeSymbol.getScopedName(enclosingDecl ? enclosingDecl.getSymbol() : null); - if (typeSymbol.isContainer() && !typeSymbol.isEnum()) { - if (!TypeScript.isQuoted(typeSymbolName)) { - typeSymbolName = "'" + typeSymbolName + "'"; - } - - if (isGetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_property_getter_from_exported_class_is_using_inaccessible_module_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_property_getter_from_exported_class_is_using_inaccessible_module_0; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_constructor_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_call_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (decl.kind === 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_index_signature_from_exported_interface_is_using_inaccessible_module_0; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_method_from_exported_class_is_using_inaccessible_module_0; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_method_from_exported_class_is_using_inaccessible_module_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_method_from_exported_interface_is_using_inaccessible_module_0; - } - } else if (!isSetter && declAST.kind() !== 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_exported_function_is_using_inaccessible_module_0; - } - } else { - if (isGetter) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_type_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_type_0; - } - } else if (decl.kind === 2097152 /* ConstructSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (decl.kind === 1048576 /* CallSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (decl.kind === 4194304 /* IndexSignature */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_type_0; - } else if (isMethod) { - if (isStatic) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_type_0; - } else if (isMethodOfClass) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_public_method_from_exported_class_has_or_is_using_private_type_0; - } else { - messageCode = TypeScript.DiagnosticCode.Return_type_of_method_from_exported_interface_has_or_is_using_private_type_0; - } - } else if (!isSetter && declAST.kind() !== 137 /* ConstructorDeclaration */) { - messageCode = TypeScript.DiagnosticCode.Return_type_of_exported_function_has_or_is_using_private_type_0; - } - } - - if (messageCode) { - var messageArguments = [typeSymbolName]; - var reportOnFuncDecl = false; - - if (returnTypeAnnotation) { - var returnExpressionSymbol = this.resolveTypeReference(returnTypeAnnotation, context); - - if (TypeScript.PullHelpers.typeSymbolsAreIdentical(returnExpressionSymbol, funcReturnType)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(returnTypeAnnotation, messageCode, messageArguments)); - } - } - - if (block) { - var reportErrorOnReturnExpressions = function (ast, walker) { - var go = true; - switch (ast.kind()) { - case 129 /* FunctionDeclaration */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - case 222 /* FunctionExpression */: - go = false; - break; - - case 150 /* ReturnStatement */: - var returnStatement = ast; - var returnExpressionSymbol = _this.resolveAST(returnStatement.expression, false, context).type; - - if (TypeScript.PullHelpers.typeSymbolsAreIdentical(returnExpressionSymbol, funcReturnType)) { - context.postDiagnostic(_this.semanticInfoChain.diagnosticFromAST(returnStatement, messageCode, messageArguments)); - } else { - reportOnFuncDecl = true; - } - go = false; - break; - - default: - break; - } - - walker.options.goChildren = go; - return ast; - }; - - TypeScript.getAstWalkerFactory().walk(block, reportErrorOnReturnExpressions); - } - - if (reportOnFuncDecl) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(declAST, messageCode, messageArguments)); - } - } - }; - - PullTypeResolver.prototype.enclosingClassIsDerived = function (classDecl) { - TypeScript.Debug.assert(classDecl.kind === 8 /* Class */); - - var classSymbol = classDecl.getSymbol(); - return classSymbol.getExtendedTypes().length > 0; - }; - - PullTypeResolver.prototype.isSuperInvocationExpression = function (ast) { - if (ast.kind() === 213 /* InvocationExpression */) { - var invocationExpression = ast; - if (invocationExpression.expression.kind() === 50 /* SuperKeyword */) { - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.isSuperInvocationExpressionStatement = function (node) { - if (node && node.kind() === 149 /* ExpressionStatement */) { - var expressionStatement = node; - if (this.isSuperInvocationExpression(expressionStatement.expression)) { - return true; - } - } - return false; - }; - - PullTypeResolver.prototype.getFirstStatementOfBlockOrNull = function (block) { - if (block && block.statements && block.statements.childCount() > 0) { - return block.statements.childAt(0); - } - - return null; - }; - - PullTypeResolver.prototype.superCallMustBeFirstStatementInConstructor = function (constructorDecl) { - TypeScript.Debug.assert(constructorDecl.kind === 32768 /* ConstructorMethod */); - - if (constructorDecl) { - var enclosingClass = constructorDecl.getParentDecl(); - - var classSymbol = enclosingClass.getSymbol(); - if (classSymbol.getExtendedTypes().length === 0) { - return false; - } - - var classMembers = classSymbol.getMembers(); - for (var i = 0, n1 = classMembers.length; i < n1; i++) { - var member = classMembers[i]; - - if (member.kind === 4096 /* Property */) { - var declarations = member.getDeclarations(); - for (var j = 0, n2 = declarations.length; j < n2; j++) { - var declaration = declarations[j]; - var ast = this.semanticInfoChain.getASTForDecl(declaration); - if (ast.kind() === 242 /* Parameter */) { - return true; - } - - if (ast.kind() === 136 /* MemberVariableDeclaration */) { - var variableDeclarator = ast; - if (variableDeclarator.variableDeclarator.equalsValueClause) { - return true; - } - } - } - } - } - } - - return false; - }; - - PullTypeResolver.prototype.checkForThisCaptureInArrowFunction = function (expression) { - var enclosingDecl = this.getEnclosingDeclForAST(expression); - - var declPath = enclosingDecl.getParentPath(); - - if (declPath.length) { - var inArrowFunction = false; - for (var i = declPath.length - 1; i >= 0; i--) { - var decl = declPath[i]; - var declKind = decl.kind; - var declFlags = decl.flags; - - if (declKind === 131072 /* FunctionExpression */ && TypeScript.hasFlag(declFlags, 8192 /* ArrowFunction */)) { - inArrowFunction = true; - continue; - } - - if (inArrowFunction) { - if (declKind === 16384 /* Function */ || declKind === 65536 /* Method */ || declKind === 32768 /* ConstructorMethod */ || declKind === 262144 /* GetAccessor */ || declKind === 524288 /* SetAccessor */ || declKind === 131072 /* FunctionExpression */ || declKind === 8 /* Class */ || declKind === 4 /* Container */ || declKind === 32 /* DynamicModule */ || declKind === 1 /* Script */) { - decl.setFlags(decl.flags | 262144 /* MustCaptureThis */); - - if (declKind === 8 /* Class */) { - var constructorSymbol = decl.getSymbol().getConstructorMethod(); - var constructorDecls = constructorSymbol.getDeclarations(); - for (var i = 0; i < constructorDecls.length; i++) { - constructorDecls[i].flags = constructorDecls[i].flags | 262144 /* MustCaptureThis */; - } - } - break; - } - } else if (declKind === 16384 /* Function */ || declKind === 131072 /* FunctionExpression */) { - break; - } - } - } - }; - - PullTypeResolver.prototype.typeCheckMembersAgainstIndexer = function (containerType, containerTypeDecl, context) { - var indexSignatures = this.getBothKindsOfIndexSignaturesExcludingAugmentedType(containerType, context); - var stringSignature = indexSignatures.stringSignature; - var numberSignature = indexSignatures.numericSignature; - - if (stringSignature || numberSignature) { - var members = containerTypeDecl.getChildDecls(); - for (var i = 0; i < members.length; i++) { - var member = members[i]; - if ((member.name || (member.kind === 4096 /* Property */ && member.name === "")) && member.kind !== 32768 /* ConstructorMethod */ && !TypeScript.hasFlag(member.flags, 16 /* Static */)) { - var memberSymbol = member.getSymbol(); - var relevantSignature = this.determineRelevantIndexerForMember(memberSymbol, numberSignature, stringSignature); - if (relevantSignature) { - var comparisonInfo = new TypeComparisonInfo(); - if (!this.sourceIsAssignableToTarget(memberSymbol.type, relevantSignature.returnType, member.ast(), context, comparisonInfo)) { - this.reportErrorThatMemberIsNotSubtypeOfIndexer(memberSymbol, relevantSignature, member.ast(), context, comparisonInfo); - } - } - } - } - } - }; - - PullTypeResolver.prototype.determineRelevantIndexerForMember = function (member, numberIndexSignature, stringIndexSignature) { - if (numberIndexSignature && TypeScript.PullHelpers.isNameNumeric(member.name)) { - return numberIndexSignature; - } else if (stringIndexSignature) { - return stringIndexSignature; - } - - return null; - }; - - PullTypeResolver.prototype.reportErrorThatMemberIsNotSubtypeOfIndexer = function (member, indexSignature, astForError, context, comparisonInfo) { - var enclosingSymbol = this.getEnclosingSymbolForAST(astForError); - if (indexSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol) { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0_NL_1, [indexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_numerically_named_properties_must_be_assignable_to_numeric_indexer_type_0, [indexSignature.returnType.toString(enclosingSymbol)])); - } - } else { - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_named_properties_must_be_assignable_to_string_indexer_type_0_NL_1, [indexSignature.returnType.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(astForError, TypeScript.DiagnosticCode.All_named_properties_must_be_assignable_to_string_indexer_type_0, [indexSignature.returnType.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.typeCheckIfTypeMemberPropertyOkToOverride = function (typeSymbol, extendedType, typeMember, extendedTypeMember, enclosingDecl, comparisonInfo) { - if (!typeSymbol.isClass()) { - return true; - } - - var typeMemberKind = typeMember.kind; - var extendedMemberKind = extendedTypeMember.kind; - - if (typeMemberKind === extendedMemberKind) { - return true; - } - - var errorCode; - if (typeMemberKind === 4096 /* Property */) { - if (typeMember.isAccessor()) { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } else { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - } else if (typeMemberKind === 65536 /* Method */) { - if (extendedTypeMember.isAccessor()) { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } else { - errorCode = TypeScript.DiagnosticCode.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; - } - } - - var message = TypeScript.getDiagnosticMessage(errorCode, [typeSymbol.toString(), typeMember.getScopedNameEx().toString(), extendedType.toString()]); - comparisonInfo.addMessage(message); - return false; - }; - - PullTypeResolver.prototype.typeCheckIfTypeExtendsType = function (classOrInterface, name, typeSymbol, extendedType, enclosingDecl, context) { - var typeMembers = typeSymbol.getMembers(); - - var comparisonInfo = new TypeComparisonInfo(); - var foundError = false; - var foundError1 = false; - var foundError2 = false; - - for (var i = 0; i < typeMembers.length; i++) { - var propName = typeMembers[i].name; - var extendedTypeProp = extendedType.findMember(propName, true); - if (extendedTypeProp) { - this.resolveDeclaredSymbol(extendedTypeProp, context); - foundError1 = !this.typeCheckIfTypeMemberPropertyOkToOverride(typeSymbol, extendedType, typeMembers[i], extendedTypeProp, enclosingDecl, comparisonInfo); - - if (!foundError1) { - foundError2 = !this.sourcePropertyIsAssignableToTargetProperty(typeSymbol, extendedType, typeMembers[i], extendedTypeProp, classOrInterface, context, comparisonInfo); - } - - if (foundError1 || foundError2) { - foundError = true; - break; - } - } - } - - if (!foundError && typeSymbol.hasOwnCallSignatures()) { - foundError = !this.sourceCallSignaturesAreAssignableToTargetCallSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.hasOwnConstructSignatures()) { - foundError = !this.sourceConstructSignaturesAreAssignableToTargetConstructSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.hasOwnIndexSignatures()) { - foundError = !this.sourceIndexSignaturesAreAssignableToTargetIndexSignatures(typeSymbol, extendedType, classOrInterface, context, comparisonInfo); - } - - if (!foundError && typeSymbol.isClass()) { - var typeConstructorType = typeSymbol.getConstructorMethod().type; - var typeConstructorTypeMembers = typeConstructorType.getMembers(); - if (typeConstructorTypeMembers.length) { - var extendedConstructorType = extendedType.getConstructorMethod().type; - var comparisonInfoForPropTypeCheck = new TypeComparisonInfo(comparisonInfo); - - for (var i = 0; i < typeConstructorTypeMembers.length; i++) { - var propName = typeConstructorTypeMembers[i].name; - var extendedConstructorTypeProp = extendedConstructorType.findMember(propName, true); - if (extendedConstructorTypeProp) { - if (!extendedConstructorTypeProp.isResolved) { - this.resolveDeclaredSymbol(extendedConstructorTypeProp, context); - } - - if (!this.sourcePropertyIsAssignableToTargetProperty(typeConstructorType, extendedConstructorType, typeConstructorTypeMembers[i], extendedConstructorTypeProp, classOrInterface, context, comparisonInfo)) { - foundError = true; - break; - } - } - } - } - } - - if (foundError) { - var errorCode; - if (typeSymbol.isClass()) { - errorCode = TypeScript.DiagnosticCode.Class_0_cannot_extend_class_1_NL_2; - } else { - if (extendedType.isClass()) { - errorCode = TypeScript.DiagnosticCode.Interface_0_cannot_extend_class_1_NL_2; - } else { - errorCode = TypeScript.DiagnosticCode.Interface_0_cannot_extend_interface_1_NL_2; - } - } - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, errorCode, [typeSymbol.getScopedName(), extendedType.getScopedName(), comparisonInfo.message])); - } - }; - - PullTypeResolver.prototype.typeCheckIfClassImplementsType = function (classDecl, classSymbol, implementedType, enclosingDecl, context) { - var comparisonInfo = new TypeComparisonInfo(); - var foundError = !this.sourceMembersAreAssignableToTargetMembers(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceCallSignaturesAreAssignableToTargetCallSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceConstructSignaturesAreAssignableToTargetConstructSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - if (!foundError) { - foundError = !this.sourceIndexSignaturesAreAssignableToTargetIndexSignatures(classSymbol, implementedType, classDecl, context, comparisonInfo); - } - } - } - - if (foundError) { - var enclosingSymbol = this.getEnclosingSymbolForAST(classDecl); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(classDecl.identifier, TypeScript.DiagnosticCode.Class_0_declares_interface_1_but_does_not_implement_it_NL_2, [classSymbol.getScopedName(enclosingSymbol), implementedType.getScopedName(enclosingSymbol), comparisonInfo.message])); - } - }; - - PullTypeResolver.prototype.computeValueSymbolFromAST = function (valueDeclAST, context) { - var prevInTypeCheck = context.inTypeCheck; - context.inTypeCheck = false; - - var typeSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(valueDeclAST); - - if (valueDeclAST.kind() == 11 /* IdentifierName */) { - var valueSymbol = this.computeNameExpression(valueDeclAST, context); - } else { - TypeScript.Debug.assert(valueDeclAST.kind() == 121 /* QualifiedName */); - var qualifiedName = valueDeclAST; - - var lhs = this.computeValueSymbolFromAST(qualifiedName.left, context); - var valueSymbol = this.computeDottedNameExpressionFromLHS(lhs.symbol, qualifiedName.left, qualifiedName.right, context, false); - } - var valueSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(valueDeclAST); - - this.semanticInfoChain.setAliasSymbolForAST(valueDeclAST, typeSymbolAlias); - context.inTypeCheck = prevInTypeCheck; - - return { symbol: valueSymbol, alias: valueSymbolAlias }; - }; - - PullTypeResolver.prototype.hasClassTypeSymbolConflictAsValue = function (baseDeclAST, typeSymbol, enclosingDecl, context) { - var typeSymbolAlias = this.semanticInfoChain.getAliasSymbolForAST(baseDeclAST); - - var valueDeclAST = baseDeclAST.kind() == 126 /* GenericType */ ? baseDeclAST.name : baseDeclAST; - var valueSymbolInfo = this.computeValueSymbolFromAST(valueDeclAST, context); - var valueSymbol = valueSymbolInfo.symbol; - var valueSymbolAlias = valueSymbolInfo.alias; - - if (typeSymbolAlias && valueSymbolAlias) { - return typeSymbolAlias !== valueSymbolAlias; - } - - if (!valueSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */)) { - return true; - } - - var associatedContainerType = valueSymbol.type ? valueSymbol.type.getAssociatedContainerType() : null; - - if (associatedContainerType) { - return associatedContainerType !== typeSymbol.getRootSymbol(); - } - - return true; - }; - - PullTypeResolver.prototype.typeCheckBase = function (classOrInterface, name, typeSymbol, baseDeclAST, isExtendedType, enclosingDecl, context) { - var _this = this; - var typeDecl = this.semanticInfoChain.getDeclForAST(classOrInterface); - - var baseType = this.resolveTypeReference(baseDeclAST, context).type; - - if (!baseType) { - return; - } - - var typeDeclIsClass = typeSymbol.isClass(); - - if (!typeSymbol.isValidBaseKind(baseType, isExtendedType)) { - if (!baseType.isError()) { - if (isExtendedType) { - if (typeDeclIsClass) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.A_class_may_only_extend_another_class)); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.An_interface_may_only_extend_another_class_or_interface)); - } - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.A_class_may_only_implement_another_class_or_interface)); - } - } - return; - } else if (typeDeclIsClass && isExtendedType) { - if (this.hasClassTypeSymbolConflictAsValue(baseDeclAST, baseType, enclosingDecl, context)) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(baseDeclAST, TypeScript.DiagnosticCode.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_1, [TypeScript.ASTHelpers.getNameOfIdenfierOrQualifiedName(baseDeclAST.kind() == 126 /* GenericType */ ? baseDeclAST.name : baseDeclAST), baseType.toString(enclosingDecl ? enclosingDecl.getSymbol() : null)])); - } - } - - if (baseType.hasBase(typeSymbol)) { - typeSymbol.setHasBaseTypeConflict(); - baseType.setHasBaseTypeConflict(); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, typeDeclIsClass ? TypeScript.DiagnosticCode.Class_0_is_recursively_referenced_as_a_base_type_of_itself : TypeScript.DiagnosticCode.Interface_0_is_recursively_referenced_as_a_base_type_of_itself, [typeSymbol.getScopedName()])); - return; - } - - if (isExtendedType) { - this.typeCheckCallBacks.push(function (context) { - return _this.typeCheckIfTypeExtendsType(classOrInterface, name, typeSymbol, baseType, enclosingDecl, context); - }); - } else { - TypeScript.Debug.assert(classOrInterface.kind() === 131 /* ClassDeclaration */); - - this.typeCheckCallBacks.push(function (context) { - return _this.typeCheckIfClassImplementsType(classOrInterface, typeSymbol, baseType, enclosingDecl, context); - }); - } - - this.checkSymbolPrivacy(typeSymbol, baseType, function (errorSymbol) { - return _this.baseListPrivacyErrorReporter(classOrInterface, typeSymbol, baseDeclAST, isExtendedType, errorSymbol, context); - }); - }; - - PullTypeResolver.prototype.typeCheckBases = function (classOrInterface, name, heritageClauses, typeSymbol, enclosingDecl, context) { - var _this = this; - var extendsClause = TypeScript.ASTHelpers.getExtendsHeritageClause(heritageClauses); - var implementsClause = TypeScript.ASTHelpers.getImplementsHeritageClause(heritageClauses); - if (!extendsClause && !implementsClause) { - return; - } - - if (extendsClause) { - for (var i = 0; i < extendsClause.typeNames.nonSeparatorCount(); i++) { - this.typeCheckBase(classOrInterface, name, typeSymbol, extendsClause.typeNames.nonSeparatorAt(i), true, enclosingDecl, context); - } - } - - if (typeSymbol.isClass()) { - if (implementsClause) { - for (var i = 0; i < implementsClause.typeNames.nonSeparatorCount(); i++) { - this.typeCheckBase(classOrInterface, name, typeSymbol, implementsClause.typeNames.nonSeparatorAt(i), false, enclosingDecl, context); - } - } - } else if (extendsClause && !typeSymbol.hasBaseTypeConflict() && typeSymbol.getExtendedTypes().length > 1) { - var firstInterfaceASTWithExtendsClause = TypeScript.ArrayUtilities.firstOrDefault(typeSymbol.getDeclarations(), function (decl) { - return decl.ast().heritageClauses !== null; - }).ast(); - if (classOrInterface === firstInterfaceASTWithExtendsClause) { - this.typeCheckCallBacks.push(function (context) { - _this.checkTypeCompatibilityBetweenBases(classOrInterface.identifier, typeSymbol, context); - }); - } - } - }; - - PullTypeResolver.prototype.checkTypeCompatibilityBetweenBases = function (name, typeSymbol, context) { - var derivedIndexSignatures = typeSymbol.getOwnIndexSignatures(); - - var inheritedMembersMap = TypeScript.createIntrinsicsObject(); - var inheritedIndexSignatures = new InheritedIndexSignatureInfo(); - - var typeHasOwnNumberIndexer = false; - var typeHasOwnStringIndexer = false; - - if (typeSymbol.hasOwnIndexSignatures()) { - var ownIndexSignatures = typeSymbol.getOwnIndexSignatures(); - for (var i = 0; i < ownIndexSignatures.length; i++) { - if (ownIndexSignatures[i].parameters[0].type === this.semanticInfoChain.numberTypeSymbol) { - typeHasOwnNumberIndexer = true; - } else { - typeHasOwnStringIndexer = true; - } - } - } - var baseTypes = typeSymbol.getExtendedTypes(); - for (var i = 0; i < baseTypes.length; i++) { - if (this.checkNamedPropertyIdentityBetweenBases(name, typeSymbol, baseTypes[i], inheritedMembersMap, context) || this.checkIndexSignatureIdentityBetweenBases(name, typeSymbol, baseTypes[i], inheritedIndexSignatures, typeHasOwnNumberIndexer, typeHasOwnStringIndexer, context)) { - return; - } - } - - if (this.checkThatInheritedNumberSignatureIsSubtypeOfInheritedStringSignature(name, typeSymbol, inheritedIndexSignatures, context)) { - return; - } - - this.checkInheritedMembersAgainstInheritedIndexSignatures(name, typeSymbol, inheritedIndexSignatures, inheritedMembersMap, context); - }; - - PullTypeResolver.prototype.checkNamedPropertyIdentityBetweenBases = function (interfaceName, interfaceSymbol, baseTypeSymbol, inheritedMembersMap, context) { - var baseMembers = baseTypeSymbol.getAllMembers(4096 /* Property */ | 65536 /* Method */, 0 /* all */); - for (var i = 0; i < baseMembers.length; i++) { - var member = baseMembers[i]; - var memberName = member.name; - - if (interfaceSymbol.findMember(memberName, false)) { - continue; - } - - this.resolveDeclaredSymbol(member, context); - - if (inheritedMembersMap[memberName]) { - var prevMember = inheritedMembersMap[memberName]; - if (prevMember.baseOrigin !== baseTypeSymbol && !this.propertiesAreIdenticalWithNewEnclosingTypes(baseTypeSymbol, prevMember.baseOrigin, member, prevMember.memberSymbol, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Named_properties_0_of_types_1_and_2_are_not_identical, [memberName, prevMember.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), prevMember.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - inheritedMembersMap[memberName] = new MemberWithBaseOrigin(member, baseTypeSymbol); - } - } - - return false; - }; - - PullTypeResolver.prototype.checkIndexSignatureIdentityBetweenBases = function (interfaceName, interfaceSymbol, baseTypeSymbol, allInheritedSignatures, derivedTypeHasOwnNumberSignature, derivedTypeHasOwnStringSignature, context) { - if (derivedTypeHasOwnNumberSignature && derivedTypeHasOwnStringSignature) { - return false; - } - - var indexSignaturesFromThisBaseType = baseTypeSymbol.getIndexSignatures(); - for (var i = 0; i < indexSignaturesFromThisBaseType.length; i++) { - var currentInheritedSignature = indexSignaturesFromThisBaseType[i]; - - var parameterTypeIsString = currentInheritedSignature.parameters[0].type === this.semanticInfoChain.stringTypeSymbol; - var parameterTypeIsNumber = currentInheritedSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol; - - if (parameterTypeIsString && derivedTypeHasOwnStringSignature || parameterTypeIsNumber && derivedTypeHasOwnNumberSignature) { - continue; - } - - if (parameterTypeIsString) { - if (allInheritedSignatures.stringSignatureWithBaseOrigin) { - if (allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin !== baseTypeSymbol && !this.typesAreIdentical(allInheritedSignatures.stringSignatureWithBaseOrigin.signature.returnType, currentInheritedSignature.returnType, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_of_string_indexer_of_types_0_and_1_are_not_identical, [allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), allInheritedSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - allInheritedSignatures.stringSignatureWithBaseOrigin = new SignatureWithBaseOrigin(currentInheritedSignature, baseTypeSymbol); - } - } else if (parameterTypeIsNumber) { - if (allInheritedSignatures.numberSignatureWithBaseOrigin) { - if (allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin !== baseTypeSymbol && !this.typesAreIdentical(allInheritedSignatures.numberSignatureWithBaseOrigin.signature.returnType, currentInheritedSignature.returnType, context)) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Types_of_number_indexer_of_types_0_and_1_are_not_identical, [allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName()]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(), allInheritedSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), baseTypeSymbol.getScopedName(), innerDiagnostic])); - return true; - } - } else { - allInheritedSignatures.numberSignatureWithBaseOrigin = new SignatureWithBaseOrigin(currentInheritedSignature, baseTypeSymbol); - } - } - } - - return false; - }; - - PullTypeResolver.prototype.checkInheritedMembersAgainstInheritedIndexSignatures = function (interfaceName, interfaceSymbol, inheritedIndexSignatures, inheritedMembers, context) { - if (!inheritedIndexSignatures.stringSignatureWithBaseOrigin && !inheritedIndexSignatures.numberSignatureWithBaseOrigin) { - return false; - } - - var comparisonInfo = new TypeComparisonInfo(); - var stringSignature = inheritedIndexSignatures.stringSignatureWithBaseOrigin && inheritedIndexSignatures.stringSignatureWithBaseOrigin.signature; - var numberSignature = inheritedIndexSignatures.numberSignatureWithBaseOrigin && inheritedIndexSignatures.numberSignatureWithBaseOrigin.signature; - for (var memberName in inheritedMembers) { - var memberWithBaseOrigin = inheritedMembers[memberName]; - if (!memberWithBaseOrigin) { - continue; - } - - var relevantSignature = this.determineRelevantIndexerForMember(memberWithBaseOrigin.memberSymbol, numberSignature, stringSignature); - if (!relevantSignature) { - continue; - } - - var relevantSignatureIsNumberSignature = relevantSignature.parameters[0].type === this.semanticInfoChain.numberTypeSymbol; - var signatureBaseOrigin = relevantSignatureIsNumberSignature ? inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin : inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin; - - if (signatureBaseOrigin === memberWithBaseOrigin.baseOrigin) { - continue; - } - - var memberIsSubtype = this.sourceIsAssignableToTarget(memberWithBaseOrigin.memberSymbol.type, relevantSignature.returnType, interfaceName, context, comparisonInfo); - - if (!memberIsSubtype) { - var enclosingSymbol = this.getEnclosingSymbolForAST(interfaceName); - if (relevantSignatureIsNumberSignature) { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_property_0_in_type_1_is_not_assignable_to_number_indexer_type_in_type_2_NL_3, [memberName, memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(enclosingSymbol), memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - } else { - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_property_0_in_type_1_is_not_assignable_to_string_indexer_type_in_type_2_NL_3, [memberName, memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [interfaceSymbol.getDisplayName(enclosingSymbol), memberWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - } - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.checkThatInheritedNumberSignatureIsSubtypeOfInheritedStringSignature = function (interfaceName, interfaceSymbol, inheritedIndexSignatures, context) { - if (inheritedIndexSignatures.numberSignatureWithBaseOrigin && inheritedIndexSignatures.stringSignatureWithBaseOrigin) { - if (inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin === inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin) { - return false; - } - - var comparisonInfo = new TypeComparisonInfo(); - var signatureIsSubtype = this.sourceIsAssignableToTarget(inheritedIndexSignatures.numberSignatureWithBaseOrigin.signature.returnType, inheritedIndexSignatures.stringSignatureWithBaseOrigin.signature.returnType, interfaceName, context, comparisonInfo); - - if (!signatureIsSubtype) { - var enclosingSymbol = this.getEnclosingSymbolForAST(interfaceName); - var innerDiagnostic = TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.Type_of_number_indexer_in_type_0_is_not_assignable_to_string_indexer_type_in_type_1_NL_2, [ - inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), - inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), comparisonInfo.message]); - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(interfaceName, TypeScript.DiagnosticCode.Interface_0_cannot_simultaneously_extend_types_1_and_2_NL_3, [ - interfaceSymbol.getDisplayName(enclosingSymbol), inheritedIndexSignatures.numberSignatureWithBaseOrigin.baseOrigin.getScopedName(), - inheritedIndexSignatures.stringSignatureWithBaseOrigin.baseOrigin.getScopedName(enclosingSymbol), innerDiagnostic])); - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.checkAssignability = function (ast, source, target, context) { - var comparisonInfo = new TypeComparisonInfo(); - - var isAssignable = this.sourceIsAssignableToTarget(source, target, ast, context, comparisonInfo); - - if (!isAssignable) { - var enclosingSymbol = this.getEnclosingSymbolForAST(ast); - if (comparisonInfo.message) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Cannot_convert_0_to_1_NL_2, [source.toString(enclosingSymbol), target.toString(enclosingSymbol), comparisonInfo.message])); - } else { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Cannot_convert_0_to_1, [source.toString(enclosingSymbol), target.toString(enclosingSymbol)])); - } - } - }; - - PullTypeResolver.prototype.isReference = function (ast, astSymbol) { - if (ast.kind() === 217 /* ParenthesizedExpression */) { - return this.isReference(ast.expression, astSymbol); - } - - if (ast.kind() !== 11 /* IdentifierName */ && ast.kind() !== 212 /* MemberAccessExpression */ && ast.kind() !== 221 /* ElementAccessExpression */) { - return false; - } - - if (ast.kind() === 11 /* IdentifierName */) { - if (astSymbol.kind === 512 /* Variable */ && astSymbol.anyDeclHasFlag(4096 /* Enum */)) { - return false; - } - - if (astSymbol.kind === 512 /* Variable */ && astSymbol.anyDeclHasFlag(102400 /* SomeInitializedModule */)) { - return false; - } - - if (astSymbol.kind === 32768 /* ConstructorMethod */ || astSymbol.kind === 16384 /* Function */) { - return false; - } - } - - if (ast.kind() === 212 /* MemberAccessExpression */ && astSymbol.kind === 67108864 /* EnumMember */) { - return false; - } - - return true; - }; - - PullTypeResolver.prototype.checkForSuperMemberAccess = function (expression, name, resolvedName, context) { - if (resolvedName) { - if (expression.kind() === 50 /* SuperKeyword */ && !resolvedName.isError() && resolvedName.kind !== 65536 /* Method */) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode.Only_public_methods_of_the_base_class_are_accessible_via_the_super_keyword)); - return true; - } - } - - return false; - }; - - PullTypeResolver.prototype.getEnclosingDeclForAST = function (ast) { - return this.semanticInfoChain.getEnclosingDecl(ast); - }; - - PullTypeResolver.prototype.getEnclosingSymbolForAST = function (ast) { - var enclosingDecl = this.getEnclosingDeclForAST(ast); - return enclosingDecl ? enclosingDecl.getSymbol() : null; - }; - - PullTypeResolver.prototype.checkForPrivateMemberAccess = function (name, expressionType, resolvedName, context) { - if (resolvedName) { - if (resolvedName.anyDeclHasFlag(2 /* Private */)) { - var memberContainer = resolvedName.getContainer(); - if (memberContainer && memberContainer.kind === 33554432 /* ConstructorType */) { - memberContainer = memberContainer.getAssociatedContainerType(); - } - - if (memberContainer && memberContainer.isClass()) { - var memberClass = memberContainer.getDeclarations()[0].ast(); - TypeScript.Debug.assert(memberClass); - - var containingClass = this.getEnclosingClassDeclaration(name); - - if (!containingClass || containingClass !== memberClass) { - context.postDiagnostic(this.semanticInfoChain.diagnosticFromAST(name, TypeScript.DiagnosticCode._0_1_is_inaccessible, [memberContainer.toString(null, false), name.text()])); - return true; - } - } - } - } - - return false; - }; - - PullTypeResolver.prototype.instantiateType = function (type, typeParameterArgumentMap) { - if (type.isPrimitive()) { - return type; - } - - if (type.isError()) { - return type; - } - - if (typeParameterArgumentMap[type.pullSymbolID]) { - return typeParameterArgumentMap[type.pullSymbolID]; - } - - type._resolveDeclaredSymbol(); - if (type.isTypeParameter()) { - return this.instantiateTypeParameter(type, typeParameterArgumentMap); - } - - if (type.wrapsSomeTypeParameter(typeParameterArgumentMap)) { - return TypeScript.PullInstantiatedTypeReferenceSymbol.create(this, type, typeParameterArgumentMap); - } - - return type; - }; - - PullTypeResolver.prototype.instantiateTypeParameter = function (typeParameter, typeParameterArgumentMap) { - var constraint = typeParameter.getConstraint(); - if (!constraint) { - return typeParameter; - } - - var instantiatedConstraint = this.instantiateType(constraint, typeParameterArgumentMap); - - if (instantiatedConstraint == constraint) { - return typeParameter; - } - - var rootTypeParameter = typeParameter.getRootSymbol(); - var instantiation = rootTypeParameter.getSpecialization([instantiatedConstraint]); - if (instantiation) { - return instantiation; - } - - instantiation = new TypeScript.PullInstantiatedTypeParameterSymbol(rootTypeParameter, instantiatedConstraint); - return instantiation; - }; - - PullTypeResolver.prototype.instantiateSignature = function (signature, typeParameterArgumentMap) { - if (!signature.wrapsSomeTypeParameter(typeParameterArgumentMap)) { - return signature; - } - - var rootSignature = signature.getRootSymbol(); - var mutableTypeParameterMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(typeParameterArgumentMap); - TypeScript.PullInstantiationHelpers.instantiateTypeArgument(this, signature, mutableTypeParameterMap); - - var instantiatedSignature = rootSignature.getSpecialization(mutableTypeParameterMap.typeParameterArgumentMap); - if (instantiatedSignature) { - return instantiatedSignature; - } - - TypeScript.PullInstantiationHelpers.cleanUpTypeArgumentMap(signature, mutableTypeParameterMap); - typeParameterArgumentMap = mutableTypeParameterMap.typeParameterArgumentMap; - - instantiatedSignature = new TypeScript.PullInstantiatedSignatureSymbol(rootSignature, typeParameterArgumentMap); - - instantiatedSignature.returnType = this.instantiateType((rootSignature.returnType || this.semanticInfoChain.anyTypeSymbol), typeParameterArgumentMap); - instantiatedSignature.functionType = this.instantiateType(rootSignature.functionType, typeParameterArgumentMap); - - var parameters = rootSignature.parameters; - var parameter = null; - - if (parameters) { - for (var j = 0; j < parameters.length; j++) { - parameter = new TypeScript.PullSymbol(parameters[j].name, 2048 /* Parameter */); - parameter.setRootSymbol(parameters[j]); - - if (parameters[j].isOptional) { - parameter.isOptional = true; - } - if (parameters[j].isVarArg) { - parameter.isVarArg = true; - instantiatedSignature.hasVarArgs = true; - } - instantiatedSignature.addParameter(parameter, parameter.isOptional); - - parameter.type = this.instantiateType(parameters[j].type, typeParameterArgumentMap); - } - } - - return instantiatedSignature; - }; - PullTypeResolver.globalTypeCheckPhase = 0; - return PullTypeResolver; - })(); - TypeScript.PullTypeResolver = PullTypeResolver; - - var TypeComparisonInfo = (function () { - function TypeComparisonInfo(sourceComparisonInfo, useSameIndent) { - this.onlyCaptureFirstError = false; - this.flags = 0 /* SuccessfulComparison */; - this.message = ""; - this.stringConstantVal = null; - this.indent = 1; - if (sourceComparisonInfo) { - this.flags = sourceComparisonInfo.flags; - this.onlyCaptureFirstError = sourceComparisonInfo.onlyCaptureFirstError; - this.stringConstantVal = sourceComparisonInfo.stringConstantVal; - this.indent = sourceComparisonInfo.indent; - if (!useSameIndent) { - this.indent++; - } - } - } - TypeComparisonInfo.prototype.indentString = function () { - var result = ""; - - for (var i = 0; i < this.indent; i++) { - result += "\t"; - } - - return result; - }; - - TypeComparisonInfo.prototype.addMessage = function (message) { - if (!this.onlyCaptureFirstError && this.message) { - this.message = this.message + TypeScript.newLine() + this.indentString() + message; - } else { - this.message = this.indentString() + message; - } - }; - return TypeComparisonInfo; - })(); - TypeScript.TypeComparisonInfo = TypeComparisonInfo; - - function getPropertyAssignmentNameTextFromIdentifier(identifier) { - if (identifier.kind() === 11 /* IdentifierName */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else if (identifier.kind() === 14 /* StringLiteral */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else if (identifier.kind() === 13 /* NumericLiteral */) { - return { actualText: identifier.text(), memberName: identifier.valueText() }; - } else { - throw TypeScript.Errors.invalidOperation(); - } - } - TypeScript.getPropertyAssignmentNameTextFromIdentifier = getPropertyAssignmentNameTextFromIdentifier; - - function isTypesOnlyLocation(ast) { - while (ast && ast.parent) { - switch (ast.parent.kind()) { - case 244 /* TypeAnnotation */: - return true; - case 127 /* TypeQuery */: - return false; - case 125 /* ConstructorType */: - var constructorType = ast.parent; - if (constructorType.type === ast) { - return true; - } - break; - case 123 /* FunctionType */: - var functionType = ast.parent; - if (functionType.type === ast) { - return true; - } - break; - case 239 /* Constraint */: - var constraint = ast.parent; - if (constraint.type === ast) { - return true; - } - break; - case 220 /* CastExpression */: - var castExpression = ast.parent; - return castExpression.type === ast; - case 230 /* ExtendsHeritageClause */: - case 231 /* ImplementsHeritageClause */: - return true; - case 228 /* TypeArgumentList */: - return true; - case 131 /* ClassDeclaration */: - case 128 /* InterfaceDeclaration */: - case 130 /* ModuleDeclaration */: - case 129 /* FunctionDeclaration */: - case 145 /* MethodSignature */: - case 212 /* MemberAccessExpression */: - case 242 /* Parameter */: - return false; - } - - ast = ast.parent; - } - - return false; - } - TypeScript.isTypesOnlyLocation = isTypesOnlyLocation; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - TypeScript.declCacheHit = 0; - TypeScript.declCacheMiss = 0; - TypeScript.symbolCacheHit = 0; - TypeScript.symbolCacheMiss = 0; - - var sentinalEmptyArray = []; - - var SemanticInfoChain = (function () { - function SemanticInfoChain(compiler, logger) { - this.compiler = compiler; - this.logger = logger; - this.documents = []; - this.fileNameToDocument = TypeScript.createIntrinsicsObject(); - this.anyTypeDecl = null; - this.booleanTypeDecl = null; - this.numberTypeDecl = null; - this.stringTypeDecl = null; - this.nullTypeDecl = null; - this.undefinedTypeDecl = null; - this.voidTypeDecl = null; - this.undefinedValueDecl = null; - this.anyTypeSymbol = null; - this.booleanTypeSymbol = null; - this.numberTypeSymbol = null; - this.stringTypeSymbol = null; - this.nullTypeSymbol = null; - this.undefinedTypeSymbol = null; - this.voidTypeSymbol = null; - this.undefinedValueSymbol = null; - this.emptyTypeSymbol = null; - this.astSymbolMap = []; - this.astAliasSymbolMap = []; - this.astCallResolutionDataMap = []; - this.declSymbolMap = []; - this.declSignatureSymbolMap = []; - this.declCache = null; - this.symbolCache = null; - this.fileNameToDiagnostics = null; - this._binder = null; - this._resolver = null; - this._topLevelDecls = null; - this._fileNames = null; - var globalDecl = new TypeScript.RootPullDecl("", "", 0 /* Global */, 0 /* None */, this, false); - this.documents[0] = new TypeScript.Document(this.compiler, this, "", [], null, 0 /* None */, 0, false, null, globalDecl); - - this.anyTypeDecl = new TypeScript.NormalPullDecl("any", "any", 2 /* Primitive */, 0 /* None */, globalDecl); - this.booleanTypeDecl = new TypeScript.NormalPullDecl("boolean", "boolean", 2 /* Primitive */, 0 /* None */, globalDecl); - this.numberTypeDecl = new TypeScript.NormalPullDecl("number", "number", 2 /* Primitive */, 0 /* None */, globalDecl); - this.stringTypeDecl = new TypeScript.NormalPullDecl("string", "string", 2 /* Primitive */, 0 /* None */, globalDecl); - this.voidTypeDecl = new TypeScript.NormalPullDecl("void", "void", 2 /* Primitive */, 0 /* None */, globalDecl); - - this.nullTypeDecl = new TypeScript.RootPullDecl("null", "", 2 /* Primitive */, 0 /* None */, this, false); - this.undefinedTypeDecl = new TypeScript.RootPullDecl("undefined", "", 2 /* Primitive */, 0 /* None */, this, false); - this.undefinedValueDecl = new TypeScript.NormalPullDecl("undefined", "undefined", 512 /* Variable */, 8 /* Ambient */, globalDecl); - - this.invalidate(); - } - SemanticInfoChain.prototype.getDocument = function (fileName) { - var document = this.fileNameToDocument[fileName]; - return document || null; - }; - - SemanticInfoChain.prototype.lineMap = function (fileName) { - return this.getDocument(fileName).lineMap(); - }; - - SemanticInfoChain.prototype.fileNames = function () { - if (this._fileNames === null) { - this._fileNames = this.documents.slice(1).map(function (s) { - return s.fileName; - }); - } - - return this._fileNames; - }; - - SemanticInfoChain.prototype.bindPrimitiveSymbol = function (decl, newSymbol) { - newSymbol.addDeclaration(decl); - decl.setSymbol(newSymbol); - newSymbol.setResolved(); - - return newSymbol; - }; - - SemanticInfoChain.prototype.addPrimitiveTypeSymbol = function (decl) { - var newSymbol = new TypeScript.PullPrimitiveTypeSymbol(decl.name); - return this.bindPrimitiveSymbol(decl, newSymbol); - }; - - SemanticInfoChain.prototype.addPrimitiveValueSymbol = function (decl, type) { - var newSymbol = new TypeScript.PullSymbol(decl.name, 512 /* Variable */); - newSymbol.type = type; - return this.bindPrimitiveSymbol(decl, newSymbol); - }; - - SemanticInfoChain.prototype.resetGlobalSymbols = function () { - this.anyTypeSymbol = this.addPrimitiveTypeSymbol(this.anyTypeDecl); - this.booleanTypeSymbol = this.addPrimitiveTypeSymbol(this.booleanTypeDecl); - this.numberTypeSymbol = this.addPrimitiveTypeSymbol(this.numberTypeDecl); - this.stringTypeSymbol = this.addPrimitiveTypeSymbol(this.stringTypeDecl); - this.voidTypeSymbol = this.addPrimitiveTypeSymbol(this.voidTypeDecl); - this.nullTypeSymbol = this.addPrimitiveTypeSymbol(this.nullTypeDecl); - this.undefinedTypeSymbol = this.addPrimitiveTypeSymbol(this.undefinedTypeDecl); - this.undefinedValueSymbol = this.addPrimitiveValueSymbol(this.undefinedValueDecl, this.undefinedTypeSymbol); - - var emptyTypeDecl = new TypeScript.PullSynthesizedDecl("{}", "{}", 8388608 /* ObjectType */, 0 /* None */, null, this); - var emptyTypeSymbol = new TypeScript.PullTypeSymbol("{}", 8388608 /* ObjectType */); - emptyTypeDecl.setSymbol(emptyTypeSymbol); - emptyTypeSymbol.addDeclaration(emptyTypeDecl); - emptyTypeSymbol.setResolved(); - this.emptyTypeSymbol = emptyTypeSymbol; - }; - - SemanticInfoChain.prototype.addDocument = function (document) { - var fileName = document.fileName; - - var existingIndex = TypeScript.ArrayUtilities.indexOf(this.documents, function (u) { - return u.fileName === fileName; - }); - if (existingIndex < 0) { - this.documents.push(document); - } else { - this.documents[existingIndex] = document; - } - - this.fileNameToDocument[fileName] = document; - - this.invalidate(); - }; - - SemanticInfoChain.prototype.removeDocument = function (fileName) { - TypeScript.Debug.assert(fileName !== "", "Can't remove the semantic info for the global decl."); - var index = TypeScript.ArrayUtilities.indexOf(this.documents, function (u) { - return u.fileName === fileName; - }); - if (index > 0) { - this.fileNameToDocument[fileName] = undefined; - this.documents.splice(index, 1); - this.invalidate(); - } - }; - - SemanticInfoChain.prototype.getDeclPathCacheID = function (declPath, declKind) { - var cacheID = ""; - - for (var i = 0; i < declPath.length; i++) { - cacheID += "#" + declPath[i]; - } - - return cacheID + "#" + declKind.toString(); - }; - - SemanticInfoChain.prototype.findTopLevelSymbol = function (name, kind, doNotGoPastThisDecl) { - var cacheID = this.getDeclPathCacheID([name], kind); - - var symbol = this.symbolCache[cacheID]; - - if (!symbol) { - for (var i = 0, n = this.documents.length; i < n; i++) { - var topLevelDecl = this.documents[i].topLevelDecl(); - - var symbol = this.findTopLevelSymbolInDecl(topLevelDecl, name, kind, doNotGoPastThisDecl); - if (symbol) { - break; - } - - if (doNotGoPastThisDecl && topLevelDecl.name === doNotGoPastThisDecl.fileName()) { - return null; - } - } - - if (symbol) { - this.symbolCache[cacheID] = symbol; - } - } - - return symbol; - }; - - SemanticInfoChain.prototype.findTopLevelSymbolInDecl = function (topLevelDecl, name, kind, doNotGoPastThisDecl) { - var doNotGoPastThisPosition = doNotGoPastThisDecl && doNotGoPastThisDecl.fileName() === topLevelDecl.fileName() ? doNotGoPastThisDecl.ast().start() : -1; - - var foundDecls = topLevelDecl.searchChildDecls(name, kind); - - for (var j = 0; j < foundDecls.length; j++) { - var foundDecl = foundDecls[j]; - - if (doNotGoPastThisPosition !== -1 && foundDecl.ast() && foundDecl.ast().start() > doNotGoPastThisPosition) { - break; - } - - var symbol = foundDecls[j].getSymbol(); - if (symbol) { - return symbol; - } - } - - return null; - }; - - SemanticInfoChain.prototype.findExternalModule = function (id) { - id = TypeScript.normalizePath(id); - - var tsFile = id + ".ts"; - var tsCacheID = this.getDeclPathCacheID([tsFile], 32 /* DynamicModule */); - symbol = this.symbolCache[tsCacheID]; - if (symbol != undefined) { - return symbol; - } - - var dtsFile = id + ".d.ts"; - var dtsCacheID = this.getDeclPathCacheID([dtsFile], 32 /* DynamicModule */); - var symbol = this.symbolCache[dtsCacheID]; - if (symbol) { - return symbol; - } - - var dtsSymbol; - for (var i = 0; i < this.documents.length; i++) { - var document = this.documents[i]; - var topLevelDecl = document.topLevelDecl(); - - if (topLevelDecl.isExternalModule()) { - var isTsFile = document.fileName === tsFile; - if (isTsFile || document.fileName === dtsFile) { - var dynamicModuleDecl = topLevelDecl.getChildDecls()[0]; - symbol = dynamicModuleDecl.getSymbol(); - - if (isTsFile) { - this.symbolCache[tsCacheID] = symbol; - - return symbol; - } else { - dtsSymbol = symbol; - } - } - } - } - - if (dtsSymbol) { - this.symbolCache[dtsCacheID] = symbol; - return dtsSymbol; - } - - this.symbolCache[dtsCacheID] = null; - this.symbolCache[tsCacheID] = null; - - return null; - }; - - SemanticInfoChain.prototype.findAmbientExternalModuleInGlobalContext = function (id) { - var cacheID = this.getDeclPathCacheID([id], 32 /* DynamicModule */); - - var symbol = this.symbolCache[cacheID]; - if (symbol == undefined) { - symbol = null; - for (var i = 0; i < this.documents.length; i++) { - var document = this.documents[i]; - var topLevelDecl = document.topLevelDecl(); - - if (!topLevelDecl.isExternalModule()) { - var dynamicModules = topLevelDecl.searchChildDecls(id, 32 /* DynamicModule */); - if (dynamicModules.length) { - symbol = dynamicModules[0].getSymbol(); - break; - } - } - } - - this.symbolCache[cacheID] = symbol; - } - - return symbol; - }; - - SemanticInfoChain.prototype.findDecls = function (declPath, declKind) { - var cacheID = this.getDeclPathCacheID(declPath, declKind); - - if (declPath.length) { - var cachedDecls = this.declCache[cacheID]; - - if (cachedDecls && cachedDecls.length) { - TypeScript.declCacheHit++; - return cachedDecls; - } - } - - TypeScript.declCacheMiss++; - - var declsToSearch = this.topLevelDecls(); - - var decls = TypeScript.sentinelEmptyArray; - var path; - var foundDecls = TypeScript.sentinelEmptyArray; - - for (var i = 0; i < declPath.length; i++) { - path = declPath[i]; - decls = TypeScript.sentinelEmptyArray; - - var kind = (i === declPath.length - 1) ? declKind : 164 /* SomeContainer */; - for (var j = 0; j < declsToSearch.length; j++) { - foundDecls = declsToSearch[j].searchChildDecls(path, kind); - - for (var k = 0; k < foundDecls.length; k++) { - if (decls === TypeScript.sentinelEmptyArray) { - decls = []; - } - decls[decls.length] = foundDecls[k]; - } - } - - declsToSearch = decls; - - if (!declsToSearch) { - break; - } - } - - if (decls.length) { - this.declCache[cacheID] = decls; - } - - return decls; - }; - - SemanticInfoChain.prototype.findDeclsFromPath = function (declPath, declKind) { - var declString = []; - - for (var i = 0, n = declPath.length; i < n; i++) { - if (declPath[i].kind & 1 /* Script */) { - continue; - } - - declString.push(declPath[i].name); - } - - return this.findDecls(declString, declKind); - }; - - SemanticInfoChain.prototype.findSymbol = function (declPath, declType) { - var cacheID = this.getDeclPathCacheID(declPath, declType); - - if (declPath.length) { - var cachedSymbol = this.symbolCache[cacheID]; - - if (cachedSymbol) { - TypeScript.symbolCacheHit++; - return cachedSymbol; - } - } - - TypeScript.symbolCacheMiss++; - - var decls = this.findDecls(declPath, declType); - var symbol = null; - - if (decls.length) { - var decl = decls[0]; - if (TypeScript.hasFlag(decl.kind, 164 /* SomeContainer */)) { - var valueDecl = decl.getValueDecl(); - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - } - symbol = decl.getSymbol(); - - if (symbol) { - for (var i = 1; i < decls.length; i++) { - decls[i].ensureSymbolIsBound(); - } - - this.symbolCache[cacheID] = symbol; - } - } - - return symbol; - }; - - SemanticInfoChain.prototype.cacheGlobalSymbol = function (symbol, kind) { - var cacheID1 = this.getDeclPathCacheID([symbol.name], kind); - var cacheID2 = this.getDeclPathCacheID([symbol.name], symbol.kind); - - if (!this.symbolCache[cacheID1]) { - this.symbolCache[cacheID1] = symbol; - } - - if (!this.symbolCache[cacheID2]) { - this.symbolCache[cacheID2] = symbol; - } - }; - - SemanticInfoChain.prototype.invalidate = function (oldSettings, newSettings) { - if (typeof oldSettings === "undefined") { oldSettings = null; } - if (typeof newSettings === "undefined") { newSettings = null; } - TypeScript.PullTypeResolver.globalTypeCheckPhase++; - - var cleanStart = new Date().getTime(); - - this.astSymbolMap.length = 0; - this.astAliasSymbolMap.length = 0; - this.astCallResolutionDataMap.length = 0; - - this.declCache = TypeScript.createIntrinsicsObject(); - this.symbolCache = TypeScript.createIntrinsicsObject(); - this.fileNameToDiagnostics = TypeScript.createIntrinsicsObject(); - this._binder = null; - this._resolver = null; - this._topLevelDecls = null; - this._fileNames = null; - - this.declSymbolMap.length = 0; - this.declSignatureSymbolMap.length = 0; - - if (oldSettings && newSettings) { - if (this.settingsChangeAffectsSyntax(oldSettings, newSettings)) { - for (var i = 1, n = this.documents.length; i < n; i++) { - this.documents[i].invalidate(); - } - } - } - - TypeScript.pullSymbolID = 0; - - this.resetGlobalSymbols(); - - var cleanEnd = new Date().getTime(); - }; - - SemanticInfoChain.prototype.settingsChangeAffectsSyntax = function (before, after) { - return before.allowAutomaticSemicolonInsertion() !== after.allowAutomaticSemicolonInsertion() || before.codeGenTarget() !== after.codeGenTarget() || before.propagateEnumConstants() !== after.propagateEnumConstants(); - }; - - SemanticInfoChain.prototype.setSymbolForAST = function (ast, symbol) { - this.astSymbolMap[ast.syntaxID()] = symbol; - }; - - SemanticInfoChain.prototype.getSymbolForAST = function (ast) { - return this.astSymbolMap[ast.syntaxID()] || null; - }; - - SemanticInfoChain.prototype.setAliasSymbolForAST = function (ast, symbol) { - this.astAliasSymbolMap[ast.syntaxID()] = symbol; - }; - - SemanticInfoChain.prototype.getAliasSymbolForAST = function (ast) { - return this.astAliasSymbolMap[ast.syntaxID()]; - }; - - SemanticInfoChain.prototype.getCallResolutionDataForAST = function (ast) { - return this.astCallResolutionDataMap[ast.syntaxID()]; - }; - - SemanticInfoChain.prototype.setCallResolutionDataForAST = function (ast, callResolutionData) { - if (callResolutionData) { - this.astCallResolutionDataMap[ast.syntaxID()] = callResolutionData; - } - }; - - SemanticInfoChain.prototype.setSymbolForDecl = function (decl, symbol) { - this.declSymbolMap[decl.declID] = symbol; - }; - - SemanticInfoChain.prototype.getSymbolForDecl = function (decl) { - return this.declSymbolMap[decl.declID]; - }; - - SemanticInfoChain.prototype.setSignatureSymbolForDecl = function (decl, signatureSymbol) { - this.declSignatureSymbolMap[decl.declID] = signatureSymbol; - }; - - SemanticInfoChain.prototype.getSignatureSymbolForDecl = function (decl) { - return this.declSignatureSymbolMap[decl.declID]; - }; - - SemanticInfoChain.prototype.addDiagnostic = function (diagnostic) { - var fileName = diagnostic.fileName(); - var diagnostics = this.fileNameToDiagnostics[fileName]; - if (!diagnostics) { - diagnostics = []; - this.fileNameToDiagnostics[fileName] = diagnostics; - } - - diagnostics.push(diagnostic); - }; - - SemanticInfoChain.prototype.getDiagnostics = function (fileName) { - var diagnostics = this.fileNameToDiagnostics[fileName]; - return diagnostics || []; - }; - - SemanticInfoChain.prototype.getBinder = function () { - if (!this._binder) { - this._binder = new TypeScript.PullSymbolBinder(this); - } - - return this._binder; - }; - - SemanticInfoChain.prototype.getResolver = function () { - if (!this._resolver) { - this._resolver = new TypeScript.PullTypeResolver(this.compiler.compilationSettings(), this); - } - - return this._resolver; - }; - - SemanticInfoChain.prototype.addSyntheticIndexSignature = function (containingDecl, containingSymbol, ast, indexParamName, indexParamType, returnType) { - var indexSignature = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - var indexParameterSymbol = new TypeScript.PullSymbol(indexParamName, 2048 /* Parameter */); - indexParameterSymbol.type = indexParamType; - indexSignature.addParameter(indexParameterSymbol); - indexSignature.returnType = returnType; - indexSignature.setResolved(); - indexParameterSymbol.setResolved(); - - containingSymbol.addIndexSignature(indexSignature); - - var indexSigDecl = new TypeScript.PullSynthesizedDecl("", "", 4194304 /* IndexSignature */, 2048 /* Signature */, containingDecl, containingDecl.semanticInfoChain); - var indexParamDecl = new TypeScript.PullSynthesizedDecl(indexParamName, indexParamName, 2048 /* Parameter */, 0 /* None */, indexSigDecl, containingDecl.semanticInfoChain); - indexSigDecl.setSignatureSymbol(indexSignature); - indexParamDecl.setSymbol(indexParameterSymbol); - indexSignature.addDeclaration(indexSigDecl); - indexParameterSymbol.addDeclaration(indexParamDecl); - }; - - SemanticInfoChain.prototype.getDeclForAST = function (ast) { - var document = this.getDocument(ast.fileName()); - - if (document) { - return document._getDeclForAST(ast); - } - - return null; - }; - - SemanticInfoChain.prototype.getEnclosingDecl = function (ast) { - return this.getDocument(ast.fileName()).getEnclosingDecl(ast); - }; - - SemanticInfoChain.prototype.setDeclForAST = function (ast, decl) { - this.getDocument(decl.fileName())._setDeclForAST(ast, decl); - }; - - SemanticInfoChain.prototype.getASTForDecl = function (decl) { - var document = this.getDocument(decl.fileName()); - if (document) { - return document._getASTForDecl(decl); - } - - return null; - }; - - SemanticInfoChain.prototype.setASTForDecl = function (decl, ast) { - this.getDocument(decl.fileName())._setASTForDecl(decl, ast); - }; - - SemanticInfoChain.prototype.topLevelDecl = function (fileName) { - var document = this.getDocument(fileName); - if (document) { - return document.topLevelDecl(); - } - - return null; - }; - - SemanticInfoChain.prototype.topLevelDecls = function () { - if (!this._topLevelDecls) { - this._topLevelDecls = TypeScript.ArrayUtilities.select(this.documents, function (u) { - return u.topLevelDecl(); - }); - } - - return this._topLevelDecls; - }; - - SemanticInfoChain.prototype.addDiagnosticFromAST = function (ast, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - this.addDiagnostic(this.diagnosticFromAST(ast, diagnosticKey, _arguments, additionalLocations)); - }; - - SemanticInfoChain.prototype.diagnosticFromAST = function (ast, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - return new TypeScript.Diagnostic(ast.fileName(), this.lineMap(ast.fileName()), ast.start(), ast.width(), diagnosticKey, _arguments, additionalLocations); - }; - - SemanticInfoChain.prototype.locationFromAST = function (ast) { - return new TypeScript.Location(ast.fileName(), this.lineMap(ast.fileName()), ast.start(), ast.width()); - }; - - SemanticInfoChain.prototype.duplicateIdentifierDiagnosticFromAST = function (ast, identifier, additionalLocationAST) { - return this.diagnosticFromAST(ast, TypeScript.DiagnosticCode.Duplicate_identifier_0, [identifier], additionalLocationAST ? [this.locationFromAST(additionalLocationAST)] : null); - }; - - SemanticInfoChain.prototype.addDuplicateIdentifierDiagnosticFromAST = function (ast, identifier, additionalLocationAST) { - this.addDiagnostic(this.duplicateIdentifierDiagnosticFromAST(ast, identifier, additionalLocationAST)); - }; - return SemanticInfoChain; - })(); - TypeScript.SemanticInfoChain = SemanticInfoChain; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var DeclCollectionContext = (function () { - function DeclCollectionContext(document, semanticInfoChain, propagateEnumConstants) { - this.document = document; - this.semanticInfoChain = semanticInfoChain; - this.propagateEnumConstants = propagateEnumConstants; - this.isDeclareFile = false; - this.parentChain = []; - } - DeclCollectionContext.prototype.getParent = function () { - return this.parentChain ? this.parentChain[this.parentChain.length - 1] : null; - }; - - DeclCollectionContext.prototype.pushParent = function (parentDecl) { - if (parentDecl) { - this.parentChain[this.parentChain.length] = parentDecl; - } - }; - - DeclCollectionContext.prototype.popParent = function () { - this.parentChain.length--; - }; - return DeclCollectionContext; - })(); - - function containingModuleHasExportAssignment(ast) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - var moduleDecl = ast; - return moduleDecl.moduleElements.any(function (m) { - return m.kind() === 134 /* ExportAssignment */; - }); - } else if (ast.kind() === 120 /* SourceUnit */) { - var sourceUnit = ast; - return sourceUnit.moduleElements.any(function (m) { - return m.kind() === 134 /* ExportAssignment */; - }); - } - - ast = ast.parent; - } - - return false; - } - - function isParsingAmbientModule(ast, context) { - ast = ast.parent; - while (ast) { - if (ast.kind() === 130 /* ModuleDeclaration */) { - if (TypeScript.hasModifier(ast.modifiers, 8 /* Ambient */)) { - return true; - } - } - - ast = ast.parent; - } - - return false; - } - - function preCollectImportDecls(ast, context) { - var importDecl = ast; - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (TypeScript.hasModifier(importDecl.modifiers, 1 /* Exported */) && !containingModuleHasExportAssignment(ast)) { - declFlags |= 1 /* Exported */; - } - - var decl = new TypeScript.NormalPullDecl(importDecl.identifier.valueText(), importDecl.identifier.text(), 128 /* TypeAlias */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - } - - function preCollectScriptDecls(sourceUnit, context) { - var fileName = sourceUnit.fileName(); - - var isExternalModule = context.document.isExternalModule(); - - var decl = new TypeScript.RootPullDecl(fileName, fileName, 1 /* Script */, 0 /* None */, context.semanticInfoChain, isExternalModule); - context.semanticInfoChain.setDeclForAST(sourceUnit, decl); - context.semanticInfoChain.setASTForDecl(decl, sourceUnit); - - context.isDeclareFile = context.document.isDeclareFile(); - - context.pushParent(decl); - - if (isExternalModule) { - var declFlags = 1 /* Exported */; - if (TypeScript.isDTSFile(fileName)) { - declFlags |= 8 /* Ambient */; - } - - var moduleContainsExecutableCode = containsExecutableCode(sourceUnit.moduleElements); - var kind = 32 /* DynamicModule */; - var valueText = TypeScript.quoteStr(fileName); - - var decl = new TypeScript.NormalPullDecl(valueText, fileName, kind, declFlags, context.getParent()); - - context.semanticInfoChain.setASTForDecl(decl, sourceUnit); - - context.semanticInfoChain.setDeclForAST(sourceUnit, decl); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, sourceUnit, context); - } - - context.pushParent(decl); - } - } - - function preCollectEnumDecls(enumDecl, context) { - var declFlags = 0 /* None */; - var enumName = enumDecl.identifier.valueText(); - - if ((TypeScript.hasModifier(enumDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(enumDecl, context)) && !containingModuleHasExportAssignment(enumDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(enumDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(enumDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - declFlags |= 4096 /* Enum */; - var kind = 64 /* Enum */; - - var enumDeclaration = new TypeScript.NormalPullDecl(enumName, enumDecl.identifier.text(), kind, declFlags, context.getParent()); - context.semanticInfoChain.setDeclForAST(enumDecl, enumDeclaration); - context.semanticInfoChain.setASTForDecl(enumDeclaration, enumDecl); - - var valueDecl = new TypeScript.NormalPullDecl(enumDeclaration.name, enumDeclaration.getDisplayName(), 512 /* Variable */, enumDeclaration.flags, context.getParent()); - enumDeclaration.setValueDecl(valueDecl); - context.semanticInfoChain.setASTForDecl(valueDecl, enumDecl); - - context.pushParent(enumDeclaration); - } - - function createEnumElementDecls(propertyDecl, context) { - var parent = context.getParent(); - - var decl = new TypeScript.PullEnumElementDecl(propertyDecl.propertyName.valueText(), propertyDecl.propertyName.text(), parent); - context.semanticInfoChain.setDeclForAST(propertyDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyDecl); - } - - function preCollectModuleDecls(moduleDecl, context) { - var declFlags = 0 /* None */; - - var moduleContainsExecutableCode = containsExecutableCode(moduleDecl.moduleElements); - - var isDynamic = moduleDecl.stringLiteral !== null; - - if ((TypeScript.hasModifier(moduleDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(moduleDecl, context)) && !containingModuleHasExportAssignment(moduleDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(moduleDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(moduleDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var kind = isDynamic ? 32 /* DynamicModule */ : 4 /* Container */; - - if (moduleDecl.stringLiteral) { - var valueText = TypeScript.quoteStr(moduleDecl.stringLiteral.valueText()); - var text = moduleDecl.stringLiteral.text(); - - var decl = new TypeScript.NormalPullDecl(valueText, text, kind, declFlags, context.getParent()); - - context.semanticInfoChain.setDeclForAST(moduleDecl, decl); - context.semanticInfoChain.setDeclForAST(moduleDecl.stringLiteral, decl); - context.semanticInfoChain.setASTForDecl(decl, moduleDecl.stringLiteral); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, moduleDecl.stringLiteral, context); - } - - context.pushParent(decl); - } else { - var moduleNames = getModuleNames(moduleDecl.name); - for (var i = 0, n = moduleNames.length; i < n; i++) { - var moduleName = moduleNames[i]; - - var specificFlags = declFlags; - if (i > 0) { - specificFlags |= 1 /* Exported */; - } - - var decl = new TypeScript.NormalPullDecl(moduleName.valueText(), moduleName.text(), kind, specificFlags, context.getParent()); - - context.semanticInfoChain.setDeclForAST(moduleDecl, decl); - context.semanticInfoChain.setDeclForAST(moduleName, decl); - context.semanticInfoChain.setASTForDecl(decl, moduleName); - - if (moduleContainsExecutableCode) { - createModuleVariableDecl(decl, moduleName, context); - } - - context.pushParent(decl); - } - } - } - - function getModuleNames(name, result) { - result = result || []; - - if (name.kind() === 121 /* QualifiedName */) { - getModuleNames(name.left, result); - result.push(name.right); - } else { - result.push(name); - } - - return result; - } - TypeScript.getModuleNames = getModuleNames; - - function createModuleVariableDecl(decl, moduleNameAST, context) { - decl.setFlags(decl.flags | getInitializationFlag(decl)); - - var valueDecl = new TypeScript.NormalPullDecl(decl.name, decl.getDisplayName(), 512 /* Variable */, decl.flags, context.getParent()); - decl.setValueDecl(valueDecl); - context.semanticInfoChain.setASTForDecl(valueDecl, moduleNameAST); - } - - function containsExecutableCode(members) { - for (var i = 0, n = members.childCount(); i < n; i++) { - var member = members.childAt(i); - - if (member.kind() === 130 /* ModuleDeclaration */) { - var moduleDecl = member; - - if (containsExecutableCode(moduleDecl.moduleElements)) { - return true; - } - } else if (member.kind() === 133 /* ImportDeclaration */) { - if (TypeScript.hasModifier(member.modifiers, 1 /* Exported */)) { - return true; - } - } else if (member.kind() !== 128 /* InterfaceDeclaration */) { - return true; - } - } - - return false; - } - - function preCollectClassDecls(classDecl, context) { - var declFlags = 0 /* None */; - - if ((TypeScript.hasModifier(classDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(classDecl, context)) && !containingModuleHasExportAssignment(classDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(classDecl.modifiers, 8 /* Ambient */) || isParsingAmbientModule(classDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(classDecl.identifier.valueText(), classDecl.identifier.text(), 8 /* Class */, declFlags, parent); - - var constructorDecl = new TypeScript.NormalPullDecl(classDecl.identifier.valueText(), classDecl.identifier.text(), 512 /* Variable */, declFlags | 16384 /* ClassConstructorVariable */, parent); - - decl.setValueDecl(constructorDecl); - - context.semanticInfoChain.setDeclForAST(classDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, classDecl); - context.semanticInfoChain.setASTForDecl(constructorDecl, classDecl); - - context.pushParent(decl); - } - - function preCollectObjectTypeDecls(objectType, context) { - if (objectType.parent.kind() === 128 /* InterfaceDeclaration */) { - return; - } - - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", 8388608 /* ObjectType */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(objectType, decl); - context.semanticInfoChain.setASTForDecl(decl, objectType); - - context.pushParent(decl); - } - - function preCollectInterfaceDecls(interfaceDecl, context) { - var declFlags = 0 /* None */; - - if ((TypeScript.hasModifier(interfaceDecl.modifiers, 1 /* Exported */) || isParsingAmbientModule(interfaceDecl, context)) && !containingModuleHasExportAssignment(interfaceDecl)) { - declFlags |= 1 /* Exported */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(interfaceDecl.identifier.valueText(), interfaceDecl.identifier.text(), 16 /* Interface */, declFlags, parent); - context.semanticInfoChain.setDeclForAST(interfaceDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, interfaceDecl); - - context.pushParent(decl); - } - - function preCollectParameterDecl(argDecl, context) { - var declFlags = 0 /* None */; - - if (TypeScript.hasModifier(argDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (argDecl.questionToken !== null || argDecl.equalsValueClause !== null || argDecl.dotDotDotToken !== null) { - declFlags |= 128 /* Optional */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(argDecl.identifier.valueText(), argDecl.identifier.text(), 2048 /* Parameter */, declFlags, parent); - - if (argDecl.equalsValueClause) { - parent.flags |= 33554432 /* HasDefaultArgs */; - } - - if (parent.kind === 32768 /* ConstructorMethod */) { - decl.setFlag(67108864 /* ConstructorParameter */); - } - - var isPublicOrPrivate = TypeScript.hasModifier(argDecl.modifiers, 4 /* Public */ | 2 /* Private */); - var isInConstructor = parent.kind === 32768 /* ConstructorMethod */; - if (isPublicOrPrivate && isInConstructor) { - var parentsParent = context.parentChain[context.parentChain.length - 2]; - - var propDeclFlags = declFlags & ~128 /* Optional */; - var propDecl = new TypeScript.NormalPullDecl(argDecl.identifier.valueText(), argDecl.identifier.text(), 4096 /* Property */, propDeclFlags, parentsParent); - propDecl.setValueDecl(decl); - decl.setFlag(8388608 /* PropertyParameter */); - propDecl.setFlag(8388608 /* PropertyParameter */); - - if (parent.kind === 32768 /* ConstructorMethod */) { - propDecl.setFlag(67108864 /* ConstructorParameter */); - } - - context.semanticInfoChain.setASTForDecl(decl, argDecl); - context.semanticInfoChain.setASTForDecl(propDecl, argDecl); - context.semanticInfoChain.setDeclForAST(argDecl, propDecl); - } else { - context.semanticInfoChain.setASTForDecl(decl, argDecl); - context.semanticInfoChain.setDeclForAST(argDecl, decl); - } - - parent.addVariableDeclToGroup(decl); - } - - function preCollectTypeParameterDecl(typeParameterDecl, context) { - var declFlags = 0 /* None */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(typeParameterDecl.identifier.valueText(), typeParameterDecl.identifier.text(), 8192 /* TypeParameter */, declFlags, parent); - context.semanticInfoChain.setASTForDecl(decl, typeParameterDecl); - context.semanticInfoChain.setDeclForAST(typeParameterDecl, decl); - } - - function createPropertySignature(propertyDecl, context) { - var declFlags = 4 /* Public */; - var parent = context.getParent(); - var declType = 4096 /* Property */; - - if (propertyDecl.questionToken !== null) { - declFlags |= 128 /* Optional */; - } - - var decl = new TypeScript.NormalPullDecl(propertyDecl.propertyName.valueText(), propertyDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(propertyDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyDecl); - } - - function createMemberVariableDeclaration(memberDecl, context) { - var declFlags = 0 /* None */; - var declType = 4096 /* Property */; - - if (TypeScript.hasModifier(memberDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (TypeScript.hasModifier(memberDecl.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(memberDecl.variableDeclarator.propertyName.valueText(), memberDecl.variableDeclarator.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(memberDecl, decl); - context.semanticInfoChain.setDeclForAST(memberDecl.variableDeclarator, decl); - context.semanticInfoChain.setASTForDecl(decl, memberDecl); - } - - function createVariableDeclaration(varDecl, context) { - var declFlags = 0 /* None */; - var declType = 512 /* Variable */; - - var modifiers = TypeScript.ASTHelpers.getVariableDeclaratorModifiers(varDecl); - if ((TypeScript.hasModifier(modifiers, 1 /* Exported */) || isParsingAmbientModule(varDecl, context)) && !containingModuleHasExportAssignment(varDecl)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(modifiers, 8 /* Ambient */) || isParsingAmbientModule(varDecl, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(varDecl.propertyName.valueText(), varDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(varDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, varDecl); - - if (parent) { - parent.addVariableDeclToGroup(decl); - } - } - - function preCollectVarDecls(ast, context) { - if (ast.parent.kind() === 136 /* MemberVariableDeclaration */) { - return; - } - - var varDecl = ast; - createVariableDeclaration(varDecl, context); - } - - function createFunctionTypeDeclaration(functionTypeDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 16777216 /* FunctionType */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(functionTypeDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, functionTypeDeclAST); - - context.pushParent(decl); - } - - function createConstructorTypeDeclaration(constructorTypeDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 33554432 /* ConstructorType */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructorTypeDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructorTypeDeclAST); - - context.pushParent(decl); - } - - function createFunctionDeclaration(funcDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 16384 /* Function */; - - if ((TypeScript.hasModifier(funcDeclAST.modifiers, 1 /* Exported */) || isParsingAmbientModule(funcDeclAST, context)) && !containingModuleHasExportAssignment(funcDeclAST)) { - declFlags |= 1 /* Exported */; - } - - if (TypeScript.hasModifier(funcDeclAST.modifiers, 8 /* Ambient */) || isParsingAmbientModule(funcDeclAST, context) || context.isDeclareFile) { - declFlags |= 8 /* Ambient */; - } - - if (!funcDeclAST.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(funcDeclAST.identifier.valueText(), funcDeclAST.identifier.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(funcDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, funcDeclAST); - - context.pushParent(decl); - } - - function createAnyFunctionExpressionDeclaration(functionExpressionDeclAST, id, context, displayName) { - if (typeof displayName === "undefined") { displayName = null; } - var declFlags = 0 /* None */; - - if (functionExpressionDeclAST.kind() === 219 /* SimpleArrowFunctionExpression */ || functionExpressionDeclAST.kind() === 218 /* ParenthesizedArrowFunctionExpression */) { - declFlags |= 8192 /* ArrowFunction */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var name = id ? id.text() : ""; - var displayNameText = displayName ? displayName.text() : ""; - var decl = new TypeScript.PullFunctionExpressionDecl(name, declFlags, parent, displayNameText); - context.semanticInfoChain.setDeclForAST(functionExpressionDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, functionExpressionDeclAST); - - context.pushParent(decl); - - if (functionExpressionDeclAST.kind() === 219 /* SimpleArrowFunctionExpression */) { - var simpleArrow = functionExpressionDeclAST; - var declFlags = 4 /* Public */; - - var parent = context.getParent(); - - if (TypeScript.hasFlag(parent.flags, 2097152 /* DeclaredInAWithBlock */)) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(simpleArrow.identifier.valueText(), simpleArrow.identifier.text(), 2048 /* Parameter */, declFlags, parent); - - context.semanticInfoChain.setASTForDecl(decl, simpleArrow.identifier); - context.semanticInfoChain.setDeclForAST(simpleArrow.identifier, decl); - - parent.addVariableDeclToGroup(decl); - } - } - - function createMemberFunctionDeclaration(funcDecl, context) { - var declFlags = 0 /* None */; - var declType = 65536 /* Method */; - - if (TypeScript.hasModifier(funcDecl.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(funcDecl.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - if (!funcDecl.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(funcDecl.propertyName.valueText(), funcDecl.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(funcDecl, decl); - context.semanticInfoChain.setASTForDecl(decl, funcDecl); - - context.pushParent(decl); - } - - function createIndexSignatureDeclaration(indexSignatureDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 4194304 /* IndexSignature */; - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(indexSignatureDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, indexSignatureDeclAST); - - context.pushParent(decl); - } - - function createCallSignatureDeclaration(callSignature, context) { - var isChildOfObjectType = callSignature.parent && callSignature.parent.parent && callSignature.parent.kind() === 2 /* SeparatedList */ && callSignature.parent.parent.kind() === 122 /* ObjectType */; - - if (!isChildOfObjectType) { - return; - } - - var declFlags = 2048 /* Signature */; - var declType = 1048576 /* CallSignature */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(callSignature, decl); - context.semanticInfoChain.setASTForDecl(decl, callSignature); - - context.pushParent(decl); - } - - function createMethodSignatureDeclaration(method, context) { - var declFlags = 0 /* None */; - var declType = 65536 /* Method */; - - declFlags |= 4 /* Public */; - declFlags |= 2048 /* Signature */; - - if (method.questionToken !== null) { - declFlags |= 128 /* Optional */; - } - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl(method.propertyName.valueText(), method.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(method, decl); - context.semanticInfoChain.setASTForDecl(decl, method); - - context.pushParent(decl); - } - - function createConstructSignatureDeclaration(constructSignatureDeclAST, context) { - var declFlags = 2048 /* Signature */; - var declType = 2097152 /* ConstructSignature */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructSignatureDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructSignatureDeclAST); - - context.pushParent(decl); - } - - function createClassConstructorDeclaration(constructorDeclAST, context) { - var declFlags = 0 /* None */; - var declType = 32768 /* ConstructorMethod */; - - if (!constructorDeclAST.block) { - declFlags |= 2048 /* Signature */; - } - - var parent = context.getParent(); - - if (parent) { - var parentFlags = parent.flags; - - if (parentFlags & 1 /* Exported */) { - declFlags |= 1 /* Exported */; - } - } - - var decl = new TypeScript.NormalPullDecl(parent.name, parent.getDisplayName(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(constructorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, constructorDeclAST); - - context.pushParent(decl); - } - - function createGetAccessorDeclaration(getAccessorDeclAST, context) { - var declFlags = 4 /* Public */; - var declType = 262144 /* GetAccessor */; - - if (TypeScript.hasModifier(getAccessorDeclAST.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(getAccessorDeclAST.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(getAccessorDeclAST.propertyName.valueText(), getAccessorDeclAST.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(getAccessorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, getAccessorDeclAST); - - context.pushParent(decl); - } - - function createFunctionExpressionDeclaration(expression, context) { - createAnyFunctionExpressionDeclaration(expression, expression.identifier, context); - } - - function createSetAccessorDeclaration(setAccessorDeclAST, context) { - var declFlags = 4 /* Public */; - var declType = 524288 /* SetAccessor */; - - if (TypeScript.hasModifier(setAccessorDeclAST.modifiers, 16 /* Static */)) { - declFlags |= 16 /* Static */; - } - - if (TypeScript.hasModifier(setAccessorDeclAST.modifiers, 2 /* Private */)) { - declFlags |= 2 /* Private */; - } else { - declFlags |= 4 /* Public */; - } - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(setAccessorDeclAST.propertyName.valueText(), setAccessorDeclAST.propertyName.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(setAccessorDeclAST, decl); - context.semanticInfoChain.setASTForDecl(decl, setAccessorDeclAST); - - context.pushParent(decl); - } - - function preCollectCatchDecls(ast, context) { - var declFlags = 0 /* None */; - var declType = 268435456 /* CatchBlock */; - - var parent = context.getParent(); - - if (parent && (parent.kind === 134217728 /* WithBlock */ || (parent.flags & 2097152 /* DeclaredInAWithBlock */))) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - - var declFlags = 0 /* None */; - var declType = 1024 /* CatchVariable */; - - var parent = context.getParent(); - - if (TypeScript.hasFlag(parent.flags, 2097152 /* DeclaredInAWithBlock */)) { - declFlags |= 2097152 /* DeclaredInAWithBlock */; - } - - var decl = new TypeScript.NormalPullDecl(ast.identifier.valueText(), ast.identifier.text(), declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast.identifier, decl); - context.semanticInfoChain.setASTForDecl(decl, ast.identifier); - - if (parent) { - parent.addVariableDeclToGroup(decl); - } - } - - function preCollectWithDecls(ast, context) { - var declFlags = 0 /* None */; - var declType = 134217728 /* WithBlock */; - - var parent = context.getParent(); - - var decl = new TypeScript.NormalPullDecl("", "", declType, declFlags, parent); - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - } - - function preCollectObjectLiteralDecls(ast, context) { - var decl = new TypeScript.NormalPullDecl("", "", 256 /* ObjectLiteral */, 0 /* None */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(ast, decl); - context.semanticInfoChain.setASTForDecl(decl, ast); - - context.pushParent(decl); - } - - function preCollectSimplePropertyAssignmentDecls(propertyAssignment, context) { - var assignmentText = TypeScript.getPropertyAssignmentNameTextFromIdentifier(propertyAssignment.propertyName); - var span = TypeScript.TextSpan.fromBounds(propertyAssignment.start(), propertyAssignment.end()); - - var decl = new TypeScript.NormalPullDecl(assignmentText.memberName, assignmentText.actualText, 4096 /* Property */, 4 /* Public */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(propertyAssignment, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyAssignment); - } - - function preCollectFunctionPropertyAssignmentDecls(propertyAssignment, context) { - var assignmentText = TypeScript.getPropertyAssignmentNameTextFromIdentifier(propertyAssignment.propertyName); - - var decl = new TypeScript.NormalPullDecl(assignmentText.memberName, assignmentText.actualText, 4096 /* Property */, 4 /* Public */, context.getParent()); - - context.semanticInfoChain.setDeclForAST(propertyAssignment, decl); - context.semanticInfoChain.setASTForDecl(decl, propertyAssignment); - - createAnyFunctionExpressionDeclaration(propertyAssignment, propertyAssignment.propertyName, context, propertyAssignment.propertyName); - } - - function preCollectDecls(ast, context) { - switch (ast.kind()) { - case 120 /* SourceUnit */: - preCollectScriptDecls(ast, context); - break; - case 132 /* EnumDeclaration */: - preCollectEnumDecls(ast, context); - break; - case 243 /* EnumElement */: - createEnumElementDecls(ast, context); - break; - case 130 /* ModuleDeclaration */: - preCollectModuleDecls(ast, context); - break; - case 131 /* ClassDeclaration */: - preCollectClassDecls(ast, context); - break; - case 128 /* InterfaceDeclaration */: - preCollectInterfaceDecls(ast, context); - break; - case 122 /* ObjectType */: - preCollectObjectTypeDecls(ast, context); - break; - case 242 /* Parameter */: - preCollectParameterDecl(ast, context); - break; - case 136 /* MemberVariableDeclaration */: - createMemberVariableDeclaration(ast, context); - break; - case 141 /* PropertySignature */: - createPropertySignature(ast, context); - break; - case 225 /* VariableDeclarator */: - preCollectVarDecls(ast, context); - break; - case 137 /* ConstructorDeclaration */: - createClassConstructorDeclaration(ast, context); - break; - case 139 /* GetAccessor */: - createGetAccessorDeclaration(ast, context); - break; - case 140 /* SetAccessor */: - createSetAccessorDeclaration(ast, context); - break; - case 222 /* FunctionExpression */: - createFunctionExpressionDeclaration(ast, context); - break; - case 135 /* MemberFunctionDeclaration */: - createMemberFunctionDeclaration(ast, context); - break; - case 144 /* IndexSignature */: - createIndexSignatureDeclaration(ast, context); - break; - case 123 /* FunctionType */: - createFunctionTypeDeclaration(ast, context); - break; - case 125 /* ConstructorType */: - createConstructorTypeDeclaration(ast, context); - break; - case 142 /* CallSignature */: - createCallSignatureDeclaration(ast, context); - break; - case 143 /* ConstructSignature */: - createConstructSignatureDeclaration(ast, context); - break; - case 145 /* MethodSignature */: - createMethodSignatureDeclaration(ast, context); - break; - case 129 /* FunctionDeclaration */: - createFunctionDeclaration(ast, context); - break; - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - createAnyFunctionExpressionDeclaration(ast, null, context); - break; - case 133 /* ImportDeclaration */: - preCollectImportDecls(ast, context); - break; - case 238 /* TypeParameter */: - preCollectTypeParameterDecl(ast, context); - break; - case 236 /* CatchClause */: - preCollectCatchDecls(ast, context); - break; - case 163 /* WithStatement */: - preCollectWithDecls(ast, context); - break; - case 215 /* ObjectLiteralExpression */: - preCollectObjectLiteralDecls(ast, context); - break; - case 240 /* SimplePropertyAssignment */: - preCollectSimplePropertyAssignmentDecls(ast, context); - break; - case 241 /* FunctionPropertyAssignment */: - preCollectFunctionPropertyAssignmentDecls(ast, context); - break; - } - } - - function isContainer(decl) { - return decl.kind === 4 /* Container */ || decl.kind === 32 /* DynamicModule */ || decl.kind === 64 /* Enum */; - } - - function getInitializationFlag(decl) { - if (decl.kind & 4 /* Container */) { - return 32768 /* InitializedModule */; - } else if (decl.kind & 32 /* DynamicModule */) { - return 65536 /* InitializedDynamicModule */; - } - - return 0 /* None */; - } - - function hasInitializationFlag(decl) { - var kind = decl.kind; - - if (kind & 4 /* Container */) { - return (decl.flags & 32768 /* InitializedModule */) !== 0; - } else if (kind & 32 /* DynamicModule */) { - return (decl.flags & 65536 /* InitializedDynamicModule */) !== 0; - } - - return false; - } - - function postCollectDecls(ast, context) { - var currentDecl = context.getParent(); - - if (ast.kind() === 11 /* IdentifierName */ || ast.kind() === 14 /* StringLiteral */) { - if (currentDecl.kind === 4 /* Container */ || currentDecl.kind === 32 /* DynamicModule */) { - return; - } - } - - if (ast.kind() === 130 /* ModuleDeclaration */) { - var moduleDeclaration = ast; - if (moduleDeclaration.stringLiteral) { - TypeScript.Debug.assert(currentDecl.ast() === moduleDeclaration.stringLiteral); - context.popParent(); - } else { - var moduleNames = getModuleNames(moduleDeclaration.name); - for (var i = moduleNames.length - 1; i >= 0; i--) { - var moduleName = moduleNames[i]; - TypeScript.Debug.assert(currentDecl.ast() === moduleName); - context.popParent(); - currentDecl = context.getParent(); - } - } - } - - if (ast.kind() === 132 /* EnumDeclaration */) { - computeEnumElementConstantValues(ast, currentDecl, context); - } - - while (currentDecl.getParentDecl() && currentDecl.ast() === ast) { - context.popParent(); - currentDecl = context.getParent(); - } - } - - function computeEnumElementConstantValues(ast, enumDecl, context) { - TypeScript.Debug.assert(enumDecl.kind === 64 /* Enum */); - - var isAmbientEnum = TypeScript.hasFlag(enumDecl.flags, 8 /* Ambient */); - var inConstantSection = !isAmbientEnum; - var currentConstantValue = 0; - var enumMemberDecls = enumDecl.getChildDecls(); - - for (var i = 0, n = ast.enumElements.nonSeparatorCount(); i < n; i++) { - var enumElement = ast.enumElements.nonSeparatorAt(i); - var enumElementDecl = TypeScript.ArrayUtilities.first(enumMemberDecls, function (d) { - return context.semanticInfoChain.getASTForDecl(d) === enumElement; - }); - - TypeScript.Debug.assert(enumElementDecl.kind === 67108864 /* EnumMember */); - - if (enumElement.equalsValueClause === null) { - if (inConstantSection) { - enumElementDecl.constantValue = currentConstantValue; - currentConstantValue++; - } - } else { - enumElementDecl.constantValue = computeEnumElementConstantValue(enumElement.equalsValueClause.value, enumMemberDecls, context); - if (enumElementDecl.constantValue !== null && !isAmbientEnum) { - inConstantSection = true; - currentConstantValue = enumElementDecl.constantValue + 1; - } else { - inConstantSection = false; - } - } - - TypeScript.Debug.assert(enumElementDecl.constantValue !== undefined); - } - } - - function computeEnumElementConstantValue(expression, enumMemberDecls, context) { - TypeScript.Debug.assert(expression); - - if (TypeScript.ASTHelpers.isIntegerLiteralAST(expression)) { - var token; - switch (expression.kind()) { - case 164 /* PlusExpression */: - case 165 /* NegateExpression */: - token = expression.operand; - break; - default: - token = expression; - } - - var value = token.value(); - return value && expression.kind() === 165 /* NegateExpression */ ? -value : value; - } else if (context.propagateEnumConstants) { - switch (expression.kind()) { - case 11 /* IdentifierName */: - var name = expression; - var matchingEnumElement = TypeScript.ArrayUtilities.firstOrDefault(enumMemberDecls, function (d) { - return d.name === name.valueText(); - }); - - return matchingEnumElement ? matchingEnumElement.constantValue : null; - - case 202 /* LeftShiftExpression */: - var binaryExpression = expression; - var left = computeEnumElementConstantValue(binaryExpression.left, enumMemberDecls, context); - var right = computeEnumElementConstantValue(binaryExpression.right, enumMemberDecls, context); - if (left === null || right === null) { - return null; - } - - return left << right; - - case 189 /* BitwiseOrExpression */: - var binaryExpression = expression; - var left = computeEnumElementConstantValue(binaryExpression.left, enumMemberDecls, context); - var right = computeEnumElementConstantValue(binaryExpression.right, enumMemberDecls, context); - if (left === null || right === null) { - return null; - } - - return left | right; - } - - return null; - } else { - return null; - } - } - - (function (DeclarationCreator) { - function create(document, semanticInfoChain, compilationSettings) { - var declCollectionContext = new DeclCollectionContext(document, semanticInfoChain, compilationSettings.propagateEnumConstants()); - - TypeScript.getAstWalkerFactory().simpleWalk(document.sourceUnit(), preCollectDecls, postCollectDecls, declCollectionContext); - - return declCollectionContext.getParent(); - } - DeclarationCreator.create = create; - })(TypeScript.DeclarationCreator || (TypeScript.DeclarationCreator = {})); - var DeclarationCreator = TypeScript.DeclarationCreator; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var PullSymbolBinder = (function () { - function PullSymbolBinder(semanticInfoChain) { - this.semanticInfoChain = semanticInfoChain; - this.declsBeingBound = []; - this.inBindingOtherDeclsWalker = new TypeScript.PullHelpers.OtherPullDeclsWalker(); - } - PullSymbolBinder.prototype.getParent = function (decl, returnInstanceType) { - if (typeof returnInstanceType === "undefined") { returnInstanceType = false; } - var parentDecl = decl.getParentDecl(); - - if (parentDecl.kind === 1 /* Script */) { - return null; - } - - var parent = parentDecl.getSymbol(); - - if (!parent && parentDecl && !parentDecl.hasBeenBound()) { - this.bindDeclToPullSymbol(parentDecl); - } - - parent = parentDecl.getSymbol(); - if (parent) { - var parentDeclKind = parentDecl.kind; - if (parentDeclKind === 262144 /* GetAccessor */) { - parent = parent.getGetter(); - } else if (parentDeclKind === 524288 /* SetAccessor */) { - parent = parent.getSetter(); - } - } - - if (parent) { - if (returnInstanceType && parent.isType() && parent.isContainer()) { - var instanceSymbol = parent.getInstanceSymbol(); - - if (instanceSymbol) { - return instanceSymbol.type; - } - } - - return parent.type; - } - - return null; - }; - - PullSymbolBinder.prototype.findDeclsInContext = function (startingDecl, declKind, searchGlobally) { - if (!searchGlobally) { - var parentDecl = startingDecl.getParentDecl(); - return parentDecl.searchChildDecls(startingDecl.name, declKind); - } - - var contextSymbolPath = startingDecl.getParentPath(); - - if (contextSymbolPath.length) { - var copyOfContextSymbolPath = []; - - for (var i = 0; i < contextSymbolPath.length; i++) { - if (contextSymbolPath[i].kind & 1 /* Script */) { - continue; - } - copyOfContextSymbolPath[copyOfContextSymbolPath.length] = contextSymbolPath[i].name; - } - - return this.semanticInfoChain.findDecls(copyOfContextSymbolPath, declKind); - } - }; - - PullSymbolBinder.prototype.getExistingSymbol = function (decl, searchKind, parent) { - var lookingForValue = (searchKind & 68147712 /* SomeValue */) !== 0; - var lookingForType = (searchKind & 58728795 /* SomeType */) !== 0; - var lookingForContainer = (searchKind & 164 /* SomeContainer */) !== 0; - var name = decl.name; - if (parent) { - var isExported = (decl.flags & 1 /* Exported */) !== 0; - - var prevSymbol = null; - if (lookingForValue) { - prevSymbol = parent.findContainedNonMember(name); - } else if (lookingForType) { - prevSymbol = parent.findContainedNonMemberType(name, searchKind); - } else if (lookingForContainer) { - prevSymbol = parent.findContainedNonMemberContainer(name, searchKind); - } - var prevIsExported = !prevSymbol; - if (!prevSymbol) { - if (lookingForValue) { - prevSymbol = parent.findMember(name, false); - } else if (lookingForType) { - prevSymbol = parent.findNestedType(name, searchKind); - } else if (lookingForContainer) { - prevSymbol = parent.findNestedContainer(name, searchKind); - } - } - - if (isExported && prevIsExported) { - return prevSymbol; - } - if (prevSymbol) { - var prevDecls = prevSymbol.getDeclarations(); - var lastPrevDecl = prevDecls[prevDecls.length - 1]; - var parentDecl = decl.getParentDecl(); - var prevParentDecl = lastPrevDecl && lastPrevDecl.getParentDecl(); - if (parentDecl !== prevParentDecl) { - return null; - } - - return prevSymbol; - } - } else { - var parentDecl = decl.getParentDecl(); - if (parentDecl && parentDecl.kind === 1 /* Script */) { - return this.semanticInfoChain.findTopLevelSymbol(name, searchKind, decl); - } else { - var prevDecls = parentDecl && parentDecl.searchChildDecls(name, searchKind); - return prevDecls[0] && prevDecls[0].getSymbol(); - } - } - - return null; - }; - - PullSymbolBinder.prototype.checkThatExportsMatch = function (decl, prevSymbol, reportError) { - if (typeof reportError === "undefined") { reportError = true; } - var isExported = (decl.flags & 1 /* Exported */) !== 0; - var prevDecls = prevSymbol.getDeclarations(); - var prevIsExported = (prevDecls[prevDecls.length - 1].flags & 1 /* Exported */) !== 0; - if ((isExported !== prevIsExported) && !prevSymbol.isSignature() && (decl.kind & 7340032 /* SomeSignature */) === 0) { - if (reportError) { - var ast = this.semanticInfoChain.getASTForDecl(decl); - this.semanticInfoChain.addDiagnosticFromAST(ast, TypeScript.DiagnosticCode.All_declarations_of_merged_declaration_0_must_be_exported_or_not_exported, [decl.getDisplayName()]); - } - return false; - } - - return true; - }; - - PullSymbolBinder.prototype.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList = function (signature, currentSignatures) { - var signatureDecl = signature.getDeclarations()[0]; - TypeScript.Debug.assert(signatureDecl); - var enclosingDecl = signatureDecl.getParentDecl(); - var indexToInsert = TypeScript.ArrayUtilities.indexOf(currentSignatures, function (someSignature) { - return someSignature.getDeclarations()[0].getParentDecl() !== enclosingDecl; - }); - return indexToInsert < 0 ? currentSignatures.length : indexToInsert; - }; - - PullSymbolBinder.prototype.bindEnumDeclarationToPullSymbol = function (enumContainerDecl) { - var enumName = enumContainerDecl.name; - - var enumContainerSymbol = null; - var enumInstanceSymbol = null; - var moduleInstanceTypeSymbol = null; - - var enumInstanceDecl = enumContainerDecl.getValueDecl(); - - var enumDeclKind = enumContainerDecl.kind; - - var parent = this.getParent(enumContainerDecl); - var parentInstanceSymbol = this.getParent(enumContainerDecl, true); - var parentDecl = enumContainerDecl.getParentDecl(); - var enumAST = this.semanticInfoChain.getASTForDecl(enumContainerDecl); - - var isExported = enumContainerDecl.flags & 1 /* Exported */; - - var createdNewSymbol = false; - - enumContainerSymbol = this.getExistingSymbol(enumContainerDecl, 64 /* Enum */, parent); - - if (enumContainerSymbol) { - if (enumContainerSymbol.kind !== enumDeclKind) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(enumAST.identifier, enumContainerDecl.getDisplayName(), enumContainerSymbol.getDeclarations()[0].ast()); - enumContainerSymbol = null; - } else if (!this.checkThatExportsMatch(enumContainerDecl, enumContainerSymbol)) { - enumContainerSymbol = null; - } - } - - if (enumContainerSymbol) { - enumInstanceSymbol = enumContainerSymbol.getInstanceSymbol(); - } else { - enumContainerSymbol = new TypeScript.PullContainerSymbol(enumName, enumDeclKind); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(enumContainerSymbol, 64 /* Enum */); - } - } - - enumContainerSymbol.addDeclaration(enumContainerDecl); - enumContainerDecl.setSymbol(enumContainerSymbol); - - this.semanticInfoChain.setSymbolForAST(enumAST.identifier, enumContainerSymbol); - this.semanticInfoChain.setSymbolForAST(enumAST, enumContainerSymbol); - - if (!enumInstanceSymbol) { - var variableSymbol = null; - if (parentInstanceSymbol) { - if (isExported) { - variableSymbol = parentInstanceSymbol.findMember(enumName, false); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findContainedNonMember(enumName); - } - } else { - variableSymbol = parentInstanceSymbol.findContainedNonMember(enumName); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findMember(enumName, false); - } - } - - if (variableSymbol) { - var declarations = variableSymbol.getDeclarations(); - - if (declarations.length) { - var variableSymbolParentDecl = declarations[0].getParentDecl(); - - if (parentDecl !== variableSymbolParentDecl) { - variableSymbol = null; - } - } - } - } else if (!(enumContainerDecl.flags & 1 /* Exported */)) { - var siblingDecls = parentDecl.getChildDecls(); - var augmentedDecl = null; - - for (var i = 0; i < siblingDecls.length; i++) { - if (siblingDecls[i] === enumContainerDecl) { - break; - } - - if ((siblingDecls[i].name === enumName) && (siblingDecls[i].kind & 68147712 /* SomeValue */)) { - augmentedDecl = siblingDecls[i]; - break; - } - } - - if (augmentedDecl) { - variableSymbol = augmentedDecl.getSymbol(); - - if (variableSymbol) { - if (variableSymbol.isContainer()) { - variableSymbol = variableSymbol.getInstanceSymbol(); - } else if (variableSymbol && variableSymbol.isType()) { - variableSymbol = variableSymbol.getConstructorMethod(); - } - } - } - } - - if (variableSymbol) { - enumInstanceSymbol = variableSymbol; - moduleInstanceTypeSymbol = variableSymbol.type; - } else { - enumInstanceSymbol = new TypeScript.PullSymbol(enumName, 512 /* Variable */); - } - - enumContainerSymbol.setInstanceSymbol(enumInstanceSymbol); - - if (!moduleInstanceTypeSymbol) { - moduleInstanceTypeSymbol = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - enumInstanceSymbol.type = moduleInstanceTypeSymbol; - } - - moduleInstanceTypeSymbol.addDeclaration(enumContainerDecl); - - if (!moduleInstanceTypeSymbol.getAssociatedContainerType()) { - moduleInstanceTypeSymbol.setAssociatedContainerType(enumContainerSymbol); - } - } - - if (createdNewSymbol && parent) { - if (enumContainerDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(enumContainerSymbol); - } else { - parent.addEnclosedNonMemberType(enumContainerSymbol); - } - } - - if (createdNewSymbol) { - this.bindEnumIndexerDeclsToPullSymbols(enumContainerSymbol); - } - var valueDecl = enumContainerDecl.getValueDecl(); - - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - }; - - PullSymbolBinder.prototype.bindEnumIndexerDeclsToPullSymbols = function (enumContainerSymbol) { - var enumContainerInstanceTypeSymbol = enumContainerSymbol.getInstanceSymbol().type; - - var syntheticIndexerParameterSymbol = new TypeScript.PullSymbol("x", 2048 /* Parameter */); - syntheticIndexerParameterSymbol.type = this.semanticInfoChain.numberTypeSymbol; - syntheticIndexerParameterSymbol.setResolved(); - syntheticIndexerParameterSymbol.setIsSynthesized(); - - var syntheticIndexerSignatureSymbol = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - syntheticIndexerSignatureSymbol.addParameter(syntheticIndexerParameterSymbol); - syntheticIndexerSignatureSymbol.returnType = this.semanticInfoChain.stringTypeSymbol; - syntheticIndexerSignatureSymbol.setResolved(); - syntheticIndexerSignatureSymbol.setIsSynthesized(); - - enumContainerInstanceTypeSymbol.addIndexSignature(syntheticIndexerSignatureSymbol); - }; - - PullSymbolBinder.prototype.findExistingVariableSymbolForModuleValueDecl = function (decl) { - var isExported = TypeScript.hasFlag(decl.flags, 1 /* Exported */); - var modName = decl.name; - var parentInstanceSymbol = this.getParent(decl, true); - var parentDecl = decl.getParentDecl(); - - var variableSymbol = null; - - if (parentInstanceSymbol) { - if (isExported) { - variableSymbol = parentInstanceSymbol.findMember(modName, false); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findContainedNonMember(modName); - } - } else { - variableSymbol = parentInstanceSymbol.findContainedNonMember(modName); - - if (!variableSymbol) { - variableSymbol = parentInstanceSymbol.findMember(modName, false); - } - } - - if (variableSymbol) { - var declarations = variableSymbol.getDeclarations(); - - if (declarations.length) { - var variableSymbolParentDecl = declarations[0].getParentDecl(); - var isExportedOrHasTheSameParent = isExported || (parentDecl === variableSymbolParentDecl); - - var canReuseVariableSymbol = isExportedOrHasTheSameParent && this.checkThatExportsMatch(decl, variableSymbol, false); - - if (!canReuseVariableSymbol) { - variableSymbol = null; - } - } - } - } else if (!isExported) { - var siblingDecls = parentDecl.getChildDecls(); - - for (var i = 0; i < siblingDecls.length; i++) { - var sibling = siblingDecls[i]; - - var siblingIsSomeValue = TypeScript.hasFlag(sibling.kind, 68147712 /* SomeValue */); - var siblingIsFunctionOrHasImplictVarFlag = TypeScript.hasFlag(sibling.kind, 1032192 /* SomeFunction */) || TypeScript.hasFlag(sibling.flags, 118784 /* ImplicitVariable */); - - var isSiblingAnAugmentableVariable = sibling !== decl && sibling !== decl.getValueDecl() && sibling.name === modName && siblingIsSomeValue && siblingIsFunctionOrHasImplictVarFlag; - - if (isSiblingAnAugmentableVariable) { - if (sibling.hasSymbol()) { - variableSymbol = sibling.getSymbol(); - if (variableSymbol.isContainer()) { - variableSymbol = variableSymbol.getInstanceSymbol(); - } else if (variableSymbol && variableSymbol.isType()) { - variableSymbol = variableSymbol.getConstructorMethod(); - } - - break; - } - } - } - } - return variableSymbol; - }; - - PullSymbolBinder.prototype.bindModuleDeclarationToPullSymbol = function (moduleContainerDecl) { - var modName = moduleContainerDecl.name; - - var moduleContainerTypeSymbol = null; - var moduleKind = moduleContainerDecl.kind; - - var parent = this.getParent(moduleContainerDecl); - var parentInstanceSymbol = this.getParent(moduleContainerDecl, true); - var parentDecl = moduleContainerDecl.getParentDecl(); - var moduleNameAST = this.semanticInfoChain.getASTForDecl(moduleContainerDecl); - var moduleDeclAST = TypeScript.ASTHelpers.getEnclosingModuleDeclaration(moduleNameAST); - if (!moduleDeclAST) { - TypeScript.Debug.assert(moduleKind === 32 /* DynamicModule */); - TypeScript.Debug.assert(moduleNameAST.kind() === 120 /* SourceUnit */); - - moduleDeclAST = moduleNameAST; - } - - var isExported = TypeScript.hasFlag(moduleContainerDecl.flags, 1 /* Exported */); - var searchKind = 164 /* SomeContainer */; - var isInitializedModule = (moduleContainerDecl.flags & 102400 /* SomeInitializedModule */) !== 0; - - if (parent && moduleKind === 32 /* DynamicModule */) { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameAST, TypeScript.DiagnosticCode.Ambient_external_module_declaration_must_be_defined_in_global_context, null); - } - - var createdNewSymbol = false; - - moduleContainerTypeSymbol = this.getExistingSymbol(moduleContainerDecl, searchKind, parent); - - if (moduleContainerTypeSymbol) { - if (moduleContainerTypeSymbol.kind !== moduleKind) { - if (isInitializedModule) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(moduleNameAST, moduleContainerDecl.getDisplayName(), moduleContainerTypeSymbol.getDeclarations()[0].ast()); - } - - moduleContainerTypeSymbol = null; - } else if (moduleKind === 32 /* DynamicModule */) { - this.semanticInfoChain.addDiagnosticFromAST(moduleNameAST, TypeScript.DiagnosticCode.Ambient_external_module_declaration_cannot_be_reopened); - } else if (!this.checkThatExportsMatch(moduleContainerDecl, moduleContainerTypeSymbol)) { - moduleContainerTypeSymbol = null; - } - } - - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = new TypeScript.PullContainerSymbol(modName, moduleKind); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(moduleContainerTypeSymbol, searchKind); - } - } - - moduleContainerTypeSymbol.addDeclaration(moduleContainerDecl); - moduleContainerDecl.setSymbol(moduleContainerTypeSymbol); - - this.semanticInfoChain.setSymbolForAST(moduleNameAST, moduleContainerTypeSymbol); - this.semanticInfoChain.setSymbolForAST(moduleDeclAST, moduleContainerTypeSymbol); - - var currentModuleValueDecl = moduleContainerDecl.getValueDecl(); - - var moduleDeclarations = moduleContainerTypeSymbol.getDeclarations(); - - if (createdNewSymbol) { - if (parent) { - if (moduleContainerDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberContainer(moduleContainerTypeSymbol); - } else { - parent.addEnclosedNonMemberContainer(moduleContainerTypeSymbol); - } - } - } - - if (currentModuleValueDecl) { - currentModuleValueDecl.ensureSymbolIsBound(); - - var instanceSymbol = null; - var instanceTypeSymbol = null; - if (currentModuleValueDecl.hasSymbol()) { - instanceSymbol = currentModuleValueDecl.getSymbol(); - } else { - instanceSymbol = new TypeScript.PullSymbol(modName, 512 /* Variable */); - currentModuleValueDecl.setSymbol(instanceSymbol); - if (!instanceSymbol.hasDeclaration(currentModuleValueDecl)) { - instanceSymbol.addDeclaration(currentModuleValueDecl); - } - } - - if (!instanceSymbol.type) { - instanceSymbol.type = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - } - - moduleContainerTypeSymbol.setInstanceSymbol(instanceSymbol); - - if (!instanceSymbol.type.getAssociatedContainerType()) { - instanceSymbol.type.setAssociatedContainerType(moduleContainerTypeSymbol); - } - } - }; - - PullSymbolBinder.prototype.bindImportDeclaration = function (importDeclaration) { - var declFlags = importDeclaration.flags; - var declKind = importDeclaration.kind; - var importDeclAST = this.semanticInfoChain.getASTForDecl(importDeclaration); - - var isExported = false; - var importSymbol = null; - var declName = importDeclaration.name; - var parentHadSymbol = false; - var parent = this.getParent(importDeclaration); - - importSymbol = this.getExistingSymbol(importDeclaration, 164 /* SomeContainer */, parent); - - if (importSymbol) { - parentHadSymbol = true; - } - - if (importSymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(importDeclAST, importDeclaration.getDisplayName(), importSymbol.getDeclarations()[0].ast()); - importSymbol = null; - } - - if (!importSymbol) { - importSymbol = new TypeScript.PullTypeAliasSymbol(declName); - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(importSymbol, 164 /* SomeContainer */); - } - } - - importSymbol.addDeclaration(importDeclaration); - importDeclaration.setSymbol(importSymbol); - - this.semanticInfoChain.setSymbolForAST(importDeclAST, importSymbol); - - if (parent && !parentHadSymbol) { - if (declFlags & 1 /* Exported */) { - parent.addEnclosedMemberContainer(importSymbol); - } else { - parent.addEnclosedNonMemberContainer(importSymbol); - } - } - }; - - PullSymbolBinder.prototype.ensurePriorDeclarationsAreBound = function (container, currentDecl) { - if (!container) { - return; - } - - var parentDecls = container.getDeclarations(); - for (var i = 0; i < parentDecls.length; ++i) { - var parentDecl = parentDecls[i]; - var childDecls = parentDecl.getChildDecls(); - for (var j = 0; j < childDecls.length; ++j) { - var childDecl = childDecls[j]; - if (childDecl === currentDecl) { - return; - } - - if (childDecl.name === currentDecl.name) { - childDecl.ensureSymbolIsBound(); - } - } - } - }; - - PullSymbolBinder.prototype.bindClassDeclarationToPullSymbol = function (classDecl) { - var className = classDecl.name; - var classSymbol = null; - - var constructorSymbol = null; - var constructorTypeSymbol = null; - - var classAST = this.semanticInfoChain.getASTForDecl(classDecl); - - var parent = this.getParent(classDecl); - - this.ensurePriorDeclarationsAreBound(parent, classDecl); - - var parentDecl = classDecl.getParentDecl(); - var isExported = classDecl.flags & 1 /* Exported */; - var isGeneric = false; - - classSymbol = this.getExistingSymbol(classDecl, 58728795 /* SomeType */, parent); - - if (classSymbol && classSymbol.kind === 16 /* Interface */) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(classAST.identifier, classDecl.getDisplayName(), classSymbol.getDeclarations()[0].ast()); - classSymbol = null; - } - - classSymbol = new TypeScript.PullTypeSymbol(className, 8 /* Class */); - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(classSymbol, 8 /* Class */); - } - - classSymbol.addDeclaration(classDecl); - - classDecl.setSymbol(classSymbol); - - this.semanticInfoChain.setSymbolForAST(classAST.identifier, classSymbol); - this.semanticInfoChain.setSymbolForAST(classAST, classSymbol); - - if (parent) { - if (classDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(classSymbol); - } else { - parent.addEnclosedNonMemberType(classSymbol); - } - } - - var typeParameterDecls = classDecl.getTypeParameters(); - - for (var i = 0; i < typeParameterDecls.length; i++) { - var typeParameterSymbol = classSymbol.findTypeParameter(typeParameterDecls[i].name); - - if (typeParameterSymbol) { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterSymbol.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameterSymbol.getName()]); - } - - typeParameterSymbol = new TypeScript.PullTypeParameterSymbol(typeParameterDecls[i].name); - - classSymbol.addTypeParameter(typeParameterSymbol); - typeParameterSymbol.addDeclaration(typeParameterDecls[i]); - typeParameterDecls[i].setSymbol(typeParameterSymbol); - } - - constructorSymbol = classSymbol.getConstructorMethod(); - constructorTypeSymbol = constructorSymbol ? constructorSymbol.type : null; - - if (!constructorSymbol) { - var siblingValueDecls = null; - if (parentDecl) { - siblingValueDecls = parentDecl.searchChildDecls(className, 68147712 /* SomeValue */); - - if (siblingValueDecls && siblingValueDecls[0] && siblingValueDecls[0].hasSymbol()) { - constructorSymbol = siblingValueDecls[0].getSymbol(); - } - } - - if (constructorSymbol) { - constructorTypeSymbol = constructorSymbol.type; - } else { - constructorSymbol = new TypeScript.PullSymbol(className, 32768 /* ConstructorMethod */); - constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - constructorSymbol.setIsSynthesized(); - constructorSymbol.type = constructorTypeSymbol; - } - - classSymbol.setConstructorMethod(constructorSymbol); - classSymbol.setHasDefaultConstructor(); - } - - if (constructorSymbol.getIsSynthesized()) { - constructorSymbol.addDeclaration(classDecl.getValueDecl()); - constructorTypeSymbol.addDeclaration(classDecl); - } else { - classSymbol.setHasDefaultConstructor(false); - } - - constructorTypeSymbol.setAssociatedContainerType(classSymbol); - - var valueDecl = classDecl.getValueDecl(); - - if (valueDecl) { - valueDecl.ensureSymbolIsBound(); - } - - this.bindStaticPrototypePropertyOfClass(classAST, classSymbol, constructorTypeSymbol); - }; - - PullSymbolBinder.prototype.bindInterfaceDeclarationToPullSymbol = function (interfaceDecl) { - var interfaceName = interfaceDecl.name; - var interfaceSymbol = null; - - var interfaceAST = this.semanticInfoChain.getASTForDecl(interfaceDecl); - var createdNewSymbol = false; - var parent = this.getParent(interfaceDecl); - - var acceptableSharedKind = 16 /* Interface */; - - interfaceSymbol = this.getExistingSymbol(interfaceDecl, 58728795 /* SomeType */, parent); - - if (interfaceSymbol) { - if (!(interfaceSymbol.kind & acceptableSharedKind)) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(interfaceAST.identifier, interfaceDecl.getDisplayName(), interfaceSymbol.getDeclarations()[0].ast()); - interfaceSymbol = null; - } else if (!this.checkThatExportsMatch(interfaceDecl, interfaceSymbol)) { - interfaceSymbol = null; - } - } - - if (!interfaceSymbol) { - interfaceSymbol = new TypeScript.PullTypeSymbol(interfaceName, 16 /* Interface */); - createdNewSymbol = true; - - if (!parent) { - this.semanticInfoChain.cacheGlobalSymbol(interfaceSymbol, acceptableSharedKind); - } - } - - interfaceSymbol.addDeclaration(interfaceDecl); - interfaceDecl.setSymbol(interfaceSymbol); - - if (createdNewSymbol) { - if (parent) { - if (interfaceDecl.flags & 1 /* Exported */) { - parent.addEnclosedMemberType(interfaceSymbol); - } else { - parent.addEnclosedNonMemberType(interfaceSymbol); - } - } - } - - var typeParameters = interfaceDecl.getTypeParameters(); - var typeParameter; - var typeParameterDecls = null; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = interfaceSymbol.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - interfaceSymbol.addTypeParameter(typeParameter); - } else { - typeParameterDecls = typeParameter.getDeclarations(); - - for (var j = 0; j < typeParameterDecls.length; j++) { - var typeParameterDeclParent = typeParameterDecls[j].getParentDecl(); - - if (typeParameterDeclParent && typeParameterDeclParent === interfaceDecl) { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameterDecls[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - - break; - } - } - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - }; - - PullSymbolBinder.prototype.bindObjectTypeDeclarationToPullSymbol = function (objectDecl) { - var objectSymbolAST = this.semanticInfoChain.getASTForDecl(objectDecl); - - var objectSymbol = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - - objectSymbol.addDeclaration(objectDecl); - objectDecl.setSymbol(objectSymbol); - - this.semanticInfoChain.setSymbolForAST(objectSymbolAST, objectSymbol); - - var childDecls = objectDecl.getChildDecls(); - - for (var i = 0; i < childDecls.length; i++) { - this.bindDeclToPullSymbol(childDecls[i]); - } - }; - - PullSymbolBinder.prototype.bindConstructorTypeDeclarationToPullSymbol = function (constructorTypeDeclaration) { - var declKind = constructorTypeDeclaration.kind; - var declFlags = constructorTypeDeclaration.flags; - var constructorTypeAST = this.semanticInfoChain.getASTForDecl(constructorTypeDeclaration); - - var constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - - constructorTypeDeclaration.setSymbol(constructorTypeSymbol); - constructorTypeSymbol.addDeclaration(constructorTypeDeclaration); - this.semanticInfoChain.setSymbolForAST(constructorTypeAST, constructorTypeSymbol); - - var signature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - - var funcDecl = this.semanticInfoChain.getASTForDecl(constructorTypeDeclaration); - if (TypeScript.lastParameterIsRest(funcDecl.parameterList)) { - signature.hasVarArgs = true; - } - - signature.addDeclaration(constructorTypeDeclaration); - constructorTypeDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList), constructorTypeSymbol, signature); - - var typeParameters = constructorTypeDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = constructorTypeSymbol.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - constructorTypeSymbol.appendConstructSignature(signature); - }; - - PullSymbolBinder.prototype.bindVariableDeclarationToPullSymbol = function (variableDeclaration) { - var declFlags = variableDeclaration.flags; - var declKind = variableDeclaration.kind; - var varDeclAST = this.semanticInfoChain.getASTForDecl(variableDeclaration); - var nameAST = varDeclAST.kind() === 131 /* ClassDeclaration */ ? varDeclAST.identifier : varDeclAST.kind() === 225 /* VariableDeclarator */ ? varDeclAST.propertyName : varDeclAST.kind() === 132 /* EnumDeclaration */ ? varDeclAST.identifier : varDeclAST; - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var variableSymbol = null; - - var declName = variableDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(variableDeclaration, true); - - var parentDecl = variableDeclaration.getParentDecl(); - - var isImplicit = (declFlags & 118784 /* ImplicitVariable */) !== 0; - var isModuleValue = (declFlags & (32768 /* InitializedModule */)) !== 0; - var isEnumValue = (declFlags & 4096 /* Enum */) !== 0; - var isClassConstructorVariable = (declFlags & 16384 /* ClassConstructorVariable */) !== 0; - variableSymbol = this.getExistingSymbol(variableDeclaration, 68147712 /* SomeValue */, parent); - - if (!variableSymbol && isModuleValue) { - variableSymbol = this.findExistingVariableSymbolForModuleValueDecl(variableDeclaration.getContainerDecl()); - } - - if (variableSymbol && !variableSymbol.isType()) { - parentHadSymbol = true; - } - - var decl; - var decls; - var ast; - var members; - - if (variableSymbol) { - var prevKind = variableSymbol.kind; - var prevIsEnum = variableSymbol.anyDeclHasFlag(4096 /* Enum */); - var prevIsClassConstructorVariable = variableSymbol.anyDeclHasFlag(16384 /* ClassConstructorVariable */); - var prevIsModuleValue = variableSymbol.allDeclsHaveFlag(32768 /* InitializedModule */); - var prevIsImplicit = variableSymbol.anyDeclHasFlag(118784 /* ImplicitVariable */); - var prevIsFunction = TypeScript.ArrayUtilities.any(variableSymbol.getDeclarations(), function (decl) { - return decl.kind === 16384 /* Function */; - }); - var prevIsAmbient = variableSymbol.allDeclsHaveFlag(8 /* Ambient */); - var isAmbientOrPrevIsAmbient = prevIsAmbient || (variableDeclaration.flags & 8 /* Ambient */) !== 0; - var prevDecl = variableSymbol.getDeclarations()[0]; - var prevParentDecl = prevDecl.getParentDecl(); - var bothAreGlobal = parentDecl && (parentDecl.kind === 1 /* Script */) && (prevParentDecl.kind === 1 /* Script */); - var shareParent = bothAreGlobal || prevDecl.getParentDecl() === variableDeclaration.getParentDecl(); - var prevIsParam = shareParent && prevKind === 2048 /* Parameter */ && declKind == 512 /* Variable */; - - var acceptableRedeclaration = prevIsParam || (isImplicit && ((!isEnumValue && !isClassConstructorVariable && prevIsFunction) || ((isModuleValue || isEnumValue) && (prevIsModuleValue || prevIsEnum)) || (isClassConstructorVariable && prevIsModuleValue && isAmbientOrPrevIsAmbient) || (isModuleValue && prevIsClassConstructorVariable))); - - if (acceptableRedeclaration && (prevIsClassConstructorVariable || prevIsFunction) && !isAmbientOrPrevIsAmbient) { - if (prevDecl.fileName() !== variableDeclaration.fileName()) { - this.semanticInfoChain.addDiagnostic(TypeScript.PullHelpers.diagnosticFromDecl(variableDeclaration, TypeScript.DiagnosticCode.Module_0_cannot_merge_with_previous_declaration_of_1_in_a_different_file_2, [declName, declName, prevDecl.fileName()])); - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } - } - - if (!acceptableRedeclaration || prevIsParam) { - if (!prevIsParam && (isImplicit || prevIsImplicit || TypeScript.hasFlag(prevKind, 1032192 /* SomeFunction */)) || !shareParent) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(nameAST, variableDeclaration.getDisplayName(), variableSymbol.getDeclarations()[0].ast()); - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } else { - this.checkThatExportsMatch(variableDeclaration, variableSymbol); - variableSymbol = null; - parentHadSymbol = false; - } - } - - if (variableSymbol && !(variableSymbol.type && variableSymbol.type.isError()) && !this.checkThatExportsMatch(variableDeclaration, variableSymbol, !(isModuleValue && prevIsModuleValue))) { - variableSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(declName); - } - } - - if ((declFlags & 118784 /* ImplicitVariable */) === 0) { - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - if (!parent && parentDecl.kind === 1 /* Script */) { - this.semanticInfoChain.cacheGlobalSymbol(variableSymbol, declKind); - } - } - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - this.semanticInfoChain.setSymbolForAST(nameAST, variableSymbol); - this.semanticInfoChain.setSymbolForAST(varDeclAST, variableSymbol); - } else if (!parentHadSymbol) { - if (isClassConstructorVariable) { - var classTypeSymbol = variableSymbol; - - if (parent) { - members = parent.getMembers(); - - for (var i = 0; i < members.length; i++) { - if ((members[i].name === declName) && (members[i].kind === 8 /* Class */)) { - classTypeSymbol = members[i]; - break; - } - } - } - - if (!classTypeSymbol) { - var containerDecl = variableDeclaration.getContainerDecl(); - classTypeSymbol = containerDecl.getSymbol(); - if (!classTypeSymbol) { - classTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 58728795 /* SomeType */, variableDeclaration); - } - } - - if (classTypeSymbol && (classTypeSymbol.kind !== 8 /* Class */)) { - classTypeSymbol = null; - } - - if (classTypeSymbol && classTypeSymbol.isClass()) { - variableSymbol = classTypeSymbol.getConstructorMethod(); - variableDeclaration.setSymbol(variableSymbol); - - decls = classTypeSymbol.getDeclarations(); - - if (decls.length) { - decl = decls[decls.length - 1]; - ast = this.semanticInfoChain.getASTForDecl(decl); - } - } else { - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - } - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - variableSymbol.type = this.semanticInfoChain.anyTypeSymbol; - } - } else if (declFlags & 102400 /* SomeInitializedModule */) { - var moduleContainerTypeSymbol = null; - var moduleParent = this.getParent(variableDeclaration); - - if (moduleParent) { - members = moduleParent.getMembers(); - - for (var i = 0; i < members.length; i++) { - if ((members[i].name === declName) && (members[i].isContainer())) { - moduleContainerTypeSymbol = members[i]; - break; - } - } - } - - if (!moduleContainerTypeSymbol) { - var containerDecl = variableDeclaration.getContainerDecl(); - moduleContainerTypeSymbol = containerDecl.getSymbol(); - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 164 /* SomeContainer */, variableDeclaration); - - if (!moduleContainerTypeSymbol) { - moduleContainerTypeSymbol = this.semanticInfoChain.findTopLevelSymbol(declName, 64 /* Enum */, variableDeclaration); - } - } - } - - if (moduleContainerTypeSymbol && (!moduleContainerTypeSymbol.isContainer())) { - moduleContainerTypeSymbol = null; - } - - if (moduleContainerTypeSymbol) { - variableSymbol = moduleContainerTypeSymbol.getInstanceSymbol(); - if (!variableSymbol) { - variableSymbol = new TypeScript.PullSymbol(declName, declKind); - variableSymbol.type = new TypeScript.PullTypeSymbol("", 8388608 /* ObjectType */); - } - - if (!variableSymbol.hasDeclaration(variableDeclaration)) { - variableSymbol.addDeclaration(variableDeclaration); - } - variableDeclaration.setSymbol(variableSymbol); - } else { - TypeScript.Debug.assert(false, "Attempted to bind invalid implicit variable symbol"); - } - } - } else { - if (!variableSymbol.hasDeclaration(variableDeclaration)) { - variableSymbol.addDeclaration(variableDeclaration); - } - variableDeclaration.setSymbol(variableSymbol); - } - - var containerDecl = variableDeclaration.getContainerDecl(); - if (variableSymbol && variableSymbol.type && containerDecl && !variableSymbol.type.hasDeclaration(containerDecl)) { - variableSymbol.type.addDeclaration(containerDecl); - } - - if (parent && !parentHadSymbol) { - if (declFlags & 1 /* Exported */) { - parent.addMember(variableSymbol); - } else { - parent.addEnclosedNonMember(variableSymbol); - } - } - }; - - PullSymbolBinder.prototype.bindCatchVariableToPullSymbol = function (variableDeclaration) { - var declFlags = variableDeclaration.flags; - var declKind = variableDeclaration.kind; - var identifier = this.semanticInfoChain.getASTForDecl(variableDeclaration); - - var declName = variableDeclaration.name; - - var variableSymbol = new TypeScript.PullSymbol(declName, declKind); - - variableSymbol.addDeclaration(variableDeclaration); - variableDeclaration.setSymbol(variableSymbol); - - variableSymbol.type = this.semanticInfoChain.anyTypeSymbol; - - this.semanticInfoChain.setSymbolForAST(identifier, variableSymbol); - }; - - PullSymbolBinder.prototype.bindEnumMemberDeclarationToPullSymbol = function (propertyDeclaration) { - var declFlags = propertyDeclaration.flags; - var declKind = propertyDeclaration.kind; - var propDeclAST = this.semanticInfoChain.getASTForDecl(propertyDeclaration); - - var declName = propertyDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(propertyDeclaration, true); - - var propertySymbol = parent.findMember(declName, false); - - if (propertySymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(propDeclAST.propertyName, propertyDeclaration.getDisplayName(), propertySymbol.getDeclarations()[0].ast()); - } - - if (propertySymbol) { - parentHadSymbol = true; - } - - if (!parentHadSymbol) { - propertySymbol = new TypeScript.PullSymbol(declName, declKind); - } - - propertySymbol.addDeclaration(propertyDeclaration); - propertyDeclaration.setSymbol(propertySymbol); - - this.semanticInfoChain.setSymbolForAST(propDeclAST.propertyName, propertySymbol); - this.semanticInfoChain.setSymbolForAST(propDeclAST, propertySymbol); - - if (parent && !parentHadSymbol) { - parent.addMember(propertySymbol); - } - }; - - PullSymbolBinder.prototype.bindPropertyDeclarationToPullSymbol = function (propertyDeclaration) { - var declFlags = propertyDeclaration.flags; - var declKind = propertyDeclaration.kind; - - var ast = this.semanticInfoChain.getASTForDecl(propertyDeclaration); - var astName = ast.kind() === 136 /* MemberVariableDeclaration */ ? ast.variableDeclarator.propertyName : ast.kind() === 141 /* PropertySignature */ ? ast.propertyName : ast.kind() === 242 /* Parameter */ ? ast.identifier : ast.propertyName; - - var isStatic = false; - var isOptional = false; - - var propertySymbol = null; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - if (TypeScript.hasFlag(declFlags, 128 /* Optional */)) { - isOptional = true; - } - - var declName = propertyDeclaration.name; - - var parentHadSymbol = false; - - var parent = this.getParent(propertyDeclaration, true); - - if (parent.isClass() && isStatic) { - parent = parent.getConstructorMethod().type; - } - - propertySymbol = parent.findMember(declName, false); - - if (propertySymbol) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(astName, propertyDeclaration.getDisplayName(), propertySymbol.getDeclarations()[0].ast()); - } - - if (propertySymbol) { - parentHadSymbol = true; - } - - var classTypeSymbol; - - if (!parentHadSymbol) { - propertySymbol = new TypeScript.PullSymbol(declName, declKind); - } - - propertySymbol.addDeclaration(propertyDeclaration); - propertyDeclaration.setSymbol(propertySymbol); - - this.semanticInfoChain.setSymbolForAST(astName, propertySymbol); - this.semanticInfoChain.setSymbolForAST(ast, propertySymbol); - - if (isOptional) { - propertySymbol.isOptional = true; - } - - if (parent && !parentHadSymbol) { - parent.addMember(propertySymbol); - } - }; - - PullSymbolBinder.prototype.bindParameterSymbols = function (functionDeclaration, parameterList, funcType, signatureSymbol) { - var parameters = []; - var params = TypeScript.createIntrinsicsObject(); - var funcDecl = this.semanticInfoChain.getDeclForAST(functionDeclaration); - - if (parameterList) { - for (var i = 0, n = parameterList.length; i < n; i++) { - var argDecl = parameterList.astAt(i); - var id = parameterList.identifierAt(i); - var decl = this.semanticInfoChain.getDeclForAST(argDecl); - var isProperty = TypeScript.hasFlag(decl.flags, 8388608 /* PropertyParameter */); - var parameterSymbol = new TypeScript.PullSymbol(id.valueText(), 2048 /* Parameter */); - - if ((i === (n - 1)) && parameterList.lastParameterIsRest()) { - parameterSymbol.isVarArg = true; - } - - if (params[id.valueText()]) { - this.semanticInfoChain.addDiagnosticFromAST(argDecl, TypeScript.DiagnosticCode.Duplicate_identifier_0, [id.text()]); - } else { - params[id.valueText()] = true; - } - - if (decl) { - var isParameterOptional = false; - - if (isProperty) { - decl.ensureSymbolIsBound(); - var valDecl = decl.getValueDecl(); - - if (valDecl) { - isParameterOptional = TypeScript.hasFlag(valDecl.flags, 128 /* Optional */); - - valDecl.setSymbol(parameterSymbol); - parameterSymbol.addDeclaration(valDecl); - } - } else { - isParameterOptional = TypeScript.hasFlag(decl.flags, 128 /* Optional */); - - parameterSymbol.addDeclaration(decl); - decl.setSymbol(parameterSymbol); - } - - parameterSymbol.isOptional = isParameterOptional; - } - - signatureSymbol.addParameter(parameterSymbol, parameterSymbol.isOptional); - - if (signatureSymbol.isDefinition()) { - funcType.addEnclosedNonMember(parameterSymbol); - } - } - } - }; - - PullSymbolBinder.prototype.bindFunctionDeclarationToPullSymbol = function (functionDeclaration) { - var declKind = functionDeclaration.kind; - var declFlags = functionDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(functionDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = functionDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(functionDeclaration, true); - - var parentDecl = functionDeclaration.getParentDecl(); - var parentHadSymbol = false; - - var functionSymbol = null; - var functionTypeSymbol = null; - - functionSymbol = this.getExistingSymbol(functionDeclaration, 68147712 /* SomeValue */, parent); - - if (functionSymbol) { - var acceptableRedeclaration; - - if (functionSymbol.kind === 16384 /* Function */) { - acceptableRedeclaration = isSignature || functionSymbol.allDeclsHaveFlag(2048 /* Signature */); - } else { - var isCurrentDeclAmbient = TypeScript.hasFlag(functionDeclaration.flags, 8 /* Ambient */); - acceptableRedeclaration = TypeScript.ArrayUtilities.all(functionSymbol.getDeclarations(), function (decl) { - var isInitializedModuleOrAmbientDecl = TypeScript.hasFlag(decl.flags, 32768 /* InitializedModule */) && (isCurrentDeclAmbient || TypeScript.hasFlag(decl.flags, 8 /* Ambient */)); - var isSignature = TypeScript.hasFlag(decl.flags, 2048 /* Signature */); - return isInitializedModuleOrAmbientDecl || isSignature; - }); - } - - if (!acceptableRedeclaration) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.identifier, functionDeclaration.getDisplayName(), functionSymbol.getDeclarations()[0].ast()); - functionSymbol.type = this.semanticInfoChain.getResolver().getNewErrorTypeSymbol(funcName); - } - } - - if (functionSymbol) { - functionTypeSymbol = functionSymbol.type; - parentHadSymbol = true; - } - - if (!functionSymbol) { - functionSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - } - - if (!functionTypeSymbol) { - functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - functionSymbol.type = functionTypeSymbol; - functionTypeSymbol.setFunctionSymbol(functionSymbol); - } - - functionDeclaration.setSymbol(functionSymbol); - functionSymbol.addDeclaration(functionDeclaration); - functionTypeSymbol.addDeclaration(functionDeclaration); - - this.semanticInfoChain.setSymbolForAST(funcDeclAST.identifier, functionSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, functionSymbol); - - if (parent && !parentHadSymbol) { - if (isExported) { - parent.addMember(functionSymbol); - } else { - parent.addEnclosedNonMember(functionSymbol); - } - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(functionDeclaration); - functionDeclaration.setSignatureSymbol(signature); - - if (TypeScript.lastParameterIsRest(funcDeclAST.callSignature.parameterList)) { - signature.hasVarArgs = true; - } - - var funcDecl = this.semanticInfoChain.getASTForDecl(functionDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.callSignature.parameterList), functionTypeSymbol, signature); - - var typeParameters = functionDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindFunctionExpressionToPullSymbol = function (functionExpressionDeclaration) { - var declKind = functionExpressionDeclaration.kind; - var declFlags = functionExpressionDeclaration.flags; - var ast = this.semanticInfoChain.getASTForDecl(functionExpressionDeclaration); - - var parameters = ast.kind() === 219 /* SimpleArrowFunctionExpression */ ? TypeScript.ASTHelpers.parametersFromIdentifier(ast.identifier) : TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(ast)); - var funcExpAST = ast; - - var functionName = declKind === 131072 /* FunctionExpression */ ? functionExpressionDeclaration.getFunctionExpressionName() : functionExpressionDeclaration.name; - var functionSymbol = new TypeScript.PullSymbol(functionName, declKind); - var functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - functionTypeSymbol.setFunctionSymbol(functionSymbol); - - functionSymbol.type = functionTypeSymbol; - - functionExpressionDeclaration.setSymbol(functionSymbol); - functionSymbol.addDeclaration(functionExpressionDeclaration); - functionTypeSymbol.addDeclaration(functionExpressionDeclaration); - - var name = funcExpAST.kind() === 222 /* FunctionExpression */ ? funcExpAST.identifier : funcExpAST.kind() === 241 /* FunctionPropertyAssignment */ ? funcExpAST.propertyName : null; - if (name) { - this.semanticInfoChain.setSymbolForAST(name, functionSymbol); - } - - this.semanticInfoChain.setSymbolForAST(funcExpAST, functionSymbol); - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, true); - - if (parameters.lastParameterIsRest()) { - signature.hasVarArgs = true; - } - - var typeParameters = functionExpressionDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(functionExpressionDeclaration); - functionExpressionDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcExpAST, parameters, functionTypeSymbol, signature); - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindFunctionTypeDeclarationToPullSymbol = function (functionTypeDeclaration) { - var declKind = functionTypeDeclaration.kind; - var declFlags = functionTypeDeclaration.flags; - var funcTypeAST = this.semanticInfoChain.getASTForDecl(functionTypeDeclaration); - - var functionTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - - functionTypeDeclaration.setSymbol(functionTypeSymbol); - functionTypeSymbol.addDeclaration(functionTypeDeclaration); - this.semanticInfoChain.setSymbolForAST(funcTypeAST, functionTypeSymbol); - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - if (TypeScript.lastParameterIsRest(funcTypeAST.parameterList)) { - signature.hasVarArgs = true; - } - - var typeParameters = functionTypeDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = signature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - signature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.name]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(functionTypeDeclaration); - functionTypeDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcTypeAST, TypeScript.ASTHelpers.parametersFromParameterList(funcTypeAST.parameterList), functionTypeSymbol, signature); - - functionTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindMethodDeclarationToPullSymbol = function (methodDeclaration) { - var declKind = methodDeclaration.kind; - var declFlags = methodDeclaration.flags; - var methodAST = this.semanticInfoChain.getASTForDecl(methodDeclaration); - - var isPrivate = (declFlags & 2 /* Private */) !== 0; - var isStatic = (declFlags & 16 /* Static */) !== 0; - var isOptional = (declFlags & 128 /* Optional */) !== 0; - - var methodName = methodDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(methodDeclaration, true); - var parentHadSymbol = false; - - var methodSymbol = null; - var methodTypeSymbol = null; - - if (parent.isClass() && isStatic) { - parent = parent.getConstructorMethod().type; - } - - methodSymbol = parent.findMember(methodName, false); - - if (methodSymbol && (methodSymbol.kind !== 65536 /* Method */ || (!isSignature && !methodSymbol.allDeclsHaveFlag(2048 /* Signature */)))) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(methodAST, methodDeclaration.getDisplayName(), methodSymbol.getDeclarations()[0].ast()); - methodSymbol = null; - } - - if (methodSymbol) { - methodTypeSymbol = methodSymbol.type; - parentHadSymbol = true; - } - - if (!methodSymbol) { - methodSymbol = new TypeScript.PullSymbol(methodName, 65536 /* Method */); - } - - if (!methodTypeSymbol) { - methodTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - methodSymbol.type = methodTypeSymbol; - methodTypeSymbol.setFunctionSymbol(methodSymbol); - } - - methodDeclaration.setSymbol(methodSymbol); - methodSymbol.addDeclaration(methodDeclaration); - methodTypeSymbol.addDeclaration(methodDeclaration); - - var nameAST = methodAST.kind() === 135 /* MemberFunctionDeclaration */ ? methodAST.propertyName : methodAST.propertyName; - - TypeScript.Debug.assert(nameAST); - - this.semanticInfoChain.setSymbolForAST(nameAST, methodSymbol); - this.semanticInfoChain.setSymbolForAST(methodAST, methodSymbol); - - if (isOptional) { - methodSymbol.isOptional = true; - } - - if (!parentHadSymbol) { - parent.addMember(methodSymbol); - } - - var sigKind = 1048576 /* CallSignature */; - - var signature = new TypeScript.PullSignatureSymbol(sigKind, !isSignature); - - var parameterList = TypeScript.ASTHelpers.getParameterList(methodAST); - if (TypeScript.lastParameterIsRest(parameterList)) { - signature.hasVarArgs = true; - } - - var typeParameters = methodDeclaration.getTypeParameters(); - var typeParameter; - var typeParameterName; - var typeParameterAST; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameterName = typeParameters[i].name; - typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameters[i]); - - typeParameter = signature.findTypeParameter(typeParameterName); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameterName); - signature.addTypeParameter(typeParameter); - } else { - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - signature.addDeclaration(methodDeclaration); - methodDeclaration.setSignatureSymbol(signature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(methodDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(funcDecl)), methodTypeSymbol, signature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(signature, methodTypeSymbol.getOwnCallSignatures()); - methodTypeSymbol.insertCallSignatureAtIndex(signature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindStaticPrototypePropertyOfClass = function (classAST, classTypeSymbol, constructorTypeSymbol) { - var prototypeStr = "prototype"; - - var prototypeSymbol = constructorTypeSymbol.findMember(prototypeStr, false); - if (prototypeSymbol && !prototypeSymbol.getIsSynthesized()) { - this.semanticInfoChain.addDiagnostic(TypeScript.PullHelpers.diagnosticFromDecl(prototypeSymbol.getDeclarations()[0], TypeScript.DiagnosticCode.Duplicate_identifier_0, [prototypeSymbol.getDisplayName()])); - } - - if (!prototypeSymbol || !prototypeSymbol.getIsSynthesized()) { - var prototypeDecl = new TypeScript.PullSynthesizedDecl(prototypeStr, prototypeStr, 4096 /* Property */, 4 /* Public */ | 16 /* Static */, constructorTypeSymbol.getDeclarations()[0], this.semanticInfoChain); - - prototypeSymbol = new TypeScript.PullSymbol(prototypeStr, 4096 /* Property */); - prototypeSymbol.setIsSynthesized(); - prototypeSymbol.addDeclaration(prototypeDecl); - prototypeSymbol.type = classTypeSymbol; - constructorTypeSymbol.addMember(prototypeSymbol); - - if (prototypeSymbol.type && prototypeSymbol.type.isGeneric()) { - var resolver = this.semanticInfoChain.getResolver(); - prototypeSymbol.type = resolver.instantiateTypeToAny(prototypeSymbol.type, new TypeScript.PullTypeResolutionContext(resolver)); - } - prototypeSymbol.setResolved(); - } - }; - - PullSymbolBinder.prototype.bindConstructorDeclarationToPullSymbol = function (constructorDeclaration) { - var declKind = constructorDeclaration.kind; - var declFlags = constructorDeclaration.flags; - var constructorAST = this.semanticInfoChain.getASTForDecl(constructorDeclaration); - - var constructorName = constructorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - - var parent = this.getParent(constructorDeclaration, true); - - var parentHadSymbol = false; - - var constructorSymbol = parent.getConstructorMethod(); - var constructorTypeSymbol = null; - - if (constructorSymbol && (constructorSymbol.kind !== 32768 /* ConstructorMethod */ || (!isSignature && constructorSymbol.type && constructorSymbol.type.hasOwnConstructSignatures()))) { - var hasDefinitionSignature = false; - var constructorSigs = constructorSymbol.type.getConstructSignatures(); - - for (var i = 0; i < constructorSigs.length; i++) { - if (!constructorSigs[i].anyDeclHasFlag(2048 /* Signature */)) { - hasDefinitionSignature = true; - break; - } - } - - if (hasDefinitionSignature) { - this.semanticInfoChain.addDiagnosticFromAST(constructorAST, TypeScript.DiagnosticCode.Multiple_constructor_implementations_are_not_allowed); - - constructorSymbol = null; - } - } - - if (constructorSymbol) { - constructorTypeSymbol = constructorSymbol.type; - } else { - constructorSymbol = new TypeScript.PullSymbol(constructorName, 32768 /* ConstructorMethod */); - constructorTypeSymbol = new TypeScript.PullTypeSymbol("", 33554432 /* ConstructorType */); - } - - parent.setConstructorMethod(constructorSymbol); - constructorSymbol.type = constructorTypeSymbol; - - constructorDeclaration.setSymbol(constructorSymbol); - constructorSymbol.addDeclaration(constructorDeclaration); - constructorTypeSymbol.addDeclaration(constructorDeclaration); - constructorSymbol.setIsSynthesized(false); - this.semanticInfoChain.setSymbolForAST(constructorAST, constructorSymbol); - - var constructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */, !isSignature); - constructSignature.returnType = parent; - constructSignature.addTypeParametersFromReturnType(); - - constructSignature.addDeclaration(constructorDeclaration); - constructorDeclaration.setSignatureSymbol(constructSignature); - - this.bindParameterSymbols(constructorAST, TypeScript.ASTHelpers.parametersFromParameterList(constructorAST.callSignature.parameterList), constructorTypeSymbol, constructSignature); - - if (TypeScript.lastParameterIsRest(constructorAST.callSignature.parameterList)) { - constructSignature.hasVarArgs = true; - } - - constructorTypeSymbol.appendConstructSignature(constructSignature); - }; - - PullSymbolBinder.prototype.bindConstructSignatureDeclarationToPullSymbol = function (constructSignatureDeclaration) { - var parent = this.getParent(constructSignatureDeclaration, true); - var constructorAST = this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration); - - var constructSignature = new TypeScript.PullSignatureSymbol(2097152 /* ConstructSignature */); - - if (TypeScript.lastParameterIsRest(constructorAST.callSignature.parameterList)) { - constructSignature.hasVarArgs = true; - } - - var typeParameters = constructSignatureDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = constructSignature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - constructSignature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - constructSignature.addDeclaration(constructSignatureDeclaration); - constructSignatureDeclaration.setSignatureSymbol(constructSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(TypeScript.ASTHelpers.getParameterList(funcDecl)), null, constructSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(constructSignatureDeclaration), constructSignature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(constructSignature, parent.getOwnConstructSignatures()); - parent.insertConstructSignatureAtIndex(constructSignature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindCallSignatureDeclarationToPullSymbol = function (callSignatureDeclaration) { - var parent = this.getParent(callSignatureDeclaration, true); - var callSignatureAST = this.semanticInfoChain.getASTForDecl(callSignatureDeclaration); - - var callSignature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */); - - if (TypeScript.lastParameterIsRest(callSignatureAST.parameterList)) { - callSignature.hasVarArgs = true; - } - - var typeParameters = callSignatureDeclaration.getTypeParameters(); - var typeParameter; - - for (var i = 0; i < typeParameters.length; i++) { - typeParameter = callSignature.findTypeParameter(typeParameters[i].name); - - if (!typeParameter) { - typeParameter = new TypeScript.PullTypeParameterSymbol(typeParameters[i].name); - - callSignature.addTypeParameter(typeParameter); - } else { - var typeParameterAST = this.semanticInfoChain.getASTForDecl(typeParameter.getDeclarations()[0]); - this.semanticInfoChain.addDiagnosticFromAST(typeParameterAST, TypeScript.DiagnosticCode.Duplicate_identifier_0, [typeParameter.getName()]); - } - - typeParameter.addDeclaration(typeParameters[i]); - typeParameters[i].setSymbol(typeParameter); - } - - callSignature.addDeclaration(callSignatureDeclaration); - callSignatureDeclaration.setSignatureSymbol(callSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(callSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameterList(funcDecl.parameterList), null, callSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(callSignatureDeclaration), callSignature); - - var signatureIndex = this.getIndexForInsertingSignatureAtEndOfEnclosingDeclInSignatureList(callSignature, parent.getOwnCallSignatures()); - parent.insertCallSignatureAtIndex(callSignature, signatureIndex); - }; - - PullSymbolBinder.prototype.bindIndexSignatureDeclarationToPullSymbol = function (indexSignatureDeclaration) { - var indexSignature = new TypeScript.PullSignatureSymbol(4194304 /* IndexSignature */); - - indexSignature.addDeclaration(indexSignatureDeclaration); - indexSignatureDeclaration.setSignatureSymbol(indexSignature); - - var funcDecl = this.semanticInfoChain.getASTForDecl(indexSignatureDeclaration); - this.bindParameterSymbols(funcDecl, TypeScript.ASTHelpers.parametersFromParameter(funcDecl.parameter), null, indexSignature); - - this.semanticInfoChain.setSymbolForAST(this.semanticInfoChain.getASTForDecl(indexSignatureDeclaration), indexSignature); - - var parent = this.getParent(indexSignatureDeclaration); - parent.addIndexSignature(indexSignature); - indexSignature.setContainer(parent); - }; - - PullSymbolBinder.prototype.bindGetAccessorDeclarationToPullSymbol = function (getAccessorDeclaration) { - var declKind = getAccessorDeclaration.kind; - var declFlags = getAccessorDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(getAccessorDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = getAccessorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var isStatic = false; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - var parent = this.getParent(getAccessorDeclaration, true); - var parentHadSymbol = false; - - var accessorSymbol = null; - var getterSymbol = null; - var getterTypeSymbol = null; - - if (isStatic) { - parent = parent.getConstructorMethod().type; - } - - accessorSymbol = parent.findMember(funcName, false); - - if (accessorSymbol) { - if (!accessorSymbol.isAccessor()) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.propertyName, getAccessorDeclaration.getDisplayName(), accessorSymbol.getDeclarations()[0].ast()); - accessorSymbol = null; - } else { - getterSymbol = accessorSymbol.getGetter(); - - if (getterSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Getter_0_already_declared, [getAccessorDeclaration.getDisplayName()]); - accessorSymbol = null; - getterSymbol = null; - } - } - } - - if (accessorSymbol) { - parentHadSymbol = true; - } - - if (accessorSymbol && getterSymbol) { - getterTypeSymbol = getterSymbol.type; - } - - if (!accessorSymbol) { - accessorSymbol = new TypeScript.PullAccessorSymbol(funcName); - } - - if (!getterSymbol) { - getterSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - getterTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - getterTypeSymbol.setFunctionSymbol(getterSymbol); - - getterSymbol.type = getterTypeSymbol; - - accessorSymbol.setGetter(getterSymbol); - } - - getAccessorDeclaration.setSymbol(accessorSymbol); - accessorSymbol.addDeclaration(getAccessorDeclaration); - getterSymbol.addDeclaration(getAccessorDeclaration); - - var nameAST = funcDeclAST.propertyName; - this.semanticInfoChain.setSymbolForAST(nameAST, accessorSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, getterSymbol); - - if (!parentHadSymbol) { - parent.addMember(accessorSymbol); - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(getAccessorDeclaration); - getAccessorDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDeclAST, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), getterTypeSymbol, signature); - - getterTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.bindSetAccessorDeclarationToPullSymbol = function (setAccessorDeclaration) { - var declKind = setAccessorDeclaration.kind; - var declFlags = setAccessorDeclaration.flags; - var funcDeclAST = this.semanticInfoChain.getASTForDecl(setAccessorDeclaration); - - var isExported = (declFlags & 1 /* Exported */) !== 0; - - var funcName = setAccessorDeclaration.name; - - var isSignature = (declFlags & 2048 /* Signature */) !== 0; - var isStatic = false; - - if (TypeScript.hasFlag(declFlags, 16 /* Static */)) { - isStatic = true; - } - - var parent = this.getParent(setAccessorDeclaration, true); - var parentHadSymbol = false; - - var accessorSymbol = null; - var setterSymbol = null; - var setterTypeSymbol = null; - - if (isStatic) { - parent = parent.getConstructorMethod().type; - } - - accessorSymbol = parent.findMember(funcName, false); - - if (accessorSymbol) { - if (!accessorSymbol.isAccessor()) { - this.semanticInfoChain.addDuplicateIdentifierDiagnosticFromAST(funcDeclAST.propertyName, setAccessorDeclaration.getDisplayName(), accessorSymbol.getDeclarations()[0].ast()); - accessorSymbol = null; - } else { - setterSymbol = accessorSymbol.getSetter(); - - if (setterSymbol) { - this.semanticInfoChain.addDiagnosticFromAST(funcDeclAST, TypeScript.DiagnosticCode.Setter_0_already_declared, [setAccessorDeclaration.getDisplayName()]); - accessorSymbol = null; - setterSymbol = null; - } - } - } - - if (accessorSymbol) { - parentHadSymbol = true; - - if (setterSymbol) { - setterTypeSymbol = setterSymbol.type; - } - } - - if (!accessorSymbol) { - accessorSymbol = new TypeScript.PullAccessorSymbol(funcName); - } - - if (!setterSymbol) { - setterSymbol = new TypeScript.PullSymbol(funcName, 16384 /* Function */); - setterTypeSymbol = new TypeScript.PullTypeSymbol("", 16777216 /* FunctionType */); - setterTypeSymbol.setFunctionSymbol(setterSymbol); - - setterSymbol.type = setterTypeSymbol; - - accessorSymbol.setSetter(setterSymbol); - } - - setAccessorDeclaration.setSymbol(accessorSymbol); - accessorSymbol.addDeclaration(setAccessorDeclaration); - setterSymbol.addDeclaration(setAccessorDeclaration); - - var nameAST = funcDeclAST.propertyName; - this.semanticInfoChain.setSymbolForAST(nameAST, accessorSymbol); - this.semanticInfoChain.setSymbolForAST(funcDeclAST, setterSymbol); - - if (!parentHadSymbol) { - parent.addMember(accessorSymbol); - } - - var signature = new TypeScript.PullSignatureSymbol(1048576 /* CallSignature */, !isSignature); - - signature.addDeclaration(setAccessorDeclaration); - setAccessorDeclaration.setSignatureSymbol(signature); - - this.bindParameterSymbols(funcDeclAST, TypeScript.ASTHelpers.parametersFromParameterList(funcDeclAST.parameterList), setterTypeSymbol, signature); - - setterTypeSymbol.appendCallSignature(signature); - }; - - PullSymbolBinder.prototype.getDeclsToBind = function (decl) { - var decls; - switch (decl.kind) { - case 64 /* Enum */: - case 32 /* DynamicModule */: - case 4 /* Container */: - case 16 /* Interface */: - decls = this.findDeclsInContext(decl, decl.kind, true); - break; - - case 512 /* Variable */: - case 16384 /* Function */: - case 65536 /* Method */: - case 32768 /* ConstructorMethod */: - decls = this.findDeclsInContext(decl, decl.kind, false); - break; - - default: - decls = [decl]; - } - TypeScript.Debug.assert(decls && decls.length > 0); - TypeScript.Debug.assert(TypeScript.ArrayUtilities.contains(decls, decl)); - return decls; - }; - - PullSymbolBinder.prototype.shouldBindDeclaration = function (decl) { - return !decl.hasBeenBound() && this.declsBeingBound.indexOf(decl.declID) < 0; - }; - - PullSymbolBinder.prototype.bindDeclToPullSymbol = function (decl) { - if (this.shouldBindDeclaration(decl)) { - this.bindAllDeclsToPullSymbol(decl); - } - }; - - PullSymbolBinder.prototype.bindAllDeclsToPullSymbol = function (askedDecl) { - var allDecls = this.getDeclsToBind(askedDecl); - for (var i = 0; i < allDecls.length; i++) { - var decl = allDecls[i]; - - if (this.shouldBindDeclaration(decl)) { - this.bindSingleDeclToPullSymbol(decl); - } - } - }; - - PullSymbolBinder.prototype.bindSingleDeclToPullSymbol = function (decl) { - this.declsBeingBound.push(decl.declID); - - switch (decl.kind) { - case 1 /* Script */: - var childDecls = decl.getChildDecls(); - for (var i = 0; i < childDecls.length; i++) { - this.bindDeclToPullSymbol(childDecls[i]); - } - break; - - case 64 /* Enum */: - this.bindEnumDeclarationToPullSymbol(decl); - break; - - case 32 /* DynamicModule */: - case 4 /* Container */: - this.bindModuleDeclarationToPullSymbol(decl); - break; - - case 16 /* Interface */: - this.bindInterfaceDeclarationToPullSymbol(decl); - break; - - case 8 /* Class */: - this.bindClassDeclarationToPullSymbol(decl); - break; - - case 16384 /* Function */: - this.bindFunctionDeclarationToPullSymbol(decl); - break; - - case 512 /* Variable */: - this.bindVariableDeclarationToPullSymbol(decl); - break; - - case 1024 /* CatchVariable */: - this.bindCatchVariableToPullSymbol(decl); - break; - - case 67108864 /* EnumMember */: - this.bindEnumMemberDeclarationToPullSymbol(decl); - break; - - case 4096 /* Property */: - this.bindPropertyDeclarationToPullSymbol(decl); - break; - - case 65536 /* Method */: - this.bindMethodDeclarationToPullSymbol(decl); - break; - - case 32768 /* ConstructorMethod */: - this.bindConstructorDeclarationToPullSymbol(decl); - break; - - case 1048576 /* CallSignature */: - this.bindCallSignatureDeclarationToPullSymbol(decl); - break; - - case 2097152 /* ConstructSignature */: - this.bindConstructSignatureDeclarationToPullSymbol(decl); - break; - - case 4194304 /* IndexSignature */: - this.bindIndexSignatureDeclarationToPullSymbol(decl); - break; - - case 262144 /* GetAccessor */: - this.bindGetAccessorDeclarationToPullSymbol(decl); - break; - - case 524288 /* SetAccessor */: - this.bindSetAccessorDeclarationToPullSymbol(decl); - break; - - case 8388608 /* ObjectType */: - this.bindObjectTypeDeclarationToPullSymbol(decl); - break; - - case 16777216 /* FunctionType */: - this.bindFunctionTypeDeclarationToPullSymbol(decl); - break; - - case 33554432 /* ConstructorType */: - this.bindConstructorTypeDeclarationToPullSymbol(decl); - break; - - case 131072 /* FunctionExpression */: - this.bindFunctionExpressionToPullSymbol(decl); - break; - - case 128 /* TypeAlias */: - this.bindImportDeclaration(decl); - break; - - case 2048 /* Parameter */: - case 8192 /* TypeParameter */: - decl.getParentDecl().getSymbol(); - break; - - case 268435456 /* CatchBlock */: - case 134217728 /* WithBlock */: - break; - - default: - TypeScript.CompilerDiagnostics.assert(false, "Unrecognized type declaration"); - } - - TypeScript.Debug.assert(TypeScript.ArrayUtilities.last(this.declsBeingBound) === decl.declID); - this.declsBeingBound.pop(); - }; - return PullSymbolBinder; - })(); - TypeScript.PullSymbolBinder = PullSymbolBinder; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (PullHelpers) { - function diagnosticFromDecl(decl, diagnosticKey, _arguments, additionalLocations) { - if (typeof _arguments === "undefined") { _arguments = null; } - if (typeof additionalLocations === "undefined") { additionalLocations = null; } - var ast = decl.ast(); - return decl.semanticInfoChain.diagnosticFromAST(ast, diagnosticKey, _arguments, additionalLocations); - } - PullHelpers.diagnosticFromDecl = diagnosticFromDecl; - - function resolveDeclaredSymbolToUseType(symbol) { - if (symbol.isSignature()) { - if (!symbol.returnType) { - symbol._resolveDeclaredSymbol(); - } - } else if (!symbol.type) { - symbol._resolveDeclaredSymbol(); - } - } - PullHelpers.resolveDeclaredSymbolToUseType = resolveDeclaredSymbolToUseType; - - function getSignatureForFuncDecl(functionDecl) { - var funcDecl = functionDecl.ast(); - var funcSymbol = functionDecl.getSymbol(); - - if (!funcSymbol) { - funcSymbol = functionDecl.getSignatureSymbol(); - } - - var functionSignature = null; - var typeSymbolWithAllSignatures = null; - if (funcSymbol.isSignature()) { - functionSignature = funcSymbol; - var parent = functionDecl.getParentDecl(); - typeSymbolWithAllSignatures = parent.getSymbol().type; - } else { - functionSignature = functionDecl.getSignatureSymbol(); - typeSymbolWithAllSignatures = funcSymbol.type; - } - var signatures; - - if (funcDecl.kind() === 137 /* ConstructorDeclaration */ || functionDecl.kind === 2097152 /* ConstructSignature */) { - signatures = typeSymbolWithAllSignatures.getConstructSignatures(); - } else if (functionDecl.kind === 4194304 /* IndexSignature */) { - signatures = typeSymbolWithAllSignatures.getIndexSignatures(); - } else { - signatures = typeSymbolWithAllSignatures.getCallSignatures(); - } - - return { - signature: functionSignature, - allSignatures: signatures - }; - } - PullHelpers.getSignatureForFuncDecl = getSignatureForFuncDecl; - - function getAccessorSymbol(getterOrSetter, semanticInfoChain) { - var functionDecl = semanticInfoChain.getDeclForAST(getterOrSetter); - var getterOrSetterSymbol = functionDecl.getSymbol(); - - return getterOrSetterSymbol; - } - PullHelpers.getAccessorSymbol = getAccessorSymbol; - - function getGetterAndSetterFunction(funcDecl, semanticInfoChain) { - var accessorSymbol = PullHelpers.getAccessorSymbol(funcDecl, semanticInfoChain); - var result = { - getter: null, - setter: null - }; - var getter = accessorSymbol.getGetter(); - if (getter) { - var getterDecl = getter.getDeclarations()[0]; - result.getter = semanticInfoChain.getASTForDecl(getterDecl); - } - var setter = accessorSymbol.getSetter(); - if (setter) { - var setterDecl = setter.getDeclarations()[0]; - result.setter = semanticInfoChain.getASTForDecl(setterDecl); - } - - return result; - } - PullHelpers.getGetterAndSetterFunction = getGetterAndSetterFunction; - - function symbolIsEnum(source) { - return source && (source.kind & (64 /* Enum */ | 67108864 /* EnumMember */)) !== 0; - } - PullHelpers.symbolIsEnum = symbolIsEnum; - - function symbolIsModule(symbol) { - return symbol && (symbol.kind === 4 /* Container */ || isOneDeclarationOfKind(symbol, 4 /* Container */)); - } - PullHelpers.symbolIsModule = symbolIsModule; - - function isOneDeclarationOfKind(symbol, kind) { - var decls = symbol.getDeclarations(); - for (var i = 0; i < decls.length; i++) { - if (decls[i].kind === kind) { - return true; - } - } - - return false; - } - - function isNameNumeric(name) { - return isFinite(+name); - } - PullHelpers.isNameNumeric = isNameNumeric; - - function typeSymbolsAreIdentical(a, b) { - if (a.isTypeReference() && !a.getIsSpecialized()) { - a = a.referencedTypeSymbol; - } - - if (b.isTypeReference() && !b.getIsSpecialized()) { - b = b.referencedTypeSymbol; - } - - return a === b; - } - PullHelpers.typeSymbolsAreIdentical = typeSymbolsAreIdentical; - - function getRootType(type) { - var rootType = type.getRootSymbol(); - - while (true) { - if (type === rootType) { - return type; - } - - type = rootType; - rootType = type.getRootSymbol(); - } - } - PullHelpers.getRootType = getRootType; - - function isSymbolLocal(symbol) { - var container = symbol.getContainer(); - if (container) { - var containerKind = container.kind; - if (containerKind & (1032192 /* SomeFunction */ | 16777216 /* FunctionType */)) { - return true; - } - - if (containerKind === 33554432 /* ConstructorType */ && !symbol.anyDeclHasFlag(16 /* Static */ | 1 /* Exported */)) { - return true; - } - } - - return false; - } - PullHelpers.isSymbolLocal = isSymbolLocal; - - function isExportedSymbolInClodule(symbol) { - var container = symbol.getContainer(); - return container && container.kind === 33554432 /* ConstructorType */ && symbolIsModule(container) && symbol.anyDeclHasFlag(1 /* Exported */); - } - PullHelpers.isExportedSymbolInClodule = isExportedSymbolInClodule; - - - - function walkSignatureSymbol(signatureSymbol, walker) { - var continueWalk = true; - var parameters = signatureSymbol.parameters; - if (parameters) { - for (var i = 0; continueWalk && i < parameters.length; i++) { - continueWalk = walker.signatureParameterWalk(parameters[i]); - } - } - - if (continueWalk) { - continueWalk = walker.signatureReturnTypeWalk(signatureSymbol.returnType); - } - - return continueWalk; - } - - function walkPullTypeSymbolStructure(typeSymbol, walker) { - var continueWalk = true; - - var members = typeSymbol.getMembers(); - for (var i = 0; continueWalk && i < members.length; i++) { - continueWalk = walker.memberSymbolWalk(members[i]); - } - - if (continueWalk) { - var callSigantures = typeSymbol.getCallSignatures(); - for (var i = 0; continueWalk && i < callSigantures.length; i++) { - continueWalk = walker.callSignatureWalk(callSigantures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(callSigantures[i], walker); - } - } - } - - if (continueWalk) { - var constructSignatures = typeSymbol.getConstructSignatures(); - for (var i = 0; continueWalk && i < constructSignatures.length; i++) { - continueWalk = walker.constructSignatureWalk(constructSignatures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(constructSignatures[i], walker); - } - } - } - - if (continueWalk) { - var indexSignatures = typeSymbol.getIndexSignatures(); - for (var i = 0; continueWalk && i < indexSignatures.length; i++) { - continueWalk = walker.indexSignatureWalk(indexSignatures[i]); - if (continueWalk) { - continueWalk = walkSignatureSymbol(indexSignatures[i], walker); - } - } - } - } - PullHelpers.walkPullTypeSymbolStructure = walkPullTypeSymbolStructure; - - var OtherPullDeclsWalker = (function () { - function OtherPullDeclsWalker() { - this.currentlyWalkingOtherDecls = []; - } - OtherPullDeclsWalker.prototype.walkOtherPullDecls = function (currentDecl, otherDecls, callBack) { - if (otherDecls) { - var isAlreadyWalkingOtherDecl = TypeScript.ArrayUtilities.any(this.currentlyWalkingOtherDecls, function (inWalkingOtherDecl) { - return TypeScript.ArrayUtilities.contains(otherDecls, inWalkingOtherDecl); - }); - - if (!isAlreadyWalkingOtherDecl) { - this.currentlyWalkingOtherDecls.push(currentDecl); - for (var i = 0; i < otherDecls.length; i++) { - if (otherDecls[i] !== currentDecl) { - callBack(otherDecls[i]); - } - } - var currentlyWalkingOtherDeclsDecl = this.currentlyWalkingOtherDecls.pop(); - TypeScript.Debug.assert(currentlyWalkingOtherDeclsDecl == currentDecl); - } - } - }; - return OtherPullDeclsWalker; - })(); - PullHelpers.OtherPullDeclsWalker = OtherPullDeclsWalker; - })(TypeScript.PullHelpers || (TypeScript.PullHelpers = {})); - var PullHelpers = TypeScript.PullHelpers; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var WrapsTypeParameterCache = (function () { - function WrapsTypeParameterCache() { - this._wrapsTypeParameterCache = TypeScript.BitVector.getBitVector(true); - } - WrapsTypeParameterCache.prototype.getWrapsTypeParameter = function (typeParameterArgumentMap) { - var mapHasTypeParameterNotCached = false; - for (var typeParameterID in typeParameterArgumentMap) { - if (typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - var cachedValue = this._wrapsTypeParameterCache.valueAt(typeParameterID); - if (cachedValue) { - return typeParameterID; - } - mapHasTypeParameterNotCached = mapHasTypeParameterNotCached || cachedValue === undefined; - } - } - - if (!mapHasTypeParameterNotCached) { - return 0; - } - - return undefined; - }; - - WrapsTypeParameterCache.prototype.setWrapsTypeParameter = function (typeParameterArgumentMap, wrappingTypeParameterID) { - if (wrappingTypeParameterID) { - this._wrapsTypeParameterCache.setValueAt(wrappingTypeParameterID, true); - } else { - for (var typeParameterID in typeParameterArgumentMap) { - if (typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - this._wrapsTypeParameterCache.setValueAt(typeParameterID, false); - } - } - } - }; - return WrapsTypeParameterCache; - })(); - TypeScript.WrapsTypeParameterCache = WrapsTypeParameterCache; - - (function (PullInstantiationHelpers) { - var MutableTypeArgumentMap = (function () { - function MutableTypeArgumentMap(typeParameterArgumentMap) { - this.typeParameterArgumentMap = typeParameterArgumentMap; - this.createdDuplicateTypeArgumentMap = false; - } - MutableTypeArgumentMap.prototype.ensureTypeArgumentCopy = function () { - if (!this.createdDuplicateTypeArgumentMap) { - var passedInTypeArgumentMap = this.typeParameterArgumentMap; - this.typeParameterArgumentMap = []; - for (var typeParameterID in passedInTypeArgumentMap) { - if (passedInTypeArgumentMap.hasOwnProperty(typeParameterID)) { - this.typeParameterArgumentMap[typeParameterID] = passedInTypeArgumentMap[typeParameterID]; - } - } - this.createdDuplicateTypeArgumentMap = true; - } - }; - return MutableTypeArgumentMap; - })(); - PullInstantiationHelpers.MutableTypeArgumentMap = MutableTypeArgumentMap; - - function instantiateTypeArgument(resolver, symbol, mutableTypeParameterMap) { - if (symbol.getIsSpecialized()) { - var rootTypeArgumentMap = symbol.getTypeParameterArgumentMap(); - var newTypeArgumentMap = []; - var allowedTypeParameters = symbol.getAllowedToReferenceTypeParameters(); - for (var i = 0; i < allowedTypeParameters.length; i++) { - var typeParameterID = allowedTypeParameters[i].pullSymbolID; - var typeArg = rootTypeArgumentMap[typeParameterID]; - if (typeArg) { - newTypeArgumentMap[typeParameterID] = resolver.instantiateType(typeArg, mutableTypeParameterMap.typeParameterArgumentMap); - } - } - - for (var i = 0; i < allowedTypeParameters.length; i++) { - var typeParameterID = allowedTypeParameters[i].pullSymbolID; - if (newTypeArgumentMap[typeParameterID] && mutableTypeParameterMap.typeParameterArgumentMap[typeParameterID] != newTypeArgumentMap[typeParameterID]) { - mutableTypeParameterMap.ensureTypeArgumentCopy(); - mutableTypeParameterMap.typeParameterArgumentMap[typeParameterID] = newTypeArgumentMap[typeParameterID]; - } - } - } - } - PullInstantiationHelpers.instantiateTypeArgument = instantiateTypeArgument; - - function cleanUpTypeArgumentMap(symbol, mutableTypeArgumentMap) { - var allowedToReferenceTypeParameters = symbol.getAllowedToReferenceTypeParameters(); - for (var typeParameterID in mutableTypeArgumentMap.typeParameterArgumentMap) { - if (mutableTypeArgumentMap.typeParameterArgumentMap.hasOwnProperty(typeParameterID)) { - if (!TypeScript.ArrayUtilities.any(allowedToReferenceTypeParameters, function (typeParameter) { - return typeParameter.pullSymbolID == typeParameterID; - })) { - mutableTypeArgumentMap.ensureTypeArgumentCopy(); - delete mutableTypeArgumentMap.typeParameterArgumentMap[typeParameterID]; - } - } - } - } - PullInstantiationHelpers.cleanUpTypeArgumentMap = cleanUpTypeArgumentMap; - - function getAllowedToReferenceTypeParametersFromDecl(decl) { - var allowedToReferenceTypeParameters = []; - - var allowedToUseDeclTypeParameters = false; - var getTypeParametersFromParentDecl = false; - - switch (decl.kind) { - case 65536 /* Method */: - if (TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - allowedToUseDeclTypeParameters = true; - break; - } - - case 16777216 /* FunctionType */: - case 33554432 /* ConstructorType */: - case 2097152 /* ConstructSignature */: - case 1048576 /* CallSignature */: - case 131072 /* FunctionExpression */: - case 16384 /* Function */: - allowedToUseDeclTypeParameters = true; - getTypeParametersFromParentDecl = true; - break; - - case 4096 /* Property */: - if (TypeScript.hasFlag(decl.flags, 16 /* Static */)) { - break; - } - - case 2048 /* Parameter */: - case 262144 /* GetAccessor */: - case 524288 /* SetAccessor */: - case 32768 /* ConstructorMethod */: - case 4194304 /* IndexSignature */: - case 8388608 /* ObjectType */: - case 256 /* ObjectLiteral */: - case 8192 /* TypeParameter */: - getTypeParametersFromParentDecl = true; - break; - - case 8 /* Class */: - case 16 /* Interface */: - allowedToUseDeclTypeParameters = true; - break; - } - - if (getTypeParametersFromParentDecl) { - allowedToReferenceTypeParameters = allowedToReferenceTypeParameters.concat(getAllowedToReferenceTypeParametersFromDecl(decl.getParentDecl())); - } - - if (allowedToUseDeclTypeParameters) { - var typeParameterDecls = decl.getTypeParameters(); - for (var i = 0; i < typeParameterDecls.length; i++) { - allowedToReferenceTypeParameters.push(typeParameterDecls[i].getSymbol()); - } - } - - return allowedToReferenceTypeParameters; - } - PullInstantiationHelpers.getAllowedToReferenceTypeParametersFromDecl = getAllowedToReferenceTypeParametersFromDecl; - - function createTypeParameterArgumentMap(typeParameters, typeArguments) { - return updateTypeParameterArgumentMap(typeParameters, typeArguments, {}); - } - PullInstantiationHelpers.createTypeParameterArgumentMap = createTypeParameterArgumentMap; - - function updateTypeParameterArgumentMap(typeParameters, typeArguments, typeParameterArgumentMap) { - for (var i = 0; i < typeParameters.length; i++) { - typeParameterArgumentMap[typeParameters[i].getRootSymbol().pullSymbolID] = typeArguments[i]; - } - return typeParameterArgumentMap; - } - PullInstantiationHelpers.updateTypeParameterArgumentMap = updateTypeParameterArgumentMap; - - function updateMutableTypeParameterArgumentMap(typeParameters, typeArguments, mutableMap) { - for (var i = 0; i < typeParameters.length; i++) { - var typeParameterId = typeParameters[i].getRootSymbol().pullSymbolID; - if (mutableMap.typeParameterArgumentMap[typeParameterId] !== typeArguments[i]) { - mutableMap.ensureTypeArgumentCopy(); - mutableMap.typeParameterArgumentMap[typeParameterId] = typeArguments[i]; - } - } - } - PullInstantiationHelpers.updateMutableTypeParameterArgumentMap = updateMutableTypeParameterArgumentMap; - - function twoTypesAreInstantiationsOfSameNamedGenericType(type1, type2) { - var type1IsGeneric = type1.isGeneric() && type1.getTypeArguments() !== null; - var type2IsGeneric = type2.isGeneric() && type2.getTypeArguments() !== null; - - if (type1IsGeneric && type2IsGeneric) { - var type1Root = TypeScript.PullHelpers.getRootType(type1); - var type2Root = TypeScript.PullHelpers.getRootType(type2); - return type1Root === type2Root; - } - - return false; - } - PullInstantiationHelpers.twoTypesAreInstantiationsOfSameNamedGenericType = twoTypesAreInstantiationsOfSameNamedGenericType; - })(TypeScript.PullInstantiationHelpers || (TypeScript.PullInstantiationHelpers = {})); - var PullInstantiationHelpers = TypeScript.PullInstantiationHelpers; -})(TypeScript || (TypeScript = {})); -if (Error) - Error.stackTraceLimit = 1000; - -var TypeScript; -(function (TypeScript) { - TypeScript.fileResolutionTime = 0; - TypeScript.fileResolutionIOTime = 0; - TypeScript.fileResolutionScanImportsTime = 0; - TypeScript.fileResolutionImportFileSearchTime = 0; - TypeScript.fileResolutionGetDefaultLibraryTime = 0; - TypeScript.sourceCharactersCompiled = 0; - TypeScript.syntaxTreeParseTime = 0; - TypeScript.syntaxDiagnosticsTime = 0; - TypeScript.astTranslationTime = 0; - TypeScript.typeCheckTime = 0; - - TypeScript.compilerResolvePathTime = 0; - TypeScript.compilerDirectoryNameTime = 0; - TypeScript.compilerDirectoryExistsTime = 0; - TypeScript.compilerFileExistsTime = 0; - - TypeScript.emitTime = 0; - TypeScript.emitWriteFileTime = 0; - - TypeScript.declarationEmitTime = 0; - TypeScript.declarationEmitIsExternallyVisibleTime = 0; - TypeScript.declarationEmitTypeSignatureTime = 0; - TypeScript.declarationEmitGetBoundDeclTypeTime = 0; - TypeScript.declarationEmitIsOverloadedCallSignatureTime = 0; - TypeScript.declarationEmitFunctionDeclarationGetSymbolTime = 0; - TypeScript.declarationEmitGetBaseTypeTime = 0; - TypeScript.declarationEmitGetAccessorFunctionTime = 0; - TypeScript.declarationEmitGetTypeParameterSymbolTime = 0; - TypeScript.declarationEmitGetImportDeclarationSymbolTime = 0; - - TypeScript.ioHostResolvePathTime = 0; - TypeScript.ioHostDirectoryNameTime = 0; - TypeScript.ioHostCreateDirectoryStructureTime = 0; - TypeScript.ioHostWriteFileTime = 0; - - (function (EmitOutputResult) { - EmitOutputResult[EmitOutputResult["Succeeded"] = 0] = "Succeeded"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfSyntaxErrors"] = 1] = "FailedBecauseOfSyntaxErrors"; - EmitOutputResult[EmitOutputResult["FailedBecauseOfCompilerOptionsErrors"] = 2] = "FailedBecauseOfCompilerOptionsErrors"; - EmitOutputResult[EmitOutputResult["FailedToGenerateDeclarationsBecauseOfSemanticErrors"] = 3] = "FailedToGenerateDeclarationsBecauseOfSemanticErrors"; - })(TypeScript.EmitOutputResult || (TypeScript.EmitOutputResult = {})); - var EmitOutputResult = TypeScript.EmitOutputResult; - - var EmitOutput = (function () { - function EmitOutput(emitOutputResult) { - if (typeof emitOutputResult === "undefined") { emitOutputResult = 0 /* Succeeded */; } - this.outputFiles = []; - this.emitOutputResult = emitOutputResult; - } - return EmitOutput; - })(); - TypeScript.EmitOutput = EmitOutput; - - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(TypeScript.OutputFileType || (TypeScript.OutputFileType = {})); - var OutputFileType = TypeScript.OutputFileType; - - var OutputFile = (function () { - function OutputFile(name, writeByteOrderMark, text, fileType, sourceMapEntries) { - if (typeof sourceMapEntries === "undefined") { sourceMapEntries = []; } - this.name = name; - this.writeByteOrderMark = writeByteOrderMark; - this.text = text; - this.fileType = fileType; - this.sourceMapEntries = sourceMapEntries; - } - return OutputFile; - })(); - TypeScript.OutputFile = OutputFile; - - var CompileResult = (function () { - function CompileResult() { - this.diagnostics = []; - this.outputFiles = []; - } - CompileResult.fromDiagnostics = function (diagnostics) { - var result = new CompileResult(); - result.diagnostics = diagnostics; - return result; - }; - - CompileResult.fromOutputFiles = function (outputFiles) { - var result = new CompileResult(); - result.outputFiles = outputFiles; - return result; - }; - return CompileResult; - })(); - TypeScript.CompileResult = CompileResult; - - var TypeScriptCompiler = (function () { - function TypeScriptCompiler(logger, _settings) { - if (typeof logger === "undefined") { logger = new TypeScript.NullLogger(); } - if (typeof _settings === "undefined") { _settings = TypeScript.ImmutableCompilationSettings.defaultSettings(); } - this.logger = logger; - this._settings = _settings; - this.semanticInfoChain = null; - this.semanticInfoChain = new TypeScript.SemanticInfoChain(this, logger); - } - TypeScriptCompiler.prototype.compilationSettings = function () { - return this._settings; - }; - - TypeScriptCompiler.prototype.setCompilationSettings = function (newSettings) { - var oldSettings = this._settings; - this._settings = newSettings; - - if (!compareDataObjects(oldSettings, newSettings)) { - this.semanticInfoChain.invalidate(oldSettings, newSettings); - } - }; - - TypeScriptCompiler.prototype.getDocument = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - return this.semanticInfoChain.getDocument(fileName); - }; - - TypeScriptCompiler.prototype.cleanupSemanticCache = function () { - this.semanticInfoChain.invalidate(); - }; - - TypeScriptCompiler.prototype.addFile = function (fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles) { - if (typeof referencedFiles === "undefined") { referencedFiles = []; } - fileName = TypeScript.switchToForwardSlashes(fileName); - - TypeScript.sourceCharactersCompiled += scriptSnapshot.getLength(); - - var document = TypeScript.Document.create(this, this.semanticInfoChain, fileName, scriptSnapshot, byteOrderMark, version, isOpen, referencedFiles); - - this.semanticInfoChain.addDocument(document); - }; - - TypeScriptCompiler.prototype.updateFile = function (fileName, scriptSnapshot, version, isOpen, textChangeRange) { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var document = this.getDocument(fileName); - var updatedDocument = document.update(scriptSnapshot, version, isOpen, textChangeRange); - - this.semanticInfoChain.addDocument(updatedDocument); - }; - - TypeScriptCompiler.prototype.removeFile = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - this.semanticInfoChain.removeDocument(fileName); - }; - - TypeScriptCompiler.prototype.mapOutputFileName = function (document, emitOptions, extensionChanger) { - if (document.emitToOwnOutputFile()) { - var updatedFileName = document.fileName; - if (emitOptions.outputDirectory() !== "") { - updatedFileName = document.fileName.replace(emitOptions.commonDirectoryPath(), ""); - updatedFileName = emitOptions.outputDirectory() + updatedFileName; - } - return extensionChanger(updatedFileName, false); - } else { - return extensionChanger(emitOptions.sharedOutputFile(), true); - } - }; - - TypeScriptCompiler.prototype.writeByteOrderMarkForDocument = function (document) { - var printReason = false; - - if (document.emitToOwnOutputFile()) { - var result = document.byteOrderMark !== 0 /* None */; - if (printReason) { - TypeScript.Environment.standardOut.WriteLine("Emitting byte order mark because of: " + document.fileName); - } - return result; - } else { - var fileNames = this.fileNames(); - - var result = false; - for (var i = 0, n = fileNames.length; i < n; i++) { - var document = this.getDocument(fileNames[i]); - - if (document.isExternalModule()) { - continue; - } - - if (document.byteOrderMark !== 0 /* None */) { - if (printReason) { - TypeScript.Environment.standardOut.WriteLine("Emitting byte order mark because of: " + document.fileName); - result = true; - } else { - return true; - } - } - } - - return result; - } - }; - - TypeScriptCompiler.mapToDTSFileName = function (fileName, wholeFileNameReplaced) { - return TypeScript.getDeclareFilePath(fileName); - }; - - TypeScriptCompiler.prototype._shouldEmit = function (document) { - return !document.isDeclareFile(); - }; - - TypeScriptCompiler.prototype._shouldEmitDeclarations = function (document) { - if (!this.compilationSettings().generateDeclarationFiles()) { - return false; - } - - return this._shouldEmit(document); - }; - - TypeScriptCompiler.prototype.emitDocumentDeclarationsWorker = function (document, emitOptions, declarationEmitter) { - var sourceUnit = document.sourceUnit(); - TypeScript.Debug.assert(this._shouldEmitDeclarations(document)); - - if (declarationEmitter) { - declarationEmitter.document = document; - } else { - var declareFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToDTSFileName); - declarationEmitter = new TypeScript.DeclarationEmitter(declareFileName, document, this, emitOptions, this.semanticInfoChain); - } - - declarationEmitter.emitDeclarations(sourceUnit); - return declarationEmitter; - }; - - TypeScriptCompiler.prototype._emitDocumentDeclarations = function (document, emitOptions, onSingleFileEmitComplete, sharedEmitter) { - if (this._shouldEmitDeclarations(document)) { - if (document.emitToOwnOutputFile()) { - var singleEmitter = this.emitDocumentDeclarationsWorker(document, emitOptions); - if (singleEmitter) { - onSingleFileEmitComplete(singleEmitter.getOutputFile()); - } - } else { - sharedEmitter = this.emitDocumentDeclarationsWorker(document, emitOptions, sharedEmitter); - } - } - - return sharedEmitter; - }; - - TypeScriptCompiler.prototype.emitAllDeclarations = function (resolvePath) { - var start = new Date().getTime(); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var sharedEmitter = null; - var fileNames = this.fileNames(); - - for (var i = 0, n = fileNames.length; i < n; i++) { - var fileName = fileNames[i]; - - var document = this.getDocument(fileNames[i]); - - sharedEmitter = this._emitDocumentDeclarations(document, emitOptions, function (file) { - return emitOutput.outputFiles.push(file); - }, sharedEmitter); - } - - if (sharedEmitter) { - emitOutput.outputFiles.push(sharedEmitter.getOutputFile()); - } - - TypeScript.declarationEmitTime += new Date().getTime() - start; - - return emitOutput; - }; - - TypeScriptCompiler.prototype.emitDeclarations = function (fileName, resolvePath) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var document = this.getDocument(fileName); - - if (document.emitToOwnOutputFile()) { - this._emitDocumentDeclarations(document, emitOptions, function (file) { - return emitOutput.outputFiles.push(file); - }, null); - return emitOutput; - } else { - return this.emitAllDeclarations(resolvePath); - } - }; - - TypeScriptCompiler.prototype.canEmitDeclarations = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var document = this.getDocument(fileName); - return this._shouldEmitDeclarations(document); - }; - - TypeScriptCompiler.mapToFileNameExtension = function (extension, fileName, wholeFileNameReplaced) { - if (wholeFileNameReplaced) { - return fileName; - } else { - var splitFname = fileName.split("."); - splitFname.pop(); - return splitFname.join(".") + extension; - } - }; - - TypeScriptCompiler.mapToJSFileName = function (fileName, wholeFileNameReplaced) { - return TypeScriptCompiler.mapToFileNameExtension(".js", fileName, wholeFileNameReplaced); - }; - - TypeScriptCompiler.prototype.emitDocumentWorker = function (document, emitOptions, emitter) { - var sourceUnit = document.sourceUnit(); - TypeScript.Debug.assert(this._shouldEmit(document)); - - var typeScriptFileName = document.fileName; - if (!emitter) { - var javaScriptFileName = this.mapOutputFileName(document, emitOptions, TypeScriptCompiler.mapToJSFileName); - var outFile = new TypeScript.TextWriter(javaScriptFileName, this.writeByteOrderMarkForDocument(document), 0 /* JavaScript */); - - emitter = new TypeScript.Emitter(javaScriptFileName, outFile, emitOptions, this.semanticInfoChain); - - if (this.compilationSettings().mapSourceFiles()) { - var sourceMapFile = new TypeScript.TextWriter(javaScriptFileName + TypeScript.SourceMapper.MapFileExtension, false, 1 /* SourceMap */); - emitter.createSourceMapper(document, javaScriptFileName, outFile, sourceMapFile, emitOptions.resolvePath); - } - } else if (this.compilationSettings().mapSourceFiles()) { - emitter.setSourceMapperNewSourceFile(document); - } - - emitter.setDocument(document); - emitter.emitJavascript(sourceUnit, false); - - return emitter; - }; - - TypeScriptCompiler.prototype._emitDocument = function (document, emitOptions, onSingleFileEmitComplete, sharedEmitter) { - if (this._shouldEmit(document)) { - if (document.emitToOwnOutputFile()) { - var singleEmitter = this.emitDocumentWorker(document, emitOptions); - if (singleEmitter) { - onSingleFileEmitComplete(singleEmitter.getOutputFiles()); - } - } else { - sharedEmitter = this.emitDocumentWorker(document, emitOptions, sharedEmitter); - } - } - - return sharedEmitter; - }; - - TypeScriptCompiler.prototype.emitAll = function (resolvePath) { - var start = new Date().getTime(); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var fileNames = this.fileNames(); - var sharedEmitter = null; - - for (var i = 0, n = fileNames.length; i < n; i++) { - var fileName = fileNames[i]; - - var document = this.getDocument(fileName); - - sharedEmitter = this._emitDocument(document, emitOptions, function (files) { - return emitOutput.outputFiles.push.apply(emitOutput.outputFiles, files); - }, sharedEmitter); - } - - if (sharedEmitter) { - emitOutput.outputFiles.push.apply(emitOutput.outputFiles, sharedEmitter.getOutputFiles()); - } - - TypeScript.emitTime += new Date().getTime() - start; - return emitOutput; - }; - - TypeScriptCompiler.prototype.emit = function (fileName, resolvePath) { - fileName = TypeScript.switchToForwardSlashes(fileName); - var emitOutput = new EmitOutput(); - - var emitOptions = new TypeScript.EmitOptions(this, resolvePath); - if (emitOptions.diagnostic()) { - emitOutput.emitOutputResult = 2 /* FailedBecauseOfCompilerOptionsErrors */; - return emitOutput; - } - - var document = this.getDocument(fileName); - - if (document.emitToOwnOutputFile()) { - this._emitDocument(document, emitOptions, function (files) { - return emitOutput.outputFiles.push.apply(emitOutput.outputFiles, files); - }, null); - return emitOutput; - } else { - return this.emitAll(resolvePath); - } - }; - - TypeScriptCompiler.prototype.compile = function (resolvePath, continueOnDiagnostics) { - if (typeof continueOnDiagnostics === "undefined") { continueOnDiagnostics = false; } - return new CompilerIterator(this, resolvePath, continueOnDiagnostics); - }; - - TypeScriptCompiler.prototype.getSyntacticDiagnostics = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - return this.getDocument(fileName).diagnostics(); - }; - - TypeScriptCompiler.prototype.getSyntaxTree = function (fileName) { - return this.getDocument(fileName).syntaxTree(); - }; - - TypeScriptCompiler.prototype.getSourceUnit = function (fileName) { - return this.getDocument(fileName).sourceUnit(); - }; - - TypeScriptCompiler.prototype.getSemanticDiagnostics = function (fileName) { - fileName = TypeScript.switchToForwardSlashes(fileName); - - var document = this.getDocument(fileName); - - var startTime = (new Date()).getTime(); - TypeScript.PullTypeResolver.typeCheck(this.compilationSettings(), this.semanticInfoChain, document); - var endTime = (new Date()).getTime(); - - TypeScript.typeCheckTime += endTime - startTime; - - var errors = this.semanticInfoChain.getDiagnostics(fileName); - - errors = TypeScript.ArrayUtilities.distinct(errors, TypeScript.Diagnostic.equals); - errors.sort(function (d1, d2) { - if (d1.fileName() < d2.fileName()) { - return -1; - } else if (d1.fileName() > d2.fileName()) { - return 1; - } - - if (d1.start() < d2.start()) { - return -1; - } else if (d1.start() > d2.start()) { - return 1; - } - - var code1 = TypeScript.diagnosticInformationMap[d1.diagnosticKey()].code; - var code2 = TypeScript.diagnosticInformationMap[d2.diagnosticKey()].code; - if (code1 < code2) { - return -1; - } else if (code1 > code2) { - return 1; - } - - return 0; - }); - - return errors; - }; - - TypeScriptCompiler.prototype.getCompilerOptionsDiagnostics = function () { - var emitOptions = new TypeScript.EmitOptions(this, null); - var emitDiagnostic = emitOptions.diagnostic(); - if (emitDiagnostic) { - return [emitDiagnostic]; - } - return TypeScript.sentinelEmptyArray; - }; - - TypeScriptCompiler.prototype.resolveAllFiles = function () { - var fileNames = this.fileNames(); - for (var i = 0, n = fileNames.length; i < n; i++) { - this.getSemanticDiagnostics(fileNames[i]); - } - }; - - TypeScriptCompiler.prototype.getSymbolOfDeclaration = function (decl) { - if (!decl) { - return null; - } - - var resolver = this.semanticInfoChain.getResolver(); - var ast = this.semanticInfoChain.getASTForDecl(decl); - if (!ast) { - return null; - } - - var enclosingDecl = resolver.getEnclosingDecl(decl); - if (ast.kind() === 139 /* GetAccessor */ || ast.kind() === 140 /* SetAccessor */) { - return this.getSymbolOfDeclaration(enclosingDecl); - } - - return resolver.resolveAST(ast, false, new TypeScript.PullTypeResolutionContext(resolver)); - }; - - TypeScriptCompiler.prototype.extractResolutionContextFromAST = function (resolver, ast, document, propagateContextualTypes) { - var scriptName = document.fileName; - - var enclosingDecl = null; - var enclosingDeclAST = null; - var inContextuallyTypedAssignment = false; - var inWithBlock = false; - - var resolutionContext = new TypeScript.PullTypeResolutionContext(resolver); - - if (!ast) { - return null; - } - - var path = this.getASTPath(ast); - - for (var i = 0, n = path.length; i < n; i++) { - var current = path[i]; - - switch (current.kind()) { - case 222 /* FunctionExpression */: - case 219 /* SimpleArrowFunctionExpression */: - case 218 /* ParenthesizedArrowFunctionExpression */: - if (propagateContextualTypes) { - resolver.resolveAST(current, true, resolutionContext); - } - break; - - case 136 /* MemberVariableDeclaration */: - var memberVariable = current; - inContextuallyTypedAssignment = memberVariable.variableDeclarator.typeAnnotation !== null; - - this.extractResolutionContextForVariable(inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, memberVariable, memberVariable.variableDeclarator.equalsValueClause); - break; - - case 225 /* VariableDeclarator */: - var variableDeclarator = current; - inContextuallyTypedAssignment = variableDeclarator.typeAnnotation !== null; - - this.extractResolutionContextForVariable(inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, variableDeclarator, variableDeclarator.equalsValueClause); - break; - - case 213 /* InvocationExpression */: - case 216 /* ObjectCreationExpression */: - if (propagateContextualTypes) { - var isNew = current.kind() === 216 /* ObjectCreationExpression */; - var callExpression = current; - var contextualType = null; - - if ((i + 2 < n) && callExpression.argumentList === path[i + 1] && callExpression.argumentList.arguments === path[i + 2]) { - var callResolutionResults = new TypeScript.PullAdditionalCallResolutionData(); - if (isNew) { - resolver.resolveObjectCreationExpression(callExpression, resolutionContext, callResolutionResults); - } else { - resolver.resolveInvocationExpression(callExpression, resolutionContext, callResolutionResults); - } - - if (callResolutionResults.actualParametersContextTypeSymbols) { - var argExpression = path[i + 3]; - if (argExpression) { - for (var j = 0, m = callExpression.argumentList.arguments.nonSeparatorCount(); j < m; j++) { - if (callExpression.argumentList.arguments.nonSeparatorAt(j) === argExpression) { - var callContextualType = callResolutionResults.actualParametersContextTypeSymbols[j]; - if (callContextualType) { - contextualType = callContextualType; - break; - } - } - } - } - } - } else { - if (isNew) { - resolver.resolveObjectCreationExpression(callExpression, resolutionContext); - } else { - resolver.resolveInvocationExpression(callExpression, resolutionContext); - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 214 /* ArrayLiteralExpression */: - if (propagateContextualTypes) { - var contextualType = null; - var currentContextualType = resolutionContext.getContextualType(); - if (currentContextualType && currentContextualType.isArrayNamedTypeReference()) { - contextualType = currentContextualType.getElementType(); - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 215 /* ObjectLiteralExpression */: - if (propagateContextualTypes) { - var objectLiteralExpression = current; - var objectLiteralResolutionContext = new TypeScript.PullAdditionalObjectLiteralResolutionData(); - resolver.resolveObjectLiteralExpression(objectLiteralExpression, inContextuallyTypedAssignment, resolutionContext, objectLiteralResolutionContext); - - var memeberAST = (path[i + 1] && path[i + 1].kind() === 2 /* SeparatedList */) ? path[i + 2] : path[i + 1]; - if (memeberAST) { - var contextualType = null; - var memberDecls = objectLiteralExpression.propertyAssignments; - if (memberDecls && objectLiteralResolutionContext.membersContextTypeSymbols) { - for (var j = 0, m = memberDecls.nonSeparatorCount(); j < m; j++) { - if (memberDecls.nonSeparatorAt(j) === memeberAST) { - var memberContextualType = objectLiteralResolutionContext.membersContextTypeSymbols[j]; - if (memberContextualType) { - contextualType = memberContextualType; - break; - } - } - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - } - - break; - - case 174 /* AssignmentExpression */: - if (propagateContextualTypes) { - var assignmentExpression = current; - var contextualType = null; - - if (path[i + 1] && path[i + 1] === assignmentExpression.right) { - var leftType = resolver.resolveAST(assignmentExpression.left, inContextuallyTypedAssignment, resolutionContext).type; - if (leftType) { - inContextuallyTypedAssignment = true; - contextualType = leftType; - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 220 /* CastExpression */: - var castExpression = current; - if (!(i + 1 < n && path[i + 1] === castExpression.type)) { - if (propagateContextualTypes) { - var contextualType = null; - var typeSymbol = resolver.resolveAST(castExpression, inContextuallyTypedAssignment, resolutionContext).type; - - if (typeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = typeSymbol; - } - - resolutionContext.pushNewContextualType(contextualType); - } - } - - break; - - case 150 /* ReturnStatement */: - if (propagateContextualTypes) { - var returnStatement = current; - var contextualType = null; - - if (enclosingDecl && (enclosingDecl.kind & 1032192 /* SomeFunction */)) { - var typeAnnotation = TypeScript.ASTHelpers.getType(enclosingDeclAST); - if (typeAnnotation) { - var returnTypeSymbol = resolver.resolveTypeReference(typeAnnotation, resolutionContext); - if (returnTypeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = returnTypeSymbol; - } - } else { - var currentContextualType = resolutionContext.getContextualType(); - if (currentContextualType && currentContextualType.isFunction()) { - var contextualSignatures = currentContextualType.kind == 33554432 /* ConstructorType */ ? currentContextualType.getConstructSignatures() : currentContextualType.getCallSignatures(); - var currentContextualTypeSignatureSymbol = contextualSignatures[0]; - var currentContextualTypeReturnTypeSymbol = currentContextualTypeSignatureSymbol.returnType; - if (currentContextualTypeReturnTypeSymbol) { - inContextuallyTypedAssignment = true; - contextualType = currentContextualTypeReturnTypeSymbol; - } - } - } - } - - resolutionContext.pushNewContextualType(contextualType); - } - - break; - - case 122 /* ObjectType */: - if (propagateContextualTypes && TypeScript.isTypesOnlyLocation(current)) { - resolver.resolveAST(current, false, resolutionContext); - } - - break; - - case 163 /* WithStatement */: - inWithBlock = true; - break; - - case 146 /* Block */: - inContextuallyTypedAssignment = false; - break; - } - - var decl = this.semanticInfoChain.getDeclForAST(current); - if (decl) { - enclosingDecl = decl; - enclosingDeclAST = current; - } - } - - if (ast && ast.parent && ast.kind() === 11 /* IdentifierName */) { - if (ast.parent.kind() === 212 /* MemberAccessExpression */) { - if (ast.parent.name === ast) { - ast = ast.parent; - } - } else if (ast.parent.kind() === 121 /* QualifiedName */) { - if (ast.parent.right === ast) { - ast = ast.parent; - } - } - } - - return { - ast: ast, - enclosingDecl: enclosingDecl, - resolutionContext: resolutionContext, - inContextuallyTypedAssignment: inContextuallyTypedAssignment, - inWithBlock: inWithBlock - }; - }; - - TypeScriptCompiler.prototype.extractResolutionContextForVariable = function (inContextuallyTypedAssignment, propagateContextualTypes, resolver, resolutionContext, enclosingDecl, assigningAST, init) { - if (inContextuallyTypedAssignment) { - if (propagateContextualTypes) { - resolver.resolveAST(assigningAST, false, resolutionContext); - var varSymbol = this.semanticInfoChain.getSymbolForAST(assigningAST); - - var contextualType = null; - if (varSymbol && inContextuallyTypedAssignment) { - contextualType = varSymbol.type; - } - - resolutionContext.pushNewContextualType(contextualType); - - if (init) { - resolver.resolveAST(init, inContextuallyTypedAssignment, resolutionContext); - } - } - } - }; - - TypeScriptCompiler.prototype.getASTPath = function (ast) { - var result = []; - - while (ast) { - result.unshift(ast); - ast = ast.parent; - } - - return result; - }; - - TypeScriptCompiler.prototype.pullGetSymbolInformationFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - ast = context.ast; - var symbol = resolver.resolveAST(ast, context.inContextuallyTypedAssignment, context.resolutionContext); - - if (!symbol) { - TypeScript.Debug.assert(ast.kind() === 120 /* SourceUnit */, "No symbol was found for ast and ast was not source unit. Ast Kind: " + TypeScript.SyntaxKind[ast.kind()]); - return null; - } - - if (symbol.isTypeReference()) { - symbol = symbol.getReferencedTypeSymbol(); - } - - var aliasSymbol = this.semanticInfoChain.getAliasSymbolForAST(ast); - - return { - symbol: symbol, - aliasSymbol: aliasSymbol, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetCallInformationFromAST = function (ast, document) { - if (ast.kind() !== 213 /* InvocationExpression */ && ast.kind() !== 216 /* ObjectCreationExpression */) { - return null; - } - - var isNew = ast.kind() === 216 /* ObjectCreationExpression */; - - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var callResolutionResults = new TypeScript.PullAdditionalCallResolutionData(); - - if (isNew) { - resolver.resolveObjectCreationExpression(ast, context.resolutionContext, callResolutionResults); - } else { - resolver.resolveInvocationExpression(ast, context.resolutionContext, callResolutionResults); - } - - return { - targetSymbol: callResolutionResults.targetSymbol, - resolvedSignatures: callResolutionResults.resolvedSignatures, - candidateSignature: callResolutionResults.candidateSignature, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl), - isConstructorCall: isNew - }; - }; - - TypeScriptCompiler.prototype.pullGetVisibleMemberSymbolsFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var symbols = resolver.getVisibleMembersFromExpression(ast, context.enclosingDecl, context.resolutionContext); - if (!symbols) { - return null; - } - - return { - symbols: symbols, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetVisibleDeclsFromAST = function (ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, false); - if (!context || context.inWithBlock) { - return null; - } - - return resolver.getVisibleDecls(context.enclosingDecl); - }; - - TypeScriptCompiler.prototype.pullGetContextualMembersFromAST = function (ast, document) { - if (ast.kind() !== 215 /* ObjectLiteralExpression */) { - return null; - } - - var resolver = this.semanticInfoChain.getResolver(); - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var members = resolver.getVisibleContextSymbols(context.enclosingDecl, context.resolutionContext); - - return { - symbols: members, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.pullGetDeclInformation = function (decl, ast, document) { - var resolver = this.semanticInfoChain.getResolver(); - - var context = this.extractResolutionContextFromAST(resolver, ast, document, true); - if (!context || context.inWithBlock) { - return null; - } - - var astForDecl = decl.ast(); - if (!astForDecl) { - return null; - } - - var astForDeclContext = this.extractResolutionContextFromAST(resolver, astForDecl, this.getDocument(astForDecl.fileName()), true); - if (!astForDeclContext) { - return null; - } - - var symbol = decl.getSymbol(); - resolver.resolveDeclaredSymbol(symbol, context.resolutionContext); - symbol.setUnresolved(); - - return { - symbol: symbol, - aliasSymbol: null, - ast: ast, - enclosingScopeSymbol: this.getSymbolOfDeclaration(context.enclosingDecl) - }; - }; - - TypeScriptCompiler.prototype.topLevelDeclaration = function (fileName) { - return this.semanticInfoChain.topLevelDecl(fileName); - }; - - TypeScriptCompiler.prototype.getDeclForAST = function (ast) { - return this.semanticInfoChain.getDeclForAST(ast); - }; - - TypeScriptCompiler.prototype.fileNames = function () { - return this.semanticInfoChain.fileNames(); - }; - - TypeScriptCompiler.prototype.topLevelDecl = function (fileName) { - return this.semanticInfoChain.topLevelDecl(fileName); - }; - - TypeScriptCompiler.getLocationText = function (location) { - return location.fileName() + "(" + (location.line() + 1) + "," + (location.character() + 1) + ")"; - }; - - TypeScriptCompiler.getFullDiagnosticText = function (diagnostic) { - var result = ""; - if (diagnostic.fileName()) { - result += this.getLocationText(diagnostic) + ": "; - } - - result += diagnostic.message(); - - var additionalLocations = diagnostic.additionalLocations(); - if (additionalLocations.length > 0) { - result += " " + TypeScript.getLocalizedText(TypeScript.DiagnosticCode.Additional_locations, null) + TypeScript.Environment.newLine; - - for (var i = 0, n = additionalLocations.length; i < n; i++) { - result += "\t" + this.getLocationText(additionalLocations[i]) + TypeScript.Environment.newLine; - } - } else { - result += TypeScript.Environment.newLine; - } - - return result; - }; - return TypeScriptCompiler; - })(); - TypeScript.TypeScriptCompiler = TypeScriptCompiler; - - var CompilerPhase; - (function (CompilerPhase) { - CompilerPhase[CompilerPhase["Syntax"] = 0] = "Syntax"; - CompilerPhase[CompilerPhase["Semantics"] = 1] = "Semantics"; - CompilerPhase[CompilerPhase["EmitOptionsValidation"] = 2] = "EmitOptionsValidation"; - CompilerPhase[CompilerPhase["Emit"] = 3] = "Emit"; - CompilerPhase[CompilerPhase["DeclarationEmit"] = 4] = "DeclarationEmit"; - })(CompilerPhase || (CompilerPhase = {})); - - var CompilerIterator = (function () { - function CompilerIterator(compiler, resolvePath, continueOnDiagnostics, startingPhase) { - if (typeof startingPhase === "undefined") { startingPhase = 0 /* Syntax */; } - this.compiler = compiler; - this.resolvePath = resolvePath; - this.continueOnDiagnostics = continueOnDiagnostics; - this.index = -1; - this.fileNames = null; - this._current = null; - this._emitOptions = null; - this._sharedEmitter = null; - this._sharedDeclarationEmitter = null; - this.hadSyntacticDiagnostics = false; - this.hadSemanticDiagnostics = false; - this.hadEmitDiagnostics = false; - this.fileNames = compiler.fileNames(); - this.compilerPhase = startingPhase; - } - CompilerIterator.prototype.current = function () { - return this._current; - }; - - CompilerIterator.prototype.moveNext = function () { - this._current = null; - - while (this.moveNextInternal()) { - if (this._current) { - return true; - } - } - - return false; - }; - - CompilerIterator.prototype.moveNextInternal = function () { - this.index++; - - while (this.shouldMoveToNextPhase()) { - this.index = 0; - this.compilerPhase++; - } - - if (this.compilerPhase > 4 /* DeclarationEmit */) { - return false; - } - - switch (this.compilerPhase) { - case 0 /* Syntax */: - return this.moveNextSyntaxPhase(); - case 1 /* Semantics */: - return this.moveNextSemanticsPhase(); - case 2 /* EmitOptionsValidation */: - return this.moveNextEmitOptionsValidationPhase(); - case 3 /* Emit */: - return this.moveNextEmitPhase(); - case 4 /* DeclarationEmit */: - return this.moveNextDeclarationEmitPhase(); - } - }; - - CompilerIterator.prototype.shouldMoveToNextPhase = function () { - switch (this.compilerPhase) { - case 2 /* EmitOptionsValidation */: - return this.index === 1; - - case 0 /* Syntax */: - case 1 /* Semantics */: - return this.index === this.fileNames.length; - - case 3 /* Emit */: - case 4 /* DeclarationEmit */: - return this.index === (this.fileNames.length + 1); - } - - return false; - }; - - CompilerIterator.prototype.moveNextSyntaxPhase = function () { - TypeScript.Debug.assert(this.index >= 0 && this.index < this.fileNames.length); - var fileName = this.fileNames[this.index]; - - var diagnostics = this.compiler.getSyntacticDiagnostics(fileName); - if (diagnostics.length) { - if (!this.continueOnDiagnostics) { - this.hadSyntacticDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics(diagnostics); - } - - return true; - }; - - CompilerIterator.prototype.moveNextSemanticsPhase = function () { - if (this.hadSyntacticDiagnostics) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index < this.fileNames.length); - var fileName = this.fileNames[this.index]; - var diagnostics = this.compiler.getSemanticDiagnostics(fileName); - if (diagnostics.length) { - if (!this.continueOnDiagnostics) { - this.hadSemanticDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics(diagnostics); - } - - return true; - }; - - CompilerIterator.prototype.moveNextEmitOptionsValidationPhase = function () { - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - - if (!this._emitOptions) { - this._emitOptions = new TypeScript.EmitOptions(this.compiler, this.resolvePath); - } - - if (this._emitOptions.diagnostic()) { - if (!this.continueOnDiagnostics) { - this.hadEmitDiagnostics = true; - } - - this._current = CompileResult.fromDiagnostics([this._emitOptions.diagnostic()]); - } - - return true; - }; - - CompilerIterator.prototype.moveNextEmitPhase = function () { - var _this = this; - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - TypeScript.Debug.assert(this._emitOptions); - - if (this.hadEmitDiagnostics) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index <= this.fileNames.length); - if (this.index < this.fileNames.length) { - var fileName = this.fileNames[this.index]; - var document = this.compiler.getDocument(fileName); - - this._sharedEmitter = this.compiler._emitDocument(document, this._emitOptions, function (outputFiles) { - _this._current = CompileResult.fromOutputFiles(outputFiles); - }, this._sharedEmitter); - return true; - } - - if (this.index === this.fileNames.length && this._sharedEmitter) { - this._current = CompileResult.fromOutputFiles(this._sharedEmitter.getOutputFiles()); - } - - return true; - }; - - CompilerIterator.prototype.moveNextDeclarationEmitPhase = function () { - var _this = this; - TypeScript.Debug.assert(!this.hadSyntacticDiagnostics); - TypeScript.Debug.assert(!this.hadEmitDiagnostics); - if (this.hadSemanticDiagnostics) { - return false; - } - - if (!this.compiler.compilationSettings().generateDeclarationFiles()) { - return false; - } - - TypeScript.Debug.assert(this.index >= 0 && this.index <= this.fileNames.length); - if (this.index < this.fileNames.length) { - var fileName = this.fileNames[this.index]; - var document = this.compiler.getDocument(fileName); - - this._sharedDeclarationEmitter = this.compiler._emitDocumentDeclarations(document, this._emitOptions, function (file) { - _this._current = CompileResult.fromOutputFiles([file]); - }, this._sharedDeclarationEmitter); - return true; - } - - if (this.index === this.fileNames.length && this._sharedDeclarationEmitter) { - this._current = CompileResult.fromOutputFiles([this._sharedDeclarationEmitter.getOutputFile()]); - } - - return true; - }; - return CompilerIterator; - })(); - - function compareDataObjects(dst, src) { - for (var e in dst) { - if (typeof dst[e] === "object") { - if (!compareDataObjects(dst[e], src[e])) - return false; - } else if (typeof dst[e] !== "function") { - if (dst[e] !== src[e]) - return false; - } - } - return true; - } - TypeScript.compareDataObjects = compareDataObjects; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - (function (GenerativeTypeClassification) { - GenerativeTypeClassification[GenerativeTypeClassification["Unknown"] = 0] = "Unknown"; - GenerativeTypeClassification[GenerativeTypeClassification["Open"] = 1] = "Open"; - GenerativeTypeClassification[GenerativeTypeClassification["Closed"] = 2] = "Closed"; - GenerativeTypeClassification[GenerativeTypeClassification["InfinitelyExpanding"] = 3] = "InfinitelyExpanding"; - })(TypeScript.GenerativeTypeClassification || (TypeScript.GenerativeTypeClassification = {})); - var GenerativeTypeClassification = TypeScript.GenerativeTypeClassification; - - var PullTypeReferenceSymbol = (function (_super) { - __extends(PullTypeReferenceSymbol, _super); - function PullTypeReferenceSymbol(referencedTypeSymbol) { - _super.call(this, referencedTypeSymbol.name, referencedTypeSymbol.kind); - this.referencedTypeSymbol = referencedTypeSymbol; - this.isResolved = true; - - TypeScript.Debug.assert(referencedTypeSymbol !== null, "Type root symbol may not be null"); - - this.setRootSymbol(referencedTypeSymbol); - - this.typeReference = this; - } - PullTypeReferenceSymbol.createTypeReference = function (type) { - if (type.isTypeReference()) { - return type; - } - - var typeReference = type.typeReference; - - if (!typeReference) { - typeReference = new PullTypeReferenceSymbol(type); - type.typeReference = typeReference; - } - - return typeReference; - }; - - PullTypeReferenceSymbol.prototype.isTypeReference = function () { - return true; - }; - - PullTypeReferenceSymbol.prototype.setResolved = function () { - }; - - PullTypeReferenceSymbol.prototype.setUnresolved = function () { - }; - PullTypeReferenceSymbol.prototype.invalidate = function () { - }; - - PullTypeReferenceSymbol.prototype.ensureReferencedTypeIsResolved = function () { - this._getResolver().resolveDeclaredSymbol(this.referencedTypeSymbol); - }; - - PullTypeReferenceSymbol.prototype.getReferencedTypeSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol; - }; - - PullTypeReferenceSymbol.prototype._getResolver = function () { - return this.referencedTypeSymbol._getResolver(); - }; - - PullTypeReferenceSymbol.prototype.hasMembers = function () { - return this.referencedTypeSymbol.hasMembers(); - }; - - PullTypeReferenceSymbol.prototype.setAssociatedContainerType = function (type) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setAssociatedContainerType"); - }; - - PullTypeReferenceSymbol.prototype.getAssociatedContainerType = function () { - return this.referencedTypeSymbol.getAssociatedContainerType(); - }; - - PullTypeReferenceSymbol.prototype.getFunctionSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getFunctionSymbol(); - }; - PullTypeReferenceSymbol.prototype.setFunctionSymbol = function (symbol) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setFunctionSymbol"); - }; - - PullTypeReferenceSymbol.prototype.addContainedNonMember = function (nonMember) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addContainedNonMember"); - }; - PullTypeReferenceSymbol.prototype.findContainedNonMemberContainer = function (containerName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.findContainedNonMemberContainer(containerName, kind); - }; - - PullTypeReferenceSymbol.prototype.addMember = function (memberSymbol) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addMember"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedMemberType = function (enclosedType) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedMemberType"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedMemberContainer = function (enclosedContainer) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedMemberContainer"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMember = function (enclosedNonMember) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMember"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMemberType = function (enclosedNonMemberType) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMemberType"); - }; - PullTypeReferenceSymbol.prototype.addEnclosedNonMemberContainer = function (enclosedNonMemberContainer) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addEnclosedNonMemberContainer"); - }; - PullTypeReferenceSymbol.prototype.addTypeParameter = function (typeParameter) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addTypeParameter"); - }; - PullTypeReferenceSymbol.prototype.addConstructorTypeParameter = function (typeParameter) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addConstructorTypeParameter"); - }; - - PullTypeReferenceSymbol.prototype.findContainedNonMember = function (name) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findContainedNonMember(name); - }; - - PullTypeReferenceSymbol.prototype.findContainedNonMemberType = function (typeName, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findContainedNonMemberType(typeName, kind); - }; - - PullTypeReferenceSymbol.prototype.getMembers = function () { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getMembers(); - }; - - PullTypeReferenceSymbol.prototype.setHasDefaultConstructor = function (hasOne) { - if (typeof hasOne === "undefined") { hasOne = true; } - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ":setHasDefaultConstructor"); - }; - PullTypeReferenceSymbol.prototype.getHasDefaultConstructor = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getHasDefaultConstructor(); - }; - PullTypeReferenceSymbol.prototype.getConstructorMethod = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getConstructorMethod(); - }; - PullTypeReferenceSymbol.prototype.setConstructorMethod = function (constructorMethod) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": setConstructorMethod"); - }; - PullTypeReferenceSymbol.prototype.getTypeParameters = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeParameters(); - }; - - PullTypeReferenceSymbol.prototype.isGeneric = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.isGeneric(); - }; - - PullTypeReferenceSymbol.prototype.addSpecialization = function (specializedVersionOfThisType, substitutingTypes) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.addSpecialization(specializedVersionOfThisType, substitutingTypes); - }; - PullTypeReferenceSymbol.prototype.getSpecialization = function (substitutingTypes) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getSpecialization(substitutingTypes); - }; - PullTypeReferenceSymbol.prototype.getKnownSpecializations = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getKnownSpecializations(); - }; - PullTypeReferenceSymbol.prototype.getTypeArguments = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeArguments(); - }; - PullTypeReferenceSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypeArgumentsOrTypeParameters(); - }; - - PullTypeReferenceSymbol.prototype.appendCallSignature = function (callSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": appendCallSignature"); - }; - PullTypeReferenceSymbol.prototype.insertCallSignatureAtIndex = function (callSignature, index) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": insertCallSignatureAtIndex"); - }; - PullTypeReferenceSymbol.prototype.appendConstructSignature = function (callSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": appendConstructSignature"); - }; - PullTypeReferenceSymbol.prototype.insertConstructSignatureAtIndex = function (callSignature, index) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": insertConstructSignatureAtIndex"); - }; - PullTypeReferenceSymbol.prototype.addIndexSignature = function (indexSignature) { - TypeScript.Debug.fail("Reference symbol " + this.pullSymbolID + ": addIndexSignature"); - }; - - PullTypeReferenceSymbol.prototype.hasOwnCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnCallSignatures(); - }; - PullTypeReferenceSymbol.prototype.getCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getCallSignatures(); - }; - PullTypeReferenceSymbol.prototype.hasOwnConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnConstructSignatures(); - }; - PullTypeReferenceSymbol.prototype.getConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getConstructSignatures(); - }; - PullTypeReferenceSymbol.prototype.hasOwnIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.hasOwnIndexSignatures(); - }; - PullTypeReferenceSymbol.prototype.getIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getIndexSignatures(); - }; - - PullTypeReferenceSymbol.prototype.addImplementedType = function (implementedType) { - this.referencedTypeSymbol.addImplementedType(implementedType); - }; - PullTypeReferenceSymbol.prototype.getImplementedTypes = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getImplementedTypes(); - }; - PullTypeReferenceSymbol.prototype.addExtendedType = function (extendedType) { - this.referencedTypeSymbol.addExtendedType(extendedType); - }; - PullTypeReferenceSymbol.prototype.getExtendedTypes = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getExtendedTypes(); - }; - PullTypeReferenceSymbol.prototype.addTypeThatExtendsThisType = function (type) { - this.referencedTypeSymbol.addTypeThatExtendsThisType(type); - }; - PullTypeReferenceSymbol.prototype.getTypesThatExtendThisType = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypesThatExtendThisType(); - }; - PullTypeReferenceSymbol.prototype.addTypeThatExplicitlyImplementsThisType = function (type) { - this.referencedTypeSymbol.addTypeThatExplicitlyImplementsThisType(type); - }; - PullTypeReferenceSymbol.prototype.getTypesThatExplicitlyImplementThisType = function () { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.getTypesThatExplicitlyImplementThisType(); - }; - - PullTypeReferenceSymbol.prototype.isValidBaseKind = function (baseType, isExtendedType) { - this.ensureReferencedTypeIsResolved(); - return this.referencedTypeSymbol.isValidBaseKind(baseType, isExtendedType); - }; - - PullTypeReferenceSymbol.prototype.findMember = function (name, lookInParent) { - if (typeof lookInParent === "undefined") { lookInParent = true; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findMember(name, lookInParent); - }; - PullTypeReferenceSymbol.prototype.findNestedType = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findNestedType(name, kind); - }; - PullTypeReferenceSymbol.prototype.findNestedContainer = function (name, kind) { - if (typeof kind === "undefined") { kind = 0 /* None */; } - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findNestedContainer(name, kind); - }; - PullTypeReferenceSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - }; - - PullTypeReferenceSymbol.prototype.findTypeParameter = function (name) { - this.ensureReferencedTypeIsResolved(); - - return this.referencedTypeSymbol.findTypeParameter(name); - }; - - PullTypeReferenceSymbol.prototype.hasOnlyOverloadCallSignatures = function () { - return this.referencedTypeSymbol.hasOnlyOverloadCallSignatures(); - }; - return PullTypeReferenceSymbol; - })(TypeScript.PullTypeSymbol); - TypeScript.PullTypeReferenceSymbol = PullTypeReferenceSymbol; - - TypeScript.nSpecializationsCreated = 0; - TypeScript.nSpecializedSignaturesCreated = 0; - TypeScript.nSpecializedTypeParameterCreated = 0; - - var PullInstantiatedTypeReferenceSymbol = (function (_super) { - __extends(PullInstantiatedTypeReferenceSymbol, _super); - function PullInstantiatedTypeReferenceSymbol(referencedTypeSymbol, _typeParameterArgumentMap, isInstanceReferenceType) { - _super.call(this, referencedTypeSymbol); - this.referencedTypeSymbol = referencedTypeSymbol; - this._typeParameterArgumentMap = _typeParameterArgumentMap; - this.isInstanceReferenceType = isInstanceReferenceType; - this._instantiatedMembers = null; - this._allInstantiatedMemberNameCache = null; - this._instantiatedMemberNameCache = TypeScript.createIntrinsicsObject(); - this._instantiatedCallSignatures = null; - this._instantiatedConstructSignatures = null; - this._instantiatedIndexSignatures = null; - this._typeArgumentReferences = undefined; - this._instantiatedConstructorMethod = null; - this._instantiatedAssociatedContainerType = null; - this._isArray = undefined; - this._generativeTypeClassification = []; - - TypeScript.nSpecializationsCreated++; - } - PullInstantiatedTypeReferenceSymbol.prototype.getIsSpecialized = function () { - return !this.isInstanceReferenceType; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getGenerativeTypeClassification = function (enclosingType) { - if (!this.isNamedTypeSymbol()) { - return 0 /* Unknown */; - } - - var generativeTypeClassification = this._generativeTypeClassification[enclosingType.pullSymbolID] || 0 /* Unknown */; - if (generativeTypeClassification === 0 /* Unknown */) { - var typeParameters = enclosingType.getTypeParameters(); - var enclosingTypeParameterMap = []; - for (var i = 0; i < typeParameters.length; i++) { - enclosingTypeParameterMap[typeParameters[i].pullSymbolID] = typeParameters[i]; - } - - var typeArguments = this.getTypeArguments(); - for (var i = 0; i < typeArguments.length; i++) { - if (typeArguments[i].wrapsSomeTypeParameter(enclosingTypeParameterMap, true)) { - generativeTypeClassification = 1 /* Open */; - break; - } - } - - if (generativeTypeClassification === 1 /* Open */) { - if (this.wrapsSomeTypeParameterIntoInfinitelyExpandingTypeReference(enclosingType)) { - generativeTypeClassification = 3 /* InfinitelyExpanding */; - } - } else { - generativeTypeClassification = 2 /* Closed */; - } - - this._generativeTypeClassification[enclosingType.pullSymbolID] = generativeTypeClassification; - } - - return generativeTypeClassification; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.isArrayNamedTypeReference = function () { - if (this._isArray === undefined) { - this._isArray = this.getRootSymbol().isArrayNamedTypeReference() || (this.getRootSymbol() === this._getResolver().getArrayNamedType()); - } - return this._isArray; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getElementType = function () { - if (!this.isArrayNamedTypeReference()) { - return null; - } - - var typeArguments = this.getTypeArguments(); - return typeArguments ? typeArguments[0] : null; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getReferencedTypeSymbol = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.getIsSpecialized()) { - return this; - } - - return this.referencedTypeSymbol; - }; - - PullInstantiatedTypeReferenceSymbol.create = function (resolver, type, typeParameterArgumentMap) { - TypeScript.Debug.assert(resolver); - - var mutableTypeParameterMap = new TypeScript.PullInstantiationHelpers.MutableTypeArgumentMap(typeParameterArgumentMap); - - TypeScript.PullInstantiationHelpers.instantiateTypeArgument(resolver, type, mutableTypeParameterMap); - - var rootType = type.getRootSymbol(); - var instantiation = rootType.getSpecialization(mutableTypeParameterMap.typeParameterArgumentMap); - if (instantiation) { - return instantiation; - } - - TypeScript.PullInstantiationHelpers.cleanUpTypeArgumentMap(type, mutableTypeParameterMap); - typeParameterArgumentMap = mutableTypeParameterMap.typeParameterArgumentMap; - - var isInstanceReferenceType = (type.kind & 8216 /* SomeInstantiatableType */) != 0; - var resolvedTypeParameterArgumentMap = typeParameterArgumentMap; - if (isInstanceReferenceType) { - var typeParameters = rootType.getTypeParameters(); - for (var i = 0; i < typeParameters.length; i++) { - if (!TypeScript.PullHelpers.typeSymbolsAreIdentical(typeParameters[i], typeParameterArgumentMap[typeParameters[i].pullSymbolID])) { - isInstanceReferenceType = false; - break; - } - } - - if (isInstanceReferenceType) { - typeParameterArgumentMap = []; - } - } - - instantiation = new PullInstantiatedTypeReferenceSymbol(rootType, typeParameterArgumentMap, isInstanceReferenceType); - - rootType.addSpecialization(instantiation, resolvedTypeParameterArgumentMap); - - return instantiation; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.isGeneric = function () { - return this.getRootSymbol().isGeneric(); - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeParameterArgumentMap = function () { - return this._typeParameterArgumentMap; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeArguments = function () { - if (this.isInstanceReferenceType) { - return this.getTypeParameters(); - } - - if (this._typeArgumentReferences === undefined) { - var typeParameters = this.referencedTypeSymbol.getTypeParameters(); - - if (typeParameters.length) { - var typeArgument = null; - var typeArguments = []; - - for (var i = 0; i < typeParameters.length; i++) { - typeArgument = this._typeParameterArgumentMap[typeParameters[i].pullSymbolID]; - - if (!typeArgument) { - TypeScript.Debug.fail("type argument count mismatch"); - } - - if (typeArgument) { - typeArguments[typeArguments.length] = typeArgument; - } - } - - this._typeArgumentReferences = typeArguments; - } else { - this._typeArgumentReferences = null; - } - } - - return this._typeArgumentReferences; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getTypeArgumentsOrTypeParameters = function () { - return this.getTypeArguments(); - }; - - PullInstantiatedTypeReferenceSymbol.prototype.populateInstantiatedMemberFromReferencedMember = function (referencedMember) { - var instantiatedMember; - TypeScript.PullHelpers.resolveDeclaredSymbolToUseType(referencedMember); - - if (!referencedMember.type.wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - instantiatedMember = referencedMember; - } else { - instantiatedMember = new TypeScript.PullSymbol(referencedMember.name, referencedMember.kind); - instantiatedMember.setRootSymbol(referencedMember); - instantiatedMember.type = this._getResolver().instantiateType(referencedMember.type, this._typeParameterArgumentMap); - instantiatedMember.isOptional = referencedMember.isOptional; - } - this._instantiatedMemberNameCache[instantiatedMember.name] = instantiatedMember; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getMembers = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getMembers(); - } - - if (!this._instantiatedMembers) { - var referencedMembers = this.referencedTypeSymbol.getMembers(); - var referencedMember = null; - var instantiatedMember = null; - - this._instantiatedMembers = []; - - for (var i = 0; i < referencedMembers.length; i++) { - referencedMember = referencedMembers[i]; - - this._getResolver().resolveDeclaredSymbol(referencedMember); - - if (!this._instantiatedMemberNameCache[referencedMember.name]) { - this.populateInstantiatedMemberFromReferencedMember(referencedMember); - } - - this._instantiatedMembers[this._instantiatedMembers.length] = this._instantiatedMemberNameCache[referencedMember.name]; - } - } - - return this._instantiatedMembers; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.findMember = function (name, lookInParent) { - if (typeof lookInParent === "undefined") { lookInParent = true; } - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.findMember(name, lookInParent); - } - - var memberSymbol = this._instantiatedMemberNameCache[name]; - - if (!memberSymbol) { - var referencedMemberSymbol = this.referencedTypeSymbol.findMember(name, lookInParent); - - if (referencedMemberSymbol) { - this.populateInstantiatedMemberFromReferencedMember(referencedMemberSymbol); - memberSymbol = this._instantiatedMemberNameCache[name]; - } else { - memberSymbol = null; - } - } - - return memberSymbol; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getAllMembers = function (searchDeclKind, memberVisiblity) { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - } - - var requestedMembers = []; - var allReferencedMembers = this.referencedTypeSymbol.getAllMembers(searchDeclKind, memberVisiblity); - - if (!this._allInstantiatedMemberNameCache) { - this._allInstantiatedMemberNameCache = TypeScript.createIntrinsicsObject(); - - var members = this.getMembers(); - - for (var i = 0; i < members.length; i++) { - this._allInstantiatedMemberNameCache[members[i].name] = members[i]; - } - } - - var referencedMember = null; - var requestedMember = null; - - for (var i = 0; i < allReferencedMembers.length; i++) { - referencedMember = allReferencedMembers[i]; - - this._getResolver().resolveDeclaredSymbol(referencedMember); - - if (this._allInstantiatedMemberNameCache[referencedMember.name]) { - requestedMembers[requestedMembers.length] = this._allInstantiatedMemberNameCache[referencedMember.name]; - } else { - if (!referencedMember.type.wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._allInstantiatedMemberNameCache[referencedMember.name] = referencedMember; - requestedMembers[requestedMembers.length] = referencedMember; - } else { - requestedMember = new TypeScript.PullSymbol(referencedMember.name, referencedMember.kind); - requestedMember.setRootSymbol(referencedMember); - - requestedMember.type = this._getResolver().instantiateType(referencedMember.type, this._typeParameterArgumentMap); - requestedMember.isOptional = referencedMember.isOptional; - - this._allInstantiatedMemberNameCache[requestedMember.name] = requestedMember; - requestedMembers[requestedMembers.length] = requestedMember; - } - } - } - - return requestedMembers; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getConstructorMethod = function () { - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getConstructorMethod(); - } - - if (!this._instantiatedConstructorMethod) { - var referencedConstructorMethod = this.referencedTypeSymbol.getConstructorMethod(); - this._instantiatedConstructorMethod = new TypeScript.PullSymbol(referencedConstructorMethod.name, referencedConstructorMethod.kind); - this._instantiatedConstructorMethod.setRootSymbol(referencedConstructorMethod); - this._instantiatedConstructorMethod.setResolved(); - - this._instantiatedConstructorMethod.type = PullInstantiatedTypeReferenceSymbol.create(this._getResolver(), referencedConstructorMethod.type, this._typeParameterArgumentMap); - } - - return this._instantiatedConstructorMethod; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getAssociatedContainerType = function () { - if (!this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getAssociatedContainerType(); - } - - if (!this._instantiatedAssociatedContainerType) { - var referencedAssociatedContainerType = this.referencedTypeSymbol.getAssociatedContainerType(); - - if (referencedAssociatedContainerType) { - this._instantiatedAssociatedContainerType = PullInstantiatedTypeReferenceSymbol.create(this._getResolver(), referencedAssociatedContainerType, this._typeParameterArgumentMap); - } - } - - return this._instantiatedAssociatedContainerType; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getCallSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getCallSignatures(); - } - - if (this._instantiatedCallSignatures) { - return this._instantiatedCallSignatures; - } - - var referencedCallSignatures = this.referencedTypeSymbol.getCallSignatures(); - this._instantiatedCallSignatures = []; - - for (var i = 0; i < referencedCallSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedCallSignatures[i]); - - if (!referencedCallSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length] = referencedCallSignatures[i]; - } else { - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length] = this._getResolver().instantiateSignature(referencedCallSignatures[i], this._typeParameterArgumentMap); - this._instantiatedCallSignatures[this._instantiatedCallSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedCallSignatures; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getConstructSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getConstructSignatures(); - } - - if (this._instantiatedConstructSignatures) { - return this._instantiatedConstructSignatures; - } - - var referencedConstructSignatures = this.referencedTypeSymbol.getConstructSignatures(); - this._instantiatedConstructSignatures = []; - - for (var i = 0; i < referencedConstructSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedConstructSignatures[i]); - - if (!referencedConstructSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length] = referencedConstructSignatures[i]; - } else { - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length] = this._getResolver().instantiateSignature(referencedConstructSignatures[i], this._typeParameterArgumentMap); - this._instantiatedConstructSignatures[this._instantiatedConstructSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedConstructSignatures; - }; - - PullInstantiatedTypeReferenceSymbol.prototype.getIndexSignatures = function () { - this.ensureReferencedTypeIsResolved(); - - if (this.isInstanceReferenceType) { - return this.referencedTypeSymbol.getIndexSignatures(); - } - - if (this._instantiatedIndexSignatures) { - return this._instantiatedIndexSignatures; - } - - var referencedIndexSignatures = this.referencedTypeSymbol.getIndexSignatures(); - this._instantiatedIndexSignatures = []; - - for (var i = 0; i < referencedIndexSignatures.length; i++) { - this._getResolver().resolveDeclaredSymbol(referencedIndexSignatures[i]); - - if (!referencedIndexSignatures[i].wrapsSomeTypeParameter(this._typeParameterArgumentMap)) { - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length] = referencedIndexSignatures[i]; - } else { - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length] = this._getResolver().instantiateSignature(referencedIndexSignatures[i], this._typeParameterArgumentMap); - this._instantiatedIndexSignatures[this._instantiatedIndexSignatures.length - 1].functionType = this; - } - } - - return this._instantiatedIndexSignatures; - }; - return PullInstantiatedTypeReferenceSymbol; - })(PullTypeReferenceSymbol); - TypeScript.PullInstantiatedTypeReferenceSymbol = PullInstantiatedTypeReferenceSymbol; - - var PullInstantiatedSignatureSymbol = (function (_super) { - __extends(PullInstantiatedSignatureSymbol, _super); - function PullInstantiatedSignatureSymbol(rootSignature, _typeParameterArgumentMap) { - _super.call(this, rootSignature.kind, rootSignature.isDefinition()); - this._typeParameterArgumentMap = _typeParameterArgumentMap; - this.setRootSymbol(rootSignature); - TypeScript.nSpecializedSignaturesCreated++; - - rootSignature.addSpecialization(this, _typeParameterArgumentMap); - } - PullInstantiatedSignatureSymbol.prototype.getTypeParameterArgumentMap = function () { - return this._typeParameterArgumentMap; - }; - - PullInstantiatedSignatureSymbol.prototype.getIsSpecialized = function () { - return true; - }; - - PullInstantiatedSignatureSymbol.prototype._getResolver = function () { - return this.getRootSymbol()._getResolver(); - }; - - PullInstantiatedSignatureSymbol.prototype.getTypeParameters = function () { - var _this = this; - if (!this._typeParameters) { - var rootSymbol = this.getRootSymbol(); - var typeParameters = rootSymbol.getTypeParameters(); - var hasInstantiatedTypeParametersOfThisSignature = TypeScript.ArrayUtilities.all(typeParameters, function (typeParameter) { - return _this._typeParameterArgumentMap[typeParameter.pullSymbolID] !== undefined; - }); - - if (!hasInstantiatedTypeParametersOfThisSignature && typeParameters.length) { - this._typeParameters = []; - for (var i = 0; i < typeParameters.length; i++) { - this._typeParameters[this._typeParameters.length] = this._getResolver().instantiateTypeParameter(typeParameters[i], this._typeParameterArgumentMap); - } - } else { - this._typeParameters = TypeScript.sentinelEmptyArray; - } - } - - return this._typeParameters; - }; - - PullInstantiatedSignatureSymbol.prototype.getAllowedToReferenceTypeParameters = function () { - var rootSymbol = this.getRootSymbol(); - return rootSymbol.getAllowedToReferenceTypeParameters(); - }; - return PullInstantiatedSignatureSymbol; - })(TypeScript.PullSignatureSymbol); - TypeScript.PullInstantiatedSignatureSymbol = PullInstantiatedSignatureSymbol; - - var PullInstantiatedTypeParameterSymbol = (function (_super) { - __extends(PullInstantiatedTypeParameterSymbol, _super); - function PullInstantiatedTypeParameterSymbol(rootTypeParameter, constraintType) { - _super.call(this, rootTypeParameter.name); - TypeScript.nSpecializedTypeParameterCreated++; - - this.setRootSymbol(rootTypeParameter); - this.setConstraint(constraintType); - - rootTypeParameter.addSpecialization(this, [constraintType]); - } - PullInstantiatedTypeParameterSymbol.prototype._getResolver = function () { - return this.getRootSymbol()._getResolver(); - }; - return PullInstantiatedTypeParameterSymbol; - })(TypeScript.PullTypeParameterSymbol); - TypeScript.PullInstantiatedTypeParameterSymbol = PullInstantiatedTypeParameterSymbol; -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var SyntaxTreeToAstVisitor = (function () { - function SyntaxTreeToAstVisitor(fileName, lineMap, compilationSettings) { - this.fileName = fileName; - this.lineMap = lineMap; - this.compilationSettings = compilationSettings; - this.position = 0; - this.previousTokenTrailingComments = null; - } - SyntaxTreeToAstVisitor.visit = function (syntaxTree, fileName, compilationSettings, incrementalAST) { - var visitor = incrementalAST ? new SyntaxTreeToIncrementalAstVisitor(fileName, syntaxTree.lineMap(), compilationSettings) : new SyntaxTreeToAstVisitor(fileName, syntaxTree.lineMap(), compilationSettings); - return syntaxTree.sourceUnit().accept(visitor); - }; - - SyntaxTreeToAstVisitor.prototype.movePast = function (element) { - if (element !== null) { - this.position += element.fullWidth(); - } - }; - - SyntaxTreeToAstVisitor.prototype.moveTo = function (element1, element2) { - if (element2 !== null) { - this.position += TypeScript.Syntax.childOffset(element1, element2); - } - }; - - SyntaxTreeToAstVisitor.prototype.setCommentsAndSpan = function (ast, fullStart, node) { - var firstToken = node.firstToken(); - var lastToken = node.lastToken(); - - this.setSpan(ast, fullStart, node, firstToken, lastToken); - ast.setPreComments(this.convertTokenLeadingComments(firstToken, fullStart)); - ast.setPostComments(this.convertNodeTrailingComments(node, lastToken, fullStart)); - }; - - SyntaxTreeToAstVisitor.prototype.createTokenSpan = function (fullStart, element) { - if (element === null) { - return null; - } - - if (element.fullWidth() === 0) { - return new TypeScript.ASTSpan(-1, -1); - } - - var leadingTriviaWidth = element.leadingTriviaWidth(); - var trailingTriviaWidth = element.trailingTriviaWidth(); - - var start = fullStart + leadingTriviaWidth; - var end = fullStart + element.fullWidth() - trailingTriviaWidth; - - return new TypeScript.ASTSpan(start, end); - }; - - SyntaxTreeToAstVisitor.prototype.setSpan = function (span, fullStart, element, firstToken, lastToken) { - if (typeof firstToken === "undefined") { firstToken = element.firstToken(); } - if (typeof lastToken === "undefined") { lastToken = element.lastToken(); } - var leadingTriviaWidth = firstToken ? firstToken.leadingTriviaWidth() : 0; - var trailingTriviaWidth = lastToken ? lastToken.trailingTriviaWidth() : 0; - - var desiredMinChar = fullStart + leadingTriviaWidth; - var desiredLimChar = fullStart + element.fullWidth() - trailingTriviaWidth; - - this.setSpanExplicit(span, desiredMinChar, desiredLimChar); - - span._trailingTriviaWidth = trailingTriviaWidth; - }; - - SyntaxTreeToAstVisitor.prototype.setSpanExplicit = function (span, start, end) { - span._start = start; - span._end = end; - }; - - SyntaxTreeToAstVisitor.prototype.visitSyntaxList = function (node) { - var start = this.position; - var array = new Array(node.childCount()); - - for (var i = 0, n = node.childCount(); i < n; i++) { - array[i] = node.childAt(i).accept(this); - } - - var result = new TypeScript.ISyntaxList2(this.fileName, array); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSeparatedSyntaxList = function (list) { - var start = this.position; - var array = new Array(list.nonSeparatorCount()); - - for (var i = 0, n = list.childCount(); i < n; i++) { - if (i % 2 === 0) { - array[i / 2] = list.childAt(i).accept(this); - this.previousTokenTrailingComments = null; - } else { - var separatorToken = list.childAt(i); - this.previousTokenTrailingComments = this.convertTokenTrailingComments(separatorToken, this.position + separatorToken.leadingTriviaWidth() + separatorToken.width()); - this.movePast(separatorToken); - } - } - - var result = new TypeScript.ISeparatedSyntaxList2(this.fileName, array, list.separatorCount()); - this.setSpan(result, start, list); - - result.setPostComments(this.previousTokenTrailingComments); - this.previousTokenTrailingComments = null; - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.convertComment = function (trivia, commentStartPosition, hasTrailingNewLine) { - var comment = new TypeScript.Comment(trivia, hasTrailingNewLine, commentStartPosition, commentStartPosition + trivia.fullWidth()); - - return comment; - }; - - SyntaxTreeToAstVisitor.prototype.convertComments = function (triviaList, commentStartPosition) { - var result = []; - - for (var i = 0, n = triviaList.count(); i < n; i++) { - var trivia = triviaList.syntaxTriviaAt(i); - - if (trivia.isComment()) { - var hasTrailingNewLine = ((i + 1) < n) && triviaList.syntaxTriviaAt(i + 1).isNewLine(); - result.push(this.convertComment(trivia, commentStartPosition, hasTrailingNewLine)); - } - - commentStartPosition += trivia.fullWidth(); - } - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.mergeComments = function (comments1, comments2) { - if (comments1 === null) { - return comments2; - } - - if (comments2 === null) { - return comments1; - } - - return comments1.concat(comments2); - }; - - SyntaxTreeToAstVisitor.prototype.convertTokenLeadingComments = function (token, commentStartPosition) { - if (token === null) { - return null; - } - - var preComments = token.hasLeadingComment() ? this.convertComments(token.leadingTrivia(), commentStartPosition) : null; - - var previousTokenTrailingComments = this.previousTokenTrailingComments; - this.previousTokenTrailingComments = null; - - return this.mergeComments(previousTokenTrailingComments, preComments); - }; - - SyntaxTreeToAstVisitor.prototype.convertTokenTrailingComments = function (token, commentStartPosition) { - if (token === null || !token.hasTrailingComment() || token.hasTrailingNewLine()) { - return null; - } - - return this.convertComments(token.trailingTrivia(), commentStartPosition); - }; - - SyntaxTreeToAstVisitor.prototype.convertNodeTrailingComments = function (node, lastToken, nodeStart) { - if (lastToken === null || !lastToken.hasTrailingComment() || lastToken.hasTrailingNewLine()) { - return null; - } - - return this.convertComments(lastToken.trailingTrivia(), nodeStart + node.fullWidth() - lastToken.trailingTriviaWidth()); - }; - - SyntaxTreeToAstVisitor.prototype.visitIdentifier = function (token) { - return this.visitToken(token); - }; - - SyntaxTreeToAstVisitor.prototype.visitToken = function (token) { - var fullStart = this.position; - - var result = this.visitTokenWorker(token); - - this.movePast(token); - - var start = fullStart + token.leadingTriviaWidth(); - this.setSpanExplicit(result, start, start + token.width()); - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTokenWorker = function (token) { - switch (token.tokenKind) { - case 60 /* AnyKeyword */: - return new TypeScript.BuiltInType(60 /* AnyKeyword */, token.text(), token.valueText()); - case 61 /* BooleanKeyword */: - return new TypeScript.BuiltInType(61 /* BooleanKeyword */, token.text(), token.valueText()); - case 67 /* NumberKeyword */: - return new TypeScript.BuiltInType(67 /* NumberKeyword */, token.text(), token.valueText()); - case 69 /* StringKeyword */: - return new TypeScript.BuiltInType(69 /* StringKeyword */, token.text(), token.valueText()); - case 41 /* VoidKeyword */: - return new TypeScript.BuiltInType(41 /* VoidKeyword */, token.text(), token.valueText()); - case 35 /* ThisKeyword */: - return new TypeScript.ThisExpression(token.text(), token.valueText()); - case 50 /* SuperKeyword */: - return new TypeScript.SuperExpression(token.text(), token.valueText()); - case 37 /* TrueKeyword */: - return new TypeScript.LiteralExpression(37 /* TrueKeyword */, token.text(), token.valueText()); - case 24 /* FalseKeyword */: - return new TypeScript.LiteralExpression(24 /* FalseKeyword */, token.text(), token.valueText()); - case 32 /* NullKeyword */: - return new TypeScript.LiteralExpression(32 /* NullKeyword */, token.text(), token.valueText()); - case 14 /* StringLiteral */: - return new TypeScript.StringLiteral(token.text(), token.valueText()); - case 12 /* RegularExpressionLiteral */: - return new TypeScript.RegularExpressionLiteral(token.text(), token.valueText()); - case 13 /* NumericLiteral */: - var fullStart = this.position; - var preComments = this.convertTokenLeadingComments(token, fullStart); - - var result = new TypeScript.NumericLiteral(token.value(), token.text(), token.valueText()); - - result.setPreComments(preComments); - return result; - case 11 /* IdentifierName */: - return new TypeScript.Identifier(token.text()); - default: - throw TypeScript.Errors.invalidOperation(); - } - }; - - SyntaxTreeToAstVisitor.prototype.visitSourceUnit = function (node) { - var start = this.position; - TypeScript.Debug.assert(start === 0); - - var bod = this.visitSyntaxList(node.moduleElements); - var comments = this.convertTokenLeadingComments(node.endOfFileToken, TypeScript.Syntax.childOffset(node, node.endOfFileToken)); - var result = new TypeScript.SourceUnit(bod, comments, this.fileName); - this.setSpanExplicit(result, start, start + node.fullWidth()); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExternalModuleReference = function (node) { - var start = this.position; - - this.moveTo(node, node.stringLiteral); - var stringLiteral = node.stringLiteral.accept(this); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ExternalModuleReference(stringLiteral); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModuleNameModuleReference = function (node) { - var start = this.position; - var moduleName = node.moduleName.accept(this); - - var result = new TypeScript.ModuleNameModuleReference(moduleName); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitClassDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var heritageClauses = node.heritageClauses ? this.visitSyntaxList(node.heritageClauses) : null; - - this.movePast(node.openBraceToken); - var members = this.visitSyntaxList(node.classElements); - - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.ClassDeclaration(modifiers, name, typeParameters, heritageClauses, members, closeBraceToken); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModifiers = function (modifiers) { - var result = null; - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 47 /* ExportKeyword */)) { - result = result || []; - result.push(1 /* Exported */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 63 /* DeclareKeyword */)) { - result = result || []; - result.push(8 /* Ambient */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 58 /* StaticKeyword */)) { - result = result || []; - result.push(16 /* Static */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 57 /* PublicKeyword */)) { - result = result || []; - result.push(4 /* Public */); - } - - if (TypeScript.SyntaxUtilities.containsToken(modifiers, 55 /* PrivateKeyword */)) { - result = result || []; - result.push(2 /* Private */); - } - - return result || TypeScript.sentinelEmptyArray; - }; - - SyntaxTreeToAstVisitor.prototype.visitInterfaceDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var heritageClauses = node.heritageClauses ? this.visitSyntaxList(node.heritageClauses) : null; - - var body = this.visitObjectType(node.body); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.InterfaceDeclaration(modifiers, name, typeParameters, heritageClauses, body); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitHeritageClause = function (node) { - var start = this.position; - - this.movePast(node.extendsOrImplementsKeyword); - var typeNames = this.visitSeparatedSyntaxList(node.typeNames); - - var result = new TypeScript.HeritageClause(node.extendsOrImplementsKeyword.tokenKind === 48 /* ExtendsKeyword */ ? 230 /* ExtendsHeritageClause */ : 231 /* ImplementsHeritageClause */, typeNames); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitModuleDeclaration = function (node) { - var start = this.position; - - var modifiers = this.visitModifiers(node.modifiers); - - this.moveTo(node, node.moduleKeyword); - this.movePast(node.moduleKeyword); - - var moduleName = node.name ? node.name.accept(this) : null; - var stringLiteral = node.stringLiteral ? node.stringLiteral.accept(this) : null; - - this.movePast(node.openBraceToken); - - var moduleElements = this.visitSyntaxList(node.moduleElements); - - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ModuleDeclaration(modifiers, moduleName, stringLiteral, moduleElements, closeBraceToken); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? this.visitBlock(node.block) : null; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.FunctionDeclaration(this.visitModifiers(node.modifiers), name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEnumDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var identifier = this.visitIdentifier(node.identifier); - - this.movePast(node.openBraceToken); - - var enumElements = this.visitSeparatedSyntaxList(node.enumElements); - - this.movePast(node.closeBraceToken); - - var result = new TypeScript.EnumDeclaration(this.visitModifiers(node.modifiers), identifier, enumElements); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEnumElement = function (node) { - var start = this.position; - - var memberName = this.visitToken(node.propertyName); - - var value = node.equalsValueClause !== null ? this.visitEqualsValueClause(node.equalsValueClause) : null; - - var result = new TypeScript.EnumElement(memberName, value); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitImportDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - this.movePast(node.equalsToken); - var alias = node.moduleReference.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.ImportDeclaration(modifiers, name, alias); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExportAssignment = function (node) { - var start = this.position; - - this.moveTo(node, node.identifier); - var name = this.visitIdentifier(node.identifier); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ExportAssignment(name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclaration); - - var declaration = node.variableDeclaration.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - - var result = new TypeScript.VariableStatement(modifiers, declaration); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclarators); - var variableDecls = this.visitSeparatedSyntaxList(node.variableDeclarators); - - var result = new TypeScript.VariableDeclaration(variableDecls); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVariableDeclarator = function (node) { - var start = this.position; - var propertyName = this.visitToken(node.propertyName); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - var init = node.equalsValueClause ? this.visitEqualsValueClause(node.equalsValueClause) : null; - - var result = new TypeScript.VariableDeclarator(propertyName, typeExpr, init); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEqualsValueClause = function (node) { - var start = this.position; - var afterEqualsComments = this.convertTokenTrailingComments(node.equalsToken, this.position + node.equalsToken.leadingTriviaWidth() + node.equalsToken.width()); - - this.movePast(node.equalsToken); - var value = node.value.accept(this); - value.setPreComments(this.mergeComments(afterEqualsComments, value.preComments())); - - var result = new TypeScript.EqualsValueClause(value); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPrefixUnaryExpression = function (node) { - var start = this.position; - - this.movePast(node.operatorToken); - var operand = node.operand.accept(this); - - var result = new TypeScript.PrefixUnaryExpression(node.kind(), operand); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArrayLiteralExpression = function (node) { - var start = this.position; - var openStart = this.position + node.openBracketToken.leadingTriviaWidth(); - this.movePast(node.openBracketToken); - - var expressions = this.visitSeparatedSyntaxList(node.expressions); - - var closeStart = this.position + node.closeBracketToken.leadingTriviaWidth(); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ArrayLiteralExpression(expressions); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitOmittedExpression = function (node) { - var start = this.position; - - var result = new TypeScript.OmittedExpression(); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParenthesizedExpression = function (node) { - var start = this.position; - - var openParenToken = node.openParenToken; - var openParenTrailingComments = this.convertTokenTrailingComments(openParenToken, start + openParenToken.leadingTriviaWidth() + openParenToken.width()); - - this.movePast(openParenToken); - - var expr = node.expression.accept(this); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ParenthesizedExpression(openParenTrailingComments, expr); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - var start = this.position; - - var identifier = node.identifier.accept(this); - this.movePast(node.equalsGreaterThanToken); - - var block = node.block ? this.visitBlock(node.block) : null; - var expression = node.expression ? node.expression.accept(this) : null; - - var result = new TypeScript.SimpleArrowFunctionExpression(identifier, block, expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - var start = this.position; - - var callSignature = this.visitCallSignature(node.callSignature); - this.movePast(node.equalsGreaterThanToken); - - var block = node.block ? this.visitBlock(node.block) : null; - var expression = node.expression ? node.expression.accept(this) : null; - - var result = new TypeScript.ParenthesizedArrowFunctionExpression(callSignature, block, expression); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitType = function (type) { - return type ? type.accept(this) : null; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeQuery = function (node) { - var start = this.position; - this.movePast(node.typeOfKeyword); - var name = node.name.accept(this); - - var result = new TypeScript.TypeQuery(name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitQualifiedName = function (node) { - var start = this.position; - var left = this.visitType(node.left); - this.movePast(node.dotToken); - var right = this.visitIdentifier(node.right); - - var result = new TypeScript.QualifiedName(left, right); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeArgumentList = function (node) { - if (node === null) { - return null; - } - - var start = this.position; - this.movePast(node.lessThanToken); - var typeArguments = this.visitSeparatedSyntaxList(node.typeArguments); - this.movePast(node.greaterThanToken); - - var result = new TypeScript.TypeArgumentList(typeArguments); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructorType = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - this.movePast(node.equalsGreaterThanToken); - var returnType = this.visitType(node.type); - - var result = new TypeScript.ConstructorType(typeParameters, parameters, returnType); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionType = function (node) { - var start = this.position; - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - this.movePast(node.equalsGreaterThanToken); - var returnType = this.visitType(node.type); - - var result = new TypeScript.FunctionType(typeParameters, parameters, returnType); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectType = function (node) { - var start = this.position; - - this.movePast(node.openBraceToken); - var typeMembers = this.visitSeparatedSyntaxList(node.typeMembers); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ObjectType(typeMembers); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArrayType = function (node) { - var start = this.position; - - var underlying = this.visitType(node.type); - this.movePast(node.openBracketToken); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ArrayType(underlying); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitGenericType = function (node) { - var start = this.position; - - var underlying = this.visitType(node.name); - var typeArguments = this.visitTypeArgumentList(node.typeArgumentList); - - var result = new TypeScript.GenericType(underlying, typeArguments); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeAnnotation = function (node) { - if (!node) { - return null; - } - - var start = this.position; - this.movePast(node.colonToken); - var type = this.visitType(node.type); - - var result = new TypeScript.TypeAnnotation(type); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBlock = function (node) { - if (!node) { - return null; - } - - var start = this.position; - - this.movePast(node.openBraceToken); - var statements = this.visitSyntaxList(node.statements); - var closeBracePosition = this.position; - - var closeBraceLeadingComments = this.convertTokenLeadingComments(node.closeBraceToken, this.position); - var closeBraceToken = this.createTokenSpan(this.position, node.closeBraceToken); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.Block(statements, closeBraceLeadingComments, closeBraceToken); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParameter = function (node) { - var start = this.position; - - var dotDotDotToken = this.createTokenSpan(this.position, node.dotDotDotToken); - - this.moveTo(node, node.identifier); - var identifier = this.visitIdentifier(node.identifier); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - var init = node.equalsValueClause ? node.equalsValueClause.accept(this) : null; - - var modifiers = this.visitModifiers(node.modifiers); - - var result = new TypeScript.Parameter(dotDotDotToken, modifiers, identifier, questionToken, typeExpr, init); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberAccessExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - this.movePast(node.dotToken); - var name = this.visitIdentifier(node.name); - - var result = new TypeScript.MemberAccessExpression(expression, name); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPostfixUnaryExpression = function (node) { - var start = this.position; - - var operand = node.operand.accept(this); - this.movePast(node.operatorToken); - - var result = new TypeScript.PostfixUnaryExpression(node.kind() === 210 /* PostIncrementExpression */ ? 210 /* PostIncrementExpression */ : 211 /* PostDecrementExpression */, operand); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitElementAccessExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - this.movePast(node.openBracketToken); - var argumentExpression = node.argumentExpression.accept(this); - this.movePast(node.closeBracketToken); - - var result = new TypeScript.ElementAccessExpression(expression, argumentExpression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitInvocationExpression = function (node) { - var start = this.position; - - var expression = node.expression.accept(this); - var argumentList = this.visitArgumentList(node.argumentList); - - var result = new TypeScript.InvocationExpression(expression, argumentList); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitArgumentList = function (node) { - if (node === null) { - return null; - } - - var start = this.position; - - var typeArguments = this.visitTypeArgumentList(node.typeArgumentList); - - this.movePast(node.openParenToken); - - var _arguments = this.visitSeparatedSyntaxList(node.arguments); - - if (node.arguments.fullWidth() === 0 && node.closeParenToken.fullWidth() === 0) { - var openParenTokenEnd = start + node.openParenToken.leadingTriviaWidth() + node.openParenToken.width(); - this.setSpanExplicit(_arguments, openParenTokenEnd, openParenTokenEnd + node.openParenToken.trailingTriviaWidth()); - } - - var closeParenToken = this.createTokenSpan(this.position, node.closeParenToken); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ArgumentList(typeArguments, _arguments, closeParenToken); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBinaryExpression = function (node) { - var start = this.position; - - var left = node.left.accept(this); - this.movePast(node.operatorToken); - var right = node.right.accept(this); - - var result = new TypeScript.BinaryExpression(node.kind(), left, right); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConditionalExpression = function (node) { - var start = this.position; - - var condition = node.condition.accept(this); - this.movePast(node.questionToken); - var whenTrue = node.whenTrue.accept(this); - this.movePast(node.colonToken); - var whenFalse = node.whenFalse.accept(this); - - var result = new TypeScript.ConditionalExpression(condition, whenTrue, whenFalse); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructSignature = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var callSignature = this.visitCallSignature(node.callSignature); - - var result = new TypeScript.ConstructSignature(callSignature); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMethodSignature = function (node) { - var start = this.position; - - var name = this.visitToken(node.propertyName); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - - var callSignature = this.visitCallSignature(node.callSignature); - - var result = new TypeScript.MethodSignature(name, questionToken, callSignature); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIndexSignature = function (node) { - var start = this.position; - - this.movePast(node.openBracketToken); - - var parameter = node.parameter.accept(this); - - this.movePast(node.closeBracketToken); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.IndexSignature(parameter, returnType); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitPropertySignature = function (node) { - var start = this.position; - - var name = this.visitToken(node.propertyName); - - var questionToken = this.createTokenSpan(this.position, node.questionToken); - this.movePast(node.questionToken); - var typeExpr = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.PropertySignature(name, questionToken, typeExpr); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitParameterList = function (node) { - if (!node) { - return null; - } - - var start = this.position; - - var openParenToken = node.openParenToken; - - this.previousTokenTrailingComments = this.convertTokenTrailingComments(openParenToken, start + openParenToken.leadingTriviaWidth() + openParenToken.width()); - var openParenTrailingComments = null; - if (node.parameters.childCount() === 0) { - openParenTrailingComments = this.previousTokenTrailingComments; - this.previousTokenTrailingComments = null; - } - - this.movePast(node.openParenToken); - var parameters = this.visitSeparatedSyntaxList(node.parameters); - this.movePast(node.closeParenToken); - - var result = new TypeScript.ParameterList(openParenTrailingComments, parameters); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCallSignature = function (node) { - var start = this.position; - - var typeParameters = this.visitTypeParameterList(node.typeParameterList); - var parameters = this.visitParameterList(node.parameterList); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var result = new TypeScript.CallSignature(typeParameters, parameters, returnType); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeParameterList = function (node) { - if (!node) { - return null; - } - - var start = this.position; - this.movePast(node.lessThanToken); - var typeParameters = this.visitSeparatedSyntaxList(node.typeParameters); - this.movePast(node.greaterThanToken); - - var result = new TypeScript.TypeParameterList(typeParameters); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeParameter = function (node) { - var start = this.position; - - var identifier = this.visitIdentifier(node.identifier); - var constraint = node.constraint ? node.constraint.accept(this) : null; - - var result = new TypeScript.TypeParameter(identifier, constraint); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstraint = function (node) { - var start = this.position; - this.movePast(node.extendsKeyword); - var type = this.visitType(node.type); - - var result = new TypeScript.Constraint(type); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIfStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var thenBod = node.statement.accept(this); - var elseBod = node.elseClause ? node.elseClause.accept(this) : null; - - var result = new TypeScript.IfStatement(condition, thenBod, elseBod); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitElseClause = function (node) { - var start = this.position; - - this.movePast(node.elseKeyword); - var statement = node.statement.accept(this); - - var result = new TypeScript.ElseClause(statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitExpressionStatement = function (node) { - var start = this.position; - - var preComments = this.convertTokenLeadingComments(node.firstToken(), start); - var expression = node.expression.accept(this); - - var semicolonPosition = this.position; - - var postComments = this.convertComments(node.semicolonToken.trailingTrivia(), this.position + node.semicolonToken.leadingTriviaWidth() + node.semicolonToken.width()); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ExpressionStatement(expression); - this.setSpan(result, start, node); - - result.setPreComments(preComments); - result.setPostComments(postComments); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitConstructorDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.callSignature); - var callSignature = this.visitCallSignature(node.callSignature); - - var block = node.block ? node.block.accept(this) : null; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.ConstructorDeclaration(callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitIndexMemberDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.indexSignature); - var indexSignature = node.indexSignature.accept(this); - - this.movePast(node.semicolonToken); - - var result = new TypeScript.IndexMemberDeclaration(indexSignature); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? this.visitBlock(node.block) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.MemberFunctionDeclaration(this.visitModifiers(node.modifiers), name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitGetAccessor = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - var parameters = this.visitParameterList(node.parameterList); - var returnType = this.visitTypeAnnotation(node.typeAnnotation); - - var block = node.block ? node.block.accept(this) : null; - var result = new TypeScript.GetAccessor(this.visitModifiers(node.modifiers), name, parameters, returnType, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSetAccessor = function (node) { - var start = this.position; - - this.moveTo(node, node.propertyName); - var name = this.visitToken(node.propertyName); - var parameters = this.visitParameterList(node.parameterList); - var block = node.block ? node.block.accept(this) : null; - var result = new TypeScript.SetAccessor(this.visitModifiers(node.modifiers), name, parameters, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitMemberVariableDeclaration = function (node) { - var start = this.position; - - this.moveTo(node, node.variableDeclarator); - var variableDeclarator = node.variableDeclarator.accept(this); - this.movePast(node.semicolonToken); - - var modifiers = this.visitModifiers(node.modifiers); - var result = new TypeScript.MemberVariableDeclaration(modifiers, variableDeclarator); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitThrowStatement = function (node) { - var start = this.position; - - this.movePast(node.throwKeyword); - var expression = node.expression.accept(this); - this.movePast(node.semicolonToken); - - var result = new TypeScript.ThrowStatement(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitReturnStatement = function (node) { - var start = this.position; - - this.movePast(node.returnKeyword); - var expression = node.expression ? node.expression.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.ReturnStatement(expression); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectCreationExpression = function (node) { - var start = this.position; - - this.movePast(node.newKeyword); - var expression = node.expression.accept(this); - var argumentList = this.visitArgumentList(node.argumentList); - - var result = new TypeScript.ObjectCreationExpression(expression, argumentList); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSwitchStatement = function (node) { - var start = this.position; - - this.movePast(node.switchKeyword); - this.movePast(node.openParenToken); - var expression = node.expression.accept(this); - - var closeParenToken = this.createTokenSpan(this.position, node.closeParenToken); - this.movePast(node.closeParenToken); - this.movePast(node.openBraceToken); - var switchClauses = this.visitSyntaxList(node.switchClauses); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.SwitchStatement(expression, closeParenToken, switchClauses); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCaseSwitchClause = function (node) { - var start = this.position; - - this.movePast(node.caseKeyword); - var expression = node.expression.accept(this); - this.movePast(node.colonToken); - var statements = this.visitSyntaxList(node.statements); - - var result = new TypeScript.CaseSwitchClause(expression, statements); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDefaultSwitchClause = function (node) { - var start = this.position; - - this.movePast(node.defaultKeyword); - this.movePast(node.colonToken); - var statements = this.visitSyntaxList(node.statements); - - var result = new TypeScript.DefaultSwitchClause(statements); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitBreakStatement = function (node) { - var start = this.position; - - this.movePast(node.breakKeyword); - var identifier = node.identifier ? node.identifier.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.BreakStatement(identifier); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitContinueStatement = function (node) { - var start = this.position; - - this.movePast(node.continueKeyword); - var identifier = node.identifier ? node.identifier.accept(this) : null; - this.movePast(node.semicolonToken); - - var result = new TypeScript.ContinueStatement(identifier); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitForStatement = function (node) { - var start = this.position; - - this.movePast(node.forKeyword); - this.movePast(node.openParenToken); - var variableDeclaration = node.variableDeclaration ? node.variableDeclaration.accept(this) : null; - var initializer = node.initializer ? node.initializer.accept(this) : null; - - this.movePast(node.firstSemicolonToken); - var cond = node.condition ? node.condition.accept(this) : null; - this.movePast(node.secondSemicolonToken); - var incr = node.incrementor ? node.incrementor.accept(this) : null; - this.movePast(node.closeParenToken); - var body = node.statement.accept(this); - - var result = new TypeScript.ForStatement(variableDeclaration, initializer, cond, incr, body); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitForInStatement = function (node) { - var start = this.position; - - this.movePast(node.forKeyword); - this.movePast(node.openParenToken); - var variableDeclaration = node.variableDeclaration ? node.variableDeclaration.accept(this) : null; - var left = node.left ? node.left.accept(this) : null; - - this.movePast(node.inKeyword); - var expression = node.expression.accept(this); - this.movePast(node.closeParenToken); - var body = node.statement.accept(this); - - var result = new TypeScript.ForInStatement(variableDeclaration, left, expression, body); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitWhileStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.WhileStatement(condition, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitWithStatement = function (node) { - var start = this.position; - - this.moveTo(node, node.condition); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.WithStatement(condition, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCastExpression = function (node) { - var start = this.position; - - this.movePast(node.lessThanToken); - var castTerm = this.visitType(node.type); - this.movePast(node.greaterThanToken); - var expression = node.expression.accept(this); - - var result = new TypeScript.CastExpression(castTerm, expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitObjectLiteralExpression = function (node) { - var start = this.position; - - var openStart = this.position + node.openBraceToken.leadingTriviaWidth(); - this.movePast(node.openBraceToken); - - var propertyAssignments = this.visitSeparatedSyntaxList(node.propertyAssignments); - - var closeStart = this.position + node.closeBraceToken.leadingTriviaWidth(); - this.movePast(node.closeBraceToken); - - var result = new TypeScript.ObjectLiteralExpression(propertyAssignments); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitSimplePropertyAssignment = function (node) { - var start = this.position; - - var preComments = this.convertTokenLeadingComments(node.firstToken(), start); - var postComments = this.convertNodeTrailingComments(node, node.lastToken(), start); - - var propertyName = node.propertyName.accept(this); - - var afterColonComments = this.convertTokenTrailingComments(node.colonToken, this.position + node.colonToken.leadingTriviaWidth() + node.colonToken.width()); - - this.movePast(node.colonToken); - var expression = node.expression.accept(this); - expression.setPreComments(this.mergeComments(afterColonComments, expression.preComments())); - - var result = new TypeScript.SimplePropertyAssignment(propertyName, expression); - this.setSpan(result, start, node); - - result.setPreComments(preComments); - result.setPostComments(postComments); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - var start = this.position; - - var propertyName = node.propertyName.accept(this); - var callSignature = this.visitCallSignature(node.callSignature); - var block = this.visitBlock(node.block); - - var result = new TypeScript.FunctionPropertyAssignment(propertyName, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFunctionExpression = function (node) { - var start = this.position; - - this.movePast(node.functionKeyword); - var name = node.identifier === null ? null : this.visitIdentifier(node.identifier); - - var callSignature = this.visitCallSignature(node.callSignature); - var block = node.block ? node.block.accept(this) : null; - - var result = new TypeScript.FunctionExpression(name, callSignature, block); - this.setCommentsAndSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitEmptyStatement = function (node) { - var start = this.position; - - this.movePast(node.semicolonToken); - - var result = new TypeScript.EmptyStatement(); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTryStatement = function (node) { - var start = this.position; - - this.movePast(node.tryKeyword); - var tryBody = node.block.accept(this); - - var catchClause = null; - if (node.catchClause !== null) { - catchClause = node.catchClause.accept(this); - } - - var finallyBody = null; - if (node.finallyClause !== null) { - finallyBody = node.finallyClause.accept(this); - } - - var result = new TypeScript.TryStatement(tryBody, catchClause, finallyBody); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitCatchClause = function (node) { - var start = this.position; - - this.movePast(node.catchKeyword); - this.movePast(node.openParenToken); - var identifier = this.visitIdentifier(node.identifier); - var typeAnnotation = this.visitTypeAnnotation(node.typeAnnotation); - this.movePast(node.closeParenToken); - var block = node.block.accept(this); - - var result = new TypeScript.CatchClause(identifier, typeAnnotation, block); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitFinallyClause = function (node) { - var start = this.position; - this.movePast(node.finallyKeyword); - var block = node.block.accept(this); - - var result = new TypeScript.FinallyClause(block); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitLabeledStatement = function (node) { - var start = this.position; - - var identifier = this.visitIdentifier(node.identifier); - this.movePast(node.colonToken); - var statement = node.statement.accept(this); - - var result = new TypeScript.LabeledStatement(identifier, statement); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDoStatement = function (node) { - var start = this.position; - - this.movePast(node.doKeyword); - var statement = node.statement.accept(this); - var whileKeyword = this.createTokenSpan(this.position, node.whileKeyword); - - this.movePast(node.whileKeyword); - this.movePast(node.openParenToken); - var condition = node.condition.accept(this); - this.movePast(node.closeParenToken); - this.movePast(node.semicolonToken); - - var result = new TypeScript.DoStatement(statement, whileKeyword, condition); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitTypeOfExpression = function (node) { - var start = this.position; - - this.movePast(node.typeOfKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.TypeOfExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDeleteExpression = function (node) { - var start = this.position; - - this.movePast(node.deleteKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.DeleteExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitVoidExpression = function (node) { - var start = this.position; - - this.movePast(node.voidKeyword); - var expression = node.expression.accept(this); - - var result = new TypeScript.VoidExpression(expression); - this.setSpan(result, start, node); - - return result; - }; - - SyntaxTreeToAstVisitor.prototype.visitDebuggerStatement = function (node) { - var start = this.position; - - this.movePast(node.debuggerKeyword); - this.movePast(node.semicolonToken); - - var result = new TypeScript.DebuggerStatement(); - this.setSpan(result, start, node); - - return result; - }; - return SyntaxTreeToAstVisitor; - })(); - TypeScript.SyntaxTreeToAstVisitor = SyntaxTreeToAstVisitor; - - function applyDelta(ast, delta) { - if (ast) { - if (ast._start !== -1) { - ast._start += delta; - } - - if (ast._end !== -1) { - ast._end += delta; - } - } - } - - function applyDeltaToComments(comments, delta) { - if (comments && comments.length > 0) { - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - applyDelta(comment, delta); - } - } - } - - var SyntaxTreeToIncrementalAstVisitor = (function (_super) { - __extends(SyntaxTreeToIncrementalAstVisitor, _super); - function SyntaxTreeToIncrementalAstVisitor() { - _super.apply(this, arguments); - } - SyntaxTreeToIncrementalAstVisitor.prototype.applyDelta = function (ast, delta) { - if (delta === 0) { - return; - } - - var pre = function (cur) { - applyDelta(cur, delta); - applyDeltaToComments(cur.preComments(), delta); - applyDeltaToComments(cur.postComments(), delta); - - switch (cur.kind()) { - case 146 /* Block */: - applyDelta(cur.closeBraceToken, delta); - break; - - case 226 /* ArgumentList */: - applyDelta(cur.closeParenToken, delta); - break; - - case 130 /* ModuleDeclaration */: - applyDelta(cur.endingToken, delta); - break; - - case 131 /* ClassDeclaration */: - applyDelta(cur.closeBraceToken, delta); - break; - - case 161 /* DoStatement */: - applyDelta(cur.whileKeyword, delta); - break; - - case 151 /* SwitchStatement */: - applyDelta(cur.closeParenToken, delta); - break; - } - }; - - TypeScript.getAstWalkerFactory().simpleWalk(ast, pre); - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.setSpanExplicit = function (span, start, end) { - if (span._start !== -1) { - var delta = start - span._start; - this.applyDelta(span, delta); - - span._end = end; - } else { - _super.prototype.setSpanExplicit.call(this, span, start, end); - } - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.getAndMovePastAST = function (element) { - if (this.previousTokenTrailingComments !== null) { - return null; - } - - var result = element._ast; - if (!result) { - return null; - } - - var start = this.position; - this.movePast(element); - this.setSpan(result, start, element); - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.setAST = function (element, ast) { - element._ast = ast; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSyntaxList = function (list) { - var result = this.getAndMovePastAST(list); - if (!result) { - result = _super.prototype.visitSyntaxList.call(this, list); - - if (list.childCount() > 0) { - this.setAST(list, result); - } - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSeparatedSyntaxList = function (list) { - var result = this.getAndMovePastAST(list); - if (!result) { - result = _super.prototype.visitSeparatedSyntaxList.call(this, list); - - if (list.childCount() > 0) { - this.setAST(list, result); - } - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitToken = function (token) { - var result = this.getAndMovePastAST(token); - - if (!result) { - result = _super.prototype.visitToken.call(this, token); - this.setAST(token, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitClassDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitClassDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitInterfaceDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitInterfaceDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitHeritageClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitHeritageClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitModuleDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitModuleDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitImportDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitImportDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitExportAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitExportAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPrefixUnaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPrefixUnaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitArrayLiteralExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitArrayLiteralExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitOmittedExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitOmittedExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParenthesizedExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParenthesizedExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSimpleArrowFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSimpleArrowFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParenthesizedArrowFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParenthesizedArrowFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitQualifiedName = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - var result = _super.prototype.visitQualifiedName.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructorType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructorType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitArrayType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitArrayType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitGenericType = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitGenericType.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBlock = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBlock.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitParameter = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitParameter.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberAccessExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberAccessExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPostfixUnaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPostfixUnaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitElementAccessExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitElementAccessExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitInvocationExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitInvocationExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBinaryExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBinaryExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConditionalExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConditionalExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMethodSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMethodSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitIndexSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitIndexSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitPropertySignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitPropertySignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCallSignature = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCallSignature.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTypeParameter = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTypeParameter.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitIfStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitIfStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitExpressionStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitExpressionStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitConstructorDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitConstructorDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberFunctionDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberFunctionDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitGetAccessor = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitGetAccessor.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSetAccessor = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSetAccessor.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitMemberVariableDeclaration = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitMemberVariableDeclaration.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitThrowStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitThrowStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitReturnStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitReturnStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectCreationExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectCreationExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSwitchStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSwitchStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCaseSwitchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCaseSwitchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDefaultSwitchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDefaultSwitchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitBreakStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitBreakStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitContinueStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitContinueStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitForStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitForStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitForInStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitForInStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitWhileStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitWhileStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitWithStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitWithStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCastExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCastExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitObjectLiteralExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitObjectLiteralExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitSimplePropertyAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitSimplePropertyAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionPropertyAssignment = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionPropertyAssignment.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitFunctionExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitFunctionExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitEmptyStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitEmptyStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTryStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTryStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitCatchClause = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitCatchClause.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitLabeledStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitLabeledStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDoStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDoStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitTypeOfExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitTypeOfExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDeleteExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDeleteExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitVoidExpression = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitVoidExpression.call(this, node); - this.setAST(node, result); - } - - return result; - }; - - SyntaxTreeToIncrementalAstVisitor.prototype.visitDebuggerStatement = function (node) { - var result = this.getAndMovePastAST(node); - if (!result) { - result = _super.prototype.visitDebuggerStatement.call(this, node); - this.setAST(node, result); - } - - return result; - }; - return SyntaxTreeToIncrementalAstVisitor; - })(SyntaxTreeToAstVisitor); -})(TypeScript || (TypeScript = {})); -var TypeScript; -(function (TypeScript) { - var ASTSpan = (function () { - function ASTSpan(_start, _end) { - this._start = _start; - this._end = _end; - } - ASTSpan.prototype.start = function () { - return this._start; - }; - - ASTSpan.prototype.end = function () { - return this._end; - }; - return ASTSpan; - })(); - TypeScript.ASTSpan = ASTSpan; - - var astID = 0; - - function structuralEqualsNotIncludingPosition(ast1, ast2) { - return structuralEquals(ast1, ast2, false); - } - TypeScript.structuralEqualsNotIncludingPosition = structuralEqualsNotIncludingPosition; - - function structuralEqualsIncludingPosition(ast1, ast2) { - return structuralEquals(ast1, ast2, true); - } - TypeScript.structuralEqualsIncludingPosition = structuralEqualsIncludingPosition; - - function commentStructuralEqualsNotIncludingPosition(ast1, ast2) { - return commentStructuralEquals(ast1, ast2, false); - } - - function commentStructuralEqualsIncludingPosition(ast1, ast2) { - return commentStructuralEquals(ast1, ast2, true); - } - - function structuralEquals(ast1, ast2, includingPosition) { - if (ast1 === ast2) { - return true; - } - - return ast1 !== null && ast2 !== null && ast1.kind() === ast2.kind() && ast1.structuralEquals(ast2, includingPosition); - } - - function commentStructuralEquals(ast1, ast2, includingPosition) { - if (ast1 === ast2) { - return true; - } - - return ast1 !== null && ast2 !== null && ast1.structuralEquals(ast2, includingPosition); - } - - function astArrayStructuralEquals(array1, array2, includingPosition) { - return TypeScript.ArrayUtilities.sequenceEquals(array1, array2, includingPosition ? structuralEqualsIncludingPosition : structuralEqualsNotIncludingPosition); - } - - function commentArrayStructuralEquals(array1, array2, includingPosition) { - return TypeScript.ArrayUtilities.sequenceEquals(array1, array2, includingPosition ? commentStructuralEqualsIncludingPosition : commentStructuralEqualsNotIncludingPosition); - } - - var AST = (function () { - function AST() { - this.parent = null; - this._start = -1; - this._end = -1; - this._trailingTriviaWidth = 0; - this._astID = astID++; - this._preComments = null; - this._postComments = null; - } - AST.prototype.syntaxID = function () { - return this._astID; - }; - - AST.prototype.start = function () { - return this._start; - }; - - AST.prototype.end = function () { - return this._end; - }; - - AST.prototype.trailingTriviaWidth = function () { - return this._trailingTriviaWidth; - }; - - AST.prototype.fileName = function () { - return this.parent.fileName(); - }; - - AST.prototype.kind = function () { - throw TypeScript.Errors.abstract(); - }; - - AST.prototype.preComments = function () { - return this._preComments; - }; - - AST.prototype.postComments = function () { - return this._postComments; - }; - - AST.prototype.setPreComments = function (comments) { - if (comments && comments.length) { - this._preComments = comments; - } else if (this._preComments) { - this._preComments = null; - } - }; - - AST.prototype.setPostComments = function (comments) { - if (comments && comments.length) { - this._postComments = comments; - } else if (this._postComments) { - this._postComments = null; - } - }; - - AST.prototype.width = function () { - return this.end() - this.start(); - }; - - AST.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return commentArrayStructuralEquals(this.preComments(), ast.preComments(), includingPosition) && commentArrayStructuralEquals(this.postComments(), ast.postComments(), includingPosition); - }; - - AST.prototype.isExpression = function () { - return false; - }; - return AST; - })(); - TypeScript.AST = AST; - - var ISyntaxList2 = (function (_super) { - __extends(ISyntaxList2, _super); - function ISyntaxList2(_fileName, members) { - _super.call(this); - this._fileName = _fileName; - this.members = members; - - for (var i = 0, n = members.length; i < n; i++) { - members[i].parent = this; - } - } - ISyntaxList2.prototype.childCount = function () { - return this.members.length; - }; - - ISyntaxList2.prototype.childAt = function (index) { - return this.members[index]; - }; - - ISyntaxList2.prototype.fileName = function () { - return this._fileName; - }; - - ISyntaxList2.prototype.kind = function () { - return 1 /* List */; - }; - - ISyntaxList2.prototype.firstOrDefault = function (func) { - return TypeScript.ArrayUtilities.firstOrDefault(this.members, func); - }; - - ISyntaxList2.prototype.lastOrDefault = function (func) { - return TypeScript.ArrayUtilities.lastOrDefault(this.members, func); - }; - - ISyntaxList2.prototype.any = function (func) { - return TypeScript.ArrayUtilities.any(this.members, func); - }; - - ISyntaxList2.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && astArrayStructuralEquals(this.members, ast.members, includingPosition); - }; - return ISyntaxList2; - })(AST); - TypeScript.ISyntaxList2 = ISyntaxList2; - - var ISeparatedSyntaxList2 = (function (_super) { - __extends(ISeparatedSyntaxList2, _super); - function ISeparatedSyntaxList2(_fileName, members, _separatorCount) { - _super.call(this); - this._fileName = _fileName; - this.members = members; - this._separatorCount = _separatorCount; - - for (var i = 0, n = members.length; i < n; i++) { - members[i].parent = this; - } - } - ISeparatedSyntaxList2.prototype.nonSeparatorCount = function () { - return this.members.length; - }; - - ISeparatedSyntaxList2.prototype.separatorCount = function () { - return this._separatorCount; - }; - - ISeparatedSyntaxList2.prototype.nonSeparatorAt = function (index) { - return this.members[index]; - }; - - ISeparatedSyntaxList2.prototype.nonSeparatorIndexOf = function (ast) { - for (var i = 0, n = this.nonSeparatorCount(); i < n; i++) { - if (this.nonSeparatorAt(i) === ast) { - return i; - } - } - - return -1; - }; - - ISeparatedSyntaxList2.prototype.fileName = function () { - return this._fileName; - }; - - ISeparatedSyntaxList2.prototype.kind = function () { - return 2 /* SeparatedList */; - }; - - ISeparatedSyntaxList2.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && astArrayStructuralEquals(this.members, ast.members, includingPosition); - }; - return ISeparatedSyntaxList2; - })(AST); - TypeScript.ISeparatedSyntaxList2 = ISeparatedSyntaxList2; - - var SourceUnit = (function (_super) { - __extends(SourceUnit, _super); - function SourceUnit(moduleElements, endOfFileTokenLeadingComments, _fileName) { - _super.call(this); - this.moduleElements = moduleElements; - this.endOfFileTokenLeadingComments = endOfFileTokenLeadingComments; - this._fileName = _fileName; - moduleElements && (moduleElements.parent = this); - } - SourceUnit.prototype.fileName = function () { - return this._fileName; - }; - - SourceUnit.prototype.kind = function () { - return 120 /* SourceUnit */; - }; - - SourceUnit.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.moduleElements, ast.moduleElements, includingPosition); - }; - return SourceUnit; - })(AST); - TypeScript.SourceUnit = SourceUnit; - - var Identifier = (function (_super) { - __extends(Identifier, _super); - function Identifier(_text) { - _super.call(this); - this._text = _text; - this._valueText = null; - } - Identifier.prototype.text = function () { - return this._text; - }; - Identifier.prototype.valueText = function () { - if (!this._valueText) { - var text = this._text; - if (text === "__proto__") { - this._valueText = "#__proto__"; - } else { - this._valueText = TypeScript.Syntax.massageEscapes(text); - } - } - - return this._valueText; - }; - - Identifier.prototype.kind = function () { - return 11 /* IdentifierName */; - }; - - Identifier.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && this._text === ast._text; - }; - - Identifier.prototype.isExpression = function () { - return true; - }; - return Identifier; - })(AST); - TypeScript.Identifier = Identifier; - - var LiteralExpression = (function (_super) { - __extends(LiteralExpression, _super); - function LiteralExpression(_nodeType, _text, _valueText) { - _super.call(this); - this._nodeType = _nodeType; - this._text = _text; - this._valueText = _valueText; - } - LiteralExpression.prototype.text = function () { - return this._text; - }; - - LiteralExpression.prototype.valueText = function () { - return this._valueText; - }; - - LiteralExpression.prototype.kind = function () { - return this._nodeType; - }; - - LiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - LiteralExpression.prototype.isExpression = function () { - return true; - }; - return LiteralExpression; - })(AST); - TypeScript.LiteralExpression = LiteralExpression; - - var ThisExpression = (function (_super) { - __extends(ThisExpression, _super); - function ThisExpression(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - ThisExpression.prototype.text = function () { - return this._text; - }; - - ThisExpression.prototype.valueText = function () { - return this._valueText; - }; - - ThisExpression.prototype.kind = function () { - return 35 /* ThisKeyword */; - }; - - ThisExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - ThisExpression.prototype.isExpression = function () { - return true; - }; - return ThisExpression; - })(AST); - TypeScript.ThisExpression = ThisExpression; - - var SuperExpression = (function (_super) { - __extends(SuperExpression, _super); - function SuperExpression(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - SuperExpression.prototype.text = function () { - return this._text; - }; - - SuperExpression.prototype.valueText = function () { - return this._valueText; - }; - - SuperExpression.prototype.kind = function () { - return 50 /* SuperKeyword */; - }; - - SuperExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - SuperExpression.prototype.isExpression = function () { - return true; - }; - return SuperExpression; - })(AST); - TypeScript.SuperExpression = SuperExpression; - - var NumericLiteral = (function (_super) { - __extends(NumericLiteral, _super); - function NumericLiteral(_value, _text, _valueText) { - _super.call(this); - this._value = _value; - this._text = _text; - this._valueText = _valueText; - } - NumericLiteral.prototype.text = function () { - return this._text; - }; - NumericLiteral.prototype.valueText = function () { - return this._valueText; - }; - NumericLiteral.prototype.value = function () { - return this._value; - }; - - NumericLiteral.prototype.kind = function () { - return 13 /* NumericLiteral */; - }; - - NumericLiteral.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && (this._value === ast._value || (isNaN(this._value) && isNaN(ast._value))) && this._text === ast._text; - }; - - NumericLiteral.prototype.isExpression = function () { - return true; - }; - return NumericLiteral; - })(AST); - TypeScript.NumericLiteral = NumericLiteral; - - var RegularExpressionLiteral = (function (_super) { - __extends(RegularExpressionLiteral, _super); - function RegularExpressionLiteral(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - } - RegularExpressionLiteral.prototype.text = function () { - return this._text; - }; - - RegularExpressionLiteral.prototype.valueText = function () { - return this._valueText; - }; - - RegularExpressionLiteral.prototype.kind = function () { - return 12 /* RegularExpressionLiteral */; - }; - - RegularExpressionLiteral.prototype.isExpression = function () { - return true; - }; - return RegularExpressionLiteral; - })(AST); - TypeScript.RegularExpressionLiteral = RegularExpressionLiteral; - - var StringLiteral = (function (_super) { - __extends(StringLiteral, _super); - function StringLiteral(_text, _valueText) { - _super.call(this); - this._text = _text; - this._valueText = _valueText; - this._valueText = _valueText === "__proto__" ? "#__proto__" : _valueText; - } - StringLiteral.prototype.text = function () { - return this._text; - }; - StringLiteral.prototype.valueText = function () { - return this._valueText; - }; - - StringLiteral.prototype.kind = function () { - return 14 /* StringLiteral */; - }; - - StringLiteral.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && this._text === ast._text; - }; - - StringLiteral.prototype.isExpression = function () { - return true; - }; - return StringLiteral; - })(AST); - TypeScript.StringLiteral = StringLiteral; - - var TypeAnnotation = (function (_super) { - __extends(TypeAnnotation, _super); - function TypeAnnotation(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - TypeAnnotation.prototype.kind = function () { - return 244 /* TypeAnnotation */; - }; - return TypeAnnotation; - })(AST); - TypeScript.TypeAnnotation = TypeAnnotation; - - var BuiltInType = (function (_super) { - __extends(BuiltInType, _super); - function BuiltInType(_nodeType, _text, _valueText) { - _super.call(this); - this._nodeType = _nodeType; - this._text = _text; - this._valueText = _valueText; - } - BuiltInType.prototype.text = function () { - return this._text; - }; - - BuiltInType.prototype.valueText = function () { - return this._valueText; - }; - - BuiltInType.prototype.kind = function () { - return this._nodeType; - }; - return BuiltInType; - })(AST); - TypeScript.BuiltInType = BuiltInType; - - var ExternalModuleReference = (function (_super) { - __extends(ExternalModuleReference, _super); - function ExternalModuleReference(stringLiteral) { - _super.call(this); - this.stringLiteral = stringLiteral; - stringLiteral && (stringLiteral.parent = this); - } - ExternalModuleReference.prototype.kind = function () { - return 245 /* ExternalModuleReference */; - }; - return ExternalModuleReference; - })(AST); - TypeScript.ExternalModuleReference = ExternalModuleReference; - - var ModuleNameModuleReference = (function (_super) { - __extends(ModuleNameModuleReference, _super); - function ModuleNameModuleReference(moduleName) { - _super.call(this); - this.moduleName = moduleName; - moduleName && (moduleName.parent = this); - } - ModuleNameModuleReference.prototype.kind = function () { - return 246 /* ModuleNameModuleReference */; - }; - return ModuleNameModuleReference; - })(AST); - TypeScript.ModuleNameModuleReference = ModuleNameModuleReference; - - var ImportDeclaration = (function (_super) { - __extends(ImportDeclaration, _super); - function ImportDeclaration(modifiers, identifier, moduleReference) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.moduleReference = moduleReference; - identifier && (identifier.parent = this); - moduleReference && (moduleReference.parent = this); - } - ImportDeclaration.prototype.kind = function () { - return 133 /* ImportDeclaration */; - }; - - ImportDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.moduleReference, ast.moduleReference, includingPosition); - }; - return ImportDeclaration; - })(AST); - TypeScript.ImportDeclaration = ImportDeclaration; - - var ExportAssignment = (function (_super) { - __extends(ExportAssignment, _super); - function ExportAssignment(identifier) { - _super.call(this); - this.identifier = identifier; - identifier && (identifier.parent = this); - } - ExportAssignment.prototype.kind = function () { - return 134 /* ExportAssignment */; - }; - - ExportAssignment.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition); - }; - return ExportAssignment; - })(AST); - TypeScript.ExportAssignment = ExportAssignment; - - var TypeParameterList = (function (_super) { - __extends(TypeParameterList, _super); - function TypeParameterList(typeParameters) { - _super.call(this); - this.typeParameters = typeParameters; - typeParameters && (typeParameters.parent = this); - } - TypeParameterList.prototype.kind = function () { - return 229 /* TypeParameterList */; - }; - return TypeParameterList; - })(AST); - TypeScript.TypeParameterList = TypeParameterList; - - var ClassDeclaration = (function (_super) { - __extends(ClassDeclaration, _super); - function ClassDeclaration(modifiers, identifier, typeParameterList, heritageClauses, classElements, closeBraceToken) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.classElements = classElements; - this.closeBraceToken = closeBraceToken; - identifier && (identifier.parent = this); - typeParameterList && (typeParameterList.parent = this); - heritageClauses && (heritageClauses.parent = this); - classElements && (classElements.parent = this); - } - ClassDeclaration.prototype.kind = function () { - return 131 /* ClassDeclaration */; - }; - - ClassDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.classElements, ast.classElements, includingPosition) && structuralEquals(this.typeParameterList, ast.typeParameterList, includingPosition) && structuralEquals(this.heritageClauses, ast.heritageClauses, includingPosition); - }; - return ClassDeclaration; - })(AST); - TypeScript.ClassDeclaration = ClassDeclaration; - - var InterfaceDeclaration = (function (_super) { - __extends(InterfaceDeclaration, _super); - function InterfaceDeclaration(modifiers, identifier, typeParameterList, heritageClauses, body) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.typeParameterList = typeParameterList; - this.heritageClauses = heritageClauses; - this.body = body; - identifier && (identifier.parent = this); - typeParameterList && (typeParameterList.parent = this); - body && (body.parent = this); - heritageClauses && (heritageClauses.parent = this); - } - InterfaceDeclaration.prototype.kind = function () { - return 128 /* InterfaceDeclaration */; - }; - - InterfaceDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.body, ast.body, includingPosition) && structuralEquals(this.typeParameterList, ast.typeParameterList, includingPosition) && structuralEquals(this.heritageClauses, ast.heritageClauses, includingPosition); - }; - return InterfaceDeclaration; - })(AST); - TypeScript.InterfaceDeclaration = InterfaceDeclaration; - - var HeritageClause = (function (_super) { - __extends(HeritageClause, _super); - function HeritageClause(_nodeType, typeNames) { - _super.call(this); - this._nodeType = _nodeType; - this.typeNames = typeNames; - typeNames && (typeNames.parent = this); - } - HeritageClause.prototype.kind = function () { - return this._nodeType; - }; - - HeritageClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.typeNames, ast.typeNames, includingPosition); - }; - return HeritageClause; - })(AST); - TypeScript.HeritageClause = HeritageClause; - - var ModuleDeclaration = (function (_super) { - __extends(ModuleDeclaration, _super); - function ModuleDeclaration(modifiers, name, stringLiteral, moduleElements, endingToken) { - _super.call(this); - this.modifiers = modifiers; - this.name = name; - this.stringLiteral = stringLiteral; - this.moduleElements = moduleElements; - this.endingToken = endingToken; - name && (name.parent = this); - stringLiteral && (stringLiteral.parent = this); - moduleElements && (moduleElements.parent = this); - } - ModuleDeclaration.prototype.kind = function () { - return 130 /* ModuleDeclaration */; - }; - - ModuleDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition) && structuralEquals(this.moduleElements, ast.moduleElements, includingPosition); - }; - return ModuleDeclaration; - })(AST); - TypeScript.ModuleDeclaration = ModuleDeclaration; - - var FunctionDeclaration = (function (_super) { - __extends(FunctionDeclaration, _super); - function FunctionDeclaration(modifiers, identifier, callSignature, block) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - identifier && (identifier.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionDeclaration.prototype.kind = function () { - return 129 /* FunctionDeclaration */; - }; - - FunctionDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.block, ast.block, includingPosition) && structuralEquals(this.callSignature, ast.callSignature, includingPosition); - }; - return FunctionDeclaration; - })(AST); - TypeScript.FunctionDeclaration = FunctionDeclaration; - - var VariableStatement = (function (_super) { - __extends(VariableStatement, _super); - function VariableStatement(modifiers, declaration) { - _super.call(this); - this.modifiers = modifiers; - this.declaration = declaration; - declaration && (declaration.parent = this); - } - VariableStatement.prototype.kind = function () { - return 148 /* VariableStatement */; - }; - - VariableStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.declaration, ast.declaration, includingPosition); - }; - return VariableStatement; - })(AST); - TypeScript.VariableStatement = VariableStatement; - - var VariableDeclaration = (function (_super) { - __extends(VariableDeclaration, _super); - function VariableDeclaration(declarators) { - _super.call(this); - this.declarators = declarators; - declarators && (declarators.parent = this); - } - VariableDeclaration.prototype.kind = function () { - return 224 /* VariableDeclaration */; - }; - - VariableDeclaration.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.declarators, ast.declarators, includingPosition); - }; - return VariableDeclaration; - })(AST); - TypeScript.VariableDeclaration = VariableDeclaration; - - var VariableDeclarator = (function (_super) { - __extends(VariableDeclarator, _super); - function VariableDeclarator(propertyName, typeAnnotation, equalsValueClause) { - _super.call(this); - this.propertyName = propertyName; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - propertyName && (propertyName.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - VariableDeclarator.prototype.kind = function () { - return 225 /* VariableDeclarator */; - }; - return VariableDeclarator; - })(AST); - TypeScript.VariableDeclarator = VariableDeclarator; - - var EqualsValueClause = (function (_super) { - __extends(EqualsValueClause, _super); - function EqualsValueClause(value) { - _super.call(this); - this.value = value; - value && (value.parent = this); - } - EqualsValueClause.prototype.kind = function () { - return 232 /* EqualsValueClause */; - }; - return EqualsValueClause; - })(AST); - TypeScript.EqualsValueClause = EqualsValueClause; - - var PrefixUnaryExpression = (function (_super) { - __extends(PrefixUnaryExpression, _super); - function PrefixUnaryExpression(_nodeType, operand) { - _super.call(this); - this._nodeType = _nodeType; - this.operand = operand; - operand && (operand.parent = this); - } - PrefixUnaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - PrefixUnaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.operand, ast.operand, includingPosition); - }; - - PrefixUnaryExpression.prototype.isExpression = function () { - return true; - }; - return PrefixUnaryExpression; - })(AST); - TypeScript.PrefixUnaryExpression = PrefixUnaryExpression; - - var ArrayLiteralExpression = (function (_super) { - __extends(ArrayLiteralExpression, _super); - function ArrayLiteralExpression(expressions) { - _super.call(this); - this.expressions = expressions; - expressions && (expressions.parent = this); - } - ArrayLiteralExpression.prototype.kind = function () { - return 214 /* ArrayLiteralExpression */; - }; - - ArrayLiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expressions, ast.expressions, includingPosition); - }; - - ArrayLiteralExpression.prototype.isExpression = function () { - return true; - }; - return ArrayLiteralExpression; - })(AST); - TypeScript.ArrayLiteralExpression = ArrayLiteralExpression; - - var OmittedExpression = (function (_super) { - __extends(OmittedExpression, _super); - function OmittedExpression() { - _super.apply(this, arguments); - } - OmittedExpression.prototype.kind = function () { - return 223 /* OmittedExpression */; - }; - - OmittedExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - - OmittedExpression.prototype.isExpression = function () { - return true; - }; - return OmittedExpression; - })(AST); - TypeScript.OmittedExpression = OmittedExpression; - - var ParenthesizedExpression = (function (_super) { - __extends(ParenthesizedExpression, _super); - function ParenthesizedExpression(openParenTrailingComments, expression) { - _super.call(this); - this.openParenTrailingComments = openParenTrailingComments; - this.expression = expression; - expression && (expression.parent = this); - } - ParenthesizedExpression.prototype.kind = function () { - return 217 /* ParenthesizedExpression */; - }; - - ParenthesizedExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - ParenthesizedExpression.prototype.isExpression = function () { - return true; - }; - return ParenthesizedExpression; - })(AST); - TypeScript.ParenthesizedExpression = ParenthesizedExpression; - - var SimpleArrowFunctionExpression = (function (_super) { - __extends(SimpleArrowFunctionExpression, _super); - function SimpleArrowFunctionExpression(identifier, block, expression) { - _super.call(this); - this.identifier = identifier; - this.block = block; - this.expression = expression; - identifier && (identifier.parent = this); - block && (block.parent = this); - expression && (expression.parent = this); - } - SimpleArrowFunctionExpression.prototype.kind = function () { - return 219 /* SimpleArrowFunctionExpression */; - }; - - SimpleArrowFunctionExpression.prototype.isExpression = function () { - return true; - }; - return SimpleArrowFunctionExpression; - })(AST); - TypeScript.SimpleArrowFunctionExpression = SimpleArrowFunctionExpression; - - var ParenthesizedArrowFunctionExpression = (function (_super) { - __extends(ParenthesizedArrowFunctionExpression, _super); - function ParenthesizedArrowFunctionExpression(callSignature, block, expression) { - _super.call(this); - this.callSignature = callSignature; - this.block = block; - this.expression = expression; - callSignature && (callSignature.parent = this); - block && (block.parent = this); - expression && (expression.parent = this); - } - ParenthesizedArrowFunctionExpression.prototype.kind = function () { - return 218 /* ParenthesizedArrowFunctionExpression */; - }; - - ParenthesizedArrowFunctionExpression.prototype.isExpression = function () { - return true; - }; - return ParenthesizedArrowFunctionExpression; - })(AST); - TypeScript.ParenthesizedArrowFunctionExpression = ParenthesizedArrowFunctionExpression; - - var QualifiedName = (function (_super) { - __extends(QualifiedName, _super); - function QualifiedName(left, right) { - _super.call(this); - this.left = left; - this.right = right; - left && (left.parent = this); - right && (right.parent = this); - } - QualifiedName.prototype.kind = function () { - return 121 /* QualifiedName */; - }; - - QualifiedName.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.left, ast.left, includingPosition) && structuralEquals(this.right, ast.right, includingPosition); - }; - return QualifiedName; - })(AST); - TypeScript.QualifiedName = QualifiedName; - - var ParameterList = (function (_super) { - __extends(ParameterList, _super); - function ParameterList(openParenTrailingComments, parameters) { - _super.call(this); - this.openParenTrailingComments = openParenTrailingComments; - this.parameters = parameters; - parameters && (parameters.parent = this); - } - ParameterList.prototype.kind = function () { - return 227 /* ParameterList */; - }; - return ParameterList; - })(AST); - TypeScript.ParameterList = ParameterList; - - var ConstructorType = (function (_super) { - __extends(ConstructorType, _super); - function ConstructorType(typeParameterList, parameterList, type) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.type = type; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - type && (type.parent = this); - } - ConstructorType.prototype.kind = function () { - return 125 /* ConstructorType */; - }; - return ConstructorType; - })(AST); - TypeScript.ConstructorType = ConstructorType; - - var FunctionType = (function (_super) { - __extends(FunctionType, _super); - function FunctionType(typeParameterList, parameterList, type) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.type = type; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - type && (type.parent = this); - } - FunctionType.prototype.kind = function () { - return 123 /* FunctionType */; - }; - return FunctionType; - })(AST); - TypeScript.FunctionType = FunctionType; - - var ObjectType = (function (_super) { - __extends(ObjectType, _super); - function ObjectType(typeMembers) { - _super.call(this); - this.typeMembers = typeMembers; - typeMembers && (typeMembers.parent = this); - } - ObjectType.prototype.kind = function () { - return 122 /* ObjectType */; - }; - - ObjectType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.typeMembers, ast.typeMembers, includingPosition); - }; - return ObjectType; - })(AST); - TypeScript.ObjectType = ObjectType; - - var ArrayType = (function (_super) { - __extends(ArrayType, _super); - function ArrayType(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - ArrayType.prototype.kind = function () { - return 124 /* ArrayType */; - }; - - ArrayType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.type, ast.type, includingPosition); - }; - return ArrayType; - })(AST); - TypeScript.ArrayType = ArrayType; - - var TypeArgumentList = (function (_super) { - __extends(TypeArgumentList, _super); - function TypeArgumentList(typeArguments) { - _super.call(this); - this.typeArguments = typeArguments; - typeArguments && (typeArguments.parent = this); - } - TypeArgumentList.prototype.kind = function () { - return 228 /* TypeArgumentList */; - }; - return TypeArgumentList; - })(AST); - TypeScript.TypeArgumentList = TypeArgumentList; - - var GenericType = (function (_super) { - __extends(GenericType, _super); - function GenericType(name, typeArgumentList) { - _super.call(this); - this.name = name; - this.typeArgumentList = typeArgumentList; - name && (name.parent = this); - typeArgumentList && (typeArgumentList.parent = this); - } - GenericType.prototype.kind = function () { - return 126 /* GenericType */; - }; - - GenericType.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition) && structuralEquals(this.typeArgumentList, ast.typeArgumentList, includingPosition); - }; - return GenericType; - })(AST); - TypeScript.GenericType = GenericType; - - var TypeQuery = (function (_super) { - __extends(TypeQuery, _super); - function TypeQuery(name) { - _super.call(this); - this.name = name; - name && (name.parent = this); - } - TypeQuery.prototype.kind = function () { - return 127 /* TypeQuery */; - }; - - TypeQuery.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.name, ast.name, includingPosition); - }; - return TypeQuery; - })(AST); - TypeScript.TypeQuery = TypeQuery; - - var Block = (function (_super) { - __extends(Block, _super); - function Block(statements, closeBraceLeadingComments, closeBraceToken) { - _super.call(this); - this.statements = statements; - this.closeBraceLeadingComments = closeBraceLeadingComments; - this.closeBraceToken = closeBraceToken; - statements && (statements.parent = this); - } - Block.prototype.kind = function () { - return 146 /* Block */; - }; - - Block.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return Block; - })(AST); - TypeScript.Block = Block; - - var Parameter = (function (_super) { - __extends(Parameter, _super); - function Parameter(dotDotDotToken, modifiers, identifier, questionToken, typeAnnotation, equalsValueClause) { - _super.call(this); - this.dotDotDotToken = dotDotDotToken; - this.modifiers = modifiers; - this.identifier = identifier; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - this.equalsValueClause = equalsValueClause; - identifier && (identifier.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - Parameter.prototype.kind = function () { - return 242 /* Parameter */; - }; - return Parameter; - })(AST); - TypeScript.Parameter = Parameter; - - var MemberAccessExpression = (function (_super) { - __extends(MemberAccessExpression, _super); - function MemberAccessExpression(expression, name) { - _super.call(this); - this.expression = expression; - this.name = name; - expression && (expression.parent = this); - name && (name.parent = this); - } - MemberAccessExpression.prototype.kind = function () { - return 212 /* MemberAccessExpression */; - }; - - MemberAccessExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.name, ast.name, includingPosition); - }; - - MemberAccessExpression.prototype.isExpression = function () { - return true; - }; - return MemberAccessExpression; - })(AST); - TypeScript.MemberAccessExpression = MemberAccessExpression; - - var PostfixUnaryExpression = (function (_super) { - __extends(PostfixUnaryExpression, _super); - function PostfixUnaryExpression(_nodeType, operand) { - _super.call(this); - this._nodeType = _nodeType; - this.operand = operand; - operand && (operand.parent = this); - } - PostfixUnaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - PostfixUnaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.operand, ast.operand, includingPosition); - }; - - PostfixUnaryExpression.prototype.isExpression = function () { - return true; - }; - return PostfixUnaryExpression; - })(AST); - TypeScript.PostfixUnaryExpression = PostfixUnaryExpression; - - var ElementAccessExpression = (function (_super) { - __extends(ElementAccessExpression, _super); - function ElementAccessExpression(expression, argumentExpression) { - _super.call(this); - this.expression = expression; - this.argumentExpression = argumentExpression; - expression && (expression.parent = this); - argumentExpression && (argumentExpression.parent = this); - } - ElementAccessExpression.prototype.kind = function () { - return 221 /* ElementAccessExpression */; - }; - - ElementAccessExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentExpression, ast.argumentExpression, includingPosition); - }; - - ElementAccessExpression.prototype.isExpression = function () { - return true; - }; - return ElementAccessExpression; - })(AST); - TypeScript.ElementAccessExpression = ElementAccessExpression; - - var InvocationExpression = (function (_super) { - __extends(InvocationExpression, _super); - function InvocationExpression(expression, argumentList) { - _super.call(this); - this.expression = expression; - this.argumentList = argumentList; - expression && (expression.parent = this); - argumentList && (argumentList.parent = this); - } - InvocationExpression.prototype.kind = function () { - return 213 /* InvocationExpression */; - }; - - InvocationExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentList, ast.argumentList, includingPosition); - }; - - InvocationExpression.prototype.isExpression = function () { - return true; - }; - return InvocationExpression; - })(AST); - TypeScript.InvocationExpression = InvocationExpression; - - var ArgumentList = (function (_super) { - __extends(ArgumentList, _super); - function ArgumentList(typeArgumentList, _arguments, closeParenToken) { - _super.call(this); - this.typeArgumentList = typeArgumentList; - this.closeParenToken = closeParenToken; - this.arguments = _arguments; - - typeArgumentList && (typeArgumentList.parent = this); - _arguments && (_arguments.parent = this); - } - ArgumentList.prototype.kind = function () { - return 226 /* ArgumentList */; - }; - return ArgumentList; - })(AST); - TypeScript.ArgumentList = ArgumentList; - - var BinaryExpression = (function (_super) { - __extends(BinaryExpression, _super); - function BinaryExpression(_nodeType, left, right) { - _super.call(this); - this._nodeType = _nodeType; - this.left = left; - this.right = right; - left && (left.parent = this); - right && (right.parent = this); - } - BinaryExpression.prototype.kind = function () { - return this._nodeType; - }; - - BinaryExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.left, ast.left, includingPosition) && structuralEquals(this.right, ast.right, includingPosition); - }; - - BinaryExpression.prototype.isExpression = function () { - return true; - }; - return BinaryExpression; - })(AST); - TypeScript.BinaryExpression = BinaryExpression; - - var ConditionalExpression = (function (_super) { - __extends(ConditionalExpression, _super); - function ConditionalExpression(condition, whenTrue, whenFalse) { - _super.call(this); - this.condition = condition; - this.whenTrue = whenTrue; - this.whenFalse = whenFalse; - condition && (condition.parent = this); - whenTrue && (whenTrue.parent = this); - whenFalse && (whenFalse.parent = this); - } - ConditionalExpression.prototype.kind = function () { - return 186 /* ConditionalExpression */; - }; - - ConditionalExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.whenTrue, ast.whenTrue, includingPosition) && structuralEquals(this.whenFalse, ast.whenFalse, includingPosition); - }; - - ConditionalExpression.prototype.isExpression = function () { - return true; - }; - return ConditionalExpression; - })(AST); - TypeScript.ConditionalExpression = ConditionalExpression; - - var ConstructSignature = (function (_super) { - __extends(ConstructSignature, _super); - function ConstructSignature(callSignature) { - _super.call(this); - this.callSignature = callSignature; - callSignature && (callSignature.parent = this); - } - ConstructSignature.prototype.kind = function () { - return 143 /* ConstructSignature */; - }; - return ConstructSignature; - })(AST); - TypeScript.ConstructSignature = ConstructSignature; - - var MethodSignature = (function (_super) { - __extends(MethodSignature, _super); - function MethodSignature(propertyName, questionToken, callSignature) { - _super.call(this); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.callSignature = callSignature; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - } - MethodSignature.prototype.kind = function () { - return 145 /* MethodSignature */; - }; - return MethodSignature; - })(AST); - TypeScript.MethodSignature = MethodSignature; - - var IndexSignature = (function (_super) { - __extends(IndexSignature, _super); - function IndexSignature(parameter, typeAnnotation) { - _super.call(this); - this.parameter = parameter; - this.typeAnnotation = typeAnnotation; - parameter && (parameter.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - IndexSignature.prototype.kind = function () { - return 144 /* IndexSignature */; - }; - return IndexSignature; - })(AST); - TypeScript.IndexSignature = IndexSignature; - - var PropertySignature = (function (_super) { - __extends(PropertySignature, _super); - function PropertySignature(propertyName, questionToken, typeAnnotation) { - _super.call(this); - this.propertyName = propertyName; - this.questionToken = questionToken; - this.typeAnnotation = typeAnnotation; - propertyName && (propertyName.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - PropertySignature.prototype.kind = function () { - return 141 /* PropertySignature */; - }; - return PropertySignature; - })(AST); - TypeScript.PropertySignature = PropertySignature; - - var CallSignature = (function (_super) { - __extends(CallSignature, _super); - function CallSignature(typeParameterList, parameterList, typeAnnotation) { - _super.call(this); - this.typeParameterList = typeParameterList; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - typeParameterList && (typeParameterList.parent = this); - parameterList && (parameterList.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - } - CallSignature.prototype.kind = function () { - return 142 /* CallSignature */; - }; - return CallSignature; - })(AST); - TypeScript.CallSignature = CallSignature; - - var TypeParameter = (function (_super) { - __extends(TypeParameter, _super); - function TypeParameter(identifier, constraint) { - _super.call(this); - this.identifier = identifier; - this.constraint = constraint; - identifier && (identifier.parent = this); - constraint && (constraint.parent = this); - } - TypeParameter.prototype.kind = function () { - return 238 /* TypeParameter */; - }; - - TypeParameter.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.constraint, ast.constraint, includingPosition); - }; - return TypeParameter; - })(AST); - TypeScript.TypeParameter = TypeParameter; - - var Constraint = (function (_super) { - __extends(Constraint, _super); - function Constraint(type) { - _super.call(this); - this.type = type; - type && (type.parent = this); - } - Constraint.prototype.kind = function () { - return 239 /* Constraint */; - }; - return Constraint; - })(AST); - TypeScript.Constraint = Constraint; - - var ElseClause = (function (_super) { - __extends(ElseClause, _super); - function ElseClause(statement) { - _super.call(this); - this.statement = statement; - statement && (statement.parent = this); - } - ElseClause.prototype.kind = function () { - return 235 /* ElseClause */; - }; - - ElseClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ElseClause; - })(AST); - TypeScript.ElseClause = ElseClause; - - var IfStatement = (function (_super) { - __extends(IfStatement, _super); - function IfStatement(condition, statement, elseClause) { - _super.call(this); - this.condition = condition; - this.statement = statement; - this.elseClause = elseClause; - condition && (condition.parent = this); - statement && (statement.parent = this); - elseClause && (elseClause.parent = this); - } - IfStatement.prototype.kind = function () { - return 147 /* IfStatement */; - }; - - IfStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition) && structuralEquals(this.elseClause, ast.elseClause, includingPosition); - }; - return IfStatement; - })(AST); - TypeScript.IfStatement = IfStatement; - - var ExpressionStatement = (function (_super) { - __extends(ExpressionStatement, _super); - function ExpressionStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ExpressionStatement.prototype.kind = function () { - return 149 /* ExpressionStatement */; - }; - - ExpressionStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ExpressionStatement; - })(AST); - TypeScript.ExpressionStatement = ExpressionStatement; - - var ConstructorDeclaration = (function (_super) { - __extends(ConstructorDeclaration, _super); - function ConstructorDeclaration(callSignature, block) { - _super.call(this); - this.callSignature = callSignature; - this.block = block; - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - ConstructorDeclaration.prototype.kind = function () { - return 137 /* ConstructorDeclaration */; - }; - return ConstructorDeclaration; - })(AST); - TypeScript.ConstructorDeclaration = ConstructorDeclaration; - - var MemberFunctionDeclaration = (function (_super) { - __extends(MemberFunctionDeclaration, _super); - function MemberFunctionDeclaration(modifiers, propertyName, callSignature, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - MemberFunctionDeclaration.prototype.kind = function () { - return 135 /* MemberFunctionDeclaration */; - }; - return MemberFunctionDeclaration; - })(AST); - TypeScript.MemberFunctionDeclaration = MemberFunctionDeclaration; - - var GetAccessor = (function (_super) { - __extends(GetAccessor, _super); - function GetAccessor(modifiers, propertyName, parameterList, typeAnnotation, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.typeAnnotation = typeAnnotation; - this.block = block; - propertyName && (propertyName.parent = this); - parameterList && (parameterList.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - block && (block.parent = this); - } - GetAccessor.prototype.kind = function () { - return 139 /* GetAccessor */; - }; - return GetAccessor; - })(AST); - TypeScript.GetAccessor = GetAccessor; - - var SetAccessor = (function (_super) { - __extends(SetAccessor, _super); - function SetAccessor(modifiers, propertyName, parameterList, block) { - _super.call(this); - this.modifiers = modifiers; - this.propertyName = propertyName; - this.parameterList = parameterList; - this.block = block; - propertyName && (propertyName.parent = this); - parameterList && (parameterList.parent = this); - block && (block.parent = this); - } - SetAccessor.prototype.kind = function () { - return 140 /* SetAccessor */; - }; - return SetAccessor; - })(AST); - TypeScript.SetAccessor = SetAccessor; - - var MemberVariableDeclaration = (function (_super) { - __extends(MemberVariableDeclaration, _super); - function MemberVariableDeclaration(modifiers, variableDeclarator) { - _super.call(this); - this.modifiers = modifiers; - this.variableDeclarator = variableDeclarator; - variableDeclarator && (variableDeclarator.parent = this); - } - MemberVariableDeclaration.prototype.kind = function () { - return 136 /* MemberVariableDeclaration */; - }; - return MemberVariableDeclaration; - })(AST); - TypeScript.MemberVariableDeclaration = MemberVariableDeclaration; - - var IndexMemberDeclaration = (function (_super) { - __extends(IndexMemberDeclaration, _super); - function IndexMemberDeclaration(indexSignature) { - _super.call(this); - this.indexSignature = indexSignature; - indexSignature && (indexSignature.parent = this); - } - IndexMemberDeclaration.prototype.kind = function () { - return 138 /* IndexMemberDeclaration */; - }; - return IndexMemberDeclaration; - })(AST); - TypeScript.IndexMemberDeclaration = IndexMemberDeclaration; - - var ThrowStatement = (function (_super) { - __extends(ThrowStatement, _super); - function ThrowStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ThrowStatement.prototype.kind = function () { - return 157 /* ThrowStatement */; - }; - - ThrowStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ThrowStatement; - })(AST); - TypeScript.ThrowStatement = ThrowStatement; - - var ReturnStatement = (function (_super) { - __extends(ReturnStatement, _super); - function ReturnStatement(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - ReturnStatement.prototype.kind = function () { - return 150 /* ReturnStatement */; - }; - - ReturnStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return ReturnStatement; - })(AST); - TypeScript.ReturnStatement = ReturnStatement; - - var ObjectCreationExpression = (function (_super) { - __extends(ObjectCreationExpression, _super); - function ObjectCreationExpression(expression, argumentList) { - _super.call(this); - this.expression = expression; - this.argumentList = argumentList; - expression && (expression.parent = this); - argumentList && (argumentList.parent = this); - } - ObjectCreationExpression.prototype.kind = function () { - return 216 /* ObjectCreationExpression */; - }; - - ObjectCreationExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.argumentList, ast.argumentList, includingPosition); - }; - - ObjectCreationExpression.prototype.isExpression = function () { - return true; - }; - return ObjectCreationExpression; - })(AST); - TypeScript.ObjectCreationExpression = ObjectCreationExpression; - - var SwitchStatement = (function (_super) { - __extends(SwitchStatement, _super); - function SwitchStatement(expression, closeParenToken, switchClauses) { - _super.call(this); - this.expression = expression; - this.closeParenToken = closeParenToken; - this.switchClauses = switchClauses; - expression && (expression.parent = this); - switchClauses && (switchClauses.parent = this); - } - SwitchStatement.prototype.kind = function () { - return 151 /* SwitchStatement */; - }; - - SwitchStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.switchClauses, ast.switchClauses, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - return SwitchStatement; - })(AST); - TypeScript.SwitchStatement = SwitchStatement; - - var CaseSwitchClause = (function (_super) { - __extends(CaseSwitchClause, _super); - function CaseSwitchClause(expression, statements) { - _super.call(this); - this.expression = expression; - this.statements = statements; - expression && (expression.parent = this); - statements && (statements.parent = this); - } - CaseSwitchClause.prototype.kind = function () { - return 233 /* CaseSwitchClause */; - }; - - CaseSwitchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return CaseSwitchClause; - })(AST); - TypeScript.CaseSwitchClause = CaseSwitchClause; - - var DefaultSwitchClause = (function (_super) { - __extends(DefaultSwitchClause, _super); - function DefaultSwitchClause(statements) { - _super.call(this); - this.statements = statements; - statements && (statements.parent = this); - } - DefaultSwitchClause.prototype.kind = function () { - return 234 /* DefaultSwitchClause */; - }; - - DefaultSwitchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statements, ast.statements, includingPosition); - }; - return DefaultSwitchClause; - })(AST); - TypeScript.DefaultSwitchClause = DefaultSwitchClause; - - var BreakStatement = (function (_super) { - __extends(BreakStatement, _super); - function BreakStatement(identifier) { - _super.call(this); - this.identifier = identifier; - } - BreakStatement.prototype.kind = function () { - return 152 /* BreakStatement */; - }; - - BreakStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return BreakStatement; - })(AST); - TypeScript.BreakStatement = BreakStatement; - - var ContinueStatement = (function (_super) { - __extends(ContinueStatement, _super); - function ContinueStatement(identifier) { - _super.call(this); - this.identifier = identifier; - } - ContinueStatement.prototype.kind = function () { - return 153 /* ContinueStatement */; - }; - - ContinueStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return ContinueStatement; - })(AST); - TypeScript.ContinueStatement = ContinueStatement; - - var ForStatement = (function (_super) { - __extends(ForStatement, _super); - function ForStatement(variableDeclaration, initializer, condition, incrementor, statement) { - _super.call(this); - this.variableDeclaration = variableDeclaration; - this.initializer = initializer; - this.condition = condition; - this.incrementor = incrementor; - this.statement = statement; - variableDeclaration && (variableDeclaration.parent = this); - initializer && (initializer.parent = this); - condition && (condition.parent = this); - incrementor && (incrementor.parent = this); - statement && (statement.parent = this); - } - ForStatement.prototype.kind = function () { - return 154 /* ForStatement */; - }; - - ForStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.initializer, ast.initializer, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.incrementor, ast.incrementor, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ForStatement; - })(AST); - TypeScript.ForStatement = ForStatement; - - var ForInStatement = (function (_super) { - __extends(ForInStatement, _super); - function ForInStatement(variableDeclaration, left, expression, statement) { - _super.call(this); - this.variableDeclaration = variableDeclaration; - this.left = left; - this.expression = expression; - this.statement = statement; - variableDeclaration && (variableDeclaration.parent = this); - left && (left.parent = this); - expression && (expression.parent = this); - statement && (statement.parent = this); - } - ForInStatement.prototype.kind = function () { - return 155 /* ForInStatement */; - }; - - ForInStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.variableDeclaration, ast.variableDeclaration, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return ForInStatement; - })(AST); - TypeScript.ForInStatement = ForInStatement; - - var WhileStatement = (function (_super) { - __extends(WhileStatement, _super); - function WhileStatement(condition, statement) { - _super.call(this); - this.condition = condition; - this.statement = statement; - condition && (condition.parent = this); - statement && (statement.parent = this); - } - WhileStatement.prototype.kind = function () { - return 158 /* WhileStatement */; - }; - - WhileStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return WhileStatement; - })(AST); - TypeScript.WhileStatement = WhileStatement; - - var WithStatement = (function (_super) { - __extends(WithStatement, _super); - function WithStatement(condition, statement) { - _super.call(this); - this.condition = condition; - this.statement = statement; - condition && (condition.parent = this); - statement && (statement.parent = this); - } - WithStatement.prototype.kind = function () { - return 163 /* WithStatement */; - }; - - WithStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return WithStatement; - })(AST); - TypeScript.WithStatement = WithStatement; - - var EnumDeclaration = (function (_super) { - __extends(EnumDeclaration, _super); - function EnumDeclaration(modifiers, identifier, enumElements) { - _super.call(this); - this.modifiers = modifiers; - this.identifier = identifier; - this.enumElements = enumElements; - identifier && (identifier.parent = this); - enumElements && (enumElements.parent = this); - } - EnumDeclaration.prototype.kind = function () { - return 132 /* EnumDeclaration */; - }; - return EnumDeclaration; - })(AST); - TypeScript.EnumDeclaration = EnumDeclaration; - - var EnumElement = (function (_super) { - __extends(EnumElement, _super); - function EnumElement(propertyName, equalsValueClause) { - _super.call(this); - this.propertyName = propertyName; - this.equalsValueClause = equalsValueClause; - propertyName && (propertyName.parent = this); - equalsValueClause && (equalsValueClause.parent = this); - } - EnumElement.prototype.kind = function () { - return 243 /* EnumElement */; - }; - return EnumElement; - })(AST); - TypeScript.EnumElement = EnumElement; - - var CastExpression = (function (_super) { - __extends(CastExpression, _super); - function CastExpression(type, expression) { - _super.call(this); - this.type = type; - this.expression = expression; - type && (type.parent = this); - expression && (expression.parent = this); - } - CastExpression.prototype.kind = function () { - return 220 /* CastExpression */; - }; - - CastExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.type, ast.type, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - CastExpression.prototype.isExpression = function () { - return true; - }; - return CastExpression; - })(AST); - TypeScript.CastExpression = CastExpression; - - var ObjectLiteralExpression = (function (_super) { - __extends(ObjectLiteralExpression, _super); - function ObjectLiteralExpression(propertyAssignments) { - _super.call(this); - this.propertyAssignments = propertyAssignments; - propertyAssignments && (propertyAssignments.parent = this); - } - ObjectLiteralExpression.prototype.kind = function () { - return 215 /* ObjectLiteralExpression */; - }; - - ObjectLiteralExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.propertyAssignments, ast.propertyAssignments, includingPosition); - }; - - ObjectLiteralExpression.prototype.isExpression = function () { - return true; - }; - return ObjectLiteralExpression; - })(AST); - TypeScript.ObjectLiteralExpression = ObjectLiteralExpression; - - var SimplePropertyAssignment = (function (_super) { - __extends(SimplePropertyAssignment, _super); - function SimplePropertyAssignment(propertyName, expression) { - _super.call(this); - this.propertyName = propertyName; - this.expression = expression; - propertyName && (propertyName.parent = this); - expression && (expression.parent = this); - } - SimplePropertyAssignment.prototype.kind = function () { - return 240 /* SimplePropertyAssignment */; - }; - return SimplePropertyAssignment; - })(AST); - TypeScript.SimplePropertyAssignment = SimplePropertyAssignment; - - var FunctionPropertyAssignment = (function (_super) { - __extends(FunctionPropertyAssignment, _super); - function FunctionPropertyAssignment(propertyName, callSignature, block) { - _super.call(this); - this.propertyName = propertyName; - this.callSignature = callSignature; - this.block = block; - propertyName && (propertyName.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionPropertyAssignment.prototype.kind = function () { - return 241 /* FunctionPropertyAssignment */; - }; - return FunctionPropertyAssignment; - })(AST); - TypeScript.FunctionPropertyAssignment = FunctionPropertyAssignment; - - var FunctionExpression = (function (_super) { - __extends(FunctionExpression, _super); - function FunctionExpression(identifier, callSignature, block) { - _super.call(this); - this.identifier = identifier; - this.callSignature = callSignature; - this.block = block; - identifier && (identifier.parent = this); - callSignature && (callSignature.parent = this); - block && (block.parent = this); - } - FunctionExpression.prototype.kind = function () { - return 222 /* FunctionExpression */; - }; - - FunctionExpression.prototype.isExpression = function () { - return true; - }; - return FunctionExpression; - })(AST); - TypeScript.FunctionExpression = FunctionExpression; - - var EmptyStatement = (function (_super) { - __extends(EmptyStatement, _super); - function EmptyStatement() { - _super.apply(this, arguments); - } - EmptyStatement.prototype.kind = function () { - return 156 /* EmptyStatement */; - }; - - EmptyStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition); - }; - return EmptyStatement; - })(AST); - TypeScript.EmptyStatement = EmptyStatement; - - var TryStatement = (function (_super) { - __extends(TryStatement, _super); - function TryStatement(block, catchClause, finallyClause) { - _super.call(this); - this.block = block; - this.catchClause = catchClause; - this.finallyClause = finallyClause; - block && (block.parent = this); - catchClause && (catchClause.parent = this); - finallyClause && (finallyClause.parent = this); - } - TryStatement.prototype.kind = function () { - return 159 /* TryStatement */; - }; - - TryStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.block, ast.block, includingPosition) && structuralEquals(this.catchClause, ast.catchClause, includingPosition) && structuralEquals(this.finallyClause, ast.finallyClause, includingPosition); - }; - return TryStatement; - })(AST); - TypeScript.TryStatement = TryStatement; - - var CatchClause = (function (_super) { - __extends(CatchClause, _super); - function CatchClause(identifier, typeAnnotation, block) { - _super.call(this); - this.identifier = identifier; - this.typeAnnotation = typeAnnotation; - this.block = block; - identifier && (identifier.parent = this); - typeAnnotation && (typeAnnotation.parent = this); - block && (block.parent = this); - } - CatchClause.prototype.kind = function () { - return 236 /* CatchClause */; - }; - - CatchClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.typeAnnotation, ast.typeAnnotation, includingPosition) && structuralEquals(this.block, ast.block, includingPosition); - }; - return CatchClause; - })(AST); - TypeScript.CatchClause = CatchClause; - - var FinallyClause = (function (_super) { - __extends(FinallyClause, _super); - function FinallyClause(block) { - _super.call(this); - this.block = block; - block && (block.parent = this); - } - FinallyClause.prototype.kind = function () { - return 237 /* FinallyClause */; - }; - - FinallyClause.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.block, ast.block, includingPosition); - }; - return FinallyClause; - })(AST); - TypeScript.FinallyClause = FinallyClause; - - var LabeledStatement = (function (_super) { - __extends(LabeledStatement, _super); - function LabeledStatement(identifier, statement) { - _super.call(this); - this.identifier = identifier; - this.statement = statement; - identifier && (identifier.parent = this); - statement && (statement.parent = this); - } - LabeledStatement.prototype.kind = function () { - return 160 /* LabeledStatement */; - }; - - LabeledStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.identifier, ast.identifier, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition); - }; - return LabeledStatement; - })(AST); - TypeScript.LabeledStatement = LabeledStatement; - - var DoStatement = (function (_super) { - __extends(DoStatement, _super); - function DoStatement(statement, whileKeyword, condition) { - _super.call(this); - this.statement = statement; - this.whileKeyword = whileKeyword; - this.condition = condition; - statement && (statement.parent = this); - condition && (condition.parent = this); - } - DoStatement.prototype.kind = function () { - return 161 /* DoStatement */; - }; - - DoStatement.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.statement, ast.statement, includingPosition) && structuralEquals(this.condition, ast.condition, includingPosition); - }; - return DoStatement; - })(AST); - TypeScript.DoStatement = DoStatement; - - var TypeOfExpression = (function (_super) { - __extends(TypeOfExpression, _super); - function TypeOfExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - TypeOfExpression.prototype.kind = function () { - return 171 /* TypeOfExpression */; - }; - - TypeOfExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - TypeOfExpression.prototype.isExpression = function () { - return true; - }; - return TypeOfExpression; - })(AST); - TypeScript.TypeOfExpression = TypeOfExpression; - - var DeleteExpression = (function (_super) { - __extends(DeleteExpression, _super); - function DeleteExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - DeleteExpression.prototype.kind = function () { - return 170 /* DeleteExpression */; - }; - - DeleteExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - DeleteExpression.prototype.isExpression = function () { - return true; - }; - return DeleteExpression; - })(AST); - TypeScript.DeleteExpression = DeleteExpression; - - var VoidExpression = (function (_super) { - __extends(VoidExpression, _super); - function VoidExpression(expression) { - _super.call(this); - this.expression = expression; - expression && (expression.parent = this); - } - VoidExpression.prototype.kind = function () { - return 172 /* VoidExpression */; - }; - - VoidExpression.prototype.structuralEquals = function (ast, includingPosition) { - return _super.prototype.structuralEquals.call(this, ast, includingPosition) && structuralEquals(this.expression, ast.expression, includingPosition); - }; - - VoidExpression.prototype.isExpression = function () { - return true; - }; - return VoidExpression; - })(AST); - TypeScript.VoidExpression = VoidExpression; - - var DebuggerStatement = (function (_super) { - __extends(DebuggerStatement, _super); - function DebuggerStatement() { - _super.apply(this, arguments); - } - DebuggerStatement.prototype.kind = function () { - return 162 /* DebuggerStatement */; - }; - return DebuggerStatement; - })(AST); - TypeScript.DebuggerStatement = DebuggerStatement; - - var Comment = (function () { - function Comment(_trivia, endsLine, _start, _end) { - this._trivia = _trivia; - this.endsLine = endsLine; - this._start = _start; - this._end = _end; - } - Comment.prototype.start = function () { - return this._start; - }; - - Comment.prototype.end = function () { - return this._end; - }; - - Comment.prototype.fullText = function () { - return this._trivia.fullText(); - }; - - Comment.prototype.kind = function () { - return this._trivia.kind(); - }; - - Comment.prototype.structuralEquals = function (ast, includingPosition) { - if (includingPosition) { - if (this.start() !== ast.start() || this.end() !== ast.end()) { - return false; - } - } - - return this._trivia.fullText() === ast._trivia.fullText() && this.endsLine === ast.endsLine; - }; - return Comment; - })(); - TypeScript.Comment = Comment; -})(TypeScript || (TypeScript = {})); diff --git a/node_modules/grunt-typescript/node_modules/typescript/package.json b/node_modules/grunt-typescript/node_modules/typescript/package.json deleted file mode 100644 index 483cd0b..0000000 --- a/node_modules/grunt-typescript/node_modules/typescript/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "typescript", - "author": { - "name": "Microsoft Corp." - }, - "homepage": "http://typescriptlang.org/", - "version": "0.9.7", - "licenses": [ - { - "type": "Apache License 2.0", - "url": "http://typescript.codeplex.com/license" - } - ], - "description": "TypeScript is a language for application scale JavaScript development", - "keywords": [ - "TypeScript", - "Microsoft", - "compiler", - "language", - "javascript" - ], - "bugs": { - "url": "http://typescript.codeplex.com/workitem/list/basic" - }, - "repository": { - "type": "git", - "url": "https://git01.codeplex.com/typescript" - }, - "preferGlobal": true, - "main": "./bin/typescript.js", - "bin": { - "tsc": "./bin/tsc" - }, - "engines": { - "node": ">=0.8.0" - }, - "devDependencies": { - "jake": "latest" - }, - "readme": "# TypeScript\r\n\r\nScalable JavaScript development with types, classes and modules.\r\n\r\n## Install\r\n\r\n npm install -g typescript\r\n\r\n## Usage\r\n\r\n tsc hello.ts\r\n \r\n\r\n## Build\r\n\r\n1. Install Node if you haven't already (http://nodejs.org/)\r\n2. Install Jake, the tool we use to build our compiler (https://github.com/mde/jake). To do this, run \"npm install -g jake\".\r\n3. To use jake, run one of the following commands: \r\n - jake local - This builds the compiler. The output is in built/local in the public directory \r\n - jake clean - deletes the build compiler \r\n - jake LKG - This replaces the LKG (last known good) version of the compiler with the built one.\r\n - This is a bootstrapping step to be executed whenever the built compiler reaches a stable state.\r\n - jake tests - This builds the test infrastructure, using the built compiler. \r\n - jake runtests - This runs the tests, using the built compiler and built test infrastructure. \r\n - You can also override the host or specify a test for this command. Use host= or tests=. \r\n - jake baseline-accept - This replaces the baseline test results with the results obtained from jake runtests. \r\n - jake -T lists the above commands. \r\n", - "readmeFilename": "README.txt", - "_id": "typescript@0.9.7", - "_from": "typescript@0.9.7" -} diff --git a/node_modules/grunt-typescript/package.json b/node_modules/grunt-typescript/package.json deleted file mode 100644 index 4a101cd..0000000 --- a/node_modules/grunt-typescript/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "author": { - "name": "kazuhide maruyama" - }, - "name": "grunt-typescript", - "description": "compile typescript to javascript", - "version": "0.2.8", - "homepage": "https://github.com/k-maru/grunt-typescript", - "repository": { - "type": "git", - "url": "git@github.com:k-maru/grunt-typescript.git" - }, - "bugs": { - "url": "https://github.com/k-maru/grunt-typescript/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/k-maru/grunt-typescript/blob/master/LICENSE" - } - ], - "main": "Gruntfile.js", - "scripts": { - "start": "grunt build", - "test": "grunt test" - }, - "engines": { - "node": ">= 0.8.0" - }, - "dependencies": { - "typescript": "0.9.7" - }, - "peerDependencies": { - "grunt": "~0.4.2" - }, - "devDependencies": { - "grunt": "~0.4.2", - "typescript": "0.9.7", - "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-nodeunit": "~0.2.2", - "grunt-exec": "~0.4.2", - "q": "~1.0.0" - }, - "optionalDependencies": {}, - "keywords": [ - "gruntplugin", - "typescript" - ], - "readme": "grunt-typescript [![Build Status](https://travis-ci.org/k-maru/grunt-typescript.png?branch=master)](https://travis-ci.org/k-maru/grunt-typescript)\r\n================\r\n\r\nCompile TypeScript\r\n\r\n## Documentation\r\nYou'll need to install `grunt-typescript` first:\r\n\r\n npm install grunt-typescript --save-dev\r\n\r\nThen modify your `Gruntfile.js` file by adding the following line:\r\n\r\n grunt.loadNpmTasks('grunt-typescript');\r\n\r\nThen add some configuration for the plugin like so:\r\n\r\n grunt.initConfig({\r\n ...\r\n typescript: {\r\n base: {\r\n src: ['path/to/typescript/files/**/*.ts'],\r\n dest: 'where/you/want/your/js/files',\r\n options: {\r\n module: 'amd', //or commonjs\r\n target: 'es5', //or es3\r\n base_path: 'path/to/typescript/files',\r\n sourcemap: true,\r\n declaration: true\r\n }\r\n }\r\n },\r\n ...\r\n });\r\n \r\nIf you want to create a js file that is a concatenation of all the ts file (like -out option from tsc), \r\nyou should specify the name of the file with the '.js' extension to dest option.\r\n\r\n grunt.initConfig({\r\n ...\r\n typescript: {\r\n base: {\r\n src: ['path/to/typescript/files/**/*.ts'],\r\n dest: 'where/you/want/your/js/file.js',\r\n options: {\r\n module: 'amd', //or commonjs\r\n }\r\n }\r\n },\r\n ...\r\n });\r\n\r\n##Options\r\n\r\n###nolib `boolean`\r\nDo not include a default lib.d.ts with global declarations\r\n\r\n###target `string`\r\nSpecify ECMAScript target version: \"ES3\" (default) or \"ES5\"\r\n\r\n###module `string`\r\nSpecify module code generation: \"commonjs\" (default) or \"amd\"\r\n\r\n###sourcemap `boolean`\r\nGenerates corresponding .map files\r\n\r\n###declaration `boolean`\r\nGenerates corresponding .d.ts file\r\n\r\n###comments `boolean`\r\nEmit comments to output\r\n\r\n###noImplicitAny `boolean`\r\nWarn on expressions and declarations with an implied 'any' type.\r\n\r\n##Original Options\r\n\r\n###newLine `string`\r\nSpecify newline code: \"auto\" (default) or \"crlf\" or \"lf\". This options is experimental.\r\n\r\n###indentStep `number`\r\nSpecify space indent count for code generation: This value will be disregarded if the useTabIndent option is specified. This options is experimental.\r\n\r\n###useTabIndent `boolean`\r\nSpecify tab indent for code generation: false (default) or true. This options is experimental.\r\n\r\n###ignoreTypeCheck `boolean`\r\nDefault value is true. This options is experimental.\r\n\r\n###disallowAsi `boolean`\r\nDo not allow auto semicolon insertion. This options is experimental.\r\n\r\n###base_path `string`\r\n\r\n※I'm sorry for poor English\r\n", - "readmeFilename": "README.md", - "_id": "grunt-typescript@0.2.8", - "_from": "grunt-typescript@~0.2.7" -} diff --git a/node_modules/grunt-typescript/tasks/typescript.js b/node_modules/grunt-typescript/tasks/typescript.js deleted file mode 100644 index 117dd2b..0000000 --- a/node_modules/grunt-typescript/tasks/typescript.js +++ /dev/null @@ -1,766 +0,0 @@ -/// -/// -var GruntTs; -(function (GruntTs) { - var _fs = require('fs'); - var _path = require('path'); - var _os = require('os'); - - function writeError(str) { - console.log('>> '.red + str.trim().replace(/\n/g, '\n>> '.red)); - } - function writeInfo(str) { - console.log('>> '.cyan + str.trim().replace(/\n/g, '\n>> '.cyan)); - } - - function normalizePath(path) { - if (Object.prototype.toString.call(path) === "[object String]") { - return path.replace(/\\/g, "/"); - } - return path; - } - - var _currentPath = normalizePath(_path.resolve(".")); - - function currentPath() { - return _currentPath; - } - - function readFile(file, codepage) { - if (codepage !== null) { - throw new Error(TypeScript.getDiagnosticMessage(TypeScript.DiagnosticCode.codepage_option_not_supported_on_current_platform, null)); - } - - var buffer = _fs.readFileSync(file); - switch (buffer[0]) { - case 0xFE: - if (buffer[1] === 0xFF) { - // utf16-be. Reading the buffer as big endian is not supported, so convert it to - // Little Endian first - var i = 0; - while ((i + 1) < buffer.length) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - i += 2; - } - return new TypeScript.FileInformation(buffer.toString("ucs2", 2), 2 /* Utf16BigEndian */); - } - break; - case 0xFF: - if (buffer[1] === 0xFE) { - // utf16-le - return new TypeScript.FileInformation(buffer.toString("ucs2", 2), 3 /* Utf16LittleEndian */); - } - break; - case 0xEF: - if (buffer[1] === 0xBB) { - // utf-8 - return new TypeScript.FileInformation(buffer.toString("utf8", 3), 1 /* Utf8 */); - } - } - - // Default behaviour - return new TypeScript.FileInformation(buffer.toString("utf8", 0), 0 /* None */); - } - - function writeFile(path, contents, writeByteOrderMark) { - function mkdirRecursiveSync(path) { - var stats = _fs.statSync(path); - if (stats.isFile()) { - throw "\"" + path + "\" exists but isn't a directory."; - } else if (stats.isDirectory()) { - return; - } else { - mkdirRecursiveSync(_path.dirname(path)); - _fs.mkdirSync(path, 509); - } - } - mkdirRecursiveSync(_path.dirname(path)); - - if (writeByteOrderMark) { - contents = '\uFEFF' + contents; - } - - var chunkLength = 4 * 1024; - var fileDescriptor = _fs.openSync(path, "w"); - try { - for (var index = 0; index < contents.length; index += chunkLength) { - var buffer = new Buffer(contents.substr(index, chunkLength), "utf8"); - - _fs.writeSync(fileDescriptor, buffer, 0, buffer.length, null); - } - } finally { - _fs.closeSync(fileDescriptor); - } - } - - var GruntIO = (function () { - function GruntIO(grunt) { - this.grunt = grunt; - this.stderr = { - Write: function (str) { - return writeError(str); - }, - WriteLine: function (str) { - return writeError(str); - }, - Close: function () { - } - }; - this.stdout = { - Write: function (str) { - return writeInfo(str); - }, - WriteLine: function (str) { - return writeInfo(str); - }, - Close: function () { - } - }; - this.arguments = process.argv.slice(2); - //original - this.newLine = _os.EOL; - } - GruntIO.prototype.readFile = function (file, codepage) { - var result; - try { - this.grunt.verbose.write("Reading " + file + "..."); - result = readFile(file, codepage); - this.grunt.verbose.writeln("OK".green); - return result; - } catch (e) { - this.grunt.verbose.writeln(""); - this.grunt.verbose.fail("Can't read file. " + e.message); - throw e; - } - }; - - GruntIO.prototype.writeFile = function (path, contents, writeByteOrderMark) { - try { - this.grunt.verbose.write("Writing " + path + "..."); - writeFile(path, contents, writeByteOrderMark); - this.grunt.verbose.writeln("OK".green); - } catch (e) { - this.grunt.verbose.writeln(""); - this.grunt.verbose.fail("Can't write file. " + e.message); - throw e; - } - }; - - GruntIO.prototype.deleteFile = function (path) { - try { - this.grunt.verbose.write("Deleting " + path + "..."); - _fs.unlinkSync(path); - this.grunt.verbose.writeln("OK".green); - } catch (e) { - this.grunt.verbose.writeln(""); - this.grunt.verbose.fail("Can't delete file. " + e.message); - throw e; - } - }; - - GruntIO.prototype.fileExists = function (path) { - return _fs.existsSync(path); - }; - - GruntIO.prototype.dir = function (path, spec, options) { - options = options || {}; - - function filesInFolder(folder) { - var paths = []; - - try { - var files = _fs.readdirSync(folder); - for (var i = 0; i < files.length; i++) { - var stat = _fs.statSync(folder + "/" + files[i]); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(folder + "/" + files[i])); - } else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(folder + "/" + files[i]); - } - } - } catch (err) { - } - - return paths; - } - - return filesInFolder(path); - }; - - GruntIO.prototype.createDirectory = function (path) { - if (!this.directoryExists(path)) { - _fs.mkdirSync(path); - } - }; - - GruntIO.prototype.directoryExists = function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }; - - GruntIO.prototype.resolvePath = function (path) { - return _path.resolve(path); - }; - - GruntIO.prototype.dirName = function (path) { - var dirPath = _path.dirname(path); - - // Node will just continue to repeat the root path, rather than return null - if (dirPath === path) { - dirPath = null; - } - - return dirPath; - }; - - GruntIO.prototype.findFile = function (rootPath, partialFilePath) { - var path = rootPath + "/" + partialFilePath; - - while (true) { - if (_fs.existsSync(path)) { - return { fileInformation: this.readFile(path, null), path: path }; - } else { - var parentPath = _path.resolve(rootPath, ".."); - - // Node will just continue to repeat the root path, rather than return null - if (rootPath === parentPath) { - return null; - } else { - rootPath = parentPath; - path = _path.resolve(rootPath, partialFilePath); - } - } - } - }; - - GruntIO.prototype.print = function (str) { - this.stdout.Write(str); - }; - - GruntIO.prototype.printLine = function (str) { - this.stdout.WriteLine(str); - }; - - GruntIO.prototype.watchFile = function (fileName, callback) { - return null; - }; - - GruntIO.prototype.run = function (source, fileName) { - return; - }; - - GruntIO.prototype.getExecutingFilePath = function () { - return null; - }; - - GruntIO.prototype.quit = function (exitCode) { - return; - }; - - //original method - GruntIO.prototype.currentPath = function () { - return currentPath(); - }; - - //original method - GruntIO.prototype.combine = function (left, right) { - return normalizePath(_path.join(left, right)); - }; - - //original - GruntIO.prototype.relativePath = function (from, to) { - return normalizePath(_path.relative(from, to)); - }; - - //original - GruntIO.prototype.resolveMulti = function () { - var paths = []; - for (var _i = 0; _i < (arguments.length - 0); _i++) { - paths[_i] = arguments[_i + 0]; - } - return normalizePath(_path.resolve.apply(_path, paths)); - }; - - GruntIO.prototype.normalizePath = function (path) { - return normalizePath(path); - }; - return GruntIO; - })(); - GruntTs.GruntIO = GruntIO; -})(GruntTs || (GruntTs = {})); -/// -/// -/// -var GruntTs; -(function (GruntTs) { - var _path = require("path"); - - function createCompilationSettings(options, dest, ioHost) { - var settings = new TypeScript.CompilationSettings(), temp; - - if (options.fullSourceMapPath) { - ioHost.printLine("fullSourceMapPath not supported."); - } - if (options.allowbool) { - ioHost.printLine("allowbool is obsolete."); - } - if (options.allowimportmodule) { - ioHost.printLine("allowimportmodule is obsolete."); - } - - if (options.outputOne) { - dest = _path.resolve(ioHost.currentPath(), dest); - settings.outFileOption = dest; - } - if (options.sourcemap) { - settings.mapSourceFiles = true; - } - if (options.declaration) { - settings.generateDeclarationFiles = true; - } - if (options.comments) { - settings.removeComments = false; - } else { - settings.removeComments = true; - } - - //default - settings.codeGenTarget = 0 /* EcmaScript3 */; - if (options.target) { - temp = options.target.toLowerCase(); - if (temp === 'es3') { - settings.codeGenTarget = 0 /* EcmaScript3 */; - } else if (temp == 'es5') { - settings.codeGenTarget = 1 /* EcmaScript5 */; - } - } - - //default - settings.moduleGenTarget = 1 /* Synchronous */; - if (options.module) { - temp = options.module.toLowerCase(); - if (temp === 'commonjs' || temp === 'node') { - settings.moduleGenTarget = 1 /* Synchronous */; - } else if (temp === 'amd') { - settings.moduleGenTarget = 2 /* Asynchronous */; - } - } - if (options.noImplicitAny) { - settings.noImplicitAny = true; - } - - if (options.nolib) { - settings.noLib = true; - } - - //test - if (options.disallowAsi) { - settings.allowAutomaticSemicolonInsertion = false; - } - - return TypeScript.ImmutableCompilationSettings.fromCompilationSettings(settings); - } - GruntTs.createCompilationSettings = createCompilationSettings; -})(GruntTs || (GruntTs = {})); -/// -/// -/// -/// -var GruntTs; -(function (GruntTs) { - var SourceFile = (function () { - function SourceFile(scriptSnapshot, byteOrderMark) { - this.scriptSnapshot = scriptSnapshot; - this.byteOrderMark = byteOrderMark; - } - return SourceFile; - })(); - - var CompilerPhase; - (function (CompilerPhase) { - CompilerPhase[CompilerPhase["Syntax"] = 0] = "Syntax"; - CompilerPhase[CompilerPhase["Semantics"] = 1] = "Semantics"; - CompilerPhase[CompilerPhase["EmitOptionsValidation"] = 2] = "EmitOptionsValidation"; - CompilerPhase[CompilerPhase["Emit"] = 3] = "Emit"; - CompilerPhase[CompilerPhase["DeclarationEmit"] = 4] = "DeclarationEmit"; - })(CompilerPhase || (CompilerPhase = {})); - - var Compiler = (function () { - function Compiler(grunt, tscBinPath, ioHost) { - this.grunt = grunt; - this.tscBinPath = tscBinPath; - this.ioHost = ioHost; - this.fileNameToSourceFile = new TypeScript.StringHashTable(); - this.hasErrors = false; - this.resolvedFiles = []; - this.logger = null; - this.outputFiles = []; - this.fileExistsCache = TypeScript.createIntrinsicsObject(); - this.resolvePathCache = TypeScript.createIntrinsicsObject(); - } - Compiler.prototype.exec = function (files, dest, options) { - this.destinationPath = dest; - this.options = options; - this.compilationSettings = GruntTs.createCompilationSettings(options, dest, this.ioHost); - this.inputFiles = files; - this.logger = new TypeScript.NullLogger(); - - try { - this.resolve(); - this.compile(); - } catch (e) { - return false; - } - - this.writeResult(); - - return true; - }; - - Compiler.prototype.resolve = function () { - var _this = this; - var resolvedFiles = []; - var resolutionResults = TypeScript.ReferenceResolver.resolve(this.inputFiles, this, this.compilationSettings.useCaseSensitiveFileResolution()); - var includeDefaultLibrary = !this.compilationSettings.noLib() && !resolutionResults.seenNoDefaultLibTag; - - resolvedFiles = resolutionResults.resolvedFiles; - - resolutionResults.diagnostics.forEach(function (d) { - return _this.addDiagnostic(d); - }); - - if (includeDefaultLibrary) { - var libraryResolvedFile = { - path: this.ioHost.combine(this.tscBinPath, "lib.d.ts"), - referencedFiles: [], - importedFiles: [] - }; - - // Prepend the library to the resolved list - resolvedFiles = [libraryResolvedFile].concat(resolvedFiles); - } - - this.resolvedFiles = resolvedFiles; - }; - - Compiler.prototype.compile = function () { - var _this = this; - var compiler = new TypeScript.TypeScriptCompiler(this.logger, this.compilationSettings); - - this.resolvedFiles.forEach(function (resolvedFile) { - var sourceFile = _this.getSourceFile(resolvedFile.path); - compiler.addFile(resolvedFile.path, sourceFile.scriptSnapshot, sourceFile.byteOrderMark, /*version:*/ 0, false, resolvedFile.referencedFiles); - }); - - for (var it = compiler.compile(function (path) { - return _this.resolvePath(path); - }); it.moveNext();) { - var result = it.current(), hasError = false, phase = it.compilerPhase; - - result.diagnostics.forEach(function (d) { - var info = d.info(); - if (info.category === 1 /* Error */) { - hasError = true; - } - _this.addDiagnostic(d); - }); - if (hasError && phase === 0 /* Syntax */) { - throw new Error(); - } - if (hasError && !this.options.ignoreTypeCheck) { - throw new Error(); - } - - if (!this.tryWriteOutputFiles(result.outputFiles)) { - throw new Error(); - } - } - }; - - Compiler.prototype.writeResult = function () { - var result = { js: [], m: [], d: [], other: [] }, resultMessage, pluralizeFile = function (n) { - return (n + " file") + ((n === 1) ? "" : "s"); - }; - this.outputFiles.forEach(function (item) { - if (/\.js$/.test(item)) - result.js.push(item); - else if (/\.js\.map$/.test(item)) - result.m.push(item); - else if (/\.d\.ts$/.test(item)) - result.d.push(item); - else - result.other.push(item); - }); - - resultMessage = "js: " + pluralizeFile(result.js.length) + ", map: " + pluralizeFile(result.m.length) + ", declaration: " + pluralizeFile(result.d.length); - if (this.options.outputOne) { - if (result.js.length > 0) { - this.grunt.log.writeln("File " + (result.js[0])["cyan"] + " created."); - } - this.grunt.log.writeln(resultMessage); - } else { - this.grunt.log.writeln(pluralizeFile(this.outputFiles.length)["cyan"] + " created. " + resultMessage); - } - }; - - Compiler.prototype.getScriptSnapshot = function (fileName) { - return this.getSourceFile(fileName).scriptSnapshot; - }; - - Compiler.prototype.getSourceFile = function (fileName) { - var sourceFile = this.fileNameToSourceFile.lookup(fileName); - if (!sourceFile) { - // Attempt to read the file - var fileInformation; - - try { - fileInformation = this.ioHost.readFile(fileName, this.compilationSettings.codepage()); - } catch (e) { - fileInformation = new TypeScript.FileInformation("", 0 /* None */); - } - - var snapshot = TypeScript.ScriptSnapshot.fromString(fileInformation.contents); - sourceFile = new SourceFile(snapshot, fileInformation.byteOrderMark); - this.fileNameToSourceFile.add(fileName, sourceFile); - } - - return sourceFile; - }; - - Compiler.prototype.resolveRelativePath = function (path, directory) { - var unQuotedPath = TypeScript.stripStartAndEndQuotes(path); - var normalizedPath; - - if (TypeScript.isRooted(unQuotedPath) || !directory) { - normalizedPath = unQuotedPath; - } else { - normalizedPath = this.ioHost.combine(directory, unQuotedPath); - } - normalizedPath = this.resolvePath(normalizedPath); - normalizedPath = TypeScript.switchToForwardSlashes(normalizedPath); - return normalizedPath; - }; - - Compiler.prototype.fileExists = function (path) { - var exists = this.fileExistsCache[path]; - if (exists === undefined) { - exists = this.ioHost.fileExists(path); - this.fileExistsCache[path] = exists; - } - return exists; - }; - - Compiler.prototype.getParentDirectory = function (path) { - return this.ioHost.dirName(path); - }; - - Compiler.prototype.addDiagnostic = function (diagnostic) { - var diagnosticInfo = diagnostic.info(); - if (diagnosticInfo.category === 1 /* Error */) { - this.hasErrors = true; - } - - if (diagnostic.fileName()) { - this.ioHost.stderr.Write(diagnostic.fileName() + "(" + (diagnostic.line() + 1) + "," + (diagnostic.character() + 1) + "): "); - } - - this.ioHost.stderr.WriteLine(diagnostic.message()); - }; - - Compiler.prototype.tryWriteOutputFiles = function (outputFiles) { - for (var i = 0, n = outputFiles.length; i < n; i++) { - var outputFile = outputFiles[i]; - - try { - this.writeFile(outputFile.name, outputFile.text, outputFile.writeByteOrderMark); - } catch (e) { - this.addDiagnostic(new TypeScript.Diagnostic(outputFile.name, null, 0, 0, TypeScript.DiagnosticCode.Emit_Error_0, [e.message])); - return false; - } - } - - return true; - }; - - Compiler.prototype.writeFile = function (fileName, contents, writeByteOrderMark) { - var preparedFileName = this.prepareFileName(fileName); - var path = this.ioHost.resolvePath(preparedFileName); - var dirName = this.ioHost.dirName(path); - this.createDirectoryStructure(dirName); - - contents = this.prepareSourcePath(fileName, preparedFileName, contents); - - this.ioHost.writeFile(path, contents, writeByteOrderMark); - - this.outputFiles.push(path); - }; - - Compiler.prototype.prepareFileName = function (fileName) { - var newFileName = fileName, basePath = this.options.base_path; - - if (this.options.outputOne) { - return newFileName; - } - if (!this.destinationPath) { - return newFileName; - } - - var currentPath = this.ioHost.currentPath(), relativePath = this.ioHost.relativePath(currentPath, fileName); - - if (basePath) { - if (relativePath.substr(0, basePath.length) !== basePath) { - throw new Error(fileName + " is not started base_path"); - } - relativePath = relativePath.substr(basePath.length); - } - - return this.ioHost.resolveMulti(currentPath, this.destinationPath, relativePath); - }; - - Compiler.prototype.prepareSourcePath = function (sourceFileName, preparedFileName, contents) { - var io = this.ioHost; - if (this.options.outputOne) { - return contents; - } - if (sourceFileName === preparedFileName) { - return contents; - } - if (!this.destinationPath) { - return contents; - } - if (!(/\.js\.map$/.test(sourceFileName))) { - return contents; - } - var mapData = JSON.parse(contents), source = mapData.sources[0]; - mapData.sources.length = 0; - var relative = io.relativePath(io.dirName(preparedFileName), sourceFileName); - mapData.sources.push(io.combine(io.dirName(relative), source)); - return JSON.stringify(mapData); - }; - - Compiler.prototype.createDirectoryStructure = function (dirName) { - if (this.ioHost.directoryExists(dirName)) { - return; - } - - var parentDirectory = this.ioHost.dirName(dirName); - if (parentDirectory != "") { - this.createDirectoryStructure(parentDirectory); - } - this.ioHost.createDirectory(dirName); - }; - - Compiler.prototype.directoryExists = function (path) { - return this.ioHost.directoryExists(path); - ; - }; - - Compiler.prototype.resolvePath = function (path) { - var cachedValue = this.resolvePathCache[path]; - if (!cachedValue) { - cachedValue = this.ioHost.resolvePath(path); - this.resolvePathCache[path] = cachedValue; - } - return cachedValue; - }; - return Compiler; - })(); - GruntTs.Compiler = Compiler; -})(GruntTs || (GruntTs = {})); -/// -/// -/// -module.exports = function (grunt) { - var _path = require("path"), _vm = require('vm'), _os = require('os'), getTsBinPathWithLoad = function () { - var typeScriptBinPath = _path.dirname(require.resolve("typescript")), typeScriptPath = _path.resolve(typeScriptBinPath, "typescript.js"), code; - - if (!typeScriptBinPath) { - grunt.fail.warn("typescript.js not found. please 'npm install typescript'."); - return false; - } - - code = grunt.file.read(typeScriptPath); - _vm.runInThisContext(code, typeScriptPath); - - return typeScriptBinPath; - }, prepareBasePath = function (io, path) { - if (!path) { - return path; - } - path = io.normalizePath(path); - if (path.lastIndexOf("/") !== path.length - 1) { - path = path + "/"; - } - return path; - }, setGlobalOption = function (options) { - var newlineOpt; - - if (!TypeScript || !options) { - return; - } - - if (options.newLine) { - newlineOpt = options.newLine.toString().toLowerCase(); - if (newlineOpt === "crlf") { - TypeScript.newLine = function () { - return "\r\n"; - }; - } else if (newlineOpt === "lf") { - TypeScript.newLine = function () { - return "\n"; - }; - } - } - - if (Object.prototype.toString.call(options.indentStep) === "[object Number]" && options.indentStep > -1) { - TypeScript.Indenter.indentStep = options.indentStep; - TypeScript.Indenter.indentStepString = Array(options.indentStep + 1).join(" "); - } - - if (options.useTabIndent) { - TypeScript.Indenter.indentStep = 1; - TypeScript.Indenter.indentStepString = "\t"; - } - }; - - grunt.registerMultiTask('typescript', 'Compile TypeScript files', function () { - var self = this, typescriptBinPath = getTsBinPathWithLoad(), hasError = false; - - this.files.forEach(function (file) { - var dest = file.dest, options = self.options(), files = [], io = new GruntTs.GruntIO(grunt), newlineOpt; - - TypeScript.newLine = function () { - return _os.EOL; - }; - - setGlobalOption(options); - - grunt.file.expand(file.src).forEach(function (file) { - files.push(file); - }); - - dest = io.normalizePath(dest); - - options.outputOne = !!dest && _path.extname(dest) === ".js"; - - options.base_path = prepareBasePath(io, options.base_path); - if (options.base_path) { - options.base_path = io.normalizePath(options.base_path); - } - if (typeof options.ignoreTypeCheck === "undefined") { - options.ignoreTypeCheck = true; - } - - if (!(new GruntTs.Compiler(grunt, typescriptBinPath, io)).exec(files, dest, options)) { - hasError = true; - } - }); - if (hasError) { - return false; - } - if (grunt.task.current.errorCount) { - return false; - } - }); -}; diff --git a/node_modules/grunt/.npmignore b/node_modules/grunt/.npmignore deleted file mode 100644 index 46cddcc..0000000 --- a/node_modules/grunt/.npmignore +++ /dev/null @@ -1,8 +0,0 @@ -docs -test -.travis.yml -AUTHORS -CHANGELOG -CONTRIBUTING.MD -custom-gruntfile.js -Gruntfile.js diff --git a/node_modules/grunt/CONTRIBUTING.md b/node_modules/grunt/CONTRIBUTING.md deleted file mode 100644 index 5d08cc3..0000000 --- a/node_modules/grunt/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please see the [Contributing to grunt](http://gruntjs.com/contributing) guide for information on contributing to this project. diff --git a/node_modules/grunt/LICENSE-MIT b/node_modules/grunt/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/grunt/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -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/grunt/README.md b/node_modules/grunt/README.md deleted file mode 100644 index 69fc38b..0000000 --- a/node_modules/grunt/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Grunt: The JavaScript Task Runner [![Build Status](https://secure.travis-ci.org/gruntjs/grunt.png?branch=master)](http://travis-ci.org/gruntjs/grunt) - - - - -### Documentation - -Visit the [gruntjs.com](http://gruntjs.com/) website for all the things. - -### Support / Contributing -Before you make an issue, please read our [Contributing](http://gruntjs.com/contributing) guide. - -You can find the grunt team in [#grunt on irc.freenode.net](http://webchat.freenode.net/?channels=grunt). - -### Release History -See the [CHANGELOG](CHANGELOG). diff --git a/node_modules/grunt/internal-tasks/bump.js b/node_modules/grunt/internal-tasks/bump.js deleted file mode 100644 index a7c011c..0000000 --- a/node_modules/grunt/internal-tasks/bump.js +++ /dev/null @@ -1,151 +0,0 @@ -/* - * grunt-contrib-bump - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman, contributors - * Licensed under the MIT license. - */ - -'use strict'; - -var semver = require('semver'); -var shell = require('shelljs'); - -module.exports = function(grunt) { - - grunt.registerTask('bump', 'Bump the version property of a JSON file.', function() { - // Validate specified semver increment modes. - var valids = ['major', 'minor', 'patch', 'prerelease']; - var modes = []; - this.args.forEach(function(mode) { - var matches = []; - valids.forEach(function(valid) { - if (valid.indexOf(mode) === 0) { matches.push(valid); } - }); - if (matches.length === 0) { - grunt.log.error('Error: mode "' + mode + '" does not match any known modes.'); - } else if (matches.length > 1) { - grunt.log.error('Error: mode "' + mode + '" is ambiguous (possibly: ' + matches.join(', ') + ').'); - } else { - modes.push(matches[0]); - } - }); - if (this.errorCount === 0 && modes.length === 0) { - grunt.log.error('Error: no modes specified.'); - } - if (this.errorCount > 0) { - grunt.log.error('Valid modes are: ' + valids.join(', ') + '.'); - throw new Error('Use valid modes (or unambiguous mode abbreviations).'); - } - // Options. - var options = this.options({ - filepaths: ['package.json'], - syncVersions: false, - commit: true, - commitMessage: 'Bumping version to {%= version %}.', - tag: true, - tagName: 'v{%= version %}', - tagMessage: 'Version {%= version %}', - tagPrerelease: false, - }); - // Normalize filepaths to array. - var filepaths = Array.isArray(options.filepaths) ? options.filepaths : [options.filepaths]; - // Process JSON files, in-order. - var versions = {}; - filepaths.forEach(function(filepath) { - var o = grunt.file.readJSON(filepath); - var origVersion = o.version; - // If syncVersions is enabled, only grab version from the first file, - // guaranteeing new versions will always be in sync. - var firstVersion = Object.keys(versions)[0]; - if (options.syncVersions && firstVersion) { - o.version = firstVersion; - } - modes.forEach(function(mode) { - var orig = o.version; - var s = semver.parse(o.version); - s.inc(mode); - o.version = String(s); - // Workaround for https://github.com/isaacs/node-semver/issues/50 - if (/-/.test(orig) && mode === 'patch') { - o.version = o.version.replace(/\d+$/, function(n) { return n - 1; }); - } - // If prerelease on an un-prerelease version, bump patch version first - if (!/-/.test(orig) && mode === 'prerelease') { - s.inc('patch'); - s.inc('prerelease'); - o.version = String(s); - } - }); - if (versions[origVersion]) { - versions[origVersion].filepaths.push(filepath); - } else { - versions[origVersion] = {version: o.version, filepaths: [filepath]}; - } - // Actually *do* something. - grunt.log.write('Bumping version in ' + filepath + ' from ' + origVersion + ' to ' + o.version + '...'); - grunt.file.write(filepath, JSON.stringify(o, null, 2)); - grunt.log.ok(); - }); - // Commit changed files? - if (options.commit) { - Object.keys(versions).forEach(function(origVersion) { - var o = versions[origVersion]; - commit(o.filepaths, processTemplate(options.commitMessage, { - version: o.version, - origVersion: origVersion - })); - }); - } - // We're only going to create one tag. And it's going to be the new - // version of the first bumped file. Because, sanity. - var newVersion = versions[Object.keys(versions)[0]].version; - if (options.tag) { - if (options.tagPrerelease || modes.indexOf('prerelease') === -1) { - tag( - processTemplate(options.tagName, {version: newVersion}), - processTemplate(options.tagMessage, {version: newVersion}) - ); - } else { - grunt.log.writeln('Not tagging (prerelease version).'); - } - } - if (this.errorCount > 0) { - grunt.warn('There were errors.'); - } - }); - - // Using custom delimiters keeps templates from being auto-processed. - grunt.template.addDelimiters('bump', '{%', '%}'); - - function processTemplate(message, data) { - return grunt.template.process(message, { - delimiters: 'bump', - data: data, - }); - } - - // Kinda borrowed from https://github.com/geddski/grunt-release - function commit(filepaths, message) { - grunt.log.writeln('Committing ' + filepaths.join(', ') + ' with message: ' + message); - run("git commit -m '" + message + "' '" + filepaths.join("' '") + "'"); - } - - function tag(name, message) { - grunt.log.writeln('Tagging ' + name + ' with message: ' + message); - run("git tag '" + name + "' -m '" + message + "'"); - } - - function run(cmd) { - if (grunt.option('no-write')) { - grunt.verbose.writeln('Not actually running: ' + cmd); - } else { - grunt.verbose.writeln('Running: ' + cmd); - var result = shell.exec(cmd, {silent:true}); - if (result.code !== 0) { - grunt.log.error('Error (' + result.code + ') ' + result.output); - } - } - } - -}; \ No newline at end of file diff --git a/node_modules/grunt/internal-tasks/subgrunt.js b/node_modules/grunt/internal-tasks/subgrunt.js deleted file mode 100644 index d7890d7..0000000 --- a/node_modules/grunt/internal-tasks/subgrunt.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -module.exports = function(grunt) { - - // Run sub-grunt files, because right now, testing tasks is a pain. - grunt.registerMultiTask('subgrunt', 'Run a sub-gruntfile.', function() { - var path = require('path'); - grunt.util.async.forEachSeries(this.filesSrc, function(gruntfile, next) { - grunt.log.write('Loading ' + gruntfile + '...'); - grunt.util.spawn({ - grunt: true, - args: ['--gruntfile', path.resolve(gruntfile)], - }, function(error, result) { - if (error) { - grunt.log.error().error(result.stdout).writeln(); - next(new Error('Error running sub-gruntfile "' + gruntfile + '".')); - } else { - grunt.log.ok().verbose.ok(result.stdout); - next(); - } - }); - }, this.async()); - }); - -}; diff --git a/node_modules/grunt/lib/grunt.js b/node_modules/grunt/lib/grunt.js deleted file mode 100644 index 7afaa17..0000000 --- a/node_modules/grunt/lib/grunt.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -// Nodejs libs. -var path = require('path'); - -// This allows grunt to require() .coffee files. -require('coffee-script'); - -// The module to be exported. -var grunt = module.exports = {}; - -// Expose internal grunt libs. -function gRequire(name) { - return grunt[name] = require('./grunt/' + name); -} -var util = gRequire('util'); -gRequire('template'); -gRequire('event'); -var fail = gRequire('fail'); -gRequire('file'); -var option = gRequire('option'); -var config = gRequire('config'); -var task = gRequire('task'); -var log = gRequire('log'); -var help = gRequire('help'); -gRequire('cli'); -var verbose = grunt.verbose = log.verbose; - -// Expose some grunt metadata. -grunt.package = require('../package.json'); -grunt.version = grunt.package.version; - -// Expose specific grunt lib methods on grunt. -function gExpose(obj, methodName, newMethodName) { - grunt[newMethodName || methodName] = obj[methodName].bind(obj); -} -gExpose(task, 'registerTask'); -gExpose(task, 'registerMultiTask'); -gExpose(task, 'registerInitTask'); -gExpose(task, 'renameTask'); -gExpose(task, 'loadTasks'); -gExpose(task, 'loadNpmTasks'); -gExpose(config, 'init', 'initConfig'); -gExpose(fail, 'warn'); -gExpose(fail, 'fatal'); - -// Expose the task interface. I've never called this manually, and have no idea -// how it will work. But it might. -grunt.tasks = function(tasks, options, done) { - // Update options with passed-in options. - option.init(options); - - // Display the grunt version and quit if the user did --version. - var _tasks, _options; - if (option('version')) { - // Not --verbose. - log.writeln('grunt v' + grunt.version); - - if (option('verbose')) { - // --verbose - verbose.writeln('Install path: ' + path.resolve(__dirname, '..')); - // Yes, this is a total hack, but we don't want to log all that verbose - // task initialization stuff here. - grunt.log.muted = true; - // Initialize task system so that available tasks can be listed. - grunt.task.init([], {help: true}); - // Re-enable logging. - grunt.log.muted = false; - - // Display available tasks (for shell completion, etc). - _tasks = Object.keys(grunt.task._tasks).sort(); - verbose.writeln('Available tasks: ' + _tasks.join(' ')); - - // Display available options (for shell completion, etc). - _options = []; - Object.keys(grunt.cli.optlist).forEach(function(long) { - var o = grunt.cli.optlist[long]; - _options.push('--' + (o.negate ? 'no-' : '') + long); - if (o.short) { _options.push('-' + o.short); } - }); - verbose.writeln('Available options: ' + _options.join(' ')); - } - - return; - } - - // Init colors. - log.initColors(); - - // Display help and quit if the user did --help. - if (option('help')) { - help.display(); - return; - } - - // A little header stuff. - verbose.header('Initializing').writeflags(option.flags(), 'Command-line options'); - - // Determine and output which tasks will be run. - var tasksSpecified = tasks && tasks.length > 0; - tasks = task.parseArgs([tasksSpecified ? tasks : 'default']); - - // Initialize tasks. - task.init(tasks); - - verbose.writeln(); - if (!tasksSpecified) { - verbose.writeln('No tasks specified, running default tasks.'); - } - verbose.writeflags(tasks, 'Running tasks'); - - // Handle otherwise unhandleable (probably asynchronous) exceptions. - var uncaughtHandler = function(e) { - fail.fatal(e, fail.code.TASK_FAILURE); - }; - process.on('uncaughtException', uncaughtHandler); - - // Report, etc when all tasks have completed. - task.options({ - error: function(e) { - fail.warn(e, fail.code.TASK_FAILURE); - }, - done: function() { - // Stop handling uncaught exceptions so that we don't leave any - // unwanted process-level side effects behind. There is no need to do - // this in the error callback, because fail.warn() will either kill - // the process, or with --force keep on going all the way here. - process.removeListener('uncaughtException', uncaughtHandler); - - // Output a final fail / success report. - fail.report(); - - if (done) { - // Execute "done" function when done (only if passed, of course). - done(); - } else { - // Otherwise, explicitly exit. - util.exit(0); - } - } - }); - - // Execute all tasks, in order. Passing each task individually in a forEach - // allows the error callback to execute multiple times. - tasks.forEach(function(name) { task.run(name); }); - task.start(); -}; diff --git a/node_modules/grunt/lib/grunt/cli.js b/node_modules/grunt/lib/grunt/cli.js deleted file mode 100644 index a86da8f..0000000 --- a/node_modules/grunt/lib/grunt/cli.js +++ /dev/null @@ -1,128 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Nodejs libs. -var path = require('path'); - -// External libs. -var nopt = require('nopt'); - -// This is only executed when run via command line. -var cli = module.exports = function(options, done) { - // CLI-parsed options override any passed-in "default" options. - if (options) { - // For each defult option... - Object.keys(options).forEach(function(key) { - if (!(key in cli.options)) { - // If this option doesn't exist in the parsed cli.options, add it in. - cli.options[key] = options[key]; - } else if (cli.optlist[key].type === Array) { - // If this option's type is Array, append it to any existing array - // (or create a new array). - [].push.apply(cli.options[key], options[key]); - } - }); - } - - // Run tasks. - grunt.tasks(cli.tasks, cli.options, done); -}; - -// Default options. -var optlist = cli.optlist = { - help: { - short: 'h', - info: 'Display this help text.', - type: Boolean - }, - base: { - info: 'Specify an alternate base path. By default, all file paths are relative to the Gruntfile. (grunt.file.setBase) *', - type: path - }, - color: { - info: 'Disable colored output.', - type: Boolean, - negate: true - }, - gruntfile: { - info: 'Specify an alternate Gruntfile. By default, grunt looks in the current or parent directories for the nearest Gruntfile.js or Gruntfile.coffee file.', - type: path - }, - debug: { - short: 'd', - info: 'Enable debugging mode for tasks that support it.', - type: Number - }, - stack: { - info: 'Print a stack trace when exiting with a warning or fatal error.', - type: Boolean - }, - force: { - short: 'f', - info: 'A way to force your way past warnings. Want a suggestion? Don\'t use this option, fix your code.', - type: Boolean - }, - tasks: { - info: 'Additional directory paths to scan for task and "extra" files. (grunt.loadTasks) *', - type: Array - }, - npm: { - info: 'Npm-installed grunt plugins to scan for task and "extra" files. (grunt.loadNpmTasks) *', - type: Array - }, - write: { - info: 'Disable writing files (dry run).', - type: Boolean, - negate: true - }, - verbose: { - short: 'v', - info: 'Verbose mode. A lot more information output.', - type: Boolean - }, - version: { - short: 'V', - info: 'Print the grunt version. Combine with --verbose for more info.', - type: Boolean - }, - // Even though shell auto-completion is now handled by grunt-cli, leave this - // option here for display in the --help screen. - completion: { - info: 'Output shell auto-completion rules. See the grunt-cli documentation for more information.', - type: String - }, -}; - -// Parse `optlist` into a form that nopt can handle. -var aliases = {}; -var known = {}; - -Object.keys(optlist).forEach(function(key) { - var short = optlist[key].short; - if (short) { - aliases[short] = '--' + key; - } - known[key] = optlist[key].type; -}); - -var parsed = nopt(known, aliases, process.argv, 2); -cli.tasks = parsed.argv.remain; -cli.options = parsed; -delete parsed.argv; - -// Initialize any Array options that weren't initialized. -Object.keys(optlist).forEach(function(key) { - if (optlist[key].type === Array && !(key in cli.options)) { - cli.options[key] = []; - } -}); diff --git a/node_modules/grunt/lib/grunt/config.js b/node_modules/grunt/lib/grunt/config.js deleted file mode 100644 index 75619a1..0000000 --- a/node_modules/grunt/lib/grunt/config.js +++ /dev/null @@ -1,118 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Get/set config data. If value was passed, set. Otherwise, get. -var config = module.exports = function(prop, value) { - if (arguments.length === 2) { - // Two arguments were passed, set the property's value. - return config.set(prop, value); - } else { - // Get the property's value (or the entire data object). - return config.get(prop); - } -}; - -// The actual config data. -config.data = {}; - -// Escape any . in name with \. so dot-based namespacing works properly. -config.escape = function(str) { - return str.replace(/\./g, '\\.'); -}; - -// Return prop as a string. -config.getPropString = function(prop) { - return Array.isArray(prop) ? prop.map(config.escape).join('.') : prop; -}; - -// Get raw, unprocessed config data. -config.getRaw = function(prop) { - if (prop) { - // Prop was passed, get that specific property's value. - return grunt.util.namespace.get(config.data, config.getPropString(prop)); - } else { - // No prop was passed, return the entire config.data object. - return config.data; - } -}; - -// Match '<%= FOO %>' where FOO is a propString, eg. foo or foo.bar but not -// a method call like foo() or foo.bar(). -var propStringTmplRe = /^<%=\s*([a-z0-9_$]+(?:\.[a-z0-9_$]+)*)\s*%>$/i; - -// Get config data, recursively processing templates. -config.get = function(prop) { - return config.process(config.getRaw(prop)); -}; - -// Expand a config value recursively. Used for post-processing raw values -// already retrieved from the config. -config.process = function(raw) { - return grunt.util.recurse(raw, function(value) { - // If the value is not a string, return it. - if (typeof value !== 'string') { return value; } - // If possible, access the specified property via config.get, in case it - // doesn't refer to a string, but instead refers to an object or array. - var matches = value.match(propStringTmplRe); - var result; - if (matches) { - result = config.get(matches[1]); - // If the result retrieved from the config data wasn't null or undefined, - // return it. - if (result != null) { return result; } - } - // Process the string as a template. - return grunt.template.process(value, {data: config.data}); - }); -}; - -// Set config data. -config.set = function(prop, value) { - return grunt.util.namespace.set(config.data, config.getPropString(prop), value); -}; - -// Initialize config data. -config.init = function(obj) { - grunt.verbose.write('Initializing config...').ok(); - // Initialize and return data. - return (config.data = obj || {}); -}; - -// Test to see if required config params have been defined. If not, throw an -// exception (use this inside of a task). -config.requires = function() { - var p = grunt.util.pluralize; - var props = grunt.util.toArray(arguments).map(config.getPropString); - var msg = 'Verifying propert' + p(props.length, 'y/ies') + - ' ' + grunt.log.wordlist(props) + ' exist' + p(props.length, 's') + - ' in config...'; - grunt.verbose.write(msg); - var failProps = config.data && props.filter(function(prop) { - return config.get(prop) == null; - }).map(function(prop) { - return '"' + prop + '"'; - }); - if (config.data && failProps.length === 0) { - grunt.verbose.ok(); - return true; - } else { - grunt.verbose.or.write(msg); - grunt.log.error().error('Unable to process task.'); - if (!config.data) { - throw grunt.util.error('Unable to load config.'); - } else { - throw grunt.util.error('Required config propert' + - p(failProps.length, 'y/ies') + ' ' + failProps.join(', ') + ' missing.'); - } - } -}; diff --git a/node_modules/grunt/lib/grunt/event.js b/node_modules/grunt/lib/grunt/event.js deleted file mode 100644 index 9e5ba0b..0000000 --- a/node_modules/grunt/lib/grunt/event.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -// External lib. -var EventEmitter2 = require('eventemitter2').EventEmitter2; - -// Awesome. -module.exports = new EventEmitter2({wildcard: true}); diff --git a/node_modules/grunt/lib/grunt/fail.js b/node_modules/grunt/lib/grunt/fail.js deleted file mode 100644 index aa33c91..0000000 --- a/node_modules/grunt/lib/grunt/fail.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// The module to be exported. -var fail = module.exports = {}; - -// Error codes. -fail.code = { - FATAL_ERROR: 1, - MISSING_GRUNTFILE: 2, - TASK_FAILURE: 3, - TEMPLATE_ERROR: 4, - INVALID_AUTOCOMPLETE: 5, - WARNING: 6, -}; - -// DRY it up! -function writeln(e, mode) { - grunt.log.muted = false; - var msg = String(e.message || e); - if (!grunt.option('no-color')) { msg += '\x07'; } // Beep! - if (mode === 'warn') { - msg = 'Warning: ' + msg + ' '; - msg += (grunt.option('force') ? 'Used --force, continuing.'.underline : 'Use --force to continue.'); - msg = msg.yellow; - } else { - msg = ('Fatal error: ' + msg).red; - } - grunt.log.writeln(msg); -} - -// If --stack is enabled, log the appropriate error stack (if it exists). -function dumpStack(e) { - if (grunt.option('stack')) { - if (e.origError && e.origError.stack) { - console.log(e.origError.stack); - } else if (e.stack) { - console.log(e.stack); - } - } -} - -// A fatal error occurred. Abort immediately. -fail.fatal = function(e, errcode) { - writeln(e, 'fatal'); - dumpStack(e); - grunt.util.exit(typeof errcode === 'number' ? errcode : fail.code.FATAL_ERROR); -}; - -// Keep track of error and warning counts. -fail.errorcount = 0; -fail.warncount = 0; - -// A warning occurred. Abort immediately unless -f or --force was used. -fail.warn = function(e, errcode) { - var message = typeof e === 'string' ? e : e.message; - fail.warncount++; - writeln(message, 'warn'); - // If -f or --force aren't used, stop script processing. - if (!grunt.option('force')) { - dumpStack(e); - grunt.log.writeln().fail('Aborted due to warnings.'); - grunt.util.exit(typeof errcode === 'number' ? errcode : fail.code.WARNING); - } -}; - -// This gets called at the very end. -fail.report = function() { - if (fail.warncount > 0) { - grunt.log.writeln().fail('Done, but with warnings.'); - } else { - grunt.log.writeln().success('Done, without errors.'); - } -}; diff --git a/node_modules/grunt/lib/grunt/file.js b/node_modules/grunt/lib/grunt/file.js deleted file mode 100644 index 461c62b..0000000 --- a/node_modules/grunt/lib/grunt/file.js +++ /dev/null @@ -1,440 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Nodejs libs. -var fs = require('fs'); -var path = require('path'); - -// The module to be exported. -var file = module.exports = {}; - -// External libs. -file.glob = require('glob'); -file.minimatch = require('minimatch'); -file.findup = require('findup-sync'); -var YAML = require('js-yaml'); -var rimraf = require('rimraf'); -var iconv = require('iconv-lite'); - -// Windows? -var win32 = process.platform === 'win32'; - -// Normalize \\ paths to / paths. -var unixifyPath = function(filepath) { - if (win32) { - return filepath.replace(/\\/g, '/'); - } else { - return filepath; - } -}; - -// Change the current base path (ie, CWD) to the specified path. -file.setBase = function() { - var dirpath = path.join.apply(path, arguments); - process.chdir(dirpath); -}; - -// Process specified wildcard glob patterns or filenames against a -// callback, excluding and uniquing files in the result set. -var processPatterns = function(patterns, fn) { - // Filepaths to return. - var result = []; - // Iterate over flattened patterns array. - grunt.util._.flatten(patterns).forEach(function(pattern) { - // If the first character is ! it should be omitted - var exclusion = pattern.indexOf('!') === 0; - // If the pattern is an exclusion, remove the ! - if (exclusion) { pattern = pattern.slice(1); } - // Find all matching files for this pattern. - var matches = fn(pattern); - if (exclusion) { - // If an exclusion, remove matching files. - result = grunt.util._.difference(result, matches); - } else { - // Otherwise add matching files. - result = grunt.util._.union(result, matches); - } - }); - return result; -}; - -// Match a filepath or filepaths against one or more wildcard patterns. Returns -// all matching filepaths. -file.match = function(options, patterns, filepaths) { - if (grunt.util.kindOf(options) !== 'object') { - filepaths = patterns; - patterns = options; - options = {}; - } - // Return empty set if either patterns or filepaths was omitted. - if (patterns == null || filepaths == null) { return []; } - // Normalize patterns and filepaths to arrays. - if (!Array.isArray(patterns)) { patterns = [patterns]; } - if (!Array.isArray(filepaths)) { filepaths = [filepaths]; } - // Return empty set if there are no patterns or filepaths. - if (patterns.length === 0 || filepaths.length === 0) { return []; } - // Return all matching filepaths. - return processPatterns(patterns, function(pattern) { - return file.minimatch.match(filepaths, pattern, options); - }); -}; - -// Match a filepath or filepaths against one or more wildcard patterns. Returns -// true if any of the patterns match. -file.isMatch = function() { - return file.match.apply(file, arguments).length > 0; -}; - -// Return an array of all file paths that match the given wildcard patterns. -file.expand = function() { - var args = grunt.util.toArray(arguments); - // If the first argument is an options object, save those options to pass - // into the file.glob.sync method. - var options = grunt.util.kindOf(args[0]) === 'object' ? args.shift() : {}; - // Use the first argument if it's an Array, otherwise convert the arguments - // object to an array and use that. - var patterns = Array.isArray(args[0]) ? args[0] : args; - // Return empty set if there are no patterns or filepaths. - if (patterns.length === 0) { return []; } - // Return all matching filepaths. - var matches = processPatterns(patterns, function(pattern) { - // Find all matching files for this pattern. - return file.glob.sync(pattern, options); - }); - // Filter result set? - if (options.filter) { - matches = matches.filter(function(filepath) { - filepath = path.join(options.cwd || '', filepath); - try { - if (typeof options.filter === 'function') { - return options.filter(filepath); - } else { - // If the file is of the right type and exists, this should work. - return fs.statSync(filepath)[options.filter](); - } - } catch(e) { - // Otherwise, it's probably not the right type. - return false; - } - }); - } - return matches; -}; - -var pathSeparatorRe = /[\/\\]/g; - -// Build a multi task "files" object dynamically. -file.expandMapping = function(patterns, destBase, options) { - options = grunt.util._.defaults({}, options, { - rename: function(destBase, destPath) { - return path.join(destBase || '', destPath); - } - }); - var files = []; - var fileByDest = {}; - // Find all files matching pattern, using passed-in options. - file.expand(options, patterns).forEach(function(src) { - var destPath = src; - // Flatten? - if (options.flatten) { - destPath = path.basename(destPath); - } - // Change the extension? - if (options.ext) { - destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); - } - // Generate destination filename. - var dest = options.rename(destBase, destPath, options); - // Prepend cwd to src path if necessary. - if (options.cwd) { src = path.join(options.cwd, src); } - // Normalize filepaths to be unix-style. - dest = dest.replace(pathSeparatorRe, '/'); - src = src.replace(pathSeparatorRe, '/'); - // Map correct src path to dest path. - if (fileByDest[dest]) { - // If dest already exists, push this src onto that dest's src array. - fileByDest[dest].src.push(src); - } else { - // Otherwise create a new src-dest file mapping object. - files.push({ - src: [src], - dest: dest, - }); - // And store a reference for later use. - fileByDest[dest] = files[files.length - 1]; - } - }); - return files; -}; - -// Like mkdir -p. Create a directory and any intermediary directories. -file.mkdir = function(dirpath, mode) { - if (grunt.option('no-write')) { return; } - // Set directory mode in a strict-mode-friendly way. - if (mode == null) { - mode = parseInt('0777', 8) & (~process.umask()); - } - dirpath.split(pathSeparatorRe).reduce(function(parts, part) { - parts += part + '/'; - var subpath = path.resolve(parts); - if (!file.exists(subpath)) { - try { - fs.mkdirSync(subpath, mode); - } catch(e) { - throw grunt.util.error('Unable to create directory "' + subpath + '" (Error code: ' + e.code + ').', e); - } - } - return parts; - }, ''); -}; - -// Recurse into a directory, executing callback for each file. -file.recurse = function recurse(rootdir, callback, subdir) { - var abspath = subdir ? path.join(rootdir, subdir) : rootdir; - fs.readdirSync(abspath).forEach(function(filename) { - var filepath = path.join(abspath, filename); - if (fs.statSync(filepath).isDirectory()) { - recurse(rootdir, callback, unixifyPath(path.join(subdir || '', filename || ''))); - } else { - callback(unixifyPath(filepath), rootdir, subdir, filename); - } - }); -}; - -// The default file encoding to use. -file.defaultEncoding = 'utf8'; -// Whether to preserve the BOM on file.read rather than strip it. -file.preserveBOM = false; - -// Read a file, return its contents. -file.read = function(filepath, options) { - if (!options) { options = {}; } - var contents; - grunt.verbose.write('Reading ' + filepath + '...'); - try { - contents = fs.readFileSync(String(filepath)); - // If encoding is not explicitly null, convert from encoded buffer to a - // string. If no encoding was specified, use the default. - if (options.encoding !== null) { - contents = iconv.decode(contents, options.encoding || file.defaultEncoding); - // Strip any BOM that might exist. - if (!file.preserveBOM && contents.charCodeAt(0) === 0xFEFF) { - contents = contents.substring(1); - } - } - grunt.verbose.ok(); - return contents; - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').', e); - } -}; - -// Read a file, parse its contents, return an object. -file.readJSON = function(filepath, options) { - var src = file.read(filepath, options); - var result; - grunt.verbose.write('Parsing ' + filepath + '...'); - try { - result = JSON.parse(src); - grunt.verbose.ok(); - return result; - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Unable to parse "' + filepath + '" file (' + e.message + ').', e); - } -}; - -// Read a YAML file, parse its contents, return an object. -file.readYAML = function(filepath, options) { - var src = file.read(filepath, options); - var result; - grunt.verbose.write('Parsing ' + filepath + '...'); - try { - result = YAML.load(src); - grunt.verbose.ok(); - return result; - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Unable to parse "' + filepath + '" file (' + e.problem + ').', e); - } -}; - -// Write a file. -file.write = function(filepath, contents, options) { - if (!options) { options = {}; } - var nowrite = grunt.option('no-write'); - grunt.verbose.write((nowrite ? 'Not actually writing ' : 'Writing ') + filepath + '...'); - // Create path, if necessary. - file.mkdir(path.dirname(filepath)); - try { - // If contents is already a Buffer, don't try to encode it. If no encoding - // was specified, use the default. - if (!Buffer.isBuffer(contents)) { - contents = iconv.encode(contents, options.encoding || file.defaultEncoding); - } - // Actually write file. - if (!nowrite) { - fs.writeFileSync(filepath, contents); - } - grunt.verbose.ok(); - return true; - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Unable to write "' + filepath + '" file (Error code: ' + e.code + ').', e); - } -}; - -// Read a file, optionally processing its content, then write the output. -file.copy = function(srcpath, destpath, options) { - if (!options) { options = {}; } - // If a process function was specified, and noProcess isn't true or doesn't - // match the srcpath, process the file's source. - var process = options.process && options.noProcess !== true && - !(options.noProcess && file.isMatch(options.noProcess, srcpath)); - // If the file will be processed, use the encoding as-specified. Otherwise, - // use an encoding of null to force the file to be read/written as a Buffer. - var readWriteOptions = process ? options : {encoding: null}; - // Actually read the file. - var contents = file.read(srcpath, readWriteOptions); - if (process) { - grunt.verbose.write('Processing source...'); - try { - contents = options.process(contents, srcpath); - grunt.verbose.ok(); - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Error while processing "' + srcpath + '" file.', e); - } - } - // Abort copy if the process function returns false. - if (contents === false) { - grunt.verbose.writeln('Write aborted.'); - } else { - file.write(destpath, contents, readWriteOptions); - } -}; - -// Delete folders and files recursively -file.delete = function(filepath, options) { - filepath = String(filepath); - - var nowrite = grunt.option('no-write'); - if (!options) { - options = {force: grunt.option('force') || false}; - } - - grunt.verbose.write((nowrite ? 'Not actually deleting ' : 'Deleting ') + filepath + '...'); - - if (!file.exists(filepath)) { - grunt.verbose.error(); - grunt.log.warn('Cannot delete nonexistent file.'); - return false; - } - - // Only delete cwd or outside cwd if --force enabled. Be careful, people! - if (!options.force) { - if (file.isPathCwd(filepath)) { - grunt.verbose.error(); - grunt.fail.warn('Cannot delete the current working directory.'); - return false; - } else if (!file.isPathInCwd(filepath)) { - grunt.verbose.error(); - grunt.fail.warn('Cannot delete files outside the current working directory.'); - return false; - } - } - - try { - // Actually delete. Or not. - if (!nowrite) { - rimraf.sync(filepath); - } - grunt.verbose.ok(); - return true; - } catch(e) { - grunt.verbose.error(); - throw grunt.util.error('Unable to delete "' + filepath + '" file (' + e.message + ').', e); - } -}; - -// True if the file path exists. -file.exists = function() { - var filepath = path.join.apply(path, arguments); - return fs.existsSync(filepath); -}; - -// True if the file is a symbolic link. -file.isLink = function() { - var filepath = path.join.apply(path, arguments); - return file.exists(filepath) && fs.lstatSync(filepath).isSymbolicLink(); -}; - -// True if the path is a directory. -file.isDir = function() { - var filepath = path.join.apply(path, arguments); - return file.exists(filepath) && fs.statSync(filepath).isDirectory(); -}; - -// True if the path is a file. -file.isFile = function() { - var filepath = path.join.apply(path, arguments); - return file.exists(filepath) && fs.statSync(filepath).isFile(); -}; - -// Is a given file path absolute? -file.isPathAbsolute = function() { - var filepath = path.join.apply(path, arguments); - return path.resolve(filepath) === filepath.replace(/[\/\\]+$/, ''); -}; - -// Do all the specified paths refer to the same path? -file.arePathsEquivalent = function(first) { - first = path.resolve(first); - for (var i = 1; i < arguments.length; i++) { - if (first !== path.resolve(arguments[i])) { return false; } - } - return true; -}; - -// Are descendant path(s) contained within ancestor path? Note: does not test -// if paths actually exist. -file.doesPathContain = function(ancestor) { - ancestor = path.resolve(ancestor); - var relative; - for (var i = 1; i < arguments.length; i++) { - relative = path.relative(path.resolve(arguments[i]), ancestor); - if (relative === '' || /\w+/.test(relative)) { return false; } - } - return true; -}; - -// Test to see if a filepath is the CWD. -file.isPathCwd = function() { - var filepath = path.join.apply(path, arguments); - try { - return file.arePathsEquivalent(process.cwd(), fs.realpathSync(filepath)); - } catch(e) { - return false; - } -}; - -// Test to see if a filepath is contained within the CWD. -file.isPathInCwd = function() { - var filepath = path.join.apply(path, arguments); - try { - return file.doesPathContain(process.cwd(), fs.realpathSync(filepath)); - } catch(e) { - return false; - } -}; diff --git a/node_modules/grunt/lib/grunt/help.js b/node_modules/grunt/lib/grunt/help.js deleted file mode 100644 index 3e610fb..0000000 --- a/node_modules/grunt/lib/grunt/help.js +++ /dev/null @@ -1,129 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Nodejs libs. -var path = require('path'); - -// Set column widths. -var col1len = 0; -exports.initCol1 = function(str) { - col1len = Math.max(col1len, str.length); -}; -exports.initWidths = function() { - // Widths for options/tasks table output. - exports.widths = [1, col1len, 2, 76 - col1len]; -}; - -// Render an array in table form. -exports.table = function(arr) { - arr.forEach(function(item) { - grunt.log.writetableln(exports.widths, ['', grunt.util._.pad(item[0], col1len), '', item[1]]); - }); -}; - -// Methods to run, in-order. -exports.queue = [ - 'initOptions', - 'initTasks', - 'initWidths', - 'header', - 'usage', - 'options', - 'optionsFooter', - 'tasks', - 'footer', -]; - -// Actually display stuff. -exports.display = function() { - exports.queue.forEach(function(name) { exports[name](); }); -}; - - -// Header. -exports.header = function() { - grunt.log.writeln('Grunt: The JavaScript Task Runner (v' + grunt.version + ')'); -}; - -// Usage info. -exports.usage = function() { - grunt.log.header('Usage'); - grunt.log.writeln(' ' + path.basename(process.argv[1]) + ' [options] [task [task ...]]'); -}; - -// Options. -exports.initOptions = function() { - // Build 2-column array for table view. - exports._options = Object.keys(grunt.cli.optlist).map(function(long) { - var o = grunt.cli.optlist[long]; - var col1 = '--' + (o.negate ? 'no-' : '') + long + (o.short ? ', -' + o.short : ''); - exports.initCol1(col1); - return [col1, o.info]; - }); -}; - -exports.options = function() { - grunt.log.header('Options'); - exports.table(exports._options); -}; - -exports.optionsFooter = function() { - grunt.log.writeln().writelns( - 'Options marked with * have methods exposed via the grunt API and should ' + - 'instead be specified inside the Gruntfile wherever possible.' - ); -}; - -// Tasks. -exports.initTasks = function() { - // Initialize task system so that the tasks can be listed. - grunt.task.init([], {help: true}); - - // Build object of tasks by info (where they were loaded from). - exports._tasks = []; - Object.keys(grunt.task._tasks).forEach(function(name) { - exports.initCol1(name); - var task = grunt.task._tasks[name]; - exports._tasks.push(task); - }); -}; - -exports.tasks = function() { - grunt.log.header('Available tasks'); - if (exports._tasks.length === 0) { - grunt.log.writeln('(no tasks found)'); - } else { - exports.table(exports._tasks.map(function(task) { - var info = task.info; - if (task.multi) { info += ' *'; } - return [task.name, info]; - })); - - grunt.log.writeln().writelns( - 'Tasks run in the order specified. Arguments may be passed to tasks that ' + - 'accept them by using colons, like "lint:files". Tasks marked with * are ' + - '"multi tasks" and will iterate over all sub-targets if no argument is ' + - 'specified.' - ); - } - - grunt.log.writeln().writelns( - 'The list of available tasks may change based on tasks directories or ' + - 'grunt plugins specified in the Gruntfile or via command-line options.' - ); -}; - -// Footer. -exports.footer = function() { - grunt.log.writeln().writeln('For more information, see http://gruntjs.com/'); -}; diff --git a/node_modules/grunt/lib/grunt/log.js b/node_modules/grunt/lib/grunt/log.js deleted file mode 100644 index 41dd534..0000000 --- a/node_modules/grunt/lib/grunt/log.js +++ /dev/null @@ -1,352 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Nodejs libs. -var util = require('util'); - -// The module to be exported. -var log = module.exports = {}; - -// External lib. Requiring this here modifies the String prototype! -var colors = require('colors'); - -// Disable colors if --no-colors was passed. -log.initColors = function() { - var util = grunt.util; - if (grunt.option('no-color')) { - // String color getters should just return the string. - colors.mode = 'none'; - // Strip colors from strings passed to console.log. - util.hooker.hook(console, 'log', function() { - var args = util.toArray(arguments); - return util.hooker.filter(this, args.map(function(arg) { - return util.kindOf(arg) === 'string' ? colors.stripColors(arg) : arg; - })); - }); - } -}; - -// Temporarily suppress output. -var suppressOutput; - -// Allow external muting of output. -log.muted = false; - -// True once anything has actually been logged. -var hasLogged; - -// Parse certain markup in strings to be logged. -function markup(str) { - str = str || ''; - // Make _foo_ underline. - str = str.replace(/(\s|^)_(\S|\S[\s\S]+?\S)_(?=[\s,.!?]|$)/g, '$1' + '$2'.underline); - // Make *foo* bold. - str = str.replace(/(\s|^)\*(\S|\S[\s\S]+?\S)\*(?=[\s,.!?]|$)/g, '$1' + '$2'.bold); - return str; -} - -// Similar to util.format in the standard library, however it'll always -// cast the first argument to a string and treat it as the format string. -function format(args) { - // Args is a argument array so copy it in order to avoid wonky behavior. - args = [].slice.call(args, 0); - if (args.length > 0) { - args[0] = String(args[0]); - } - return util.format.apply(util, args); -} - -function write(msg) { - msg = msg || ''; - // Actually write output. - if (!log.muted && !suppressOutput) { - hasLogged = true; - // Users should probably use the colors-provided methods, but if they - // don't, this should strip extraneous color codes. - if (grunt.option('no-color')) { msg = colors.stripColors(msg); } - // Actually write to stdout. - process.stdout.write(markup(msg)); - } -} - -function writeln(msg) { - // Write blank line if no msg is passed in. - msg = msg || ''; - write(msg + '\n'); -} - -// Write output. -log.write = function() { - write(format(arguments)); - return log; -}; - -// Write a line of output. -log.writeln = function() { - writeln(format(arguments)); - return log; -}; - -log.warn = function() { - var msg = format(arguments); - if (arguments.length > 0) { - writeln('>> '.red + grunt.util._.trim(msg).replace(/\n/g, '\n>> '.red)); - } else { - writeln('ERROR'.red); - } - return log; -}; -log.error = function() { - grunt.fail.errorcount++; - log.warn.apply(log, arguments); - return log; -}; -log.ok = function() { - var msg = format(arguments); - if (arguments.length > 0) { - writeln('>> '.green + grunt.util._.trim(msg).replace(/\n/g, '\n>> '.green)); - } else { - writeln('OK'.green); - } - return log; -}; -log.errorlns = function() { - var msg = format(arguments); - log.error(log.wraptext(77, msg)); - return log; -}; -log.oklns = function() { - var msg = format(arguments); - log.ok(log.wraptext(77, msg)); - return log; -}; -log.success = function() { - var msg = format(arguments); - writeln(msg.green); - return log; -}; -log.fail = function() { - var msg = format(arguments); - writeln(msg.red); - return log; -}; -log.header = function() { - var msg = format(arguments); - // Skip line before header, but not if header is the very first line output. - if (hasLogged) { writeln(); } - writeln(msg.underline); - return log; -}; -log.subhead = function() { - var msg = format(arguments); - // Skip line before subhead, but not if subhead is the very first line output. - if (hasLogged) { writeln(); } - writeln(msg.bold); - return log; -}; -// For debugging. -log.debug = function() { - var msg = format(arguments); - if (grunt.option('debug')) { - writeln('[D] ' + msg.magenta); - } - return log; -}; - -// Write a line of a table. -log.writetableln = function(widths, texts) { - writeln(log.table(widths, texts)); - return log; -}; - -// Wrap a long line of text to 80 columns. -log.writelns = function() { - var msg = format(arguments); - writeln(log.wraptext(80, msg)); - return log; -}; - -// Display flags in verbose mode. -log.writeflags = function(obj, prefix) { - var wordlist; - if (Array.isArray(obj)) { - wordlist = log.wordlist(obj); - } else if (typeof obj === 'object' && obj) { - wordlist = log.wordlist(Object.keys(obj).map(function(key) { - var val = obj[key]; - return key + (val === true ? '' : '=' + JSON.stringify(val)); - })); - } - writeln((prefix || 'Flags') + ': ' + (wordlist || '(none)'.cyan)); - return log; -}; - -// Create explicit "verbose" and "notverbose" functions, one for each already- -// defined log function, that do the same thing but ONLY if -v or --verbose is -// specified (or not specified). -log.verbose = {}; -log.notverbose = {}; - -// Iterate over all exported functions. -Object.keys(log).filter(function(key) { - return typeof log[key] === 'function'; -}).forEach(function(key) { - // Like any other log function, but suppresses output if the "verbose" option - // IS NOT set. - log.verbose[key] = function() { - suppressOutput = !grunt.option('verbose'); - log[key].apply(log, arguments); - suppressOutput = false; - return log.verbose; - }; - // Like any other log function, but suppresses output if the "verbose" option - // IS set. - log.notverbose[key] = function() { - suppressOutput = grunt.option('verbose'); - log[key].apply(log, arguments); - suppressOutput = false; - return log.notverbose; - }; -}); - -// A way to switch between verbose and notverbose modes. For example, this will -// write 'foo' if verbose logging is enabled, otherwise write 'bar': -// verbose.write('foo').or.write('bar'); -log.verbose.or = log.notverbose; -log.notverbose.or = log.verbose; - -// Static methods. - -// Pretty-format a word list. -log.wordlist = function(arr, options) { - options = grunt.util._.defaults(options || {}, { - separator: ', ', - color: 'cyan' - }); - return arr.map(function(item) { - return options.color ? String(item)[options.color] : item; - }).join(options.separator); -}; - -// Return a string, uncolored (suitable for testing .length, etc). -log.uncolor = function(str) { - return str.replace(/\x1B\[\d+m/g, ''); -}; - -// Word-wrap text to a given width, permitting ANSI color codes. -log.wraptext = function(width, text) { - // notes to self: - // grab 1st character or ansi code from string - // if ansi code, add to array and save for later, strip from front of string - // if character, add to array and increment counter, strip from front of string - // if width + 1 is reached and current character isn't space: - // slice off everything after last space in array and prepend it to string - // etc - - // This result array will be joined on \n. - var result = []; - var matches, color, tmp; - var captured = []; - var charlen = 0; - - while (matches = text.match(/(?:(\x1B\[\d+m)|\n|(.))([\s\S]*)/)) { - // Updated text to be everything not matched. - text = matches[3]; - - // Matched a color code? - if (matches[1]) { - // Save last captured color code for later use. - color = matches[1]; - // Capture color code. - captured.push(matches[1]); - continue; - - // Matched a non-newline character? - } else if (matches[2]) { - // If this is the first character and a previous color code was set, push - // that onto the captured array first. - if (charlen === 0 && color) { captured.push(color); } - // Push the matched character. - captured.push(matches[2]); - // Increment the current charlen. - charlen++; - // If not yet at the width limit or a space was matched, continue. - if (charlen <= width || matches[2] === ' ') { continue; } - // The current charlen exceeds the width and a space wasn't matched. - // "Roll everything back" until the last space character. - tmp = captured.lastIndexOf(' '); - text = captured.slice(tmp === -1 ? tmp : tmp + 1).join('') + text; - captured = captured.slice(0, tmp); - } - - // The limit has been reached. Push captured string onto result array. - result.push(captured.join('')); - - // Reset captured array and charlen. - captured = []; - charlen = 0; - } - - result.push(captured.join('')); - return result.join('\n'); -}; - -// todo: write unit tests -// -// function logs(text) { -// [4, 6, 10, 15, 20, 25, 30, 40].forEach(function(n) { -// log(n, text); -// }); -// } -// -// function log(n, text) { -// console.log(Array(n + 1).join('-')); -// console.log(wrap(n, text)); -// } -// -// var text = 'this is '.red + 'a simple'.yellow.inverse + ' test of'.green + ' ' + 'some wrapped'.blue + ' text over '.inverse.magenta + 'many lines'.red; -// logs(text); -// -// var text = 'foolish '.red.inverse + 'monkeys'.yellow + ' eating'.green + ' ' + 'delicious'.inverse.blue + ' bananas '.magenta + 'forever'.red; -// logs(text); -// -// var text = 'foolish monkeys eating delicious bananas forever'.rainbow; -// logs(text); - -// Format output into columns, wrapping words as-necessary. -log.table = function(widths, texts) { - var rows = []; - widths.forEach(function(width, i) { - var lines = log.wraptext(width, texts[i]).split('\n'); - lines.forEach(function(line, j) { - var row = rows[j]; - if (!row) { row = rows[j] = []; } - row[i] = line; - }); - }); - - var lines = []; - rows.forEach(function(row) { - var txt = ''; - var column; - for (var i = 0; i < row.length; i++) { - column = row[i] || ''; - txt += column; - var diff = widths[i] - log.uncolor(column).length; - if (diff > 0) { txt += grunt.util.repeat(diff, ' '); } - } - lines.push(txt); - }); - - return lines.join('\n'); -}; diff --git a/node_modules/grunt/lib/grunt/option.js b/node_modules/grunt/lib/grunt/option.js deleted file mode 100644 index 84b6763..0000000 --- a/node_modules/grunt/lib/grunt/option.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -// The actual option data. -var data = {}; - -// Get or set an option value. -var option = module.exports = function(key, value) { - var no = key.match(/^no-(.+)$/); - if (arguments.length === 2) { - return (data[key] = value); - } else if (no) { - return data[no[1]] === false; - } else { - return data[key]; - } -}; - -// Initialize option data. -option.init = function(obj) { - return (data = obj || {}); -}; - -// List of options as flags. -option.flags = function() { - return Object.keys(data).filter(function(key) { - // Don't display empty arrays. - return !(Array.isArray(data[key]) && data[key].length === 0); - }).map(function(key) { - var val = data[key]; - return '--' + (val === false ? 'no-' : '') + key + - (typeof val === 'boolean' ? '' : '=' + val); - }); -}; diff --git a/node_modules/grunt/lib/grunt/task.js b/node_modules/grunt/lib/grunt/task.js deleted file mode 100644 index 887592e..0000000 --- a/node_modules/grunt/lib/grunt/task.js +++ /dev/null @@ -1,451 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// Nodejs libs. -var path = require('path'); - -// Extend generic "task" util lib. -var parent = grunt.util.task.create(); - -// The module to be exported. -var task = module.exports = Object.create(parent); - -// A temporary registry of tasks and metadata. -var registry = {tasks: [], untasks: [], meta: {}}; - -// The last specified tasks message. -var lastInfo; - -// Number of levels of recursion when loading tasks in collections. -var loadTaskDepth = 0; - -// Keep track of the number of log.error() calls. -var errorcount; - -// Override built-in registerTask. -task.registerTask = function(name) { - // Add task to registry. - registry.tasks.push(name); - // Register task. - parent.registerTask.apply(task, arguments); - // This task, now that it's been registered. - var thisTask = task._tasks[name]; - // Metadata about the current task. - thisTask.meta = grunt.util._.clone(registry.meta); - // Override task function. - var _fn = thisTask.fn; - thisTask.fn = function(arg) { - // Guaranteed to always be the actual task name. - var name = thisTask.name; - // Initialize the errorcount for this task. - errorcount = grunt.fail.errorcount; - // Return the number of errors logged during this task. - Object.defineProperty(this, 'errorCount', { - enumerable: true, - get: function() { - return grunt.fail.errorcount - errorcount; - } - }); - // Expose task.requires on `this`. - this.requires = task.requires.bind(task); - // Expose config.requires on `this`. - this.requiresConfig = grunt.config.requires; - // Return an options object with the specified defaults overwritten by task- - // specific overrides, via the "options" property. - this.options = function() { - var args = [{}].concat(grunt.util.toArray(arguments)).concat([ - grunt.config([name, 'options']) - ]); - var options = grunt.util._.extend.apply(null, args); - grunt.verbose.writeflags(options, 'Options'); - return options; - }; - // If this task was an alias or a multi task called without a target, - // only log if in verbose mode. - var logger = _fn.alias || (thisTask.multi && (!arg || arg === '*')) ? 'verbose' : 'log'; - // Actually log. - grunt[logger].header('Running "' + this.nameArgs + '"' + - (this.name !== this.nameArgs ? ' (' + this.name + ')' : '') + ' task'); - // If --debug was specified, log the path to this task's source file. - grunt[logger].debug('Task source: ' + thisTask.meta.filepath); - // Actually run the task. - return _fn.apply(this, arguments); - }; - return task; -}; - -// Multi task targets can't start with _ or be a reserved property (options). -function isValidMultiTaskTarget(target) { - return !/^_|^options$/.test(target); -} - -// Normalize multi task files. -task.normalizeMultiTaskFiles = function(data, target) { - var prop, obj; - var files = []; - if (grunt.util.kindOf(data) === 'object') { - if ('src' in data || 'dest' in data) { - obj = {}; - for (prop in data) { - if (prop !== 'options') { - obj[prop] = data[prop]; - } - } - files.push(obj); - } else if (grunt.util.kindOf(data.files) === 'object') { - for (prop in data.files) { - files.push({src: data.files[prop], dest: grunt.config.process(prop)}); - } - } else if (Array.isArray(data.files)) { - data.files.forEach(function(obj) { - var prop; - if ('src' in obj || 'dest' in obj) { - files.push(obj); - } else { - for (prop in obj) { - files.push({src: obj[prop], dest: grunt.config.process(prop)}); - } - } - }); - } - } else { - files.push({src: data, dest: grunt.config.process(target)}); - } - - // If no src/dest or files were specified, return an empty files array. - if (files.length === 0) { - grunt.verbose.writeln('File: ' + '[no files]'.yellow); - return []; - } - - // Process all normalized file objects. - files = grunt.util._(files).chain().forEach(function(obj) { - if (!('src' in obj) || !obj.src) { return; } - // Normalize .src properties to flattened array. - if (Array.isArray(obj.src)) { - obj.src = grunt.util._.flatten(obj.src); - } else { - obj.src = [obj.src]; - } - }).map(function(obj) { - // Build options object, removing unwanted properties. - var expandOptions = grunt.util._.extend({}, obj); - delete expandOptions.src; - delete expandOptions.dest; - - // Expand file mappings. - if (obj.expand) { - return grunt.file.expandMapping(obj.src, obj.dest, expandOptions).map(function(mapObj) { - // Copy obj properties to result. - var result = grunt.util._.extend({}, obj); - // Make a clone of the orig obj available. - result.orig = grunt.util._.extend({}, obj); - // Set .src and .dest, processing both as templates. - result.src = grunt.config.process(mapObj.src); - result.dest = grunt.config.process(mapObj.dest); - // Remove unwanted properties. - ['expand', 'cwd', 'flatten', 'rename', 'ext'].forEach(function(prop) { - delete result[prop]; - }); - return result; - }); - } - - // Copy obj properties to result, adding an .orig property. - var result = grunt.util._.extend({}, obj); - // Make a clone of the orig obj available. - result.orig = grunt.util._.extend({}, obj); - - if ('src' in result) { - // Expose an expand-on-demand getter method as .src. - Object.defineProperty(result, 'src', { - enumerable: true, - get: function fn() { - var src; - if (!('result' in fn)) { - src = obj.src; - // If src is an array, flatten it. Otherwise, make it into an array. - src = Array.isArray(src) ? grunt.util._.flatten(src) : [src]; - // Expand src files, memoizing result. - fn.result = grunt.file.expand(expandOptions, src); - } - return fn.result; - } - }); - } - - if ('dest' in result) { - result.dest = obj.dest; - } - - return result; - }).flatten().value(); - - // Log this.file src and dest properties when --verbose is specified. - if (grunt.option('verbose')) { - files.forEach(function(obj) { - var output = []; - if ('src' in obj) { - output.push(obj.src.length > 0 ? grunt.log.wordlist(obj.src) : '[no src]'.yellow); - } - if ('dest' in obj) { - output.push('-> ' + (obj.dest ? String(obj.dest).cyan : '[no dest]'.yellow)); - } - if (output.length > 0) { - grunt.verbose.writeln('Files: ' + output.join(' ')); - } - }); - } - - return files; -}; - -// This is the most common "multi task" pattern. -task.registerMultiTask = function(name, info, fn) { - // If optional "info" string is omitted, shuffle arguments a bit. - if (fn == null) { - fn = info; - info = 'Custom multi task.'; - } - // Store a reference to the task object, in case the task gets renamed. - var thisTask; - task.registerTask(name, info, function(target) { - // Guaranteed to always be the actual task name. - var name = thisTask.name; - // Arguments (sans target) as an array. - this.args = grunt.util.toArray(arguments).slice(1); - // If a target wasn't specified, run this task once for each target. - if (!target || target === '*') { - return task.runAllTargets(name, this.args); - } else if (!isValidMultiTaskTarget(target)) { - throw new Error('Invalid target "' + target + '" specified.'); - } - // Fail if any required config properties have been omitted. - this.requiresConfig([name, target]); - // Return an options object with the specified defaults overwritten by task- - // and/or target-specific overrides, via the "options" property. - this.options = function() { - var targetObj = grunt.config([name, target]); - var args = [{}].concat(grunt.util.toArray(arguments)).concat([ - grunt.config([name, 'options']), - grunt.util.kindOf(targetObj) === 'object' ? targetObj.options : {} - ]); - var options = grunt.util._.extend.apply(null, args); - grunt.verbose.writeflags(options, 'Options'); - return options; - }; - // Expose data on `this` (as well as task.current). - this.data = grunt.config([name, target]); - // Expose normalized files object. - this.files = task.normalizeMultiTaskFiles(this.data, target); - // Expose normalized, flattened, uniqued array of src files. - Object.defineProperty(this, 'filesSrc', { - enumerable: true, - get: function() { - return grunt.util._(this.files).chain().pluck('src').flatten().uniq().value(); - }.bind(this) - }); - // Expose the current target. - this.target = target; - // Recreate flags object so that the target isn't set as a flag. - this.flags = {}; - this.args.forEach(function(arg) { this.flags[arg] = true; }, this); - // Call original task function, passing in the target and any other args. - return fn.apply(this, this.args); - }); - - thisTask = task._tasks[name]; - thisTask.multi = true; -}; - -// Init tasks don't require properties in config, and as such will preempt -// config loading errors. -task.registerInitTask = function(name, info, fn) { - task.registerTask(name, info, fn); - task._tasks[name].init = true; -}; - -// Override built-in renameTask to use the registry. -task.renameTask = function(oldname, newname) { - // Add and remove task. - registry.untasks.push(oldname); - registry.tasks.push(newname); - // Actually rename task. - return parent.renameTask.apply(task, arguments); -}; - -// If a property wasn't passed, run all task targets in turn. -task.runAllTargets = function(taskname, args) { - // Get an array of sub-property keys under the given config object. - var targets = Object.keys(grunt.config.getRaw(taskname) || {}); - // Fail if there are no actual properties to iterate over. - if (targets.length === 0) { - grunt.log.error('No "' + taskname + '" targets found.'); - return false; - } - // Iterate over all valid target properties, running a task for each. - targets.filter(isValidMultiTaskTarget).forEach(function(target) { - // Be sure to pass in any additionally specified args. - task.run([taskname, target].concat(args || []).join(':')); - }); -}; - -// Load tasks and handlers from a given tasks file. -var loadTaskStack = []; -function loadTask(filepath) { - // In case this was called recursively, save registry for later. - loadTaskStack.push(registry); - // Reset registry. - registry = {tasks: [], untasks: [], meta: {info: lastInfo, filepath: filepath}}; - var filename = path.basename(filepath); - var msg = 'Loading "' + filename + '" tasks...'; - var regCount = 0; - var fn; - try { - // Load taskfile. - fn = require(path.resolve(filepath)); - if (typeof fn === 'function') { - fn.call(grunt, grunt); - } - grunt.verbose.write(msg).ok(); - // Log registered/renamed/unregistered tasks. - ['un', ''].forEach(function(prefix) { - var list = grunt.util._.chain(registry[prefix + 'tasks']).uniq().sort().value(); - if (list.length > 0) { - regCount++; - grunt.verbose.writeln((prefix ? '- ' : '+ ') + grunt.log.wordlist(list)); - } - }); - if (regCount === 0) { - grunt.verbose.error('No tasks were registered or unregistered.'); - } - } catch(e) { - // Something went wrong. - grunt.log.write(msg).error().verbose.error(e.stack).or.error(e); - } - // Restore registry. - registry = loadTaskStack.pop() || {}; -} - -// Log a message when loading tasks. -function loadTasksMessage(info) { - // Only keep track of names of top-level loaded tasks and collections, - // not sub-tasks. - if (loadTaskDepth === 0) { lastInfo = info; } - grunt.verbose.subhead('Registering ' + info + ' tasks.'); -} - -// Load tasks and handlers from a given directory. -function loadTasks(tasksdir) { - try { - var files = grunt.file.glob.sync('*.{js,coffee}', {cwd: tasksdir, maxDepth: 1}); - // Load tasks from files. - files.forEach(function(filename) { - loadTask(path.join(tasksdir, filename)); - }); - } catch(e) { - grunt.log.verbose.error(e.stack).or.error(e); - } -} - -// Load tasks and handlers from a given directory. -task.loadTasks = function(tasksdir) { - loadTasksMessage('"' + tasksdir + '"'); - if (grunt.file.exists(tasksdir)) { - loadTasks(tasksdir); - } else { - grunt.log.error('Tasks directory "' + tasksdir + '" not found.'); - } -}; - -// Load tasks and handlers from a given locally-installed Npm module (installed -// relative to the base dir). -task.loadNpmTasks = function(name) { - loadTasksMessage('"' + name + '" local Npm module'); - var root = path.resolve('node_modules'); - var pkgfile = path.join(root, name, 'package.json'); - var pkg = grunt.file.exists(pkgfile) ? grunt.file.readJSON(pkgfile) : {keywords: []}; - - // Process collection plugins. - if (pkg.keywords && pkg.keywords.indexOf('gruntcollection') !== -1) { - loadTaskDepth++; - Object.keys(pkg.dependencies).forEach(function(depName) { - // Npm sometimes pulls dependencies out if they're shared, so find - // upwards if not found locally. - var filepath = grunt.file.findup('node_modules/' + depName, { - cwd: path.resolve('node_modules', name), - nocase: true - }); - if (filepath) { - // Load this task plugin recursively. - task.loadNpmTasks(path.relative(root, filepath)); - } - }); - loadTaskDepth--; - return; - } - - // Process task plugins. - var tasksdir = path.join(root, name, 'tasks'); - if (grunt.file.exists(tasksdir)) { - loadTasks(tasksdir); - } else { - grunt.log.error('Local Npm module "' + name + '" not found. Is it installed?'); - } -}; - -// Initialize tasks. -task.init = function(tasks, options) { - if (!options) { options = {}; } - - // Were only init tasks specified? - var allInit = tasks.length > 0 && tasks.every(function(name) { - var obj = task._taskPlusArgs(name).task; - return obj && obj.init; - }); - - // Get any local Gruntfile or tasks that might exist. Use --gruntfile override - // if specified, otherwise search the current directory or any parent. - var gruntfile = allInit ? null : grunt.option('gruntfile') || - grunt.file.findup('Gruntfile.{js,coffee}', {nocase: true}); - - var msg = 'Reading "' + (gruntfile ? path.basename(gruntfile) : '???') + '" Gruntfile...'; - if (gruntfile && grunt.file.exists(gruntfile)) { - grunt.verbose.writeln().write(msg).ok(); - // Change working directory so that all paths are relative to the - // Gruntfile's location (or the --base option, if specified). - process.chdir(grunt.option('base') || path.dirname(gruntfile)); - // Load local tasks, if the file exists. - loadTasksMessage('Gruntfile'); - loadTask(gruntfile); - } else if (options.help || allInit) { - // Don't complain about missing Gruntfile. - } else if (grunt.option('gruntfile')) { - // If --config override was specified and it doesn't exist, complain. - grunt.log.writeln().write(msg).error(); - grunt.fatal('Unable to find "' + gruntfile + '" Gruntfile.', grunt.fail.code.MISSING_GRUNTFILE); - } else if (!grunt.option('help')) { - grunt.verbose.writeln().write(msg).error(); - grunt.log.writelns( - 'A valid Gruntfile could not be found. Please see the getting ' + - 'started guide for more information on how to configure grunt: ' + - 'http://gruntjs.com/getting-started' - ); - grunt.fatal('Unable to find Gruntfile.', grunt.fail.code.MISSING_GRUNTFILE); - } - - // Load all user-specified --npm tasks. - (grunt.option('npm') || []).forEach(task.loadNpmTasks); - // Load all user-specified --tasks. - (grunt.option('tasks') || []).forEach(task.loadTasks); -}; diff --git a/node_modules/grunt/lib/grunt/template.js b/node_modules/grunt/lib/grunt/template.js deleted file mode 100644 index 0db3bdb..0000000 --- a/node_modules/grunt/lib/grunt/template.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -var grunt = require('../grunt'); - -// The module to be exported. -var template = module.exports = {}; - -// External libs. -template.date = require('dateformat'); - -// Format today's date. -template.today = function(format) { - return template.date(new Date(), format); -}; - -// Template delimiters. -var allDelimiters = {}; - -// Initialize template delimiters. -template.addDelimiters = function(name, opener, closer) { - var delimiters = allDelimiters[name] = {}; - // Used by grunt. - delimiters.opener = opener; - delimiters.closer = closer; - // Generate RegExp patterns dynamically. - var a = delimiters.opener.replace(/(.)/g, '\\$1'); - var b = '([\\s\\S]+?)' + delimiters.closer.replace(/(.)/g, '\\$1'); - // Used by Lo-Dash. - delimiters.lodash = { - evaluate: new RegExp(a + b, 'g'), - interpolate: new RegExp(a + '=' + b, 'g'), - escape: new RegExp(a + '-' + b, 'g') - }; -}; - -// The underscore default template syntax should be a pretty sane default for -// the config system. -template.addDelimiters('config', '<%', '%>'); - -// Set Lo-Dash template delimiters. -template.setDelimiters = function(name) { - // Get the appropriate delimiters. - var delimiters = allDelimiters[name in allDelimiters ? name : 'config']; - // Tell Lo-Dash which delimiters to use. - grunt.util._.templateSettings = delimiters.lodash; - // Return the delimiters. - return delimiters; -}; - -// Process template + data with Lo-Dash. -template.process = function(tmpl, options) { - if (!options) { options = {}; } - // Set delimiters, and get a opening match character. - var delimiters = template.setDelimiters(options.delimiters); - // Clone data, initializing to config data or empty object if omitted. - var data = Object.create(options.data || grunt.config.data || {}); - // Expose grunt so that grunt utilities can be accessed, but only if it - // doesn't conflict with an existing .grunt property. - if (!('grunt' in data)) { data.grunt = grunt; } - // Keep track of last change. - var last = tmpl; - try { - // As long as tmpl contains template tags, render it and get the result, - // otherwise just use the template string. - while (tmpl.indexOf(delimiters.opener) >= 0) { - tmpl = grunt.util._.template(tmpl, data); - // Abort if template didn't change - nothing left to process! - if (tmpl === last) { break; } - last = tmpl; - } - } catch (e) { - // In upgrading to Lo-Dash (or Underscore.js 1.3.3), \n and \r in template - // tags now causes an exception to be thrown. Warn the user why this is - // happening. https://github.com/documentcloud/underscore/issues/553 - if (String(e) === 'SyntaxError: Unexpected token ILLEGAL' && /\n|\r/.test(tmpl)) { - grunt.log.errorlns('A special character was detected in this template. ' + - 'Inside template tags, the \\n and \\r special characters must be ' + - 'escaped as \\\\n and \\\\r. (grunt 0.4.0+)'); - } - // Slightly better error message. - e.message = 'An error occurred while processing a template (' + e.message + ').'; - grunt.warn(e, grunt.fail.code.TEMPLATE_ERROR); - } - // Normalize linefeeds and return. - return grunt.util.normalizelf(tmpl); -}; diff --git a/node_modules/grunt/lib/grunt/util.js b/node_modules/grunt/lib/grunt/util.js deleted file mode 100644 index d9e1da3..0000000 --- a/node_modules/grunt/lib/grunt/util.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -'use strict'; - -// Nodejs libs. -var spawn = require('child_process').spawn; -var nodeUtil = require('util'); -var path = require('path'); - -// The module to be exported. -var util = module.exports = {}; - -// A few internal utilites, exposed. -util.task = require('../util/task'); -util.namespace = require('getobject'); - -// External libs. -util.hooker = require('hooker'); -util.async = require('async'); -var _ = util._ = require('lodash'); -var which = require('which').sync; -// Instead of process.exit. See https://github.com/cowboy/node-exit -util.exit = require('exit'); - -// Mixin Underscore.string methods. -_.str = require('underscore.string'); -_.mixin(_.str.exports()); - -// Return a function that normalizes the given function either returning a -// value or accepting a "done" callback that accepts a single value. -util.callbackify = function(fn) { - return function callbackable() { - // Invoke original function, getting its result. - var result = fn.apply(this, arguments); - // If the same number or less arguments were specified than fn accepts, - // assume the "done" callback was already handled. - var length = arguments.length; - if (length === fn.length) { return; } - // Otherwise, if the last argument is a function, assume it is a "done" - // callback and call it. - var done = arguments[length - 1]; - if (typeof done === 'function') { done(result); } - }; -}; - -// Create a new Error object, with an origError property that will be dumped -// if grunt was run with the --debug=9 option. -util.error = function(err, origError) { - if (!nodeUtil.isError(err)) { err = new Error(err); } - if (origError) { err.origError = origError; } - return err; -}; - -// The line feed char for the current system. -util.linefeed = process.platform === 'win32' ? '\r\n' : '\n'; - -// Normalize linefeeds in a string. -util.normalizelf = function(str) { - return str.replace(/\r\n|\n/g, util.linefeed); -}; - -// What "kind" is a value? -// I really need to rework https://github.com/cowboy/javascript-getclass -var kindsOf = {}; -'Number String Boolean Function RegExp Array Date Error'.split(' ').forEach(function(k) { - kindsOf['[object ' + k + ']'] = k.toLowerCase(); -}); -util.kindOf = function(value) { - // Null or undefined. - if (value == null) { return String(value); } - // Everything else. - return kindsOf[kindsOf.toString.call(value)] || 'object'; -}; - -// Coerce something to an Array. -util.toArray = Function.call.bind(Array.prototype.slice); - -// Return the string `str` repeated `n` times. -util.repeat = function(n, str) { - return new Array(n + 1).join(str || ' '); -}; - -// Given str of "a/b", If n is 1, return "a" otherwise "b". -util.pluralize = function(n, str, separator) { - var parts = str.split(separator || '/'); - return n === 1 ? (parts[0] || '') : (parts[1] || ''); -}; - -// Recurse through objects and arrays, executing fn for each non-object. -util.recurse = function recurse(value, fn, fnContinue) { - var obj; - if (fnContinue && fnContinue(value) === false) { - // Skip value if necessary. - return value; - } else if (util.kindOf(value) === 'array') { - // If value is an array, recurse. - return value.map(function(value) { - return recurse(value, fn, fnContinue); - }); - } else if (util.kindOf(value) === 'object') { - // If value is an object, recurse. - obj = {}; - Object.keys(value).forEach(function(key) { - obj[key] = recurse(value[key], fn, fnContinue); - }); - return obj; - } else { - // Otherwise pass value into fn and return. - return fn(value); - } -}; - -// Spawn a child process, capturing its stdout and stderr. -util.spawn = function(opts, done) { - // Build a result object and pass it (among other things) into the - // done function. - var callDone = function(code, stdout, stderr) { - // Remove trailing whitespace (newline) - stdout = _.rtrim(stdout); - stderr = _.rtrim(stderr); - // Create the result object. - var result = { - stdout: stdout, - stderr: stderr, - code: code, - toString: function() { - if (code === 0) { - return stdout; - } else if ('fallback' in opts) { - return opts.fallback; - } else if (opts.grunt) { - // grunt.log.error uses standard out, to be fixed in 0.5. - return stderr || stdout; - } - return stderr; - } - }; - // On error (and no fallback) pass an error object, otherwise pass null. - done(code === 0 || 'fallback' in opts ? null : new Error(stderr), result, code); - }; - - var cmd, args; - var pathSeparatorRe = /[\\\/]/g; - if (opts.grunt) { - cmd = process.argv[0]; - args = [process.argv[1]].concat(opts.args); - } else { - // On Windows, child_process.spawn will only file .exe files in the PATH, - // not other executable types (grunt issue #155). - try { - if (!pathSeparatorRe.test(opts.cmd)) { - // Only use which if cmd has no path component. - cmd = which(opts.cmd); - } else { - cmd = opts.cmd.replace(pathSeparatorRe, path.sep); - } - } catch (err) { - callDone(127, '', String(err)); - return; - } - args = opts.args; - } - - var child = spawn(cmd, args, opts.opts); - var stdout = new Buffer(''); - var stderr = new Buffer(''); - if (child.stdout) { - child.stdout.on('data', function(buf) { - stdout = Buffer.concat([stdout, new Buffer(buf)]); - }); - } - if (child.stderr) { - child.stderr.on('data', function(buf) { - stderr = Buffer.concat([stderr, new Buffer(buf)]); - }); - } - child.on('close', function(code) { - callDone(code, stdout.toString(), stderr.toString()); - }); - return child; -}; diff --git a/node_modules/grunt/lib/util/task.js b/node_modules/grunt/lib/util/task.js deleted file mode 100644 index 680a3ab..0000000 --- a/node_modules/grunt/lib/util/task.js +++ /dev/null @@ -1,323 +0,0 @@ -/* - * grunt - * http://gruntjs.com/ - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT - */ - -(function(exports) { - - 'use strict'; - - // Construct-o-rama. - function Task() { - // Information about the currently-running task. - this.current = {}; - // Tasks. - this._tasks = {}; - // Task queue. - this._queue = []; - // Queue placeholder (for dealing with nested tasks). - this._placeholder = {placeholder: true}; - // Queue marker (for clearing the queue programmatically). - this._marker = {marker: true}; - // Options. - this._options = {}; - // Is the queue running? - this._running = false; - // Success status of completed tasks. - this._success = {}; - } - - // Expose the constructor function. - exports.Task = Task; - - // Create a new Task instance. - exports.create = function() { - return new Task(); - }; - - // If the task runner is running or an error handler is not defined, throw - // an exception. Otherwise, call the error handler directly. - Task.prototype._throwIfRunning = function(obj) { - if (this._running || !this._options.error) { - // Throw an exception that the task runner will catch. - throw obj; - } else { - // Not inside the task runner. Call the error handler and abort. - this._options.error.call({name: null}, obj); - } - }; - - // Register a new task. - Task.prototype.registerTask = function(name, info, fn) { - // If optional "info" string is omitted, shuffle arguments a bit. - if (fn == null) { - fn = info; - info = null; - } - // String or array of strings was passed instead of fn. - var tasks; - if (typeof fn !== 'function') { - // Array of task names. - tasks = this.parseArgs([fn]); - // This task function just runs the specified tasks. - fn = this.run.bind(this, fn); - fn.alias = true; - // Generate an info string if one wasn't explicitly passed. - if (!info) { - info = 'Alias for "' + tasks.join('", "') + '" task' + - (tasks.length === 1 ? '' : 's') + '.'; - } - } else if (!info) { - info = 'Custom task.'; - } - // Add task into cache. - this._tasks[name] = {name: name, info: info, fn: fn}; - // Make chainable! - return this; - }; - - // Is the specified task an alias? - Task.prototype.isTaskAlias = function(name) { - return !!this._tasks[name].fn.alias; - }; - - // Rename a task. This might be useful if you want to override the default - // behavior of a task, while retaining the old name. This is a billion times - // easier to implement than some kind of in-task "super" functionality. - Task.prototype.renameTask = function(oldname, newname) { - // Rename task. - this._tasks[newname] = this._tasks[oldname]; - // Update name property of task. - this._tasks[newname].name = newname; - // Remove old name. - delete this._tasks[oldname]; - // Make chainable! - return this; - }; - - // Argument parsing helper. Supports these signatures: - // fn('foo') // ['foo'] - // fn('foo', 'bar', 'baz') // ['foo', 'bar', 'baz'] - // fn(['foo', 'bar', 'baz']) // ['foo', 'bar', 'baz'] - Task.prototype.parseArgs = function(args) { - // Return the first argument if it's an array, otherwise return an array - // of all arguments. - return Array.isArray(args[0]) ? args[0] : [].slice.call(args); - }; - - // Split a colon-delimited string into an array, unescaping (but not - // splitting on) any \: escaped colons. - Task.prototype.splitArgs = function(str) { - if (!str) { return []; } - // Store placeholder for \\ followed by \: - str = str.replace(/\\\\/g, '\uFFFF').replace(/\\:/g, '\uFFFE'); - // Split on : - return str.split(':').map(function(s) { - // Restore place-held : followed by \\ - return s.replace(/\uFFFE/g, ':').replace(/\uFFFF/g, '\\'); - }); - }; - - // Given a task name, determine which actual task will be called, and what - // arguments will be passed into the task callback. "foo" -> task "foo", no - // args. "foo:bar:baz" -> task "foo:bar:baz" with no args (if "foo:bar:baz" - // task exists), otherwise task "foo:bar" with arg "baz" (if "foo:bar" task - // exists), otherwise task "foo" with args "bar" and "baz". - Task.prototype._taskPlusArgs = function(name) { - // Get task name / argument parts. - var parts = this.splitArgs(name); - // Start from the end, not the beginning! - var i = parts.length; - var task; - do { - // Get a task. - task = this._tasks[parts.slice(0, i).join(':')]; - // If the task doesn't exist, decrement `i`, and if `i` is greater than - // 0, repeat. - } while (!task && --i > 0); - // Just the args. - var args = parts.slice(i); - // Maybe you want to use them as flags instead of as positional args? - var flags = {}; - args.forEach(function(arg) { flags[arg] = true; }); - // The task to run and the args to run it with. - return {task: task, nameArgs: name, args: args, flags: flags}; - }; - - // Append things to queue in the correct spot. - Task.prototype._push = function(things) { - // Get current placeholder index. - var index = this._queue.indexOf(this._placeholder); - if (index === -1) { - // No placeholder, add task+args objects to end of queue. - this._queue = this._queue.concat(things); - } else { - // Placeholder exists, add task+args objects just before placeholder. - [].splice.apply(this._queue, [index, 0].concat(things)); - } - }; - - // Enqueue a task. - Task.prototype.run = function() { - // Parse arguments into an array, returning an array of task+args objects. - var things = this.parseArgs(arguments).map(this._taskPlusArgs, this); - // Throw an exception if any tasks weren't found. - var fails = things.filter(function(thing) { return !thing.task; }); - if (fails.length > 0) { - this._throwIfRunning(new Error('Task "' + fails[0].nameArgs + '" not found.')); - return this; - } - // Append things to queue in the correct spot. - this._push(things); - // Make chainable! - return this; - }; - - // Add a marker to the queue to facilitate clearing it programmatically. - Task.prototype.mark = function() { - this._push(this._marker); - // Make chainable! - return this; - }; - - // Run a task function, handling this.async / return value. - Task.prototype.runTaskFn = function(context, fn, done) { - // Async flag. - var async = false; - - // Update the internal status object and run the next task. - var complete = function(success) { - var err = null; - if (success === false) { - // Since false was passed, the task failed generically. - err = new Error('Task "' + context.nameArgs + '" failed.'); - } else if (success instanceof Error || {}.toString.call(success) === '[object Error]') { - // An error object was passed, so the task failed specifically. - err = success; - success = false; - } else { - // The task succeeded. - success = true; - } - // The task has ended, reset the current task object. - this.current = {}; - // A task has "failed" only if it returns false (async) or if the - // function returned by .async is passed false. - this._success[context.nameArgs] = success; - // If task failed, call error handler. - if (!success && this._options.error) { - this._options.error.call({name: context.name, nameArgs: context.nameArgs}, err); - } - done(err, success); - }.bind(this); - - // When called, sets the async flag and returns a function that can - // be used to continue processing the queue. - context.async = function() { - async = true; - // The returned function should execute asynchronously in case - // someone tries to do this.async()(); inside a task (WTF). - return function(success) { - setTimeout(function() { complete(success); }, 1); - }; - }; - - // Expose some information about the currently-running task. - this.current = context; - - try { - // Get the current task and run it, setting `this` inside the task - // function to be something useful. - var success = fn.call(context); - // If the async flag wasn't set, process the next task in the queue. - if (!async) { - complete(success); - } - } catch (err) { - complete(err); - } - }; - - // Begin task queue processing. Ie. run all tasks. - Task.prototype.start = function() { - // Abort if already running. - if (this._running) { return false; } - // Actually process the next task. - var nextTask = function() { - // Get next task+args object from queue. - var thing; - // Skip any placeholders or markers. - do { - thing = this._queue.shift(); - } while (thing === this._placeholder || thing === this._marker); - // If queue was empty, we're all done. - if (!thing) { - this._running = false; - if (this._options.done) { - this._options.done(); - } - return; - } - // Add a placeholder to the front of the queue. - this._queue.unshift(this._placeholder); - - // Expose some information about the currently-running task. - var context = { - // The current task name plus args, as-passed. - nameArgs: thing.nameArgs, - // The current task name. - name: thing.task.name, - // The current task arguments. - args: thing.args, - // The current arguments, available as named flags. - flags: thing.flags - }; - - // Actually run the task function (handling this.async, etc) - this.runTaskFn(context, function() { - return thing.task.fn.apply(this, this.args); - }, nextTask); - - }.bind(this); - - // Update flag. - this._running = true; - // Process the next task. - nextTask(); - }; - - // Clear remaining tasks from the queue. - Task.prototype.clearQueue = function(options) { - if (!options) { options = {}; } - if (options.untilMarker) { - this._queue.splice(0, this._queue.indexOf(this._marker) + 1); - } else { - this._queue = []; - } - // Make chainable! - return this; - }; - - // Test to see if all of the given tasks have succeeded. - Task.prototype.requires = function() { - this.parseArgs(arguments).forEach(function(name) { - var success = this._success[name]; - if (!success) { - throw new Error('Required task "' + name + - '" ' + (success === false ? 'failed' : 'must be run first') + '.'); - } - }.bind(this)); - }; - - // Override default options. - Task.prototype.options = function(options) { - Object.keys(options).forEach(function(name) { - this._options[name] = options[name]; - }.bind(this)); - }; - -}(typeof exports === 'object' && exports || this)); diff --git a/node_modules/grunt/node_modules/.bin/cake b/node_modules/grunt/node_modules/.bin/cake deleted file mode 120000 index d95f32a..0000000 --- a/node_modules/grunt/node_modules/.bin/cake +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/cake \ No newline at end of file diff --git a/node_modules/grunt/node_modules/.bin/coffee b/node_modules/grunt/node_modules/.bin/coffee deleted file mode 120000 index b57f275..0000000 --- a/node_modules/grunt/node_modules/.bin/coffee +++ /dev/null @@ -1 +0,0 @@ -../coffee-script/bin/coffee \ No newline at end of file diff --git a/node_modules/grunt/node_modules/.bin/js-yaml b/node_modules/grunt/node_modules/.bin/js-yaml deleted file mode 120000 index 9dbd010..0000000 --- a/node_modules/grunt/node_modules/.bin/js-yaml +++ /dev/null @@ -1 +0,0 @@ -../js-yaml/bin/js-yaml.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/.bin/nopt b/node_modules/grunt/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/node_modules/grunt/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/.bin/which b/node_modules/grunt/node_modules/.bin/which deleted file mode 120000 index f62471c..0000000 --- a/node_modules/grunt/node_modules/.bin/which +++ /dev/null @@ -1 +0,0 @@ -../which/bin/which \ No newline at end of file diff --git a/node_modules/grunt/node_modules/async/.gitmodules b/node_modules/grunt/node_modules/async/.gitmodules deleted file mode 100644 index a9aae98..0000000 --- a/node_modules/grunt/node_modules/async/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "deps/nodeunit"] - path = deps/nodeunit - url = git://github.com/caolan/nodeunit.git -[submodule "deps/UglifyJS"] - path = deps/UglifyJS - url = https://github.com/mishoo/UglifyJS.git -[submodule "deps/nodelint"] - path = deps/nodelint - url = https://github.com/tav/nodelint.git diff --git a/node_modules/grunt/node_modules/async/.npmignore b/node_modules/grunt/node_modules/async/.npmignore deleted file mode 100644 index 9bdfc97..0000000 --- a/node_modules/grunt/node_modules/async/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -deps -dist -test -nodelint.cfg \ No newline at end of file diff --git a/node_modules/grunt/node_modules/async/LICENSE b/node_modules/grunt/node_modules/async/LICENSE deleted file mode 100644 index b7f9d50..0000000 --- a/node_modules/grunt/node_modules/async/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2010 Caolan McMahon - -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/grunt/node_modules/async/Makefile b/node_modules/grunt/node_modules/async/Makefile deleted file mode 100644 index bad647c..0000000 --- a/node_modules/grunt/node_modules/async/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -PACKAGE = asyncjs -NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node) -CWD := $(shell pwd) -NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit -UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs -NODELINT = $(CWD)/node_modules/nodelint/nodelint - -BUILDDIR = dist - -all: clean test build - -build: $(wildcard lib/*.js) - mkdir -p $(BUILDDIR) - $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js - -test: - $(NODEUNIT) test - -clean: - rm -rf $(BUILDDIR) - -lint: - $(NODELINT) --config nodelint.cfg lib/async.js - -.PHONY: test build all diff --git a/node_modules/grunt/node_modules/async/README.md b/node_modules/grunt/node_modules/async/README.md deleted file mode 100644 index 1bbbc47..0000000 --- a/node_modules/grunt/node_modules/async/README.md +++ /dev/null @@ -1,1021 +0,0 @@ -# Async.js - -Async is a utility module which provides straight-forward, powerful functions -for working with asynchronous JavaScript. Although originally designed for -use with [node.js](http://nodejs.org), it can also be used directly in the -browser. - -Async provides around 20 functions that include the usual 'functional' -suspects (map, reduce, filter, forEach…) as well as some common patterns -for asynchronous control flow (parallel, series, waterfall…). All these -functions assume you follow the node.js convention of providing a single -callback as the last argument of your async function. - - -## Quick Examples - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - - async.parallel([ - function(){ ... }, - function(){ ... } - ], callback); - - async.series([ - function(){ ... }, - function(){ ... } - ]); - -There are many more functions available so take a look at the docs below for a -full list. This module aims to be comprehensive, so if you feel anything is -missing please create a GitHub issue for it. - - -## Download - -Releases are available for download from -[GitHub](http://github.com/caolan/async/downloads). -Alternatively, you can install using Node Package Manager (npm): - - npm install async - - -__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed - -__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped - - -## In the Browser - -So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage: - - - - - -## Documentation - -### Collections - -* [forEach](#forEach) -* [map](#map) -* [filter](#filter) -* [reject](#reject) -* [reduce](#reduce) -* [detect](#detect) -* [sortBy](#sortBy) -* [some](#some) -* [every](#every) -* [concat](#concat) - -### Control Flow - -* [series](#series) -* [parallel](#parallel) -* [whilst](#whilst) -* [until](#until) -* [waterfall](#waterfall) -* [queue](#queue) -* [auto](#auto) -* [iterator](#iterator) -* [apply](#apply) -* [nextTick](#nextTick) - -### Utils - -* [memoize](#memoize) -* [unmemoize](#unmemoize) -* [log](#log) -* [dir](#dir) -* [noConflict](#noConflict) - - -## Collections - - -### forEach(arr, iterator, callback) - -Applies an iterator function to each item in an array, in parallel. -The iterator is called with an item from the list and a callback for when it -has finished. If the iterator passes an error to this callback, the main -callback for the forEach function is immediately called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // assuming openFiles is an array of file names and saveFile is a function - // to save the modified contents of that file: - - async.forEach(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error - }); - ---------------------------------------- - - -### forEachSeries(arr, iterator, callback) - -The same as forEach only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. This means the iterator functions will complete in order. - - ---------------------------------------- - - -### forEachLimit(arr, limit, iterator, callback) - -The same as forEach only the iterator is applied to batches of items in the -array, in series. The next batch of iterators is only called once the current -one has completed processing. - -__Arguments__ - -* arr - An array to iterate over. -* limit - How many items should be in each batch. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(err) - A callback which is called after all the iterator functions - have finished, or an error has occurred. - -__Example__ - - // Assume documents is an array of JSON objects and requestApi is a - // function that interacts with a rate-limited REST api. - - async.forEachLimit(documents, 20, requestApi, function(err){ - // if any of the saves produced an error, err would equal that error - }); ---------------------------------------- - - -### map(arr, iterator, callback) - -Produces a new array of values by mapping each value in the given array through -the iterator function. The iterator is called with an item from the array and a -callback for when it has finished processing. The callback takes 2 arguments, -an error and the transformed item from the array. If the iterator passes an -error to this callback, the main callback for the map function is immediately -called with the error. - -Note, that since this function applies the iterator to each item in parallel -there is no guarantee that the iterator functions will complete in order, however -the results array will be in the same order as the original array. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a transformed item. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array of the - transformed items from the original array. - -__Example__ - - async.map(['file1','file2','file3'], fs.stat, function(err, results){ - // results is now an array of stats for each file - }); - ---------------------------------------- - - -### mapSeries(arr, iterator, callback) - -The same as map only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - - ---------------------------------------- - - -### filter(arr, iterator, callback) - -__Alias:__ select - -Returns a new array of all the values which pass an async truth test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. This operation is -performed in parallel, but the results array will be in the same order as the -original. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(results) - A callback which is called after all the iterator - functions have finished. - -__Example__ - - async.filter(['file1','file2','file3'], path.exists, function(results){ - // results now equals an array of the existing files - }); - ---------------------------------------- - - -### filterSeries(arr, iterator, callback) - -__alias:__ selectSeries - -The same as filter only the iterator is applied to each item in the array in -series. The next iterator is only called once the current one has completed -processing. The results array will be in the same order as the original. - ---------------------------------------- - - -### reject(arr, iterator, callback) - -The opposite of filter. Removes values that pass an async truth test. - ---------------------------------------- - - -### rejectSeries(arr, iterator, callback) - -The same as filter, only the iterator is applied to each item in the array -in series. - - ---------------------------------------- - - -### reduce(arr, memo, iterator, callback) - -__aliases:__ inject, foldl - -Reduces a list of values into a single value using an async iterator to return -each successive step. Memo is the initial state of the reduction. This -function only operates in series. For performance reasons, it may make sense to -split a call to this function into a parallel map, then use the normal -Array.prototype.reduce on the results. This function is for situations where -each step in the reduction needs to be async, if you can get the data before -reducing it then its probably a good idea to do so. - -__Arguments__ - -* arr - An array to iterate over. -* memo - The initial state of the reduction. -* iterator(memo, item, callback) - A function applied to each item in the - array to produce the next step in the reduction. The iterator is passed a - callback which accepts an optional error as its first argument, and the state - of the reduction as the second. If an error is passed to the callback, the - reduction is stopped and the main callback is immediately called with the - error. -* callback(err, result) - A callback which is called after all the iterator - functions have finished. Result is the reduced value. - -__Example__ - - async.reduce([1,2,3], 0, function(memo, item, callback){ - // pointless async: - process.nextTick(function(){ - callback(null, memo + item) - }); - }, function(err, result){ - // result is now equal to the last value of memo, which is 6 - }); - ---------------------------------------- - - -### reduceRight(arr, memo, iterator, callback) - -__Alias:__ foldr - -Same as reduce, only operates on the items in the array in reverse order. - - ---------------------------------------- - - -### detect(arr, iterator, callback) - -Returns the first value in a list that passes an async truth test. The -iterator is applied in parallel, meaning the first iterator to return true will -fire the detect callback with that result. That means the result might not be -the first item in the original array (in terms of order) that passes the test. - -If order within the original array is important then look at detectSeries. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - the first item in the array that passes the truth test (iterator) or the - value undefined if none passed. - -__Example__ - - async.detect(['file1','file2','file3'], path.exists, function(result){ - // result now equals the first file in the list that exists - }); - ---------------------------------------- - - -### detectSeries(arr, iterator, callback) - -The same as detect, only the iterator is applied to each item in the array -in series. This means the result is always the first in the original array (in -terms of array order) that passes the truth test. - - ---------------------------------------- - - -### sortBy(arr, iterator, callback) - -Sorts a list by the results of running each value through an async iterator. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and a value to use as the sort criteria. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is the items from - the original array sorted by the values returned by the iterator calls. - -__Example__ - - async.sortBy(['file1','file2','file3'], function(file, callback){ - fs.stat(file, function(err, stats){ - callback(err, stats.mtime); - }); - }, function(err, results){ - // results is now the original array of files sorted by - // modified date - }); - - ---------------------------------------- - - -### some(arr, iterator, callback) - -__Alias:__ any - -Returns true if at least one element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. Once any iterator -call returns true, the main callback is immediately called. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called as soon as any iterator returns - true, or after all the iterator functions have finished. Result will be - either true or false depending on the values of the async tests. - -__Example__ - - async.some(['file1','file2','file3'], path.exists, function(result){ - // if result is true then at least one of the files exists - }); - ---------------------------------------- - - -### every(arr, iterator, callback) - -__Alias:__ all - -Returns true if every element in the array satisfies an async test. -_The callback for each iterator call only accepts a single argument of true or -false, it does not accept an error argument first!_ This is in-line with the -way node libraries work with truth tests like path.exists. - -__Arguments__ - -* arr - An array to iterate over. -* iterator(item, callback) - A truth test to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed. -* callback(result) - A callback which is called after all the iterator - functions have finished. Result will be either true or false depending on - the values of the async tests. - -__Example__ - - async.every(['file1','file2','file3'], path.exists, function(result){ - // if result is true then every file exists - }); - ---------------------------------------- - - -### concat(arr, iterator, callback) - -Applies an iterator to each item in a list, concatenating the results. Returns the -concatenated list. The iterators are called in parallel, and the results are -concatenated as they return. There is no guarantee that the results array will -be returned in the original order of the arguments passed to the iterator function. - -__Arguments__ - -* arr - An array to iterate over -* iterator(item, callback) - A function to apply to each item in the array. - The iterator is passed a callback which must be called once it has completed - with an error (which can be null) and an array of results. -* callback(err, results) - A callback which is called after all the iterator - functions have finished, or an error has occurred. Results is an array containing - the concatenated results of the iterator function. - -__Example__ - - async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ - // files is now a list of filenames that exist in the 3 directories - }); - ---------------------------------------- - - -### concatSeries(arr, iterator, callback) - -Same as async.concat, but executes in series instead of parallel. - - -## Control Flow - - -### series(tasks, [callback]) - -Run an array of functions in series, each one running once the previous -function has completed. If any functions in the series pass an error to its -callback, no more functions are run and the callback for the series is -immediately called with the value of the error. Once the tasks have completed, -the results are passed to the final callback as an array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.series. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed - a callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.series([ - function(callback){ - // do some stuff ... - callback(null, 'one'); - }, - function(callback){ - // do some more stuff ... - callback(null, 'two'); - }, - ], - // optional callback - function(err, results){ - // results is now equal to ['one', 'two'] - }); - - - // an example using an object instead of an array - async.series({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equal to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### parallel(tasks, [callback]) - -Run an array of functions in parallel, without waiting until the previous -function has completed. If any of the functions pass an error to its -callback, the main callback is immediately called with the value of the error. -Once the tasks have completed, the results are passed to the final callback as an -array. - -It is also possible to use an object instead of an array. Each property will be -run as a function and the results will be passed to the final callback as an object -instead of an array. This can be a more readable way of handling results from -async.parallel. - - -__Arguments__ - -* tasks - An array or object containing functions to run, each function is passed a - callback it must call on completion. -* callback(err, results) - An optional callback to run once all the functions - have completed. This function gets an array of all the arguments passed to - the callbacks used in the array. - -__Example__ - - async.parallel([ - function(callback){ - setTimeout(function(){ - callback(null, 'one'); - }, 200); - }, - function(callback){ - setTimeout(function(){ - callback(null, 'two'); - }, 100); - }, - ], - // optional callback - function(err, results){ - // the results array will equal ['one','two'] even though - // the second function had a shorter timeout. - }); - - - // an example using an object instead of an array - async.parallel({ - one: function(callback){ - setTimeout(function(){ - callback(null, 1); - }, 200); - }, - two: function(callback){ - setTimeout(function(){ - callback(null, 2); - }, 100); - }, - }, - function(err, results) { - // results is now equals to: {one: 1, two: 2} - }); - - ---------------------------------------- - - -### whilst(test, fn, callback) - -Repeatedly call fn, while test returns true. Calls the callback when stopped, -or an error occurs. - -__Arguments__ - -* test() - synchronous truth test to perform before each execution of fn. -* fn(callback) - A function to call each time the test passes. The function is - passed a callback which must be called once it has completed with an optional - error as the first argument. -* callback(err) - A callback which is called after the test fails and repeated - execution of fn has stopped. - -__Example__ - - var count = 0; - - async.whilst( - function () { return count < 5; }, - function (callback) { - count++; - setTimeout(callback, 1000); - }, - function (err) { - // 5 seconds have passed - } - ); - - ---------------------------------------- - - -### until(test, fn, callback) - -Repeatedly call fn, until test returns true. Calls the callback when stopped, -or an error occurs. - -The inverse of async.whilst. - - ---------------------------------------- - - -### waterfall(tasks, [callback]) - -Runs an array of functions in series, each passing their results to the next in -the array. However, if any of the functions pass an error to the callback, the -next function is not executed and the main callback is immediately called with -the error. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. -* callback(err, [results]) - An optional callback to run once all the functions - have completed. This will be passed the results of the last task's callback. - - - -__Example__ - - async.waterfall([ - function(callback){ - callback(null, 'one', 'two'); - }, - function(arg1, arg2, callback){ - callback(null, 'three'); - }, - function(arg1, callback){ - // arg1 now equals 'three' - callback(null, 'done'); - } - ], function (err, result) { - // result now equals 'done' - }); - - ---------------------------------------- - - -### queue(worker, concurrency) - -Creates a queue object with the specified concurrency. Tasks added to the -queue will be processed in parallel (up to the concurrency limit). If all -workers are in progress, the task is queued until one is available. Once -a worker has completed a task, the task's callback is called. - -__Arguments__ - -* worker(task, callback) - An asynchronous function for processing a queued - task. -* concurrency - An integer for determining how many worker functions should be - run in parallel. - -__Queue objects__ - -The queue object returned by this function has the following properties and -methods: - -* length() - a function returning the number of items waiting to be processed. -* concurrency - an integer for determining how many worker functions should be - run in parallel. This property can be changed after a queue is created to - alter the concurrency on-the-fly. -* push(task, [callback]) - add a new task to the queue, the callback is called - once the worker has finished processing the task. - instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list. -* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued -* empty - a callback that is called when the last item from the queue is given to a worker -* drain - a callback that is called when the last item from the queue has returned from the worker - -__Example__ - - // create a queue object with concurrency 2 - - var q = async.queue(function (task, callback) { - console.log('hello ' + task.name); - callback(); - }, 2); - - - // assign a callback - q.drain = function() { - console.log('all items have been processed'); - } - - // add some items to the queue - - q.push({name: 'foo'}, function (err) { - console.log('finished processing foo'); - }); - q.push({name: 'bar'}, function (err) { - console.log('finished processing bar'); - }); - - // add some items to the queue (batch-wise) - - q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { - console.log('finished processing bar'); - }); - - ---------------------------------------- - - -### auto(tasks, [callback]) - -Determines the best order for running functions based on their requirements. -Each function can optionally depend on other functions being completed first, -and each function is run as soon as its requirements are satisfied. If any of -the functions pass an error to their callback, that function will not complete -(so any other functions depending on it will not run) and the main callback -will be called immediately with the error. Functions also receive an object -containing the results of functions which have completed so far. - -__Arguments__ - -* tasks - An object literal containing named functions or an array of - requirements, with the function itself the last item in the array. The key - used for each function or array is used when specifying requirements. The - syntax is easier to understand by looking at the example. -* callback(err, results) - An optional callback which is called when all the - tasks have been completed. The callback will receive an error as an argument - if any tasks pass an error to their callback. If all tasks complete - successfully, it will receive an object containing their results. - -__Example__ - - async.auto({ - get_data: function(callback){ - // async code to get some data - }, - make_folder: function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - }, - write_file: ['get_data', 'make_folder', function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - callback(null, filename); - }], - email_link: ['write_file', function(callback, results){ - // once the file is written let's email a link to it... - // results.write_file contains the filename returned by write_file. - }] - }); - -This is a fairly trivial example, but to do this using the basic parallel and -series functions would look like this: - - async.parallel([ - function(callback){ - // async code to get some data - }, - function(callback){ - // async code to create a directory to store a file in - // this is run at the same time as getting the data - } - ], - function(results){ - async.series([ - function(callback){ - // once there is some data and the directory exists, - // write the data to a file in the directory - }, - email_link: function(callback){ - // once the file is written let's email a link to it... - } - ]); - }); - -For a complicated series of async tasks using the auto function makes adding -new tasks much easier and makes the code more readable. - - ---------------------------------------- - - -### iterator(tasks) - -Creates an iterator function which calls the next function in the array, -returning a continuation to call the next one after that. Its also possible to -'peek' the next iterator by doing iterator.next(). - -This function is used internally by the async module but can be useful when -you want to manually control the flow of functions in series. - -__Arguments__ - -* tasks - An array of functions to run, each function is passed a callback it - must call on completion. - -__Example__ - - var iterator = async.iterator([ - function(){ sys.p('one'); }, - function(){ sys.p('two'); }, - function(){ sys.p('three'); } - ]); - - node> var iterator2 = iterator(); - 'one' - node> var iterator3 = iterator2(); - 'two' - node> iterator3(); - 'three' - node> var nextfn = iterator2.next(); - node> nextfn(); - 'three' - - ---------------------------------------- - - -### apply(function, arguments..) - -Creates a continuation function with some arguments already applied, a useful -shorthand when combined with other control flow functions. Any arguments -passed to the returned function are added to the arguments originally passed -to apply. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to automatically apply when the - continuation is called. - -__Example__ - - // using apply - - async.parallel([ - async.apply(fs.writeFile, 'testfile1', 'test1'), - async.apply(fs.writeFile, 'testfile2', 'test2'), - ]); - - - // the same process without using apply - - async.parallel([ - function(callback){ - fs.writeFile('testfile1', 'test1', callback); - }, - function(callback){ - fs.writeFile('testfile2', 'test2', callback); - }, - ]); - -It's possible to pass any number of additional arguments when calling the -continuation: - - node> var fn = async.apply(sys.puts, 'one'); - node> fn('two', 'three'); - one - two - three - ---------------------------------------- - - -### nextTick(callback) - -Calls the callback on a later loop around the event loop. In node.js this just -calls process.nextTick, in the browser it falls back to setTimeout(callback, 0), -which means other higher priority events may precede the execution of the callback. - -This is used internally for browser-compatibility purposes. - -__Arguments__ - -* callback - The function to call on a later loop around the event loop. - -__Example__ - - var call_order = []; - async.nextTick(function(){ - call_order.push('two'); - // call_order now equals ['one','two] - }); - call_order.push('one') - - -## Utils - - -### memoize(fn, [hasher]) - -Caches the results of an async function. When creating a hash to store function -results against, the callback is omitted from the hash and an optional hash -function can be used. - -__Arguments__ - -* fn - the function you to proxy and cache results from. -* hasher - an optional function for generating a custom hash for storing - results, it has all the arguments applied to it apart from the callback, and - must be synchronous. - -__Example__ - - var slow_fn = function (name, callback) { - // do something - callback(null, result); - }; - var fn = async.memoize(slow_fn); - - // fn can now be used as if it were slow_fn - fn('some name', function () { - // callback - }); - - -### unmemoize(fn) - -Undoes a memoized function, reverting it to the original, unmemoized -form. Comes handy in tests. - -__Arguments__ - -* fn - the memoized function - - -### log(function, arguments) - -Logs the result of an async function to the console. Only works in node.js or -in browsers that support console.log and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.log is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, 'hello ' + name); - }, 1000); - }; - - node> async.log(hello, 'world'); - 'hello world' - - ---------------------------------------- - - -### dir(function, arguments) - -Logs the result of an async function to the console using console.dir to -display the properties of the resulting object. Only works in node.js or -in browsers that support console.dir and console.error (such as FF and Chrome). -If multiple arguments are returned from the async function, console.dir is -called on each argument in order. - -__Arguments__ - -* function - The function you want to eventually apply all arguments to. -* arguments... - Any number of arguments to apply to the function. - -__Example__ - - var hello = function(name, callback){ - setTimeout(function(){ - callback(null, {hello: name}); - }, 1000); - }; - - node> async.dir(hello, 'world'); - {hello: 'world'} - - ---------------------------------------- - - -### noConflict() - -Changes the value of async back to its original value, returning a reference to the -async object. diff --git a/node_modules/grunt/node_modules/async/index.js b/node_modules/grunt/node_modules/async/index.js deleted file mode 100644 index 8e23845..0000000 --- a/node_modules/grunt/node_modules/async/index.js +++ /dev/null @@ -1,3 +0,0 @@ -// This file is just added for convenience so this repository can be -// directly checked out into a project's deps folder -module.exports = require('./lib/async'); diff --git a/node_modules/grunt/node_modules/async/lib/async.js b/node_modules/grunt/node_modules/async/lib/async.js deleted file mode 100644 index 7cc4f5e..0000000 --- a/node_modules/grunt/node_modules/async/lib/async.js +++ /dev/null @@ -1,692 +0,0 @@ -/*global setTimeout: false, console: false */ -(function () { - - var async = {}; - - // global on the server, window in the browser - var root = this, - previous_async = root.async; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = async; - } - else { - root.async = async; - } - - async.noConflict = function () { - root.async = previous_async; - return async; - }; - - //// cross-browser compatiblity functions //// - - var _forEach = function (arr, iterator) { - if (arr.forEach) { - return arr.forEach(iterator); - } - for (var i = 0; i < arr.length; i += 1) { - iterator(arr[i], i, arr); - } - }; - - var _map = function (arr, iterator) { - if (arr.map) { - return arr.map(iterator); - } - var results = []; - _forEach(arr, function (x, i, a) { - results.push(iterator(x, i, a)); - }); - return results; - }; - - var _reduce = function (arr, iterator, memo) { - if (arr.reduce) { - return arr.reduce(iterator, memo); - } - _forEach(arr, function (x, i, a) { - memo = iterator(memo, x, i, a); - }); - return memo; - }; - - var _keys = function (obj) { - if (Object.keys) { - return Object.keys(obj); - } - var keys = []; - for (var k in obj) { - if (obj.hasOwnProperty(k)) { - keys.push(k); - } - } - return keys; - }; - - //// exported async module functions //// - - //// nextTick implementation with browser-compatible fallback //// - if (typeof process === 'undefined' || !(process.nextTick)) { - async.nextTick = function (fn) { - setTimeout(fn, 0); - }; - } - else { - async.nextTick = process.nextTick; - } - - async.forEach = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - _forEach(arr, function (x) { - iterator(x, function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - } - }); - }); - }; - - async.forEachSeries = function (arr, iterator, callback) { - callback = callback || function () {}; - if (!arr.length) { - return callback(); - } - var completed = 0; - var iterate = function () { - iterator(arr[completed], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - if (completed === arr.length) { - callback(null); - } - else { - iterate(); - } - } - }); - }; - iterate(); - }; - - async.forEachLimit = function (arr, limit, iterator, callback) { - callback = callback || function () {}; - if (!arr.length || limit <= 0) { - return callback(); - } - var completed = 0; - var started = 0; - var running = 0; - - (function replenish () { - if (completed === arr.length) { - return callback(); - } - - while (running < limit && started < arr.length) { - started += 1; - running += 1; - iterator(arr[started - 1], function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - completed += 1; - running -= 1; - if (completed === arr.length) { - callback(); - } - else { - replenish(); - } - } - }); - } - })(); - }; - - - var doParallel = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEach].concat(args)); - }; - }; - var doSeries = function (fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - return fn.apply(null, [async.forEachSeries].concat(args)); - }; - }; - - - var _asyncMap = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (err, v) { - results[x.index] = v; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - }; - async.map = doParallel(_asyncMap); - async.mapSeries = doSeries(_asyncMap); - - - // reduce only has a series version, as doing reduce in parallel won't - // work in many situations. - async.reduce = function (arr, memo, iterator, callback) { - async.forEachSeries(arr, function (x, callback) { - iterator(memo, x, function (err, v) { - memo = v; - callback(err); - }); - }, function (err) { - callback(err, memo); - }); - }; - // inject alias - async.inject = async.reduce; - // foldl alias - async.foldl = async.reduce; - - async.reduceRight = function (arr, memo, iterator, callback) { - var reversed = _map(arr, function (x) { - return x; - }).reverse(); - async.reduce(reversed, memo, iterator, callback); - }; - // foldr alias - async.foldr = async.reduceRight; - - var _filter = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.filter = doParallel(_filter); - async.filterSeries = doSeries(_filter); - // select alias - async.select = async.filter; - async.selectSeries = async.filterSeries; - - var _reject = function (eachfn, arr, iterator, callback) { - var results = []; - arr = _map(arr, function (x, i) { - return {index: i, value: x}; - }); - eachfn(arr, function (x, callback) { - iterator(x.value, function (v) { - if (!v) { - results.push(x); - } - callback(); - }); - }, function (err) { - callback(_map(results.sort(function (a, b) { - return a.index - b.index; - }), function (x) { - return x.value; - })); - }); - }; - async.reject = doParallel(_reject); - async.rejectSeries = doSeries(_reject); - - var _detect = function (eachfn, arr, iterator, main_callback) { - eachfn(arr, function (x, callback) { - iterator(x, function (result) { - if (result) { - main_callback(x); - main_callback = function () {}; - } - else { - callback(); - } - }); - }, function (err) { - main_callback(); - }); - }; - async.detect = doParallel(_detect); - async.detectSeries = doSeries(_detect); - - async.some = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (v) { - main_callback(true); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(false); - }); - }; - // any alias - async.any = async.some; - - async.every = function (arr, iterator, main_callback) { - async.forEach(arr, function (x, callback) { - iterator(x, function (v) { - if (!v) { - main_callback(false); - main_callback = function () {}; - } - callback(); - }); - }, function (err) { - main_callback(true); - }); - }; - // all alias - async.all = async.every; - - async.sortBy = function (arr, iterator, callback) { - async.map(arr, function (x, callback) { - iterator(x, function (err, criteria) { - if (err) { - callback(err); - } - else { - callback(null, {value: x, criteria: criteria}); - } - }); - }, function (err, results) { - if (err) { - return callback(err); - } - else { - var fn = function (left, right) { - var a = left.criteria, b = right.criteria; - return a < b ? -1 : a > b ? 1 : 0; - }; - callback(null, _map(results.sort(fn), function (x) { - return x.value; - })); - } - }); - }; - - async.auto = function (tasks, callback) { - callback = callback || function () {}; - var keys = _keys(tasks); - if (!keys.length) { - return callback(null); - } - - var results = {}; - - var listeners = []; - var addListener = function (fn) { - listeners.unshift(fn); - }; - var removeListener = function (fn) { - for (var i = 0; i < listeners.length; i += 1) { - if (listeners[i] === fn) { - listeners.splice(i, 1); - return; - } - } - }; - var taskComplete = function () { - _forEach(listeners.slice(0), function (fn) { - fn(); - }); - }; - - addListener(function () { - if (_keys(results).length === keys.length) { - callback(null, results); - callback = function () {}; - } - }); - - _forEach(keys, function (k) { - var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k]; - var taskCallback = function (err) { - if (err) { - callback(err); - // stop subsequent errors hitting callback multiple times - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - taskComplete(); - } - }; - var requires = task.slice(0, Math.abs(task.length - 1)) || []; - var ready = function () { - return _reduce(requires, function (a, x) { - return (a && results.hasOwnProperty(x)); - }, true) && !results.hasOwnProperty(k); - }; - if (ready()) { - task[task.length - 1](taskCallback, results); - } - else { - var listener = function () { - if (ready()) { - removeListener(listener); - task[task.length - 1](taskCallback, results); - } - }; - addListener(listener); - } - }); - }; - - async.waterfall = function (tasks, callback) { - callback = callback || function () {}; - if (!tasks.length) { - return callback(); - } - var wrapIterator = function (iterator) { - return function (err) { - if (err) { - callback(err); - callback = function () {}; - } - else { - var args = Array.prototype.slice.call(arguments, 1); - var next = iterator.next(); - if (next) { - args.push(wrapIterator(next)); - } - else { - args.push(callback); - } - async.nextTick(function () { - iterator.apply(null, args); - }); - } - }; - }; - wrapIterator(async.iterator(tasks))(); - }; - - async.parallel = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.map(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEach(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.series = function (tasks, callback) { - callback = callback || function () {}; - if (tasks.constructor === Array) { - async.mapSeries(tasks, function (fn, callback) { - if (fn) { - fn(function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - callback.call(null, err, args); - }); - } - }, callback); - } - else { - var results = {}; - async.forEachSeries(_keys(tasks), function (k, callback) { - tasks[k](function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (args.length <= 1) { - args = args[0]; - } - results[k] = args; - callback(err); - }); - }, function (err) { - callback(err, results); - }); - } - }; - - async.iterator = function (tasks) { - var makeCallback = function (index) { - var fn = function () { - if (tasks.length) { - tasks[index].apply(null, arguments); - } - return fn.next(); - }; - fn.next = function () { - return (index < tasks.length - 1) ? makeCallback(index + 1): null; - }; - return fn; - }; - return makeCallback(0); - }; - - async.apply = function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - return function () { - return fn.apply( - null, args.concat(Array.prototype.slice.call(arguments)) - ); - }; - }; - - var _concat = function (eachfn, arr, fn, callback) { - var r = []; - eachfn(arr, function (x, cb) { - fn(x, function (err, y) { - r = r.concat(y || []); - cb(err); - }); - }, function (err) { - callback(err, r); - }); - }; - async.concat = doParallel(_concat); - async.concatSeries = doSeries(_concat); - - async.whilst = function (test, iterator, callback) { - if (test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.whilst(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.until = function (test, iterator, callback) { - if (!test()) { - iterator(function (err) { - if (err) { - return callback(err); - } - async.until(test, iterator, callback); - }); - } - else { - callback(); - } - }; - - async.queue = function (worker, concurrency) { - var workers = 0; - var q = { - tasks: [], - concurrency: concurrency, - saturated: null, - empty: null, - drain: null, - push: function (data, callback) { - if(data.constructor !== Array) { - data = [data]; - } - _forEach(data, function(task) { - q.tasks.push({ - data: task, - callback: typeof callback === 'function' ? callback : null - }); - if (q.saturated && q.tasks.length == concurrency) { - q.saturated(); - } - async.nextTick(q.process); - }); - }, - process: function () { - if (workers < q.concurrency && q.tasks.length) { - var task = q.tasks.shift(); - if(q.empty && q.tasks.length == 0) q.empty(); - workers += 1; - worker(task.data, function () { - workers -= 1; - if (task.callback) { - task.callback.apply(task, arguments); - } - if(q.drain && q.tasks.length + workers == 0) q.drain(); - q.process(); - }); - } - }, - length: function () { - return q.tasks.length; - }, - running: function () { - return workers; - } - }; - return q; - }; - - var _console_fn = function (name) { - return function (fn) { - var args = Array.prototype.slice.call(arguments, 1); - fn.apply(null, args.concat([function (err) { - var args = Array.prototype.slice.call(arguments, 1); - if (typeof console !== 'undefined') { - if (err) { - if (console.error) { - console.error(err); - } - } - else if (console[name]) { - _forEach(args, function (x) { - console[name](x); - }); - } - } - }])); - }; - }; - async.log = _console_fn('log'); - async.dir = _console_fn('dir'); - /*async.info = _console_fn('info'); - async.warn = _console_fn('warn'); - async.error = _console_fn('error');*/ - - async.memoize = function (fn, hasher) { - var memo = {}; - var queues = {}; - hasher = hasher || function (x) { - return x; - }; - var memoized = function () { - var args = Array.prototype.slice.call(arguments); - var callback = args.pop(); - var key = hasher.apply(null, args); - if (key in memo) { - callback.apply(null, memo[key]); - } - else if (key in queues) { - queues[key].push(callback); - } - else { - queues[key] = [callback]; - fn.apply(null, args.concat([function () { - memo[key] = arguments; - var q = queues[key]; - delete queues[key]; - for (var i = 0, l = q.length; i < l; i++) { - q[i].apply(null, arguments); - } - }])); - } - }; - memoized.unmemoized = fn; - return memoized; - }; - - async.unmemoize = function (fn) { - return function () { - return (fn.unmemoized || fn).apply(null, arguments); - }; - }; - -}()); diff --git a/node_modules/grunt/node_modules/async/package.json b/node_modules/grunt/node_modules/async/package.json deleted file mode 100644 index 4f74950..0000000 --- a/node_modules/grunt/node_modules/async/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "async", - "description": "Higher-order functions and common patterns for asynchronous code", - "main": "./index", - "author": { - "name": "Caolan McMahon" - }, - "version": "0.1.22", - "repository": { - "type": "git", - "url": "http://github.com/caolan/async.git" - }, - "bugs": { - "url": "http://github.com/caolan/async/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://github.com/caolan/async/raw/master/LICENSE" - } - ], - "devDependencies": { - "nodeunit": ">0.0.0", - "uglify-js": "1.2.x", - "nodelint": ">0.0.0" - }, - "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser.\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, forEach…) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfall…). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n async.parallel([\n function(){ ... },\n function(){ ... }\n ], callback);\n\n async.series([\n function(){ ... },\n function(){ ... }\n ]);\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n\n## Download\n\nReleases are available for download from\n[GitHub](http://github.com/caolan/async/downloads).\nAlternatively, you can install using Node Package Manager (npm):\n\n npm install async\n\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed\n\n__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped\n\n\n## In the Browser\n\nSo far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n \n \n\n\n## Documentation\n\n### Collections\n\n* [forEach](#forEach)\n* [map](#map)\n* [filter](#filter)\n* [reject](#reject)\n* [reduce](#reduce)\n* [detect](#detect)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [whilst](#whilst)\n* [until](#until)\n* [waterfall](#waterfall)\n* [queue](#queue)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n### forEach(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the forEach function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // assuming openFiles is an array of file names and saveFile is a function\n // to save the modified contents of that file:\n\n async.forEach(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n\n---------------------------------------\n\n\n### forEachSeries(arr, iterator, callback)\n\nThe same as forEach only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n### forEachLimit(arr, limit, iterator, callback)\n\nThe same as forEach only the iterator is applied to batches of items in the\narray, in series. The next batch of iterators is only called once the current\none has completed processing.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - How many items should be in each batch.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n // Assume documents is an array of JSON objects and requestApi is a\n // function that interacts with a rate-limited REST api.\n\n async.forEachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n });\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n async.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n });\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n async.filter(['file1','file2','file3'], path.exists, function(results){\n // results now equals an array of the existing files\n });\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as filter, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then its probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback which accepts an optional error as its first argument, and the state\n of the reduction as the second. If an error is passed to the callback, the\n reduction is stopped and the main callback is immediately called with the\n error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n async.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n }, function(err, result){\n // result is now equal to the last value of memo, which is 6\n });\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n async.detect(['file1','file2','file3'], path.exists, function(result){\n // result now equals the first file in the list that exists\n });\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and a value to use as the sort criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n async.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n }, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n });\n\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n async.some(['file1','file2','file3'], path.exists, function(result){\n // if result is true then at least one of the files exists\n });\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like path.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n async.every(['file1','file2','file3'], path.exists, function(result){\n // if result is true then every file exists\n });\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback which must be called once it has completed\n with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n });\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n },\n ],\n // optional callback\n function(err, results){\n // results is now equal to ['one', 'two']\n });\n\n\n // an example using an object instead of an array\n async.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equal to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed a\n callback it must call on completion.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets an array of all the arguments passed to\n the callbacks used in the array.\n\n__Example__\n\n async.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n },\n ],\n // optional callback\n function(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n });\n\n\n // an example using an object instead of an array\n async.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n },\n },\n function(err, results) {\n // results is now equals to: {one: 1, two: 2}\n });\n\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback which must be called once it has completed with an optional\n error as the first argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n var count = 0;\n\n async.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n );\n\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n async.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n ], function (err, result) {\n // result now equals 'done' \n });\n\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n // create a queue object with concurrency 2\n\n var q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n }, 2);\n\n\n // assign a callback\n q.drain = function() {\n console.log('all items have been processed');\n }\n\n // add some items to the queue\n\n q.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n });\n q.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n });\n\n // add some items to the queue (batch-wise)\n\n q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n });\n\n\n---------------------------------------\n\n\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The\n syntax is easier to understand by looking at the example.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. If all tasks complete\n successfully, it will receive an object containing their results.\n\n__Example__\n\n async.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n });\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n async.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n ],\n function(results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n email_link: function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n });\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. Its also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a callback it\n must call on completion.\n\n__Example__\n\n var iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n ]);\n\n node> var iterator2 = iterator();\n 'one'\n node> var iterator3 = iterator2();\n 'two'\n node> iterator3();\n 'three'\n node> var nextfn = iterator2.next();\n node> nextfn();\n 'three'\n\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n // using apply\n\n async.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n ]);\n\n\n // the same process without using apply\n\n async.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n },\n ]);\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n node> var fn = async.apply(sys.puts, 'one');\n node> fn('two', 'three');\n one\n two\n three\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setTimeout(callback, 0),\nwhich means other higher priority events may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n var call_order = [];\n async.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two]\n });\n call_order.push('one')\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n var slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n };\n var fn = async.memoize(slow_fn);\n\n // fn can now be used as if it were slow_fn\n fn('some name', function () {\n // callback\n });\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n };\n\n node> async.log(hello, 'world');\n 'hello world'\n\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n var hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n };\n\n node> async.dir(hello, 'world');\n {hello: 'world'}\n\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n", - "readmeFilename": "README.md", - "_id": "async@0.1.22", - "_from": "async@~0.1.22" -} diff --git a/node_modules/grunt/node_modules/coffee-script/.npmignore b/node_modules/grunt/node_modules/coffee-script/.npmignore deleted file mode 100644 index 21e430d..0000000 --- a/node_modules/grunt/node_modules/coffee-script/.npmignore +++ /dev/null @@ -1,11 +0,0 @@ -*.coffee -*.html -.DS_Store -.git* -Cakefile -documentation/ -examples/ -extras/coffee-script.js -raw/ -src/ -test/ diff --git a/node_modules/grunt/node_modules/coffee-script/CNAME b/node_modules/grunt/node_modules/coffee-script/CNAME deleted file mode 100644 index faadabe..0000000 --- a/node_modules/grunt/node_modules/coffee-script/CNAME +++ /dev/null @@ -1 +0,0 @@ -coffeescript.org \ No newline at end of file diff --git a/node_modules/grunt/node_modules/coffee-script/LICENSE b/node_modules/grunt/node_modules/coffee-script/LICENSE deleted file mode 100644 index dbe6b4e..0000000 --- a/node_modules/grunt/node_modules/coffee-script/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2012 Jeremy Ashkenas - -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/grunt/node_modules/coffee-script/README b/node_modules/grunt/node_modules/coffee-script/README deleted file mode 100644 index 69ee6f4..0000000 --- a/node_modules/grunt/node_modules/coffee-script/README +++ /dev/null @@ -1,51 +0,0 @@ - - { - } } { - { { } } - } }{ { - { }{ } } _____ __ __ - ( }{ }{ { ) / ____| / _|/ _| - .- { { } { }} -. | | ___ | |_| |_ ___ ___ - ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \ - |`-..________ ..-'| | |___| (_) | | | || __/ __/ - | | \_____\___/|_| |_| \___|\___| - | ;--. - | (__ \ _____ _ _ - | | ) ) / ____| (_) | | - | |/ / | (___ ___ _ __ _ _ __ | |_ - | ( / \___ \ / __| '__| | '_ \| __| - | |/ ____) | (__| | | | |_) | |_ - | | |_____/ \___|_| |_| .__/ \__| - `-.._________..-' | | - |_| - - - CoffeeScript is a little language that compiles into JavaScript. - - Install Node.js, and then the CoffeeScript compiler: - sudo bin/cake install - - Or, if you have the Node Package Manager installed: - npm install -g coffee-script - (Leave off the -g if you don't wish to install globally.) - - Execute a script: - coffee /path/to/script.coffee - - Compile a script: - coffee -c /path/to/script.coffee - - For documentation, usage, and examples, see: - http://coffeescript.org/ - - To suggest a feature, report a bug, or general discussion: - http://github.com/jashkenas/coffee-script/issues/ - - If you'd like to chat, drop by #coffeescript on Freenode IRC, - or on webchat.freenode.net. - - The source repository: - git://github.com/jashkenas/coffee-script.git - - All contributors are listed here: - http://github.com/jashkenas/coffee-script/contributors diff --git a/node_modules/grunt/node_modules/coffee-script/Rakefile b/node_modules/grunt/node_modules/coffee-script/Rakefile deleted file mode 100644 index dfb85da..0000000 --- a/node_modules/grunt/node_modules/coffee-script/Rakefile +++ /dev/null @@ -1,78 +0,0 @@ -require 'rubygems' -require 'erb' -require 'fileutils' -require 'rake/testtask' -require 'json' - -desc "Build the documentation page" -task :doc do - source = 'documentation/index.html.erb' - child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" } - at_exit { Process.kill("INT", child) } - Signal.trap("INT") { exit } - loop do - mtime = File.stat(source).mtime - if !@mtime || mtime > @mtime - rendered = ERB.new(File.read(source)).result(binding) - File.open('index.html', 'w+') {|f| f.write(rendered) } - end - @mtime = mtime - sleep 1 - end -end - -desc "Build coffee-script-source gem" -task :gem do - require 'rubygems' - require 'rubygems/package' - - gemspec = Gem::Specification.new do |s| - s.name = 'coffee-script-source' - s.version = JSON.parse(File.read('package.json'))["version"] - s.date = Time.now.strftime("%Y-%m-%d") - - s.homepage = "http://jashkenas.github.com/coffee-script/" - s.summary = "The CoffeeScript Compiler" - s.description = <<-EOS - CoffeeScript is a little language that compiles into JavaScript. - Underneath all of those embarrassing braces and semicolons, - JavaScript has always had a gorgeous object model at its heart. - CoffeeScript is an attempt to expose the good parts of JavaScript - in a simple way. - EOS - - s.files = [ - 'lib/coffee_script/coffee-script.js', - 'lib/coffee_script/source.rb' - ] - - s.authors = ['Jeremy Ashkenas'] - s.email = 'jashkenas@gmail.com' - s.rubyforge_project = 'coffee-script-source' - end - - file = File.open("coffee-script-source.gem", "w") - Gem::Package.open(file, 'w') do |pkg| - pkg.metadata = gemspec.to_yaml - - path = "lib/coffee_script/source.rb" - contents = <<-ERUBY -module CoffeeScript - module Source - def self.bundled_path - File.expand_path("../coffee-script.js", __FILE__) - end - end -end - ERUBY - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - - contents = File.read("extras/coffee-script.js") - path = "lib/coffee_script/coffee-script.js" - pkg.add_file_simple(path, 0644, contents.size) do |tar_io| - tar_io.write(contents) - end - end -end diff --git a/node_modules/grunt/node_modules/coffee-script/bin/cake b/node_modules/grunt/node_modules/coffee-script/bin/cake deleted file mode 100755 index 5965f4e..0000000 --- a/node_modules/grunt/node_modules/coffee-script/bin/cake +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var fs = require('fs'); -var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); - -require(lib + '/coffee-script/cake').run(); diff --git a/node_modules/grunt/node_modules/coffee-script/bin/coffee b/node_modules/grunt/node_modules/coffee-script/bin/coffee deleted file mode 100755 index 3d1d71c..0000000 --- a/node_modules/grunt/node_modules/coffee-script/bin/coffee +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env node - -var path = require('path'); -var fs = require('fs'); -var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); - -require(lib + '/coffee-script/command').run(); diff --git a/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf b/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf deleted file mode 100644 index 1190da5..0000000 --- a/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf +++ /dev/null @@ -1,44 +0,0 @@ -# JavaScriptLint configuration file for CoffeeScript. - -+no_return_value # function {0} does not always return a value -+duplicate_formal # duplicate formal argument {0} --equal_as_assign # test for equality (==) mistyped as assignment (=)?{0} -+var_hides_arg # variable {0} hides argument -+redeclared_var # redeclaration of {0} {1} --anon_no_return_value # anonymous function does not always return a value -+missing_semicolon # missing semicolon -+meaningless_block # meaningless block; curly braces have no impact --comma_separated_stmts # multiple statements separated by commas (use semicolons?) -+unreachable_code # unreachable code -+missing_break # missing break statement --missing_break_for_last_case # missing break statement for last case in switch --comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==) --inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement --useless_void # use of the void type may be unnecessary (void is always undefined) -+multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs -+use_of_label # use of label --block_without_braces # block statement without curly braces -+leading_decimal_point # leading decimal point may indicate a number or an object member -+trailing_decimal_point # trailing decimal point may indicate a number or an object member -+octal_number # leading zeros make an octal number -+nested_comment # nested comment -+misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma -+ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement -+empty_statement # empty statement or extra semicolon --missing_option_explicit # the "option explicit" control comment is missing -+partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag -+dup_option_explicit # duplicate "option explicit" control comment -+useless_assign # useless assignment -+ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity -+ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent) --missing_default_case # missing default case in switch statement -+duplicate_case_in_switch # duplicate case in switch statements -+default_not_at_end # the default case is not at the end of the switch statement -+legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax -+jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax -+useless_comparison # useless comparison; comparing identical expressions -+with_statement # with statement hides undeclared variables; use temporary variable instead -+trailing_comma_in_array # extra comma is not recommended in array initializers -+assign_to_function_call # assignment to a function call -+parseint_missing_radix # parseInt missing radix parameter -+lambda_assign_requires_semicolon diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/browser.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/browser.js deleted file mode 100644 index 825cbf3..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/browser.js +++ /dev/null @@ -1,92 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var CoffeeScript, runScripts; - - CoffeeScript = require('./coffee-script'); - - CoffeeScript.require = require; - - CoffeeScript["eval"] = function(code, options) { - var _ref; - if (options == null) { - options = {}; - } - if ((_ref = options.bare) == null) { - options.bare = true; - } - return eval(CoffeeScript.compile(code, options)); - }; - - CoffeeScript.run = function(code, options) { - if (options == null) { - options = {}; - } - options.bare = true; - return Function(CoffeeScript.compile(code, options))(); - }; - - if (typeof window === "undefined" || window === null) { - return; - } - - CoffeeScript.load = function(url, callback) { - var xhr; - xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP'); - xhr.open('GET', url, true); - if ('overrideMimeType' in xhr) { - xhr.overrideMimeType('text/plain'); - } - xhr.onreadystatechange = function() { - var _ref; - if (xhr.readyState === 4) { - if ((_ref = xhr.status) === 0 || _ref === 200) { - CoffeeScript.run(xhr.responseText); - } else { - throw new Error("Could not load " + url); - } - if (callback) { - return callback(); - } - } - }; - return xhr.send(null); - }; - - runScripts = function() { - var coffees, execute, index, length, s, scripts; - scripts = document.getElementsByTagName('script'); - coffees = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = scripts.length; _i < _len; _i++) { - s = scripts[_i]; - if (s.type === 'text/coffeescript') { - _results.push(s); - } - } - return _results; - })(); - index = 0; - length = coffees.length; - (execute = function() { - var script; - script = coffees[index++]; - if ((script != null ? script.type : void 0) === 'text/coffeescript') { - if (script.src) { - return CoffeeScript.load(script.src, execute); - } else { - CoffeeScript.run(script.innerHTML); - return execute(); - } - } - })(); - return null; - }; - - if (window.addEventListener) { - addEventListener('DOMContentLoaded', runScripts, false); - } else { - attachEvent('onload', runScripts); - } - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/cake.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/cake.js deleted file mode 100644 index 1523418..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/cake.js +++ /dev/null @@ -1,111 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks; - - fs = require('fs'); - - path = require('path'); - - helpers = require('./helpers'); - - optparse = require('./optparse'); - - CoffeeScript = require('./coffee-script'); - - tasks = {}; - - options = {}; - - switches = []; - - oparse = null; - - helpers.extend(global, { - task: function(name, description, action) { - var _ref; - if (!action) { - _ref = [description, action], action = _ref[0], description = _ref[1]; - } - return tasks[name] = { - name: name, - description: description, - action: action - }; - }, - option: function(letter, flag, description) { - return switches.push([letter, flag, description]); - }, - invoke: function(name) { - if (!tasks[name]) { - missingTask(name); - } - return tasks[name].action(options); - } - }); - - exports.run = function() { - var arg, args, _i, _len, _ref, _results; - global.__originalDirname = fs.realpathSync('.'); - process.chdir(cakefileDirectory(__originalDirname)); - args = process.argv.slice(2); - CoffeeScript.run(fs.readFileSync('Cakefile').toString(), { - filename: 'Cakefile' - }); - oparse = new optparse.OptionParser(switches); - if (!args.length) { - return printTasks(); - } - try { - options = oparse.parse(args); - } catch (e) { - return fatalError("" + e); - } - _ref = options["arguments"]; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - arg = _ref[_i]; - _results.push(invoke(arg)); - } - return _results; - }; - - printTasks = function() { - var cakefilePath, desc, name, relative, spaces, task; - relative = path.relative || path.resolve; - cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile'); - console.log("" + cakefilePath + " defines the following tasks:\n"); - for (name in tasks) { - task = tasks[name]; - spaces = 20 - name.length; - spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; - desc = task.description ? "# " + task.description : ''; - console.log("cake " + name + spaces + " " + desc); - } - if (switches.length) { - return console.log(oparse.help()); - } - }; - - fatalError = function(message) { - console.error(message + '\n'); - console.log('To see a list of all tasks/options, run "cake"'); - return process.exit(1); - }; - - missingTask = function(task) { - return fatalError("No such task: " + task); - }; - - cakefileDirectory = function(dir) { - var parent; - if (path.existsSync(path.join(dir, 'Cakefile'))) { - return dir; - } - parent = path.normalize(path.join(dir, '..')); - if (parent !== dir) { - return cakefileDirectory(parent); - } - throw new Error("Cakefile not found in " + (process.cwd())); - }; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js deleted file mode 100644 index c43fa49..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js +++ /dev/null @@ -1,167 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var Lexer, RESERVED, compile, fs, lexer, parser, path, vm, _ref, - __hasProp = {}.hasOwnProperty; - - fs = require('fs'); - - path = require('path'); - - _ref = require('./lexer'), Lexer = _ref.Lexer, RESERVED = _ref.RESERVED; - - parser = require('./parser').parser; - - vm = require('vm'); - - if (require.extensions) { - require.extensions['.coffee'] = function(module, filename) { - var content; - content = compile(fs.readFileSync(filename, 'utf8'), { - filename: filename - }); - return module._compile(content, filename); - }; - } else if (require.registerExtension) { - require.registerExtension('.coffee', function(content) { - return compile(content); - }); - } - - exports.VERSION = '1.3.3'; - - exports.RESERVED = RESERVED; - - exports.helpers = require('./helpers'); - - exports.compile = compile = function(code, options) { - var header, js, merge; - if (options == null) { - options = {}; - } - merge = exports.helpers.merge; - try { - js = (parser.parse(lexer.tokenize(code))).compile(options); - if (!options.header) { - return js; - } - } catch (err) { - if (options.filename) { - err.message = "In " + options.filename + ", " + err.message; - } - throw err; - } - header = "Generated by CoffeeScript " + this.VERSION; - return "// " + header + "\n" + js; - }; - - exports.tokens = function(code, options) { - return lexer.tokenize(code, options); - }; - - exports.nodes = function(source, options) { - if (typeof source === 'string') { - return parser.parse(lexer.tokenize(source, options)); - } else { - return parser.parse(source); - } - }; - - exports.run = function(code, options) { - var mainModule; - if (options == null) { - options = {}; - } - mainModule = require.main; - mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.'; - mainModule.moduleCache && (mainModule.moduleCache = {}); - mainModule.paths = require('module')._nodeModulePaths(path.dirname(fs.realpathSync(options.filename))); - if (path.extname(mainModule.filename) !== '.coffee' || require.extensions) { - return mainModule._compile(compile(code, options), mainModule.filename); - } else { - return mainModule._compile(code, mainModule.filename); - } - }; - - exports["eval"] = function(code, options) { - var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref1, _ref2, _require; - if (options == null) { - options = {}; - } - if (!(code = code.trim())) { - return; - } - Script = vm.Script; - if (Script) { - if (options.sandbox != null) { - if (options.sandbox instanceof Script.createContext().constructor) { - sandbox = options.sandbox; - } else { - sandbox = Script.createContext(); - _ref1 = options.sandbox; - for (k in _ref1) { - if (!__hasProp.call(_ref1, k)) continue; - v = _ref1[k]; - sandbox[k] = v; - } - } - sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox; - } else { - sandbox = global; - } - sandbox.__filename = options.filename || 'eval'; - sandbox.__dirname = path.dirname(sandbox.__filename); - if (!(sandbox !== global || sandbox.module || sandbox.require)) { - Module = require('module'); - sandbox.module = _module = new Module(options.modulename || 'eval'); - sandbox.require = _require = function(path) { - return Module._load(path, _module, true); - }; - _module.filename = sandbox.__filename; - _ref2 = Object.getOwnPropertyNames(require); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - r = _ref2[_i]; - if (r !== 'paths') { - _require[r] = require[r]; - } - } - _require.paths = _module.paths = Module._nodeModulePaths(process.cwd()); - _require.resolve = function(request) { - return Module._resolveFilename(request, _module); - }; - } - } - o = {}; - for (k in options) { - if (!__hasProp.call(options, k)) continue; - v = options[k]; - o[k] = v; - } - o.bare = true; - js = compile(code, o); - if (sandbox === global) { - return vm.runInThisContext(js); - } else { - return vm.runInContext(js, sandbox); - } - }; - - lexer = new Lexer; - - parser.lexer = { - lex: function() { - var tag, _ref1; - _ref1 = this.tokens[this.pos++] || [''], tag = _ref1[0], this.yytext = _ref1[1], this.yylineno = _ref1[2]; - return tag; - }, - setInput: function(tokens) { - this.tokens = tokens; - return this.pos = 0; - }, - upcomingInput: function() { - return ""; - } - }; - - parser.yy = require('./nodes'); - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/command.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/command.js deleted file mode 100644 index e02da9f..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/command.js +++ /dev/null @@ -1,500 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, forkNode, fs, helpers, hidden, joinTimeout, lint, loadRequires, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref; - - fs = require('fs'); - - path = require('path'); - - helpers = require('./helpers'); - - optparse = require('./optparse'); - - CoffeeScript = require('./coffee-script'); - - _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec; - - EventEmitter = require('events').EventEmitter; - - helpers.extend(CoffeeScript, new EventEmitter); - - printLine = function(line) { - return process.stdout.write(line + '\n'); - }; - - printWarn = function(line) { - return process.stderr.write(line + '\n'); - }; - - hidden = function(file) { - return /^\.|~$/.test(file); - }; - - BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.'; - - SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-r', '--require [FILE*]', 'require a library before executing your script'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']]; - - opts = {}; - - sources = []; - - sourceCode = []; - - notSources = {}; - - watchers = {}; - - optionParser = null; - - exports.run = function() { - var literals, source, _i, _len, _results; - parseOptions(); - if (opts.nodejs) { - return forkNode(); - } - if (opts.help) { - return usage(); - } - if (opts.version) { - return version(); - } - if (opts.require) { - loadRequires(); - } - if (opts.interactive) { - return require('./repl'); - } - if (opts.watch && !fs.watch) { - return printWarn("The --watch feature depends on Node v0.6.0+. You are running " + process.version + "."); - } - if (opts.stdio) { - return compileStdio(); - } - if (opts["eval"]) { - return compileScript(null, sources[0]); - } - if (!sources.length) { - return require('./repl'); - } - literals = opts.run ? sources.splice(1) : []; - process.argv = process.argv.slice(0, 2).concat(literals); - process.argv[0] = 'coffee'; - process.execPath = require.main.filename; - _results = []; - for (_i = 0, _len = sources.length; _i < _len; _i++) { - source = sources[_i]; - _results.push(compilePath(source, true, path.normalize(source))); - } - return _results; - }; - - compilePath = function(source, topLevel, base) { - return fs.stat(source, function(err, stats) { - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - if (topLevel && source.slice(-7) !== '.coffee') { - source = sources[sources.indexOf(source)] = "" + source + ".coffee"; - return compilePath(source, topLevel, base); - } - if (topLevel) { - console.error("File not found: " + source); - process.exit(1); - } - return; - } - if (stats.isDirectory()) { - if (opts.watch) { - watchDir(source, base); - } - return fs.readdir(source, function(err, files) { - var file, index, _ref1, _ref2; - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - return; - } - index = sources.indexOf(source); - files = files.filter(function(file) { - return !hidden(file); - }); - [].splice.apply(sources, [index, index - index + 1].concat(_ref1 = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - _results.push(path.join(source, file)); - } - return _results; - })())), _ref1; - [].splice.apply(sourceCode, [index, index - index + 1].concat(_ref2 = files.map(function() { - return null; - }))), _ref2; - return files.forEach(function(file) { - return compilePath(path.join(source, file), false, base); - }); - }); - } else if (topLevel || path.extname(source) === '.coffee') { - if (opts.watch) { - watch(source, base); - } - return fs.readFile(source, function(err, code) { - if (err && err.code !== 'ENOENT') { - throw err; - } - if ((err != null ? err.code : void 0) === 'ENOENT') { - return; - } - return compileScript(source, code.toString(), base); - }); - } else { - notSources[source] = true; - return removeSource(source, base); - } - }); - }; - - compileScript = function(file, input, base) { - var o, options, t, task; - o = opts; - options = compileOptions(file); - try { - t = task = { - file: file, - input: input, - options: options - }; - CoffeeScript.emit('compile', task); - if (o.tokens) { - return printTokens(CoffeeScript.tokens(t.input)); - } else if (o.nodes) { - return printLine(CoffeeScript.nodes(t.input).toString().trim()); - } else if (o.run) { - return CoffeeScript.run(t.input, t.options); - } else if (o.join && t.file !== o.join) { - sourceCode[sources.indexOf(t.file)] = t.input; - return compileJoin(); - } else { - t.output = CoffeeScript.compile(t.input, t.options); - CoffeeScript.emit('success', task); - if (o.print) { - return printLine(t.output.trim()); - } else if (o.compile) { - return writeJs(t.file, t.output, base); - } else if (o.lint) { - return lint(t.file, t.output); - } - } - } catch (err) { - CoffeeScript.emit('failure', err, task); - if (CoffeeScript.listeners('failure').length) { - return; - } - if (o.watch) { - return printLine(err.message + '\x07'); - } - printWarn(err instanceof Error && err.stack || ("ERROR: " + err)); - return process.exit(1); - } - }; - - compileStdio = function() { - var code, stdin; - code = ''; - stdin = process.openStdin(); - stdin.on('data', function(buffer) { - if (buffer) { - return code += buffer.toString(); - } - }); - return stdin.on('end', function() { - return compileScript(null, code); - }); - }; - - joinTimeout = null; - - compileJoin = function() { - if (!opts.join) { - return; - } - if (!sourceCode.some(function(code) { - return code === null; - })) { - clearTimeout(joinTimeout); - return joinTimeout = wait(100, function() { - return compileScript(opts.join, sourceCode.join('\n'), opts.join); - }); - } - }; - - loadRequires = function() { - var realFilename, req, _i, _len, _ref1; - realFilename = module.filename; - module.filename = '.'; - _ref1 = opts.require; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - req = _ref1[_i]; - require(req); - } - return module.filename = realFilename; - }; - - watch = function(source, base) { - var compile, compileTimeout, prevStats, rewatch, watchErr, watcher; - prevStats = null; - compileTimeout = null; - watchErr = function(e) { - if (e.code === 'ENOENT') { - if (sources.indexOf(source) === -1) { - return; - } - try { - rewatch(); - return compile(); - } catch (e) { - removeSource(source, base, true); - return compileJoin(); - } - } else { - throw e; - } - }; - compile = function() { - clearTimeout(compileTimeout); - return compileTimeout = wait(25, function() { - return fs.stat(source, function(err, stats) { - if (err) { - return watchErr(err); - } - if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) { - return rewatch(); - } - prevStats = stats; - return fs.readFile(source, function(err, code) { - if (err) { - return watchErr(err); - } - compileScript(source, code.toString(), base); - return rewatch(); - }); - }); - }); - }; - try { - watcher = fs.watch(source, compile); - } catch (e) { - watchErr(e); - } - return rewatch = function() { - if (watcher != null) { - watcher.close(); - } - return watcher = fs.watch(source, compile); - }; - }; - - watchDir = function(source, base) { - var readdirTimeout, watcher; - readdirTimeout = null; - try { - return watcher = fs.watch(source, function() { - clearTimeout(readdirTimeout); - return readdirTimeout = wait(25, function() { - return fs.readdir(source, function(err, files) { - var file, _i, _len, _results; - if (err) { - if (err.code !== 'ENOENT') { - throw err; - } - watcher.close(); - return unwatchDir(source, base); - } - _results = []; - for (_i = 0, _len = files.length; _i < _len; _i++) { - file = files[_i]; - if (!(!hidden(file) && !notSources[file])) { - continue; - } - file = path.join(source, file); - if (sources.some(function(s) { - return s.indexOf(file) >= 0; - })) { - continue; - } - sources.push(file); - sourceCode.push(null); - _results.push(compilePath(file, false, base)); - } - return _results; - }); - }); - }); - } catch (e) { - if (e.code !== 'ENOENT') { - throw e; - } - } - }; - - unwatchDir = function(source, base) { - var file, prevSources, toRemove, _i, _len; - prevSources = sources.slice(0); - toRemove = (function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = sources.length; _i < _len; _i++) { - file = sources[_i]; - if (file.indexOf(source) >= 0) { - _results.push(file); - } - } - return _results; - })(); - for (_i = 0, _len = toRemove.length; _i < _len; _i++) { - file = toRemove[_i]; - removeSource(file, base, true); - } - if (!sources.some(function(s, i) { - return prevSources[i] !== s; - })) { - return; - } - return compileJoin(); - }; - - removeSource = function(source, base, removeJs) { - var index, jsPath; - index = sources.indexOf(source); - sources.splice(index, 1); - sourceCode.splice(index, 1); - if (removeJs && !opts.join) { - jsPath = outputPath(source, base); - return path.exists(jsPath, function(exists) { - if (exists) { - return fs.unlink(jsPath, function(err) { - if (err && err.code !== 'ENOENT') { - throw err; - } - return timeLog("removed " + source); - }); - } - }); - } - }; - - outputPath = function(source, base) { - var baseDir, dir, filename, srcDir; - filename = path.basename(source, path.extname(source)) + '.js'; - srcDir = path.dirname(source); - baseDir = base === '.' ? srcDir : srcDir.substring(base.length); - dir = opts.output ? path.join(opts.output, baseDir) : srcDir; - return path.join(dir, filename); - }; - - writeJs = function(source, js, base) { - var compile, jsDir, jsPath; - jsPath = outputPath(source, base); - jsDir = path.dirname(jsPath); - compile = function() { - if (js.length <= 0) { - js = ' '; - } - return fs.writeFile(jsPath, js, function(err) { - if (err) { - return printLine(err.message); - } else if (opts.compile && opts.watch) { - return timeLog("compiled " + source); - } - }); - }; - return path.exists(jsDir, function(exists) { - if (exists) { - return compile(); - } else { - return exec("mkdir -p " + jsDir, compile); - } - }); - }; - - wait = function(milliseconds, func) { - return setTimeout(func, milliseconds); - }; - - timeLog = function(message) { - return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message); - }; - - lint = function(file, js) { - var conf, jsl, printIt; - printIt = function(buffer) { - return printLine(file + ':\t' + buffer.toString().trim()); - }; - conf = __dirname + '/../../extras/jsl.conf'; - jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]); - jsl.stdout.on('data', printIt); - jsl.stderr.on('data', printIt); - jsl.stdin.write(js); - return jsl.stdin.end(); - }; - - printTokens = function(tokens) { - var strings, tag, token, value; - strings = (function() { - var _i, _len, _ref1, _results; - _results = []; - for (_i = 0, _len = tokens.length; _i < _len; _i++) { - token = tokens[_i]; - _ref1 = [token[0], token[1].toString().replace(/\n/, '\\n')], tag = _ref1[0], value = _ref1[1]; - _results.push("[" + tag + " " + value + "]"); - } - return _results; - })(); - return printLine(strings.join(' ')); - }; - - parseOptions = function() { - var i, o, source, _i, _len; - optionParser = new optparse.OptionParser(SWITCHES, BANNER); - o = opts = optionParser.parse(process.argv.slice(2)); - o.compile || (o.compile = !!o.output); - o.run = !(o.compile || o.print || o.lint); - o.print = !!(o.print || (o["eval"] || o.stdio && o.compile)); - sources = o["arguments"]; - for (i = _i = 0, _len = sources.length; _i < _len; i = ++_i) { - source = sources[i]; - sourceCode[i] = null; - } - }; - - compileOptions = function(filename) { - return { - filename: filename, - bare: opts.bare, - header: opts.compile - }; - }; - - forkNode = function() { - var args, nodeArgs; - nodeArgs = opts.nodejs.split(/\s+/); - args = process.argv.slice(1); - args.splice(args.indexOf('--nodejs'), 2); - return spawn(process.execPath, nodeArgs.concat(args), { - cwd: process.cwd(), - env: process.env, - customFds: [0, 1, 2] - }); - }; - - usage = function() { - return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help()); - }; - - version = function() { - return printLine("CoffeeScript version " + CoffeeScript.VERSION); - }; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/grammar.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/grammar.js deleted file mode 100644 index 5662138..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/grammar.js +++ /dev/null @@ -1,606 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap; - - Parser = require('jison').Parser; - - unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/; - - o = function(patternString, action, options) { - var match; - patternString = patternString.replace(/\s{2,}/g, ' '); - if (!action) { - return [patternString, '$$ = $1;', options]; - } - action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())"; - action = action.replace(/\bnew /g, '$&yy.'); - action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&'); - return [patternString, "$$ = " + action + ";", options]; - }; - - grammar = { - Root: [ - o('', function() { - return new Block; - }), o('Body'), o('Block TERMINATOR') - ], - Body: [ - o('Line', function() { - return Block.wrap([$1]); - }), o('Body TERMINATOR Line', function() { - return $1.push($3); - }), o('Body TERMINATOR') - ], - Line: [o('Expression'), o('Statement')], - Statement: [ - o('Return'), o('Comment'), o('STATEMENT', function() { - return new Literal($1); - }) - ], - Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')], - Block: [ - o('INDENT OUTDENT', function() { - return new Block; - }), o('INDENT Body OUTDENT', function() { - return $2; - }) - ], - Identifier: [ - o('IDENTIFIER', function() { - return new Literal($1); - }) - ], - AlphaNumeric: [ - o('NUMBER', function() { - return new Literal($1); - }), o('STRING', function() { - return new Literal($1); - }) - ], - Literal: [ - o('AlphaNumeric'), o('JS', function() { - return new Literal($1); - }), o('REGEX', function() { - return new Literal($1); - }), o('DEBUGGER', function() { - return new Literal($1); - }), o('UNDEFINED', function() { - return new Undefined; - }), o('NULL', function() { - return new Null; - }), o('BOOL', function() { - return new Bool($1); - }) - ], - Assign: [ - o('Assignable = Expression', function() { - return new Assign($1, $3); - }), o('Assignable = TERMINATOR Expression', function() { - return new Assign($1, $4); - }), o('Assignable = INDENT Expression OUTDENT', function() { - return new Assign($1, $4); - }) - ], - AssignObj: [ - o('ObjAssignable', function() { - return new Value($1); - }), o('ObjAssignable : Expression', function() { - return new Assign(new Value($1), $3, 'object'); - }), o('ObjAssignable :\ - INDENT Expression OUTDENT', function() { - return new Assign(new Value($1), $4, 'object'); - }), o('Comment') - ], - ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')], - Return: [ - o('RETURN Expression', function() { - return new Return($2); - }), o('RETURN', function() { - return new Return; - }) - ], - Comment: [ - o('HERECOMMENT', function() { - return new Comment($1); - }) - ], - Code: [ - o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() { - return new Code($2, $5, $4); - }), o('FuncGlyph Block', function() { - return new Code([], $2, $1); - }) - ], - FuncGlyph: [ - o('->', function() { - return 'func'; - }), o('=>', function() { - return 'boundfunc'; - }) - ], - OptComma: [o(''), o(',')], - ParamList: [ - o('', function() { - return []; - }), o('Param', function() { - return [$1]; - }), o('ParamList , Param', function() { - return $1.concat($3); - }), o('ParamList OptComma TERMINATOR Param', function() { - return $1.concat($4); - }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Param: [ - o('ParamVar', function() { - return new Param($1); - }), o('ParamVar ...', function() { - return new Param($1, null, true); - }), o('ParamVar = Expression', function() { - return new Param($1, $3); - }) - ], - ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')], - Splat: [ - o('Expression ...', function() { - return new Splat($1); - }) - ], - SimpleAssignable: [ - o('Identifier', function() { - return new Value($1); - }), o('Value Accessor', function() { - return $1.add($2); - }), o('Invocation Accessor', function() { - return new Value($1, [].concat($2)); - }), o('ThisProperty') - ], - Assignable: [ - o('SimpleAssignable'), o('Array', function() { - return new Value($1); - }), o('Object', function() { - return new Value($1); - }) - ], - Value: [ - o('Assignable'), o('Literal', function() { - return new Value($1); - }), o('Parenthetical', function() { - return new Value($1); - }), o('Range', function() { - return new Value($1); - }), o('This') - ], - Accessor: [ - o('. Identifier', function() { - return new Access($2); - }), o('?. Identifier', function() { - return new Access($2, 'soak'); - }), o(':: Identifier', function() { - return [new Access(new Literal('prototype')), new Access($2)]; - }), o('::', function() { - return new Access(new Literal('prototype')); - }), o('Index') - ], - Index: [ - o('INDEX_START IndexValue INDEX_END', function() { - return $2; - }), o('INDEX_SOAK Index', function() { - return extend($2, { - soak: true - }); - }) - ], - IndexValue: [ - o('Expression', function() { - return new Index($1); - }), o('Slice', function() { - return new Slice($1); - }) - ], - Object: [ - o('{ AssignList OptComma }', function() { - return new Obj($2, $1.generated); - }) - ], - AssignList: [ - o('', function() { - return []; - }), o('AssignObj', function() { - return [$1]; - }), o('AssignList , AssignObj', function() { - return $1.concat($3); - }), o('AssignList OptComma TERMINATOR AssignObj', function() { - return $1.concat($4); - }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Class: [ - o('CLASS', function() { - return new Class; - }), o('CLASS Block', function() { - return new Class(null, null, $2); - }), o('CLASS EXTENDS Expression', function() { - return new Class(null, $3); - }), o('CLASS EXTENDS Expression Block', function() { - return new Class(null, $3, $4); - }), o('CLASS SimpleAssignable', function() { - return new Class($2); - }), o('CLASS SimpleAssignable Block', function() { - return new Class($2, null, $3); - }), o('CLASS SimpleAssignable EXTENDS Expression', function() { - return new Class($2, $4); - }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() { - return new Class($2, $4, $5); - }) - ], - Invocation: [ - o('Value OptFuncExist Arguments', function() { - return new Call($1, $3, $2); - }), o('Invocation OptFuncExist Arguments', function() { - return new Call($1, $3, $2); - }), o('SUPER', function() { - return new Call('super', [new Splat(new Literal('arguments'))]); - }), o('SUPER Arguments', function() { - return new Call('super', $2); - }) - ], - OptFuncExist: [ - o('', function() { - return false; - }), o('FUNC_EXIST', function() { - return true; - }) - ], - Arguments: [ - o('CALL_START CALL_END', function() { - return []; - }), o('CALL_START ArgList OptComma CALL_END', function() { - return $2; - }) - ], - This: [ - o('THIS', function() { - return new Value(new Literal('this')); - }), o('@', function() { - return new Value(new Literal('this')); - }) - ], - ThisProperty: [ - o('@ Identifier', function() { - return new Value(new Literal('this'), [new Access($2)], 'this'); - }) - ], - Array: [ - o('[ ]', function() { - return new Arr([]); - }), o('[ ArgList OptComma ]', function() { - return new Arr($2); - }) - ], - RangeDots: [ - o('..', function() { - return 'inclusive'; - }), o('...', function() { - return 'exclusive'; - }) - ], - Range: [ - o('[ Expression RangeDots Expression ]', function() { - return new Range($2, $4, $3); - }) - ], - Slice: [ - o('Expression RangeDots Expression', function() { - return new Range($1, $3, $2); - }), o('Expression RangeDots', function() { - return new Range($1, null, $2); - }), o('RangeDots Expression', function() { - return new Range(null, $2, $1); - }), o('RangeDots', function() { - return new Range(null, null, $1); - }) - ], - ArgList: [ - o('Arg', function() { - return [$1]; - }), o('ArgList , Arg', function() { - return $1.concat($3); - }), o('ArgList OptComma TERMINATOR Arg', function() { - return $1.concat($4); - }), o('INDENT ArgList OptComma OUTDENT', function() { - return $2; - }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() { - return $1.concat($4); - }) - ], - Arg: [o('Expression'), o('Splat')], - SimpleArgs: [ - o('Expression'), o('SimpleArgs , Expression', function() { - return [].concat($1, $3); - }) - ], - Try: [ - o('TRY Block', function() { - return new Try($2); - }), o('TRY Block Catch', function() { - return new Try($2, $3[0], $3[1]); - }), o('TRY Block FINALLY Block', function() { - return new Try($2, null, null, $4); - }), o('TRY Block Catch FINALLY Block', function() { - return new Try($2, $3[0], $3[1], $5); - }) - ], - Catch: [ - o('CATCH Identifier Block', function() { - return [$2, $3]; - }) - ], - Throw: [ - o('THROW Expression', function() { - return new Throw($2); - }) - ], - Parenthetical: [ - o('( Body )', function() { - return new Parens($2); - }), o('( INDENT Body OUTDENT )', function() { - return new Parens($3); - }) - ], - WhileSource: [ - o('WHILE Expression', function() { - return new While($2); - }), o('WHILE Expression WHEN Expression', function() { - return new While($2, { - guard: $4 - }); - }), o('UNTIL Expression', function() { - return new While($2, { - invert: true - }); - }), o('UNTIL Expression WHEN Expression', function() { - return new While($2, { - invert: true, - guard: $4 - }); - }) - ], - While: [ - o('WhileSource Block', function() { - return $1.addBody($2); - }), o('Statement WhileSource', function() { - return $2.addBody(Block.wrap([$1])); - }), o('Expression WhileSource', function() { - return $2.addBody(Block.wrap([$1])); - }), o('Loop', function() { - return $1; - }) - ], - Loop: [ - o('LOOP Block', function() { - return new While(new Literal('true')).addBody($2); - }), o('LOOP Expression', function() { - return new While(new Literal('true')).addBody(Block.wrap([$2])); - }) - ], - For: [ - o('Statement ForBody', function() { - return new For($1, $2); - }), o('Expression ForBody', function() { - return new For($1, $2); - }), o('ForBody Block', function() { - return new For($2, $1); - }) - ], - ForBody: [ - o('FOR Range', function() { - return { - source: new Value($2) - }; - }), o('ForStart ForSource', function() { - $2.own = $1.own; - $2.name = $1[0]; - $2.index = $1[1]; - return $2; - }) - ], - ForStart: [ - o('FOR ForVariables', function() { - return $2; - }), o('FOR OWN ForVariables', function() { - $3.own = true; - return $3; - }) - ], - ForValue: [ - o('Identifier'), o('ThisProperty'), o('Array', function() { - return new Value($1); - }), o('Object', function() { - return new Value($1); - }) - ], - ForVariables: [ - o('ForValue', function() { - return [$1]; - }), o('ForValue , ForValue', function() { - return [$1, $3]; - }) - ], - ForSource: [ - o('FORIN Expression', function() { - return { - source: $2 - }; - }), o('FOROF Expression', function() { - return { - source: $2, - object: true - }; - }), o('FORIN Expression WHEN Expression', function() { - return { - source: $2, - guard: $4 - }; - }), o('FOROF Expression WHEN Expression', function() { - return { - source: $2, - guard: $4, - object: true - }; - }), o('FORIN Expression BY Expression', function() { - return { - source: $2, - step: $4 - }; - }), o('FORIN Expression WHEN Expression BY Expression', function() { - return { - source: $2, - guard: $4, - step: $6 - }; - }), o('FORIN Expression BY Expression WHEN Expression', function() { - return { - source: $2, - step: $4, - guard: $6 - }; - }) - ], - Switch: [ - o('SWITCH Expression INDENT Whens OUTDENT', function() { - return new Switch($2, $4); - }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() { - return new Switch($2, $4, $6); - }), o('SWITCH INDENT Whens OUTDENT', function() { - return new Switch(null, $3); - }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() { - return new Switch(null, $3, $5); - }) - ], - Whens: [ - o('When'), o('Whens When', function() { - return $1.concat($2); - }) - ], - When: [ - o('LEADING_WHEN SimpleArgs Block', function() { - return [[$2, $3]]; - }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() { - return [[$2, $3]]; - }) - ], - IfBlock: [ - o('IF Expression Block', function() { - return new If($2, $3, { - type: $1 - }); - }), o('IfBlock ELSE IF Expression Block', function() { - return $1.addElse(new If($4, $5, { - type: $3 - })); - }) - ], - If: [ - o('IfBlock'), o('IfBlock ELSE Block', function() { - return $1.addElse($3); - }), o('Statement POST_IF Expression', function() { - return new If($3, Block.wrap([$1]), { - type: $2, - statement: true - }); - }), o('Expression POST_IF Expression', function() { - return new If($3, Block.wrap([$1]), { - type: $2, - statement: true - }); - }) - ], - Operation: [ - o('UNARY Expression', function() { - return new Op($1, $2); - }), o('- Expression', (function() { - return new Op('-', $2); - }), { - prec: 'UNARY' - }), o('+ Expression', (function() { - return new Op('+', $2); - }), { - prec: 'UNARY' - }), o('-- SimpleAssignable', function() { - return new Op('--', $2); - }), o('++ SimpleAssignable', function() { - return new Op('++', $2); - }), o('SimpleAssignable --', function() { - return new Op('--', $1, null, true); - }), o('SimpleAssignable ++', function() { - return new Op('++', $1, null, true); - }), o('Expression ?', function() { - return new Existence($1); - }), o('Expression + Expression', function() { - return new Op('+', $1, $3); - }), o('Expression - Expression', function() { - return new Op('-', $1, $3); - }), o('Expression MATH Expression', function() { - return new Op($2, $1, $3); - }), o('Expression SHIFT Expression', function() { - return new Op($2, $1, $3); - }), o('Expression COMPARE Expression', function() { - return new Op($2, $1, $3); - }), o('Expression LOGIC Expression', function() { - return new Op($2, $1, $3); - }), o('Expression RELATION Expression', function() { - if ($2.charAt(0) === '!') { - return new Op($2.slice(1), $1, $3).invert(); - } else { - return new Op($2, $1, $3); - } - }), o('SimpleAssignable COMPOUND_ASSIGN\ - Expression', function() { - return new Assign($1, $3, $2); - }), o('SimpleAssignable COMPOUND_ASSIGN\ - INDENT Expression OUTDENT', function() { - return new Assign($1, $4, $2); - }), o('SimpleAssignable EXTENDS Expression', function() { - return new Extends($1, $3); - }) - ] - }; - - operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']]; - - tokens = []; - - for (name in grammar) { - alternatives = grammar[name]; - grammar[name] = (function() { - var _i, _j, _len, _len1, _ref, _results; - _results = []; - for (_i = 0, _len = alternatives.length; _i < _len; _i++) { - alt = alternatives[_i]; - _ref = alt[0].split(' '); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - token = _ref[_j]; - if (!grammar[token]) { - tokens.push(token); - } - } - if (name === 'Root') { - alt[1] = "return " + alt[1]; - } - _results.push(alt); - } - return _results; - })(); - } - - exports.parser = new Parser({ - tokens: tokens.join(' '), - bnf: grammar, - operators: operators.reverse(), - startSymbol: 'Root' - }); - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/helpers.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/helpers.js deleted file mode 100644 index b0a997b..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/helpers.js +++ /dev/null @@ -1,77 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var extend, flatten; - - exports.starts = function(string, literal, start) { - return literal === string.substr(start, literal.length); - }; - - exports.ends = function(string, literal, back) { - var len; - len = literal.length; - return literal === string.substr(string.length - len - (back || 0), len); - }; - - exports.compact = function(array) { - var item, _i, _len, _results; - _results = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - item = array[_i]; - if (item) { - _results.push(item); - } - } - return _results; - }; - - exports.count = function(string, substr) { - var num, pos; - num = pos = 0; - if (!substr.length) { - return 1 / 0; - } - while (pos = 1 + string.indexOf(substr, pos)) { - num++; - } - return num; - }; - - exports.merge = function(options, overrides) { - return extend(extend({}, options), overrides); - }; - - extend = exports.extend = function(object, properties) { - var key, val; - for (key in properties) { - val = properties[key]; - object[key] = val; - } - return object; - }; - - exports.flatten = flatten = function(array) { - var element, flattened, _i, _len; - flattened = []; - for (_i = 0, _len = array.length; _i < _len; _i++) { - element = array[_i]; - if (element instanceof Array) { - flattened = flattened.concat(flatten(element)); - } else { - flattened.push(element); - } - } - return flattened; - }; - - exports.del = function(obj, key) { - var val; - val = obj[key]; - delete obj[key]; - return val; - }; - - exports.last = function(array, back) { - return array[array.length - (back || 0) - 1]; - }; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/index.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/index.js deleted file mode 100644 index d344c41..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/index.js +++ /dev/null @@ -1,11 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var key, val, _ref; - - _ref = require('./coffee-script'); - for (key in _ref) { - val = _ref[key]; - exports[key] = val; - } - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/lexer.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/lexer.js deleted file mode 100644 index f80a443..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/lexer.js +++ /dev/null @@ -1,788 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES; - - _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last; - - exports.Lexer = Lexer = (function() { - - function Lexer() {} - - Lexer.prototype.tokenize = function(code, opts) { - var i, tag; - if (opts == null) { - opts = {}; - } - if (WHITESPACE.test(code)) { - code = "\n" + code; - } - code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); - this.code = code; - this.line = opts.line || 0; - this.indent = 0; - this.indebt = 0; - this.outdebt = 0; - this.indents = []; - this.ends = []; - this.tokens = []; - i = 0; - while (this.chunk = code.slice(i)) { - i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); - } - this.closeIndentation(); - if (tag = this.ends.pop()) { - this.error("missing " + tag); - } - if (opts.rewrite === false) { - return this.tokens; - } - return (new Rewriter).rewrite(this.tokens); - }; - - Lexer.prototype.identifierToken = function() { - var colon, forcedIdentifier, id, input, match, prev, tag, _ref2, _ref3; - if (!(match = IDENTIFIER.exec(this.chunk))) { - return 0; - } - input = match[0], id = match[1], colon = match[2]; - if (id === 'own' && this.tag() === 'FOR') { - this.token('OWN', id); - return id.length; - } - forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::') || !prev.spaced && prev[0] === '@'); - tag = 'IDENTIFIER'; - if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { - tag = id.toUpperCase(); - if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) { - tag = 'LEADING_WHEN'; - } else if (tag === 'FOR') { - this.seenFor = true; - } else if (tag === 'UNLESS') { - tag = 'IF'; - } else if (__indexOf.call(UNARY, tag) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(RELATION, tag) >= 0) { - if (tag !== 'INSTANCEOF' && this.seenFor) { - tag = 'FOR' + tag; - this.seenFor = false; - } else { - tag = 'RELATION'; - if (this.value() === '!') { - this.tokens.pop(); - id = '!' + id; - } - } - } - } - if (__indexOf.call(JS_FORBIDDEN, id) >= 0) { - if (forcedIdentifier) { - tag = 'IDENTIFIER'; - id = new String(id); - id.reserved = true; - } else if (__indexOf.call(RESERVED, id) >= 0) { - this.error("reserved word \"" + id + "\""); - } - } - if (!forcedIdentifier) { - if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { - id = COFFEE_ALIAS_MAP[id]; - } - tag = (function() { - switch (id) { - case '!': - return 'UNARY'; - case '==': - case '!=': - return 'COMPARE'; - case '&&': - case '||': - return 'LOGIC'; - case 'true': - case 'false': - return 'BOOL'; - case 'break': - case 'continue': - return 'STATEMENT'; - default: - return tag; - } - })(); - } - this.token(tag, id); - if (colon) { - this.token(':', ':'); - } - return input.length; - }; - - Lexer.prototype.numberToken = function() { - var binaryLiteral, lexedLength, match, number, octalLiteral; - if (!(match = NUMBER.exec(this.chunk))) { - return 0; - } - number = match[0]; - if (/^0[BOX]/.test(number)) { - this.error("radix prefix '" + number + "' must be lowercase"); - } else if (/E/.test(number) && !/^0x/.test(number)) { - this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); - } else if (/^0\d*[89]/.test(number)) { - this.error("decimal literal '" + number + "' must not be prefixed with '0'"); - } else if (/^0\d+/.test(number)) { - this.error("octal literal '" + number + "' must be prefixed with '0o'"); - } - lexedLength = number.length; - if (octalLiteral = /^0o([0-7]+)/.exec(number)) { - number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16); - } - if (binaryLiteral = /^0b([01]+)/.exec(number)) { - number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16); - } - this.token('NUMBER', number); - return lexedLength; - }; - - Lexer.prototype.stringToken = function() { - var match, octalEsc, string; - switch (this.chunk.charAt(0)) { - case "'": - if (!(match = SIMPLESTR.exec(this.chunk))) { - return 0; - } - this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n')); - break; - case '"': - if (!(string = this.balancedString(this.chunk, '"'))) { - return 0; - } - if (0 < string.indexOf('#{', 1)) { - this.interpolateString(string.slice(1, -1)); - } else { - this.token('STRING', this.escapeLines(string)); - } - break; - default: - return 0; - } - if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { - this.error("octal escape sequences " + string + " are not allowed"); - } - this.line += count(string, '\n'); - return string.length; - }; - - Lexer.prototype.heredocToken = function() { - var doc, heredoc, match, quote; - if (!(match = HEREDOC.exec(this.chunk))) { - return 0; - } - heredoc = match[0]; - quote = heredoc.charAt(0); - doc = this.sanitizeHeredoc(match[2], { - quote: quote, - indent: null - }); - if (quote === '"' && 0 <= doc.indexOf('#{')) { - this.interpolateString(doc, { - heredoc: true - }); - } else { - this.token('STRING', this.makeString(doc, quote, true)); - } - this.line += count(heredoc, '\n'); - return heredoc.length; - }; - - Lexer.prototype.commentToken = function() { - var comment, here, match; - if (!(match = this.chunk.match(COMMENT))) { - return 0; - } - comment = match[0], here = match[1]; - if (here) { - this.token('HERECOMMENT', this.sanitizeHeredoc(here, { - herecomment: true, - indent: Array(this.indent + 1).join(' ') - })); - } - this.line += count(comment, '\n'); - return comment.length; - }; - - Lexer.prototype.jsToken = function() { - var match, script; - if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { - return 0; - } - this.token('JS', (script = match[0]).slice(1, -1)); - return script.length; - }; - - Lexer.prototype.regexToken = function() { - var flags, length, match, prev, regex, _ref2, _ref3; - if (this.chunk.charAt(0) !== '/') { - return 0; - } - if (match = HEREGEX.exec(this.chunk)) { - length = this.heregexToken(match); - this.line += count(match[0], '\n'); - return length; - } - prev = last(this.tokens); - if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) { - return 0; - } - if (!(match = REGEX.exec(this.chunk))) { - return 0; - } - _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2]; - if (regex.slice(0, 2) === '/*') { - this.error('regular expressions cannot begin with `*`'); - } - if (regex === '//') { - regex = '/(?:)/'; - } - this.token('REGEX', "" + regex + flags); - return match.length; - }; - - Lexer.prototype.heregexToken = function(match) { - var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4, _ref5; - heregex = match[0], body = match[1], flags = match[2]; - if (0 > body.indexOf('#{')) { - re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); - if (re.match(/^\*/)) { - this.error('regular expressions cannot begin with `*`'); - } - this.token('REGEX', "/" + (re || '(?:)') + "/" + flags); - return heregex.length; - } - this.token('IDENTIFIER', 'RegExp'); - this.tokens.push(['CALL_START', '(']); - tokens = []; - _ref2 = this.interpolateString(body, { - regex: true - }); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - _ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1]; - if (tag === 'TOKENS') { - tokens.push.apply(tokens, value); - } else { - if (!(value = value.replace(HEREGEX_OMIT, ''))) { - continue; - } - value = value.replace(/\\/g, '\\\\'); - tokens.push(['STRING', this.makeString(value, '"', true)]); - } - tokens.push(['+', '+']); - } - tokens.pop(); - if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') { - this.tokens.push(['STRING', '""'], ['+', '+']); - } - (_ref5 = this.tokens).push.apply(_ref5, tokens); - if (flags) { - this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); - } - this.token(')', ')'); - return heregex.length; - }; - - Lexer.prototype.lineToken = function() { - var diff, indent, match, noNewlines, prev, size; - if (!(match = MULTI_DENT.exec(this.chunk))) { - return 0; - } - indent = match[0]; - this.line += count(indent, '\n'); - this.seenFor = false; - prev = last(this.tokens, 1); - size = indent.length - 1 - indent.lastIndexOf('\n'); - noNewlines = this.unfinished(); - if (size - this.indebt === this.indent) { - if (noNewlines) { - this.suppressNewlines(); - } else { - this.newlineToken(); - } - return indent.length; - } - if (size > this.indent) { - if (noNewlines) { - this.indebt = size - this.indent; - this.suppressNewlines(); - return indent.length; - } - diff = size - this.indent + this.outdebt; - this.token('INDENT', diff); - this.indents.push(diff); - this.ends.push('OUTDENT'); - this.outdebt = this.indebt = 0; - } else { - this.indebt = 0; - this.outdentToken(this.indent - size, noNewlines); - } - this.indent = size; - return indent.length; - }; - - Lexer.prototype.outdentToken = function(moveOut, noNewlines) { - var dent, len; - while (moveOut > 0) { - len = this.indents.length - 1; - if (this.indents[len] === void 0) { - moveOut = 0; - } else if (this.indents[len] === this.outdebt) { - moveOut -= this.outdebt; - this.outdebt = 0; - } else if (this.indents[len] < this.outdebt) { - this.outdebt -= this.indents[len]; - moveOut -= this.indents[len]; - } else { - dent = this.indents.pop() - this.outdebt; - moveOut -= dent; - this.outdebt = 0; - this.pair('OUTDENT'); - this.token('OUTDENT', dent); - } - } - if (dent) { - this.outdebt -= moveOut; - } - while (this.value() === ';') { - this.tokens.pop(); - } - if (!(this.tag() === 'TERMINATOR' || noNewlines)) { - this.token('TERMINATOR', '\n'); - } - return this; - }; - - Lexer.prototype.whitespaceToken = function() { - var match, nline, prev; - if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { - return 0; - } - prev = last(this.tokens); - if (prev) { - prev[match ? 'spaced' : 'newLine'] = true; - } - if (match) { - return match[0].length; - } else { - return 0; - } - }; - - Lexer.prototype.newlineToken = function() { - while (this.value() === ';') { - this.tokens.pop(); - } - if (this.tag() !== 'TERMINATOR') { - this.token('TERMINATOR', '\n'); - } - return this; - }; - - Lexer.prototype.suppressNewlines = function() { - if (this.value() === '\\') { - this.tokens.pop(); - } - return this; - }; - - Lexer.prototype.literalToken = function() { - var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; - if (match = OPERATOR.exec(this.chunk)) { - value = match[0]; - if (CODE.test(value)) { - this.tagParameters(); - } - } else { - value = this.chunk.charAt(0); - } - tag = value; - prev = last(this.tokens); - if (value === '=' && prev) { - if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) { - this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); - } - if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') { - prev[0] = 'COMPOUND_ASSIGN'; - prev[1] += '='; - return value.length; - } - } - if (value === ';') { - this.seenFor = false; - tag = 'TERMINATOR'; - } else if (__indexOf.call(MATH, value) >= 0) { - tag = 'MATH'; - } else if (__indexOf.call(COMPARE, value) >= 0) { - tag = 'COMPARE'; - } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { - tag = 'COMPOUND_ASSIGN'; - } else if (__indexOf.call(UNARY, value) >= 0) { - tag = 'UNARY'; - } else if (__indexOf.call(SHIFT, value) >= 0) { - tag = 'SHIFT'; - } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { - tag = 'LOGIC'; - } else if (prev && !prev.spaced) { - if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } - tag = 'CALL_START'; - } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { - tag = 'INDEX_START'; - switch (prev[0]) { - case '?': - prev[0] = 'INDEX_SOAK'; - } - } - } - switch (value) { - case '(': - case '{': - case '[': - this.ends.push(INVERSES[value]); - break; - case ')': - case '}': - case ']': - this.pair(value); - } - this.token(tag, value); - return value.length; - }; - - Lexer.prototype.sanitizeHeredoc = function(doc, options) { - var attempt, herecomment, indent, match, _ref2; - indent = options.indent, herecomment = options.herecomment; - if (herecomment) { - if (HEREDOC_ILLEGAL.test(doc)) { - this.error("block comment cannot contain \"*/\", starting"); - } - if (doc.indexOf('\n') <= 0) { - return doc; - } - } else { - while (match = HEREDOC_INDENT.exec(doc)) { - attempt = match[1]; - if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) { - indent = attempt; - } - } - } - if (indent) { - doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); - } - if (!herecomment) { - doc = doc.replace(/^\n/, ''); - } - return doc; - }; - - Lexer.prototype.tagParameters = function() { - var i, stack, tok, tokens; - if (this.tag() !== ')') { - return this; - } - stack = []; - tokens = this.tokens; - i = tokens.length; - tokens[--i][0] = 'PARAM_END'; - while (tok = tokens[--i]) { - switch (tok[0]) { - case ')': - stack.push(tok); - break; - case '(': - case 'CALL_START': - if (stack.length) { - stack.pop(); - } else if (tok[0] === '(') { - tok[0] = 'PARAM_START'; - return this; - } else { - return this; - } - } - } - return this; - }; - - Lexer.prototype.closeIndentation = function() { - return this.outdentToken(this.indent); - }; - - Lexer.prototype.balancedString = function(str, end) { - var continueCount, i, letter, match, prev, stack, _i, _ref2; - continueCount = 0; - stack = [end]; - for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) { - if (continueCount) { - --continueCount; - continue; - } - switch (letter = str.charAt(i)) { - case '\\': - ++continueCount; - continue; - case end: - stack.pop(); - if (!stack.length) { - return str.slice(0, i + 1 || 9e9); - } - end = stack[stack.length - 1]; - continue; - } - if (end === '}' && (letter === '"' || letter === "'")) { - stack.push(end = letter); - } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { - continueCount += match[0].length - 1; - } else if (end === '}' && letter === '{') { - stack.push(end = '}'); - } else if (end === '"' && prev === '#' && letter === '{') { - stack.push(end = '}'); - } - prev = letter; - } - return this.error("missing " + (stack.pop()) + ", starting"); - }; - - Lexer.prototype.interpolateString = function(str, options) { - var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4; - if (options == null) { - options = {}; - } - heredoc = options.heredoc, regex = options.regex; - tokens = []; - pi = 0; - i = -1; - while (letter = str.charAt(i += 1)) { - if (letter === '\\') { - i += 1; - continue; - } - if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { - continue; - } - if (pi < i) { - tokens.push(['NEOSTRING', str.slice(pi, i)]); - } - inner = expr.slice(1, -1); - if (inner.length) { - nested = new Lexer().tokenize(inner, { - line: this.line, - rewrite: false - }); - nested.pop(); - if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') { - nested.shift(); - } - if (len = nested.length) { - if (len > 1) { - nested.unshift(['(', '(', this.line]); - nested.push([')', ')', this.line]); - } - tokens.push(['TOKENS', nested]); - } - } - i += expr.length; - pi = i + 1; - } - if ((i > pi && pi < str.length)) { - tokens.push(['NEOSTRING', str.slice(pi)]); - } - if (regex) { - return tokens; - } - if (!tokens.length) { - return this.token('STRING', '""'); - } - if (tokens[0][0] !== 'NEOSTRING') { - tokens.unshift(['', '']); - } - if (interpolated = tokens.length > 1) { - this.token('(', '('); - } - for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { - _ref3 = tokens[i], tag = _ref3[0], value = _ref3[1]; - if (i) { - this.token('+', '+'); - } - if (tag === 'TOKENS') { - (_ref4 = this.tokens).push.apply(_ref4, value); - } else { - this.token('STRING', this.makeString(value, '"', heredoc)); - } - } - if (interpolated) { - this.token(')', ')'); - } - return tokens; - }; - - Lexer.prototype.pair = function(tag) { - var size, wanted; - if (tag !== (wanted = last(this.ends))) { - if ('OUTDENT' !== wanted) { - this.error("unmatched " + tag); - } - this.indent -= size = last(this.indents); - this.outdentToken(size, true); - return this.pair(tag); - } - return this.ends.pop(); - }; - - Lexer.prototype.token = function(tag, value) { - return this.tokens.push([tag, value, this.line]); - }; - - Lexer.prototype.tag = function(index, tag) { - var tok; - return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); - }; - - Lexer.prototype.value = function(index, val) { - var tok; - return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); - }; - - Lexer.prototype.unfinished = function() { - var _ref2; - return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); - }; - - Lexer.prototype.escapeLines = function(str, heredoc) { - return str.replace(MULTILINER, heredoc ? '\\n' : ''); - }; - - Lexer.prototype.makeString = function(body, quote, heredoc) { - if (!body) { - return quote + quote; - } - body = body.replace(/\\([\s\S])/g, function(match, contents) { - if (contents === '\n' || contents === quote) { - return contents; - } else { - return match; - } - }); - body = body.replace(RegExp("" + quote, "g"), '\\$&'); - return quote + this.escapeLines(body, heredoc) + quote; - }; - - Lexer.prototype.error = function(message) { - throw SyntaxError("" + message + " on line " + (this.line + 1)); - }; - - return Lexer; - - })(); - - JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; - - COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; - - COFFEE_ALIAS_MAP = { - and: '&&', - or: '||', - is: '==', - isnt: '!=', - not: '!', - yes: 'true', - no: 'false', - on: 'true', - off: 'false' - }; - - COFFEE_ALIASES = (function() { - var _results; - _results = []; - for (key in COFFEE_ALIAS_MAP) { - _results.push(key); - } - return _results; - })(); - - COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); - - RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield']; - - STRICT_PROSCRIBED = ['arguments', 'eval']; - - JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED); - - exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED); - - exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; - - IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; - - NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; - - HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/; - - OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/; - - WHITESPACE = /^[^\n\S]+/; - - COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/; - - CODE = /^[-=]>/; - - MULTI_DENT = /^(?:\n[^\n\S]*)+/; - - SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/; - - JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; - - REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; - - HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/; - - HEREGEX_OMIT = /\s+(?:#.*)?/g; - - MULTILINER = /\n/g; - - HEREDOC_INDENT = /\n+([^\n\S]*)/g; - - HEREDOC_ILLEGAL = /\*\//; - - LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; - - TRAILING_SPACES = /\s+$/; - - COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; - - UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; - - LOGIC = ['&&', '||', '&', '|', '^']; - - SHIFT = ['<<', '>>', '>>>']; - - COMPARE = ['==', '!=', '<', '>', '<=', '>=']; - - MATH = ['*', '/', '%']; - - RELATION = ['IN', 'OF', 'INSTANCEOF']; - - BOOL = ['TRUE', 'FALSE']; - - NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']']; - - NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); - - CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; - - INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); - - LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/nodes.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/nodes.js deleted file mode 100644 index 799b68e..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/nodes.js +++ /dev/null @@ -1,2986 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, starts, unfoldSoak, utility, _ref, _ref1, - __hasProp = {}.hasOwnProperty, - __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; - - Scope = require('./scope').Scope; - - _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; - - _ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last; - - exports.extend = extend; - - YES = function() { - return true; - }; - - NO = function() { - return false; - }; - - THIS = function() { - return this; - }; - - NEGATE = function() { - this.negated = !this.negated; - return this; - }; - - exports.Base = Base = (function() { - - function Base() {} - - Base.prototype.compile = function(o, lvl) { - var node; - o = extend({}, o); - if (lvl) { - o.level = lvl; - } - node = this.unfoldSoak(o) || this; - node.tab = o.indent; - if (o.level === LEVEL_TOP || !node.isStatement(o)) { - return node.compileNode(o); - } else { - return node.compileClosure(o); - } - }; - - Base.prototype.compileClosure = function(o) { - if (this.jumps()) { - throw SyntaxError('cannot use a pure statement in an expression.'); - } - o.sharedScope = true; - return Closure.wrap(this).compileNode(o); - }; - - Base.prototype.cache = function(o, level, reused) { - var ref, sub; - if (!this.isComplex()) { - ref = level ? this.compile(o, level) : this; - return [ref, ref]; - } else { - ref = new Literal(reused || o.scope.freeVariable('ref')); - sub = new Assign(ref, this); - if (level) { - return [sub.compile(o, level), ref.value]; - } else { - return [sub, ref]; - } - } - }; - - Base.prototype.compileLoopReference = function(o, name) { - var src, tmp; - src = tmp = this.compile(o, LEVEL_LIST); - if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) { - src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src; - } - return [src, tmp]; - }; - - Base.prototype.makeReturn = function(res) { - var me; - me = this.unwrapAll(); - if (res) { - return new Call(new Literal("" + res + ".push"), [me]); - } else { - return new Return(me); - } - }; - - Base.prototype.contains = function(pred) { - var contains; - contains = false; - this.traverseChildren(false, function(node) { - if (pred(node)) { - contains = true; - return false; - } - }); - return contains; - }; - - Base.prototype.containsType = function(type) { - return this instanceof type || this.contains(function(node) { - return node instanceof type; - }); - }; - - Base.prototype.lastNonComment = function(list) { - var i; - i = list.length; - while (i--) { - if (!(list[i] instanceof Comment)) { - return list[i]; - } - } - return null; - }; - - Base.prototype.toString = function(idt, name) { - var tree; - if (idt == null) { - idt = ''; - } - if (name == null) { - name = this.constructor.name; - } - tree = '\n' + idt + name; - if (this.soak) { - tree += '?'; - } - this.eachChild(function(node) { - return tree += node.toString(idt + TAB); - }); - return tree; - }; - - Base.prototype.eachChild = function(func) { - var attr, child, _i, _j, _len, _len1, _ref2, _ref3; - if (!this.children) { - return this; - } - _ref2 = this.children; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - attr = _ref2[_i]; - if (this[attr]) { - _ref3 = flatten([this[attr]]); - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - child = _ref3[_j]; - if (func(child) === false) { - return this; - } - } - } - } - return this; - }; - - Base.prototype.traverseChildren = function(crossScope, func) { - return this.eachChild(function(child) { - if (func(child) === false) { - return false; - } - return child.traverseChildren(crossScope, func); - }); - }; - - Base.prototype.invert = function() { - return new Op('!', this); - }; - - Base.prototype.unwrapAll = function() { - var node; - node = this; - while (node !== (node = node.unwrap())) { - continue; - } - return node; - }; - - Base.prototype.children = []; - - Base.prototype.isStatement = NO; - - Base.prototype.jumps = NO; - - Base.prototype.isComplex = YES; - - Base.prototype.isChainable = NO; - - Base.prototype.isAssignable = NO; - - Base.prototype.unwrap = THIS; - - Base.prototype.unfoldSoak = NO; - - Base.prototype.assigns = NO; - - return Base; - - })(); - - exports.Block = Block = (function(_super) { - - __extends(Block, _super); - - function Block(nodes) { - this.expressions = compact(flatten(nodes || [])); - } - - Block.prototype.children = ['expressions']; - - Block.prototype.push = function(node) { - this.expressions.push(node); - return this; - }; - - Block.prototype.pop = function() { - return this.expressions.pop(); - }; - - Block.prototype.unshift = function(node) { - this.expressions.unshift(node); - return this; - }; - - Block.prototype.unwrap = function() { - if (this.expressions.length === 1) { - return this.expressions[0]; - } else { - return this; - } - }; - - Block.prototype.isEmpty = function() { - return !this.expressions.length; - }; - - Block.prototype.isStatement = function(o) { - var exp, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (exp.isStatement(o)) { - return true; - } - } - return false; - }; - - Block.prototype.jumps = function(o) { - var exp, _i, _len, _ref2; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - exp = _ref2[_i]; - if (exp.jumps(o)) { - return exp; - } - } - }; - - Block.prototype.makeReturn = function(res) { - var expr, len; - len = this.expressions.length; - while (len--) { - expr = this.expressions[len]; - if (!(expr instanceof Comment)) { - this.expressions[len] = expr.makeReturn(res); - if (expr instanceof Return && !expr.expression) { - this.expressions.splice(len, 1); - } - break; - } - } - return this; - }; - - Block.prototype.compile = function(o, level) { - if (o == null) { - o = {}; - } - if (o.scope) { - return Block.__super__.compile.call(this, o, level); - } else { - return this.compileRoot(o); - } - }; - - Block.prototype.compileNode = function(o) { - var code, codes, node, top, _i, _len, _ref2; - this.tab = o.indent; - top = o.level === LEVEL_TOP; - codes = []; - _ref2 = this.expressions; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - node = _ref2[_i]; - node = node.unwrapAll(); - node = node.unfoldSoak(o) || node; - if (node instanceof Block) { - codes.push(node.compileNode(o)); - } else if (top) { - node.front = true; - code = node.compile(o); - if (!node.isStatement(o)) { - code = "" + this.tab + code + ";"; - if (node instanceof Literal) { - code = "" + code + "\n"; - } - } - codes.push(code); - } else { - codes.push(node.compile(o, LEVEL_LIST)); - } - } - if (top) { - if (this.spaced) { - return "\n" + (codes.join('\n\n')) + "\n"; - } else { - return codes.join('\n'); - } - } - code = codes.join(', ') || 'void 0'; - if (codes.length > 1 && o.level >= LEVEL_LIST) { - return "(" + code + ")"; - } else { - return code; - } - }; - - Block.prototype.compileRoot = function(o) { - var code, exp, i, prelude, preludeExps, rest; - o.indent = o.bare ? '' : TAB; - o.scope = new Scope(null, this, null); - o.level = LEVEL_TOP; - this.spaced = true; - prelude = ""; - if (!o.bare) { - preludeExps = (function() { - var _i, _len, _ref2, _results; - _ref2 = this.expressions; - _results = []; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - exp = _ref2[i]; - if (!(exp.unwrap() instanceof Comment)) { - break; - } - _results.push(exp); - } - return _results; - }).call(this); - rest = this.expressions.slice(preludeExps.length); - this.expressions = preludeExps; - if (preludeExps.length) { - prelude = "" + (this.compileNode(merge(o, { - indent: '' - }))) + "\n"; - } - this.expressions = rest; - } - code = this.compileWithDeclarations(o); - if (o.bare) { - return code; - } - return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n"; - }; - - Block.prototype.compileWithDeclarations = function(o) { - var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; - code = post = ''; - _ref2 = this.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - exp = _ref2[i]; - exp = exp.unwrap(); - if (!(exp instanceof Comment || exp instanceof Literal)) { - break; - } - } - o = merge(o, { - level: LEVEL_TOP - }); - if (i) { - rest = this.expressions.splice(i, 9e9); - _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; - _ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1]; - this.expressions = rest; - } - post = this.compileNode(o); - scope = o.scope; - if (scope.expressions === this) { - declars = o.scope.hasDeclarations(); - assigns = scope.hasAssignments; - if (declars || assigns) { - if (i) { - code += '\n'; - } - code += "" + this.tab + "var "; - if (declars) { - code += scope.declaredVariables().join(', '); - } - if (assigns) { - if (declars) { - code += ",\n" + (this.tab + TAB); - } - code += scope.assignedVariables().join(",\n" + (this.tab + TAB)); - } - code += ';\n'; - } - } - return code + post; - }; - - Block.wrap = function(nodes) { - if (nodes.length === 1 && nodes[0] instanceof Block) { - return nodes[0]; - } - return new Block(nodes); - }; - - return Block; - - })(Base); - - exports.Literal = Literal = (function(_super) { - - __extends(Literal, _super); - - function Literal(value) { - this.value = value; - } - - Literal.prototype.makeReturn = function() { - if (this.isStatement()) { - return this; - } else { - return Literal.__super__.makeReturn.apply(this, arguments); - } - }; - - Literal.prototype.isAssignable = function() { - return IDENTIFIER.test(this.value); - }; - - Literal.prototype.isStatement = function() { - var _ref2; - return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; - }; - - Literal.prototype.isComplex = NO; - - Literal.prototype.assigns = function(name) { - return name === this.value; - }; - - Literal.prototype.jumps = function(o) { - if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { - return this; - } - if (this.value === 'continue' && !(o != null ? o.loop : void 0)) { - return this; - } - }; - - Literal.prototype.compileNode = function(o) { - var code, _ref2; - code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; - if (this.isStatement()) { - return "" + this.tab + code + ";"; - } else { - return code; - } - }; - - Literal.prototype.toString = function() { - return ' "' + this.value + '"'; - }; - - return Literal; - - })(Base); - - exports.Undefined = (function(_super) { - - __extends(Undefined, _super); - - function Undefined() { - return Undefined.__super__.constructor.apply(this, arguments); - } - - Undefined.prototype.isAssignable = NO; - - Undefined.prototype.isComplex = NO; - - Undefined.prototype.compileNode = function(o) { - if (o.level >= LEVEL_ACCESS) { - return '(void 0)'; - } else { - return 'void 0'; - } - }; - - return Undefined; - - })(Base); - - exports.Null = (function(_super) { - - __extends(Null, _super); - - function Null() { - return Null.__super__.constructor.apply(this, arguments); - } - - Null.prototype.isAssignable = NO; - - Null.prototype.isComplex = NO; - - Null.prototype.compileNode = function() { - return "null"; - }; - - return Null; - - })(Base); - - exports.Bool = (function(_super) { - - __extends(Bool, _super); - - Bool.prototype.isAssignable = NO; - - Bool.prototype.isComplex = NO; - - Bool.prototype.compileNode = function() { - return this.val; - }; - - function Bool(val) { - this.val = val; - } - - return Bool; - - })(Base); - - exports.Return = Return = (function(_super) { - - __extends(Return, _super); - - function Return(expr) { - if (expr && !expr.unwrap().isUndefined) { - this.expression = expr; - } - } - - Return.prototype.children = ['expression']; - - Return.prototype.isStatement = YES; - - Return.prototype.makeReturn = THIS; - - Return.prototype.jumps = THIS; - - Return.prototype.compile = function(o, level) { - var expr, _ref2; - expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; - if (expr && !(expr instanceof Return)) { - return expr.compile(o, level); - } else { - return Return.__super__.compile.call(this, o, level); - } - }; - - Return.prototype.compileNode = function(o) { - return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";"); - }; - - return Return; - - })(Base); - - exports.Value = Value = (function(_super) { - - __extends(Value, _super); - - function Value(base, props, tag) { - if (!props && base instanceof Value) { - return base; - } - this.base = base; - this.properties = props || []; - if (tag) { - this[tag] = true; - } - return this; - } - - Value.prototype.children = ['base', 'properties']; - - Value.prototype.add = function(props) { - this.properties = this.properties.concat(props); - return this; - }; - - Value.prototype.hasProperties = function() { - return !!this.properties.length; - }; - - Value.prototype.isArray = function() { - return !this.properties.length && this.base instanceof Arr; - }; - - Value.prototype.isComplex = function() { - return this.hasProperties() || this.base.isComplex(); - }; - - Value.prototype.isAssignable = function() { - return this.hasProperties() || this.base.isAssignable(); - }; - - Value.prototype.isSimpleNumber = function() { - return this.base instanceof Literal && SIMPLENUM.test(this.base.value); - }; - - Value.prototype.isString = function() { - return this.base instanceof Literal && IS_STRING.test(this.base.value); - }; - - Value.prototype.isAtomic = function() { - var node, _i, _len, _ref2; - _ref2 = this.properties.concat(this.base); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - node = _ref2[_i]; - if (node.soak || node instanceof Call) { - return false; - } - } - return true; - }; - - Value.prototype.isStatement = function(o) { - return !this.properties.length && this.base.isStatement(o); - }; - - Value.prototype.assigns = function(name) { - return !this.properties.length && this.base.assigns(name); - }; - - Value.prototype.jumps = function(o) { - return !this.properties.length && this.base.jumps(o); - }; - - Value.prototype.isObject = function(onlyGenerated) { - if (this.properties.length) { - return false; - } - return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); - }; - - Value.prototype.isSplice = function() { - return last(this.properties) instanceof Slice; - }; - - Value.prototype.unwrap = function() { - if (this.properties.length) { - return this; - } else { - return this.base; - } - }; - - Value.prototype.cacheReference = function(o) { - var base, bref, name, nref; - name = last(this.properties); - if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { - return [this, this]; - } - base = new Value(this.base, this.properties.slice(0, -1)); - if (base.isComplex()) { - bref = new Literal(o.scope.freeVariable('base')); - base = new Value(new Parens(new Assign(bref, base))); - } - if (!name) { - return [base, bref]; - } - if (name.isComplex()) { - nref = new Literal(o.scope.freeVariable('name')); - name = new Index(new Assign(nref, name.index)); - nref = new Index(nref); - } - return [base.add(name), new Value(bref || base.base, [nref || name])]; - }; - - Value.prototype.compileNode = function(o) { - var code, prop, props, _i, _len; - this.base.front = this.front; - props = this.properties; - code = this.base.compile(o, props.length ? LEVEL_ACCESS : null); - if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) { - code = "" + code + "."; - } - for (_i = 0, _len = props.length; _i < _len; _i++) { - prop = props[_i]; - code += prop.compile(o); - } - return code; - }; - - Value.prototype.unfoldSoak = function(o) { - var result, - _this = this; - if (this.unfoldedSoak != null) { - return this.unfoldedSoak; - } - result = (function() { - var fst, i, ifn, prop, ref, snd, _i, _len, _ref2; - if (ifn = _this.base.unfoldSoak(o)) { - Array.prototype.push.apply(ifn.body.properties, _this.properties); - return ifn; - } - _ref2 = _this.properties; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - prop = _ref2[i]; - if (!prop.soak) { - continue; - } - prop.soak = false; - fst = new Value(_this.base, _this.properties.slice(0, i)); - snd = new Value(_this.base, _this.properties.slice(i)); - if (fst.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, fst)); - snd.base = ref; - } - return new If(new Existence(fst), snd, { - soak: true - }); - } - return null; - })(); - return this.unfoldedSoak = result || false; - }; - - return Value; - - })(Base); - - exports.Comment = Comment = (function(_super) { - - __extends(Comment, _super); - - function Comment(comment) { - this.comment = comment; - } - - Comment.prototype.isStatement = YES; - - Comment.prototype.makeReturn = THIS; - - Comment.prototype.compileNode = function(o, level) { - var code; - code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n"); - if ((level || o.level) === LEVEL_TOP) { - code = o.indent + code; - } - return code; - }; - - return Comment; - - })(Base); - - exports.Call = Call = (function(_super) { - - __extends(Call, _super); - - function Call(variable, args, soak) { - this.args = args != null ? args : []; - this.soak = soak; - this.isNew = false; - this.isSuper = variable === 'super'; - this.variable = this.isSuper ? null : variable; - } - - Call.prototype.children = ['variable', 'args']; - - Call.prototype.newInstance = function() { - var base, _ref2; - base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; - if (base instanceof Call && !base.isNew) { - base.newInstance(); - } else { - this.isNew = true; - } - return this; - }; - - Call.prototype.superReference = function(o) { - var accesses, method, name; - method = o.scope.namedMethod(); - if (!method) { - throw SyntaxError('cannot call super outside of a function.'); - } - name = method.name; - if (name == null) { - throw SyntaxError('cannot call super on an anonymous function.'); - } - if (method.klass) { - accesses = [new Access(new Literal('__super__'))]; - if (method["static"]) { - accesses.push(new Access(new Literal('constructor'))); - } - accesses.push(new Access(new Literal(name))); - return (new Value(new Literal(method.klass), accesses)).compile(o); - } else { - return "" + name + ".__super__.constructor"; - } - }; - - Call.prototype.superThis = function(o) { - var method; - method = o.scope.method; - return (method && !method.klass && method.context) || "this"; - }; - - Call.prototype.unfoldSoak = function(o) { - var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; - if (this.soak) { - if (this.variable) { - if (ifn = unfoldSoak(o, this, 'variable')) { - return ifn; - } - _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; - } else { - left = new Literal(this.superReference(o)); - rite = new Value(left); - } - rite = new Call(rite, this.args); - rite.isNew = this.isNew; - left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); - return new If(left, new Value(rite), { - soak: true - }); - } - call = this; - list = []; - while (true) { - if (call.variable instanceof Call) { - list.push(call); - call = call.variable; - continue; - } - if (!(call.variable instanceof Value)) { - break; - } - list.push(call); - if (!((call = call.variable.base) instanceof Call)) { - break; - } - } - _ref3 = list.reverse(); - for (_i = 0, _len = _ref3.length; _i < _len; _i++) { - call = _ref3[_i]; - if (ifn) { - if (call.variable instanceof Call) { - call.variable = ifn; - } else { - call.variable.base = ifn; - } - } - ifn = unfoldSoak(o, call, 'variable'); - } - return ifn; - }; - - Call.prototype.filterImplicitObjects = function(list) { - var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2; - nodes = []; - for (_i = 0, _len = list.length; _i < _len; _i++) { - node = list[_i]; - if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) { - nodes.push(node); - continue; - } - obj = null; - _ref2 = node.base.properties; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - prop = _ref2[_j]; - if (prop instanceof Assign || prop instanceof Comment) { - if (!obj) { - nodes.push(obj = new Obj(properties = [], true)); - } - properties.push(prop); - } else { - nodes.push(prop); - obj = null; - } - } - } - return nodes; - }; - - Call.prototype.compileNode = function(o) { - var arg, args, code, _ref2; - if ((_ref2 = this.variable) != null) { - _ref2.front = this.front; - } - if (code = Splat.compileSplattedArray(o, this.args, true)) { - return this.compileSplat(o, code); - } - args = this.filterImplicitObjects(this.args); - args = ((function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - _results.push(arg.compile(o, LEVEL_LIST)); - } - return _results; - })()).join(', '); - if (this.isSuper) { - return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")"); - } else { - return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")"); - } - }; - - Call.prototype.compileSuper = function(args, o) { - return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")"; - }; - - Call.prototype.compileSplat = function(o, splatArgs) { - var base, fun, idt, name, ref; - if (this.isSuper) { - return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")"; - } - if (this.isNew) { - idt = this.tab + TAB; - return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args), t = typeof result;\n" + idt + "return t == \"object\" || t == \"function\" ? result || child : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})"; - } - base = new Value(this.variable); - if ((name = base.properties.pop()) && base.isComplex()) { - ref = o.scope.freeVariable('ref'); - fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o)); - } else { - fun = base.compile(o, LEVEL_ACCESS); - if (SIMPLENUM.test(fun)) { - fun = "(" + fun + ")"; - } - if (name) { - ref = fun; - fun += name.compile(o); - } else { - ref = 'null'; - } - } - return "" + fun + ".apply(" + ref + ", " + splatArgs + ")"; - }; - - return Call; - - })(Base); - - exports.Extends = Extends = (function(_super) { - - __extends(Extends, _super); - - function Extends(child, parent) { - this.child = child; - this.parent = parent; - } - - Extends.prototype.children = ['child', 'parent']; - - Extends.prototype.compile = function(o) { - return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o); - }; - - return Extends; - - })(Base); - - exports.Access = Access = (function(_super) { - - __extends(Access, _super); - - function Access(name, tag) { - this.name = name; - this.name.asKey = true; - this.soak = tag === 'soak'; - } - - Access.prototype.children = ['name']; - - Access.prototype.compile = function(o) { - var name; - name = this.name.compile(o); - if (IDENTIFIER.test(name)) { - return "." + name; - } else { - return "[" + name + "]"; - } - }; - - Access.prototype.isComplex = NO; - - return Access; - - })(Base); - - exports.Index = Index = (function(_super) { - - __extends(Index, _super); - - function Index(index) { - this.index = index; - } - - Index.prototype.children = ['index']; - - Index.prototype.compile = function(o) { - return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]"; - }; - - Index.prototype.isComplex = function() { - return this.index.isComplex(); - }; - - return Index; - - })(Base); - - exports.Range = Range = (function(_super) { - - __extends(Range, _super); - - Range.prototype.children = ['from', 'to']; - - function Range(from, to, tag) { - this.from = from; - this.to = to; - this.exclusive = tag === 'exclusive'; - this.equals = this.exclusive ? '' : '='; - } - - Range.prototype.compileVariables = function(o) { - var step, _ref2, _ref3, _ref4, _ref5; - o = merge(o, { - top: true - }); - _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1]; - _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1]; - if (step = del(o, 'step')) { - _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1]; - } - _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; - if (this.stepVar) { - return this.stepNum = this.stepVar.match(SIMPLENUM); - } - }; - - Range.prototype.compileNode = function(o) { - var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3; - if (!this.fromVar) { - this.compileVariables(o); - } - if (!o.index) { - return this.compileArray(o); - } - known = this.fromNum && this.toNum; - idx = del(o, 'index'); - idxName = del(o, 'name'); - namedIndex = idxName && idxName !== idx; - varPart = "" + idx + " = " + this.fromC; - if (this.toC !== this.toVar) { - varPart += ", " + this.toC; - } - if (this.step !== this.stepVar) { - varPart += ", " + this.step; - } - _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; - condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); - stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--"; - if (namedIndex) { - varPart = "" + idxName + " = " + varPart; - } - if (namedIndex) { - stepPart = "" + idxName + " = " + stepPart; - } - return "" + varPart + "; " + condPart + "; " + stepPart; - }; - - Range.prototype.compileArray = function(o) { - var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; - if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { - range = (function() { - _results = []; - for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } - return _results; - }).apply(this); - if (this.exclusive) { - range.pop(); - } - return "[" + (range.join(', ')) + "]"; - } - idt = this.tab + TAB; - i = o.scope.freeVariable('i'); - result = o.scope.freeVariable('results'); - pre = "\n" + idt + result + " = [];"; - if (this.fromNum && this.toNum) { - o.index = i; - body = this.compileNode(o); - } else { - vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); - cond = "" + this.fromVar + " <= " + this.toVar; - body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; - } - post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; - hasArgs = function(node) { - return node != null ? node.contains(function(n) { - return n instanceof Literal && n.value === 'arguments' && !n.asKey; - }) : void 0; - }; - if (hasArgs(this.from) || hasArgs(this.to)) { - args = ', arguments'; - } - return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")"; - }; - - return Range; - - })(Base); - - exports.Slice = Slice = (function(_super) { - - __extends(Slice, _super); - - Slice.prototype.children = ['range']; - - function Slice(range) { - this.range = range; - Slice.__super__.constructor.call(this); - } - - Slice.prototype.compileNode = function(o) { - var compiled, from, fromStr, to, toStr, _ref2; - _ref2 = this.range, to = _ref2.to, from = _ref2.from; - fromStr = from && from.compile(o, LEVEL_PAREN) || '0'; - compiled = to && to.compile(o, LEVEL_PAREN); - if (to && !(!this.range.exclusive && +compiled === -1)) { - toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "" + compiled + " + 1 || 9e9")); - } - return ".slice(" + fromStr + (toStr || '') + ")"; - }; - - return Slice; - - })(Base); - - exports.Obj = Obj = (function(_super) { - - __extends(Obj, _super); - - function Obj(props, generated) { - this.generated = generated != null ? generated : false; - this.objects = this.properties = props || []; - } - - Obj.prototype.children = ['properties']; - - Obj.prototype.compileNode = function(o) { - var i, idt, indent, join, lastNoncom, node, obj, prop, propName, propNames, props, _i, _j, _len, _len1, _ref2; - props = this.properties; - propNames = []; - _ref2 = this.properties; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - prop = _ref2[_i]; - if (prop.isComplex()) { - prop = prop.variable; - } - if (prop != null) { - propName = prop.unwrapAll().value.toString(); - if (__indexOf.call(propNames, propName) >= 0) { - throw SyntaxError("multiple object literal properties named \"" + propName + "\""); - } - propNames.push(propName); - } - } - if (!props.length) { - return (this.front ? '({})' : '{}'); - } - if (this.generated) { - for (_j = 0, _len1 = props.length; _j < _len1; _j++) { - node = props[_j]; - if (node instanceof Value) { - throw new Error('cannot have an implicit value in an implicit object'); - } - } - } - idt = o.indent += TAB; - lastNoncom = this.lastNonComment(this.properties); - props = (function() { - var _k, _len2, _results; - _results = []; - for (i = _k = 0, _len2 = props.length; _k < _len2; i = ++_k) { - prop = props[i]; - join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; - indent = prop instanceof Comment ? '' : idt; - if (prop instanceof Value && prop["this"]) { - prop = new Assign(prop.properties[0].name, prop, 'object'); - } - if (!(prop instanceof Comment)) { - if (!(prop instanceof Assign)) { - prop = new Assign(prop, prop, 'object'); - } - (prop.variable.base || prop.variable).asKey = true; - } - _results.push(indent + prop.compile(o, LEVEL_TOP) + join); - } - return _results; - })(); - props = props.join(''); - obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}"; - if (this.front) { - return "(" + obj + ")"; - } else { - return obj; - } - }; - - Obj.prototype.assigns = function(name) { - var prop, _i, _len, _ref2; - _ref2 = this.properties; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - prop = _ref2[_i]; - if (prop.assigns(name)) { - return true; - } - } - return false; - }; - - return Obj; - - })(Base); - - exports.Arr = Arr = (function(_super) { - - __extends(Arr, _super); - - function Arr(objs) { - this.objects = objs || []; - } - - Arr.prototype.children = ['objects']; - - Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects; - - Arr.prototype.compileNode = function(o) { - var code, obj, objs; - if (!this.objects.length) { - return '[]'; - } - o.indent += TAB; - objs = this.filterImplicitObjects(this.objects); - if (code = Splat.compileSplattedArray(o, objs)) { - return code; - } - code = ((function() { - var _i, _len, _results; - _results = []; - for (_i = 0, _len = objs.length; _i < _len; _i++) { - obj = objs[_i]; - _results.push(obj.compile(o, LEVEL_LIST)); - } - return _results; - })()).join(', '); - if (code.indexOf('\n') >= 0) { - return "[\n" + o.indent + code + "\n" + this.tab + "]"; - } else { - return "[" + code + "]"; - } - }; - - Arr.prototype.assigns = function(name) { - var obj, _i, _len, _ref2; - _ref2 = this.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj.assigns(name)) { - return true; - } - } - return false; - }; - - return Arr; - - })(Base); - - exports.Class = Class = (function(_super) { - - __extends(Class, _super); - - function Class(variable, parent, body) { - this.variable = variable; - this.parent = parent; - this.body = body != null ? body : new Block; - this.boundFuncs = []; - this.body.classBody = true; - } - - Class.prototype.children = ['variable', 'parent', 'body']; - - Class.prototype.determineName = function() { - var decl, tail; - if (!this.variable) { - return null; - } - decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; - if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) { - throw SyntaxError("variable name may not be " + decl); - } - return decl && (decl = IDENTIFIER.test(decl) && decl); - }; - - Class.prototype.setContext = function(name) { - return this.body.traverseChildren(false, function(node) { - if (node.classBody) { - return false; - } - if (node instanceof Literal && node.value === 'this') { - return node.value = name; - } else if (node instanceof Code) { - node.klass = name; - if (node.bound) { - return node.context = name; - } - } - }); - }; - - Class.prototype.addBoundFunctions = function(o) { - var bvar, lhs, _i, _len, _ref2, _results; - if (this.boundFuncs.length) { - _ref2 = this.boundFuncs; - _results = []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - bvar = _ref2[_i]; - lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); - _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"))); - } - return _results; - } - }; - - Class.prototype.addProperties = function(node, name, o) { - var assign, base, exprs, func, props; - props = node.base.properties.slice(0); - exprs = (function() { - var _results; - _results = []; - while (assign = props.shift()) { - if (assign instanceof Assign) { - base = assign.variable.base; - delete assign.context; - func = assign.value; - if (base.value === 'constructor') { - if (this.ctor) { - throw new Error('cannot define more than one constructor in a class'); - } - if (func.bound) { - throw new Error('cannot define a constructor as a bound function'); - } - if (func instanceof Code) { - assign = this.ctor = func; - } else { - this.externalCtor = o.scope.freeVariable('class'); - assign = new Assign(new Literal(this.externalCtor), func); - } - } else { - if (assign.variable["this"]) { - func["static"] = true; - if (func.bound) { - func.context = name; - } - } else { - assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); - if (func instanceof Code && func.bound) { - this.boundFuncs.push(base); - func.bound = false; - } - } - } - } - _results.push(assign); - } - return _results; - }).call(this); - return compact(exprs); - }; - - Class.prototype.walkBody = function(name, o) { - var _this = this; - return this.traverseChildren(false, function(child) { - var exps, i, node, _i, _len, _ref2; - if (child instanceof Class) { - return false; - } - if (child instanceof Block) { - _ref2 = exps = child.expressions; - for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { - node = _ref2[i]; - if (node instanceof Value && node.isObject(true)) { - exps[i] = _this.addProperties(node, name, o); - } - } - return child.expressions = exps = flatten(exps); - } - }); - }; - - Class.prototype.hoistDirectivePrologue = function() { - var expressions, index, node; - index = 0; - expressions = this.body.expressions; - while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) { - ++index; - } - return this.directives = expressions.splice(0, index); - }; - - Class.prototype.ensureConstructor = function(name) { - if (!this.ctor) { - this.ctor = new Code; - if (this.parent) { - this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); - } - if (this.externalCtor) { - this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); - } - this.ctor.body.makeReturn(); - this.body.expressions.unshift(this.ctor); - } - this.ctor.ctor = this.ctor.name = name; - this.ctor.klass = null; - return this.ctor.noReturn = true; - }; - - Class.prototype.compileNode = function(o) { - var call, decl, klass, lname, name, params, _ref2; - decl = this.determineName(); - name = decl || '_Class'; - if (name.reserved) { - name = "_" + name; - } - lname = new Literal(name); - this.hoistDirectivePrologue(); - this.setContext(name); - this.walkBody(name, o); - this.ensureConstructor(name); - this.body.spaced = true; - if (!(this.ctor instanceof Code)) { - this.body.expressions.unshift(this.ctor); - } - this.body.expressions.push(lname); - (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); - this.addBoundFunctions(o); - call = Closure.wrap(this.body); - if (this.parent) { - this.superClass = new Literal(o.scope.freeVariable('super', false)); - this.body.expressions.unshift(new Extends(lname, this.superClass)); - call.args.push(this.parent); - params = call.variable.params || call.variable.base.params; - params.push(new Param(this.superClass)); - } - klass = new Parens(call, true); - if (this.variable) { - klass = new Assign(this.variable, klass); - } - return klass.compile(o); - }; - - return Class; - - })(Base); - - exports.Assign = Assign = (function(_super) { - - __extends(Assign, _super); - - function Assign(variable, value, context, options) { - var forbidden, name, _ref2; - this.variable = variable; - this.value = value; - this.context = context; - this.param = options && options.param; - this.subpattern = options && options.subpattern; - forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); - if (forbidden && this.context !== 'object') { - throw SyntaxError("variable name may not be \"" + name + "\""); - } - } - - Assign.prototype.children = ['variable', 'value']; - - Assign.prototype.isStatement = function(o) { - return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; - }; - - Assign.prototype.assigns = function(name) { - return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); - }; - - Assign.prototype.unfoldSoak = function(o) { - return unfoldSoak(o, this, 'variable'); - }; - - Assign.prototype.compileNode = function(o) { - var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5; - if (isValue = this.variable instanceof Value) { - if (this.variable.isArray() || this.variable.isObject()) { - return this.compilePatternMatch(o); - } - if (this.variable.isSplice()) { - return this.compileSplice(o); - } - if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { - return this.compileConditional(o); - } - } - name = this.variable.compile(o, LEVEL_LIST); - if (!this.context) { - if (!(varBase = this.variable.unwrapAll()).isAssignable()) { - throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned."); - } - if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { - if (this.param) { - o.scope.add(name, 'var'); - } else { - o.scope.find(name); - } - } - } - if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { - if (match[1]) { - this.value.klass = match[1]; - } - this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; - } - val = this.value.compile(o, LEVEL_LIST); - if (this.context === 'object') { - return "" + name + ": " + val; - } - val = name + (" " + (this.context || '=') + " ") + val; - if (o.level <= LEVEL_LIST) { - return val; - } else { - return "(" + val + ")"; - } - }; - - Assign.prototype.compilePatternMatch = function(o) { - var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; - top = o.level === LEVEL_TOP; - value = this.value; - objects = this.variable.base.objects; - if (!(olen = objects.length)) { - code = value.compile(o); - if (o.level >= LEVEL_OP) { - return "(" + code + ")"; - } else { - return code; - } - } - isObject = this.variable.isObject(); - if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { - if (obj instanceof Assign) { - _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; - } else { - if (obj.base instanceof Parens) { - _ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1]; - } else { - idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); - } - } - acc = IDENTIFIER.test(idx.unwrap().value || 0); - value = new Value(value); - value.properties.push(new (acc ? Access : Index)(idx)); - if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) { - throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o))); - } - return new Assign(obj, value, null, { - param: this.param - }).compile(o, LEVEL_TOP); - } - vvar = value.compile(o, LEVEL_LIST); - assigns = []; - splat = false; - if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) { - assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar); - vvar = ref; - } - for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) { - obj = objects[i]; - idx = i; - if (isObject) { - if (obj instanceof Assign) { - _ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value; - } else { - if (obj.base instanceof Parens) { - _ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1]; - } else { - idx = obj["this"] ? obj.properties[0].name : obj; - } - } - } - if (!splat && obj instanceof Splat) { - name = obj.name.unwrap().value; - obj = obj.unwrap(); - val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i; - if (rest = olen - i - 1) { - ivar = o.scope.freeVariable('i'); - val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; - } else { - val += ") : []"; - } - val = new Literal(val); - splat = "" + ivar + "++"; - } else { - name = obj.unwrap().value; - if (obj instanceof Splat) { - obj = obj.name.compile(o); - throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "..."); - } - if (typeof idx === 'number') { - idx = new Literal(splat || idx); - acc = false; - } else { - acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); - } - val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]); - } - if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { - throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o))); - } - assigns.push(new Assign(obj, val, null, { - param: this.param, - subpattern: true - }).compile(o, LEVEL_LIST)); - } - if (!(top || this.subpattern)) { - assigns.push(vvar); - } - code = assigns.join(', '); - if (o.level < LEVEL_LIST) { - return code; - } else { - return "(" + code + ")"; - } - }; - - Assign.prototype.compileConditional = function(o) { - var left, right, _ref2; - _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; - if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { - throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined."); - } - if (__indexOf.call(this.context, "?") >= 0) { - o.isExistentialEquals = true; - } - return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o); - }; - - Assign.prototype.compileSplice = function(o) { - var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; - _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; - name = this.variable.compile(o); - _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1]; - if (to) { - if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) { - to = +to.compile(o) - +fromRef; - if (!exclusive) { - to += 1; - } - } else { - to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; - if (!exclusive) { - to += ' + 1'; - } - } - } else { - to = "9e9"; - } - _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; - code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef; - if (o.level > LEVEL_TOP) { - return "(" + code + ")"; - } else { - return code; - } - }; - - return Assign; - - })(Base); - - exports.Code = Code = (function(_super) { - - __extends(Code, _super); - - function Code(params, body, tag) { - this.params = params || []; - this.body = body || new Block; - this.bound = tag === 'boundfunc'; - if (this.bound) { - this.context = '_this'; - } - } - - Code.prototype.children = ['params', 'body']; - - Code.prototype.isStatement = function() { - return !!this.ctor; - }; - - Code.prototype.jumps = NO; - - Code.prototype.compileNode = function(o) { - var code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; - o.scope = new Scope(o.scope, this.body, this); - o.scope.shared = del(o, 'sharedScope'); - o.indent += TAB; - delete o.bare; - delete o.isExistentialEquals; - params = []; - exprs = []; - _ref2 = this.paramNames(); - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - name = _ref2[_i]; - if (!o.scope.check(name)) { - o.scope.parameter(name); - } - } - _ref3 = this.params; - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - param = _ref3[_j]; - if (!param.splat) { - continue; - } - _ref4 = this.params; - for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { - p = _ref4[_k].name; - if (p["this"]) { - p = p.properties[0].name; - } - if (p.value) { - o.scope.add(p.value, 'var', true); - } - } - splats = new Assign(new Value(new Arr((function() { - var _l, _len3, _ref5, _results; - _ref5 = this.params; - _results = []; - for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { - p = _ref5[_l]; - _results.push(p.asReference(o)); - } - return _results; - }).call(this))), new Value(new Literal('arguments'))); - break; - } - _ref5 = this.params; - for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { - param = _ref5[_l]; - if (param.isComplex()) { - val = ref = param.asReference(o); - if (param.value) { - val = new Op('?', ref, param.value); - } - exprs.push(new Assign(new Value(param.name), val, '=', { - param: true - })); - } else { - ref = param; - if (param.value) { - lit = new Literal(ref.name.value + ' == null'); - val = new Assign(new Value(param.name), param.value, '='); - exprs.push(new If(lit, val)); - } - } - if (!splats) { - params.push(ref); - } - } - wasEmpty = this.body.isEmpty(); - if (splats) { - exprs.unshift(splats); - } - if (exprs.length) { - (_ref6 = this.body.expressions).unshift.apply(_ref6, exprs); - } - for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { - p = params[i]; - o.scope.parameter(params[i] = p.compile(o)); - } - uniqs = []; - _ref7 = this.paramNames(); - for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) { - name = _ref7[_n]; - if (__indexOf.call(uniqs, name) >= 0) { - throw SyntaxError("multiple parameters named '" + name + "'"); - } - uniqs.push(name); - } - if (!(wasEmpty || this.noReturn)) { - this.body.makeReturn(); - } - if (this.bound) { - if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) { - this.bound = this.context = o.scope.parent.method.context; - } else if (!this["static"]) { - o.scope.parent.assign('_this', 'this'); - } - } - idt = o.indent; - code = 'function'; - if (this.ctor) { - code += ' ' + this.name; - } - code += '(' + params.join(', ') + ') {'; - if (!this.body.isEmpty()) { - code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab; - } - code += '}'; - if (this.ctor) { - return this.tab + code; - } - if (this.front || (o.level >= LEVEL_ACCESS)) { - return "(" + code + ")"; - } else { - return code; - } - }; - - Code.prototype.paramNames = function() { - var names, param, _i, _len, _ref2; - names = []; - _ref2 = this.params; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - names.push.apply(names, param.names()); - } - return names; - }; - - Code.prototype.traverseChildren = function(crossScope, func) { - if (crossScope) { - return Code.__super__.traverseChildren.call(this, crossScope, func); - } - }; - - return Code; - - })(Base); - - exports.Param = Param = (function(_super) { - - __extends(Param, _super); - - function Param(name, value, splat) { - var _ref2; - this.name = name; - this.value = value; - this.splat = splat; - if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { - throw SyntaxError("parameter name \"" + name + "\" is not allowed"); - } - } - - Param.prototype.children = ['name', 'value']; - - Param.prototype.compile = function(o) { - return this.name.compile(o, LEVEL_LIST); - }; - - Param.prototype.asReference = function(o) { - var node; - if (this.reference) { - return this.reference; - } - node = this.name; - if (node["this"]) { - node = node.properties[0].name; - if (node.value.reserved) { - node = new Literal(o.scope.freeVariable(node.value)); - } - } else if (node.isComplex()) { - node = new Literal(o.scope.freeVariable('arg')); - } - node = new Value(node); - if (this.splat) { - node = new Splat(node); - } - return this.reference = node; - }; - - Param.prototype.isComplex = function() { - return this.name.isComplex(); - }; - - Param.prototype.names = function(name) { - var atParam, names, obj, _i, _len, _ref2; - if (name == null) { - name = this.name; - } - atParam = function(obj) { - var value; - value = obj.properties[0].name.value; - if (value.reserved) { - return []; - } else { - return [value]; - } - }; - if (name instanceof Literal) { - return [name.value]; - } - if (name instanceof Value) { - return atParam(name); - } - names = []; - _ref2 = name.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (obj instanceof Assign) { - names.push(obj.value.unwrap().value); - } else if (obj instanceof Splat) { - names.push(obj.name.unwrap().value); - } else if (obj instanceof Value) { - if (obj.isArray() || obj.isObject()) { - names.push.apply(names, this.names(obj.base)); - } else if (obj["this"]) { - names.push.apply(names, atParam(obj)); - } else { - names.push(obj.base.value); - } - } else { - throw SyntaxError("illegal parameter " + (obj.compile())); - } - } - return names; - }; - - return Param; - - })(Base); - - exports.Splat = Splat = (function(_super) { - - __extends(Splat, _super); - - Splat.prototype.children = ['name']; - - Splat.prototype.isAssignable = YES; - - function Splat(name) { - this.name = name.compile ? name : new Literal(name); - } - - Splat.prototype.assigns = function(name) { - return this.name.assigns(name); - }; - - Splat.prototype.compile = function(o) { - if (this.index != null) { - return this.compileParam(o); - } else { - return this.name.compile(o); - } - }; - - Splat.prototype.unwrap = function() { - return this.name; - }; - - Splat.compileSplattedArray = function(o, list, apply) { - var args, base, code, i, index, node, _i, _len; - index = -1; - while ((node = list[++index]) && !(node instanceof Splat)) { - continue; - } - if (index >= list.length) { - return ''; - } - if (list.length === 1) { - code = list[0].compile(o, LEVEL_LIST); - if (apply) { - return code; - } - return "" + (utility('slice')) + ".call(" + code + ")"; - } - args = list.slice(index); - for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { - node = args[i]; - code = node.compile(o, LEVEL_LIST); - args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]"; - } - if (index === 0) { - return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")"); - } - base = (function() { - var _j, _len1, _ref2, _results; - _ref2 = list.slice(0, index); - _results = []; - for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { - node = _ref2[_j]; - _results.push(node.compile(o, LEVEL_LIST)); - } - return _results; - })(); - return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")"; - }; - - return Splat; - - })(Base); - - exports.While = While = (function(_super) { - - __extends(While, _super); - - function While(condition, options) { - this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; - this.guard = options != null ? options.guard : void 0; - } - - While.prototype.children = ['condition', 'guard', 'body']; - - While.prototype.isStatement = YES; - - While.prototype.makeReturn = function(res) { - if (res) { - return While.__super__.makeReturn.apply(this, arguments); - } else { - this.returns = !this.jumps({ - loop: true - }); - return this; - } - }; - - While.prototype.addBody = function(body) { - this.body = body; - return this; - }; - - While.prototype.jumps = function() { - var expressions, node, _i, _len; - expressions = this.body.expressions; - if (!expressions.length) { - return false; - } - for (_i = 0, _len = expressions.length; _i < _len; _i++) { - node = expressions[_i]; - if (node.jumps({ - loop: true - })) { - return node; - } - } - return false; - }; - - While.prototype.compileNode = function(o) { - var body, code, rvar, set; - o.indent += TAB; - set = ''; - body = this.body; - if (body.isEmpty()) { - body = ''; - } else { - if (this.returns) { - body.makeReturn(rvar = o.scope.freeVariable('results')); - set = "" + this.tab + rvar + " = [];\n"; - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab; - } - code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}"); - if (this.returns) { - code += "\n" + this.tab + "return " + rvar + ";"; - } - return code; - }; - - return While; - - })(Base); - - exports.Op = Op = (function(_super) { - var CONVERSIONS, INVERSIONS; - - __extends(Op, _super); - - function Op(op, first, second, flip) { - if (op === 'in') { - return new In(first, second); - } - if (op === 'do') { - return this.generateDo(first); - } - if (op === 'new') { - if (first instanceof Call && !first["do"] && !first.isNew) { - return first.newInstance(); - } - if (first instanceof Code && first.bound || first["do"]) { - first = new Parens(first); - } - } - this.operator = CONVERSIONS[op] || op; - this.first = first; - this.second = second; - this.flip = !!flip; - return this; - } - - CONVERSIONS = { - '==': '===', - '!=': '!==', - 'of': 'in' - }; - - INVERSIONS = { - '!==': '===', - '===': '!==' - }; - - Op.prototype.children = ['first', 'second']; - - Op.prototype.isSimpleNumber = NO; - - Op.prototype.isUnary = function() { - return !this.second; - }; - - Op.prototype.isComplex = function() { - var _ref2; - return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); - }; - - Op.prototype.isChainable = function() { - var _ref2; - return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; - }; - - Op.prototype.invert = function() { - var allInvertable, curr, fst, op, _ref2; - if (this.isChainable() && this.first.isChainable()) { - allInvertable = true; - curr = this; - while (curr && curr.operator) { - allInvertable && (allInvertable = curr.operator in INVERSIONS); - curr = curr.first; - } - if (!allInvertable) { - return new Parens(this).invert(); - } - curr = this; - while (curr && curr.operator) { - curr.invert = !curr.invert; - curr.operator = INVERSIONS[curr.operator]; - curr = curr.first; - } - return this; - } else if (op = INVERSIONS[this.operator]) { - this.operator = op; - if (this.first.unwrap() instanceof Op) { - this.first.invert(); - } - return this; - } else if (this.second) { - return new Parens(this).invert(); - } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { - return fst; - } else { - return new Op('!', this); - } - }; - - Op.prototype.unfoldSoak = function(o) { - var _ref2; - return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); - }; - - Op.prototype.generateDo = function(exp) { - var call, func, param, passedParams, ref, _i, _len, _ref2; - passedParams = []; - func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp; - _ref2 = func.params || []; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - param = _ref2[_i]; - if (param.value) { - passedParams.push(param.value); - delete param.value; - } else { - passedParams.push(param); - } - } - call = new Call(exp, passedParams); - call["do"] = true; - return call; - }; - - Op.prototype.compileNode = function(o) { - var code, isChain, _ref2, _ref3; - isChain = this.isChainable() && this.first.isChainable(); - if (!isChain) { - this.first.front = this.front; - } - if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { - throw SyntaxError('delete operand may not be argument or var'); - } - if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) { - throw SyntaxError('prefix increment/decrement may not have eval or arguments operand'); - } - if (this.isUnary()) { - return this.compileUnary(o); - } - if (isChain) { - return this.compileChain(o); - } - if (this.operator === '?') { - return this.compileExistence(o); - } - code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP); - if (o.level <= LEVEL_OP) { - return code; - } else { - return "(" + code + ")"; - } - }; - - Op.prototype.compileChain = function(o) { - var code, fst, shared, _ref2; - _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; - fst = this.first.compile(o, LEVEL_OP); - code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP)); - return "(" + code + ")"; - }; - - Op.prototype.compileExistence = function(o) { - var fst, ref; - if (this.first.isComplex()) { - ref = new Literal(o.scope.freeVariable('ref')); - fst = new Parens(new Assign(ref, this.first)); - } else { - fst = this.first; - ref = fst; - } - return new If(new Existence(fst), ref, { - type: 'if' - }).addElse(this.second).compile(o); - }; - - Op.prototype.compileUnary = function(o) { - var op, parts, plusMinus; - if (o.level >= LEVEL_ACCESS) { - return (new Parens(this)).compile(o); - } - parts = [op = this.operator]; - plusMinus = op === '+' || op === '-'; - if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { - parts.push(' '); - } - if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { - this.first = new Parens(this.first); - } - parts.push(this.first.compile(o, LEVEL_OP)); - if (this.flip) { - parts.reverse(); - } - return parts.join(''); - }; - - Op.prototype.toString = function(idt) { - return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); - }; - - return Op; - - })(Base); - - exports.In = In = (function(_super) { - - __extends(In, _super); - - function In(object, array) { - this.object = object; - this.array = array; - } - - In.prototype.children = ['object', 'array']; - - In.prototype.invert = NEGATE; - - In.prototype.compileNode = function(o) { - var hasSplat, obj, _i, _len, _ref2; - if (this.array instanceof Value && this.array.isArray()) { - _ref2 = this.array.base.objects; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - obj = _ref2[_i]; - if (!(obj instanceof Splat)) { - continue; - } - hasSplat = true; - break; - } - if (!hasSplat) { - return this.compileOrTest(o); - } - } - return this.compileLoopTest(o); - }; - - In.prototype.compileOrTest = function(o) { - var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3; - if (this.array.base.objects.length === 0) { - return "" + (!!this.negated); - } - _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; - _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; - tests = (function() { - var _i, _len, _ref4, _results; - _ref4 = this.array.base.objects; - _results = []; - for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { - item = _ref4[i]; - _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS)); - } - return _results; - }).call(this); - tests = tests.join(cnj); - if (o.level < LEVEL_OP) { - return tests; - } else { - return "(" + tests + ")"; - } - }; - - In.prototype.compileLoopTest = function(o) { - var code, ref, sub, _ref2; - _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; - code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0'); - if (sub === ref) { - return code; - } - code = sub + ', ' + code; - if (o.level < LEVEL_LIST) { - return code; - } else { - return "(" + code + ")"; - } - }; - - In.prototype.toString = function(idt) { - return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); - }; - - return In; - - })(Base); - - exports.Try = Try = (function(_super) { - - __extends(Try, _super); - - function Try(attempt, error, recovery, ensure) { - this.attempt = attempt; - this.error = error; - this.recovery = recovery; - this.ensure = ensure; - } - - Try.prototype.children = ['attempt', 'recovery', 'ensure']; - - Try.prototype.isStatement = YES; - - Try.prototype.jumps = function(o) { - var _ref2; - return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); - }; - - Try.prototype.makeReturn = function(res) { - if (this.attempt) { - this.attempt = this.attempt.makeReturn(res); - } - if (this.recovery) { - this.recovery = this.recovery.makeReturn(res); - } - return this; - }; - - Try.prototype.compileNode = function(o) { - var catchPart, ensurePart, errorPart, tryPart; - o.indent += TAB; - errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' '; - tryPart = this.attempt.compile(o, LEVEL_TOP); - catchPart = (function() { - var _ref2; - if (this.recovery) { - if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { - throw SyntaxError("catch variable may not be \"" + this.error.value + "\""); - } - if (!o.scope.check(this.error.value)) { - o.scope.add(this.error.value, 'param'); - } - return " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}"; - } else if (!(this.ensure || this.recovery)) { - return ' catch (_error) {}'; - } - }).call(this); - ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : ''; - return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart; - }; - - return Try; - - })(Base); - - exports.Throw = Throw = (function(_super) { - - __extends(Throw, _super); - - function Throw(expression) { - this.expression = expression; - } - - Throw.prototype.children = ['expression']; - - Throw.prototype.isStatement = YES; - - Throw.prototype.jumps = NO; - - Throw.prototype.makeReturn = THIS; - - Throw.prototype.compileNode = function(o) { - return this.tab + ("throw " + (this.expression.compile(o)) + ";"); - }; - - return Throw; - - })(Base); - - exports.Existence = Existence = (function(_super) { - - __extends(Existence, _super); - - function Existence(expression) { - this.expression = expression; - } - - Existence.prototype.children = ['expression']; - - Existence.prototype.invert = NEGATE; - - Existence.prototype.compileNode = function(o) { - var cmp, cnj, code, _ref2; - this.expression.front = this.front; - code = this.expression.compile(o, LEVEL_OP); - if (IDENTIFIER.test(code) && !o.scope.check(code)) { - _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; - code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; - } else { - code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; - } - if (o.level <= LEVEL_COND) { - return code; - } else { - return "(" + code + ")"; - } - }; - - return Existence; - - })(Base); - - exports.Parens = Parens = (function(_super) { - - __extends(Parens, _super); - - function Parens(body) { - this.body = body; - } - - Parens.prototype.children = ['body']; - - Parens.prototype.unwrap = function() { - return this.body; - }; - - Parens.prototype.isComplex = function() { - return this.body.isComplex(); - }; - - Parens.prototype.compileNode = function(o) { - var bare, code, expr; - expr = this.body.unwrap(); - if (expr instanceof Value && expr.isAtomic()) { - expr.front = this.front; - return expr.compile(o); - } - code = expr.compile(o, LEVEL_PAREN); - bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); - if (bare) { - return code; - } else { - return "(" + code + ")"; - } - }; - - return Parens; - - })(Base); - - exports.For = For = (function(_super) { - - __extends(For, _super); - - function For(body, source) { - var _ref2; - this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; - this.body = Block.wrap([body]); - this.own = !!source.own; - this.object = !!source.object; - if (this.object) { - _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; - } - if (this.index instanceof Value) { - throw SyntaxError('index cannot be a pattern matching expression'); - } - this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; - this.pattern = this.name instanceof Value; - if (this.range && this.index) { - throw SyntaxError('indexes do not apply to range loops'); - } - if (this.range && this.pattern) { - throw SyntaxError('cannot pattern match over range loops'); - } - this.returns = false; - } - - For.prototype.children = ['body', 'source', 'guard', 'step']; - - For.prototype.compileNode = function(o) { - var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2; - body = Block.wrap([this.body]); - lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; - if (lastJumps && lastJumps instanceof Return) { - this.returns = false; - } - source = this.range ? this.source.base : this.source; - scope = o.scope; - name = this.name && this.name.compile(o, LEVEL_LIST); - index = this.index && this.index.compile(o, LEVEL_LIST); - if (name && !this.pattern) { - scope.find(name); - } - if (index) { - scope.find(index); - } - if (this.returns) { - rvar = scope.freeVariable('results'); - } - ivar = (this.object && index) || scope.freeVariable('i'); - kvar = (this.range && name) || index || ivar; - kvarAssign = kvar !== ivar ? "" + kvar + " = " : ""; - if (this.step && !this.range) { - stepvar = scope.freeVariable("step"); - } - if (this.pattern) { - name = ivar; - } - varPart = ''; - guardPart = ''; - defPart = ''; - idt1 = this.tab + TAB; - if (this.range) { - forPart = source.compile(merge(o, { - index: ivar, - name: name, - step: this.step - })); - } else { - svar = this.source.compile(o, LEVEL_LIST); - if ((name || this.own) && !IDENTIFIER.test(svar)) { - defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; - svar = ref; - } - if (name && !this.pattern) { - namePart = "" + name + " = " + svar + "[" + kvar + "]"; - } - if (!this.object) { - lvar = scope.freeVariable('len'); - forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; - if (this.step) { - forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP)); - } - stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++")); - forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart; - } - } - if (this.returns) { - resultPart = "" + this.tab + rvar + " = [];\n"; - returnResult = "\n" + this.tab + "return " + rvar + ";"; - body.makeReturn(rvar); - } - if (this.guard) { - if (body.expressions.length > 1) { - body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); - } else { - if (this.guard) { - body = Block.wrap([new If(this.guard, body)]); - } - } - } - if (this.pattern) { - body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); - } - defPart += this.pluckDirectCall(o, body); - if (namePart) { - varPart = "\n" + idt1 + namePart + ";"; - } - if (this.object) { - forPart = "" + kvar + " in " + svar; - if (this.own) { - guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; - } - } - body = body.compile(merge(o, { - indent: idt1 - }), LEVEL_TOP); - if (body) { - body = '\n' + body + '\n'; - } - return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || ''); - }; - - For.prototype.pluckDirectCall = function(o, body) { - var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; - defs = ''; - _ref2 = body.expressions; - for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) { - expr = _ref2[idx]; - expr = expr.unwrapAll(); - if (!(expr instanceof Call)) { - continue; - } - val = expr.variable.unwrapAll(); - if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) { - continue; - } - fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val; - ref = new Literal(o.scope.freeVariable('fn')); - base = new Value(ref); - if (val.base) { - _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1]; - } - body.expressions[idx] = new Call(base, expr.args); - defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n'; - } - return defs; - }; - - return For; - - })(While); - - exports.Switch = Switch = (function(_super) { - - __extends(Switch, _super); - - function Switch(subject, cases, otherwise) { - this.subject = subject; - this.cases = cases; - this.otherwise = otherwise; - } - - Switch.prototype.children = ['subject', 'cases', 'otherwise']; - - Switch.prototype.isStatement = YES; - - Switch.prototype.jumps = function(o) { - var block, conds, _i, _len, _ref2, _ref3, _ref4; - if (o == null) { - o = { - block: true - }; - } - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; - if (block.jumps(o)) { - return block; - } - } - return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; - }; - - Switch.prototype.makeReturn = function(res) { - var pair, _i, _len, _ref2, _ref3; - _ref2 = this.cases; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - pair = _ref2[_i]; - pair[1].makeReturn(res); - } - if (res) { - this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); - } - if ((_ref3 = this.otherwise) != null) { - _ref3.makeReturn(res); - } - return this; - }; - - Switch.prototype.compileNode = function(o) { - var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4, _ref5; - idt1 = o.indent + TAB; - idt2 = o.indent = idt1 + TAB; - code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n"); - _ref3 = this.cases; - for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { - _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1]; - _ref5 = flatten([conditions]); - for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) { - cond = _ref5[_j]; - if (!this.subject) { - cond = cond.invert(); - } - code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n"); - } - if (body = block.compile(o, LEVEL_TOP)) { - code += body + '\n'; - } - if (i === this.cases.length - 1 && !this.otherwise) { - break; - } - expr = this.lastNonComment(block.expressions); - if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { - continue; - } - code += idt2 + 'break;\n'; - } - if (this.otherwise && this.otherwise.expressions.length) { - code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n"); - } - return code + this.tab + '}'; - }; - - return Switch; - - })(Base); - - exports.If = If = (function(_super) { - - __extends(If, _super); - - function If(condition, body, options) { - this.body = body; - if (options == null) { - options = {}; - } - this.condition = options.type === 'unless' ? condition.invert() : condition; - this.elseBody = null; - this.isChain = false; - this.soak = options.soak; - } - - If.prototype.children = ['condition', 'body', 'elseBody']; - - If.prototype.bodyNode = function() { - var _ref2; - return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.elseBodyNode = function() { - var _ref2; - return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; - }; - - If.prototype.addElse = function(elseBody) { - if (this.isChain) { - this.elseBodyNode().addElse(elseBody); - } else { - this.isChain = elseBody instanceof If; - this.elseBody = this.ensureBlock(elseBody); - } - return this; - }; - - If.prototype.isStatement = function(o) { - var _ref2; - return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); - }; - - If.prototype.jumps = function(o) { - var _ref2; - return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); - }; - - If.prototype.compileNode = function(o) { - if (this.isStatement(o)) { - return this.compileStatement(o); - } else { - return this.compileExpression(o); - } - }; - - If.prototype.makeReturn = function(res) { - if (res) { - this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); - } - this.body && (this.body = new Block([this.body.makeReturn(res)])); - this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); - return this; - }; - - If.prototype.ensureBlock = function(node) { - if (node instanceof Block) { - return node; - } else { - return new Block([node]); - } - }; - - If.prototype.compileStatement = function(o) { - var body, child, cond, exeq, ifPart; - child = del(o, 'chainChild'); - exeq = del(o, 'isExistentialEquals'); - if (exeq) { - return new If(this.condition.invert(), this.elseBodyNode(), { - type: 'if' - }).compile(o); - } - cond = this.condition.compile(o, LEVEL_PAREN); - o.indent += TAB; - body = this.ensureBlock(this.body); - ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}"; - if (!child) { - ifPart = this.tab + ifPart; - } - if (!this.elseBody) { - return ifPart; - } - return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}"); - }; - - If.prototype.compileExpression = function(o) { - var alt, body, code, cond; - cond = this.condition.compile(o, LEVEL_COND); - body = this.bodyNode().compile(o, LEVEL_LIST); - alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0'; - code = "" + cond + " ? " + body + " : " + alt; - if (o.level >= LEVEL_COND) { - return "(" + code + ")"; - } else { - return code; - } - }; - - If.prototype.unfoldSoak = function() { - return this.soak && this; - }; - - return If; - - })(Base); - - Closure = { - wrap: function(expressions, statement, noReturn) { - var args, call, func, mentionsArgs, meth; - if (expressions.jumps()) { - return expressions; - } - func = new Code([], Block.wrap([expressions])); - args = []; - if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) { - meth = new Literal(mentionsArgs ? 'apply' : 'call'); - args = [new Literal('this')]; - if (mentionsArgs) { - args.push(new Literal('arguments')); - } - func = new Value(func, [new Access(meth)]); - } - func.noReturn = noReturn; - call = new Call(func, args); - if (statement) { - return Block.wrap([call]); - } else { - return call; - } - }, - literalArgs: function(node) { - return node instanceof Literal && node.value === 'arguments' && !node.asKey; - }, - literalThis: function(node) { - return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); - } - }; - - unfoldSoak = function(o, parent, name) { - var ifn; - if (!(ifn = parent[name].unfoldSoak(o))) { - return; - } - parent[name] = ifn.body; - ifn.body = new Value(parent); - return ifn; - }; - - UTILITIES = { - "extends": function() { - return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; - }, - bind: function() { - return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }'; - }, - indexOf: function() { - return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; - }, - hasProp: function() { - return '{}.hasOwnProperty'; - }, - slice: function() { - return '[].slice'; - } - }; - - LEVEL_TOP = 1; - - LEVEL_PAREN = 2; - - LEVEL_LIST = 3; - - LEVEL_COND = 4; - - LEVEL_OP = 5; - - LEVEL_ACCESS = 6; - - TAB = ' '; - - IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; - - IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); - - SIMPLENUM = /^[+-]?\d+$/; - - METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$"); - - IS_STRING = /^['"]/; - - utility = function(name) { - var ref; - ref = "__" + name; - Scope.root.assign(ref, UTILITIES[name]()); - return ref; - }; - - multident = function(code, tab) { - code = code.replace(/\n/g, '$&' + tab); - return code.replace(/\s+$/, ''); - }; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js deleted file mode 100644 index d7fda40..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js +++ /dev/null @@ -1,138 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments; - - exports.OptionParser = OptionParser = (function() { - - function OptionParser(rules, banner) { - this.banner = banner; - this.rules = buildRules(rules); - } - - OptionParser.prototype.parse = function(args) { - var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref; - options = { - "arguments": [] - }; - skippingArgument = false; - originalArgs = args; - args = normalizeArguments(args); - for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { - arg = args[i]; - if (skippingArgument) { - skippingArgument = false; - continue; - } - if (arg === '--') { - pos = originalArgs.indexOf('--'); - options["arguments"] = options["arguments"].concat(originalArgs.slice(pos + 1)); - break; - } - isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG)); - seenNonOptionArg = options["arguments"].length > 0; - if (!seenNonOptionArg) { - matchedRule = false; - _ref = this.rules; - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - rule = _ref[_j]; - if (rule.shortFlag === arg || rule.longFlag === arg) { - value = true; - if (rule.hasArgument) { - skippingArgument = true; - value = args[i + 1]; - } - options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value; - matchedRule = true; - break; - } - } - if (isOption && !matchedRule) { - throw new Error("unrecognized option: " + arg); - } - } - if (seenNonOptionArg || !isOption) { - options["arguments"].push(arg); - } - } - return options; - }; - - OptionParser.prototype.help = function() { - var letPart, lines, rule, spaces, _i, _len, _ref; - lines = []; - if (this.banner) { - lines.unshift("" + this.banner + "\n"); - } - _ref = this.rules; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - rule = _ref[_i]; - spaces = 15 - rule.longFlag.length; - spaces = spaces > 0 ? Array(spaces + 1).join(' ') : ''; - letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' '; - lines.push(' ' + letPart + rule.longFlag + spaces + rule.description); - } - return "\n" + (lines.join('\n')) + "\n"; - }; - - return OptionParser; - - })(); - - LONG_FLAG = /^(--\w[\w\-]*)/; - - SHORT_FLAG = /^(-\w)$/; - - MULTI_FLAG = /^-(\w{2,})/; - - OPTIONAL = /\[(\w+(\*?))\]/; - - buildRules = function(rules) { - var tuple, _i, _len, _results; - _results = []; - for (_i = 0, _len = rules.length; _i < _len; _i++) { - tuple = rules[_i]; - if (tuple.length < 3) { - tuple.unshift(null); - } - _results.push(buildRule.apply(null, tuple)); - } - return _results; - }; - - buildRule = function(shortFlag, longFlag, description, options) { - var match; - if (options == null) { - options = {}; - } - match = longFlag.match(OPTIONAL); - longFlag = longFlag.match(LONG_FLAG)[1]; - return { - name: longFlag.substr(2), - shortFlag: shortFlag, - longFlag: longFlag, - description: description, - hasArgument: !!(match && match[1]), - isList: !!(match && match[2]) - }; - }; - - normalizeArguments = function(args) { - var arg, l, match, result, _i, _j, _len, _len1, _ref; - args = args.slice(0); - result = []; - for (_i = 0, _len = args.length; _i < _len; _i++) { - arg = args[_i]; - if (match = arg.match(MULTI_FLAG)) { - _ref = match[1].split(''); - for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { - l = _ref[_j]; - result.push('-' + l); - } - } else { - result.push(arg); - } - } - return result; - }; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/parser.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/parser.js deleted file mode 100755 index f049903..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/parser.js +++ /dev/null @@ -1,683 +0,0 @@ -/* Jison generated parser */ -var parser = (function(){ -var parser = {trace: function trace() { }, -yy: {}, -symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"Index":69,"INDEX_START":70,"IndexValue":71,"INDEX_END":72,"INDEX_SOAK":73,"Slice":74,"{":75,"AssignList":76,"}":77,"CLASS":78,"EXTENDS":79,"OptFuncExist":80,"Arguments":81,"SUPER":82,"FUNC_EXIST":83,"CALL_START":84,"CALL_END":85,"ArgList":86,"THIS":87,"@":88,"[":89,"]":90,"RangeDots":91,"..":92,"Arg":93,"SimpleArgs":94,"TRY":95,"Catch":96,"FINALLY":97,"CATCH":98,"THROW":99,"(":100,")":101,"WhileSource":102,"WHILE":103,"WHEN":104,"UNTIL":105,"Loop":106,"LOOP":107,"ForBody":108,"FOR":109,"ForStart":110,"ForSource":111,"ForVariables":112,"OWN":113,"ForValue":114,"FORIN":115,"FOROF":116,"BY":117,"SWITCH":118,"Whens":119,"ELSE":120,"When":121,"LEADING_WHEN":122,"IfBlock":123,"IF":124,"POST_IF":125,"UNARY":126,"-":127,"+":128,"--":129,"++":130,"?":131,"MATH":132,"SHIFT":133,"COMPARE":134,"LOGIC":135,"RELATION":136,"COMPOUND_ASSIGN":137,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",70:"INDEX_START",72:"INDEX_END",73:"INDEX_SOAK",75:"{",77:"}",78:"CLASS",79:"EXTENDS",82:"SUPER",83:"FUNC_EXIST",84:"CALL_START",85:"CALL_END",87:"THIS",88:"@",89:"[",90:"]",92:"..",95:"TRY",97:"FINALLY",98:"CATCH",99:"THROW",100:"(",101:")",103:"WHILE",104:"WHEN",105:"UNTIL",107:"LOOP",109:"FOR",113:"OWN",115:"FORIN",116:"FOROF",117:"BY",118:"SWITCH",120:"ELSE",122:"LEADING_WHEN",124:"IF",125:"POST_IF",126:"UNARY",127:"-",128:"+",129:"--",130:"++",131:"?",132:"MATH",133:"SHIFT",134:"COMPARE",135:"LOGIC",136:"RELATION",137:"COMPOUND_ASSIGN"}, -productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,1],[62,1],[69,3],[69,2],[71,1],[71,1],[59,4],[76,0],[76,1],[76,3],[76,4],[76,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[80,0],[80,1],[81,2],[81,4],[65,1],[65,1],[44,2],[58,2],[58,4],[91,1],[91,1],[64,5],[74,3],[74,2],[74,2],[74,1],[86,1],[86,3],[86,4],[86,4],[86,6],[93,1],[93,1],[94,1],[94,3],[19,2],[19,3],[19,4],[19,5],[96,3],[24,2],[63,3],[63,5],[102,2],[102,4],[102,2],[102,4],[20,2],[20,2],[20,2],[20,1],[106,2],[106,2],[21,2],[21,2],[21,2],[108,2],[108,2],[110,2],[110,3],[114,1],[114,1],[114,1],[114,1],[112,1],[112,3],[111,2],[111,2],[111,4],[111,4],[111,4],[111,6],[111,6],[22,5],[22,7],[22,4],[22,6],[119,1],[119,2],[121,3],[121,4],[123,3],[123,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]], -performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { - -var $0 = $$.length - 1; -switch (yystate) { -case 1:return this.$ = new yy.Block; -break; -case 2:return this.$ = $$[$0]; -break; -case 3:return this.$ = $$[$0-1]; -break; -case 4:this.$ = yy.Block.wrap([$$[$0]]); -break; -case 5:this.$ = $$[$0-2].push($$[$0]); -break; -case 6:this.$ = $$[$0-1]; -break; -case 7:this.$ = $$[$0]; -break; -case 8:this.$ = $$[$0]; -break; -case 9:this.$ = $$[$0]; -break; -case 10:this.$ = $$[$0]; -break; -case 11:this.$ = new yy.Literal($$[$0]); -break; -case 12:this.$ = $$[$0]; -break; -case 13:this.$ = $$[$0]; -break; -case 14:this.$ = $$[$0]; -break; -case 15:this.$ = $$[$0]; -break; -case 16:this.$ = $$[$0]; -break; -case 17:this.$ = $$[$0]; -break; -case 18:this.$ = $$[$0]; -break; -case 19:this.$ = $$[$0]; -break; -case 20:this.$ = $$[$0]; -break; -case 21:this.$ = $$[$0]; -break; -case 22:this.$ = $$[$0]; -break; -case 23:this.$ = $$[$0]; -break; -case 24:this.$ = new yy.Block; -break; -case 25:this.$ = $$[$0-1]; -break; -case 26:this.$ = new yy.Literal($$[$0]); -break; -case 27:this.$ = new yy.Literal($$[$0]); -break; -case 28:this.$ = new yy.Literal($$[$0]); -break; -case 29:this.$ = $$[$0]; -break; -case 30:this.$ = new yy.Literal($$[$0]); -break; -case 31:this.$ = new yy.Literal($$[$0]); -break; -case 32:this.$ = new yy.Literal($$[$0]); -break; -case 33:this.$ = new yy.Undefined; -break; -case 34:this.$ = new yy.Null; -break; -case 35:this.$ = new yy.Bool($$[$0]); -break; -case 36:this.$ = new yy.Assign($$[$0-2], $$[$0]); -break; -case 37:this.$ = new yy.Assign($$[$0-3], $$[$0]); -break; -case 38:this.$ = new yy.Assign($$[$0-4], $$[$0-1]); -break; -case 39:this.$ = new yy.Value($$[$0]); -break; -case 40:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object'); -break; -case 41:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object'); -break; -case 42:this.$ = $$[$0]; -break; -case 43:this.$ = $$[$0]; -break; -case 44:this.$ = $$[$0]; -break; -case 45:this.$ = $$[$0]; -break; -case 46:this.$ = new yy.Return($$[$0]); -break; -case 47:this.$ = new yy.Return; -break; -case 48:this.$ = new yy.Comment($$[$0]); -break; -case 49:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]); -break; -case 50:this.$ = new yy.Code([], $$[$0], $$[$0-1]); -break; -case 51:this.$ = 'func'; -break; -case 52:this.$ = 'boundfunc'; -break; -case 53:this.$ = $$[$0]; -break; -case 54:this.$ = $$[$0]; -break; -case 55:this.$ = []; -break; -case 56:this.$ = [$$[$0]]; -break; -case 57:this.$ = $$[$0-2].concat($$[$0]); -break; -case 58:this.$ = $$[$0-3].concat($$[$0]); -break; -case 59:this.$ = $$[$0-5].concat($$[$0-2]); -break; -case 60:this.$ = new yy.Param($$[$0]); -break; -case 61:this.$ = new yy.Param($$[$0-1], null, true); -break; -case 62:this.$ = new yy.Param($$[$0-2], $$[$0]); -break; -case 63:this.$ = $$[$0]; -break; -case 64:this.$ = $$[$0]; -break; -case 65:this.$ = $$[$0]; -break; -case 66:this.$ = $$[$0]; -break; -case 67:this.$ = new yy.Splat($$[$0-1]); -break; -case 68:this.$ = new yy.Value($$[$0]); -break; -case 69:this.$ = $$[$0-1].add($$[$0]); -break; -case 70:this.$ = new yy.Value($$[$0-1], [].concat($$[$0])); -break; -case 71:this.$ = $$[$0]; -break; -case 72:this.$ = $$[$0]; -break; -case 73:this.$ = new yy.Value($$[$0]); -break; -case 74:this.$ = new yy.Value($$[$0]); -break; -case 75:this.$ = $$[$0]; -break; -case 76:this.$ = new yy.Value($$[$0]); -break; -case 77:this.$ = new yy.Value($$[$0]); -break; -case 78:this.$ = new yy.Value($$[$0]); -break; -case 79:this.$ = $$[$0]; -break; -case 80:this.$ = new yy.Access($$[$0]); -break; -case 81:this.$ = new yy.Access($$[$0], 'soak'); -break; -case 82:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])]; -break; -case 83:this.$ = new yy.Access(new yy.Literal('prototype')); -break; -case 84:this.$ = $$[$0]; -break; -case 85:this.$ = $$[$0-1]; -break; -case 86:this.$ = yy.extend($$[$0], { - soak: true - }); -break; -case 87:this.$ = new yy.Index($$[$0]); -break; -case 88:this.$ = new yy.Slice($$[$0]); -break; -case 89:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated); -break; -case 90:this.$ = []; -break; -case 91:this.$ = [$$[$0]]; -break; -case 92:this.$ = $$[$0-2].concat($$[$0]); -break; -case 93:this.$ = $$[$0-3].concat($$[$0]); -break; -case 94:this.$ = $$[$0-5].concat($$[$0-2]); -break; -case 95:this.$ = new yy.Class; -break; -case 96:this.$ = new yy.Class(null, null, $$[$0]); -break; -case 97:this.$ = new yy.Class(null, $$[$0]); -break; -case 98:this.$ = new yy.Class(null, $$[$0-1], $$[$0]); -break; -case 99:this.$ = new yy.Class($$[$0]); -break; -case 100:this.$ = new yy.Class($$[$0-1], null, $$[$0]); -break; -case 101:this.$ = new yy.Class($$[$0-2], $$[$0]); -break; -case 102:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]); -break; -case 103:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); -break; -case 104:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); -break; -case 105:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]); -break; -case 106:this.$ = new yy.Call('super', $$[$0]); -break; -case 107:this.$ = false; -break; -case 108:this.$ = true; -break; -case 109:this.$ = []; -break; -case 110:this.$ = $$[$0-2]; -break; -case 111:this.$ = new yy.Value(new yy.Literal('this')); -break; -case 112:this.$ = new yy.Value(new yy.Literal('this')); -break; -case 113:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this'); -break; -case 114:this.$ = new yy.Arr([]); -break; -case 115:this.$ = new yy.Arr($$[$0-2]); -break; -case 116:this.$ = 'inclusive'; -break; -case 117:this.$ = 'exclusive'; -break; -case 118:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]); -break; -case 119:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]); -break; -case 120:this.$ = new yy.Range($$[$0-1], null, $$[$0]); -break; -case 121:this.$ = new yy.Range(null, $$[$0], $$[$0-1]); -break; -case 122:this.$ = new yy.Range(null, null, $$[$0]); -break; -case 123:this.$ = [$$[$0]]; -break; -case 124:this.$ = $$[$0-2].concat($$[$0]); -break; -case 125:this.$ = $$[$0-3].concat($$[$0]); -break; -case 126:this.$ = $$[$0-2]; -break; -case 127:this.$ = $$[$0-5].concat($$[$0-2]); -break; -case 128:this.$ = $$[$0]; -break; -case 129:this.$ = $$[$0]; -break; -case 130:this.$ = $$[$0]; -break; -case 131:this.$ = [].concat($$[$0-2], $$[$0]); -break; -case 132:this.$ = new yy.Try($$[$0]); -break; -case 133:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]); -break; -case 134:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]); -break; -case 135:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]); -break; -case 136:this.$ = [$$[$0-1], $$[$0]]; -break; -case 137:this.$ = new yy.Throw($$[$0]); -break; -case 138:this.$ = new yy.Parens($$[$0-1]); -break; -case 139:this.$ = new yy.Parens($$[$0-2]); -break; -case 140:this.$ = new yy.While($$[$0]); -break; -case 141:this.$ = new yy.While($$[$0-2], { - guard: $$[$0] - }); -break; -case 142:this.$ = new yy.While($$[$0], { - invert: true - }); -break; -case 143:this.$ = new yy.While($$[$0-2], { - invert: true, - guard: $$[$0] - }); -break; -case 144:this.$ = $$[$0-1].addBody($$[$0]); -break; -case 145:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); -break; -case 146:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); -break; -case 147:this.$ = $$[$0]; -break; -case 148:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]); -break; -case 149:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]])); -break; -case 150:this.$ = new yy.For($$[$0-1], $$[$0]); -break; -case 151:this.$ = new yy.For($$[$0-1], $$[$0]); -break; -case 152:this.$ = new yy.For($$[$0], $$[$0-1]); -break; -case 153:this.$ = { - source: new yy.Value($$[$0]) - }; -break; -case 154:this.$ = (function () { - $$[$0].own = $$[$0-1].own; - $$[$0].name = $$[$0-1][0]; - $$[$0].index = $$[$0-1][1]; - return $$[$0]; - }()); -break; -case 155:this.$ = $$[$0]; -break; -case 156:this.$ = (function () { - $$[$0].own = true; - return $$[$0]; - }()); -break; -case 157:this.$ = $$[$0]; -break; -case 158:this.$ = $$[$0]; -break; -case 159:this.$ = new yy.Value($$[$0]); -break; -case 160:this.$ = new yy.Value($$[$0]); -break; -case 161:this.$ = [$$[$0]]; -break; -case 162:this.$ = [$$[$0-2], $$[$0]]; -break; -case 163:this.$ = { - source: $$[$0] - }; -break; -case 164:this.$ = { - source: $$[$0], - object: true - }; -break; -case 165:this.$ = { - source: $$[$0-2], - guard: $$[$0] - }; -break; -case 166:this.$ = { - source: $$[$0-2], - guard: $$[$0], - object: true - }; -break; -case 167:this.$ = { - source: $$[$0-2], - step: $$[$0] - }; -break; -case 168:this.$ = { - source: $$[$0-4], - guard: $$[$0-2], - step: $$[$0] - }; -break; -case 169:this.$ = { - source: $$[$0-4], - step: $$[$0-2], - guard: $$[$0] - }; -break; -case 170:this.$ = new yy.Switch($$[$0-3], $$[$0-1]); -break; -case 171:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]); -break; -case 172:this.$ = new yy.Switch(null, $$[$0-1]); -break; -case 173:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]); -break; -case 174:this.$ = $$[$0]; -break; -case 175:this.$ = $$[$0-1].concat($$[$0]); -break; -case 176:this.$ = [[$$[$0-1], $$[$0]]]; -break; -case 177:this.$ = [[$$[$0-2], $$[$0-1]]]; -break; -case 178:this.$ = new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - }); -break; -case 179:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], { - type: $$[$0-2] - })); -break; -case 180:this.$ = $$[$0]; -break; -case 181:this.$ = $$[$0-2].addElse($$[$0]); -break; -case 182:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { - type: $$[$0-1], - statement: true - }); -break; -case 183:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { - type: $$[$0-1], - statement: true - }); -break; -case 184:this.$ = new yy.Op($$[$0-1], $$[$0]); -break; -case 185:this.$ = new yy.Op('-', $$[$0]); -break; -case 186:this.$ = new yy.Op('+', $$[$0]); -break; -case 187:this.$ = new yy.Op('--', $$[$0]); -break; -case 188:this.$ = new yy.Op('++', $$[$0]); -break; -case 189:this.$ = new yy.Op('--', $$[$0-1], null, true); -break; -case 190:this.$ = new yy.Op('++', $$[$0-1], null, true); -break; -case 191:this.$ = new yy.Existence($$[$0-1]); -break; -case 192:this.$ = new yy.Op('+', $$[$0-2], $$[$0]); -break; -case 193:this.$ = new yy.Op('-', $$[$0-2], $$[$0]); -break; -case 194:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); -break; -case 195:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); -break; -case 196:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); -break; -case 197:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); -break; -case 198:this.$ = (function () { - if ($$[$0-1].charAt(0) === '!') { - return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); - } else { - return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); - } - }()); -break; -case 199:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]); -break; -case 200:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]); -break; -case 201:this.$ = new yy.Extends($$[$0-2], $$[$0]); -break; -} -}, -table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],101:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,7],6:[2,7],26:[2,7],101:[2,7],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,8],6:[2,8],26:[2,8],101:[2,8],102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,12],73:[1,100],77:[2,12],80:92,83:[1,94],84:[2,107],85:[2,12],90:[2,12],92:[2,12],101:[2,12],103:[2,12],104:[2,12],105:[2,12],109:[2,12],117:[2,12],125:[2,12],127:[2,12],128:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,13],73:[1,100],77:[2,13],80:101,83:[1,94],84:[2,107],85:[2,13],90:[2,13],92:[2,13],101:[2,13],103:[2,13],104:[2,13],105:[2,13],109:[2,13],117:[2,13],125:[2,13],127:[2,13],128:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],72:[2,14],77:[2,14],85:[2,14],90:[2,14],92:[2,14],101:[2,14],103:[2,14],104:[2,14],105:[2,14],109:[2,14],117:[2,14],125:[2,14],127:[2,14],128:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],72:[2,15],77:[2,15],85:[2,15],90:[2,15],92:[2,15],101:[2,15],103:[2,15],104:[2,15],105:[2,15],109:[2,15],117:[2,15],125:[2,15],127:[2,15],128:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],72:[2,16],77:[2,16],85:[2,16],90:[2,16],92:[2,16],101:[2,16],103:[2,16],104:[2,16],105:[2,16],109:[2,16],117:[2,16],125:[2,16],127:[2,16],128:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],72:[2,17],77:[2,17],85:[2,17],90:[2,17],92:[2,17],101:[2,17],103:[2,17],104:[2,17],105:[2,17],109:[2,17],117:[2,17],125:[2,17],127:[2,17],128:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],72:[2,18],77:[2,18],85:[2,18],90:[2,18],92:[2,18],101:[2,18],103:[2,18],104:[2,18],105:[2,18],109:[2,18],117:[2,18],125:[2,18],127:[2,18],128:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],72:[2,19],77:[2,19],85:[2,19],90:[2,19],92:[2,19],101:[2,19],103:[2,19],104:[2,19],105:[2,19],109:[2,19],117:[2,19],125:[2,19],127:[2,19],128:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],72:[2,20],77:[2,20],85:[2,20],90:[2,20],92:[2,20],101:[2,20],103:[2,20],104:[2,20],105:[2,20],109:[2,20],117:[2,20],125:[2,20],127:[2,20],128:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],72:[2,21],77:[2,21],85:[2,21],90:[2,21],92:[2,21],101:[2,21],103:[2,21],104:[2,21],105:[2,21],109:[2,21],117:[2,21],125:[2,21],127:[2,21],128:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],72:[2,22],77:[2,22],85:[2,22],90:[2,22],92:[2,22],101:[2,22],103:[2,22],104:[2,22],105:[2,22],109:[2,22],117:[2,22],125:[2,22],127:[2,22],128:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],72:[2,23],77:[2,23],85:[2,23],90:[2,23],92:[2,23],101:[2,23],103:[2,23],104:[2,23],105:[2,23],109:[2,23],117:[2,23],125:[2,23],127:[2,23],128:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23]},{1:[2,9],6:[2,9],26:[2,9],101:[2,9],103:[2,9],105:[2,9],109:[2,9],125:[2,9]},{1:[2,10],6:[2,10],26:[2,10],101:[2,10],103:[2,10],105:[2,10],109:[2,10],125:[2,10]},{1:[2,11],6:[2,11],26:[2,11],101:[2,11],103:[2,11],105:[2,11],109:[2,11],125:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,103],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],70:[2,75],72:[2,75],73:[2,75],77:[2,75],83:[2,75],84:[2,75],85:[2,75],90:[2,75],92:[2,75],101:[2,75],103:[2,75],104:[2,75],105:[2,75],109:[2,75],117:[2,75],125:[2,75],127:[2,75],128:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],70:[2,76],72:[2,76],73:[2,76],77:[2,76],83:[2,76],84:[2,76],85:[2,76],90:[2,76],92:[2,76],101:[2,76],103:[2,76],104:[2,76],105:[2,76],109:[2,76],117:[2,76],125:[2,76],127:[2,76],128:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],70:[2,77],72:[2,77],73:[2,77],77:[2,77],83:[2,77],84:[2,77],85:[2,77],90:[2,77],92:[2,77],101:[2,77],103:[2,77],104:[2,77],105:[2,77],109:[2,77],117:[2,77],125:[2,77],127:[2,77],128:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],70:[2,78],72:[2,78],73:[2,78],77:[2,78],83:[2,78],84:[2,78],85:[2,78],90:[2,78],92:[2,78],101:[2,78],103:[2,78],104:[2,78],105:[2,78],109:[2,78],117:[2,78],125:[2,78],127:[2,78],128:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],70:[2,79],72:[2,79],73:[2,79],77:[2,79],83:[2,79],84:[2,79],85:[2,79],90:[2,79],92:[2,79],101:[2,79],103:[2,79],104:[2,79],105:[2,79],109:[2,79],117:[2,79],125:[2,79],127:[2,79],128:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],70:[2,105],72:[2,105],73:[2,105],77:[2,105],81:104,83:[2,105],84:[1,105],85:[2,105],90:[2,105],92:[2,105],101:[2,105],103:[2,105],104:[2,105],105:[2,105],109:[2,105],117:[2,105],125:[2,105],127:[2,105],128:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105]},{6:[2,55],25:[2,55],27:109,28:[1,73],44:110,48:106,49:[2,55],54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{5:115,25:[1,5]},{8:116,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:118,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:119,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:120,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:124,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,72],73:[2,72],77:[2,72],79:[1,128],83:[2,72],84:[2,72],85:[2,72],90:[2,72],92:[2,72],101:[2,72],103:[2,72],104:[2,72],105:[2,72],109:[2,72],117:[2,72],125:[2,72],127:[2,72],128:[2,72],129:[1,125],130:[1,126],131:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[1,127]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],72:[2,180],77:[2,180],85:[2,180],90:[2,180],92:[2,180],101:[2,180],103:[2,180],104:[2,180],105:[2,180],109:[2,180],117:[2,180],120:[1,129],125:[2,180],127:[2,180],128:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180]},{5:130,25:[1,5]},{5:131,25:[1,5]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],72:[2,147],77:[2,147],85:[2,147],90:[2,147],92:[2,147],101:[2,147],103:[2,147],104:[2,147],105:[2,147],109:[2,147],117:[2,147],125:[2,147],127:[2,147],128:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147]},{5:132,25:[1,5]},{8:133,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,134],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,95],5:135,6:[2,95],13:121,14:122,25:[1,5],26:[2,95],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,49:[2,95],54:[2,95],57:[2,95],58:47,59:48,61:137,63:25,64:26,65:27,72:[2,95],75:[1,70],77:[2,95],79:[1,136],82:[1,28],85:[2,95],87:[1,58],88:[1,59],89:[1,57],90:[2,95],92:[2,95],100:[1,56],101:[2,95],103:[2,95],104:[2,95],105:[2,95],109:[2,95],117:[2,95],125:[2,95],127:[2,95],128:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95]},{8:138,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,47],6:[2,47],8:139,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,47],102:39,103:[2,47],105:[2,47],106:40,107:[1,67],108:41,109:[2,47],110:69,118:[1,42],123:37,124:[1,64],125:[2,47],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],77:[2,48],101:[2,48],103:[2,48],105:[2,48],109:[2,48],125:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],70:[2,73],72:[2,73],73:[2,73],77:[2,73],83:[2,73],84:[2,73],85:[2,73],90:[2,73],92:[2,73],101:[2,73],103:[2,73],104:[2,73],105:[2,73],109:[2,73],117:[2,73],125:[2,73],127:[2,73],128:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],70:[2,74],72:[2,74],73:[2,74],77:[2,74],83:[2,74],84:[2,74],85:[2,74],90:[2,74],92:[2,74],101:[2,74],103:[2,74],104:[2,74],105:[2,74],109:[2,74],117:[2,74],125:[2,74],127:[2,74],128:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],70:[2,29],72:[2,29],73:[2,29],77:[2,29],83:[2,29],84:[2,29],85:[2,29],90:[2,29],92:[2,29],101:[2,29],103:[2,29],104:[2,29],105:[2,29],109:[2,29],117:[2,29],125:[2,29],127:[2,29],128:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],70:[2,30],72:[2,30],73:[2,30],77:[2,30],83:[2,30],84:[2,30],85:[2,30],90:[2,30],92:[2,30],101:[2,30],103:[2,30],104:[2,30],105:[2,30],109:[2,30],117:[2,30],125:[2,30],127:[2,30],128:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],70:[2,31],72:[2,31],73:[2,31],77:[2,31],83:[2,31],84:[2,31],85:[2,31],90:[2,31],92:[2,31],101:[2,31],103:[2,31],104:[2,31],105:[2,31],109:[2,31],117:[2,31],125:[2,31],127:[2,31],128:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],70:[2,32],72:[2,32],73:[2,32],77:[2,32],83:[2,32],84:[2,32],85:[2,32],90:[2,32],92:[2,32],101:[2,32],103:[2,32],104:[2,32],105:[2,32],109:[2,32],117:[2,32],125:[2,32],127:[2,32],128:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],70:[2,33],72:[2,33],73:[2,33],77:[2,33],83:[2,33],84:[2,33],85:[2,33],90:[2,33],92:[2,33],101:[2,33],103:[2,33],104:[2,33],105:[2,33],109:[2,33],117:[2,33],125:[2,33],127:[2,33],128:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],70:[2,34],72:[2,34],73:[2,34],77:[2,34],83:[2,34],84:[2,34],85:[2,34],90:[2,34],92:[2,34],101:[2,34],103:[2,34],104:[2,34],105:[2,34],109:[2,34],117:[2,34],125:[2,34],127:[2,34],128:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],70:[2,35],72:[2,35],73:[2,35],77:[2,35],83:[2,35],84:[2,35],85:[2,35],90:[2,35],92:[2,35],101:[2,35],103:[2,35],104:[2,35],105:[2,35],109:[2,35],117:[2,35],125:[2,35],127:[2,35],128:[2,35],131:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35]},{4:140,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,141],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:142,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],70:[2,111],72:[2,111],73:[2,111],77:[2,111],83:[2,111],84:[2,111],85:[2,111],90:[2,111],92:[2,111],101:[2,111],103:[2,111],104:[2,111],105:[2,111],109:[2,111],117:[2,111],125:[2,111],127:[2,111],128:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:148,28:[1,73],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],70:[2,112],72:[2,112],73:[2,112],77:[2,112],83:[2,112],84:[2,112],85:[2,112],90:[2,112],92:[2,112],101:[2,112],103:[2,112],104:[2,112],105:[2,112],109:[2,112],117:[2,112],125:[2,112],127:[2,112],128:[2,112],131:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],70:[2,68],72:[2,68],73:[2,68],77:[2,68],79:[2,68],83:[2,68],84:[2,68],85:[2,68],90:[2,68],92:[2,68],101:[2,68],103:[2,68],104:[2,68],105:[2,68],109:[2,68],117:[2,68],125:[2,68],127:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],70:[2,71],72:[2,71],73:[2,71],77:[2,71],79:[2,71],83:[2,71],84:[2,71],85:[2,71],90:[2,71],92:[2,71],101:[2,71],103:[2,71],104:[2,71],105:[2,71],109:[2,71],117:[2,71],125:[2,71],127:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71]},{8:149,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:150,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:151,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:152,8:153,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{27:158,28:[1,73],44:159,58:160,59:161,64:154,75:[1,70],88:[1,113],89:[1,57],112:155,113:[1,156],114:157},{111:162,115:[1,163],116:[1,164]},{6:[2,90],11:168,25:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:165,77:[2,90],88:[1,113]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],70:[2,27],72:[2,27],73:[2,27],77:[2,27],83:[2,27],84:[2,27],85:[2,27],90:[2,27],92:[2,27],101:[2,27],103:[2,27],104:[2,27],105:[2,27],109:[2,27],117:[2,27],125:[2,27],127:[2,27],128:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],70:[2,28],72:[2,28],73:[2,28],77:[2,28],83:[2,28],84:[2,28],85:[2,28],90:[2,28],92:[2,28],101:[2,28],103:[2,28],104:[2,28],105:[2,28],109:[2,28],117:[2,28],125:[2,28],127:[2,28],128:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],70:[2,26],72:[2,26],73:[2,26],77:[2,26],79:[2,26],83:[2,26],84:[2,26],85:[2,26],90:[2,26],92:[2,26],101:[2,26],103:[2,26],104:[2,26],105:[2,26],109:[2,26],115:[2,26],116:[2,26],117:[2,26],125:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,6],6:[2,6],7:172,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,6],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],72:[2,24],77:[2,24],85:[2,24],90:[2,24],92:[2,24],97:[2,24],98:[2,24],101:[2,24],103:[2,24],104:[2,24],105:[2,24],109:[2,24],117:[2,24],120:[2,24],122:[2,24],125:[2,24],127:[2,24],128:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24]},{6:[1,74],26:[1,173]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],72:[2,191],77:[2,191],85:[2,191],90:[2,191],92:[2,191],101:[2,191],103:[2,191],104:[2,191],105:[2,191],109:[2,191],117:[2,191],125:[2,191],127:[2,191],128:[2,191],131:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191]},{8:174,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:175,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:176,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:177,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:178,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:179,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:180,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:181,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],72:[2,146],77:[2,146],85:[2,146],90:[2,146],92:[2,146],101:[2,146],103:[2,146],104:[2,146],105:[2,146],109:[2,146],117:[2,146],125:[2,146],127:[2,146],128:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],72:[2,151],77:[2,151],85:[2,151],90:[2,151],92:[2,151],101:[2,151],103:[2,151],104:[2,151],105:[2,151],109:[2,151],117:[2,151],125:[2,151],127:[2,151],128:[2,151],131:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151]},{8:182,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],72:[2,145],77:[2,145],85:[2,145],90:[2,145],92:[2,145],101:[2,145],103:[2,145],104:[2,145],105:[2,145],109:[2,145],117:[2,145],125:[2,145],127:[2,145],128:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145],135:[2,145],136:[2,145]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],72:[2,150],77:[2,150],85:[2,150],90:[2,150],92:[2,150],101:[2,150],103:[2,150],104:[2,150],105:[2,150],109:[2,150],117:[2,150],125:[2,150],127:[2,150],128:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150]},{81:183,84:[1,105]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],70:[2,69],72:[2,69],73:[2,69],77:[2,69],79:[2,69],83:[2,69],84:[2,69],85:[2,69],90:[2,69],92:[2,69],101:[2,69],103:[2,69],104:[2,69],105:[2,69],109:[2,69],117:[2,69],125:[2,69],127:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69]},{84:[2,108]},{27:184,28:[1,73]},{27:185,28:[1,73]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:186,28:[1,73],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],70:[2,83],72:[2,83],73:[2,83],77:[2,83],79:[2,83],83:[2,83],84:[2,83],85:[2,83],90:[2,83],92:[2,83],101:[2,83],103:[2,83],104:[2,83],105:[2,83],109:[2,83],117:[2,83],125:[2,83],127:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],70:[2,84],72:[2,84],73:[2,84],77:[2,84],79:[2,84],83:[2,84],84:[2,84],85:[2,84],90:[2,84],92:[2,84],101:[2,84],103:[2,84],104:[2,84],105:[2,84],109:[2,84],117:[2,84],125:[2,84],127:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84]},{8:188,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,192],58:47,59:48,61:36,63:25,64:26,65:27,71:187,74:189,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],91:190,92:[1,191],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{69:193,70:[1,99],73:[1,100]},{81:194,84:[1,105]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],70:[2,70],72:[2,70],73:[2,70],77:[2,70],79:[2,70],83:[2,70],84:[2,70],85:[2,70],90:[2,70],92:[2,70],101:[2,70],103:[2,70],104:[2,70],105:[2,70],109:[2,70],117:[2,70],125:[2,70],127:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70]},{6:[1,196],8:195,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,197],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],70:[2,106],72:[2,106],73:[2,106],77:[2,106],83:[2,106],84:[2,106],85:[2,106],90:[2,106],92:[2,106],101:[2,106],103:[2,106],104:[2,106],105:[2,106],109:[2,106],117:[2,106],125:[2,106],127:[2,106],128:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[1,198],86:199,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],49:[1,201],53:203,54:[1,202]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,205],49:[2,60],54:[2,60],57:[1,204]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:148,28:[1,73]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],72:[2,50],77:[2,50],85:[2,50],90:[2,50],92:[2,50],101:[2,50],103:[2,50],104:[2,50],105:[2,50],109:[2,50],117:[2,50],125:[2,50],127:[2,50],128:[2,50],131:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],72:[2,184],77:[2,184],85:[2,184],90:[2,184],92:[2,184],101:[2,184],102:87,103:[2,184],104:[2,184],105:[2,184],108:88,109:[2,184],110:69,117:[2,184],125:[2,184],127:[2,184],128:[2,184],131:[1,78],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184]},{102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],72:[2,185],77:[2,185],85:[2,185],90:[2,185],92:[2,185],101:[2,185],102:87,103:[2,185],104:[2,185],105:[2,185],108:88,109:[2,185],110:69,117:[2,185],125:[2,185],127:[2,185],128:[2,185],131:[1,78],132:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],72:[2,186],77:[2,186],85:[2,186],90:[2,186],92:[2,186],101:[2,186],102:87,103:[2,186],104:[2,186],105:[2,186],108:88,109:[2,186],110:69,117:[2,186],125:[2,186],127:[2,186],128:[2,186],131:[1,78],132:[2,186],133:[2,186],134:[2,186],135:[2,186],136:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,187],73:[2,72],77:[2,187],83:[2,72],84:[2,72],85:[2,187],90:[2,187],92:[2,187],101:[2,187],103:[2,187],104:[2,187],105:[2,187],109:[2,187],117:[2,187],125:[2,187],127:[2,187],128:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187],135:[2,187],136:[2,187]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:92,83:[1,94],84:[2,107]},{62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:101,83:[1,94],84:[2,107]},{66:[2,75],67:[2,75],68:[2,75],70:[2,75],73:[2,75],83:[2,75],84:[2,75]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,188],73:[2,72],77:[2,188],83:[2,72],84:[2,72],85:[2,188],90:[2,188],92:[2,188],101:[2,188],103:[2,188],104:[2,188],105:[2,188],109:[2,188],117:[2,188],125:[2,188],127:[2,188],128:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188],135:[2,188],136:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],72:[2,189],77:[2,189],85:[2,189],90:[2,189],92:[2,189],101:[2,189],103:[2,189],104:[2,189],105:[2,189],109:[2,189],117:[2,189],125:[2,189],127:[2,189],128:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],72:[2,190],77:[2,190],85:[2,190],90:[2,190],92:[2,190],101:[2,190],103:[2,190],104:[2,190],105:[2,190],109:[2,190],117:[2,190],125:[2,190],127:[2,190],128:[2,190],131:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190]},{8:206,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,207],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:208,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:209,25:[1,5],124:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],72:[2,132],77:[2,132],85:[2,132],90:[2,132],92:[2,132],96:211,97:[1,212],98:[1,213],101:[2,132],103:[2,132],104:[2,132],105:[2,132],109:[2,132],117:[2,132],125:[2,132],127:[2,132],128:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],72:[2,144],77:[2,144],85:[2,144],90:[2,144],92:[2,144],101:[2,144],103:[2,144],104:[2,144],105:[2,144],109:[2,144],117:[2,144],125:[2,144],127:[2,144],128:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144],135:[2,144],136:[2,144]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],72:[2,152],77:[2,152],85:[2,152],90:[2,152],92:[2,152],101:[2,152],103:[2,152],104:[2,152],105:[2,152],109:[2,152],117:[2,152],125:[2,152],127:[2,152],128:[2,152],131:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152]},{25:[1,214],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{119:215,121:216,122:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],72:[2,96],77:[2,96],85:[2,96],90:[2,96],92:[2,96],101:[2,96],103:[2,96],104:[2,96],105:[2,96],109:[2,96],117:[2,96],125:[2,96],127:[2,96],128:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96]},{8:218,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,99],5:219,6:[2,99],25:[1,5],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,99],73:[2,72],77:[2,99],79:[1,220],83:[2,72],84:[2,72],85:[2,99],90:[2,99],92:[2,99],101:[2,99],103:[2,99],104:[2,99],105:[2,99],109:[2,99],117:[2,99],125:[2,99],127:[2,99],128:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],72:[2,137],77:[2,137],85:[2,137],90:[2,137],92:[2,137],101:[2,137],102:87,103:[2,137],104:[2,137],105:[2,137],108:88,109:[2,137],110:69,117:[2,137],125:[2,137],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,46],6:[2,46],26:[2,46],101:[2,46],102:87,103:[2,46],105:[2,46],108:88,109:[2,46],110:69,125:[2,46],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,74],101:[1,221]},{4:222,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],90:[2,128],91:223,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],70:[2,114],72:[2,114],73:[2,114],77:[2,114],83:[2,114],84:[2,114],85:[2,114],90:[2,114],92:[2,114],101:[2,114],103:[2,114],104:[2,114],105:[2,114],109:[2,114],115:[2,114],116:[2,114],117:[2,114],125:[2,114],127:[2,114],128:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114]},{6:[2,53],25:[2,53],53:225,54:[1,226],90:[2,53]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],85:[2,123],90:[2,123]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:227,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],85:[2,129],90:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],70:[2,113],72:[2,113],73:[2,113],77:[2,113],79:[2,113],83:[2,113],84:[2,113],85:[2,113],90:[2,113],92:[2,113],101:[2,113],103:[2,113],104:[2,113],105:[2,113],109:[2,113],115:[2,113],116:[2,113],117:[2,113],125:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{5:228,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],72:[2,140],77:[2,140],85:[2,140],90:[2,140],92:[2,140],101:[2,140],102:87,103:[1,65],104:[1,229],105:[1,66],108:88,109:[1,68],110:69,117:[2,140],125:[2,140],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],72:[2,142],77:[2,142],85:[2,142],90:[2,142],92:[2,142],101:[2,142],102:87,103:[1,65],104:[1,230],105:[1,66],108:88,109:[1,68],110:69,117:[2,142],125:[2,142],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],72:[2,148],77:[2,148],85:[2,148],90:[2,148],92:[2,148],101:[2,148],103:[2,148],104:[2,148],105:[2,148],109:[2,148],117:[2,148],125:[2,148],127:[2,148],128:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],72:[2,149],77:[2,149],85:[2,149],90:[2,149],92:[2,149],101:[2,149],102:87,103:[1,65],104:[2,149],105:[1,66],108:88,109:[1,68],110:69,117:[2,149],125:[2,149],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],72:[2,153],77:[2,153],85:[2,153],90:[2,153],92:[2,153],101:[2,153],103:[2,153],104:[2,153],105:[2,153],109:[2,153],117:[2,153],125:[2,153],127:[2,153],128:[2,153],131:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153]},{115:[2,155],116:[2,155]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],112:231,114:157},{54:[1,232],115:[2,161],116:[2,161]},{54:[2,157],115:[2,157],116:[2,157]},{54:[2,158],115:[2,158],116:[2,158]},{54:[2,159],115:[2,159],116:[2,159]},{54:[2,160],115:[2,160],116:[2,160]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],72:[2,154],77:[2,154],85:[2,154],90:[2,154],92:[2,154],101:[2,154],103:[2,154],104:[2,154],105:[2,154],109:[2,154],117:[2,154],125:[2,154],127:[2,154],128:[2,154],131:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154]},{8:233,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:234,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],53:235,54:[1,236],77:[2,53]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],77:[2,91]},{6:[2,39],25:[2,39],26:[2,39],43:[1,237],54:[2,39],77:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],77:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],77:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],77:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],77:[2,45]},{1:[2,5],6:[2,5],26:[2,5],101:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],72:[2,25],77:[2,25],85:[2,25],90:[2,25],92:[2,25],97:[2,25],98:[2,25],101:[2,25],103:[2,25],104:[2,25],105:[2,25],109:[2,25],117:[2,25],120:[2,25],122:[2,25],125:[2,25],127:[2,25],128:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],72:[2,192],77:[2,192],85:[2,192],90:[2,192],92:[2,192],101:[2,192],102:87,103:[2,192],104:[2,192],105:[2,192],108:88,109:[2,192],110:69,117:[2,192],125:[2,192],127:[2,192],128:[2,192],131:[1,78],132:[1,81],133:[2,192],134:[2,192],135:[2,192],136:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],72:[2,193],77:[2,193],85:[2,193],90:[2,193],92:[2,193],101:[2,193],102:87,103:[2,193],104:[2,193],105:[2,193],108:88,109:[2,193],110:69,117:[2,193],125:[2,193],127:[2,193],128:[2,193],131:[1,78],132:[1,81],133:[2,193],134:[2,193],135:[2,193],136:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],72:[2,194],77:[2,194],85:[2,194],90:[2,194],92:[2,194],101:[2,194],102:87,103:[2,194],104:[2,194],105:[2,194],108:88,109:[2,194],110:69,117:[2,194],125:[2,194],127:[2,194],128:[2,194],131:[1,78],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],72:[2,195],77:[2,195],85:[2,195],90:[2,195],92:[2,195],101:[2,195],102:87,103:[2,195],104:[2,195],105:[2,195],108:88,109:[2,195],110:69,117:[2,195],125:[2,195],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[2,195],134:[2,195],135:[2,195],136:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],72:[2,196],77:[2,196],85:[2,196],90:[2,196],92:[2,196],101:[2,196],102:87,103:[2,196],104:[2,196],105:[2,196],108:88,109:[2,196],110:69,117:[2,196],125:[2,196],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,196],135:[2,196],136:[1,85]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],72:[2,197],77:[2,197],85:[2,197],90:[2,197],92:[2,197],101:[2,197],102:87,103:[2,197],104:[2,197],105:[2,197],108:88,109:[2,197],110:69,117:[2,197],125:[2,197],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[2,197],136:[1,85]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],72:[2,198],77:[2,198],85:[2,198],90:[2,198],92:[2,198],101:[2,198],102:87,103:[2,198],104:[2,198],105:[2,198],108:88,109:[2,198],110:69,117:[2,198],125:[2,198],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,198],135:[2,198],136:[2,198]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],72:[2,183],77:[2,183],85:[2,183],90:[2,183],92:[2,183],101:[2,183],102:87,103:[1,65],104:[2,183],105:[1,66],108:88,109:[1,68],110:69,117:[2,183],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],72:[2,182],77:[2,182],85:[2,182],90:[2,182],92:[2,182],101:[2,182],102:87,103:[1,65],104:[2,182],105:[1,66],108:88,109:[1,68],110:69,117:[2,182],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],70:[2,103],72:[2,103],73:[2,103],77:[2,103],83:[2,103],84:[2,103],85:[2,103],90:[2,103],92:[2,103],101:[2,103],103:[2,103],104:[2,103],105:[2,103],109:[2,103],117:[2,103],125:[2,103],127:[2,103],128:[2,103],131:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],70:[2,80],72:[2,80],73:[2,80],77:[2,80],79:[2,80],83:[2,80],84:[2,80],85:[2,80],90:[2,80],92:[2,80],101:[2,80],103:[2,80],104:[2,80],105:[2,80],109:[2,80],117:[2,80],125:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],70:[2,81],72:[2,81],73:[2,81],77:[2,81],79:[2,81],83:[2,81],84:[2,81],85:[2,81],90:[2,81],92:[2,81],101:[2,81],103:[2,81],104:[2,81],105:[2,81],109:[2,81],117:[2,81],125:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],70:[2,82],72:[2,82],73:[2,82],77:[2,82],79:[2,82],83:[2,82],84:[2,82],85:[2,82],90:[2,82],92:[2,82],101:[2,82],103:[2,82],104:[2,82],105:[2,82],109:[2,82],117:[2,82],125:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82]},{72:[1,238]},{57:[1,192],72:[2,87],91:239,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{72:[2,88]},{8:240,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,122],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{12:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],72:[2,116],75:[2,116],78:[2,116],82:[2,116],87:[2,116],88:[2,116],89:[2,116],95:[2,116],99:[2,116],100:[2,116],103:[2,116],105:[2,116],107:[2,116],109:[2,116],118:[2,116],124:[2,116],126:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],72:[2,117],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],70:[2,86],72:[2,86],73:[2,86],77:[2,86],79:[2,86],83:[2,86],84:[2,86],85:[2,86],90:[2,86],92:[2,86],101:[2,86],103:[2,86],104:[2,86],105:[2,86],109:[2,86],117:[2,86],125:[2,86],127:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],70:[2,104],72:[2,104],73:[2,104],77:[2,104],83:[2,104],84:[2,104],85:[2,104],90:[2,104],92:[2,104],101:[2,104],103:[2,104],104:[2,104],105:[2,104],109:[2,104],117:[2,104],125:[2,104],127:[2,104],128:[2,104],131:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],72:[2,36],77:[2,36],85:[2,36],90:[2,36],92:[2,36],101:[2,36],102:87,103:[2,36],104:[2,36],105:[2,36],108:88,109:[2,36],110:69,117:[2,36],125:[2,36],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:241,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:242,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],70:[2,109],72:[2,109],73:[2,109],77:[2,109],83:[2,109],84:[2,109],85:[2,109],90:[2,109],92:[2,109],101:[2,109],103:[2,109],104:[2,109],105:[2,109],109:[2,109],117:[2,109],125:[2,109],127:[2,109],128:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109]},{6:[2,53],25:[2,53],53:243,54:[1,226],85:[2,53]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],85:[2,128],90:[2,128],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{50:245,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:109,28:[1,73],44:110,55:246,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[1,247],25:[1,248]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:249,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],72:[2,199],77:[2,199],85:[2,199],90:[2,199],92:[2,199],101:[2,199],102:87,103:[2,199],104:[2,199],105:[2,199],108:88,109:[2,199],110:69,117:[2,199],125:[2,199],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:250,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],72:[2,201],77:[2,201],85:[2,201],90:[2,201],92:[2,201],101:[2,201],102:87,103:[2,201],104:[2,201],105:[2,201],108:88,109:[2,201],110:69,117:[2,201],125:[2,201],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],72:[2,181],77:[2,181],85:[2,181],90:[2,181],92:[2,181],101:[2,181],103:[2,181],104:[2,181],105:[2,181],109:[2,181],117:[2,181],125:[2,181],127:[2,181],128:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181]},{8:251,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],72:[2,133],77:[2,133],85:[2,133],90:[2,133],92:[2,133],97:[1,252],101:[2,133],103:[2,133],104:[2,133],105:[2,133],109:[2,133],117:[2,133],125:[2,133],127:[2,133],128:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133]},{5:253,25:[1,5]},{27:254,28:[1,73]},{119:255,121:216,122:[1,217]},{26:[1,256],120:[1,257],121:258,122:[1,217]},{26:[2,174],120:[2,174],122:[2,174]},{8:260,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],94:259,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,97],5:261,6:[2,97],25:[1,5],26:[2,97],49:[2,97],54:[2,97],57:[2,97],72:[2,97],77:[2,97],85:[2,97],90:[2,97],92:[2,97],101:[2,97],102:87,103:[1,65],104:[2,97],105:[1,66],108:88,109:[1,68],110:69,117:[2,97],125:[2,97],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],72:[2,100],77:[2,100],85:[2,100],90:[2,100],92:[2,100],101:[2,100],103:[2,100],104:[2,100],105:[2,100],109:[2,100],117:[2,100],125:[2,100],127:[2,100],128:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100]},{8:262,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],66:[2,138],67:[2,138],68:[2,138],70:[2,138],72:[2,138],73:[2,138],77:[2,138],83:[2,138],84:[2,138],85:[2,138],90:[2,138],92:[2,138],101:[2,138],103:[2,138],104:[2,138],105:[2,138],109:[2,138],117:[2,138],125:[2,138],127:[2,138],128:[2,138],131:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138]},{6:[1,74],26:[1,263]},{8:264,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,67],12:[2,117],25:[2,67],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,67],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],90:[2,67],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{6:[1,266],25:[1,267],90:[1,265]},{6:[2,54],8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[2,54],87:[1,58],88:[1,59],89:[1,57],90:[2,54],93:268,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:269,54:[1,226]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],49:[2,178],54:[2,178],57:[2,178],72:[2,178],77:[2,178],85:[2,178],90:[2,178],92:[2,178],101:[2,178],103:[2,178],104:[2,178],105:[2,178],109:[2,178],117:[2,178],120:[2,178],125:[2,178],127:[2,178],128:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178],135:[2,178],136:[2,178]},{8:270,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:271,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{115:[2,156],116:[2,156]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],114:272},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],49:[2,163],54:[2,163],57:[2,163],72:[2,163],77:[2,163],85:[2,163],90:[2,163],92:[2,163],101:[2,163],102:87,103:[2,163],104:[1,273],105:[2,163],108:88,109:[2,163],110:69,117:[1,274],125:[2,163],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],49:[2,164],54:[2,164],57:[2,164],72:[2,164],77:[2,164],85:[2,164],90:[2,164],92:[2,164],101:[2,164],102:87,103:[2,164],104:[1,275],105:[2,164],108:88,109:[2,164],110:69,117:[2,164],125:[2,164],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,277],25:[1,278],77:[1,276]},{6:[2,54],11:168,25:[2,54],26:[2,54],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:279,42:167,44:171,46:[1,46],77:[2,54],88:[1,113]},{8:280,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,281],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],70:[2,85],72:[2,85],73:[2,85],77:[2,85],79:[2,85],83:[2,85],84:[2,85],85:[2,85],90:[2,85],92:[2,85],101:[2,85],103:[2,85],104:[2,85],105:[2,85],109:[2,85],117:[2,85],125:[2,85],127:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85]},{8:282,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,120],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,121],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],72:[2,37],77:[2,37],85:[2,37],90:[2,37],92:[2,37],101:[2,37],102:87,103:[2,37],104:[2,37],105:[2,37],108:88,109:[2,37],110:69,117:[2,37],125:[2,37],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,283],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],85:[1,284]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],85:[2,67],90:[2,67]},{5:285,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:109,28:[1,73],44:110,55:286,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,55],25:[2,55],26:[2,55],27:109,28:[1,73],44:110,48:287,54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,288],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:289,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:290,25:[1,5]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],72:[2,134],77:[2,134],85:[2,134],90:[2,134],92:[2,134],101:[2,134],103:[2,134],104:[2,134],105:[2,134],109:[2,134],117:[2,134],125:[2,134],127:[2,134],128:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134]},{5:291,25:[1,5]},{26:[1,292],120:[1,293],121:258,122:[1,217]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],72:[2,172],77:[2,172],85:[2,172],90:[2,172],92:[2,172],101:[2,172],103:[2,172],104:[2,172],105:[2,172],109:[2,172],117:[2,172],125:[2,172],127:[2,172],128:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172]},{5:294,25:[1,5]},{26:[2,175],120:[2,175],122:[2,175]},{5:295,25:[1,5],54:[1,296]},{25:[2,130],54:[2,130],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],72:[2,98],77:[2,98],85:[2,98],90:[2,98],92:[2,98],101:[2,98],103:[2,98],104:[2,98],105:[2,98],109:[2,98],117:[2,98],125:[2,98],127:[2,98],128:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98]},{1:[2,101],5:297,6:[2,101],25:[1,5],26:[2,101],49:[2,101],54:[2,101],57:[2,101],72:[2,101],77:[2,101],85:[2,101],90:[2,101],92:[2,101],101:[2,101],102:87,103:[1,65],104:[2,101],105:[1,66],108:88,109:[1,68],110:69,117:[2,101],125:[2,101],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{101:[1,298]},{90:[1,299],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],70:[2,115],72:[2,115],73:[2,115],77:[2,115],83:[2,115],84:[2,115],85:[2,115],90:[2,115],92:[2,115],101:[2,115],103:[2,115],104:[2,115],105:[2,115],109:[2,115],115:[2,115],116:[2,115],117:[2,115],125:[2,115],127:[2,115],128:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],93:300,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:301,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],85:[2,124],90:[2,124]},{6:[1,266],25:[1,267],26:[1,302]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],72:[2,141],77:[2,141],85:[2,141],90:[2,141],92:[2,141],101:[2,141],102:87,103:[1,65],104:[2,141],105:[1,66],108:88,109:[1,68],110:69,117:[2,141],125:[2,141],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],72:[2,143],77:[2,143],85:[2,143],90:[2,143],92:[2,143],101:[2,143],102:87,103:[1,65],104:[2,143],105:[1,66],108:88,109:[1,68],110:69,117:[2,143],125:[2,143],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{115:[2,162],116:[2,162]},{8:303,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:304,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:305,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],70:[2,89],72:[2,89],73:[2,89],77:[2,89],83:[2,89],84:[2,89],85:[2,89],90:[2,89],92:[2,89],101:[2,89],103:[2,89],104:[2,89],105:[2,89],109:[2,89],115:[2,89],116:[2,89],117:[2,89],125:[2,89],127:[2,89],128:[2,89],131:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89]},{11:168,27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:306,42:167,44:171,46:[1,46],88:[1,113]},{6:[2,90],11:168,25:[2,90],26:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:307,88:[1,113]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],77:[2,92]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],77:[2,40],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:308,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,119],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],72:[2,38],77:[2,38],85:[2,38],90:[2,38],92:[2,38],101:[2,38],103:[2,38],104:[2,38],105:[2,38],109:[2,38],117:[2,38],125:[2,38],127:[2,38],128:[2,38],131:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],70:[2,110],72:[2,110],73:[2,110],77:[2,110],83:[2,110],84:[2,110],85:[2,110],90:[2,110],92:[2,110],101:[2,110],103:[2,110],104:[2,110],105:[2,110],109:[2,110],117:[2,110],125:[2,110],127:[2,110],128:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],72:[2,49],77:[2,49],85:[2,49],90:[2,49],92:[2,49],101:[2,49],103:[2,49],104:[2,49],105:[2,49],109:[2,49],117:[2,49],125:[2,49],127:[2,49],128:[2,49],131:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:309,54:[1,202]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],72:[2,200],77:[2,200],85:[2,200],90:[2,200],92:[2,200],101:[2,200],103:[2,200],104:[2,200],105:[2,200],109:[2,200],117:[2,200],125:[2,200],127:[2,200],128:[2,200],131:[2,200],132:[2,200],133:[2,200],134:[2,200],135:[2,200],136:[2,200]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],49:[2,179],54:[2,179],57:[2,179],72:[2,179],77:[2,179],85:[2,179],90:[2,179],92:[2,179],101:[2,179],103:[2,179],104:[2,179],105:[2,179],109:[2,179],117:[2,179],120:[2,179],125:[2,179],127:[2,179],128:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179],135:[2,179],136:[2,179]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],72:[2,135],77:[2,135],85:[2,135],90:[2,135],92:[2,135],101:[2,135],103:[2,135],104:[2,135],105:[2,135],109:[2,135],117:[2,135],125:[2,135],127:[2,135],128:[2,135],131:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],72:[2,136],77:[2,136],85:[2,136],90:[2,136],92:[2,136],97:[2,136],101:[2,136],103:[2,136],104:[2,136],105:[2,136],109:[2,136],117:[2,136],125:[2,136],127:[2,136],128:[2,136],131:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],72:[2,170],77:[2,170],85:[2,170],90:[2,170],92:[2,170],101:[2,170],103:[2,170],104:[2,170],105:[2,170],109:[2,170],117:[2,170],125:[2,170],127:[2,170],128:[2,170],131:[2,170],132:[2,170],133:[2,170],134:[2,170],135:[2,170],136:[2,170]},{5:310,25:[1,5]},{26:[1,311]},{6:[1,312],26:[2,176],120:[2,176],122:[2,176]},{8:313,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],72:[2,102],77:[2,102],85:[2,102],90:[2,102],92:[2,102],101:[2,102],103:[2,102],104:[2,102],105:[2,102],109:[2,102],117:[2,102],125:[2,102],127:[2,102],128:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],66:[2,139],67:[2,139],68:[2,139],70:[2,139],72:[2,139],73:[2,139],77:[2,139],83:[2,139],84:[2,139],85:[2,139],90:[2,139],92:[2,139],101:[2,139],103:[2,139],104:[2,139],105:[2,139],109:[2,139],117:[2,139],125:[2,139],127:[2,139],128:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],70:[2,118],72:[2,118],73:[2,118],77:[2,118],83:[2,118],84:[2,118],85:[2,118],90:[2,118],92:[2,118],101:[2,118],103:[2,118],104:[2,118],105:[2,118],109:[2,118],117:[2,118],125:[2,118],127:[2,118],128:[2,118],131:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],85:[2,125],90:[2,125]},{6:[2,53],25:[2,53],26:[2,53],53:314,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],85:[2,126],90:[2,126]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],72:[2,165],77:[2,165],85:[2,165],90:[2,165],92:[2,165],101:[2,165],102:87,103:[2,165],104:[2,165],105:[2,165],108:88,109:[2,165],110:69,117:[1,315],125:[2,165],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],72:[2,167],77:[2,167],85:[2,167],90:[2,167],92:[2,167],101:[2,167],102:87,103:[2,167],104:[1,316],105:[2,167],108:88,109:[2,167],110:69,117:[2,167],125:[2,167],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],72:[2,166],77:[2,166],85:[2,166],90:[2,166],92:[2,166],101:[2,166],102:87,103:[2,166],104:[2,166],105:[2,166],108:88,109:[2,166],110:69,117:[2,166],125:[2,166],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],77:[2,93]},{6:[2,53],25:[2,53],26:[2,53],53:317,54:[1,236]},{26:[1,318],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,247],25:[1,248],26:[1,319]},{26:[1,320]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],72:[2,173],77:[2,173],85:[2,173],90:[2,173],92:[2,173],101:[2,173],103:[2,173],104:[2,173],105:[2,173],109:[2,173],117:[2,173],125:[2,173],127:[2,173],128:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173]},{26:[2,177],120:[2,177],122:[2,177]},{25:[2,131],54:[2,131],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],26:[1,321]},{8:322,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:323,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[1,277],25:[1,278],26:[1,324]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],77:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],72:[2,171],77:[2,171],85:[2,171],90:[2,171],92:[2,171],101:[2,171],103:[2,171],104:[2,171],105:[2,171],109:[2,171],117:[2,171],125:[2,171],127:[2,171],128:[2,171],131:[2,171],132:[2,171],133:[2,171],134:[2,171],135:[2,171],136:[2,171]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],85:[2,127],90:[2,127]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],72:[2,168],77:[2,168],85:[2,168],90:[2,168],92:[2,168],101:[2,168],102:87,103:[2,168],104:[2,168],105:[2,168],108:88,109:[2,168],110:69,117:[2,168],125:[2,168],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],72:[2,169],77:[2,169],85:[2,169],90:[2,169],92:[2,169],101:[2,169],102:87,103:[2,169],104:[2,169],105:[2,169],108:88,109:[2,169],110:69,117:[2,169],125:[2,169],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],77:[2,94]}], -defaultActions: {60:[2,51],61:[2,52],75:[2,3],94:[2,108],189:[2,88]}, -parseError: function parseError(str, hash) { - throw new Error(str); -}, -parse: function parse(input) { - var self = this, - stack = [0], - vstack = [null], // semantic value stack - lstack = [], // location stack - table = this.table, - yytext = '', - yylineno = 0, - yyleng = 0, - recovering = 0, - TERROR = 2, - EOF = 1; - - //this.reductionCount = this.shiftCount = 0; - - this.lexer.setInput(input); - this.lexer.yy = this.yy; - this.yy.lexer = this.lexer; - if (typeof this.lexer.yylloc == 'undefined') - this.lexer.yylloc = {}; - var yyloc = this.lexer.yylloc; - lstack.push(yyloc); - - if (typeof this.yy.parseError === 'function') - this.parseError = this.yy.parseError; - - function popStack (n) { - stack.length = stack.length - 2*n; - vstack.length = vstack.length - n; - lstack.length = lstack.length - n; - } - - function lex() { - var token; - token = self.lexer.lex() || 1; // $end = 1 - // if token isn't its numeric value, convert - if (typeof token !== 'number') { - token = self.symbols_[token] || token; - } - return token; - } - - var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected; - while (true) { - // retreive state number from top of stack - state = stack[stack.length-1]; - - // use default actions if available - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol == null) - symbol = lex(); - // read action for current state and first input - action = table[state] && table[state][symbol]; - } - - // handle parse error - _handle_error: - if (typeof action === 'undefined' || !action.length || !action[0]) { - - if (!recovering) { - // Report error - expected = []; - for (p in table[state]) if (this.terminals_[p] && p > 2) { - expected.push("'"+this.terminals_[p]+"'"); - } - var errStr = ''; - if (this.lexer.showPosition) { - errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'"; - } else { - errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " + - (symbol == 1 /*EOF*/ ? "end of input" : - ("'"+(this.terminals_[symbol] || symbol)+"'")); - } - this.parseError(errStr, - {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); - } - - // just recovered from another error - if (recovering == 3) { - if (symbol == EOF) { - throw new Error(errStr || 'Parsing halted.'); - } - - // discard current lookahead and grab another - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - symbol = lex(); - } - - // try to recover from error - while (1) { - // check for error recovery rule in this state - if ((TERROR.toString()) in table[state]) { - break; - } - if (state == 0) { - throw new Error(errStr || 'Parsing halted.'); - } - popStack(1); - state = stack[stack.length-1]; - } - - preErrorSymbol = symbol; // save the lookahead token - symbol = TERROR; // insert generic error symbol as new lookahead - state = stack[stack.length-1]; - action = table[state] && table[state][TERROR]; - recovering = 3; // allow 3 real symbols to be shifted before reporting a new error - } - - // this shouldn't happen, unless resolve defaults are off - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol); - } - - switch (action[0]) { - - case 1: // shift - //this.shiftCount++; - - stack.push(symbol); - vstack.push(this.lexer.yytext); - lstack.push(this.lexer.yylloc); - stack.push(action[1]); // push state - symbol = null; - if (!preErrorSymbol) { // normal execution/no error - yyleng = this.lexer.yyleng; - yytext = this.lexer.yytext; - yylineno = this.lexer.yylineno; - yyloc = this.lexer.yylloc; - if (recovering > 0) - recovering--; - } else { // error just occurred, resume old lookahead f/ before error - symbol = preErrorSymbol; - preErrorSymbol = null; - } - break; - - case 2: // reduce - //this.reductionCount++; - - len = this.productions_[action[1]][1]; - - // perform semantic action - yyval.$ = vstack[vstack.length-len]; // default to $$ = $1 - // default location, uses first token for firsts, last for lasts - yyval._$ = { - first_line: lstack[lstack.length-(len||1)].first_line, - last_line: lstack[lstack.length-1].last_line, - first_column: lstack[lstack.length-(len||1)].first_column, - last_column: lstack[lstack.length-1].last_column - }; - r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); - - if (typeof r !== 'undefined') { - return r; - } - - // pop off stack - if (len) { - stack = stack.slice(0,-1*len*2); - vstack = vstack.slice(0, -1*len); - lstack = lstack.slice(0, -1*len); - } - - stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce) - vstack.push(yyval.$); - lstack.push(yyval._$); - // goto new state = table[STATE][NONTERMINAL] - newState = table[stack[stack.length-2]][stack[stack.length-1]]; - stack.push(newState); - break; - - case 3: // accept - return true; - } - - } - - return true; -}}; -undefined -return parser; -})(); -if (typeof require !== 'undefined' && typeof exports !== 'undefined') { -exports.parser = parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); } -exports.main = function commonjsMain(args) { - if (!args[1]) - throw new Error('Usage: '+args[0]+' FILE'); - if (typeof process !== 'undefined') { - var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8"); - } else { - var cwd = require("file").path(require("file").cwd()); - var source = cwd.join(args[1]).read({charset: "utf-8"}); - } - return exports.parser.parse(source); -} -if (typeof module !== 'undefined' && require.main === module) { - exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args); -} -} \ No newline at end of file diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/repl.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/repl.js deleted file mode 100644 index b4a4765..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/repl.js +++ /dev/null @@ -1,261 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout; - - stdin = process.openStdin(); - - stdout = process.stdout; - - CoffeeScript = require('./coffee-script'); - - readline = require('readline'); - - inspect = require('util').inspect; - - Script = require('vm').Script; - - Module = require('module'); - - REPL_PROMPT = 'coffee> '; - - REPL_PROMPT_MULTILINE = '------> '; - - REPL_PROMPT_CONTINUATION = '......> '; - - enableColours = false; - - if (process.platform !== 'win32') { - enableColours = !process.env.NODE_DISABLE_COLORS; - } - - error = function(err) { - return stdout.write((err.stack || err.toString()) + '\n'); - }; - - ACCESSOR = /\s*([\w\.]+)(?:\.(\w*))$/; - - SIMPLEVAR = /(\w+)$/i; - - autocomplete = function(text) { - return completeAttribute(text) || completeVariable(text) || [[], text]; - }; - - completeAttribute = function(text) { - var all, completions, key, match, obj, possibilities, prefix, val; - if (match = text.match(ACCESSOR)) { - all = match[0], obj = match[1], prefix = match[2]; - try { - val = Script.runInThisContext(obj); - } catch (error) { - return; - } - val = Object(val); - possibilities = Object.getOwnPropertyNames(val); - for (key in val) { - if (~possibilities.indexOf(val)) { - possibilities.push(key); - } - } - completions = getCompletions(prefix, possibilities); - return [completions, prefix]; - } - }; - - completeVariable = function(text) { - var completions, free, keywords, possibilities, r, vars, _ref; - free = (_ref = text.match(SIMPLEVAR)) != null ? _ref[1] : void 0; - if (text === "") { - free = ""; - } - if (free != null) { - vars = Script.runInThisContext('Object.getOwnPropertyNames(Object(this))'); - keywords = (function() { - var _i, _len, _ref1, _results; - _ref1 = CoffeeScript.RESERVED; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - r = _ref1[_i]; - if (r.slice(0, 2) !== '__') { - _results.push(r); - } - } - return _results; - })(); - possibilities = vars.concat(keywords); - completions = getCompletions(free, possibilities); - return [completions, free]; - } - }; - - getCompletions = function(prefix, candidates) { - var el, _i, _len, _results; - _results = []; - for (_i = 0, _len = candidates.length; _i < _len; _i++) { - el = candidates[_i]; - if (el.indexOf(prefix) === 0) { - _results.push(el); - } - } - return _results; - }; - - process.on('uncaughtException', error); - - backlog = ''; - - run = function(buffer) { - var code, returnValue, _; - buffer = buffer.replace(/(^|[\r\n]+)(\s*)##?(?:[^#\r\n][^\r\n]*|)($|[\r\n])/, "$1$2$3"); - buffer = buffer.replace(/[\r\n]+$/, ""); - if (multilineMode) { - backlog += "" + buffer + "\n"; - repl.setPrompt(REPL_PROMPT_CONTINUATION); - repl.prompt(); - return; - } - if (!buffer.toString().trim() && !backlog) { - repl.prompt(); - return; - } - code = backlog += buffer; - if (code[code.length - 1] === '\\') { - backlog = "" + backlog.slice(0, -1) + "\n"; - repl.setPrompt(REPL_PROMPT_CONTINUATION); - repl.prompt(); - return; - } - repl.setPrompt(REPL_PROMPT); - backlog = ''; - try { - _ = global._; - returnValue = CoffeeScript["eval"]("_=(" + code + "\n)", { - filename: 'repl', - modulename: 'repl' - }); - if (returnValue === void 0) { - global._ = _; - } - repl.output.write("" + (inspect(returnValue, false, 2, enableColours)) + "\n"); - } catch (err) { - error(err); - } - return repl.prompt(); - }; - - if (stdin.readable) { - pipedInput = ''; - repl = { - prompt: function() { - return stdout.write(this._prompt); - }, - setPrompt: function(p) { - return this._prompt = p; - }, - input: stdin, - output: stdout, - on: function() {} - }; - stdin.on('data', function(chunk) { - var line, lines, _i, _len, _ref; - pipedInput += chunk; - if (!/\n/.test(pipedInput)) { - return; - } - lines = pipedInput.split("\n"); - pipedInput = lines[lines.length - 1]; - _ref = lines.slice(0, -1); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - line = _ref[_i]; - if (!(line)) { - continue; - } - stdout.write("" + line + "\n"); - run(line); - } - }); - stdin.on('end', function() { - var line, _i, _len, _ref; - _ref = pipedInput.trim().split("\n"); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - line = _ref[_i]; - if (!(line)) { - continue; - } - stdout.write("" + line + "\n"); - run(line); - } - stdout.write('\n'); - return process.exit(0); - }); - } else { - if (readline.createInterface.length < 3) { - repl = readline.createInterface(stdin, autocomplete); - stdin.on('data', function(buffer) { - return repl.write(buffer); - }); - } else { - repl = readline.createInterface(stdin, stdout, autocomplete); - } - } - - multilineMode = false; - - repl.input.on('keypress', function(char, key) { - var cursorPos, newPrompt; - if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'v')) { - return; - } - cursorPos = repl.cursor; - repl.output.cursorTo(0); - repl.output.clearLine(1); - multilineMode = !multilineMode; - if (!multilineMode && backlog) { - repl._line(); - } - backlog = ''; - repl.setPrompt((newPrompt = multilineMode ? REPL_PROMPT_MULTILINE : REPL_PROMPT)); - repl.prompt(); - return repl.output.cursorTo(newPrompt.length + (repl.cursor = cursorPos)); - }); - - repl.input.on('keypress', function(char, key) { - if (!(multilineMode && repl.line)) { - return; - } - if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'd')) { - return; - } - multilineMode = false; - return repl._line(); - }); - - repl.on('attemptClose', function() { - if (multilineMode) { - multilineMode = false; - repl.output.cursorTo(0); - repl.output.clearLine(1); - repl._onLine(repl.line); - return; - } - if (backlog) { - backlog = ''; - repl.output.write('\n'); - repl.setPrompt(REPL_PROMPT); - return repl.prompt(); - } else { - return repl.close(); - } - }); - - repl.on('close', function() { - repl.output.write('\n'); - return repl.input.destroy(); - }); - - repl.on('line', run); - - repl.setPrompt(REPL_PROMPT); - - repl.prompt(); - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/rewriter.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/rewriter.js deleted file mode 100644 index d26133c..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/rewriter.js +++ /dev/null @@ -1,349 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref, - __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, - __slice = [].slice; - - exports.Rewriter = (function() { - - function Rewriter() {} - - Rewriter.prototype.rewrite = function(tokens) { - this.tokens = tokens; - this.removeLeadingNewlines(); - this.removeMidExpressionNewlines(); - this.closeOpenCalls(); - this.closeOpenIndexes(); - this.addImplicitIndentation(); - this.tagPostfixConditionals(); - this.addImplicitBraces(); - this.addImplicitParentheses(); - return this.tokens; - }; - - Rewriter.prototype.scanTokens = function(block) { - var i, token, tokens; - tokens = this.tokens; - i = 0; - while (token = tokens[i]) { - i += block.call(this, token, i, tokens); - } - return true; - }; - - Rewriter.prototype.detectEnd = function(i, condition, action) { - var levels, token, tokens, _ref, _ref1; - tokens = this.tokens; - levels = 0; - while (token = tokens[i]) { - if (levels === 0 && condition.call(this, token, i)) { - return action.call(this, token, i); - } - if (!token || levels < 0) { - return action.call(this, token, i - 1); - } - if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { - levels += 1; - } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) { - levels -= 1; - } - i += 1; - } - return i - 1; - }; - - Rewriter.prototype.removeLeadingNewlines = function() { - var i, tag, _i, _len, _ref; - _ref = this.tokens; - for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { - tag = _ref[i][0]; - if (tag !== 'TERMINATOR') { - break; - } - } - if (i) { - return this.tokens.splice(0, i); - } - }; - - Rewriter.prototype.removeMidExpressionNewlines = function() { - return this.scanTokens(function(token, i, tokens) { - var _ref; - if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { - return 1; - } - tokens.splice(i, 1); - return 0; - }); - }; - - Rewriter.prototype.closeOpenCalls = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; - }; - action = function(token, i) { - return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'CALL_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.closeOpenIndexes = function() { - var action, condition; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; - }; - action = function(token, i) { - return token[0] = 'INDEX_END'; - }; - return this.scanTokens(function(token, i) { - if (token[0] === 'INDEX_START') { - this.detectEnd(i + 1, condition, action); - } - return 1; - }); - }; - - Rewriter.prototype.addImplicitBraces = function() { - var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine; - stack = []; - start = null; - startsLine = null; - sameLine = true; - startIndent = 0; - startIndex = 0; - condition = function(token, i) { - var one, tag, three, two, _ref, _ref1; - _ref = this.tokens.slice(i + 1, (i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2]; - if ('HERECOMMENT' === (one != null ? one[0] : void 0)) { - return false; - } - tag = token[0]; - if (__indexOf.call(LINEBREAKS, tag) >= 0) { - sameLine = false; - } - return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT')); - }; - action = function(token, i) { - var tok; - tok = this.generate('}', '}', token[2]); - return this.tokens.splice(i, 0, tok); - }; - return this.scanTokens(function(token, i, tokens) { - var ago, idx, prevTag, tag, tok, value, _ref, _ref1; - if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { - stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]); - return 1; - } - if (__indexOf.call(EXPRESSION_END, tag) >= 0) { - start = stack.pop(); - return 1; - } - if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) { - return 1; - } - sameLine = true; - startIndex = i + 1; - stack.push(['{']); - idx = ago === '@' ? i - 2 : i - 1; - while (this.tag(idx - 2) === 'HERECOMMENT') { - idx -= 2; - } - prevTag = this.tag(idx - 1); - startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0); - value = new String('{'); - value.generated = true; - tok = this.generate('{', value, token[2]); - tokens.splice(idx, 0, tok); - this.detectEnd(i + 2, condition, action); - return 2; - }); - }; - - Rewriter.prototype.addImplicitParentheses = function() { - var action, condition, noCall, seenControl, seenSingle; - noCall = seenSingle = seenControl = false; - condition = function(token, i) { - var post, tag, _ref, _ref1; - tag = token[0]; - if (!seenSingle && token.fromThen) { - return true; - } - if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') { - seenSingle = true; - } - if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') { - seenControl = true; - } - if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') { - return true; - } - return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref1 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref1) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{'))); - }; - action = function(token, i) { - return this.tokens.splice(i, 0, this.generate('CALL_END', ')', token[2])); - }; - return this.scanTokens(function(token, i, tokens) { - var callObject, current, next, prev, tag, _ref, _ref1, _ref2; - tag = token[0]; - if (tag === 'CLASS' || tag === 'IF' || tag === 'FOR' || tag === 'WHILE') { - noCall = true; - } - _ref = tokens.slice(i - 1, (i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2]; - callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref1 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref1) >= 0); - seenSingle = false; - seenControl = false; - if (__indexOf.call(LINEBREAKS, tag) >= 0) { - noCall = false; - } - if (prev && !prev.spaced && tag === '?') { - token.call = true; - } - if (token.fromThen) { - return 1; - } - if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) { - return 1; - } - tokens.splice(i, 0, this.generate('CALL_START', '(', token[2])); - this.detectEnd(i + 1, condition, action); - if (prev[0] === '?') { - prev[0] = 'FUNC_EXIST'; - } - return 2; - }); - }; - - Rewriter.prototype.addImplicitIndentation = function() { - var action, condition, indent, outdent, starter; - starter = indent = outdent = null; - condition = function(token, i) { - var _ref; - return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN')); - }; - action = function(token, i) { - return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); - }; - return this.scanTokens(function(token, i, tokens) { - var tag, _ref, _ref1; - tag = token[0]; - if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { - tokens.splice(i, 1); - return 0; - } - if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { - tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token)))); - return 2; - } - if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) { - tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token)))); - return 4; - } - if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { - starter = tag; - _ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1]; - if (starter === 'THEN') { - indent.fromThen = true; - } - tokens.splice(i + 1, 0, indent); - this.detectEnd(i + 2, condition, action); - if (tag === 'THEN') { - tokens.splice(i, 1); - } - return 1; - } - return 1; - }); - }; - - Rewriter.prototype.tagPostfixConditionals = function() { - var action, condition, original; - original = null; - condition = function(token, i) { - var _ref; - return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; - }; - action = function(token, i) { - if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { - return original[0] = 'POST_' + original[0]; - } - }; - return this.scanTokens(function(token, i) { - if (token[0] !== 'IF') { - return 1; - } - original = token; - this.detectEnd(i + 1, condition, action); - return 1; - }); - }; - - Rewriter.prototype.indentation = function(token, implicit) { - var indent, outdent; - if (implicit == null) { - implicit = false; - } - indent = ['INDENT', 2, token[2]]; - outdent = ['OUTDENT', 2, token[2]]; - if (implicit) { - indent.generated = outdent.generated = true; - } - return [indent, outdent]; - }; - - Rewriter.prototype.generate = function(tag, value, line) { - var tok; - tok = [tag, value, line]; - tok.generated = true; - return tok; - }; - - Rewriter.prototype.tag = function(i) { - var _ref; - return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; - }; - - return Rewriter; - - })(); - - BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; - - exports.INVERSES = INVERSES = {}; - - EXPRESSION_START = []; - - EXPRESSION_END = []; - - for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { - _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; - EXPRESSION_START.push(INVERSES[rite] = left); - EXPRESSION_END.push(INVERSES[left] = rite); - } - - EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); - - IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; - - IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; - - IMPLICIT_UNSPACED_CALL = ['+', '-']; - - IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; - - IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; - - SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; - - SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; - - LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/scope.js b/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/scope.js deleted file mode 100644 index 3efc4ed..0000000 --- a/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/scope.js +++ /dev/null @@ -1,146 +0,0 @@ -// Generated by CoffeeScript 1.3.3 -(function() { - var Scope, extend, last, _ref; - - _ref = require('./helpers'), extend = _ref.extend, last = _ref.last; - - exports.Scope = Scope = (function() { - - Scope.root = null; - - function Scope(parent, expressions, method) { - this.parent = parent; - this.expressions = expressions; - this.method = method; - this.variables = [ - { - name: 'arguments', - type: 'arguments' - } - ]; - this.positions = {}; - if (!this.parent) { - Scope.root = this; - } - } - - Scope.prototype.add = function(name, type, immediate) { - if (this.shared && !immediate) { - return this.parent.add(name, type, immediate); - } - if (Object.prototype.hasOwnProperty.call(this.positions, name)) { - return this.variables[this.positions[name]].type = type; - } else { - return this.positions[name] = this.variables.push({ - name: name, - type: type - }) - 1; - } - }; - - Scope.prototype.namedMethod = function() { - if (this.method.name || !this.parent) { - return this.method; - } - return this.parent.namedMethod(); - }; - - Scope.prototype.find = function(name) { - if (this.check(name)) { - return true; - } - this.add(name, 'var'); - return false; - }; - - Scope.prototype.parameter = function(name) { - if (this.shared && this.parent.check(name, true)) { - return; - } - return this.add(name, 'param'); - }; - - Scope.prototype.check = function(name) { - var _ref1; - return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); - }; - - Scope.prototype.temporary = function(name, index) { - if (name.length > 1) { - return '_' + name + (index > 1 ? index - 1 : ''); - } else { - return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); - } - }; - - Scope.prototype.type = function(name) { - var v, _i, _len, _ref1; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.name === name) { - return v.type; - } - } - return null; - }; - - Scope.prototype.freeVariable = function(name, reserve) { - var index, temp; - if (reserve == null) { - reserve = true; - } - index = 0; - while (this.check((temp = this.temporary(name, index)))) { - index++; - } - if (reserve) { - this.add(temp, 'var', true); - } - return temp; - }; - - Scope.prototype.assign = function(name, value) { - this.add(name, { - value: value, - assigned: true - }, true); - return this.hasAssignments = true; - }; - - Scope.prototype.hasDeclarations = function() { - return !!this.declaredVariables().length; - }; - - Scope.prototype.declaredVariables = function() { - var realVars, tempVars, v, _i, _len, _ref1; - realVars = []; - tempVars = []; - _ref1 = this.variables; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type === 'var') { - (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); - } - } - return realVars.sort().concat(tempVars.sort()); - }; - - Scope.prototype.assignedVariables = function() { - var v, _i, _len, _ref1, _results; - _ref1 = this.variables; - _results = []; - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - v = _ref1[_i]; - if (v.type.assigned) { - _results.push("" + v.name + " = " + v.type.value); - } - } - return _results; - }; - - return Scope; - - })(); - -}).call(this); diff --git a/node_modules/grunt/node_modules/coffee-script/package.json b/node_modules/grunt/node_modules/coffee-script/package.json deleted file mode 100644 index 56f3097..0000000 --- a/node_modules/grunt/node_modules/coffee-script/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "coffee-script", - "description": "Unfancy JavaScript", - "keywords": [ - "javascript", - "language", - "coffeescript", - "compiler" - ], - "author": { - "name": "Jeremy Ashkenas" - }, - "version": "1.3.3", - "licenses": [ - { - "type": "MIT", - "url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE" - } - ], - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "lib": "./lib/coffee-script" - }, - "main": "./lib/coffee-script/coffee-script", - "bin": { - "coffee": "./bin/coffee", - "cake": "./bin/cake" - }, - "homepage": "http://coffeescript.org", - "bugs": { - "url": "https://github.com/jashkenas/coffee-script/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/jashkenas/coffee-script.git" - }, - "devDependencies": { - "uglify-js": ">=1.0.0", - "jison": ">=0.2.0" - }, - "readme": "\n {\n } } {\n { { } }\n } }{ {\n { }{ } } _____ __ __\n ( }{ }{ { ) / ____| / _|/ _|\n .- { { } { }} -. | | ___ | |_| |_ ___ ___\n ( ( } { } { } } ) | | / _ \\| _| _/ _ \\/ _ \\\n |`-..________ ..-'| | |___| (_) | | | || __/ __/\n | | \\_____\\___/|_| |_| \\___|\\___|\n | ;--.\n | (__ \\ _____ _ _\n | | ) ) / ____| (_) | |\n | |/ / | (___ ___ _ __ _ _ __ | |_\n | ( / \\___ \\ / __| '__| | '_ \\| __|\n | |/ ____) | (__| | | | |_) | |_\n | | |_____/ \\___|_| |_| .__/ \\__|\n `-.._________..-' | |\n |_|\n\n\n CoffeeScript is a little language that compiles into JavaScript.\n\n Install Node.js, and then the CoffeeScript compiler:\n sudo bin/cake install\n\n Or, if you have the Node Package Manager installed:\n npm install -g coffee-script\n (Leave off the -g if you don't wish to install globally.)\n\n Execute a script:\n coffee /path/to/script.coffee\n\n Compile a script:\n coffee -c /path/to/script.coffee\n\n For documentation, usage, and examples, see:\n http://coffeescript.org/\n\n To suggest a feature, report a bug, or general discussion:\n http://github.com/jashkenas/coffee-script/issues/\n\n If you'd like to chat, drop by #coffeescript on Freenode IRC,\n or on webchat.freenode.net.\n\n The source repository:\n git://github.com/jashkenas/coffee-script.git\n\n All contributors are listed here:\n http://github.com/jashkenas/coffee-script/contributors\n", - "readmeFilename": "README", - "_id": "coffee-script@1.3.3", - "_from": "coffee-script@~1.3.3" -} diff --git a/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt b/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt deleted file mode 100644 index 7dca107..0000000 --- a/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -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/grunt/node_modules/colors/ReadMe.md b/node_modules/grunt/node_modules/colors/ReadMe.md deleted file mode 100644 index 0eda52d..0000000 --- a/node_modules/grunt/node_modules/colors/ReadMe.md +++ /dev/null @@ -1,77 +0,0 @@ -# colors.js - get color and style in your node.js console ( and browser ) like what - - - - -## Installation - - npm install colors - -## colors and styles! - -- bold -- italic -- underline -- inverse -- yellow -- cyan -- white -- magenta -- green -- red -- grey -- blue -- rainbow -- zebra -- random - -## Usage - -``` js -var colors = require('./colors'); - -console.log('hello'.green); // outputs green text -console.log('i like cake and pies'.underline.red) // outputs red underlined text -console.log('inverse the color'.inverse); // inverses the color -console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) -``` - -# Creating Custom themes - -```js - -var colors = require('colors'); - -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); -``` - - -### Contributors - -Marak (Marak Squires) -Alexis Sellier (cloudhead) -mmalecki (Maciej Małecki) -nicoreed (Nico Reed) -morganrallen (Morgan Allen) -JustinCampbell (Justin Campbell) -ded (Dustin Diaz) - - -#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded) diff --git a/node_modules/grunt/node_modules/colors/colors.js b/node_modules/grunt/node_modules/colors/colors.js deleted file mode 100644 index 7a537d8..0000000 --- a/node_modules/grunt/node_modules/colors/colors.js +++ /dev/null @@ -1,342 +0,0 @@ -/* -colors.js - -Copyright (c) 2010 - -Marak Squires -Alexis Sellier (cloudhead) - -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. - -*/ - -var isHeadless = false; - -if (typeof module !== 'undefined') { - isHeadless = true; -} - -if (!isHeadless) { - var exports = {}; - var module = {}; - var colors = exports; - exports.mode = "browser"; -} else { - exports.mode = "console"; -} - -// -// Prototypes the string object to have additional method calls that add terminal colors -// -var addProperty = function (color, func) { - exports[color] = function (str) { - return func.apply(str); - }; - String.prototype.__defineGetter__(color, func); -}; - -function stylize(str, style) { - - var styles; - - if (exports.mode === 'console') { - styles = { - //styles - 'bold' : ['\x1B[1m', '\x1B[22m'], - 'italic' : ['\x1B[3m', '\x1B[23m'], - 'underline' : ['\x1B[4m', '\x1B[24m'], - 'inverse' : ['\x1B[7m', '\x1B[27m'], - 'strikethrough' : ['\x1B[9m', '\x1B[29m'], - //text colors - //grayscale - 'white' : ['\x1B[37m', '\x1B[39m'], - 'grey' : ['\x1B[90m', '\x1B[39m'], - 'black' : ['\x1B[30m', '\x1B[39m'], - //colors - 'blue' : ['\x1B[34m', '\x1B[39m'], - 'cyan' : ['\x1B[36m', '\x1B[39m'], - 'green' : ['\x1B[32m', '\x1B[39m'], - 'magenta' : ['\x1B[35m', '\x1B[39m'], - 'red' : ['\x1B[31m', '\x1B[39m'], - 'yellow' : ['\x1B[33m', '\x1B[39m'], - //background colors - //grayscale - 'whiteBG' : ['\x1B[47m', '\x1B[49m'], - 'greyBG' : ['\x1B[49;5;8m', '\x1B[49m'], - 'blackBG' : ['\x1B[40m', '\x1B[49m'], - //colors - 'blueBG' : ['\x1B[44m', '\x1B[49m'], - 'cyanBG' : ['\x1B[46m', '\x1B[49m'], - 'greenBG' : ['\x1B[42m', '\x1B[49m'], - 'magentaBG' : ['\x1B[45m', '\x1B[49m'], - 'redBG' : ['\x1B[41m', '\x1B[49m'], - 'yellowBG' : ['\x1B[43m', '\x1B[49m'] - }; - } else if (exports.mode === 'browser') { - styles = { - //styles - 'bold' : ['', ''], - 'italic' : ['', ''], - 'underline' : ['', ''], - 'inverse' : ['', ''], - 'strikethrough' : ['', ''], - //text colors - //grayscale - 'white' : ['', ''], - 'grey' : ['', ''], - 'black' : ['', ''], - //colors - 'blue' : ['', ''], - 'cyan' : ['', ''], - 'green' : ['', ''], - 'magenta' : ['', ''], - 'red' : ['', ''], - 'yellow' : ['', ''], - //background colors - //grayscale - 'whiteBG' : ['', ''], - 'greyBG' : ['', ''], - 'blackBG' : ['', ''], - //colors - 'blueBG' : ['', ''], - 'cyanBG' : ['', ''], - 'greenBG' : ['', ''], - 'magentaBG' : ['', ''], - 'redBG' : ['', ''], - 'yellowBG' : ['', ''] - }; - } else if (exports.mode === 'none') { - return str + ''; - } else { - console.log('unsupported mode, try "browser", "console" or "none"'); - } - return styles[style][0] + str + styles[style][1]; -} - -function applyTheme(theme) { - - // - // Remark: This is a list of methods that exist - // on String that you should not overwrite. - // - var stringPrototypeBlacklist = [ - '__defineGetter__', '__defineSetter__', '__lookupGetter__', '__lookupSetter__', 'charAt', 'constructor', - 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf', 'charCodeAt', - 'indexOf', 'lastIndexof', 'length', 'localeCompare', 'match', 'replace', 'search', 'slice', 'split', 'substring', - 'toLocaleLowerCase', 'toLocaleUpperCase', 'toLowerCase', 'toUpperCase', 'trim', 'trimLeft', 'trimRight' - ]; - - Object.keys(theme).forEach(function (prop) { - if (stringPrototypeBlacklist.indexOf(prop) !== -1) { - console.log('warn: '.red + ('String.prototype' + prop).magenta + ' is probably something you don\'t want to override. Ignoring style name'); - } - else { - if (typeof(theme[prop]) === 'string') { - addProperty(prop, function () { - return exports[theme[prop]](this); - }); - } - else { - addProperty(prop, function () { - var ret = this; - for (var t = 0; t < theme[prop].length; t++) { - ret = exports[theme[prop][t]](ret); - } - return ret; - }); - } - } - }); -} - - -// -// Iterate through all default styles and colors -// -var x = ['bold', 'underline', 'strikethrough', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta', 'greyBG', 'blackBG', 'yellowBG', 'redBG', 'greenBG', 'blueBG', 'whiteBG', 'cyanBG', 'magentaBG']; -x.forEach(function (style) { - - // __defineGetter__ at the least works in more browsers - // http://robertnyman.com/javascript/javascript-getters-setters.html - // Object.defineProperty only works in Chrome - addProperty(style, function () { - return stylize(this, style); - }); -}); - -function sequencer(map) { - return function () { - if (!isHeadless) { - return this.replace(/( )/, '$1'); - } - var exploded = this.split(""), i = 0; - exploded = exploded.map(map); - return exploded.join(""); - }; -} - -var rainbowMap = (function () { - var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta']; //RoY G BiV - return function (letter, i, exploded) { - if (letter === " ") { - return letter; - } else { - return stylize(letter, rainbowColors[i++ % rainbowColors.length]); - } - }; -})(); - -exports.themes = {}; - -exports.addSequencer = function (name, map) { - addProperty(name, sequencer(map)); -}; - -exports.addSequencer('rainbow', rainbowMap); -exports.addSequencer('zebra', function (letter, i, exploded) { - return i % 2 === 0 ? letter : letter.inverse; -}); - -exports.setTheme = function (theme) { - if (typeof theme === 'string') { - try { - exports.themes[theme] = require(theme); - applyTheme(exports.themes[theme]); - return exports.themes[theme]; - } catch (err) { - console.log(err); - return err; - } - } else { - applyTheme(theme); - } -}; - - -addProperty('stripColors', function () { - return ("" + this).replace(/\x1B\[\d+m/g, ''); -}); - -// please no -function zalgo(text, options) { - var soul = { - "up" : [ - '̍', '̎', '̄', '̅', - '̿', '̑', '̆', '̐', - '͒', '͗', '͑', '̇', - '̈', '̊', '͂', '̓', - '̈', '͊', '͋', '͌', - '̃', '̂', '̌', '͐', - '̀', '́', '̋', '̏', - '̒', '̓', '̔', '̽', - '̉', 'ͣ', 'ͤ', 'ͥ', - 'ͦ', 'ͧ', 'ͨ', 'ͩ', - 'ͪ', 'ͫ', 'ͬ', 'ͭ', - 'ͮ', 'ͯ', '̾', '͛', - '͆', '̚' - ], - "down" : [ - '̖', '̗', '̘', '̙', - '̜', '̝', '̞', '̟', - '̠', '̤', '̥', '̦', - '̩', '̪', '̫', '̬', - '̭', '̮', '̯', '̰', - '̱', '̲', '̳', '̹', - '̺', '̻', '̼', 'ͅ', - '͇', '͈', '͉', '͍', - '͎', '͓', '͔', '͕', - '͖', '͙', '͚', '̣' - ], - "mid" : [ - '̕', '̛', '̀', '́', - '͘', '̡', '̢', '̧', - '̨', '̴', '̵', '̶', - '͜', '͝', '͞', - '͟', '͠', '͢', '̸', - '̷', '͡', ' ҉' - ] - }, - all = [].concat(soul.up, soul.down, soul.mid), - zalgo = {}; - - function randomNumber(range) { - var r = Math.floor(Math.random() * range); - return r; - } - - function is_char(character) { - var bool = false; - all.filter(function (i) { - bool = (i === character); - }); - return bool; - } - - function heComes(text, options) { - var result = '', counts, l; - options = options || {}; - options["up"] = options["up"] || true; - options["mid"] = options["mid"] || true; - options["down"] = options["down"] || true; - options["size"] = options["size"] || "maxi"; - text = text.split(''); - for (l in text) { - if (is_char(l)) { - continue; - } - result = result + text[l]; - counts = {"up" : 0, "down" : 0, "mid" : 0}; - switch (options.size) { - case 'mini': - counts.up = randomNumber(8); - counts.min = randomNumber(2); - counts.down = randomNumber(8); - break; - case 'maxi': - counts.up = randomNumber(16) + 3; - counts.min = randomNumber(4) + 1; - counts.down = randomNumber(64) + 3; - break; - default: - counts.up = randomNumber(8) + 1; - counts.mid = randomNumber(6) / 2; - counts.down = randomNumber(8) + 1; - break; - } - - var arr = ["up", "mid", "down"]; - for (var d in arr) { - var index = arr[d]; - for (var i = 0 ; i <= counts[index]; i++) { - if (options[index]) { - result = result + soul[index][randomNumber(soul[index].length)]; - } - } - } - } - return result; - } - return heComes(text); -} - - -// don't summon zalgo -addProperty('zalgo', function () { - return zalgo(this); -}); diff --git a/node_modules/grunt/node_modules/colors/example.html b/node_modules/grunt/node_modules/colors/example.html deleted file mode 100644 index 7a2ae60..0000000 --- a/node_modules/grunt/node_modules/colors/example.html +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Colors Example - - - - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/colors/example.js b/node_modules/grunt/node_modules/colors/example.js deleted file mode 100644 index b1e03a4..0000000 --- a/node_modules/grunt/node_modules/colors/example.js +++ /dev/null @@ -1,77 +0,0 @@ -var colors = require('./colors'); - -//colors.mode = "browser"; - -var test = colors.red("hopefully colorless output"); -console.log('Rainbows are fun!'.rainbow); -console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported -//console.log('zalgo time!'.zalgo); -console.log(test.stripColors); -console.log("a".grey + " b".black); -console.log("Zebras are so fun!".zebra); -console.log('background color attack!'.black.whiteBG) - -// -// Remark: .strikethrough may not work with Mac OS Terminal App -// -console.log("This is " + "not".strikethrough + " fun."); -console.log(colors.rainbow('Rainbows are fun!')); -console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported -console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported -//console.log(colors.zalgo('zalgo time!')); -console.log(colors.stripColors(test)); -console.log(colors.grey("a") + colors.black(" b")); - -colors.addSequencer("america", function(letter, i, exploded) { - if(letter === " ") return letter; - switch(i%3) { - case 0: return letter.red; - case 1: return letter.white; - case 2: return letter.blue; - } -}); - -colors.addSequencer("random", (function() { - var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta']; - - return function(letter, i, exploded) { - return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]]; - }; -})()); - -console.log("AMERICA! F--K YEAH!".america); -console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random); - -// -// Custom themes -// - -// Load theme with JSON literal -colors.setTheme({ - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}); - -// outputs red text -console.log("this is an error".error); - -// outputs yellow text -console.log("this is a warning".warn); - -// outputs grey text -console.log("this is an input".input); - -// Load a theme from file -colors.setTheme('./themes/winston-dark.js'); - -console.log("this is an input".input); - diff --git a/node_modules/grunt/node_modules/colors/package.json b/node_modules/grunt/node_modules/colors/package.json deleted file mode 100644 index 54dfcbe..0000000 --- a/node_modules/grunt/node_modules/colors/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.6.2", - "author": { - "name": "Marak Squires" - }, - "homepage": "https://github.com/Marak/colors.js", - "bugs": { - "url": "https://github.com/Marak/colors.js/issues" - }, - "keywords": [ - "ansi", - "terminal", - "colors" - ], - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engines": { - "node": ">=0.1.90" - }, - "main": "colors", - "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar colors = require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.6.2", - "_from": "colors@~0.6.2" -} diff --git a/node_modules/grunt/node_modules/colors/test.js b/node_modules/grunt/node_modules/colors/test.js deleted file mode 100644 index c32417d..0000000 --- a/node_modules/grunt/node_modules/colors/test.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require('assert'), - colors = require('./colors'); - -var s = 'string'; - -function a(s, code) { - return '\x1B[' + code.toString() + 'm' + s + '\x1B[39m'; -} - -function aE(s, color, code) { - assert.equal(s[color], a(s, code)); - assert.equal(colors[color](s), a(s, code)); - assert.equal(s[color], colors[color](s)); - assert.equal(s[color].stripColors, s); - assert.equal(s[color].stripColors, colors.stripColors(s)); -} - -function h(s, color) { - return '' + s + ''; -} - -var stylesColors = ['white', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow']; -var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']); - -colors.mode = 'console'; -assert.equal(s.bold, '\x1B[1m' + s + '\x1B[22m'); -assert.equal(s.italic, '\x1B[3m' + s + '\x1B[23m'); -assert.equal(s.underline, '\x1B[4m' + s + '\x1B[24m'); -assert.equal(s.strikethrough, '\x1B[9m' + s + '\x1B[29m'); -assert.equal(s.inverse, '\x1B[7m' + s + '\x1B[27m'); -assert.ok(s.rainbow); -aE(s, 'white', 37); -aE(s, 'grey', 90); -aE(s, 'black', 30); -aE(s, 'blue', 34); -aE(s, 'cyan', 36); -aE(s, 'green', 32); -aE(s, 'magenta', 35); -aE(s, 'red', 31); -aE(s, 'yellow', 33); -assert.equal(s, 'string'); - -colors.setTheme({error:'red'}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'browser'; -assert.equal(s.bold, '' + s + ''); -assert.equal(s.italic, '' + s + ''); -assert.equal(s.underline, '' + s + ''); -assert.equal(s.strikethrough, '' + s + ''); -assert.equal(s.inverse, '' + s + ''); -assert.ok(s.rainbow); -stylesColors.forEach(function (color) { - assert.equal(s[color], h(s, color)); - assert.equal(colors[color](s), h(s, color)); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); - -colors.mode = 'none'; -stylesAll.forEach(function (style) { - assert.equal(s[style], s); - assert.equal(colors[style](s), s); -}); - -assert.equal(typeof("astring".red),'string'); -assert.equal(typeof("astring".error),'string'); diff --git a/node_modules/grunt/node_modules/colors/themes/winston-dark.js b/node_modules/grunt/node_modules/colors/themes/winston-dark.js deleted file mode 100644 index 49a905b..0000000 --- a/node_modules/grunt/node_modules/colors/themes/winston-dark.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'black', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/colors/themes/winston-light.js b/node_modules/grunt/node_modules/colors/themes/winston-light.js deleted file mode 100644 index 571972c..0000000 --- a/node_modules/grunt/node_modules/colors/themes/winston-light.js +++ /dev/null @@ -1,12 +0,0 @@ -module['exports'] = { - silly: 'rainbow', - input: 'grey', - verbose: 'cyan', - prompt: 'grey', - info: 'green', - data: 'grey', - help: 'cyan', - warn: 'yellow', - debug: 'blue', - error: 'red' -}; \ No newline at end of file diff --git a/node_modules/grunt/node_modules/dateformat/Readme.md b/node_modules/grunt/node_modules/dateformat/Readme.md deleted file mode 100644 index d469e6d..0000000 --- a/node_modules/grunt/node_modules/dateformat/Readme.md +++ /dev/null @@ -1,67 +0,0 @@ -# node-dateformat - -A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function. - -## Modifications - -* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers. -* Added a `module.exports = dateFormat;` statement at the bottom - -## Usage - -As taken from Steven's post, modified to match the Modifications listed above: - - var dateFormat = require('dateformat'); - var now = new Date(); - - // Basic usage - dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT"); - // Saturday, June 9th, 2007, 5:46:21 PM - - // You can use one of several named masks - dateFormat(now, "isoDateTime"); - // 2007-06-09T17:46:21 - - // ...Or add your own - dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"'; - dateFormat(now, "hammerTime"); - // 17:46! Can't touch this! - - // When using the standalone dateFormat function, - // you can also provide the date as a string - dateFormat("Jun 9 2007", "fullDate"); - // Saturday, June 9, 2007 - - // Note that if you don't include the mask argument, - // dateFormat.masks.default is used - dateFormat(now); - // Sat Jun 09 2007 17:46:21 - - // And if you don't include the date argument, - // the current date and time is used - dateFormat(); - // Sat Jun 09 2007 17:46:22 - - // You can also skip the date argument (as long as your mask doesn't - // contain any numbers), in which case the current date/time is used - dateFormat("longTime"); - // 5:46:22 PM EST - - // And finally, you can convert local time to UTC time. Simply pass in - // true as an additional argument (no argument skipping allowed in this case): - dateFormat(now, "longTime", true); - // 10:46:21 PM UTC - - // ...Or add the prefix "UTC:" to your mask. - dateFormat(now, "UTC:h:MM:ss TT Z"); - // 10:46:21 PM UTC - - // You can also get the ISO 8601 week of the year: - dateFormat(now, "W"); - // 42 -## License - -(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license. - -[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format -[stevenlevithan]: http://stevenlevithan.com/ diff --git a/node_modules/grunt/node_modules/dateformat/lib/dateformat.js b/node_modules/grunt/node_modules/dateformat/lib/dateformat.js deleted file mode 100644 index 9229424..0000000 --- a/node_modules/grunt/node_modules/dateformat/lib/dateformat.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Date Format 1.2.3 - * (c) 2007-2009 Steven Levithan - * MIT license - * - * Includes enhancements by Scott Trenda - * and Kris Kowal - * - * Accepts a date, a mask, or a date and a mask. - * Returns a formatted version of the given date. - * The date defaults to the current date/time. - * The mask defaults to dateFormat.masks.default. - */ - -var dateFormat = function () { - var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZW]|"[^"]*"|'[^']*'/g, - timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, - timezoneClip = /[^-+\dA-Z]/g, - pad = function (val, len) { - val = String(val); - len = len || 2; - while (val.length < len) val = "0" + val; - return val; - }, - /** - * Get the ISO 8601 week number - * Based on comments from - * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html - */ - getWeek = function (date) { - // Remove time components of date - var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate()); - - // Change date to Thursday same week - targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3); - - // Take January 4th as it is always in week 1 (see ISO 8601) - var firstThursday = new Date(targetThursday.getFullYear(), 0, 4); - - // Change date to Thursday same week - firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3); - - // Check if daylight-saving-time-switch occured and correct for it - var ds = targetThursday.getTimezoneOffset()/firstThursday.getTimezoneOffset()-1; - targetThursday.setHours(targetThursday.getHours()+ds); - - // Number of weeks between target Thursday and first Thursday - var weekDiff = (targetThursday - firstThursday) / (86400000*7); - return 1 + weekDiff; - }; - - // Regexes and supporting functions are cached through closure - return function (date, mask, utc) { - var dF = dateFormat; - - // You can't provide utc if you skip other args (use the "UTC:" mask prefix) - if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { - mask = date; - date = undefined; - } - - date = date || new Date; - - if(!(date instanceof Date)) { - date = new Date(date); - } - - if (isNaN(date)) { - throw TypeError("Invalid date"); - } - - mask = String(dF.masks[mask] || mask || dF.masks["default"]); - - // Allow setting the utc argument via the mask - if (mask.slice(0, 4) == "UTC:") { - mask = mask.slice(4); - utc = true; - } - - var _ = utc ? "getUTC" : "get", - d = date[_ + "Date"](), - D = date[_ + "Day"](), - m = date[_ + "Month"](), - y = date[_ + "FullYear"](), - H = date[_ + "Hours"](), - M = date[_ + "Minutes"](), - s = date[_ + "Seconds"](), - L = date[_ + "Milliseconds"](), - o = utc ? 0 : date.getTimezoneOffset(), - W = getWeek(date), - flags = { - d: d, - dd: pad(d), - ddd: dF.i18n.dayNames[D], - dddd: dF.i18n.dayNames[D + 7], - m: m + 1, - mm: pad(m + 1), - mmm: dF.i18n.monthNames[m], - mmmm: dF.i18n.monthNames[m + 12], - yy: String(y).slice(2), - yyyy: y, - h: H % 12 || 12, - hh: pad(H % 12 || 12), - H: H, - HH: pad(H), - M: M, - MM: pad(M), - s: s, - ss: pad(s), - l: pad(L, 3), - L: pad(L > 99 ? Math.round(L / 10) : L), - t: H < 12 ? "a" : "p", - tt: H < 12 ? "am" : "pm", - T: H < 12 ? "A" : "P", - TT: H < 12 ? "AM" : "PM", - Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), - o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), - S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10], - W: W - }; - - return mask.replace(token, function ($0) { - return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); - }); - }; -}(); - -// Some common format strings -dateFormat.masks = { - "default": "ddd mmm dd yyyy HH:MM:ss", - shortDate: "m/d/yy", - mediumDate: "mmm d, yyyy", - longDate: "mmmm d, yyyy", - fullDate: "dddd, mmmm d, yyyy", - shortTime: "h:MM TT", - mediumTime: "h:MM:ss TT", - longTime: "h:MM:ss TT Z", - isoDate: "yyyy-mm-dd", - isoTime: "HH:MM:ss", - isoDateTime: "yyyy-mm-dd'T'HH:MM:ss", - isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'" -}; - -// Internationalization strings -dateFormat.i18n = { - dayNames: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", - "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" - ], - monthNames: [ - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ] -}; - -/* -// For convenience... -Date.prototype.format = function (mask, utc) { - return dateFormat(this, mask, utc); -}; -*/ - -if (typeof exports !== "undefined") { - module.exports = dateFormat; -} diff --git a/node_modules/grunt/node_modules/dateformat/package.json b/node_modules/grunt/node_modules/dateformat/package.json deleted file mode 100644 index cd4b896..0000000 --- a/node_modules/grunt/node_modules/dateformat/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "dateformat", - "description": "A node.js package for Steven Levithan's excellent dateFormat() function.", - "maintainers": "Felix Geisendörfer ", - "homepage": "https://github.com/felixge/node-dateformat", - "author": { - "name": "Steven Levithan" - }, - "version": "1.0.2-1.2.3", - "main": "./lib/dateformat", - "dependencies": {}, - "devDependencies": {}, - "engines": { - "node": "*" - }, - "readme": "# node-dateformat\n\nA node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.\n\n## Modifications\n\n* Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.\n* Added a `module.exports = dateFormat;` statement at the bottom\n\n## Usage\n\nAs taken from Steven's post, modified to match the Modifications listed above:\n\n var dateFormat = require('dateformat');\n var now = new Date();\n\n // Basic usage\n dateFormat(now, \"dddd, mmmm dS, yyyy, h:MM:ss TT\");\n // Saturday, June 9th, 2007, 5:46:21 PM\n\n // You can use one of several named masks\n dateFormat(now, \"isoDateTime\");\n // 2007-06-09T17:46:21\n\n // ...Or add your own\n dateFormat.masks.hammerTime = 'HH:MM! \"Can\\'t touch this!\"';\n dateFormat(now, \"hammerTime\");\n // 17:46! Can't touch this!\n\n // When using the standalone dateFormat function,\n // you can also provide the date as a string\n dateFormat(\"Jun 9 2007\", \"fullDate\");\n // Saturday, June 9, 2007\n\n // Note that if you don't include the mask argument,\n // dateFormat.masks.default is used\n dateFormat(now);\n // Sat Jun 09 2007 17:46:21\n\n // And if you don't include the date argument,\n // the current date and time is used\n dateFormat();\n // Sat Jun 09 2007 17:46:22\n\n // You can also skip the date argument (as long as your mask doesn't\n // contain any numbers), in which case the current date/time is used\n dateFormat(\"longTime\");\n // 5:46:22 PM EST\n\n // And finally, you can convert local time to UTC time. Simply pass in\n // true as an additional argument (no argument skipping allowed in this case):\n dateFormat(now, \"longTime\", true);\n // 10:46:21 PM UTC\n\n // ...Or add the prefix \"UTC:\" to your mask.\n dateFormat(now, \"UTC:h:MM:ss TT Z\");\n // 10:46:21 PM UTC\n\n // You can also get the ISO 8601 week of the year:\n dateFormat(now, \"W\");\n // 42\n## License\n\n(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.\n\n[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format\n[stevenlevithan]: http://stevenlevithan.com/\n", - "readmeFilename": "Readme.md", - "_id": "dateformat@1.0.2-1.2.3", - "_from": "dateformat@1.0.2-1.2.3" -} diff --git a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js b/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js deleted file mode 100644 index d1ddbe8..0000000 --- a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js +++ /dev/null @@ -1,4 +0,0 @@ -var dateFormat = require('../lib/dateformat.js'); - -var val = process.argv[2] || new Date(); -console.log(dateFormat(val, 'W')); diff --git a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh b/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh deleted file mode 100644 index 3c3e69b..0000000 --- a/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# this just takes php's date() function as a reference to check if week of year -# is calculated correctly in the range from 1970 .. 2038 by brute force... - -SEQ="seq" -SYSTEM=`uname` -if [ "$SYSTEM" = "Darwin" ]; then - SEQ="jot" -fi - -for YEAR in {1970..2038}; do - for MONTH in {1..12}; do - DAYS=$(cal $MONTH $YEAR | egrep "28|29|30|31" |tail -1 |awk '{print $NF}') - for DAY in $( $SEQ $DAYS ); do - DATE=$YEAR-$MONTH-$DAY - echo -n $DATE ... - NODEVAL=$(node test_weekofyear.js $DATE) - PHPVAL=$(php -r "echo intval(date('W', strtotime('$DATE')));") - if [ "$NODEVAL" -ne "$PHPVAL" ]; then - echo "MISMATCH: node: $NODEVAL vs php: $PHPVAL for date $DATE" - else - echo " OK" - fi - done - done -done diff --git a/node_modules/grunt/node_modules/eventemitter2/README.md b/node_modules/grunt/node_modules/eventemitter2/README.md deleted file mode 100644 index 9501fa3..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/README.md +++ /dev/null @@ -1,212 +0,0 @@ -# EventEmitter2 - -EventEmitter2 is an implementation of the EventEmitter found in Node.js - -## Features - - - Namespaces/Wildcards. - - Times To Listen (TTL), extends the `once` concept with `many`. - - Browser environment compatibility. - - Demonstrates good performance in benchmarks - -``` -EventEmitterHeatUp x 3,728,965 ops/sec \302\2610.68% (60 runs sampled) -EventEmitter x 2,822,904 ops/sec \302\2610.74% (63 runs sampled) -EventEmitter2 x 7,251,227 ops/sec \302\2610.55% (58 runs sampled) -EventEmitter2 (wild) x 3,220,268 ops/sec \302\2610.44% (65 runs sampled) -Fastest is EventEmitter2 -``` - -## Differences (Non breaking, compatible with existing EventEmitter) - - - The constructor takes a configuration object. - -```javascript - var EventEmitter2 = require('eventemitter2').EventEmitter2; - var server = new EventEmitter2({ - wildcard: true, // should the event emitter use wildcards. - delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`. - newListener: false, // if you want to emit the newListener event set to true. - maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10. - }); -``` - - - Getting the actual event that fired. - -```javascript - server.on('foo.*', function(value1, value2) { - console.log(this.event, value1, value2); - }); -``` - - - Fire an event N times and then remove it, an extension of the `once` concept. - -```javascript - server.many('foo', 4, function() { - console.log('hello'); - }); -``` - - - Pass in a namespaced event as an array rather than a delimited string. - -```javascript - server.many(['foo', 'bar', 'bazz'], function() { - console.log('hello'); - }); -``` - - -## API - -When an `EventEmitter` instance experiences an error, the typical action is -to emit an `error` event. Error events are treated as a special case. -If there is no listener for it, then the default action is to print a stack -trace and exit the program. - -All EventEmitters emit the event `newListener` when new listeners are -added. - - -**Namespaces** with **Wildcards** -To use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor. -When namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated -by a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a -constructor option. - -An event name passed to any event emitter method can contain a wild card (the `*` character). -If the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, -the wildcard may appear as `['foo', '*']`. - -If either of the above described events were passed to the `on` method, subsequent emits such -as the following would be observed... - -```javascript - emitter.emit('foo.bazz'); - emitter.emit(['foo', 'bar']); -``` - - -#### emitter.addListener(event, listener) -#### emitter.on(event, listener) - -Adds a listener to the end of the listeners array for the specified event. - -```javascript - server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) { - console.log('The event was raised!'); - }); -``` - -```javascript - server.on('data', function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.onAny(listener) - -Adds a listener that will be fired when any event is emitted. - -```javascript - server.onAny(function(value) { - console.log('All events trigger this.'); - }); -``` - -#### emitter.offAny(listener) - -Removes the listener that will be fired when any event is emitted. - -```javascript - server.offAny(function(value) { - console.log('The event was raised!'); - }); -``` - -#### emitter.once(event, listener) - -Adds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.once('get', function (value) { - console.log('Ah, we have our first value!'); - }); -``` - -#### emitter.many(event, timesToListen, listener) - -Adds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed. - -```javascript - server.many('get', 4, function (value) { - console.log('This event will be listened to exactly four times.'); - }); -``` - - -#### emitter.removeListener(event, listener) -#### emitter.off(event, listener) - -Remove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener. - -```javascript - var callback = function(value) { - console.log('someone connected!'); - }; - server.on('get', callback); - // ... - server.removeListener('get', callback); -``` - - -#### emitter.removeAllListeners([event]) - -Removes all listeners, or those of the specified event. - - -#### emitter.setMaxListeners(n) - -By default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. - - -#### emitter.listeners(event) - -Returns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.on('get', function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listeners('get')); // [ [Function] ] -``` - -#### emitter.listenersAny() - -Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners. - -```javascript - server.onAny(function(value) { - console.log('someone connected!'); - }); - console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected! -``` - -#### emitter.emit(event, [arg1], [arg2], [...]) - -Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. - -## Test coverage - -There is a test suite that tries to cover each use case, it can be found here. - -## Licence - -(The MIT License) - -Copyright (c) 2011 hij1nx - -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/grunt/node_modules/eventemitter2/index.js b/node_modules/grunt/node_modules/eventemitter2/index.js deleted file mode 100644 index 6f583b5..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/eventemitter2'); diff --git a/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js b/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js deleted file mode 100644 index dc9849e..0000000 --- a/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js +++ /dev/null @@ -1,561 +0,0 @@ -;!function(exports, undefined) { - - var isArray = Array.isArray ? Array.isArray : function _isArray(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - var defaultMaxListeners = 10; - - function init() { - this._events = {}; - if (this._conf) { - configure.call(this, this._conf); - } - } - - function configure(conf) { - if (conf) { - - this._conf = conf; - - conf.delimiter && (this.delimiter = conf.delimiter); - conf.maxListeners && (this._events.maxListeners = conf.maxListeners); - conf.wildcard && (this.wildcard = conf.wildcard); - conf.newListener && (this.newListener = conf.newListener); - - if (this.wildcard) { - this.listenerTree = {}; - } - } - } - - function EventEmitter(conf) { - this._events = {}; - this.newListener = false; - configure.call(this, conf); - } - - // - // Attention, function return type now is array, always ! - // It has zero elements if no any matches found and one or more - // elements (leafs) if there are matches - // - function searchListenerTree(handlers, type, tree, i) { - if (!tree) { - return []; - } - var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached, - typeLength = type.length, currentType = type[i], nextType = type[i+1]; - if (i === typeLength && tree._listeners) { - // - // If at the end of the event(s) list and the tree has listeners - // invoke those listeners. - // - if (typeof tree._listeners === 'function') { - handlers && handlers.push(tree._listeners); - return [tree]; - } else { - for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) { - handlers && handlers.push(tree._listeners[leaf]); - } - return [tree]; - } - } - - if ((currentType === '*' || currentType === '**') || tree[currentType]) { - // - // If the event emitted is '*' at this part - // or there is a concrete match at this patch - // - if (currentType === '*') { - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1)); - } - } - return listeners; - } else if(currentType === '**') { - endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*')); - if(endReached && tree._listeners) { - // The next element has a _listeners, add it to the handlers. - listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength)); - } - - for (branch in tree) { - if (branch !== '_listeners' && tree.hasOwnProperty(branch)) { - if(branch === '*' || branch === '**') { - if(tree[branch]._listeners && !endReached) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength)); - } - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } else if(branch === nextType) { - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2)); - } else { - // No match on this one, shift into the tree but not in the type array. - listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i)); - } - } - } - return listeners; - } - - listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1)); - } - - xTree = tree['*']; - if (xTree) { - // - // If the listener tree will allow any match for this part, - // then recursively explore all branches of the tree - // - searchListenerTree(handlers, type, xTree, i+1); - } - - xxTree = tree['**']; - if(xxTree) { - if(i < typeLength) { - if(xxTree._listeners) { - // If we have a listener on a '**', it will catch all, so add its handler. - searchListenerTree(handlers, type, xxTree, typeLength); - } - - // Build arrays of matching next branches and others. - for(branch in xxTree) { - if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) { - if(branch === nextType) { - // We know the next element will match, so jump twice. - searchListenerTree(handlers, type, xxTree[branch], i+2); - } else if(branch === currentType) { - // Current node matches, move into the tree. - searchListenerTree(handlers, type, xxTree[branch], i+1); - } else { - isolatedBranch = {}; - isolatedBranch[branch] = xxTree[branch]; - searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1); - } - } - } - } else if(xxTree._listeners) { - // We have reached the end and still on a '**' - searchListenerTree(handlers, type, xxTree, typeLength); - } else if(xxTree['*'] && xxTree['*']._listeners) { - searchListenerTree(handlers, type, xxTree['*'], typeLength); - } - } - - return listeners; - } - - function growListenerTree(type, listener) { - - type = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - - // - // Looks for two consecutive '**', if so, don't add the event at all. - // - for(var i = 0, len = type.length; i+1 < len; i++) { - if(type[i] === '**' && type[i+1] === '**') { - return; - } - } - - var tree = this.listenerTree; - var name = type.shift(); - - while (name) { - - if (!tree[name]) { - tree[name] = {}; - } - - tree = tree[name]; - - if (type.length === 0) { - - if (!tree._listeners) { - tree._listeners = listener; - } - else if(typeof tree._listeners === 'function') { - tree._listeners = [tree._listeners, listener]; - } - else if (isArray(tree._listeners)) { - - tree._listeners.push(listener); - - if (!tree._listeners.warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && tree._listeners.length > m) { - - tree._listeners.warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - tree._listeners.length); - console.trace(); - } - } - } - return true; - } - name = type.shift(); - } - return true; - } - - // By default EventEmitters will print a warning if more than - // 10 listeners are added to it. This is a useful default which - // helps finding memory leaks. - // - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - - EventEmitter.prototype.delimiter = '.'; - - EventEmitter.prototype.setMaxListeners = function(n) { - this._events || init.call(this); - this._events.maxListeners = n; - if (!this._conf) this._conf = {}; - this._conf.maxListeners = n; - }; - - EventEmitter.prototype.event = ''; - - EventEmitter.prototype.once = function(event, fn) { - this.many(event, 1, fn); - return this; - }; - - EventEmitter.prototype.many = function(event, ttl, fn) { - var self = this; - - if (typeof fn !== 'function') { - throw new Error('many only accepts instances of Function'); - } - - function listener() { - if (--ttl === 0) { - self.off(event, listener); - } - fn.apply(this, arguments); - } - - listener._origin = fn; - - this.on(event, listener); - - return self; - }; - - EventEmitter.prototype.emit = function() { - - this._events || init.call(this); - - var type = arguments[0]; - - if (type === 'newListener' && !this.newListener) { - if (!this._events.newListener) { return false; } - } - - // Loop through the *_all* functions and invoke them. - if (this._all) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - for (i = 0, l = this._all.length; i < l; i++) { - this.event = type; - this._all[i].apply(this, args); - } - } - - // If there is no 'error' event listener then throw. - if (type === 'error') { - - if (!this._all && - !this._events.error && - !(this.wildcard && this.listenerTree.error)) { - - if (arguments[1] instanceof Error) { - throw arguments[1]; // Unhandled 'error' event - } else { - throw new Error("Uncaught, unspecified 'error' event."); - } - return false; - } - } - - var handler; - - if(this.wildcard) { - handler = []; - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - searchListenerTree.call(this, handler, ns, this.listenerTree, 0); - } - else { - handler = this._events[type]; - } - - if (typeof handler === 'function') { - this.event = type; - if (arguments.length === 1) { - handler.call(this); - } - else if (arguments.length > 1) - switch (arguments.length) { - case 2: - handler.call(this, arguments[1]); - break; - case 3: - handler.call(this, arguments[1], arguments[2]); - break; - // slower - default: - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - handler.apply(this, args); - } - return true; - } - else if (handler) { - var l = arguments.length; - var args = new Array(l - 1); - for (var i = 1; i < l; i++) args[i - 1] = arguments[i]; - - var listeners = handler.slice(); - for (var i = 0, l = listeners.length; i < l; i++) { - this.event = type; - listeners[i].apply(this, args); - } - return (listeners.length > 0) || this._all; - } - else { - return this._all; - } - - }; - - EventEmitter.prototype.on = function(type, listener) { - - if (typeof type === 'function') { - this.onAny(type); - return this; - } - - if (typeof listener !== 'function') { - throw new Error('on only accepts instances of Function'); - } - this._events || init.call(this); - - // To avoid recursion in the case that type == "newListeners"! Before - // adding it to the listeners, first emit "newListeners". - this.emit('newListener', type, listener); - - if(this.wildcard) { - growListenerTree.call(this, type, listener); - return this; - } - - if (!this._events[type]) { - // Optimize the case of one listener. Don't need the extra array object. - this._events[type] = listener; - } - else if(typeof this._events[type] === 'function') { - // Adding the second element, need to change to array. - this._events[type] = [this._events[type], listener]; - } - else if (isArray(this._events[type])) { - // If we've already got an array, just append. - this._events[type].push(listener); - - // Check for listener leak - if (!this._events[type].warned) { - - var m = defaultMaxListeners; - - if (typeof this._events.maxListeners !== 'undefined') { - m = this._events.maxListeners; - } - - if (m > 0 && this._events[type].length > m) { - - this._events[type].warned = true; - console.error('(node) warning: possible EventEmitter memory ' + - 'leak detected. %d listeners added. ' + - 'Use emitter.setMaxListeners() to increase limit.', - this._events[type].length); - console.trace(); - } - } - } - return this; - }; - - EventEmitter.prototype.onAny = function(fn) { - - if(!this._all) { - this._all = []; - } - - if (typeof fn !== 'function') { - throw new Error('onAny only accepts instances of Function'); - } - - // Add the function to the event listener collection. - this._all.push(fn); - return this; - }; - - EventEmitter.prototype.addListener = EventEmitter.prototype.on; - - EventEmitter.prototype.off = function(type, listener) { - if (typeof listener !== 'function') { - throw new Error('removeListener only takes instances of Function'); - } - - var handlers,leafs=[]; - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - } - else { - // does not use listeners(), so no side effect of creating _events[type] - if (!this._events[type]) return this; - handlers = this._events[type]; - leafs.push({_listeners:handlers}); - } - - for (var iLeaf=0; iLeaf 0) { - fns = this._all; - for(i = 0, l = fns.length; i < l; i++) { - if(fn === fns[i]) { - fns.splice(i, 1); - return this; - } - } - } else { - this._all = []; - } - return this; - }; - - EventEmitter.prototype.removeListener = EventEmitter.prototype.off; - - EventEmitter.prototype.removeAllListeners = function(type) { - if (arguments.length === 0) { - !this._events || init.call(this); - return this; - } - - if(this.wildcard) { - var ns = typeof type === 'string' ? type.split(this.delimiter) : type.slice(); - var leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0); - - for (var iLeaf=0; iLeaf= 0.2.2" - }, - "main": "./lib/eventemitter2.js", - "scripts": { - "test": "nodeunit test/simple/ && nodeunit test/wildcardEvents/", - "benchmark": "node test/perf/benchmark.js" - }, - "files": [ - "lib/eventemitter2.js", - "index.js" - ], - "readme": "# EventEmitter2\n\nEventEmitter2 is an implementation of the EventEmitter found in Node.js\n\n## Features\n\n - Namespaces/Wildcards.\n - Times To Listen (TTL), extends the `once` concept with `many`.\n - Browser environment compatibility.\n - Demonstrates good performance in benchmarks\n\n```\nEventEmitterHeatUp x 3,728,965 ops/sec \\302\\2610.68% (60 runs sampled)\nEventEmitter x 2,822,904 ops/sec \\302\\2610.74% (63 runs sampled)\nEventEmitter2 x 7,251,227 ops/sec \\302\\2610.55% (58 runs sampled)\nEventEmitter2 (wild) x 3,220,268 ops/sec \\302\\2610.44% (65 runs sampled)\nFastest is EventEmitter2\n```\n\n## Differences (Non breaking, compatible with existing EventEmitter)\n\n - The constructor takes a configuration object.\n \n```javascript\n var EventEmitter2 = require('eventemitter2').EventEmitter2;\n var server = new EventEmitter2({\n wildcard: true, // should the event emitter use wildcards.\n delimiter: '::', // the delimiter used to segment namespaces, defaults to `.`.\n newListener: false, // if you want to emit the newListener event set to true.\n maxListeners: 20, // the max number of listeners that can be assigned to an event, defaults to 10.\n });\n```\n\n - Getting the actual event that fired.\n\n```javascript\n server.on('foo.*', function(value1, value2) {\n console.log(this.event, value1, value2);\n });\n```\n\n - Fire an event N times and then remove it, an extension of the `once` concept.\n\n```javascript\n server.many('foo', 4, function() {\n console.log('hello');\n });\n```\n\n - Pass in a namespaced event as an array rather than a delimited string.\n\n```javascript\n server.many(['foo', 'bar', 'bazz'], function() {\n console.log('hello');\n });\n```\n\n\n## API\n\nWhen an `EventEmitter` instance experiences an error, the typical action is\nto emit an `error` event. Error events are treated as a special case.\nIf there is no listener for it, then the default action is to print a stack\ntrace and exit the program.\n\nAll EventEmitters emit the event `newListener` when new listeners are\nadded.\n\n\n**Namespaces** with **Wildcards**\nTo use namespaces/wildcards, pass the `wildcard` option into the EventEmitter constructor.\nWhen namespaces/wildcards are enabled, events can either be strings (`foo.bar`) separated\nby a delimiter or arrays (`['foo', 'bar']`). The delimiter is also configurable as a \nconstructor option.\n\nAn event name passed to any event emitter method can contain a wild card (the `*` character).\nIf the event name is a string, a wildcard may appear as `foo.*`. If the event name is an array, \nthe wildcard may appear as `['foo', '*']`.\n\nIf either of the above described events were passed to the `on` method, subsequent emits such \nas the following would be observed...\n\n```javascript\n emitter.emit('foo.bazz');\n emitter.emit(['foo', 'bar']);\n```\n\n\n#### emitter.addListener(event, listener)\n#### emitter.on(event, listener)\n\nAdds a listener to the end of the listeners array for the specified event.\n\n```javascript\n server.on('data', function(value1, value2, value3 /* accepts any number of expected values... */) {\n console.log('The event was raised!');\n });\n```\n\n```javascript\n server.on('data', function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.onAny(listener)\n\nAdds a listener that will be fired when any event is emitted.\n\n```javascript\n server.onAny(function(value) {\n console.log('All events trigger this.');\n });\n```\n\n#### emitter.offAny(listener)\n\nRemoves the listener that will be fired when any event is emitted.\n\n```javascript\n server.offAny(function(value) {\n console.log('The event was raised!');\n });\n```\n\n#### emitter.once(event, listener)\n\nAdds a **one time** listener for the event. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.once('get', function (value) {\n console.log('Ah, we have our first value!');\n });\n```\n\n#### emitter.many(event, timesToListen, listener)\n\nAdds a listener that will execute **n times** for the event before being removed. The listener is invoked only the first time the event is fired, after which it is removed.\n\n```javascript\n server.many('get', 4, function (value) {\n console.log('This event will be listened to exactly four times.');\n });\n```\n\n\n#### emitter.removeListener(event, listener)\n#### emitter.off(event, listener)\n\nRemove a listener from the listener array for the specified event. **Caution**: changes array indices in the listener array behind the listener.\n\n```javascript\n var callback = function(value) {\n console.log('someone connected!');\n };\n server.on('get', callback);\n // ...\n server.removeListener('get', callback);\n```\n\n\n#### emitter.removeAllListeners([event])\n\nRemoves all listeners, or those of the specified event.\n\n\n#### emitter.setMaxListeners(n)\n\nBy default EventEmitters will print a warning if more than 10 listeners are added to it. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited.\n\n\n#### emitter.listeners(event)\n\nReturns an array of listeners for the specified event. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.on('get', function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listeners('get')); // [ [Function] ]\n```\n\n#### emitter.listenersAny()\n\nReturns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.\n\n```javascript\n server.onAny(function(value) {\n console.log('someone connected!');\n });\n console.log(console.log(server.listenersAny()[0]); // [ [Function] ] // someone connected!\n```\n\n#### emitter.emit(event, [arg1], [arg2], [...])\n\nExecute each of the listeners that may be listening for the specified event name in order with the list of arguments.\n\n## Test coverage\n\nThere is a test suite that tries to cover each use case, it can be found here.\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 hij1nx \n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hij1nx/EventEmitter2/issues" - }, - "_id": "eventemitter2@0.4.13", - "_from": "eventemitter2@~0.4.13" -} diff --git a/node_modules/grunt/node_modules/exit/.jshintrc b/node_modules/grunt/node_modules/exit/.jshintrc deleted file mode 100644 index 2b7e39b..0000000 --- a/node_modules/grunt/node_modules/exit/.jshintrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": "nofunc", - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "unused": true, - "boss": true, - "eqnull": true, - "node": true -} diff --git a/node_modules/grunt/node_modules/exit/.npmignore b/node_modules/grunt/node_modules/exit/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/exit/.travis.yml b/node_modules/grunt/node_modules/exit/.travis.yml deleted file mode 100644 index 42d4302..0000000 --- a/node_modules/grunt/node_modules/exit/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - 0.8 - - '0.10' -before_script: - - npm install -g grunt-cli diff --git a/node_modules/grunt/node_modules/exit/Gruntfile.js b/node_modules/grunt/node_modules/exit/Gruntfile.js deleted file mode 100644 index ff37751..0000000 --- a/node_modules/grunt/node_modules/exit/Gruntfile.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - nodeunit: { - files: ['test/**/*_test.js'], - }, - jshint: { - options: { - jshintrc: '.jshintrc' - }, - gruntfile: { - src: 'Gruntfile.js' - }, - lib: { - src: ['lib/**/*.js'] - }, - test: { - src: ['test/**/*.js'] - }, - }, - watch: { - gruntfile: { - files: '<%= jshint.gruntfile.src %>', - tasks: ['jshint:gruntfile'] - }, - lib: { - files: '<%= jshint.lib.src %>', - tasks: ['jshint:lib', 'nodeunit'] - }, - test: { - files: '<%= jshint.test.src %>', - tasks: ['jshint:test', 'nodeunit'] - }, - }, - }); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - // Default task. - grunt.registerTask('default', ['jshint', 'nodeunit']); - -}; diff --git a/node_modules/grunt/node_modules/exit/LICENSE-MIT b/node_modules/grunt/node_modules/exit/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/grunt/node_modules/exit/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -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/grunt/node_modules/exit/README.md b/node_modules/grunt/node_modules/exit/README.md deleted file mode 100644 index 20c364e..0000000 --- a/node_modules/grunt/node_modules/exit/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# exit [![Build Status](https://secure.travis-ci.org/cowboy/node-exit.png?branch=master)](http://travis-ci.org/cowboy/node-exit) - -A replacement for process.exit that ensures stdio are fully drained before exiting. - -To make a long story short, if `process.exit` is called on Windows, script output is often truncated when pipe-redirecting `stdout` or `stderr`. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling `process.exit`. - -See [Node.js issue #3584](https://github.com/joyent/node/issues/3584) for further reference. - -Tested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18. - -Based on some code by [@vladikoff](https://github.com/vladikoff). - -## Getting Started -Install the module with: `npm install exit` - -```javascript -var exit = require('exit'); - -// These lines should appear in the output, EVEN ON WINDOWS. -console.log("omg"); -console.error("yay"); - -// process.exit(5); -exit(5); - -// These lines shouldn't appear in the output. -console.log("wtf"); -console.error("bro"); -``` - -## Don't believe me? Try it for yourself. - -In Windows, clone the repo and cd to the `test\fixtures` directory. The only difference between [log.js](test/fixtures/log.js) and [log-broken.js](test/fixtures/log-broken.js) is that the former uses `exit` while the latter calls `process.exit` directly. - -This test was done using cmd.exe, but you can see the same results using `| grep "std"` in either PowerShell or git-bash. - -``` -C:\node-exit\test\fixtures>node log.js 0 10 stdout stderr 2>&1 | find "std" -stdout 0 -stderr 0 -stdout 1 -stderr 1 -stdout 2 -stderr 2 -stdout 3 -stderr 3 -stdout 4 -stderr 4 -stdout 5 -stderr 5 -stdout 6 -stderr 6 -stdout 7 -stderr 7 -stdout 8 -stderr 8 -stdout 9 -stderr 9 - -C:\node-exit\test\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find "std" - -C:\node-exit\test\fixtures> -``` - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). - -## Release History -2013-11-26 - v0.1.2 - Fixed a bug with hanging processes. -2013-09-26 - v0.1.1 - Fixed some bugs. It seems to actually work now! -2013-09-20 - v0.1.0 - Initial release. - -## License -Copyright (c) 2013 "Cowboy" Ben Alman -Licensed under the MIT license. diff --git a/node_modules/grunt/node_modules/exit/lib/exit.js b/node_modules/grunt/node_modules/exit/lib/exit.js deleted file mode 100644 index 2883e05..0000000 --- a/node_modules/grunt/node_modules/exit/lib/exit.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * exit - * https://github.com/cowboy/node-exit - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - */ - -'use strict'; - -module.exports = function exit(exitCode, streams) { - if (!streams) { streams = [process.stdout, process.stderr]; } - var drainCount = 0; - // Actually exit if all streams are drained. - function tryToExit() { - if (drainCount === streams.length) { - process.exit(exitCode); - } - } - streams.forEach(function(stream) { - // Count drained streams now, but monitor non-drained streams. - if (stream.bufferSize === 0) { - drainCount++; - } else { - stream.write('', 'utf-8', function() { - drainCount++; - tryToExit(); - }); - } - // Prevent further writing. - stream.write = function() {}; - }); - // If all streams were already drained, exit now. - tryToExit(); - // In Windows, when run as a Node.js child process, a script utilizing - // this library might just exit with a 0 exit code, regardless. This code, - // despite the fact that it looks a bit crazy, appears to fix that. - process.on('exit', function() { - process.exit(exitCode); - }); -}; diff --git a/node_modules/grunt/node_modules/exit/package.json b/node_modules/grunt/node_modules/exit/package.json deleted file mode 100644 index 9cd4007..0000000 --- a/node_modules/grunt/node_modules/exit/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "exit", - "description": "A replacement for process.exit that ensures stdio are fully drained before exiting.", - "version": "0.1.2", - "homepage": "https://github.com/cowboy/node-exit", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/node-exit.git" - }, - "bugs": { - "url": "https://github.com/cowboy/node-exit/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/node-exit/blob/master/LICENSE-MIT" - } - ], - "main": "lib/exit", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.6.4", - "grunt-contrib-nodeunit": "~0.2.0", - "grunt-contrib-watch": "~0.5.3", - "grunt": "~0.4.1", - "which": "~1.0.5" - }, - "keywords": [ - "exit", - "process", - "stdio", - "stdout", - "stderr", - "drain", - "flush", - "3584" - ], - "readme": "# exit [![Build Status](https://secure.travis-ci.org/cowboy/node-exit.png?branch=master)](http://travis-ci.org/cowboy/node-exit)\n\nA replacement for process.exit that ensures stdio are fully drained before exiting.\n\nTo make a long story short, if `process.exit` is called on Windows, script output is often truncated when pipe-redirecting `stdout` or `stderr`. This module attempts to work around this issue by waiting until those streams have been completely drained before actually calling `process.exit`.\n\nSee [Node.js issue #3584](https://github.com/joyent/node/issues/3584) for further reference.\n\nTested in OS X 10.8, Windows 7 on Node.js 0.8.25 and 0.10.18.\n\nBased on some code by [@vladikoff](https://github.com/vladikoff).\n\n## Getting Started\nInstall the module with: `npm install exit`\n\n```javascript\nvar exit = require('exit');\n\n// These lines should appear in the output, EVEN ON WINDOWS.\nconsole.log(\"omg\");\nconsole.error(\"yay\");\n\n// process.exit(5);\nexit(5);\n\n// These lines shouldn't appear in the output.\nconsole.log(\"wtf\");\nconsole.error(\"bro\");\n```\n\n## Don't believe me? Try it for yourself.\n\nIn Windows, clone the repo and cd to the `test\\fixtures` directory. The only difference between [log.js](test/fixtures/log.js) and [log-broken.js](test/fixtures/log-broken.js) is that the former uses `exit` while the latter calls `process.exit` directly.\n\nThis test was done using cmd.exe, but you can see the same results using `| grep \"std\"` in either PowerShell or git-bash.\n\n```\nC:\\node-exit\\test\\fixtures>node log.js 0 10 stdout stderr 2>&1 | find \"std\"\nstdout 0\nstderr 0\nstdout 1\nstderr 1\nstdout 2\nstderr 2\nstdout 3\nstderr 3\nstdout 4\nstderr 4\nstdout 5\nstderr 5\nstdout 6\nstderr 6\nstdout 7\nstderr 7\nstdout 8\nstderr 8\nstdout 9\nstderr 9\n\nC:\\node-exit\\test\\fixtures>node log-broken.js 0 10 stdout stderr 2>&1 | find \"std\"\n\nC:\\node-exit\\test\\fixtures>\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-11-26 - v0.1.2 - Fixed a bug with hanging processes. \n2013-09-26 - v0.1.1 - Fixed some bugs. It seems to actually work now! \n2013-09-20 - v0.1.0 - Initial release.\n\n## License\nCopyright (c) 2013 \"Cowboy\" Ben Alman \nLicensed under the MIT license.\n", - "readmeFilename": "README.md", - "_id": "exit@0.1.2", - "_from": "exit@~0.1.1" -} diff --git a/node_modules/grunt/node_modules/exit/test/exit_test.js b/node_modules/grunt/node_modules/exit/test/exit_test.js deleted file mode 100644 index a91afb9..0000000 --- a/node_modules/grunt/node_modules/exit/test/exit_test.js +++ /dev/null @@ -1,121 +0,0 @@ -'use strict'; - -/* - ======== A Handy Little Nodeunit Reference ======== - https://github.com/caolan/nodeunit - - Test methods: - test.expect(numAssertions) - test.done() - Test assertions: - test.ok(value, [message]) - test.equal(actual, expected, [message]) - test.notEqual(actual, expected, [message]) - test.deepEqual(actual, expected, [message]) - test.notDeepEqual(actual, expected, [message]) - test.strictEqual(actual, expected, [message]) - test.notStrictEqual(actual, expected, [message]) - test.throws(block, [error], [message]) - test.doesNotThrow(block, [error], [message]) - test.ifError(value) -*/ - -var fs = require('fs'); -var exec = require('child_process').exec; - -var _which = require('which').sync; -function which(command) { - try { - _which(command); - return command; - } catch (err) { - return false; - } -} - -// Look for grep first (any OS). If not found (but on Windows) look for find, -// which is Windows' horribly crippled grep alternative. -var grep = which('grep') || process.platform === 'win32' && which('find'); - -exports['exit'] = { - setUp: function(done) { - this.origCwd = process.cwd(); - process.chdir('test/fixtures'); - done(); - }, - tearDown: function(done) { - process.chdir(this.origCwd); - done(); - }, - 'grep': function(test) { - test.expect(1); - // Many unit tests depend on this. - test.ok(grep, 'A suitable "grep" or "find" program was not found in the PATH.'); - test.done(); - }, - // The rest of the tests are built dynamically, to keep things sane. -}; - -// A few helper functions. -function normalizeLineEndings(s) { - return s.replace(/\r?\n/g, '\n'); -} - -// Capture command output, normalizing captured stdout to unix file endings. -function run(command, callback) { - exec(command, function(error, stdout) { - callback(error ? error.code : 0, normalizeLineEndings(stdout)); - }); -} - -// Read a fixture file, normalizing file contents to unix file endings. -function fixture(filename) { - return normalizeLineEndings(String(fs.readFileSync(filename))); -} - -function buildTests() { - // Build individual unit tests for command output. - var counts = [10, 100, 1000]; - var outputs = [' stdout stderr', ' stdout', ' stderr']; - var pipes = ['', ' | ' + grep + ' "std"']; - counts.forEach(function(count) { - outputs.forEach(function(output) { - pipes.forEach(function(pipe) { - var command = 'node log.js 0 ' + count + output + ' 2>&1' + pipe; - exports['exit']['output (' + command + ')'] = function(test) { - test.expect(2); - run(command, function(code, actual) { - var expected = fixture(count + output.replace(/ /g, '-') + '.txt'); - // Sometimes, the actual file lines are out of order on Windows. - // But since the point of this lib is to drain the buffer and not - // guarantee output order, we only test the length. - test.equal(actual.length, expected.length, 'should be the same length.'); - // The "fail" lines in log.js should NOT be output! - test.ok(actual.indexOf('fail') === -1, 'should not output after exit is called.'); - test.done(); - }); - }; - }); - }); - }); - - // Build individual unit tests for exit codes. - var codes = [0, 1, 123]; - codes.forEach(function(code) { - var command = 'node log.js ' + code + ' 10 stdout stderr'; - exports['exit']['exit code (' + command + ')'] = function(test) { - test.expect(1); - run(command, function(actual) { - // The specified exit code should be passed through. - test.equal(actual, code, 'should exit with ' + code + ' error code.'); - test.done(); - }); - }; - }); -} - -// Don't bother building tests if grep wasn't found, otherwise everything will -// fail and the error will get lost. -if (grep) { - buildTests(); -} diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/10-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/10-stderr.txt deleted file mode 100644 index 2859200..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/10-stderr.txt +++ /dev/null @@ -1,10 +0,0 @@ -stderr 0 -stderr 1 -stderr 2 -stderr 3 -stderr 4 -stderr 5 -stderr 6 -stderr 7 -stderr 8 -stderr 9 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout-stderr.txt deleted file mode 100644 index 9de8616..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout-stderr.txt +++ /dev/null @@ -1,20 +0,0 @@ -stdout 0 -stderr 0 -stdout 1 -stdout 2 -stderr 1 -stdout 3 -stderr 2 -stderr 3 -stdout 4 -stderr 4 -stdout 5 -stderr 5 -stdout 6 -stderr 6 -stdout 7 -stderr 7 -stdout 8 -stderr 8 -stdout 9 -stderr 9 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout.txt b/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout.txt deleted file mode 100644 index 1ce90dc..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout.txt +++ /dev/null @@ -1,10 +0,0 @@ -stdout 0 -stdout 1 -stdout 2 -stdout 3 -stdout 4 -stdout 5 -stdout 6 -stdout 7 -stdout 8 -stdout 9 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/100-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/100-stderr.txt deleted file mode 100644 index 3a78c85..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/100-stderr.txt +++ /dev/null @@ -1,100 +0,0 @@ -stderr 0 -stderr 1 -stderr 2 -stderr 3 -stderr 4 -stderr 5 -stderr 6 -stderr 7 -stderr 8 -stderr 9 -stderr 10 -stderr 11 -stderr 12 -stderr 13 -stderr 14 -stderr 15 -stderr 16 -stderr 17 -stderr 18 -stderr 19 -stderr 20 -stderr 21 -stderr 22 -stderr 23 -stderr 24 -stderr 25 -stderr 26 -stderr 27 -stderr 28 -stderr 29 -stderr 30 -stderr 31 -stderr 32 -stderr 33 -stderr 34 -stderr 35 -stderr 36 -stderr 37 -stderr 38 -stderr 39 -stderr 40 -stderr 41 -stderr 42 -stderr 43 -stderr 44 -stderr 45 -stderr 46 -stderr 47 -stderr 48 -stderr 49 -stderr 50 -stderr 51 -stderr 52 -stderr 53 -stderr 54 -stderr 55 -stderr 56 -stderr 57 -stderr 58 -stderr 59 -stderr 60 -stderr 61 -stderr 62 -stderr 63 -stderr 64 -stderr 65 -stderr 66 -stderr 67 -stderr 68 -stderr 69 -stderr 70 -stderr 71 -stderr 72 -stderr 73 -stderr 74 -stderr 75 -stderr 76 -stderr 77 -stderr 78 -stderr 79 -stderr 80 -stderr 81 -stderr 82 -stderr 83 -stderr 84 -stderr 85 -stderr 86 -stderr 87 -stderr 88 -stderr 89 -stderr 90 -stderr 91 -stderr 92 -stderr 93 -stderr 94 -stderr 95 -stderr 96 -stderr 97 -stderr 98 -stderr 99 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout-stderr.txt deleted file mode 100644 index 65f35f4..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout-stderr.txt +++ /dev/null @@ -1,200 +0,0 @@ -stdout 0 -stderr 0 -stdout 1 -stderr 1 -stdout 2 -stderr 2 -stdout 3 -stderr 3 -stdout 4 -stderr 4 -stdout 5 -stderr 5 -stdout 6 -stderr 6 -stdout 7 -stderr 7 -stdout 8 -stderr 8 -stdout 9 -stderr 9 -stdout 10 -stderr 10 -stdout 11 -stderr 11 -stdout 12 -stderr 12 -stdout 13 -stderr 13 -stdout 14 -stderr 14 -stdout 15 -stderr 15 -stdout 16 -stderr 16 -stdout 17 -stderr 17 -stdout 18 -stderr 18 -stdout 19 -stderr 19 -stdout 20 -stderr 20 -stdout 21 -stderr 21 -stdout 22 -stderr 22 -stdout 23 -stderr 23 -stdout 24 -stderr 24 -stdout 25 -stderr 25 -stdout 26 -stderr 26 -stdout 27 -stderr 27 -stdout 28 -stderr 28 -stdout 29 -stderr 29 -stdout 30 -stderr 30 -stdout 31 -stderr 31 -stdout 32 -stderr 32 -stdout 33 -stderr 33 -stdout 34 -stderr 34 -stdout 35 -stderr 35 -stdout 36 -stderr 36 -stdout 37 -stderr 37 -stdout 38 -stderr 38 -stdout 39 -stderr 39 -stdout 40 -stderr 40 -stdout 41 -stderr 41 -stdout 42 -stderr 42 -stdout 43 -stderr 43 -stdout 44 -stderr 44 -stdout 45 -stderr 45 -stdout 46 -stderr 46 -stdout 47 -stderr 47 -stdout 48 -stderr 48 -stdout 49 -stderr 49 -stdout 50 -stderr 50 -stdout 51 -stderr 51 -stdout 52 -stderr 52 -stdout 53 -stderr 53 -stdout 54 -stderr 54 -stdout 55 -stderr 55 -stdout 56 -stderr 56 -stdout 57 -stderr 57 -stdout 58 -stderr 58 -stdout 59 -stderr 59 -stdout 60 -stderr 60 -stdout 61 -stderr 61 -stdout 62 -stderr 62 -stdout 63 -stderr 63 -stdout 64 -stderr 64 -stdout 65 -stderr 65 -stdout 66 -stderr 66 -stdout 67 -stderr 67 -stdout 68 -stderr 68 -stdout 69 -stderr 69 -stdout 70 -stderr 70 -stdout 71 -stderr 71 -stdout 72 -stderr 72 -stdout 73 -stderr 73 -stdout 74 -stderr 74 -stdout 75 -stderr 75 -stdout 76 -stderr 76 -stdout 77 -stderr 77 -stdout 78 -stderr 78 -stdout 79 -stderr 79 -stdout 80 -stderr 80 -stdout 81 -stderr 81 -stdout 82 -stderr 82 -stdout 83 -stderr 83 -stdout 84 -stderr 84 -stdout 85 -stderr 85 -stdout 86 -stderr 86 -stdout 87 -stderr 87 -stdout 88 -stderr 88 -stdout 89 -stderr 89 -stdout 90 -stderr 90 -stdout 91 -stderr 91 -stdout 92 -stderr 92 -stdout 93 -stderr 93 -stdout 94 -stderr 94 -stdout 95 -stderr 95 -stdout 96 -stderr 96 -stdout 97 -stderr 97 -stdout 98 -stderr 98 -stdout 99 -stderr 99 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout.txt b/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout.txt deleted file mode 100644 index 5d9cac2..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout.txt +++ /dev/null @@ -1,100 +0,0 @@ -stdout 0 -stdout 1 -stdout 2 -stdout 3 -stdout 4 -stdout 5 -stdout 6 -stdout 7 -stdout 8 -stdout 9 -stdout 10 -stdout 11 -stdout 12 -stdout 13 -stdout 14 -stdout 15 -stdout 16 -stdout 17 -stdout 18 -stdout 19 -stdout 20 -stdout 21 -stdout 22 -stdout 23 -stdout 24 -stdout 25 -stdout 26 -stdout 27 -stdout 28 -stdout 29 -stdout 30 -stdout 31 -stdout 32 -stdout 33 -stdout 34 -stdout 35 -stdout 36 -stdout 37 -stdout 38 -stdout 39 -stdout 40 -stdout 41 -stdout 42 -stdout 43 -stdout 44 -stdout 45 -stdout 46 -stdout 47 -stdout 48 -stdout 49 -stdout 50 -stdout 51 -stdout 52 -stdout 53 -stdout 54 -stdout 55 -stdout 56 -stdout 57 -stdout 58 -stdout 59 -stdout 60 -stdout 61 -stdout 62 -stdout 63 -stdout 64 -stdout 65 -stdout 66 -stdout 67 -stdout 68 -stdout 69 -stdout 70 -stdout 71 -stdout 72 -stdout 73 -stdout 74 -stdout 75 -stdout 76 -stdout 77 -stdout 78 -stdout 79 -stdout 80 -stdout 81 -stdout 82 -stdout 83 -stdout 84 -stdout 85 -stdout 86 -stdout 87 -stdout 88 -stdout 89 -stdout 90 -stdout 91 -stdout 92 -stdout 93 -stdout 94 -stdout 95 -stdout 96 -stdout 97 -stdout 98 -stdout 99 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/1000-stderr.txt deleted file mode 100644 index d637510..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stderr.txt +++ /dev/null @@ -1,1000 +0,0 @@ -stderr 0 -stderr 1 -stderr 2 -stderr 3 -stderr 4 -stderr 5 -stderr 6 -stderr 7 -stderr 8 -stderr 9 -stderr 10 -stderr 11 -stderr 12 -stderr 13 -stderr 14 -stderr 15 -stderr 16 -stderr 17 -stderr 18 -stderr 19 -stderr 20 -stderr 21 -stderr 22 -stderr 23 -stderr 24 -stderr 25 -stderr 26 -stderr 27 -stderr 28 -stderr 29 -stderr 30 -stderr 31 -stderr 32 -stderr 33 -stderr 34 -stderr 35 -stderr 36 -stderr 37 -stderr 38 -stderr 39 -stderr 40 -stderr 41 -stderr 42 -stderr 43 -stderr 44 -stderr 45 -stderr 46 -stderr 47 -stderr 48 -stderr 49 -stderr 50 -stderr 51 -stderr 52 -stderr 53 -stderr 54 -stderr 55 -stderr 56 -stderr 57 -stderr 58 -stderr 59 -stderr 60 -stderr 61 -stderr 62 -stderr 63 -stderr 64 -stderr 65 -stderr 66 -stderr 67 -stderr 68 -stderr 69 -stderr 70 -stderr 71 -stderr 72 -stderr 73 -stderr 74 -stderr 75 -stderr 76 -stderr 77 -stderr 78 -stderr 79 -stderr 80 -stderr 81 -stderr 82 -stderr 83 -stderr 84 -stderr 85 -stderr 86 -stderr 87 -stderr 88 -stderr 89 -stderr 90 -stderr 91 -stderr 92 -stderr 93 -stderr 94 -stderr 95 -stderr 96 -stderr 97 -stderr 98 -stderr 99 -stderr 100 -stderr 101 -stderr 102 -stderr 103 -stderr 104 -stderr 105 -stderr 106 -stderr 107 -stderr 108 -stderr 109 -stderr 110 -stderr 111 -stderr 112 -stderr 113 -stderr 114 -stderr 115 -stderr 116 -stderr 117 -stderr 118 -stderr 119 -stderr 120 -stderr 121 -stderr 122 -stderr 123 -stderr 124 -stderr 125 -stderr 126 -stderr 127 -stderr 128 -stderr 129 -stderr 130 -stderr 131 -stderr 132 -stderr 133 -stderr 134 -stderr 135 -stderr 136 -stderr 137 -stderr 138 -stderr 139 -stderr 140 -stderr 141 -stderr 142 -stderr 143 -stderr 144 -stderr 145 -stderr 146 -stderr 147 -stderr 148 -stderr 149 -stderr 150 -stderr 151 -stderr 152 -stderr 153 -stderr 154 -stderr 155 -stderr 156 -stderr 157 -stderr 158 -stderr 159 -stderr 160 -stderr 161 -stderr 162 -stderr 163 -stderr 164 -stderr 165 -stderr 166 -stderr 167 -stderr 168 -stderr 169 -stderr 170 -stderr 171 -stderr 172 -stderr 173 -stderr 174 -stderr 175 -stderr 176 -stderr 177 -stderr 178 -stderr 179 -stderr 180 -stderr 181 -stderr 182 -stderr 183 -stderr 184 -stderr 185 -stderr 186 -stderr 187 -stderr 188 -stderr 189 -stderr 190 -stderr 191 -stderr 192 -stderr 193 -stderr 194 -stderr 195 -stderr 196 -stderr 197 -stderr 198 -stderr 199 -stderr 200 -stderr 201 -stderr 202 -stderr 203 -stderr 204 -stderr 205 -stderr 206 -stderr 207 -stderr 208 -stderr 209 -stderr 210 -stderr 211 -stderr 212 -stderr 213 -stderr 214 -stderr 215 -stderr 216 -stderr 217 -stderr 218 -stderr 219 -stderr 220 -stderr 221 -stderr 222 -stderr 223 -stderr 224 -stderr 225 -stderr 226 -stderr 227 -stderr 228 -stderr 229 -stderr 230 -stderr 231 -stderr 232 -stderr 233 -stderr 234 -stderr 235 -stderr 236 -stderr 237 -stderr 238 -stderr 239 -stderr 240 -stderr 241 -stderr 242 -stderr 243 -stderr 244 -stderr 245 -stderr 246 -stderr 247 -stderr 248 -stderr 249 -stderr 250 -stderr 251 -stderr 252 -stderr 253 -stderr 254 -stderr 255 -stderr 256 -stderr 257 -stderr 258 -stderr 259 -stderr 260 -stderr 261 -stderr 262 -stderr 263 -stderr 264 -stderr 265 -stderr 266 -stderr 267 -stderr 268 -stderr 269 -stderr 270 -stderr 271 -stderr 272 -stderr 273 -stderr 274 -stderr 275 -stderr 276 -stderr 277 -stderr 278 -stderr 279 -stderr 280 -stderr 281 -stderr 282 -stderr 283 -stderr 284 -stderr 285 -stderr 286 -stderr 287 -stderr 288 -stderr 289 -stderr 290 -stderr 291 -stderr 292 -stderr 293 -stderr 294 -stderr 295 -stderr 296 -stderr 297 -stderr 298 -stderr 299 -stderr 300 -stderr 301 -stderr 302 -stderr 303 -stderr 304 -stderr 305 -stderr 306 -stderr 307 -stderr 308 -stderr 309 -stderr 310 -stderr 311 -stderr 312 -stderr 313 -stderr 314 -stderr 315 -stderr 316 -stderr 317 -stderr 318 -stderr 319 -stderr 320 -stderr 321 -stderr 322 -stderr 323 -stderr 324 -stderr 325 -stderr 326 -stderr 327 -stderr 328 -stderr 329 -stderr 330 -stderr 331 -stderr 332 -stderr 333 -stderr 334 -stderr 335 -stderr 336 -stderr 337 -stderr 338 -stderr 339 -stderr 340 -stderr 341 -stderr 342 -stderr 343 -stderr 344 -stderr 345 -stderr 346 -stderr 347 -stderr 348 -stderr 349 -stderr 350 -stderr 351 -stderr 352 -stderr 353 -stderr 354 -stderr 355 -stderr 356 -stderr 357 -stderr 358 -stderr 359 -stderr 360 -stderr 361 -stderr 362 -stderr 363 -stderr 364 -stderr 365 -stderr 366 -stderr 367 -stderr 368 -stderr 369 -stderr 370 -stderr 371 -stderr 372 -stderr 373 -stderr 374 -stderr 375 -stderr 376 -stderr 377 -stderr 378 -stderr 379 -stderr 380 -stderr 381 -stderr 382 -stderr 383 -stderr 384 -stderr 385 -stderr 386 -stderr 387 -stderr 388 -stderr 389 -stderr 390 -stderr 391 -stderr 392 -stderr 393 -stderr 394 -stderr 395 -stderr 396 -stderr 397 -stderr 398 -stderr 399 -stderr 400 -stderr 401 -stderr 402 -stderr 403 -stderr 404 -stderr 405 -stderr 406 -stderr 407 -stderr 408 -stderr 409 -stderr 410 -stderr 411 -stderr 412 -stderr 413 -stderr 414 -stderr 415 -stderr 416 -stderr 417 -stderr 418 -stderr 419 -stderr 420 -stderr 421 -stderr 422 -stderr 423 -stderr 424 -stderr 425 -stderr 426 -stderr 427 -stderr 428 -stderr 429 -stderr 430 -stderr 431 -stderr 432 -stderr 433 -stderr 434 -stderr 435 -stderr 436 -stderr 437 -stderr 438 -stderr 439 -stderr 440 -stderr 441 -stderr 442 -stderr 443 -stderr 444 -stderr 445 -stderr 446 -stderr 447 -stderr 448 -stderr 449 -stderr 450 -stderr 451 -stderr 452 -stderr 453 -stderr 454 -stderr 455 -stderr 456 -stderr 457 -stderr 458 -stderr 459 -stderr 460 -stderr 461 -stderr 462 -stderr 463 -stderr 464 -stderr 465 -stderr 466 -stderr 467 -stderr 468 -stderr 469 -stderr 470 -stderr 471 -stderr 472 -stderr 473 -stderr 474 -stderr 475 -stderr 476 -stderr 477 -stderr 478 -stderr 479 -stderr 480 -stderr 481 -stderr 482 -stderr 483 -stderr 484 -stderr 485 -stderr 486 -stderr 487 -stderr 488 -stderr 489 -stderr 490 -stderr 491 -stderr 492 -stderr 493 -stderr 494 -stderr 495 -stderr 496 -stderr 497 -stderr 498 -stderr 499 -stderr 500 -stderr 501 -stderr 502 -stderr 503 -stderr 504 -stderr 505 -stderr 506 -stderr 507 -stderr 508 -stderr 509 -stderr 510 -stderr 511 -stderr 512 -stderr 513 -stderr 514 -stderr 515 -stderr 516 -stderr 517 -stderr 518 -stderr 519 -stderr 520 -stderr 521 -stderr 522 -stderr 523 -stderr 524 -stderr 525 -stderr 526 -stderr 527 -stderr 528 -stderr 529 -stderr 530 -stderr 531 -stderr 532 -stderr 533 -stderr 534 -stderr 535 -stderr 536 -stderr 537 -stderr 538 -stderr 539 -stderr 540 -stderr 541 -stderr 542 -stderr 543 -stderr 544 -stderr 545 -stderr 546 -stderr 547 -stderr 548 -stderr 549 -stderr 550 -stderr 551 -stderr 552 -stderr 553 -stderr 554 -stderr 555 -stderr 556 -stderr 557 -stderr 558 -stderr 559 -stderr 560 -stderr 561 -stderr 562 -stderr 563 -stderr 564 -stderr 565 -stderr 566 -stderr 567 -stderr 568 -stderr 569 -stderr 570 -stderr 571 -stderr 572 -stderr 573 -stderr 574 -stderr 575 -stderr 576 -stderr 577 -stderr 578 -stderr 579 -stderr 580 -stderr 581 -stderr 582 -stderr 583 -stderr 584 -stderr 585 -stderr 586 -stderr 587 -stderr 588 -stderr 589 -stderr 590 -stderr 591 -stderr 592 -stderr 593 -stderr 594 -stderr 595 -stderr 596 -stderr 597 -stderr 598 -stderr 599 -stderr 600 -stderr 601 -stderr 602 -stderr 603 -stderr 604 -stderr 605 -stderr 606 -stderr 607 -stderr 608 -stderr 609 -stderr 610 -stderr 611 -stderr 612 -stderr 613 -stderr 614 -stderr 615 -stderr 616 -stderr 617 -stderr 618 -stderr 619 -stderr 620 -stderr 621 -stderr 622 -stderr 623 -stderr 624 -stderr 625 -stderr 626 -stderr 627 -stderr 628 -stderr 629 -stderr 630 -stderr 631 -stderr 632 -stderr 633 -stderr 634 -stderr 635 -stderr 636 -stderr 637 -stderr 638 -stderr 639 -stderr 640 -stderr 641 -stderr 642 -stderr 643 -stderr 644 -stderr 645 -stderr 646 -stderr 647 -stderr 648 -stderr 649 -stderr 650 -stderr 651 -stderr 652 -stderr 653 -stderr 654 -stderr 655 -stderr 656 -stderr 657 -stderr 658 -stderr 659 -stderr 660 -stderr 661 -stderr 662 -stderr 663 -stderr 664 -stderr 665 -stderr 666 -stderr 667 -stderr 668 -stderr 669 -stderr 670 -stderr 671 -stderr 672 -stderr 673 -stderr 674 -stderr 675 -stderr 676 -stderr 677 -stderr 678 -stderr 679 -stderr 680 -stderr 681 -stderr 682 -stderr 683 -stderr 684 -stderr 685 -stderr 686 -stderr 687 -stderr 688 -stderr 689 -stderr 690 -stderr 691 -stderr 692 -stderr 693 -stderr 694 -stderr 695 -stderr 696 -stderr 697 -stderr 698 -stderr 699 -stderr 700 -stderr 701 -stderr 702 -stderr 703 -stderr 704 -stderr 705 -stderr 706 -stderr 707 -stderr 708 -stderr 709 -stderr 710 -stderr 711 -stderr 712 -stderr 713 -stderr 714 -stderr 715 -stderr 716 -stderr 717 -stderr 718 -stderr 719 -stderr 720 -stderr 721 -stderr 722 -stderr 723 -stderr 724 -stderr 725 -stderr 726 -stderr 727 -stderr 728 -stderr 729 -stderr 730 -stderr 731 -stderr 732 -stderr 733 -stderr 734 -stderr 735 -stderr 736 -stderr 737 -stderr 738 -stderr 739 -stderr 740 -stderr 741 -stderr 742 -stderr 743 -stderr 744 -stderr 745 -stderr 746 -stderr 747 -stderr 748 -stderr 749 -stderr 750 -stderr 751 -stderr 752 -stderr 753 -stderr 754 -stderr 755 -stderr 756 -stderr 757 -stderr 758 -stderr 759 -stderr 760 -stderr 761 -stderr 762 -stderr 763 -stderr 764 -stderr 765 -stderr 766 -stderr 767 -stderr 768 -stderr 769 -stderr 770 -stderr 771 -stderr 772 -stderr 773 -stderr 774 -stderr 775 -stderr 776 -stderr 777 -stderr 778 -stderr 779 -stderr 780 -stderr 781 -stderr 782 -stderr 783 -stderr 784 -stderr 785 -stderr 786 -stderr 787 -stderr 788 -stderr 789 -stderr 790 -stderr 791 -stderr 792 -stderr 793 -stderr 794 -stderr 795 -stderr 796 -stderr 797 -stderr 798 -stderr 799 -stderr 800 -stderr 801 -stderr 802 -stderr 803 -stderr 804 -stderr 805 -stderr 806 -stderr 807 -stderr 808 -stderr 809 -stderr 810 -stderr 811 -stderr 812 -stderr 813 -stderr 814 -stderr 815 -stderr 816 -stderr 817 -stderr 818 -stderr 819 -stderr 820 -stderr 821 -stderr 822 -stderr 823 -stderr 824 -stderr 825 -stderr 826 -stderr 827 -stderr 828 -stderr 829 -stderr 830 -stderr 831 -stderr 832 -stderr 833 -stderr 834 -stderr 835 -stderr 836 -stderr 837 -stderr 838 -stderr 839 -stderr 840 -stderr 841 -stderr 842 -stderr 843 -stderr 844 -stderr 845 -stderr 846 -stderr 847 -stderr 848 -stderr 849 -stderr 850 -stderr 851 -stderr 852 -stderr 853 -stderr 854 -stderr 855 -stderr 856 -stderr 857 -stderr 858 -stderr 859 -stderr 860 -stderr 861 -stderr 862 -stderr 863 -stderr 864 -stderr 865 -stderr 866 -stderr 867 -stderr 868 -stderr 869 -stderr 870 -stderr 871 -stderr 872 -stderr 873 -stderr 874 -stderr 875 -stderr 876 -stderr 877 -stderr 878 -stderr 879 -stderr 880 -stderr 881 -stderr 882 -stderr 883 -stderr 884 -stderr 885 -stderr 886 -stderr 887 -stderr 888 -stderr 889 -stderr 890 -stderr 891 -stderr 892 -stderr 893 -stderr 894 -stderr 895 -stderr 896 -stderr 897 -stderr 898 -stderr 899 -stderr 900 -stderr 901 -stderr 902 -stderr 903 -stderr 904 -stderr 905 -stderr 906 -stderr 907 -stderr 908 -stderr 909 -stderr 910 -stderr 911 -stderr 912 -stderr 913 -stderr 914 -stderr 915 -stderr 916 -stderr 917 -stderr 918 -stderr 919 -stderr 920 -stderr 921 -stderr 922 -stderr 923 -stderr 924 -stderr 925 -stderr 926 -stderr 927 -stderr 928 -stderr 929 -stderr 930 -stderr 931 -stderr 932 -stderr 933 -stderr 934 -stderr 935 -stderr 936 -stderr 937 -stderr 938 -stderr 939 -stderr 940 -stderr 941 -stderr 942 -stderr 943 -stderr 944 -stderr 945 -stderr 946 -stderr 947 -stderr 948 -stderr 949 -stderr 950 -stderr 951 -stderr 952 -stderr 953 -stderr 954 -stderr 955 -stderr 956 -stderr 957 -stderr 958 -stderr 959 -stderr 960 -stderr 961 -stderr 962 -stderr 963 -stderr 964 -stderr 965 -stderr 966 -stderr 967 -stderr 968 -stderr 969 -stderr 970 -stderr 971 -stderr 972 -stderr 973 -stderr 974 -stderr 975 -stderr 976 -stderr 977 -stderr 978 -stderr 979 -stderr 980 -stderr 981 -stderr 982 -stderr 983 -stderr 984 -stderr 985 -stderr 986 -stderr 987 -stderr 988 -stderr 989 -stderr 990 -stderr 991 -stderr 992 -stderr 993 -stderr 994 -stderr 995 -stderr 996 -stderr 997 -stderr 998 -stderr 999 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout-stderr.txt b/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout-stderr.txt deleted file mode 100644 index 4fde2b4..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +++ /dev/null @@ -1,2000 +0,0 @@ -stdout 0 -stderr 0 -stdout 1 -stderr 1 -stdout 2 -stderr 2 -stdout 3 -stderr 3 -stdout 4 -stderr 4 -stdout 5 -stderr 5 -stdout 6 -stderr 6 -stdout 7 -stderr 7 -stdout 8 -stderr 8 -stdout 9 -stderr 9 -stdout 10 -stderr 10 -stdout 11 -stderr 11 -stdout 12 -stderr 12 -stdout 13 -stderr 13 -stdout 14 -stderr 14 -stdout 15 -stderr 15 -stdout 16 -stderr 16 -stdout 17 -stderr 17 -stdout 18 -stderr 18 -stdout 19 -stderr 19 -stdout 20 -stderr 20 -stdout 21 -stderr 21 -stdout 22 -stderr 22 -stdout 23 -stderr 23 -stdout 24 -stderr 24 -stdout 25 -stderr 25 -stdout 26 -stderr 26 -stdout 27 -stderr 27 -stdout 28 -stderr 28 -stdout 29 -stderr 29 -stdout 30 -stderr 30 -stdout 31 -stderr 31 -stdout 32 -stderr 32 -stdout 33 -stderr 33 -stdout 34 -stderr 34 -stdout 35 -stderr 35 -stdout 36 -stderr 36 -stdout 37 -stderr 37 -stdout 38 -stderr 38 -stdout 39 -stderr 39 -stdout 40 -stderr 40 -stdout 41 -stderr 41 -stdout 42 -stderr 42 -stdout 43 -stderr 43 -stdout 44 -stderr 44 -stdout 45 -stderr 45 -stdout 46 -stderr 46 -stdout 47 -stderr 47 -stdout 48 -stderr 48 -stdout 49 -stderr 49 -stdout 50 -stderr 50 -stdout 51 -stderr 51 -stdout 52 -stderr 52 -stdout 53 -stderr 53 -stdout 54 -stderr 54 -stdout 55 -stderr 55 -stdout 56 -stderr 56 -stdout 57 -stderr 57 -stdout 58 -stderr 58 -stdout 59 -stderr 59 -stdout 60 -stderr 60 -stdout 61 -stderr 61 -stdout 62 -stderr 62 -stdout 63 -stderr 63 -stdout 64 -stderr 64 -stdout 65 -stderr 65 -stdout 66 -stderr 66 -stdout 67 -stderr 67 -stdout 68 -stderr 68 -stdout 69 -stderr 69 -stdout 70 -stderr 70 -stdout 71 -stderr 71 -stdout 72 -stderr 72 -stdout 73 -stderr 73 -stdout 74 -stderr 74 -stdout 75 -stderr 75 -stdout 76 -stderr 76 -stdout 77 -stderr 77 -stdout 78 -stderr 78 -stdout 79 -stderr 79 -stdout 80 -stderr 80 -stdout 81 -stderr 81 -stdout 82 -stderr 82 -stdout 83 -stderr 83 -stdout 84 -stderr 84 -stdout 85 -stderr 85 -stdout 86 -stderr 86 -stdout 87 -stderr 87 -stdout 88 -stderr 88 -stdout 89 -stderr 89 -stdout 90 -stderr 90 -stdout 91 -stderr 91 -stdout 92 -stderr 92 -stdout 93 -stderr 93 -stdout 94 -stderr 94 -stdout 95 -stderr 95 -stdout 96 -stderr 96 -stdout 97 -stderr 97 -stdout 98 -stderr 98 -stdout 99 -stderr 99 -stdout 100 -stderr 100 -stdout 101 -stderr 101 -stdout 102 -stderr 102 -stdout 103 -stderr 103 -stdout 104 -stderr 104 -stdout 105 -stderr 105 -stdout 106 -stderr 106 -stdout 107 -stderr 107 -stdout 108 -stderr 108 -stdout 109 -stderr 109 -stdout 110 -stderr 110 -stdout 111 -stderr 111 -stdout 112 -stderr 112 -stdout 113 -stderr 113 -stdout 114 -stderr 114 -stdout 115 -stderr 115 -stdout 116 -stderr 116 -stdout 117 -stderr 117 -stdout 118 -stderr 118 -stdout 119 -stderr 119 -stdout 120 -stderr 120 -stdout 121 -stderr 121 -stdout 122 -stderr 122 -stdout 123 -stderr 123 -stdout 124 -stderr 124 -stdout 125 -stderr 125 -stdout 126 -stderr 126 -stdout 127 -stderr 127 -stdout 128 -stderr 128 -stdout 129 -stderr 129 -stdout 130 -stderr 130 -stdout 131 -stderr 131 -stdout 132 -stderr 132 -stdout 133 -stderr 133 -stdout 134 -stderr 134 -stdout 135 -stderr 135 -stdout 136 -stderr 136 -stdout 137 -stderr 137 -stdout 138 -stderr 138 -stdout 139 -stderr 139 -stdout 140 -stderr 140 -stdout 141 -stderr 141 -stdout 142 -stderr 142 -stdout 143 -stderr 143 -stdout 144 -stderr 144 -stdout 145 -stderr 145 -stdout 146 -stderr 146 -stdout 147 -stderr 147 -stdout 148 -stderr 148 -stdout 149 -stderr 149 -stdout 150 -stderr 150 -stdout 151 -stderr 151 -stdout 152 -stderr 152 -stdout 153 -stderr 153 -stdout 154 -stderr 154 -stdout 155 -stderr 155 -stdout 156 -stderr 156 -stdout 157 -stderr 157 -stdout 158 -stderr 158 -stdout 159 -stderr 159 -stdout 160 -stderr 160 -stdout 161 -stderr 161 -stdout 162 -stderr 162 -stdout 163 -stderr 163 -stdout 164 -stderr 164 -stdout 165 -stderr 165 -stdout 166 -stderr 166 -stdout 167 -stderr 167 -stdout 168 -stderr 168 -stdout 169 -stderr 169 -stdout 170 -stderr 170 -stdout 171 -stderr 171 -stdout 172 -stderr 172 -stdout 173 -stderr 173 -stdout 174 -stderr 174 -stdout 175 -stderr 175 -stdout 176 -stderr 176 -stdout 177 -stderr 177 -stdout 178 -stderr 178 -stdout 179 -stderr 179 -stdout 180 -stderr 180 -stdout 181 -stderr 181 -stdout 182 -stderr 182 -stdout 183 -stderr 183 -stdout 184 -stderr 184 -stdout 185 -stderr 185 -stdout 186 -stderr 186 -stdout 187 -stderr 187 -stdout 188 -stderr 188 -stdout 189 -stderr 189 -stdout 190 -stderr 190 -stdout 191 -stderr 191 -stdout 192 -stderr 192 -stdout 193 -stderr 193 -stdout 194 -stderr 194 -stdout 195 -stderr 195 -stdout 196 -stderr 196 -stdout 197 -stderr 197 -stdout 198 -stderr 198 -stdout 199 -stderr 199 -stdout 200 -stderr 200 -stdout 201 -stderr 201 -stdout 202 -stderr 202 -stdout 203 -stderr 203 -stdout 204 -stderr 204 -stdout 205 -stderr 205 -stdout 206 -stderr 206 -stdout 207 -stderr 207 -stdout 208 -stderr 208 -stdout 209 -stderr 209 -stdout 210 -stderr 210 -stdout 211 -stderr 211 -stdout 212 -stderr 212 -stdout 213 -stderr 213 -stdout 214 -stderr 214 -stdout 215 -stderr 215 -stdout 216 -stderr 216 -stdout 217 -stderr 217 -stdout 218 -stderr 218 -stdout 219 -stderr 219 -stdout 220 -stderr 220 -stdout 221 -stderr 221 -stdout 222 -stderr 222 -stdout 223 -stderr 223 -stdout 224 -stderr 224 -stdout 225 -stderr 225 -stdout 226 -stderr 226 -stdout 227 -stderr 227 -stdout 228 -stderr 228 -stdout 229 -stderr 229 -stdout 230 -stderr 230 -stdout 231 -stderr 231 -stdout 232 -stderr 232 -stdout 233 -stderr 233 -stdout 234 -stderr 234 -stdout 235 -stderr 235 -stdout 236 -stderr 236 -stdout 237 -stderr 237 -stdout 238 -stderr 238 -stdout 239 -stderr 239 -stdout 240 -stderr 240 -stdout 241 -stderr 241 -stdout 242 -stderr 242 -stdout 243 -stderr 243 -stdout 244 -stderr 244 -stdout 245 -stderr 245 -stdout 246 -stderr 246 -stdout 247 -stderr 247 -stdout 248 -stderr 248 -stdout 249 -stderr 249 -stdout 250 -stderr 250 -stdout 251 -stderr 251 -stdout 252 -stderr 252 -stdout 253 -stderr 253 -stdout 254 -stderr 254 -stdout 255 -stderr 255 -stdout 256 -stderr 256 -stdout 257 -stderr 257 -stdout 258 -stderr 258 -stdout 259 -stderr 259 -stdout 260 -stderr 260 -stdout 261 -stderr 261 -stdout 262 -stderr 262 -stdout 263 -stderr 263 -stdout 264 -stderr 264 -stdout 265 -stderr 265 -stdout 266 -stderr 266 -stdout 267 -stderr 267 -stdout 268 -stderr 268 -stdout 269 -stderr 269 -stdout 270 -stderr 270 -stdout 271 -stderr 271 -stdout 272 -stderr 272 -stdout 273 -stderr 273 -stdout 274 -stderr 274 -stdout 275 -stderr 275 -stdout 276 -stderr 276 -stdout 277 -stderr 277 -stdout 278 -stderr 278 -stdout 279 -stderr 279 -stdout 280 -stderr 280 -stdout 281 -stderr 281 -stdout 282 -stderr 282 -stdout 283 -stderr 283 -stdout 284 -stderr 284 -stdout 285 -stderr 285 -stdout 286 -stderr 286 -stdout 287 -stderr 287 -stdout 288 -stderr 288 -stdout 289 -stderr 289 -stdout 290 -stderr 290 -stdout 291 -stderr 291 -stdout 292 -stderr 292 -stdout 293 -stderr 293 -stdout 294 -stderr 294 -stdout 295 -stderr 295 -stdout 296 -stderr 296 -stdout 297 -stderr 297 -stdout 298 -stderr 298 -stdout 299 -stderr 299 -stdout 300 -stderr 300 -stdout 301 -stderr 301 -stdout 302 -stderr 302 -stdout 303 -stderr 303 -stdout 304 -stderr 304 -stdout 305 -stderr 305 -stdout 306 -stderr 306 -stdout 307 -stderr 307 -stdout 308 -stderr 308 -stdout 309 -stderr 309 -stdout 310 -stderr 310 -stdout 311 -stderr 311 -stdout 312 -stderr 312 -stdout 313 -stderr 313 -stdout 314 -stderr 314 -stdout 315 -stderr 315 -stdout 316 -stderr 316 -stdout 317 -stderr 317 -stdout 318 -stderr 318 -stdout 319 -stderr 319 -stdout 320 -stderr 320 -stdout 321 -stderr 321 -stdout 322 -stderr 322 -stdout 323 -stderr 323 -stdout 324 -stderr 324 -stdout 325 -stderr 325 -stdout 326 -stderr 326 -stdout 327 -stderr 327 -stdout 328 -stderr 328 -stdout 329 -stderr 329 -stdout 330 -stderr 330 -stdout 331 -stderr 331 -stdout 332 -stderr 332 -stdout 333 -stderr 333 -stdout 334 -stderr 334 -stdout 335 -stderr 335 -stdout 336 -stderr 336 -stdout 337 -stderr 337 -stdout 338 -stderr 338 -stdout 339 -stderr 339 -stdout 340 -stderr 340 -stdout 341 -stderr 341 -stdout 342 -stderr 342 -stdout 343 -stderr 343 -stdout 344 -stderr 344 -stdout 345 -stderr 345 -stdout 346 -stderr 346 -stdout 347 -stderr 347 -stdout 348 -stderr 348 -stdout 349 -stderr 349 -stdout 350 -stderr 350 -stdout 351 -stderr 351 -stdout 352 -stderr 352 -stdout 353 -stderr 353 -stdout 354 -stderr 354 -stdout 355 -stderr 355 -stdout 356 -stderr 356 -stdout 357 -stderr 357 -stdout 358 -stderr 358 -stdout 359 -stderr 359 -stdout 360 -stderr 360 -stdout 361 -stderr 361 -stdout 362 -stderr 362 -stdout 363 -stderr 363 -stdout 364 -stderr 364 -stdout 365 -stderr 365 -stdout 366 -stderr 366 -stdout 367 -stderr 367 -stdout 368 -stderr 368 -stdout 369 -stderr 369 -stdout 370 -stderr 370 -stdout 371 -stderr 371 -stdout 372 -stderr 372 -stdout 373 -stderr 373 -stdout 374 -stderr 374 -stdout 375 -stderr 375 -stdout 376 -stderr 376 -stdout 377 -stderr 377 -stdout 378 -stderr 378 -stdout 379 -stderr 379 -stdout 380 -stderr 380 -stdout 381 -stderr 381 -stdout 382 -stderr 382 -stdout 383 -stderr 383 -stdout 384 -stderr 384 -stdout 385 -stderr 385 -stdout 386 -stderr 386 -stdout 387 -stderr 387 -stdout 388 -stderr 388 -stdout 389 -stderr 389 -stdout 390 -stderr 390 -stdout 391 -stderr 391 -stdout 392 -stderr 392 -stdout 393 -stderr 393 -stdout 394 -stderr 394 -stdout 395 -stderr 395 -stdout 396 -stderr 396 -stdout 397 -stderr 397 -stdout 398 -stderr 398 -stdout 399 -stderr 399 -stdout 400 -stderr 400 -stdout 401 -stderr 401 -stdout 402 -stderr 402 -stdout 403 -stderr 403 -stdout 404 -stderr 404 -stdout 405 -stderr 405 -stdout 406 -stderr 406 -stdout 407 -stderr 407 -stdout 408 -stderr 408 -stdout 409 -stderr 409 -stdout 410 -stderr 410 -stdout 411 -stderr 411 -stdout 412 -stderr 412 -stdout 413 -stderr 413 -stdout 414 -stderr 414 -stdout 415 -stderr 415 -stdout 416 -stderr 416 -stdout 417 -stderr 417 -stdout 418 -stderr 418 -stdout 419 -stderr 419 -stdout 420 -stderr 420 -stdout 421 -stderr 421 -stdout 422 -stderr 422 -stdout 423 -stderr 423 -stdout 424 -stderr 424 -stdout 425 -stderr 425 -stdout 426 -stderr 426 -stdout 427 -stderr 427 -stdout 428 -stderr 428 -stdout 429 -stderr 429 -stdout 430 -stderr 430 -stdout 431 -stderr 431 -stdout 432 -stderr 432 -stdout 433 -stderr 433 -stdout 434 -stderr 434 -stdout 435 -stderr 435 -stdout 436 -stderr 436 -stdout 437 -stderr 437 -stdout 438 -stderr 438 -stdout 439 -stderr 439 -stdout 440 -stderr 440 -stdout 441 -stderr 441 -stdout 442 -stderr 442 -stdout 443 -stderr 443 -stdout 444 -stderr 444 -stdout 445 -stderr 445 -stdout 446 -stderr 446 -stdout 447 -stderr 447 -stdout 448 -stderr 448 -stdout 449 -stderr 449 -stdout 450 -stderr 450 -stdout 451 -stderr 451 -stdout 452 -stderr 452 -stdout 453 -stderr 453 -stdout 454 -stderr 454 -stdout 455 -stderr 455 -stdout 456 -stderr 456 -stdout 457 -stderr 457 -stdout 458 -stderr 458 -stdout 459 -stderr 459 -stdout 460 -stderr 460 -stdout 461 -stderr 461 -stdout 462 -stderr 462 -stdout 463 -stderr 463 -stdout 464 -stderr 464 -stdout 465 -stderr 465 -stdout 466 -stderr 466 -stdout 467 -stderr 467 -stdout 468 -stderr 468 -stdout 469 -stderr 469 -stdout 470 -stderr 470 -stdout 471 -stderr 471 -stdout 472 -stderr 472 -stdout 473 -stderr 473 -stdout 474 -stderr 474 -stdout 475 -stderr 475 -stdout 476 -stderr 476 -stdout 477 -stderr 477 -stdout 478 -stderr 478 -stdout 479 -stderr 479 -stdout 480 -stderr 480 -stdout 481 -stderr 481 -stdout 482 -stderr 482 -stdout 483 -stderr 483 -stdout 484 -stderr 484 -stdout 485 -stderr 485 -stdout 486 -stderr 486 -stdout 487 -stderr 487 -stdout 488 -stderr 488 -stdout 489 -stderr 489 -stdout 490 -stderr 490 -stdout 491 -stderr 491 -stdout 492 -stderr 492 -stdout 493 -stderr 493 -stdout 494 -stderr 494 -stdout 495 -stderr 495 -stdout 496 -stderr 496 -stdout 497 -stderr 497 -stdout 498 -stderr 498 -stdout 499 -stderr 499 -stdout 500 -stderr 500 -stdout 501 -stderr 501 -stdout 502 -stderr 502 -stdout 503 -stderr 503 -stdout 504 -stderr 504 -stdout 505 -stderr 505 -stdout 506 -stderr 506 -stdout 507 -stderr 507 -stdout 508 -stderr 508 -stdout 509 -stderr 509 -stdout 510 -stderr 510 -stdout 511 -stderr 511 -stdout 512 -stderr 512 -stdout 513 -stderr 513 -stdout 514 -stderr 514 -stdout 515 -stderr 515 -stdout 516 -stderr 516 -stdout 517 -stderr 517 -stdout 518 -stderr 518 -stdout 519 -stderr 519 -stdout 520 -stderr 520 -stdout 521 -stderr 521 -stdout 522 -stderr 522 -stdout 523 -stderr 523 -stdout 524 -stderr 524 -stdout 525 -stderr 525 -stdout 526 -stderr 526 -stdout 527 -stderr 527 -stdout 528 -stderr 528 -stdout 529 -stderr 529 -stdout 530 -stderr 530 -stdout 531 -stderr 531 -stdout 532 -stderr 532 -stdout 533 -stderr 533 -stdout 534 -stderr 534 -stdout 535 -stderr 535 -stdout 536 -stderr 536 -stdout 537 -stderr 537 -stdout 538 -stderr 538 -stdout 539 -stderr 539 -stdout 540 -stderr 540 -stdout 541 -stderr 541 -stdout 542 -stderr 542 -stdout 543 -stderr 543 -stdout 544 -stderr 544 -stdout 545 -stderr 545 -stdout 546 -stderr 546 -stdout 547 -stderr 547 -stdout 548 -stderr 548 -stdout 549 -stderr 549 -stdout 550 -stderr 550 -stdout 551 -stderr 551 -stdout 552 -stderr 552 -stdout 553 -stderr 553 -stdout 554 -stderr 554 -stdout 555 -stderr 555 -stdout 556 -stderr 556 -stdout 557 -stderr 557 -stdout 558 -stderr 558 -stdout 559 -stderr 559 -stdout 560 -stderr 560 -stdout 561 -stderr 561 -stdout 562 -stderr 562 -stdout 563 -stderr 563 -stdout 564 -stderr 564 -stdout 565 -stderr 565 -stdout 566 -stderr 566 -stdout 567 -stderr 567 -stdout 568 -stderr 568 -stdout 569 -stderr 569 -stdout 570 -stderr 570 -stdout 571 -stderr 571 -stdout 572 -stderr 572 -stdout 573 -stderr 573 -stdout 574 -stderr 574 -stdout 575 -stderr 575 -stdout 576 -stderr 576 -stdout 577 -stderr 577 -stdout 578 -stderr 578 -stdout 579 -stderr 579 -stdout 580 -stderr 580 -stdout 581 -stderr 581 -stdout 582 -stderr 582 -stdout 583 -stderr 583 -stdout 584 -stderr 584 -stdout 585 -stderr 585 -stdout 586 -stderr 586 -stdout 587 -stderr 587 -stdout 588 -stderr 588 -stdout 589 -stderr 589 -stdout 590 -stderr 590 -stdout 591 -stderr 591 -stdout 592 -stderr 592 -stdout 593 -stderr 593 -stdout 594 -stderr 594 -stdout 595 -stderr 595 -stdout 596 -stderr 596 -stdout 597 -stderr 597 -stdout 598 -stderr 598 -stdout 599 -stderr 599 -stdout 600 -stderr 600 -stdout 601 -stderr 601 -stdout 602 -stderr 602 -stdout 603 -stderr 603 -stdout 604 -stderr 604 -stdout 605 -stderr 605 -stdout 606 -stderr 606 -stdout 607 -stderr 607 -stdout 608 -stderr 608 -stdout 609 -stderr 609 -stdout 610 -stderr 610 -stdout 611 -stderr 611 -stdout 612 -stderr 612 -stdout 613 -stderr 613 -stdout 614 -stderr 614 -stdout 615 -stderr 615 -stdout 616 -stderr 616 -stdout 617 -stderr 617 -stdout 618 -stderr 618 -stdout 619 -stderr 619 -stdout 620 -stderr 620 -stdout 621 -stderr 621 -stdout 622 -stderr 622 -stdout 623 -stderr 623 -stdout 624 -stderr 624 -stdout 625 -stderr 625 -stdout 626 -stderr 626 -stdout 627 -stderr 627 -stdout 628 -stderr 628 -stdout 629 -stderr 629 -stdout 630 -stderr 630 -stdout 631 -stderr 631 -stdout 632 -stderr 632 -stdout 633 -stderr 633 -stdout 634 -stderr 634 -stdout 635 -stderr 635 -stdout 636 -stderr 636 -stdout 637 -stderr 637 -stdout 638 -stderr 638 -stdout 639 -stderr 639 -stdout 640 -stderr 640 -stdout 641 -stderr 641 -stdout 642 -stderr 642 -stdout 643 -stderr 643 -stdout 644 -stderr 644 -stdout 645 -stderr 645 -stdout 646 -stderr 646 -stdout 647 -stderr 647 -stdout 648 -stderr 648 -stdout 649 -stderr 649 -stdout 650 -stderr 650 -stdout 651 -stderr 651 -stdout 652 -stderr 652 -stdout 653 -stderr 653 -stdout 654 -stderr 654 -stdout 655 -stderr 655 -stdout 656 -stderr 656 -stdout 657 -stderr 657 -stdout 658 -stderr 658 -stdout 659 -stderr 659 -stdout 660 -stderr 660 -stdout 661 -stderr 661 -stdout 662 -stderr 662 -stdout 663 -stderr 663 -stdout 664 -stderr 664 -stdout 665 -stderr 665 -stdout 666 -stderr 666 -stdout 667 -stderr 667 -stdout 668 -stderr 668 -stdout 669 -stderr 669 -stdout 670 -stderr 670 -stdout 671 -stderr 671 -stdout 672 -stderr 672 -stdout 673 -stderr 673 -stdout 674 -stderr 674 -stdout 675 -stderr 675 -stdout 676 -stderr 676 -stdout 677 -stderr 677 -stdout 678 -stderr 678 -stdout 679 -stderr 679 -stdout 680 -stderr 680 -stdout 681 -stderr 681 -stdout 682 -stderr 682 -stdout 683 -stderr 683 -stdout 684 -stderr 684 -stdout 685 -stderr 685 -stdout 686 -stderr 686 -stdout 687 -stderr 687 -stdout 688 -stderr 688 -stdout 689 -stderr 689 -stdout 690 -stderr 690 -stdout 691 -stderr 691 -stdout 692 -stderr 692 -stdout 693 -stderr 693 -stdout 694 -stderr 694 -stdout 695 -stderr 695 -stdout 696 -stderr 696 -stdout 697 -stderr 697 -stdout 698 -stderr 698 -stdout 699 -stderr 699 -stdout 700 -stderr 700 -stdout 701 -stderr 701 -stdout 702 -stderr 702 -stdout 703 -stderr 703 -stdout 704 -stderr 704 -stdout 705 -stderr 705 -stdout 706 -stderr 706 -stdout 707 -stderr 707 -stdout 708 -stderr 708 -stdout 709 -stderr 709 -stdout 710 -stderr 710 -stdout 711 -stderr 711 -stdout 712 -stderr 712 -stdout 713 -stderr 713 -stdout 714 -stderr 714 -stdout 715 -stderr 715 -stdout 716 -stderr 716 -stdout 717 -stderr 717 -stdout 718 -stderr 718 -stdout 719 -stderr 719 -stdout 720 -stderr 720 -stdout 721 -stderr 721 -stdout 722 -stderr 722 -stdout 723 -stderr 723 -stdout 724 -stderr 724 -stdout 725 -stderr 725 -stdout 726 -stderr 726 -stdout 727 -stderr 727 -stdout 728 -stderr 728 -stdout 729 -stderr 729 -stdout 730 -stderr 730 -stdout 731 -stderr 731 -stdout 732 -stderr 732 -stdout 733 -stderr 733 -stdout 734 -stderr 734 -stdout 735 -stderr 735 -stdout 736 -stderr 736 -stdout 737 -stderr 737 -stdout 738 -stderr 738 -stdout 739 -stderr 739 -stdout 740 -stderr 740 -stdout 741 -stderr 741 -stdout 742 -stderr 742 -stdout 743 -stderr 743 -stdout 744 -stderr 744 -stdout 745 -stderr 745 -stdout 746 -stderr 746 -stdout 747 -stderr 747 -stdout 748 -stderr 748 -stdout 749 -stderr 749 -stdout 750 -stderr 750 -stdout 751 -stderr 751 -stdout 752 -stderr 752 -stdout 753 -stderr 753 -stdout 754 -stderr 754 -stdout 755 -stderr 755 -stdout 756 -stderr 756 -stdout 757 -stderr 757 -stdout 758 -stderr 758 -stdout 759 -stderr 759 -stdout 760 -stderr 760 -stdout 761 -stderr 761 -stdout 762 -stderr 762 -stdout 763 -stderr 763 -stdout 764 -stderr 764 -stdout 765 -stderr 765 -stdout 766 -stderr 766 -stdout 767 -stderr 767 -stdout 768 -stderr 768 -stdout 769 -stderr 769 -stdout 770 -stderr 770 -stdout 771 -stderr 771 -stdout 772 -stderr 772 -stdout 773 -stderr 773 -stdout 774 -stderr 774 -stdout 775 -stderr 775 -stdout 776 -stderr 776 -stdout 777 -stderr 777 -stdout 778 -stderr 778 -stdout 779 -stderr 779 -stdout 780 -stderr 780 -stdout 781 -stderr 781 -stdout 782 -stderr 782 -stdout 783 -stderr 783 -stdout 784 -stderr 784 -stdout 785 -stderr 785 -stdout 786 -stderr 786 -stdout 787 -stderr 787 -stdout 788 -stderr 788 -stdout 789 -stderr 789 -stdout 790 -stderr 790 -stdout 791 -stderr 791 -stdout 792 -stderr 792 -stdout 793 -stderr 793 -stdout 794 -stderr 794 -stdout 795 -stderr 795 -stdout 796 -stderr 796 -stdout 797 -stderr 797 -stdout 798 -stderr 798 -stdout 799 -stderr 799 -stdout 800 -stderr 800 -stdout 801 -stderr 801 -stdout 802 -stderr 802 -stdout 803 -stderr 803 -stdout 804 -stderr 804 -stdout 805 -stderr 805 -stdout 806 -stderr 806 -stdout 807 -stderr 807 -stdout 808 -stderr 808 -stdout 809 -stderr 809 -stdout 810 -stderr 810 -stdout 811 -stderr 811 -stdout 812 -stderr 812 -stdout 813 -stderr 813 -stdout 814 -stderr 814 -stdout 815 -stderr 815 -stdout 816 -stderr 816 -stdout 817 -stderr 817 -stdout 818 -stderr 818 -stdout 819 -stderr 819 -stdout 820 -stderr 820 -stdout 821 -stderr 821 -stdout 822 -stderr 822 -stdout 823 -stderr 823 -stdout 824 -stderr 824 -stdout 825 -stderr 825 -stdout 826 -stderr 826 -stdout 827 -stderr 827 -stdout 828 -stderr 828 -stdout 829 -stderr 829 -stdout 830 -stderr 830 -stdout 831 -stderr 831 -stdout 832 -stderr 832 -stdout 833 -stderr 833 -stdout 834 -stderr 834 -stdout 835 -stderr 835 -stdout 836 -stderr 836 -stdout 837 -stderr 837 -stdout 838 -stderr 838 -stdout 839 -stderr 839 -stdout 840 -stderr 840 -stdout 841 -stderr 841 -stdout 842 -stderr 842 -stdout 843 -stderr 843 -stdout 844 -stderr 844 -stdout 845 -stderr 845 -stdout 846 -stderr 846 -stdout 847 -stderr 847 -stdout 848 -stderr 848 -stdout 849 -stderr 849 -stdout 850 -stderr 850 -stdout 851 -stderr 851 -stdout 852 -stderr 852 -stdout 853 -stderr 853 -stdout 854 -stderr 854 -stdout 855 -stderr 855 -stdout 856 -stderr 856 -stdout 857 -stderr 857 -stdout 858 -stderr 858 -stdout 859 -stderr 859 -stdout 860 -stderr 860 -stdout 861 -stderr 861 -stdout 862 -stderr 862 -stdout 863 -stderr 863 -stdout 864 -stderr 864 -stdout 865 -stderr 865 -stdout 866 -stderr 866 -stdout 867 -stderr 867 -stdout 868 -stderr 868 -stdout 869 -stderr 869 -stdout 870 -stderr 870 -stdout 871 -stderr 871 -stdout 872 -stderr 872 -stdout 873 -stderr 873 -stdout 874 -stderr 874 -stdout 875 -stderr 875 -stdout 876 -stderr 876 -stdout 877 -stderr 877 -stdout 878 -stderr 878 -stdout 879 -stderr 879 -stdout 880 -stderr 880 -stdout 881 -stderr 881 -stdout 882 -stderr 882 -stdout 883 -stderr 883 -stdout 884 -stderr 884 -stdout 885 -stderr 885 -stdout 886 -stderr 886 -stdout 887 -stderr 887 -stdout 888 -stderr 888 -stdout 889 -stderr 889 -stdout 890 -stderr 890 -stdout 891 -stderr 891 -stdout 892 -stderr 892 -stdout 893 -stderr 893 -stdout 894 -stderr 894 -stdout 895 -stderr 895 -stdout 896 -stderr 896 -stdout 897 -stderr 897 -stdout 898 -stderr 898 -stdout 899 -stderr 899 -stdout 900 -stderr 900 -stdout 901 -stderr 901 -stdout 902 -stderr 902 -stdout 903 -stderr 903 -stdout 904 -stderr 904 -stdout 905 -stderr 905 -stdout 906 -stderr 906 -stdout 907 -stderr 907 -stdout 908 -stderr 908 -stdout 909 -stderr 909 -stdout 910 -stderr 910 -stdout 911 -stderr 911 -stdout 912 -stderr 912 -stdout 913 -stderr 913 -stdout 914 -stderr 914 -stdout 915 -stderr 915 -stdout 916 -stderr 916 -stdout 917 -stderr 917 -stdout 918 -stderr 918 -stdout 919 -stderr 919 -stdout 920 -stderr 920 -stdout 921 -stderr 921 -stdout 922 -stderr 922 -stdout 923 -stderr 923 -stdout 924 -stderr 924 -stdout 925 -stderr 925 -stdout 926 -stderr 926 -stdout 927 -stderr 927 -stdout 928 -stderr 928 -stdout 929 -stderr 929 -stdout 930 -stderr 930 -stdout 931 -stderr 931 -stdout 932 -stderr 932 -stdout 933 -stderr 933 -stdout 934 -stderr 934 -stdout 935 -stderr 935 -stdout 936 -stderr 936 -stdout 937 -stderr 937 -stdout 938 -stderr 938 -stdout 939 -stderr 939 -stdout 940 -stderr 940 -stdout 941 -stderr 941 -stdout 942 -stderr 942 -stdout 943 -stderr 943 -stdout 944 -stderr 944 -stdout 945 -stderr 945 -stdout 946 -stderr 946 -stdout 947 -stderr 947 -stdout 948 -stderr 948 -stdout 949 -stderr 949 -stdout 950 -stderr 950 -stdout 951 -stderr 951 -stdout 952 -stderr 952 -stdout 953 -stderr 953 -stdout 954 -stderr 954 -stdout 955 -stderr 955 -stdout 956 -stderr 956 -stdout 957 -stderr 957 -stdout 958 -stderr 958 -stdout 959 -stderr 959 -stdout 960 -stderr 960 -stdout 961 -stderr 961 -stdout 962 -stderr 962 -stdout 963 -stderr 963 -stdout 964 -stderr 964 -stdout 965 -stderr 965 -stdout 966 -stderr 966 -stdout 967 -stderr 967 -stdout 968 -stderr 968 -stdout 969 -stderr 969 -stdout 970 -stderr 970 -stdout 971 -stderr 971 -stdout 972 -stderr 972 -stdout 973 -stderr 973 -stdout 974 -stderr 974 -stdout 975 -stderr 975 -stdout 976 -stderr 976 -stdout 977 -stderr 977 -stdout 978 -stderr 978 -stdout 979 -stderr 979 -stdout 980 -stderr 980 -stdout 981 -stderr 981 -stdout 982 -stderr 982 -stdout 983 -stderr 983 -stdout 984 -stderr 984 -stdout 985 -stderr 985 -stdout 986 -stderr 986 -stdout 987 -stderr 987 -stdout 988 -stderr 988 -stdout 989 -stderr 989 -stdout 990 -stderr 990 -stdout 991 -stderr 991 -stdout 992 -stderr 992 -stdout 993 -stderr 993 -stdout 994 -stderr 994 -stdout 995 -stderr 995 -stdout 996 -stderr 996 -stdout 997 -stderr 997 -stdout 998 -stderr 998 -stdout 999 -stderr 999 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout.txt b/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout.txt deleted file mode 100644 index d3649d0..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout.txt +++ /dev/null @@ -1,1000 +0,0 @@ -stdout 0 -stdout 1 -stdout 2 -stdout 3 -stdout 4 -stdout 5 -stdout 6 -stdout 7 -stdout 8 -stdout 9 -stdout 10 -stdout 11 -stdout 12 -stdout 13 -stdout 14 -stdout 15 -stdout 16 -stdout 17 -stdout 18 -stdout 19 -stdout 20 -stdout 21 -stdout 22 -stdout 23 -stdout 24 -stdout 25 -stdout 26 -stdout 27 -stdout 28 -stdout 29 -stdout 30 -stdout 31 -stdout 32 -stdout 33 -stdout 34 -stdout 35 -stdout 36 -stdout 37 -stdout 38 -stdout 39 -stdout 40 -stdout 41 -stdout 42 -stdout 43 -stdout 44 -stdout 45 -stdout 46 -stdout 47 -stdout 48 -stdout 49 -stdout 50 -stdout 51 -stdout 52 -stdout 53 -stdout 54 -stdout 55 -stdout 56 -stdout 57 -stdout 58 -stdout 59 -stdout 60 -stdout 61 -stdout 62 -stdout 63 -stdout 64 -stdout 65 -stdout 66 -stdout 67 -stdout 68 -stdout 69 -stdout 70 -stdout 71 -stdout 72 -stdout 73 -stdout 74 -stdout 75 -stdout 76 -stdout 77 -stdout 78 -stdout 79 -stdout 80 -stdout 81 -stdout 82 -stdout 83 -stdout 84 -stdout 85 -stdout 86 -stdout 87 -stdout 88 -stdout 89 -stdout 90 -stdout 91 -stdout 92 -stdout 93 -stdout 94 -stdout 95 -stdout 96 -stdout 97 -stdout 98 -stdout 99 -stdout 100 -stdout 101 -stdout 102 -stdout 103 -stdout 104 -stdout 105 -stdout 106 -stdout 107 -stdout 108 -stdout 109 -stdout 110 -stdout 111 -stdout 112 -stdout 113 -stdout 114 -stdout 115 -stdout 116 -stdout 117 -stdout 118 -stdout 119 -stdout 120 -stdout 121 -stdout 122 -stdout 123 -stdout 124 -stdout 125 -stdout 126 -stdout 127 -stdout 128 -stdout 129 -stdout 130 -stdout 131 -stdout 132 -stdout 133 -stdout 134 -stdout 135 -stdout 136 -stdout 137 -stdout 138 -stdout 139 -stdout 140 -stdout 141 -stdout 142 -stdout 143 -stdout 144 -stdout 145 -stdout 146 -stdout 147 -stdout 148 -stdout 149 -stdout 150 -stdout 151 -stdout 152 -stdout 153 -stdout 154 -stdout 155 -stdout 156 -stdout 157 -stdout 158 -stdout 159 -stdout 160 -stdout 161 -stdout 162 -stdout 163 -stdout 164 -stdout 165 -stdout 166 -stdout 167 -stdout 168 -stdout 169 -stdout 170 -stdout 171 -stdout 172 -stdout 173 -stdout 174 -stdout 175 -stdout 176 -stdout 177 -stdout 178 -stdout 179 -stdout 180 -stdout 181 -stdout 182 -stdout 183 -stdout 184 -stdout 185 -stdout 186 -stdout 187 -stdout 188 -stdout 189 -stdout 190 -stdout 191 -stdout 192 -stdout 193 -stdout 194 -stdout 195 -stdout 196 -stdout 197 -stdout 198 -stdout 199 -stdout 200 -stdout 201 -stdout 202 -stdout 203 -stdout 204 -stdout 205 -stdout 206 -stdout 207 -stdout 208 -stdout 209 -stdout 210 -stdout 211 -stdout 212 -stdout 213 -stdout 214 -stdout 215 -stdout 216 -stdout 217 -stdout 218 -stdout 219 -stdout 220 -stdout 221 -stdout 222 -stdout 223 -stdout 224 -stdout 225 -stdout 226 -stdout 227 -stdout 228 -stdout 229 -stdout 230 -stdout 231 -stdout 232 -stdout 233 -stdout 234 -stdout 235 -stdout 236 -stdout 237 -stdout 238 -stdout 239 -stdout 240 -stdout 241 -stdout 242 -stdout 243 -stdout 244 -stdout 245 -stdout 246 -stdout 247 -stdout 248 -stdout 249 -stdout 250 -stdout 251 -stdout 252 -stdout 253 -stdout 254 -stdout 255 -stdout 256 -stdout 257 -stdout 258 -stdout 259 -stdout 260 -stdout 261 -stdout 262 -stdout 263 -stdout 264 -stdout 265 -stdout 266 -stdout 267 -stdout 268 -stdout 269 -stdout 270 -stdout 271 -stdout 272 -stdout 273 -stdout 274 -stdout 275 -stdout 276 -stdout 277 -stdout 278 -stdout 279 -stdout 280 -stdout 281 -stdout 282 -stdout 283 -stdout 284 -stdout 285 -stdout 286 -stdout 287 -stdout 288 -stdout 289 -stdout 290 -stdout 291 -stdout 292 -stdout 293 -stdout 294 -stdout 295 -stdout 296 -stdout 297 -stdout 298 -stdout 299 -stdout 300 -stdout 301 -stdout 302 -stdout 303 -stdout 304 -stdout 305 -stdout 306 -stdout 307 -stdout 308 -stdout 309 -stdout 310 -stdout 311 -stdout 312 -stdout 313 -stdout 314 -stdout 315 -stdout 316 -stdout 317 -stdout 318 -stdout 319 -stdout 320 -stdout 321 -stdout 322 -stdout 323 -stdout 324 -stdout 325 -stdout 326 -stdout 327 -stdout 328 -stdout 329 -stdout 330 -stdout 331 -stdout 332 -stdout 333 -stdout 334 -stdout 335 -stdout 336 -stdout 337 -stdout 338 -stdout 339 -stdout 340 -stdout 341 -stdout 342 -stdout 343 -stdout 344 -stdout 345 -stdout 346 -stdout 347 -stdout 348 -stdout 349 -stdout 350 -stdout 351 -stdout 352 -stdout 353 -stdout 354 -stdout 355 -stdout 356 -stdout 357 -stdout 358 -stdout 359 -stdout 360 -stdout 361 -stdout 362 -stdout 363 -stdout 364 -stdout 365 -stdout 366 -stdout 367 -stdout 368 -stdout 369 -stdout 370 -stdout 371 -stdout 372 -stdout 373 -stdout 374 -stdout 375 -stdout 376 -stdout 377 -stdout 378 -stdout 379 -stdout 380 -stdout 381 -stdout 382 -stdout 383 -stdout 384 -stdout 385 -stdout 386 -stdout 387 -stdout 388 -stdout 389 -stdout 390 -stdout 391 -stdout 392 -stdout 393 -stdout 394 -stdout 395 -stdout 396 -stdout 397 -stdout 398 -stdout 399 -stdout 400 -stdout 401 -stdout 402 -stdout 403 -stdout 404 -stdout 405 -stdout 406 -stdout 407 -stdout 408 -stdout 409 -stdout 410 -stdout 411 -stdout 412 -stdout 413 -stdout 414 -stdout 415 -stdout 416 -stdout 417 -stdout 418 -stdout 419 -stdout 420 -stdout 421 -stdout 422 -stdout 423 -stdout 424 -stdout 425 -stdout 426 -stdout 427 -stdout 428 -stdout 429 -stdout 430 -stdout 431 -stdout 432 -stdout 433 -stdout 434 -stdout 435 -stdout 436 -stdout 437 -stdout 438 -stdout 439 -stdout 440 -stdout 441 -stdout 442 -stdout 443 -stdout 444 -stdout 445 -stdout 446 -stdout 447 -stdout 448 -stdout 449 -stdout 450 -stdout 451 -stdout 452 -stdout 453 -stdout 454 -stdout 455 -stdout 456 -stdout 457 -stdout 458 -stdout 459 -stdout 460 -stdout 461 -stdout 462 -stdout 463 -stdout 464 -stdout 465 -stdout 466 -stdout 467 -stdout 468 -stdout 469 -stdout 470 -stdout 471 -stdout 472 -stdout 473 -stdout 474 -stdout 475 -stdout 476 -stdout 477 -stdout 478 -stdout 479 -stdout 480 -stdout 481 -stdout 482 -stdout 483 -stdout 484 -stdout 485 -stdout 486 -stdout 487 -stdout 488 -stdout 489 -stdout 490 -stdout 491 -stdout 492 -stdout 493 -stdout 494 -stdout 495 -stdout 496 -stdout 497 -stdout 498 -stdout 499 -stdout 500 -stdout 501 -stdout 502 -stdout 503 -stdout 504 -stdout 505 -stdout 506 -stdout 507 -stdout 508 -stdout 509 -stdout 510 -stdout 511 -stdout 512 -stdout 513 -stdout 514 -stdout 515 -stdout 516 -stdout 517 -stdout 518 -stdout 519 -stdout 520 -stdout 521 -stdout 522 -stdout 523 -stdout 524 -stdout 525 -stdout 526 -stdout 527 -stdout 528 -stdout 529 -stdout 530 -stdout 531 -stdout 532 -stdout 533 -stdout 534 -stdout 535 -stdout 536 -stdout 537 -stdout 538 -stdout 539 -stdout 540 -stdout 541 -stdout 542 -stdout 543 -stdout 544 -stdout 545 -stdout 546 -stdout 547 -stdout 548 -stdout 549 -stdout 550 -stdout 551 -stdout 552 -stdout 553 -stdout 554 -stdout 555 -stdout 556 -stdout 557 -stdout 558 -stdout 559 -stdout 560 -stdout 561 -stdout 562 -stdout 563 -stdout 564 -stdout 565 -stdout 566 -stdout 567 -stdout 568 -stdout 569 -stdout 570 -stdout 571 -stdout 572 -stdout 573 -stdout 574 -stdout 575 -stdout 576 -stdout 577 -stdout 578 -stdout 579 -stdout 580 -stdout 581 -stdout 582 -stdout 583 -stdout 584 -stdout 585 -stdout 586 -stdout 587 -stdout 588 -stdout 589 -stdout 590 -stdout 591 -stdout 592 -stdout 593 -stdout 594 -stdout 595 -stdout 596 -stdout 597 -stdout 598 -stdout 599 -stdout 600 -stdout 601 -stdout 602 -stdout 603 -stdout 604 -stdout 605 -stdout 606 -stdout 607 -stdout 608 -stdout 609 -stdout 610 -stdout 611 -stdout 612 -stdout 613 -stdout 614 -stdout 615 -stdout 616 -stdout 617 -stdout 618 -stdout 619 -stdout 620 -stdout 621 -stdout 622 -stdout 623 -stdout 624 -stdout 625 -stdout 626 -stdout 627 -stdout 628 -stdout 629 -stdout 630 -stdout 631 -stdout 632 -stdout 633 -stdout 634 -stdout 635 -stdout 636 -stdout 637 -stdout 638 -stdout 639 -stdout 640 -stdout 641 -stdout 642 -stdout 643 -stdout 644 -stdout 645 -stdout 646 -stdout 647 -stdout 648 -stdout 649 -stdout 650 -stdout 651 -stdout 652 -stdout 653 -stdout 654 -stdout 655 -stdout 656 -stdout 657 -stdout 658 -stdout 659 -stdout 660 -stdout 661 -stdout 662 -stdout 663 -stdout 664 -stdout 665 -stdout 666 -stdout 667 -stdout 668 -stdout 669 -stdout 670 -stdout 671 -stdout 672 -stdout 673 -stdout 674 -stdout 675 -stdout 676 -stdout 677 -stdout 678 -stdout 679 -stdout 680 -stdout 681 -stdout 682 -stdout 683 -stdout 684 -stdout 685 -stdout 686 -stdout 687 -stdout 688 -stdout 689 -stdout 690 -stdout 691 -stdout 692 -stdout 693 -stdout 694 -stdout 695 -stdout 696 -stdout 697 -stdout 698 -stdout 699 -stdout 700 -stdout 701 -stdout 702 -stdout 703 -stdout 704 -stdout 705 -stdout 706 -stdout 707 -stdout 708 -stdout 709 -stdout 710 -stdout 711 -stdout 712 -stdout 713 -stdout 714 -stdout 715 -stdout 716 -stdout 717 -stdout 718 -stdout 719 -stdout 720 -stdout 721 -stdout 722 -stdout 723 -stdout 724 -stdout 725 -stdout 726 -stdout 727 -stdout 728 -stdout 729 -stdout 730 -stdout 731 -stdout 732 -stdout 733 -stdout 734 -stdout 735 -stdout 736 -stdout 737 -stdout 738 -stdout 739 -stdout 740 -stdout 741 -stdout 742 -stdout 743 -stdout 744 -stdout 745 -stdout 746 -stdout 747 -stdout 748 -stdout 749 -stdout 750 -stdout 751 -stdout 752 -stdout 753 -stdout 754 -stdout 755 -stdout 756 -stdout 757 -stdout 758 -stdout 759 -stdout 760 -stdout 761 -stdout 762 -stdout 763 -stdout 764 -stdout 765 -stdout 766 -stdout 767 -stdout 768 -stdout 769 -stdout 770 -stdout 771 -stdout 772 -stdout 773 -stdout 774 -stdout 775 -stdout 776 -stdout 777 -stdout 778 -stdout 779 -stdout 780 -stdout 781 -stdout 782 -stdout 783 -stdout 784 -stdout 785 -stdout 786 -stdout 787 -stdout 788 -stdout 789 -stdout 790 -stdout 791 -stdout 792 -stdout 793 -stdout 794 -stdout 795 -stdout 796 -stdout 797 -stdout 798 -stdout 799 -stdout 800 -stdout 801 -stdout 802 -stdout 803 -stdout 804 -stdout 805 -stdout 806 -stdout 807 -stdout 808 -stdout 809 -stdout 810 -stdout 811 -stdout 812 -stdout 813 -stdout 814 -stdout 815 -stdout 816 -stdout 817 -stdout 818 -stdout 819 -stdout 820 -stdout 821 -stdout 822 -stdout 823 -stdout 824 -stdout 825 -stdout 826 -stdout 827 -stdout 828 -stdout 829 -stdout 830 -stdout 831 -stdout 832 -stdout 833 -stdout 834 -stdout 835 -stdout 836 -stdout 837 -stdout 838 -stdout 839 -stdout 840 -stdout 841 -stdout 842 -stdout 843 -stdout 844 -stdout 845 -stdout 846 -stdout 847 -stdout 848 -stdout 849 -stdout 850 -stdout 851 -stdout 852 -stdout 853 -stdout 854 -stdout 855 -stdout 856 -stdout 857 -stdout 858 -stdout 859 -stdout 860 -stdout 861 -stdout 862 -stdout 863 -stdout 864 -stdout 865 -stdout 866 -stdout 867 -stdout 868 -stdout 869 -stdout 870 -stdout 871 -stdout 872 -stdout 873 -stdout 874 -stdout 875 -stdout 876 -stdout 877 -stdout 878 -stdout 879 -stdout 880 -stdout 881 -stdout 882 -stdout 883 -stdout 884 -stdout 885 -stdout 886 -stdout 887 -stdout 888 -stdout 889 -stdout 890 -stdout 891 -stdout 892 -stdout 893 -stdout 894 -stdout 895 -stdout 896 -stdout 897 -stdout 898 -stdout 899 -stdout 900 -stdout 901 -stdout 902 -stdout 903 -stdout 904 -stdout 905 -stdout 906 -stdout 907 -stdout 908 -stdout 909 -stdout 910 -stdout 911 -stdout 912 -stdout 913 -stdout 914 -stdout 915 -stdout 916 -stdout 917 -stdout 918 -stdout 919 -stdout 920 -stdout 921 -stdout 922 -stdout 923 -stdout 924 -stdout 925 -stdout 926 -stdout 927 -stdout 928 -stdout 929 -stdout 930 -stdout 931 -stdout 932 -stdout 933 -stdout 934 -stdout 935 -stdout 936 -stdout 937 -stdout 938 -stdout 939 -stdout 940 -stdout 941 -stdout 942 -stdout 943 -stdout 944 -stdout 945 -stdout 946 -stdout 947 -stdout 948 -stdout 949 -stdout 950 -stdout 951 -stdout 952 -stdout 953 -stdout 954 -stdout 955 -stdout 956 -stdout 957 -stdout 958 -stdout 959 -stdout 960 -stdout 961 -stdout 962 -stdout 963 -stdout 964 -stdout 965 -stdout 966 -stdout 967 -stdout 968 -stdout 969 -stdout 970 -stdout 971 -stdout 972 -stdout 973 -stdout 974 -stdout 975 -stdout 976 -stdout 977 -stdout 978 -stdout 979 -stdout 980 -stdout 981 -stdout 982 -stdout 983 -stdout 984 -stdout 985 -stdout 986 -stdout 987 -stdout 988 -stdout 989 -stdout 990 -stdout 991 -stdout 992 -stdout 993 -stdout 994 -stdout 995 -stdout 996 -stdout 997 -stdout 998 -stdout 999 diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/create-files.sh b/node_modules/grunt/node_modules/exit/test/fixtures/create-files.sh deleted file mode 100755 index 6a526de..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/create-files.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -rm 10*.txt -for n in 10 100 1000; do - node log.js 0 $n stdout stderr &> $n-stdout-stderr.txt - node log.js 0 $n stdout &> $n-stdout.txt - node log.js 0 $n stderr &> $n-stderr.txt -done diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/log-broken.js b/node_modules/grunt/node_modules/exit/test/fixtures/log-broken.js deleted file mode 100644 index 74c8f12..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/log-broken.js +++ /dev/null @@ -1,23 +0,0 @@ -var errorCode = process.argv[2]; -var max = process.argv[3]; -var modes = process.argv.slice(4); - -function stdout(message) { - if (modes.indexOf('stdout') === -1) { return; } - process.stdout.write('stdout ' + message + '\n'); -} - -function stderr(message) { - if (modes.indexOf('stderr') === -1) { return; } - process.stderr.write('stderr ' + message + '\n'); -} - -for (var i = 0; i < max; i++) { - stdout(i); - stderr(i); -} - -process.exit(errorCode); - -stdout('fail'); -stderr('fail'); diff --git a/node_modules/grunt/node_modules/exit/test/fixtures/log.js b/node_modules/grunt/node_modules/exit/test/fixtures/log.js deleted file mode 100644 index 8a9ed9a..0000000 --- a/node_modules/grunt/node_modules/exit/test/fixtures/log.js +++ /dev/null @@ -1,25 +0,0 @@ -var exit = require('../../lib/exit'); - -var errorCode = process.argv[2]; -var max = process.argv[3]; -var modes = process.argv.slice(4); - -function stdout(message) { - if (modes.indexOf('stdout') === -1) { return; } - process.stdout.write('stdout ' + message + '\n'); -} - -function stderr(message) { - if (modes.indexOf('stderr') === -1) { return; } - process.stderr.write('stderr ' + message + '\n'); -} - -for (var i = 0; i < max; i++) { - stdout(i); - stderr(i); -} - -exit(errorCode); - -stdout('fail'); -stderr('fail'); diff --git a/node_modules/grunt/node_modules/findup-sync/.jshintrc b/node_modules/grunt/node_modules/findup-sync/.jshintrc deleted file mode 100644 index 6d171b8..0000000 --- a/node_modules/grunt/node_modules/findup-sync/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "loopfunc": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "unused": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/node_modules/grunt/node_modules/findup-sync/.npmignore b/node_modules/grunt/node_modules/findup-sync/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/Gruntfile.js b/node_modules/grunt/node_modules/findup-sync/Gruntfile.js deleted file mode 100644 index 2f964a5..0000000 --- a/node_modules/grunt/node_modules/findup-sync/Gruntfile.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - nodeunit: { - files: ['test/**/*_test.js'], - }, - jshint: { - options: { - jshintrc: '.jshintrc' - }, - all: ['Gruntfile.js', 'lib/**/*.js', 'test/**/*.js'] - } - }); - - // Load plugins. - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - - // Default task. - grunt.registerTask('default', ['jshint', 'nodeunit']); - -}; diff --git a/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT b/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -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/grunt/node_modules/findup-sync/README.md b/node_modules/grunt/node_modules/findup-sync/README.md deleted file mode 100644 index 3b08b4e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# findup-sync - -Find the first file matching a given pattern in the current directory or the nearest ancestor directory. - -## Getting Started -Install the module with: `npm install findup-sync` - -```js -var findup = require('findup-sync'); - -// Start looking in the CWD. -var filepath1 = findup('{a,b}*.txt'); - -// Start looking somewhere else, and ignore case (probably a good idea). -var filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true}); -``` - -## Usage - -```js -findup(patternOrPatterns [, minimatchOptions]) -``` - -### patternOrPatterns -Type: `String` or `Array` -Default: none - -One or more wildcard glob patterns. Or just filenames. - -### minimatchOptions -Type: `Object` -Default: `{}` - -Options to be passed to [minimatch](https://github.com/isaacs/minimatch). - -Note that if you want to start in a different directory than the current working directory, specify a `cwd` property here. - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). - -## Release History -2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. -2012-11-15 - v0.1.1 - Now works without an options object. -2012-11-01 - v0.1.0 - Initial release. diff --git a/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js b/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js deleted file mode 100644 index 742a478..0000000 --- a/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * findup-sync - * https://github.com/cowboy/node-findup-sync - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - */ - -'use strict'; - -// Nodejs libs. -var path = require('path'); - -// External libs. -var glob = require('glob'); -var _ = require('lodash'); - -// Search for a filename in the given directory or all parent directories. -module.exports = function(patterns, options) { - // Normalize patterns to an array. - if (!Array.isArray(patterns)) { patterns = [patterns]; } - // Create globOptions so that it can be modified without mutating the - // original object. - var globOptions = Object.create(options || {}); - globOptions.maxDepth = 1; - globOptions.cwd = path.resolve(globOptions.cwd || '.'); - - var files, lastpath; - do { - // Search for files matching patterns. - files = _(patterns).map(function(pattern) { - return glob.sync(pattern, globOptions); - }).flatten().uniq().value(); - // Return file if found. - if (files.length > 0) { - return path.resolve(path.join(globOptions.cwd, files[0])); - } - // Go up a directory. - lastpath = globOptions.cwd; - globOptions.cwd = path.resolve(globOptions.cwd, '..'); - // If parentpath is the same as basedir, we can't go any higher. - } while (globOptions.cwd !== lastpath); - - // No files were found! - return null; -}; diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md deleted file mode 100644 index cac2c65..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# Lo-Dash v1.0.1 - -A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). - -## Download - -* Lo-Dash builds (for modern environments):
-[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.js) and -[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.min.js) - -* Lo-Dash compatibility builds (for legacy and modern environments):
-[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.compat.js) and -[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.compat.min.js) - -* Underscore compatibility builds:
-[Development](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.underscore.js) and -[Production](https://raw.github.com/lodash/lodash/v1.0.1/dist/lodash.underscore.min.js) - -* CDN copies of ≤ v1.0.1’s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):
-[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.js), -[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.min.js),
-[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.js), -[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.compat.min.js),
-[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.js), and -[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.1/lodash.underscore.min.js) - -* For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need - -## Dive in - -We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). - -For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). - -## Resources - -For more information check out these articles, screencasts, and other videos over Lo-Dash: - - * Posts - - [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/) - - * Videos - - [Introducing Lo-Dash](https://vimeo.com/44154599) - - [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - - [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) - - [Unit testing in Lo-Dash](https://vimeo.com/45865290) - - [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) - - [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_(…)](http://lodash.com/docs#_) supports intuitive chaining - * [_.at](http://lodash.com/docs#at) for cherry-picking collection values - * [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods - * [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays and objects - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument - * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early - * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor - * [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) and [_.partialRight](http://lodash.com/docs#partialRight) for partial application without `this` binding - * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) - * [_.where](http://lodash.com/docs#where) supports deep object comparisons - * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), - [and more…](http://lodash.com/docs "_.assign, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept `callback` and `thisArg` arguments - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - * [_.filter](http://lodash.com/docs#filter), [_.find](http://lodash.com/docs#find), [_.map](http://lodash.com/docs#map), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* and *“_.where”* `callback` shorthands - -## Support - -Lo-Dash has been tested in at least Chrome 5~24, Firefox 1~18, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.20, Narwhal 0.3.2, PhantomJS 1.8.1, RingoJS 0.9, and Rhino 1.7RC5. - -## Installation and usage - -In browsers: - -```html - -``` - -Using [`npm`](http://npmjs.org/): - -```bash -npm install lodash - -npm install -g lodash -npm link lodash -``` - -To avoid potential issues, update `npm` before installing Lo-Dash: - -```bash -npm install npm -g -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var _ = require('lodash'); - -// or as a drop-in replacement for Underscore -var _ = require('lodash/lodash.underscore'); -``` - -**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var _ = require('lodash')._; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('lodash.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'underscore': 'path/to/lodash' - } -}, -['underscore'], function(_) { - console.log(_.VERSION); -}); -``` - -## Release Notes - -### v1.0.1 - - * Add support for specifying source map URLs in `-p`/`--source-map` build options - * Ensured the second argument passed to `_.assign` is not treated as a `callback` - * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL` - * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed - * Made `_.defer` use `setImmediate`, in Node.js, when available - * Made `_.where` search arrays for values regardless of their index position - * Removed dead code from `_.template` - -The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## Contributors - -| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | -|---|---|---| -| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js b/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js deleted file mode 100644 index 37ebc92..0000000 --- a/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js +++ /dev/null @@ -1,5152 +0,0 @@ -/** - * @license - * Lo-Dash 1.0.1 (Custom Build) - * Build: `lodash -o ./dist/lodash.compat.js` - * Copyright 2012-2013 The Dojo Foundation - * Based on Underscore.js 1.4.4 - * Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license - */ -;(function(window, undefined) { - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports; - - /** Detect free variable `module` */ - var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; - - /** Detect free variable `global` and use it as `window` */ - var freeGlobal = typeof global == 'object' && global; - if (freeGlobal.global === freeGlobal) { - window = freeGlobal; - } - - /** Used for array and object method references */ - var arrayRef = [], - objectRef = {}; - - /** Used to generate unique IDs */ - var idCounter = 0; - - /** Used internally to indicate various things */ - var indicatorObject = objectRef; - - /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ - var largeArraySize = 30; - - /** Used to restore the original `_` reference in `noConflict` */ - var oldDash = window._; - - /** Used to match HTML entities */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g; - - /** Used to match empty string literals in compiled template source */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match regexp flags from their coerced string values */ - var reFlags = /\w*$/; - - /** Used to detect if a method is native */ - var reNative = RegExp('^' + - (objectRef.valueOf + '') - .replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - .replace(/valueOf|for [^\]]+/g, '.+?') + '$' - ); - - /** - * Used to match ES6 template delimiters - * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match "interpolate" template delimiters */ - var reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to ensure capturing order of template delimiters */ - var reNoMatch = /($^)/; - - /** Used to match HTML characters */ - var reUnescapedHtml = /[&<>"']/g; - - /** Used to match unescaped characters in compiled string literals */ - var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; - - /** Used to fix the JScript [[DontEnum]] bug */ - var shadowed = [ - 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', - 'toLocaleString', 'toString', 'valueOf' - ]; - - /** Used to make template sourceURLs easier to identify */ - var templateCounter = 0; - - /** Native method shortcuts */ - var ceil = Math.ceil, - concat = arrayRef.concat, - floor = Math.floor, - getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, - hasOwnProperty = objectRef.hasOwnProperty, - push = arrayRef.push, - toString = objectRef.toString; - - /* Native method shortcuts for methods with the same name as other `lodash` methods */ - var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, - nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, - nativeIsFinite = window.isFinite, - nativeIsNaN = window.isNaN, - nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, - nativeMax = Math.max, - nativeMin = Math.min, - nativeRandom = Math.random; - - /** `Object#toString` result shortcuts */ - var argsClass = '[object Arguments]', - arrayClass = '[object Array]', - boolClass = '[object Boolean]', - dateClass = '[object Date]', - funcClass = '[object Function]', - numberClass = '[object Number]', - objectClass = '[object Object]', - regexpClass = '[object RegExp]', - stringClass = '[object String]'; - - /** Detect various environments */ - var isIeOpera = !!window.attachEvent, - isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera); - - /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ - var isBindFast = nativeBind && !isV8; - - /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ - var isKeysFast = nativeKeys && (isIeOpera || isV8); - - /** - * Detect the JScript [[DontEnum]] bug: - * - * In IE < 9 an objects own properties, shadowing non-enumerable ones, are - * made non-enumerable as well. - */ - var hasDontEnumBug; - - /** - * Detect if a `prototype` properties are enumerable by default: - * - * Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 - * (if the prototype or a property on the prototype has been set) - * incorrectly sets a function's `prototype` property [[Enumerable]] - * value to `true`. - */ - var hasEnumPrototype; - - /** Detect if own properties are iterated after inherited properties (IE < 9) */ - var iteratesOwnLast; - - /** - * Detect if `Array#shift` and `Array#splice` augment array-like objects - * incorrectly: - * - * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` - * and `splice()` functions that fail to remove the last element, `value[0]`, - * of array-like objects even though the `length` property is set to `0`. - * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` - * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. - */ - var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, - arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); - - /** Detect if `arguments` object indexes are non-enumerable (Firefox < 4, IE < 9, PhantomJS, Safari < 5.1) */ - var nonEnumArgs = true; - - (function() { - var props = []; - function ctor() { this.x = 1; } - ctor.prototype = { 'valueOf': 1, 'y': 1 }; - for (var prop in new ctor) { props.push(prop); } - for (prop in arguments) { nonEnumArgs = !prop; } - - hasDontEnumBug = !/valueOf/.test(props); - hasEnumPrototype = ctor.propertyIsEnumerable('prototype'); - iteratesOwnLast = props[0] != 'x'; - }(1)); - - /** Detect if `arguments` objects are `Object` objects (all but Opera < 10.5) */ - var argsAreObjects = arguments.constructor == Object; - - /** Detect if `arguments` objects [[Class]] is unresolvable (Firefox < 4, IE < 9) */ - var noArgsClass = !isArguments(arguments); - - /** - * Detect lack of support for accessing string characters by index: - * - * IE < 8 can't access characters by index and IE 8 can only access - * characters by index on string literals. - */ - var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; - - /** - * Detect if a DOM node's [[Class]] is unresolvable (IE < 9) - * and that the JS engine won't error when attempting to coerce an object to - * a string without a `toString` function. - */ - try { - var noNodeClass = toString.call(document) == objectClass && !({ 'toString': 0 } + ''); - } catch(e) { } - - /** Used to identify object classifications that `_.clone` supports */ - var cloneableClasses = {}; - cloneableClasses[funcClass] = false; - cloneableClasses[argsClass] = cloneableClasses[arrayClass] = - cloneableClasses[boolClass] = cloneableClasses[dateClass] = - cloneableClasses[numberClass] = cloneableClasses[objectClass] = - cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true; - - /** Used to lookup a built-in constructor by [[Class]] */ - var ctorByClass = {}; - ctorByClass[arrayClass] = Array; - ctorByClass[boolClass] = Boolean; - ctorByClass[dateClass] = Date; - ctorByClass[objectClass] = Object; - ctorByClass[numberClass] = Number; - ctorByClass[regexpClass] = RegExp; - ctorByClass[stringClass] = String; - - /** Used to determine if values are of the language type Object */ - var objectTypes = { - 'boolean': false, - 'function': true, - 'object': true, - 'number': false, - 'string': false, - 'undefined': false - }; - - /** Used to escape characters for inclusion in compiled string literals */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a `lodash` object, that wraps the given `value`, to enable method - * chaining. - * - * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: - * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, - * and `unshift` - * - * The chainable wrapper functions are: - * `after`, `assign`, `bind`, `bindAll`, `bindKey`, `chain`, `compact`, `compose`, - * `concat`, `countBy`, `debounce`, `defaults`, `defer`, `delay`, `difference`, - * `filter`, `flatten`, `forEach`, `forIn`, `forOwn`, `functions`, `groupBy`, - * `initial`, `intersection`, `invert`, `invoke`, `keys`, `map`, `max`, `memoize`, - * `merge`, `min`, `object`, `omit`, `once`, `pairs`, `partial`, `partialRight`, - * `pick`, `pluck`, `push`, `range`, `reject`, `rest`, `reverse`, `shuffle`, - * `slice`, `sort`, `sortBy`, `splice`, `tap`, `throttle`, `times`, `toArray`, - * `union`, `uniq`, `unshift`, `values`, `where`, `without`, `wrap`, and `zip` - * - * The non-chainable wrapper functions are: - * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, `identity`, - * `indexOf`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`, `isEmpty`, - * `isEqual`, `isFinite`, `isFunction`, `isNaN`, `isNull`, `isNumber`, `isObject`, - * `isPlainObject`, `isRegExp`, `isString`, `isUndefined`, `join`, `lastIndexOf`, - * `mixin`, `noConflict`, `pop`, `random`, `reduce`, `reduceRight`, `result`, - * `shift`, `size`, `some`, `sortedIndex`, `template`, `unescape`, and `uniqueId` - * - * The wrapper functions `first` and `last` return wrapped values when `n` is - * passed, otherwise they return unwrapped values. - * - * @name _ - * @constructor - * @category Chaining - * @param {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodash(value) { - // exit early if already wrapped, even if wrapped by a different `lodash` constructor - if (value && typeof value == 'object' && value.__wrapped__) { - return value; - } - // allow invoking `lodash` without the `new` operator - if (!(this instanceof lodash)) { - return new lodash(value); - } - this.__wrapped__ = value; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in - * embedded Ruby (ERB). Change the following template settings to use alternative - * delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': /<%-([\s\S]+?)%>/g, - - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': /<%([\s\S]+?)%>/g, - - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type String - */ - 'variable': '', - - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type Object - */ - 'imports': { - - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type Function - */ - '_': lodash - } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The template used to create iterator functions. - * - * @private - * @param {Obect} data The data object used to populate the text. - * @returns {String} Returns the interpolated text. - */ - var iteratorTemplate = function(obj) { - - var __p = 'var index, iterable = ' + - (obj.firstArg ) + - ', result = iterable;\nif (!iterable) return result;\n' + - (obj.top ) + - ';\n'; - if (obj.arrays) { - __p += 'var length = iterable.length; index = -1;\nif (' + - (obj.arrays ) + - ') { '; - if (obj.noCharByIndex) { - __p += '\n if (isString(iterable)) {\n iterable = iterable.split(\'\')\n } '; - } ; - __p += '\n while (++index < length) {\n ' + - (obj.loop ) + - '\n }\n}\nelse { '; - } else if (obj.nonEnumArgs) { - __p += '\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += \'\';\n ' + - (obj.loop ) + - '\n }\n } else { '; - } ; - - if (obj.hasEnumPrototype) { - __p += '\n var skipProto = typeof iterable == \'function\';\n '; - } ; - - if (obj.isKeysFast && obj.useHas) { - __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n '; - if (obj.hasEnumPrototype) { - __p += 'if (!(skipProto && index == \'prototype\')) {\n '; - } ; - __p += - (obj.loop ) + - ''; - if (obj.hasEnumPrototype) { - __p += '}\n'; - } ; - __p += ' } '; - } else { - __p += '\n for (index in iterable) {'; - if (obj.hasEnumPrototype || obj.useHas) { - __p += '\n if ('; - if (obj.hasEnumPrototype) { - __p += '!(skipProto && index == \'prototype\')'; - } if (obj.hasEnumPrototype && obj.useHas) { - __p += ' && '; - } if (obj.useHas) { - __p += 'hasOwnProperty.call(iterable, index)'; - } ; - __p += ') { '; - } ; - __p += - (obj.loop ) + - '; '; - if (obj.hasEnumPrototype || obj.useHas) { - __p += '\n }'; - } ; - __p += '\n } '; - } ; - - if (obj.hasDontEnumBug) { - __p += '\n\n var ctor = iterable.constructor;\n '; - for (var k = 0; k < 7; k++) { - __p += '\n index = \'' + - (obj.shadowed[k] ) + - '\';\n if ('; - if (obj.shadowed[k] == 'constructor') { - __p += '!(ctor && ctor.prototype === iterable) && '; - } ; - __p += 'hasOwnProperty.call(iterable, index)) {\n ' + - (obj.loop ) + - '\n } '; - } ; - - } ; - - if (obj.arrays || obj.nonEnumArgs) { - __p += '\n}'; - } ; - __p += - (obj.bottom ) + - ';\nreturn result'; - - - return __p - }; - - /** Reusable iterator options for `assign` and `defaults` */ - var defaultsIteratorOptions = { - 'args': 'object, source, guard', - 'top': - 'var args = arguments,\n' + - ' argsIndex = 0,\n' + - " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + - 'while (++argsIndex < argsLength) {\n' + - ' iterable = args[argsIndex];\n' + - ' if (iterable && objectTypes[typeof iterable]) {', - 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", - 'bottom': ' }\n}' - }; - - /** Reusable iterator options shared by `each`, `forIn`, and `forOwn` */ - var eachIteratorOptions = { - 'args': 'collection, callback, thisArg', - 'top': "callback = callback && typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg)", - 'arrays': "typeof length == 'number'", - 'loop': 'if (callback(iterable[index], index, collection) === false) return result' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'arrays': false - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function optimized to search large arrays for a given `value`, - * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. - * - * @private - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to search from. - * @param {Number} [largeSize=30] The length at which an array is considered large. - * @returns {Boolean} Returns `true`, if `value` is found, else `false`. - */ - function cachedContains(array, fromIndex, largeSize) { - fromIndex || (fromIndex = 0); - - var length = array.length, - isLarge = (length - fromIndex) >= (largeSize || largeArraySize); - - if (isLarge) { - var cache = {}, - index = fromIndex - 1; - - while (++index < length) { - // manually coerce `value` to a string because `hasOwnProperty`, in some - // older versions of Firefox, coerces objects incorrectly - var key = array[index] + ''; - (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); - } - } - return function(value) { - if (isLarge) { - var key = value + ''; - return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; - } - return indexOf(array, value, fromIndex) > -1; - } - } - - /** - * Used by `_.max` and `_.min` as the default `callback` when a given - * `collection` is a string value. - * - * @private - * @param {String} value The character to inspect. - * @returns {Number} Returns the code unit of given character. - */ - function charAtCallback(value) { - return value.charCodeAt(0); - } - - /** - * Used by `sortBy` to compare transformed `collection` values, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {Number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ai = a.index, - bi = b.index; - - a = a.criteria; - b = b.criteria; - - // ensure a stable sort in V8 and other engines - // http://code.google.com/p/v8/issues/detail?id=90 - if (a !== b) { - if (a > b || typeof a == 'undefined') { - return 1; - } - if (a < b || typeof b == 'undefined') { - return -1; - } - } - return ai < bi ? -1 : 1; - } - - /** - * Creates a function that, when called, invokes `func` with the `this` binding - * of `thisArg` and prepends any `partialArgs` to the arguments passed to the - * bound function. - * - * @private - * @param {Function|String} func The function to bind or the method name. - * @param {Mixed} [thisArg] The `this` binding of `func`. - * @param {Array} partialArgs An array of arguments to be partially applied. - * @param {Object} [rightIndicator] Used to indicate partially applying arguments from the right. - * @returns {Function} Returns the new bound function. - */ - function createBound(func, thisArg, partialArgs, rightIndicator) { - var isFunc = isFunction(func), - isPartial = !partialArgs, - key = thisArg; - - // juggle arguments - if (isPartial) { - partialArgs = thisArg; - } - if (!isFunc) { - thisArg = func; - } - - function bound() { - // `Function#bind` spec - // http://es5.github.com/#x15.3.4.5 - var args = arguments, - thisBinding = isPartial ? this : thisArg; - - if (!isFunc) { - func = thisArg[key]; - } - if (partialArgs.length) { - args = args.length - ? (args = slice(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) - : partialArgs; - } - if (this instanceof bound) { - // ensure `new bound` is an instance of `bound` and `func` - noop.prototype = func.prototype; - thisBinding = new noop; - noop.prototype = null; - - // mimic the constructor's `return` behavior - // http://es5.github.com/#x13.2.2 - var result = func.apply(thisBinding, args); - return isObject(result) ? result : thisBinding; - } - return func.apply(thisBinding, args); - } - return bound; - } - - /** - * Produces a callback bound to an optional `thisArg`. If `func` is a property - * name, the created callback will return the property value for a given element. - * If `func` is an object, the created callback will return `true` for elements - * that contain the equivalent object properties, otherwise it will return `false`. - * - * @private - * @param {Mixed} [func=identity] The value to convert to a callback. - * @param {Mixed} [thisArg] The `this` binding of the created callback. - * @param {Number} [argCount=3] The number of arguments the callback accepts. - * @returns {Function} Returns a callback function. - */ - function createCallback(func, thisArg, argCount) { - if (func == null) { - return identity; - } - var type = typeof func; - if (type != 'function') { - if (type != 'object') { - return function(object) { - return object[func]; - }; - } - var props = keys(func); - return function(object) { - var length = props.length, - result = false; - while (length--) { - if (!(result = isEqual(object[props[length]], func[props[length]], indicatorObject))) { - break; - } - } - return result; - }; - } - if (typeof thisArg != 'undefined') { - if (argCount === 1) { - return function(value) { - return func.call(thisArg, value); - }; - } - if (argCount === 2) { - return function(a, b) { - return func.call(thisArg, a, b); - }; - } - if (argCount === 4) { - return function(accumulator, value, index, object) { - return func.call(thisArg, accumulator, value, index, object); - }; - } - return function(value, index, object) { - return func.call(thisArg, value, index, object); - }; - } - return func; - } - - /** - * Creates compiled iteration functions. - * - * @private - * @param {Object} [options1, options2, ...] The compile options object(s). - * arrays - A string of code to determine if the iterable is an array or array-like. - * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. - * args - A string of comma separated arguments the iteration function will accept. - * top - A string of code to execute before the iteration branches. - * loop - A string of code to execute in the object loop. - * bottom - A string of code to execute after the iteration branches. - * - * @returns {Function} Returns the compiled function. - */ - function createIterator() { - var data = { - // support properties - 'hasDontEnumBug': hasDontEnumBug, - 'hasEnumPrototype': hasEnumPrototype, - 'isKeysFast': isKeysFast, - 'nonEnumArgs': nonEnumArgs, - 'noCharByIndex': noCharByIndex, - 'shadowed': shadowed, - - // iterator options - 'arrays': 'isArray(iterable)', - 'bottom': '', - 'loop': '', - 'top': '', - 'useHas': true - }; - - // merge options into a template data object - for (var object, index = 0; object = arguments[index]; index++) { - for (var key in object) { - data[key] = object[key]; - } - } - var args = data.args; - data.firstArg = /^[^,]+/.exec(args)[0]; - - // create the function factory - var factory = Function( - 'createCallback, hasOwnProperty, isArguments, isArray, isString, ' + - 'objectTypes, nativeKeys', - 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' - ); - // return the compiled function - return factory( - createCallback, hasOwnProperty, isArguments, isArray, isString, - objectTypes, nativeKeys - ); - } - - /** - * A function compiled to iterate `arguments` objects, arrays, objects, and - * strings consistenly across environments, executing the `callback` for each - * element in the `collection`. The `callback` is bound to `thisArg` and invoked - * with three arguments; (value, index|key, collection). Callbacks may exit - * iteration early by explicitly returning `false`. - * - * @private - * @type Function - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|String} Returns `collection`. - */ - var each = createIterator(eachIteratorOptions); - - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - - /** - * Used by `escape` to convert characters to HTML entities. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeHtmlChar(match) { - return htmlEscapes[match]; - } - - /** - * Checks if `value` is a DOM node in IE < 9. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`. - */ - function isNode(value) { - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings - return typeof value.toString != 'function' && typeof (value + '') == 'string'; - } - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - - /** - * Slices the `collection` from the `start` index up to, but not including, - * the `end` index. - * - * Note: This function is used, instead of `Array#slice`, to support node lists - * in IE < 9 and to ensure dense arrays are returned. - * - * @private - * @param {Array|Object|String} collection The collection to slice. - * @param {Number} start The start index. - * @param {Number} end The end index. - * @returns {Array} Returns the new array. - */ - function slice(array, start, end) { - start || (start = 0); - if (typeof end == 'undefined') { - end = array ? array.length : 0; - } - var index = -1, - length = end - start || 0, - result = Array(length < 0 ? 0 : length); - - while (++index < length) { - result[index] = array[start + index]; - } - return result; - } - - /** - * Used by `unescape` to convert HTML entities to characters. - * - * @private - * @param {String} match The matched character to unescape. - * @returns {String} Returns the unescaped character. - */ - function unescapeHtmlChar(match) { - return htmlUnescapes[match]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return toString.call(value) == argsClass; - } - // fallback for browsers that can't detect `arguments` objects by [[Class]] - if (noArgsClass) { - isArguments = function(value) { - return value ? hasOwnProperty.call(value, 'callee') : false; - }; - } - - /** - * Iterates over `object`'s own and inherited enumerable properties, executing - * the `callback` for each property. The `callback` is bound to `thisArg` and - * invoked with three arguments; (value, key, object). Callbacks may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * function Dog(name) { - * this.name = name; - * } - * - * Dog.prototype.bark = function() { - * alert('Woof, woof!'); - * }; - * - * _.forIn(new Dog('Dagny'), function(value, key) { - * alert(key); - * }); - * // => alerts 'name' and 'bark' (order is not guaranteed) - */ - var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { - 'useHas': false - }); - - /** - * Iterates over an object's own enumerable properties, executing the `callback` - * for each property. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, key, object). Callbacks may exit iteration early by explicitly - * returning `false`. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - * alert(key); - * }); - * // => alerts '0', '1', and 'length' (order is not guaranteed) - */ - var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); - - /** - * Checks if `value` is an array. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is an array, else `false`. - * @example - * - * (function() { return _.isArray(arguments); })(); - * // => false - * - * _.isArray([1, 2, 3]); - * // => true - */ - var isArray = nativeIsArray || function(value) { - // `instanceof` may cause a memory leak in IE 7 if `value` is a host object - // http://ajaxian.com/archives/working-aroung-the-instanceof-memory-leak - return (argsAreObjects && value instanceof Array) || toString.call(value) == arrayClass; - }; - - /** - * Creates an array composed of the own enumerable property names of `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names. - * @example - * - * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (order is not guaranteed) - */ - var keys = !nativeKeys ? shimKeys : function(object) { - if (!isObject(object)) { - return []; - } - if ((hasEnumPrototype && typeof object == 'function') || - (nonEnumArgs && object.length && isArguments(object))) { - return shimKeys(object); - } - return nativeKeys(object); - }; - - /** - * A fallback implementation of `isPlainObject` that checks if a given `value` - * is an object created by the `Object` constructor, assuming objects created - * by the `Object` constructor have no inherited enumerable properties and that - * there are no `Object.prototype` extensions. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - // avoid non-objects and false positives for `arguments` objects - var result = false; - if (!(value && typeof value == 'object') || isArguments(value)) { - return result; - } - // check that the constructor is `Object` (i.e. `Object instanceof Object`) - var ctor = value.constructor; - if ((!isFunction(ctor) && (!noNodeClass || !isNode(value))) || ctor instanceof ctor) { - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - if (iteratesOwnLast) { - forIn(value, function(value, key, object) { - result = !hasOwnProperty.call(object, key); - return false; - }); - return result === false; - } - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - forIn(value, function(value, key) { - result = key; - }); - return result === false || hasOwnProperty.call(value, result); - } - return result; - } - - /** - * A fallback implementation of `Object.keys` that produces an array of the - * given object's own enumerable property names. - * - * @private - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names. - */ - function shimKeys(object) { - var result = []; - forOwn(object, function(value, key) { - result.push(key); - }); - return result; - } - - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /*--------------------------------------------------------------------------*/ - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object. Subsequent sources will overwrite propery assignments of previous - * sources. If a `callback` function is passed, it will be executed to produce - * the assigned values. The `callback` is bound to `thisArg` and invoked with - * two arguments; (objectValue, sourceValue). - * - * @static - * @memberOf _ - * @type Function - * @alias extend - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @param {Function} [callback] The function to customize assigning values. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the destination object. - * @example - * - * _.assign({ 'name': 'moe' }, { 'age': 40 }); - * // => { 'name': 'moe', 'age': 40 } - * - * var defaults = _.partialRight(_.assign, function(a, b) { - * return typeof a == 'undefined' ? b : a; - * }); - * - * var food = { 'name': 'apple' }; - * defaults(food, { 'name': 'banana', 'type': 'fruit' }); - * // => { 'name': 'apple', 'type': 'fruit' } - */ - var assign = createIterator(defaultsIteratorOptions, { - 'top': - defaultsIteratorOptions.top.replace(';', - ';\n' + - "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + - ' var callback = createCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + - "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" + - ' callback = args[--argsLength];\n' + - '}' - ), - 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' - }); - - /** - * Creates a clone of `value`. If `deep` is `true`, nested objects will also - * be cloned, otherwise they will be assigned by reference. If a `callback` - * function is passed, it will be executed to produce the cloned values. If - * `callback` returns `undefined`, cloning will be handled by the method instead. - * The `callback` is bound to `thisArg` and invoked with one argument; (value). - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to clone. - * @param {Boolean} [deep=false] A flag to indicate a deep clone. - * @param {Function} [callback] The function to customize cloning values. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @param- {Array} [stackA=[]] Internally used to track traversed source objects. - * @param- {Array} [stackB=[]] Internally used to associate clones with source counterparts. - * @returns {Mixed} Returns the cloned `value`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * var shallow = _.clone(stooges); - * shallow[0] === stooges[0]; - * // => true - * - * var deep = _.clone(stooges, true); - * deep[0] === stooges[0]; - * // => false - * - * _.mixin({ - * 'clone': _.partialRight(_.clone, function(value) { - * return _.isElement(value) ? value.cloneNode(false) : undefined; - * }) - * }); - * - * var clone = _.clone(document.body); - * clone.childNodes.length; - * // => 0 - */ - function clone(value, deep, callback, thisArg, stackA, stackB) { - var result = value; - - // allows working with "Collections" methods without using their `callback` - // argument, `index|key`, for this method's `callback` - if (typeof deep == 'function') { - thisArg = callback; - callback = deep; - deep = false; - } - if (typeof callback == 'function') { - callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 1); - result = callback(result); - - var done = typeof result != 'undefined'; - if (!done) { - result = value; - } - } - // inspect [[Class]] - var isObj = isObject(result); - if (isObj) { - var className = toString.call(result); - if (!cloneableClasses[className] || (noNodeClass && isNode(result))) { - return result; - } - var isArr = isArray(result); - } - // shallow clone - if (!isObj || !deep) { - return isObj && !done - ? (isArr ? slice(result) : assign({}, result)) - : result; - } - var ctor = ctorByClass[className]; - switch (className) { - case boolClass: - case dateClass: - return done ? result : new ctor(+result); - - case numberClass: - case stringClass: - return done ? result : new ctor(result); - - case regexpClass: - return done ? result : ctor(result.source, reFlags.exec(result)); - } - // check for circular references and return corresponding clone - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // init cloned object - if (!done) { - result = isArr ? ctor(result.length) : {}; - - // add array properties assigned by `RegExp#exec` - if (isArr) { - if (hasOwnProperty.call(value, 'index')) { - result.index = value.index; - } - if (hasOwnProperty.call(value, 'input')) { - result.input = value.input; - } - } - } - // add the source value to the stack of traversed objects - // and associate it with its clone - stackA.push(value); - stackB.push(result); - - // recursively populate clone (susceptible to call stack limits) - (isArr ? forEach : forOwn)(done ? result : value, function(objValue, key) { - result[key] = clone(objValue, deep, callback, undefined, stackA, stackB); - }); - - return result; - } - - /** - * Creates a deep clone of `value`. If a `callback` function is passed, it will - * be executed to produce the cloned values. If `callback` returns the value it - * was passed, cloning will be handled by the method instead. The `callback` is - * bound to `thisArg` and invoked with one argument; (value). - * - * Note: This function is loosely based on the structured clone algorithm. Functions - * and DOM nodes are **not** cloned. The enumerable properties of `arguments` objects and - * objects created by constructors other than `Object` are cloned to plain `Object` objects. - * See http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to deep clone. - * @param {Function} [callback] The function to customize cloning values. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the deep cloned `value`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * var deep = _.cloneDeep(stooges); - * deep[0] === stooges[0]; - * // => false - * - * var view = { - * 'label': 'docs', - * 'node': element - * }; - * - * var clone = _.cloneDeep(view, function(value) { - * return _.isElement(value) ? value.cloneNode(true) : value; - * }); - * - * clone.node == view.node; - * // => false - */ - function cloneDeep(value, callback, thisArg) { - return clone(value, true, callback, thisArg); - } - - /** - * Assigns own enumerable properties of source object(s) to the destination - * object for all destination properties that resolve to `undefined`. Once a - * property is set, additional defaults of the same property will be ignored. - * - * @static - * @memberOf _ - * @type Function - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @param- {Object} [guard] Internally used to allow working with `_.reduce` - * without using its callback's `key` and `object` arguments as sources. - * @returns {Object} Returns the destination object. - * @example - * - * var food = { 'name': 'apple' }; - * _.defaults(food, { 'name': 'banana', 'type': 'fruit' }); - * // => { 'name': 'apple', 'type': 'fruit' } - */ - var defaults = createIterator(defaultsIteratorOptions); - - /** - * Creates a sorted array of all enumerable properties, own and inherited, - * of `object` that have function values. - * - * @static - * @memberOf _ - * @alias methods - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names that have function values. - * @example - * - * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] - */ - function functions(object) { - var result = []; - forIn(object, function(value, key) { - if (isFunction(value)) { - result.push(key); - } - }); - return result.sort(); - } - - /** - * Checks if the specified object `property` exists and is a direct property, - * instead of an inherited property. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to check. - * @param {String} property The property to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - * @example - * - * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); - * // => true - */ - function has(object, property) { - return object ? hasOwnProperty.call(object, property) : false; - } - - /** - * Creates an object composed of the inverted keys and values of the given `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to invert. - * @returns {Object} Returns the created inverted object. - * @example - * - * _.invert({ 'first': 'moe', 'second': 'larry' }); - * // => { 'moe': 'first', 'larry': 'second' } (order is not guaranteed) - */ - function invert(object) { - var index = -1, - props = keys(object), - length = props.length, - result = {}; - - while (++index < length) { - var key = props[index]; - result[object[key]] = key; - } - return result; - } - - /** - * Checks if `value` is a boolean value. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a boolean value, else `false`. - * @example - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || toString.call(value) == boolClass; - } - - /** - * Checks if `value` is a date. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a date, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - */ - function isDate(value) { - return value instanceof Date || toString.call(value) == dateClass; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - */ - function isElement(value) { - return value ? value.nodeType === 1 : false; - } - - /** - * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a - * length of `0` and objects with no own enumerable properties are considered - * "empty". - * - * @static - * @memberOf _ - * @category Objects - * @param {Array|Object|String} value The value to inspect. - * @returns {Boolean} Returns `true`, if the `value` is empty, else `false`. - * @example - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({}); - * // => true - * - * _.isEmpty(''); - * // => true - */ - function isEmpty(value) { - var result = true; - if (!value) { - return result; - } - var className = toString.call(value), - length = value.length; - - if ((className == arrayClass || className == stringClass || - className == argsClass || (noArgsClass && isArguments(value))) || - (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { - return !length; - } - forOwn(value, function() { - return (result = false); - }); - return result; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent to each other. If `callback` is passed, it will be executed to - * compare values. If `callback` returns `undefined`, comparisons will be handled - * by the method instead. The `callback` is bound to `thisArg` and invoked with - * two arguments; (a, b). - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} a The value to compare. - * @param {Mixed} b The other value to compare. - * @param {Function} [callback] The function to customize comparing values. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. - * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. - * @returns {Boolean} Returns `true`, if the values are equvalent, else `false`. - * @example - * - * var moe = { 'name': 'moe', 'age': 40 }; - * var copy = { 'name': 'moe', 'age': 40 }; - * - * moe == copy; - * // => false - * - * _.isEqual(moe, copy); - * // => true - * - * var words = ['hello', 'goodbye']; - * var otherWords = ['hi', 'goodbye']; - * - * _.isEqual(words, otherWords, function(a, b) { - * var reGreet = /^(?:hello|hi)$/i, - * aGreet = _.isString(a) && reGreet.test(a), - * bGreet = _.isString(b) && reGreet.test(b); - * - * return (aGreet || bGreet) ? (aGreet == bGreet) : undefined; - * }); - * // => true - */ - function isEqual(a, b, callback, thisArg, stackA, stackB) { - // used to indicate that when comparing objects, `a` has at least the properties of `b` - var whereIndicator = callback === indicatorObject; - if (callback && !whereIndicator) { - callback = typeof thisArg == 'undefined' ? callback : createCallback(callback, thisArg, 2); - var result = callback(a, b); - if (typeof result != 'undefined') { - return !!result; - } - } - // exit early for identical values - if (a === b) { - // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); - } - var type = typeof a, - otherType = typeof b; - - // exit early for unlike primitive values - if (a === a && - (!a || (type != 'function' && type != 'object')) && - (!b || (otherType != 'function' && otherType != 'object'))) { - return false; - } - // exit early for `null` and `undefined`, avoiding ES3's Function#call behavior - // http://es5.github.com/#x15.3.4.4 - if (a == null || b == null) { - return a === b; - } - // compare [[Class]] names - var className = toString.call(a), - otherClass = toString.call(b); - - if (className == argsClass) { - className = objectClass; - } - if (otherClass == argsClass) { - otherClass = objectClass; - } - if (className != otherClass) { - return false; - } - switch (className) { - case boolClass: - case dateClass: - // coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal - return +a == +b; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return a != +a - ? b != +b - // but treat `+0` vs. `-0` as not equal - : (a == 0 ? (1 / a == 1 / b) : a == +b); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) - // treat string primitives and their corresponding object instances as equal - return a == b + ''; - } - var isArr = className == arrayClass; - if (!isArr) { - // unwrap any `lodash` wrapped values - if (a.__wrapped__ || b.__wrapped__) { - return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, thisArg, stackA, stackB); - } - // exit for functions and DOM nodes - if (className != objectClass || (noNodeClass && (isNode(a) || isNode(b)))) { - return false; - } - // in older versions of Opera, `arguments` objects have `Array` constructors - var ctorA = !argsAreObjects && isArguments(a) ? Object : a.constructor, - ctorB = !argsAreObjects && isArguments(b) ? Object : b.constructor; - - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && !( - isFunction(ctorA) && ctorA instanceof ctorA && - isFunction(ctorB) && ctorB instanceof ctorB - )) { - return false; - } - } - // assume cyclic structures are equal - // the algorithm for detecting cyclic structures is adapted from ES 5.1 - // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; - } - } - var size = 0; - result = true; - - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); - - // recursively compare objects and arrays (susceptible to call stack limits) - if (isArr) { - length = a.length; - size = b.length; - - // compare lengths to determine if a deep comparison is necessary - result = size == a.length; - if (!result && !whereIndicator) { - return result; - } - // deep compare the contents, ignoring non-numeric properties - while (size--) { - var index = length, - value = b[size]; - - if (whereIndicator) { - while (index--) { - if ((result = isEqual(a[index], value, callback, thisArg, stackA, stackB))) { - break; - } - } - } else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) { - break; - } - } - return result; - } - // deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys` - // which, in this case, is more costly - forIn(b, function(value, key, b) { - if (hasOwnProperty.call(b, key)) { - // count the number of properties. - size++; - // deep compare each property value. - return (result = hasOwnProperty.call(a, key) && isEqual(a[key], value, callback, thisArg, stackA, stackB)); - } - }); - - if (result && !whereIndicator) { - // ensure both objects have the same number of properties - forIn(a, function(value, key, a) { - if (hasOwnProperty.call(a, key)) { - // `size` will be `-1` if `a` has more properties than `b` - return (result = --size > -1); - } - }); - } - return result; - } - - /** - * Checks if `value` is, or can be coerced to, a finite number. - * - * Note: This is not the same as native `isFinite`, which will return true for - * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is finite, else `false`. - * @example - * - * _.isFinite(-101); - * // => true - * - * _.isFinite('10'); - * // => true - * - * _.isFinite(true); - * // => false - * - * _.isFinite(''); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); - } - - /** - * Checks if `value` is a function. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - */ - function isFunction(value) { - return typeof value == 'function'; - } - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return value instanceof Function || toString.call(value) == funcClass; - }; - } - - /** - * Checks if `value` is the language type of Object. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // check if the value is the ECMAScript language type of Object - // http://es5.github.com/#x8 - // and avoid a V8 bug - // http://code.google.com/p/v8/issues/detail?id=2291 - return value ? objectTypes[typeof value] : false; - } - - /** - * Checks if `value` is `NaN`. - * - * Note: This is not the same as native `isNaN`, which will return `true` for - * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the [[Class]] check first to avoid errors with some host objects in IE) - return isNumber(value) && value != +value - } - - /** - * Checks if `value` is `null`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(undefined); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is a number. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a number, else `false`. - * @example - * - * _.isNumber(8.4 * 5); - * // => true - */ - function isNumber(value) { - return typeof value == 'number' || toString.call(value) == numberClass; - } - - /** - * Checks if a given `value` is an object created by the `Object` constructor. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`. - * @example - * - * function Stooge(name, age) { - * this.name = name; - * this.age = age; - * } - * - * _.isPlainObject(new Stooge('moe', 40)); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'name': 'moe', 'age': 40 }); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && typeof value == 'object')) { - return false; - } - var valueOf = value.valueOf, - objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is a regular expression. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a regular expression, else `false`. - * @example - * - * _.isRegExp(/moe/); - * // => true - */ - function isRegExp(value) { - return value instanceof RegExp || toString.call(value) == regexpClass; - } - - /** - * Checks if `value` is a string. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is a string, else `false`. - * @example - * - * _.isString('moe'); - * // => true - */ - function isString(value) { - return typeof value == 'string' || toString.call(value) == stringClass; - } - - /** - * Checks if `value` is `undefined`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true`, if the `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - */ - function isUndefined(value) { - return typeof value == 'undefined'; - } - - /** - * Recursively merges own enumerable properties of the source object(s), that - * don't resolve to `undefined`, into the destination object. Subsequent sources - * will overwrite propery assignments of previous sources. If a `callback` function - * is passed, it will be executed to produce the merged values of the destination - * and source properties. If `callback` returns `undefined`, merging will be - * handled by the method instead. The `callback` is bound to `thisArg` and - * invoked with two arguments; (objectValue, sourceValue). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @param {Function} [callback] The function to customize merging properties. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @param- {Object} [deepIndicator] Internally used to indicate that `stackA` - * and `stackB` are arrays of traversed objects instead of source objects. - * @param- {Array} [stackA=[]] Internally used to track traversed source objects. - * @param- {Array} [stackB=[]] Internally used to associate values with their - * source counterparts. - * @returns {Object} Returns the destination object. - * @example - * - * var names = { - * 'stooges': [ - * { 'name': 'moe' }, - * { 'name': 'larry' } - * ] - * }; - * - * var ages = { - * 'stooges': [ - * { 'age': 40 }, - * { 'age': 50 } - * ] - * }; - * - * _.merge(names, ages); - * // => { 'stooges': [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] } - * - * var food = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var otherFood = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; - * - * _.merge(food, otherFood, function(a, b) { - * return _.isArray(a) ? a.concat(b) : undefined; - * }); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot] } - */ - function merge(object, source, deepIndicator) { - var args = arguments, - index = 0, - length = 2; - - if (!isObject(object)) { - return object; - } - if (deepIndicator === indicatorObject) { - var callback = args[3], - stackA = args[4], - stackB = args[5]; - } else { - stackA = []; - stackB = []; - - // allows working with `_.reduce` and `_.reduceRight` without - // using their `callback` arguments, `index|key` and `collection` - if (typeof deepIndicator != 'number') { - length = args.length; - } - if (length > 3 && typeof args[length - 2] == 'function') { - callback = createCallback(args[--length - 1], args[length--], 2); - } else if (length > 2 && typeof args[length - 1] == 'function') { - callback = args[--length]; - } - } - while (++index < length) { - (isArray(args[index]) ? forEach : forOwn)(args[index], function(source, key) { - var found, - isArr, - result = source, - value = object[key]; - - if (source && ((isArr = isArray(source)) || isPlainObject(source))) { - // avoid merging previously merged cyclic sources - var stackLength = stackA.length; - while (stackLength--) { - if ((found = stackA[stackLength] == source)) { - value = stackB[stackLength]; - break; - } - } - if (!found) { - value = isArr - ? (isArray(value) ? value : []) - : (isPlainObject(value) ? value : {}); - - if (callback) { - result = callback(value, source); - if (typeof result != 'undefined') { - value = result; - } - } - // add `source` and associated `value` to the stack of traversed objects - stackA.push(source); - stackB.push(value); - - // recursively merge objects and arrays (susceptible to call stack limits) - if (!callback) { - value = merge(value, source, indicatorObject, callback, stackA, stackB); - } - } - } - else { - if (callback) { - result = callback(value, source); - if (typeof result == 'undefined') { - result = source; - } - } - if (typeof result != 'undefined') { - value = result; - } - } - object[key] = value; - }); - } - return object; - } - - /** - * Creates a shallow clone of `object` excluding the specified properties. - * Property names may be specified as individual arguments or as arrays of - * property names. If a `callback` function is passed, it will be executed - * for each property in the `object`, omitting the properties `callback` - * returns truthy for. The `callback` is bound to `thisArg` and invoked - * with three arguments; (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit - * or the function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object without the omitted properties. - * @example - * - * _.omit({ 'name': 'moe', 'age': 40 }, 'age'); - * // => { 'name': 'moe' } - * - * _.omit({ 'name': 'moe', 'age': 40 }, function(value) { - * return typeof value == 'number'; - * }); - * // => { 'name': 'moe' } - */ - function omit(object, callback, thisArg) { - var isFunc = typeof callback == 'function', - result = {}; - - if (isFunc) { - callback = createCallback(callback, thisArg); - } else { - var props = concat.apply(arrayRef, arguments); - } - forIn(object, function(value, key, object) { - if (isFunc - ? !callback(value, key, object) - : indexOf(props, key, 1) < 0 - ) { - result[key] = value; - } - }); - return result; - } - - /** - * Creates a two dimensional array of the given object's key-value pairs, - * i.e. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. - * @example - * - * _.pairs({ 'moe': 30, 'larry': 40 }); - * // => [['moe', 30], ['larry', 40]] (order is not guaranteed) - */ - function pairs(object) { - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - var key = props[index]; - result[index] = [key, object[key]]; - } - return result; - } - - /** - * Creates a shallow clone of `object` composed of the specified properties. - * Property names may be specified as individual arguments or as arrays of property - * names. If `callback` is passed, it will be executed for each property in the - * `object`, picking the properties `callback` returns truthy for. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Array|Function|String} callback|[prop1, prop2, ...] The function called - * per iteration or properties to pick, either as individual arguments or arrays. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object composed of the picked properties. - * @example - * - * _.pick({ 'name': 'moe', '_userid': 'moe1' }, 'name'); - * // => { 'name': 'moe' } - * - * _.pick({ 'name': 'moe', '_userid': 'moe1' }, function(value, key) { - * return key.charAt(0) != '_'; - * }); - * // => { 'name': 'moe' } - */ - function pick(object, callback, thisArg) { - var result = {}; - if (typeof callback != 'function') { - var index = 0, - props = concat.apply(arrayRef, arguments), - length = isObject(object) ? props.length : 0; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - } else { - callback = createCallback(callback, thisArg); - forIn(object, function(value, key, object) { - if (callback(value, key, object)) { - result[key] = value; - } - }); - } - return result; - } - - /** - * Creates an array composed of the own enumerable property values of `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property values. - * @example - * - * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] - */ - function values(object) { - var index = -1, - props = keys(object), - length = props.length, - result = Array(length); - - while (++index < length) { - result[index] = object[props[index]]; - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates an array of elements from the specified indexes, or keys, of the - * `collection`. Indexes may be specified as individual arguments or as arrays - * of indexes. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Array|Number|String} [index1, index2, ...] The indexes of - * `collection` to retrieve, either as individual arguments or arrays. - * @returns {Array} Returns a new array of elements corresponding to the - * provided indexes. - * @example - * - * _.at(['a', 'b', 'c', 'd', 'e'], [0, 2, 4]); - * // => ['a', 'c', 'e'] - * - * _.at(['moe', 'larry', 'curly'], 0, 2); - * // => ['moe', 'curly'] - */ - function at(collection) { - var index = -1, - props = concat.apply(arrayRef, slice(arguments, 1)), - length = props.length, - result = Array(length); - - if (noCharByIndex && isString(collection)) { - collection = collection.split(''); - } - while(++index < length) { - result[index] = collection[props[index]]; - } - return result; - } - - /** - * Checks if a given `target` element is present in a `collection` using strict - * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used - * as the offset from the end of the collection. - * - * @static - * @memberOf _ - * @alias include - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Mixed} target The value to check for. - * @param {Number} [fromIndex=0] The index to search from. - * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. - * @example - * - * _.contains([1, 2, 3], 1); - * // => true - * - * _.contains([1, 2, 3], 1, 2); - * // => false - * - * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); - * // => true - * - * _.contains('curly', 'ur'); - * // => true - */ - function contains(collection, target, fromIndex) { - var index = -1, - length = collection ? collection.length : 0, - result = false; - - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; - if (typeof length == 'number') { - result = (isString(collection) - ? collection.indexOf(target, fromIndex) - : indexOf(collection, target, fromIndex) - ) > -1; - } else { - each(collection, function(value) { - if (++index >= fromIndex) { - return !(result = value === target); - } - }); - } - return result; - } - - /** - * Creates an object composed of keys returned from running each element of the - * `collection` through the given `callback`. The corresponding value of each key - * is the number of times the key was returned by the `callback`. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - function countBy(collection, callback, thisArg) { - var result = {}; - callback = createCallback(callback, thisArg); - - forEach(collection, function(value, key, collection) { - key = callback(value, key, collection) + ''; - (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); - }); - return result; - } - - /** - * Checks if the `callback` returns a truthy value for **all** elements of a - * `collection`. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias all - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Boolean} Returns `true` if all elements pass the callback check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * // using "_.pluck" callback shorthand - * _.every(stooges, 'age'); - * // => true - * - * // using "_.where" callback shorthand - * _.every(stooges, { 'age': 50 }); - * // => false - */ - function every(collection, callback, thisArg) { - var result = true; - callback = createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (!(result = !!callback(collection[index], index, collection))) { - break; - } - } - } else { - each(collection, function(value, index, collection) { - return (result = !!callback(value, index, collection)); - }); - } - return result; - } - - /** - * Examines each element in a `collection`, returning an array of all elements - * the `callback` returns truthy for. The `callback` is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias select - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that passed the callback check. - * @example - * - * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [2, 4, 6] - * - * var food = [ - * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.filter(food, 'organic'); - * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] - * - * // using "_.where" callback shorthand - * _.filter(food, { 'type': 'fruit' }); - * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] - */ - function filter(collection, callback, thisArg) { - var result = []; - callback = createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (callback(value, index, collection)) { - result.push(value); - } - } - } else { - each(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result.push(value); - } - }); - } - return result; - } - - /** - * Examines each element in a `collection`, returning the first that the `callback` - * returns truthy for. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias detect - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the element that passed the callback check, - * else `undefined`. - * @example - * - * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => 2 - * - * var food = [ - * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - * { 'name': 'banana', 'organic': true, 'type': 'fruit' }, - * { 'name': 'beet', 'organic': false, 'type': 'vegetable' }, - * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } - * ]; - * - * // using "_.where" callback shorthand - * var veggie = _.find(food, { 'type': 'vegetable' }); - * // => { 'name': 'beet', 'organic': false, 'type': 'vegetable' } - * - * // using "_.pluck" callback shorthand - * var healthy = _.find(food, 'organic'); - * // => { 'name': 'banana', 'organic': true, 'type': 'fruit' } - */ - function find(collection, callback, thisArg) { - var result; - callback = createCallback(callback, thisArg); - - forEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result = value; - return false; - } - }); - return result; - } - - /** - * Iterates over a `collection`, executing the `callback` for each element in - * the `collection`. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). Callbacks may exit iteration early - * by explicitly returning `false`. - * - * @static - * @memberOf _ - * @alias each - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|String} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEach(alert).join(','); - * // => alerts each number and returns '1,2,3' - * - * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); - * // => alerts each number value (order is not guaranteed) - */ - function forEach(collection, callback, thisArg) { - if (callback && typeof thisArg == 'undefined' && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (callback(collection[index], index, collection) === false) { - break; - } - } - } else { - each(collection, callback, thisArg); - } - return collection; - } - - /** - * Creates an object composed of keys returned from running each element of the - * `collection` through the `callback`. The corresponding value of each key is - * an array of elements passed to `callback` that returned the key. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false` - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * // using "_.pluck" callback shorthand - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - function groupBy(collection, callback, thisArg) { - var result = {}; - callback = createCallback(callback, thisArg); - - forEach(collection, function(value, key, collection) { - key = callback(value, key, collection) + ''; - (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); - }); - return result; - } - - /** - * Invokes the method named by `methodName` on each element in the `collection`, - * returning an array of the results of each invoked method. Additional arguments - * will be passed to each invoked method. If `methodName` is a function, it will - * be invoked for, and `this` bound to, each element in the `collection`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} Returns a new array of the results of each invoked method. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - function invoke(collection, methodName) { - var args = slice(arguments, 2), - index = -1, - isFunc = typeof methodName == 'function', - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - forEach(collection, function(value) { - result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args); - }); - return result; - } - - /** - * Creates an array of values by running each element in the `collection` - * through the `callback`. The `callback` is bound to `thisArg` and invoked with - * three arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias collect - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of the results of each `callback` execution. - * @example - * - * _.map([1, 2, 3], function(num) { return num * 3; }); - * // => [3, 6, 9] - * - * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * // using "_.pluck" callback shorthand - * _.map(stooges, 'name'); - * // => ['moe', 'larry'] - */ - function map(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - callback = createCallback(callback, thisArg); - if (isArray(collection)) { - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - each(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); - } - return result; - } - - /** - * Retrieves the maximum value of an `array`. If `callback` is passed, - * it will be executed for each value in the `array` to generate the - * criterion by which the value is ranked. The `callback` is bound to - * `thisArg` and invoked with three arguments; (value, index, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the maximum value. - * @example - * - * _.max([4, 2, 8, 6]); - * // => 8 - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * _.max(stooges, function(stooge) { return stooge.age; }); - * // => { 'name': 'larry', 'age': 50 }; - * - * // using "_.pluck" callback shorthand - * _.max(stooges, 'age'); - * // => { 'name': 'larry', 'age': 50 }; - */ - function max(collection, callback, thisArg) { - var computed = -Infinity, - result = computed; - - if (!callback && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (value > result) { - result = value; - } - } - } else { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - each(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current > computed) { - computed = current; - result = value; - } - }); - } - return result; - } - - /** - * Retrieves the minimum value of an `array`. If `callback` is passed, - * it will be executed for each value in the `array` to generate the - * criterion by which the value is ranked. The `callback` is bound to `thisArg` - * and invoked with three arguments; (value, index, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the minimum value. - * @example - * - * _.min([4, 2, 8, 6]); - * // => 2 - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * _.min(stooges, function(stooge) { return stooge.age; }); - * // => { 'name': 'moe', 'age': 40 }; - * - * // using "_.pluck" callback shorthand - * _.min(stooges, 'age'); - * // => { 'name': 'moe', 'age': 40 }; - */ - function min(collection, callback, thisArg) { - var computed = Infinity, - result = computed; - - if (!callback && isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - var value = collection[index]; - if (value < result) { - result = value; - } - } - } else { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - each(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current < computed) { - computed = current; - result = value; - } - }); - } - return result; - } - - /** - * Retrieves the value of a specified property from all elements in the `collection`. - * - * @static - * @memberOf _ - * @type Function - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {String} property The property to pluck. - * @returns {Array} Returns a new array of property values. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * _.pluck(stooges, 'name'); - * // => ['moe', 'larry'] - */ - var pluck = map; - - /** - * Reduces a `collection` to a value that is the accumulated result of running - * each element in the `collection` through the `callback`, where each successive - * `callback` execution consumes the return value of the previous execution. - * If `accumulator` is not passed, the first element of the `collection` will be - * used as the initial `accumulator` value. The `callback` is bound to `thisArg` - * and invoked with four arguments; (accumulator, value, index|key, collection). - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [accumulator] Initial value of the accumulator. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the accumulated value. - * @example - * - * var sum = _.reduce([1, 2, 3], function(sum, num) { - * return sum + num; - * }); - * // => 6 - * - * var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { - * result[key] = num * 3; - * return result; - * }, {}); - * // => { 'a': 3, 'b': 6, 'c': 9 } - */ - function reduce(collection, callback, accumulator, thisArg) { - var noaccum = arguments.length < 3; - callback = createCallback(callback, thisArg, 4); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - if (noaccum) { - accumulator = collection[++index]; - } - while (++index < length) { - accumulator = callback(accumulator, collection[index], index, collection); - } - } else { - each(collection, function(value, index, collection) { - accumulator = noaccum - ? (noaccum = false, value) - : callback(accumulator, value, index, collection) - }); - } - return accumulator; - } - - /** - * This method is similar to `_.reduce`, except that it iterates over a - * `collection` from right to left. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [accumulator] Initial value of the accumulator. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the accumulated value. - * @example - * - * var list = [[0, 1], [2, 3], [4, 5]]; - * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, callback, accumulator, thisArg) { - var iterable = collection, - length = collection ? collection.length : 0, - noaccum = arguments.length < 3; - - if (typeof length != 'number') { - var props = keys(collection); - length = props.length; - } else if (noCharByIndex && isString(collection)) { - iterable = collection.split(''); - } - callback = createCallback(callback, thisArg, 4); - forEach(collection, function(value, index, collection) { - index = props ? props[--length] : --length; - accumulator = noaccum - ? (noaccum = false, iterable[index]) - : callback(accumulator, iterable[index], index, collection); - }); - return accumulator; - } - - /** - * The opposite of `_.filter`, this method returns the elements of a - * `collection` that `callback` does **not** return truthy for. - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that did **not** pass the - * callback check. - * @example - * - * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [1, 3, 5] - * - * var food = [ - * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.reject(food, 'organic'); - * // => [{ 'name': 'apple', 'organic': false, 'type': 'fruit' }] - * - * // using "_.where" callback shorthand - * _.reject(food, { 'type': 'fruit' }); - * // => [{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }] - */ - function reject(collection, callback, thisArg) { - callback = createCallback(callback, thisArg); - return filter(collection, function(value, index, collection) { - return !callback(value, index, collection); - }); - } - - /** - * Creates an array of shuffled `array` values, using a version of the - * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to shuffle. - * @returns {Array} Returns a new shuffled collection. - * @example - * - * _.shuffle([1, 2, 3, 4, 5, 6]); - * // => [4, 1, 6, 3, 5, 2] - */ - function shuffle(collection) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - forEach(collection, function(value) { - var rand = floor(nativeRandom() * (++index + 1)); - result[index] = result[rand]; - result[rand] = value; - }); - return result; - } - - /** - * Gets the size of the `collection` by returning `collection.length` for arrays - * and array-like objects or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to inspect. - * @returns {Number} Returns `collection.length` or number of own enumerable properties. - * @example - * - * _.size([1, 2]); - * // => 2 - * - * _.size({ 'one': 1, 'two': 2, 'three': 3 }); - * // => 3 - * - * _.size('curly'); - * // => 5 - */ - function size(collection) { - var length = collection ? collection.length : 0; - return typeof length == 'number' ? length : keys(collection).length; - } - - /** - * Checks if the `callback` returns a truthy value for **any** element of a - * `collection`. The function returns as soon as it finds passing value, and - * does not iterate over the entire `collection`. The `callback` is bound to - * `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias any - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Boolean} Returns `true` if any element passes the callback check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false], Boolean); - * // => true - * - * var food = [ - * { 'name': 'apple', 'organic': false, 'type': 'fruit' }, - * { 'name': 'carrot', 'organic': true, 'type': 'vegetable' } - * ]; - * - * // using "_.pluck" callback shorthand - * _.some(food, 'organic'); - * // => true - * - * // using "_.where" callback shorthand - * _.some(food, { 'type': 'meat' }); - * // => false - */ - function some(collection, callback, thisArg) { - var result; - callback = createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if ((result = callback(collection[index], index, collection))) { - break; - } - } - } else { - each(collection, function(value, index, collection) { - return !(result = callback(value, index, collection)); - }); - } - return !!result; - } - - /** - * Creates an array of elements, sorted in ascending order by the results of - * running each element in the `collection` through the `callback`. This method - * performs a stable sort, that is, it will preserve the original sort order of - * equal elements. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of sorted elements. - * @example - * - * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); - * // => [3, 1, 2] - * - * // using "_.pluck" callback shorthand - * _.sortBy(['banana', 'strawberry', 'apple'], 'length'); - * // => ['apple', 'banana', 'strawberry'] - */ - function sortBy(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - callback = createCallback(callback, thisArg); - forEach(collection, function(value, key, collection) { - result[++index] = { - 'criteria': callback(value, key, collection), - 'index': index, - 'value': value - }; - }); - - length = result.length; - result.sort(compareAscending); - while (length--) { - result[length] = result[length].value; - } - return result; - } - - /** - * Converts the `collection` to an array. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to convert. - * @returns {Array} Returns the new converted array. - * @example - * - * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); - * // => [2, 3, 4] - */ - function toArray(collection) { - if (collection && typeof collection.length == 'number') { - return noCharByIndex && isString(collection) - ? collection.split('') - : slice(collection); - } - return values(collection); - } - - /** - * Examines each element in a `collection`, returning an array of all elements - * that have the given `properties`. When checking `properties`, this method - * performs a deep comparison between values to determine if they are equivalent - * to each other. - * - * @static - * @memberOf _ - * @type Function - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Object} properties The object of property values to filter by. - * @returns {Array} Returns a new array of elements that have the given `properties`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 } - * ]; - * - * _.where(stooges, { 'age': 40 }); - * // => [{ 'name': 'moe', 'age': 40 }] - */ - var where = filter; - - /*--------------------------------------------------------------------------*/ - - /** - * Creates an array with all falsey values of `array` removed. The values - * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to compact. - * @returns {Array} Returns a new filtered array. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result.push(value); - } - } - return result; - } - - /** - * Creates an array of `array` elements not present in the other arrays - * using strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to process. - * @param {Array} [array1, array2, ...] Arrays to check. - * @returns {Array} Returns a new array of `array` elements not present in the - * other arrays. - * @example - * - * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); - * // => [1, 3, 4] - */ - function difference(array) { - var index = -1, - length = array ? array.length : 0, - flattened = concat.apply(arrayRef, arguments), - contains = cachedContains(flattened, length), - result = []; - - while (++index < length) { - var value = array[index]; - if (!contains(value)) { - result.push(value); - } - } - return result; - } - - /** - * Gets the first element of the `array`. If a number `n` is passed, the first - * `n` elements of the `array` are returned. If a `callback` function is passed, - * the first elements the `callback` returns truthy for are returned. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias head, take - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|Number|String} [callback|n] The function called - * per element or the number of elements to return. If a property name or - * object is passed, it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the first element(s) of `array`. - * @example - * - * _.first([1, 2, 3]); - * // => 1 - * - * _.first([1, 2, 3], 2); - * // => [1, 2] - * - * _.first([1, 2, 3], function(num) { - * return num < 3; - * }); - * // => [1, 2] - * - * var food = [ - * { 'name': 'banana', 'organic': true }, - * { 'name': 'beet', 'organic': false }, - * ]; - * - * // using "_.pluck" callback shorthand - * _.first(food, 'organic'); - * // => [{ 'name': 'banana', 'organic': true }] - * - * var food = [ - * { 'name': 'apple', 'type': 'fruit' }, - * { 'name': 'banana', 'type': 'fruit' }, - * { 'name': 'beet', 'type': 'vegetable' } - * ]; - * - * // using "_.where" callback shorthand - * _.first(food, { 'type': 'fruit' }); - * // => [{ 'name': 'apple', 'type': 'fruit' }, { 'name': 'banana', 'type': 'fruit' }] - */ - function first(array, callback, thisArg) { - if (array) { - var n = 0, - length = array.length; - - if (typeof callback != 'number' && callback != null) { - var index = -1; - callback = createCallback(callback, thisArg); - while (++index < length && callback(array[index], index, array)) { - n++; - } - } else { - n = callback; - if (n == null || thisArg) { - return array[0]; - } - } - return slice(array, 0, nativeMin(nativeMax(0, n), length)); - } - } - - /** - * Flattens a nested array (the nesting can be to any depth). If `shallow` is - * truthy, `array` will only be flattened a single level. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to compact. - * @param {Boolean} shallow A flag to indicate only flattening a single level. - * @returns {Array} Returns a new flattened array. - * @example - * - * _.flatten([1, [2], [3, [[4]]]]); - * // => [1, 2, 3, 4]; - * - * _.flatten([1, [2], [3, [[4]]]], true); - * // => [1, 2, 3, [[4]]]; - */ - function flatten(array, shallow) { - var index = -1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - - // recursively flatten arrays (susceptible to call stack limits) - if (isArray(value)) { - push.apply(result, shallow ? value : flatten(value)); - } else { - result.push(value); - } - } - return result; - } - - /** - * Gets the index at which the first occurrence of `value` is found using - * strict equality for comparisons, i.e. `===`. If the `array` is already - * sorted, passing `true` for `fromIndex` will run a faster binary search. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to - * perform a binary search on a sorted `array`. - * @returns {Number} Returns the index of the matched value or `-1`. - * @example - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2); - * // => 1 - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 4 - * - * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var index = -1, - length = array ? array.length : 0; - - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; - } else if (fromIndex) { - index = sortedIndex(array, value); - return array[index] === value ? index : -1; - } - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Gets all but the last element of `array`. If a number `n` is passed, the - * last `n` elements are excluded from the result. If a `callback` function - * is passed, the last elements the `callback` returns truthy for are excluded - * from the result. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index, array). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|Number|String} [callback|n=1] The function called - * per element or the number of elements to exclude. If a property name or - * object is passed, it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a slice of `array`. - * @example - * - * _.initial([1, 2, 3]); - * // => [1, 2] - * - * _.initial([1, 2, 3], 2); - * // => [1] - * - * _.initial([1, 2, 3], function(num) { - * return num > 1; - * }); - * // => [1] - * - * var food = [ - * { 'name': 'beet', 'organic': false }, - * { 'name': 'carrot', 'organic': true } - * ]; - * - * // using "_.pluck" callback shorthand - * _.initial(food, 'organic'); - * // => [{ 'name': 'beet', 'organic': false }] - * - * var food = [ - * { 'name': 'banana', 'type': 'fruit' }, - * { 'name': 'beet', 'type': 'vegetable' }, - * { 'name': 'carrot', 'type': 'vegetable' } - * ]; - * - * // using "_.where" callback shorthand - * _.initial(food, { 'type': 'vegetable' }); - * // => [{ 'name': 'banana', 'type': 'fruit' }] - */ - function initial(array, callback, thisArg) { - if (!array) { - return []; - } - var n = 0, - length = array.length; - - if (typeof callback != 'number' && callback != null) { - var index = length; - callback = createCallback(callback, thisArg); - while (index-- && callback(array[index], index, array)) { - n++; - } - } else { - n = (callback == null || thisArg) ? 1 : callback || n; - } - return slice(array, 0, nativeMin(nativeMax(0, length - n), length)); - } - - /** - * Computes the intersection of all the passed-in arrays using strict equality - * for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of unique elements that are present - * in **all** of the arrays. - * @example - * - * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); - * // => [1, 2] - */ - function intersection(array) { - var args = arguments, - argsLength = args.length, - cache = { '0': {} }, - index = -1, - length = array ? array.length : 0, - isLarge = length >= 100, - result = [], - seen = result; - - outer: - while (++index < length) { - var value = array[index]; - if (isLarge) { - var key = value + ''; - var inited = hasOwnProperty.call(cache[0], key) - ? !(seen = cache[0][key]) - : (seen = cache[0][key] = []); - } - if (inited || indexOf(seen, value) < 0) { - if (isLarge) { - seen.push(value); - } - var argsIndex = argsLength; - while (--argsIndex) { - if (!(cache[argsIndex] || (cache[argsIndex] = cachedContains(args[argsIndex], 0, 100)))(value)) { - continue outer; - } - } - result.push(value); - } - } - return result; - } - - /** - * Gets the last element of the `array`. If a number `n` is passed, the last - * `n` elements of the `array` are returned. If a `callback` function is passed, - * the last elements the `callback` returns truthy for are returned. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|Number|String} [callback|n] The function called - * per element or the number of elements to return. If a property name or - * object is passed, it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the last element(s) of `array`. - * @example - * - * _.last([1, 2, 3]); - * // => 3 - * - * _.last([1, 2, 3], 2); - * // => [2, 3] - * - * _.last([1, 2, 3], function(num) { - * return num > 1; - * }); - * // => [2, 3] - * - * var food = [ - * { 'name': 'beet', 'organic': false }, - * { 'name': 'carrot', 'organic': true } - * ]; - * - * // using "_.pluck" callback shorthand - * _.last(food, 'organic'); - * // => [{ 'name': 'carrot', 'organic': true }] - * - * var food = [ - * { 'name': 'banana', 'type': 'fruit' }, - * { 'name': 'beet', 'type': 'vegetable' }, - * { 'name': 'carrot', 'type': 'vegetable' } - * ]; - * - * // using "_.where" callback shorthand - * _.last(food, { 'type': 'vegetable' }); - * // => [{ 'name': 'beet', 'type': 'vegetable' }, { 'name': 'carrot', 'type': 'vegetable' }] - */ - function last(array, callback, thisArg) { - if (array) { - var n = 0, - length = array.length; - - if (typeof callback != 'number' && callback != null) { - var index = length; - callback = createCallback(callback, thisArg); - while (index-- && callback(array[index], index, array)) { - n++; - } - } else { - n = callback; - if (n == null || thisArg) { - return array[length - 1]; - } - } - return slice(array, nativeMax(0, length - n)); - } - } - - /** - * Gets the index at which the last occurrence of `value` is found using strict - * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used - * as the offset from the end of the collection. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=array.length-1] The index to search from. - * @returns {Number} Returns the index of the matched value or `-1`. - * @example - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); - * // => 4 - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var index = array ? array.length : 0; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Creates an object composed from arrays of `keys` and `values`. Pass either - * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or - * two arrays, one of `keys` and one of corresponding `values`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} keys The array of keys. - * @param {Array} [values=[]] The array of values. - * @returns {Object} Returns an object composed of the given keys and - * corresponding values. - * @example - * - * _.object(['moe', 'larry'], [30, 40]); - * // => { 'moe': 30, 'larry': 40 } - */ - function object(keys, values) { - var index = -1, - length = keys ? keys.length : 0, - result = {}; - - while (++index < length) { - var key = keys[index]; - if (values) { - result[key] = values[index]; - } else { - result[key[0]] = key[1]; - } - } - return result; - } - - /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to but not including `end`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Number} [start=0] The start of the range. - * @param {Number} end The end of the range. - * @param {Number} [step=1] The value to increment or descrement by. - * @returns {Array} Returns a new range array. - * @example - * - * _.range(10); - * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - * - * _.range(1, 11); - * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - * - * _.range(0, 30, 5); - * // => [0, 5, 10, 15, 20, 25] - * - * _.range(0, -10, -1); - * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] - * - * _.range(0); - * // => [] - */ - function range(start, end, step) { - start = +start || 0; - step = +step || 1; - - if (end == null) { - end = start; - start = 0; - } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode - // http://youtu.be/XAqIpGU8ZZk#t=17m25s - var index = -1, - length = nativeMax(0, ceil((end - start) / step)), - result = Array(length); - - while (++index < length) { - result[index] = start; - start += step; - } - return result; - } - - /** - * The opposite of `_.initial`, this method gets all but the first value of `array`. - * If a number `n` is passed, the first `n` values are excluded from the result. - * If a `callback` function is passed, the first elements the `callback` returns - * truthy for are excluded from the result. The `callback` is bound to `thisArg` - * and invoked with three arguments; (value, index, array). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias drop, tail - * @category Arrays - * @param {Array} array The array to query. - * @param {Function|Object|Number|String} [callback|n=1] The function called - * per element or the number of elements to exclude. If a property name or - * object is passed, it will be used to create a "_.pluck" or "_.where" - * style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a slice of `array`. - * @example - * - * _.rest([1, 2, 3]); - * // => [2, 3] - * - * _.rest([1, 2, 3], 2); - * // => [3] - * - * _.rest([1, 2, 3], function(num) { - * return num < 3; - * }); - * // => [3] - * - * var food = [ - * { 'name': 'banana', 'organic': true }, - * { 'name': 'beet', 'organic': false }, - * ]; - * - * // using "_.pluck" callback shorthand - * _.rest(food, 'organic'); - * // => [{ 'name': 'beet', 'organic': false }] - * - * var food = [ - * { 'name': 'apple', 'type': 'fruit' }, - * { 'name': 'banana', 'type': 'fruit' }, - * { 'name': 'beet', 'type': 'vegetable' } - * ]; - * - * // using "_.where" callback shorthand - * _.rest(food, { 'type': 'fruit' }); - * // => [{ 'name': 'beet', 'type': 'vegetable' }] - */ - function rest(array, callback, thisArg) { - if (typeof callback != 'number' && callback != null) { - var n = 0, - index = -1, - length = array ? array.length : 0; - - callback = createCallback(callback, thisArg); - while (++index < length && callback(array[index], index, array)) { - n++; - } - } else { - n = (callback == null || thisArg) ? 1 : nativeMax(0, callback); - } - return slice(array, n); - } - - /** - * Uses a binary search to determine the smallest index at which the `value` - * should be inserted into `array` in order to maintain the sort order of the - * sorted `array`. If `callback` is passed, it will be executed for `value` and - * each element in `array` to compute their sort ranking. The `callback` is - * bound to `thisArg` and invoked with one argument; (value). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to iterate over. - * @param {Mixed} value The value to evaluate. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Number} Returns the index at which the value should be inserted - * into `array`. - * @example - * - * _.sortedIndex([20, 30, 50], 40); - * // => 2 - * - * // using "_.pluck" callback shorthand - * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 2 - * - * var dict = { - * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } - * }; - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return dict.wordToNumber[word]; - * }); - * // => 2 - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return this.wordToNumber[word]; - * }, dict); - * // => 2 - */ - function sortedIndex(array, value, callback, thisArg) { - var low = 0, - high = array ? array.length : low; - - // explicitly reference `identity` for better inlining in Firefox - callback = callback ? createCallback(callback, thisArg, 1) : identity; - value = callback(value); - - while (low < high) { - var mid = (low + high) >>> 1; - callback(array[mid]) < value - ? low = mid + 1 - : high = mid; - } - return low; - } - - /** - * Computes the union of the passed-in arrays using strict equality for - * comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of unique values, in order, that are - * present in one or more of the arrays. - * @example - * - * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); - * // => [1, 2, 3, 101, 10] - */ - function union() { - return uniq(concat.apply(arrayRef, arguments)); - } - - /** - * Creates a duplicate-value-free version of the `array` using strict equality - * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` - * for `isSorted` will run a faster algorithm. If `callback` is passed, each - * element of `array` is passed through a callback` before uniqueness is computed. - * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * If a property name is passed for `callback`, the created "_.pluck" style - * callback will return the property value of the given element. - * - * If an object is passed for `callback`, the created "_.where" style callback - * will return `true` for elements that have the propeties of the given object, - * else `false`. - * - * @static - * @memberOf _ - * @alias unique - * @category Arrays - * @param {Array} array The array to process. - * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. - * @param {Function|Object|String} [callback=identity] The function called per - * iteration. If a property name or object is passed, it will be used to create - * a "_.pluck" or "_.where" style callback, respectively. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a duplicate-value-free array. - * @example - * - * _.uniq([1, 2, 1, 3, 1]); - * // => [1, 2, 3] - * - * _.uniq([1, 1, 2, 2, 3], true); - * // => [1, 2, 3] - * - * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); - * // => [1, 2, 3] - * - * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); - * // => [1, 2, 3] - * - * // using "_.pluck" callback shorthand - * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); - * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniq(array, isSorted, callback, thisArg) { - var index = -1, - length = array ? array.length : 0, - result = [], - seen = result; - - // juggle arguments - if (typeof isSorted == 'function') { - thisArg = callback; - callback = isSorted; - isSorted = false; - } - // init value cache for large arrays - var isLarge = !isSorted && length >= 75; - if (isLarge) { - var cache = {}; - } - if (callback) { - seen = []; - callback = createCallback(callback, thisArg); - } - while (++index < length) { - var value = array[index], - computed = callback ? callback(value, index, array) : value; - - if (isLarge) { - var key = computed + ''; - var inited = hasOwnProperty.call(cache, key) - ? !(seen = cache[key]) - : (seen = cache[key] = []); - } - if (isSorted - ? !index || seen[seen.length - 1] !== computed - : inited || indexOf(seen, computed) < 0 - ) { - if (callback || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * Creates an array with all occurrences of the passed values removed using - * strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to filter. - * @param {Mixed} [value1, value2, ...] Values to remove. - * @returns {Array} Returns a new filtered array. - * @example - * - * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); - * // => [2, 3, 4] - */ - function without(array) { - var index = -1, - length = array ? array.length : 0, - contains = cachedContains(arguments, 1), - result = []; - - while (++index < length) { - var value = array[index]; - if (!contains(value)) { - result.push(value); - } - } - return result; - } - - /** - * Groups the elements of each array at their corresponding indexes. Useful for - * separate data sources that are coordinated through matching array indexes. - * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix - * in a similar fashion. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of grouped elements. - * @example - * - * _.zip(['moe', 'larry'], [30, 40], [true, false]); - * // => [['moe', 30, true], ['larry', 40, false]] - */ - function zip(array) { - var index = -1, - length = array ? max(pluck(arguments, 'length')) : 0, - result = Array(length); - - while (++index < length) { - result[index] = pluck(arguments, index); - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function that is restricted to executing `func` only after it is - * called `n` times. The `func` is executed with the `this` binding of the - * created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Number} n The number of times the function must be called before - * it is executed. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var renderNotes = _.after(notes.length, render); - * _.forEach(notes, function(note) { - * note.asyncSave({ 'success': renderNotes }); - * }); - * // `renderNotes` is run once, after all notes have saved - */ - function after(n, func) { - if (n < 1) { - return func(); - } - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that, when called, invokes `func` with the `this` - * binding of `thisArg` and prepends any additional `bind` arguments to those - * passed to the bound function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to bind. - * @param {Mixed} [thisArg] The `this` binding of `func`. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var func = function(greeting) { - * return greeting + ' ' + this.name; - * }; - * - * func = _.bind(func, { 'name': 'moe' }, 'hi'); - * func(); - * // => 'hi moe' - */ - function bind(func, thisArg) { - // use `Function#bind` if it exists and is fast - // (in V8 `Function#bind` is slower except when partially applied) - return isBindFast || (nativeBind && arguments.length > 2) - ? nativeBind.call.apply(nativeBind, arguments) - : createBound(func, thisArg, slice(arguments, 2)); - } - - /** - * Binds methods on `object` to `object`, overwriting the existing method. - * Method names may be specified as individual arguments or as arrays of method - * names. If no method names are provided, all the function properties of `object` - * will be bound. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object to bind and assign the bound methods to. - * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. - * @returns {Object} Returns `object`. - * @example - * - * var view = { - * 'label': 'docs', - * 'onClick': function() { alert('clicked ' + this.label); } - * }; - * - * _.bindAll(view); - * jQuery('#docs').on('click', view.onClick); - * // => alerts 'clicked docs', when the button is clicked - */ - function bindAll(object) { - var funcs = concat.apply(arrayRef, arguments), - index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), - length = funcs.length; - - while (++index < length) { - var key = funcs[index]; - object[key] = bind(object[key], object); - } - return object; - } - - /** - * Creates a function that, when called, invokes the method at `object[key]` - * and prepends any additional `bindKey` arguments to those passed to the bound - * function. This method differs from `_.bind` by allowing bound functions to - * reference methods that will be redefined or don't yet exist. - * See http://michaux.ca/articles/lazy-function-definition-pattern. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object the method belongs to. - * @param {String} key The key of the method. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'name': 'moe', - * 'greet': function(greeting) { - * return greeting + ' ' + this.name; - * } - * }; - * - * var func = _.bindKey(object, 'greet', 'hi'); - * func(); - * // => 'hi moe' - * - * object.greet = function(greeting) { - * return greeting + ', ' + this.name + '!'; - * }; - * - * func(); - * // => 'hi, moe!' - */ - function bindKey(object, key) { - return createBound(object, key, slice(arguments, 2)); - } - - /** - * Creates a function that is the composition of the passed functions, - * where each function consumes the return value of the function that follows. - * For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} [func1, func2, ...] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var greet = function(name) { return 'hi ' + name; }; - * var exclaim = function(statement) { return statement + '!'; }; - * var welcome = _.compose(exclaim, greet); - * welcome('moe'); - * // => 'hi moe!' - */ - function compose() { - var funcs = arguments; - return function() { - var args = arguments, - length = funcs.length; - - while (length--) { - args = [funcs[length].apply(this, args)]; - } - return args[0]; - }; - } - - /** - * Creates a function that will delay the execution of `func` until after - * `wait` milliseconds have elapsed since the last time it was invoked. Pass - * `true` for `immediate` to cause debounce to invoke `func` on the leading, - * instead of the trailing, edge of the `wait` timeout. Subsequent calls to - * the debounced function will return the result of the last `func` call. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to debounce. - * @param {Number} wait The number of milliseconds to delay. - * @param {Boolean} immediate A flag to indicate execution is on the leading - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * var lazyLayout = _.debounce(calculateLayout, 300); - * jQuery(window).on('resize', lazyLayout); - */ - function debounce(func, wait, immediate) { - var args, - result, - thisArg, - timeoutId; - - function delayed() { - timeoutId = null; - if (!immediate) { - result = func.apply(thisArg, args); - } - } - return function() { - var isImmediate = immediate && !timeoutId; - args = arguments; - thisArg = this; - - clearTimeout(timeoutId); - timeoutId = setTimeout(delayed, wait); - - if (isImmediate) { - result = func.apply(thisArg, args); - } - return result; - }; - } - - /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * will be passed to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to delay. - * @param {Number} wait The number of milliseconds to delay execution. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. - * @returns {Number} Returns the `setTimeout` timeout id. - * @example - * - * var log = _.bind(console.log, console); - * _.delay(log, 1000, 'logged later'); - * // => 'logged later' (Appears after one second.) - */ - function delay(func, wait) { - var args = slice(arguments, 2); - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * Defers executing the `func` function until the current call stack has cleared. - * Additional arguments will be passed to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to defer. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. - * @returns {Number} Returns the `setTimeout` timeout id. - * @example - * - * _.defer(function() { alert('deferred'); }); - * // returns from the function before `alert` is called - */ - function defer(func) { - var args = slice(arguments, 1); - return setTimeout(function() { func.apply(undefined, args); }, 1); - } - // use `setImmediate` if it's available in Node.js - if (isV8 && freeModule && typeof setImmediate == 'function') { - defer = bind(setImmediate, window); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * passed, it will be used to determine the cache key for storing the result - * based on the arguments passed to the memoized function. By default, the first - * argument passed to the memoized function is used as the cache key. The `func` - * is executed with the `this` binding of the memoized function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] A function used to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var fibonacci = _.memoize(function(n) { - * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); - * }); - */ - function memoize(func, resolver) { - var cache = {}; - return function() { - var key = (resolver ? resolver.apply(this, arguments) : arguments[0]) + ''; - return hasOwnProperty.call(cache, key) - ? cache[key] - : (cache[key] = func.apply(this, arguments)); - }; - } - - /** - * Creates a function that is restricted to execute `func` once. Repeat calls to - * the function will return the value of the first call. The `func` is executed - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // `initialize` executes `createApplication` once - */ - function once(func) { - var ran, - result; - - return function() { - if (ran) { - return result; - } - ran = true; - result = func.apply(this, arguments); - - // clear the `func` variable so the function may be garbage collected - func = null; - return result; - }; - } - - /** - * Creates a function that, when called, invokes `func` with any additional - * `partial` arguments prepended to those passed to the new function. This - * method is similar to `_.bind`, except it does **not** alter the `this` binding. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to partially apply arguments to. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { return greeting + ' ' + name; }; - * var hi = _.partial(greet, 'hi'); - * hi('moe'); - * // => 'hi moe' - */ - function partial(func) { - return createBound(func, slice(arguments, 1)); - } - - /** - * This method is similar to `_.partial`, except that `partial` arguments are - * appended to those passed to the new function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to partially apply arguments to. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var defaultsDeep = _.partialRight(_.merge, _.defaults); - * - * var options = { - * 'variable': 'data', - * 'imports': { 'jq': $ } - * }; - * - * defaultsDeep(options, _.templateSettings); - * - * options.variable - * // => 'data' - * - * options.imports - * // => { '_': _, 'jq': $ } - */ - function partialRight(func) { - return createBound(func, slice(arguments, 1), null, indicatorObject); - } - - /** - * Creates a function that, when executed, will only call the `func` - * function at most once per every `wait` milliseconds. If the throttled - * function is invoked more than once during the `wait` timeout, `func` will - * also be called on the trailing edge of the timeout. Subsequent calls to the - * throttled function will return the result of the last `func` call. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to throttle. - * @param {Number} wait The number of milliseconds to throttle executions to. - * @returns {Function} Returns the new throttled function. - * @example - * - * var throttled = _.throttle(updatePosition, 100); - * jQuery(window).on('scroll', throttled); - */ - function throttle(func, wait) { - var args, - result, - thisArg, - timeoutId, - lastCalled = 0; - - function trailingCall() { - lastCalled = new Date; - timeoutId = null; - result = func.apply(thisArg, args); - } - return function() { - var now = new Date, - remaining = wait - (now - lastCalled); - - args = arguments; - thisArg = this; - - if (remaining <= 0) { - clearTimeout(timeoutId); - timeoutId = null; - lastCalled = now; - result = func.apply(thisArg, args); - } - else if (!timeoutId) { - timeoutId = setTimeout(trailingCall, remaining); - } - return result; - }; - } - - /** - * Creates a function that passes `value` to the `wrapper` function as its - * first argument. Additional arguments passed to the function are appended - * to those passed to the `wrapper` function. The `wrapper` is executed with - * the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Mixed} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var hello = function(name) { return 'hello ' + name; }; - * hello = _.wrap(hello, function(func) { - * return 'before, ' + func('moe') + ', after'; - * }); - * hello(); - * // => 'before, hello moe, after' - */ - function wrap(value, wrapper) { - return function() { - var args = [value]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their - * corresponding HTML entities. - * - * @static - * @memberOf _ - * @category Utilities - * @param {String} string The string to escape. - * @returns {String} Returns the escaped string. - * @example - * - * _.escape('Moe, Larry & Curly'); - * // => 'Moe, Larry & Curly' - */ - function escape(string) { - return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); - } - - /** - * This function returns the first argument passed to it. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Mixed} value Any value. - * @returns {Mixed} Returns `value`. - * @example - * - * var moe = { 'name': 'moe' }; - * moe === _.identity(moe); - * // => true - */ - function identity(value) { - return value; - } - - /** - * Adds functions properties of `object` to the `lodash` function and chainable - * wrapper. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Object} object The object of function properties to add to `lodash`. - * @example - * - * _.mixin({ - * 'capitalize': function(string) { - * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); - * } - * }); - * - * _.capitalize('moe'); - * // => 'Moe' - * - * _('moe').capitalize(); - * // => 'Moe' - */ - function mixin(object) { - forEach(functions(object), function(methodName) { - var func = lodash[methodName] = object[methodName]; - - lodash.prototype[methodName] = function() { - var args = [this.__wrapped__]; - push.apply(args, arguments); - return new lodash(func.apply(lodash, args)); - }; - }); - } - - /** - * Reverts the '_' variable to its previous value and returns a reference to - * the `lodash` function. - * - * @static - * @memberOf _ - * @category Utilities - * @returns {Function} Returns the `lodash` function. - * @example - * - * var lodash = _.noConflict(); - */ - function noConflict() { - window._ = oldDash; - return this; - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is passed, a number between `0` and the given number will be returned. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Number} [min=0] The minimum possible value. - * @param {Number} [max=1] The maximum possible value. - * @returns {Number} Returns a random number. - * @example - * - * _.random(0, 5); - * // => a number between 0 and 5 - * - * _.random(5); - * // => also a number between 0 and 5 - */ - function random(min, max) { - if (min == null && max == null) { - max = 1; - } - min = +min || 0; - if (max == null) { - max = min; - min = 0; - } - return min + floor(nativeRandom() * ((+max || 0) - min + 1)); - } - - /** - * Resolves the value of `property` on `object`. If `property` is a function, - * it will be invoked and its result returned, else the property value is - * returned. If `object` is falsey, then `null` is returned. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Object} object The object to inspect. - * @param {String} property The property to get the value of. - * @returns {Mixed} Returns the resolved value. - * @example - * - * var object = { - * 'cheese': 'crumpets', - * 'stuff': function() { - * return 'nonsense'; - * } - * }; - * - * _.result(object, 'cheese'); - * // => 'crumpets' - * - * _.result(object, 'stuff'); - * // => 'nonsense' - */ - function result(object, property) { - var value = object ? object[property] : undefined; - return isFunction(value) ? object[property]() : value; - } - - /** - * A micro-templating method that handles arbitrary delimiters, preserves - * whitespace, and correctly escapes quotes within interpolated code. - * - * Note: In the development build, `_.template` utilizes sourceURLs for easier - * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - * - * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` - * build and using precompiled templates, or loading Lo-Dash in a sandbox. - * - * For more information on precompiling templates see: - * http://lodash.com/#custom-builds - * - * For more information on Chrome extension sandboxes see: - * http://developer.chrome.com/stable/extensions/sandboxingEval.html - * - * @static - * @memberOf _ - * @category Utilities - * @param {String} text The template text. - * @param {Obect} data The data object used to populate the text. - * @param {Object} options The options object. - * escape - The "escape" delimiter regexp. - * evaluate - The "evaluate" delimiter regexp. - * interpolate - The "interpolate" delimiter regexp. - * sourceURL - The sourceURL of the template's compiled source. - * variable - The data object variable name. - * - * @returns {Function|String} Returns a compiled function when no `data` object - * is given, else it returns the interpolated text. - * @example - * - * // using a compiled template - * var compiled = _.template('hello <%= name %>'); - * compiled({ 'name': 'moe' }); - * // => 'hello moe' - * - * var list = '<% _.forEach(people, function(name) { %>
  • <%= name %>
  • <% }); %>'; - * _.template(list, { 'people': ['moe', 'larry'] }); - * // => '
  • moe
  • larry
  • ' - * - * // using the "escape" delimiter to escape HTML in data property values - * _.template('<%- value %>', { 'value': '\n```\n\nUsing [`npm`](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nTo avoid potential issues, update `npm` before installing Lo-Dash:\n\n```bash\nnpm install npm -g\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n\n// or as a drop-in replacement for Underscore\nvar _ = require('lodash/lodash.underscore');\n```\n\n**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Release Notes\n\n### v1.0.1\n\n * Add support for specifying source map URLs in `-p`/`--source-map` build options\n * Ensured the second argument passed to `_.assign` is not treated as a `callback`\n * Ensured `-p`/`--source-map` build options correctly set the `sourceMappingURL`\n * Made `-p`/`--source-map` build options set source map *“sources”* keys based on the builds performed\n * Made `_.defer` use `setImmediate`, in Node.js, when available\n * Made `_.where` search arrays for values regardless of their index position\n * Removed dead code from `_.template`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", - "readmeFilename": "README.md", - "_id": "lodash@1.0.1", - "_from": "lodash@~1.0.1" -} diff --git a/node_modules/grunt/node_modules/findup-sync/package.json b/node_modules/grunt/node_modules/findup-sync/package.json deleted file mode 100644 index 7940868..0000000 --- a/node_modules/grunt/node_modules/findup-sync/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "findup-sync", - "description": "Find the first file matching a given pattern in the current directory or the nearest ancestor directory.", - "version": "0.1.2", - "homepage": "https://github.com/cowboy/node-findup-sync", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/node-findup-sync.git" - }, - "bugs": { - "url": "https://github.com/cowboy/node-findup-sync/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/node-findup-sync/blob/master/LICENSE-MIT" - } - ], - "main": "lib/findup-sync", - "engines": { - "node": ">= 0.6.0" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "dependencies": { - "glob": "~3.1.21", - "lodash": "~1.0.1" - }, - "devDependencies": { - "grunt": "~0.4.0", - "grunt-contrib-jshint": "~0.2.0", - "grunt-contrib-nodeunit": "~0.1.2" - }, - "keywords": [ - "find", - "glob", - "file" - ], - "readme": "# findup-sync\n\nFind the first file matching a given pattern in the current directory or the nearest ancestor directory.\n\n## Getting Started\nInstall the module with: `npm install findup-sync`\n\n```js\nvar findup = require('findup-sync');\n\n// Start looking in the CWD.\nvar filepath1 = findup('{a,b}*.txt');\n\n// Start looking somewhere else, and ignore case (probably a good idea).\nvar filepath2 = findup('{a,b}*.txt', {cwd: '/some/path', nocase: true});\n```\n\n## Usage\n\n```js\nfindup(patternOrPatterns [, minimatchOptions])\n```\n\n### patternOrPatterns\nType: `String` or `Array` \nDefault: none\n\nOne or more wildcard glob patterns. Or just filenames.\n\n### minimatchOptions\nType: `Object` \nDefault: `{}`\n\nOptions to be passed to [minimatch](https://github.com/isaacs/minimatch).\n\nNote that if you want to start in a different directory than the current working directory, specify a `cwd` property here.\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n2013-03-08 - v0.1.2 - Updated dependencies. Fixed a Node 0.9.x bug. Updated unit tests to work cross-platform. \n2012-11-15 - v0.1.1 - Now works without an options object. \n2012-11-01 - v0.1.0 - Initial release.\n", - "readmeFilename": "README.md", - "_id": "findup-sync@0.1.2", - "_from": "findup-sync@~0.1.2" -} diff --git a/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js b/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js deleted file mode 100644 index f8baf9e..0000000 --- a/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -// Nodejs lib. -var path = require('path'); - -var findup = require('../lib/findup-sync.js'); - -// Get a relative path. -var rel = function(abspath) { - return typeof abspath === 'string' ? path.relative('.', abspath) : abspath; -}; - -exports['findup'] = { - setUp: function(done) { - this.cwd = process.cwd(); - done(); - }, - tearDown: function(done) { - process.chdir(this.cwd); - done(); - }, - 'simple': function(test) { - test.expect(8); - var opts = {cwd: 'test/fixtures/a/b'}; - test.equal(rel(findup('foo.txt', opts)), path.normalize('test/fixtures/a/foo.txt'), 'should find files'); - test.equal(rel(findup('bar.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find files'); - test.equal(rel(findup('a.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should find files'); - test.equal(rel(findup('?.txt', opts)), path.normalize('test/fixtures/a.txt'), 'should support glob patterns'); - test.equal(rel(findup('*.txt', opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches the glob pattern'); - test.equal(rel(findup(['b*.txt', 'f*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); - test.equal(rel(findup(['f*.txt', 'b*.txt'], opts)), path.normalize('test/fixtures/a/b/bar.txt'), 'should find the first thing that matches any of the glob patterns'); - test.equal(findup('not-gonna-exist-i-hope.txt', opts), null, 'should returning null if no files found'); - test.done(); - }, - 'cwd': function(test) { - test.expect(8); - process.chdir('test/fixtures/a/b'); - test.equal(rel(findup('foo.txt')), path.normalize('../foo.txt'), 'should find files'); - test.equal(rel(findup('bar.txt')), 'bar.txt', 'should find files'); - test.equal(rel(findup('a.txt')), path.normalize('../../a.txt'), 'should find files'); - test.equal(rel(findup('?.txt')), path.normalize('../../a.txt'), 'should support glob patterns'); - test.equal(rel(findup('*.txt')), 'bar.txt', 'should find the first thing that matches the glob pattern'); - test.equal(rel(findup(['b*.txt', 'f*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); - test.equal(rel(findup(['f*.txt', 'b*.txt'])), 'bar.txt', 'should find the first thing that matches any of the glob patterns'); - test.equal(findup('not-gonna-exist-i-hope.txt'), null, 'should returning null if no files found'); - test.done(); - }, -}; diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt b/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/getobject/.jshintrc b/node_modules/grunt/node_modules/getobject/.jshintrc deleted file mode 100644 index 2c40c44..0000000 --- a/node_modules/grunt/node_modules/getobject/.jshintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "curly": true, - "eqeqeq": true, - "immed": true, - "latedef": true, - "newcap": true, - "noarg": true, - "sub": true, - "undef": true, - "unused": true, - "boss": true, - "eqnull": true, - "node": true, - "es5": true -} diff --git a/node_modules/grunt/node_modules/getobject/.npmignore b/node_modules/grunt/node_modules/getobject/.npmignore deleted file mode 100644 index 2ccbe46..0000000 --- a/node_modules/grunt/node_modules/getobject/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules/ diff --git a/node_modules/grunt/node_modules/getobject/.travis.yml b/node_modules/grunt/node_modules/getobject/.travis.yml deleted file mode 100644 index cbace30..0000000 --- a/node_modules/grunt/node_modules/getobject/.travis.yml +++ /dev/null @@ -1,6 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" -before_script: - - npm install -g grunt-cli diff --git a/node_modules/grunt/node_modules/getobject/Gruntfile.js b/node_modules/grunt/node_modules/getobject/Gruntfile.js deleted file mode 100644 index c3f7d74..0000000 --- a/node_modules/grunt/node_modules/getobject/Gruntfile.js +++ /dev/null @@ -1,48 +0,0 @@ -'use strict'; - -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - nodeunit: { - files: ['test/**/*_test.js'], - }, - jshint: { - options: { - jshintrc: '.jshintrc' - }, - gruntfile: { - src: 'Gruntfile.js' - }, - lib: { - src: ['lib/**/*.js'] - }, - test: { - src: ['test/*.js'] - }, - }, - watch: { - gruntfile: { - files: '<%= jshint.gruntfile.src %>', - tasks: ['jshint:gruntfile'] - }, - lib: { - files: '<%= jshint.lib.src %>', - tasks: ['jshint:lib', 'nodeunit'] - }, - test: { - files: '<%= jshint.test.src %>', - tasks: ['jshint:test', 'nodeunit'] - }, - }, - }); - - // These plugins provide necessary tasks. - grunt.loadNpmTasks('grunt-contrib-nodeunit'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-watch'); - - // Default task. - grunt.registerTask('default', ['jshint', 'nodeunit']); - -}; diff --git a/node_modules/grunt/node_modules/getobject/LICENSE-MIT b/node_modules/grunt/node_modules/getobject/LICENSE-MIT deleted file mode 100644 index bb2aad6..0000000 --- a/node_modules/grunt/node_modules/getobject/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2013 "Cowboy" Ben Alman - -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/grunt/node_modules/getobject/README.md b/node_modules/grunt/node_modules/getobject/README.md deleted file mode 100644 index 6d27c24..0000000 --- a/node_modules/grunt/node_modules/getobject/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# getobject [![Build Status](https://secure.travis-ci.org/cowboy/node-getobject.png?branch=master)](http://travis-ci.org/cowboy/node-getobject) - -get.and.set.deep.objects.easily = true; - -## Getting Started -Install the module with: `npm install getobject` - -```javascript -var getobject = require('getobject'); -``` - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). - -## Release History -_(Nothing yet)_ - -## License -Copyright (c) 2013 "Cowboy" Ben Alman -Licensed under the MIT license. \ No newline at end of file diff --git a/node_modules/grunt/node_modules/getobject/lib/getobject.js b/node_modules/grunt/node_modules/getobject/lib/getobject.js deleted file mode 100644 index e4006fe..0000000 --- a/node_modules/grunt/node_modules/getobject/lib/getobject.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * getobject - * https://github.com/cowboy/node-getobject - * - * Copyright (c) 2013 "Cowboy" Ben Alman - * Licensed under the MIT license. - */ - -'use strict'; - -var getobject = module.exports = {}; - -// Split strings on dot, but only if dot isn't preceded by a backslash. Since -// JavaScript doesn't support lookbehinds, use a placeholder for "\.", split -// on dot, then replace the placeholder character with a dot. -function getParts(str) { - return str.replace(/\\\./g, '\uffff').split('.').map(function(s) { - return s.replace(/\uffff/g, '.'); - }); -} - -// Get the value of a deeply-nested property exist in an object. -getobject.get = function(obj, parts, create) { - if (typeof parts === 'string') { - parts = getParts(parts); - } - - var part; - while (typeof obj === 'object' && obj && parts.length) { - part = parts.shift(); - if (!(part in obj) && create) { - obj[part] = {}; - } - obj = obj[part]; - } - - return obj; -}; - -// Set a deeply-nested property in an object, creating intermediary objects -// as we go. -getobject.set = function(obj, parts, value) { - parts = getParts(parts); - - var prop = parts.pop(); - obj = getobject.get(obj, parts, true); - if (obj && typeof obj === 'object') { - return (obj[prop] = value); - } -}; - -// Does a deeply-nested property exist in an object? -getobject.exists = function(obj, parts) { - parts = getParts(parts); - - var prop = parts.pop(); - obj = getobject.get(obj, parts); - - return typeof obj === 'object' && obj && prop in obj; -}; diff --git a/node_modules/grunt/node_modules/getobject/package.json b/node_modules/grunt/node_modules/getobject/package.json deleted file mode 100644 index b62bea6..0000000 --- a/node_modules/grunt/node_modules/getobject/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "getobject", - "description": "get.and.set.deep.objects.easily = true", - "version": "0.1.0", - "homepage": "https://github.com/cowboy/node-getobject", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/node-getobject.git" - }, - "bugs": { - "url": "https://github.com/cowboy/node-getobject/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/node-getobject/blob/master/LICENSE-MIT" - } - ], - "main": "lib/getobject", - "engines": { - "node": ">= 0.8.0" - }, - "scripts": { - "test": "grunt nodeunit" - }, - "devDependencies": { - "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-nodeunit": "~0.1.2", - "grunt-contrib-watch": "~0.2.0", - "grunt": "~0.4.1" - }, - "keywords": [ - "dot notation", - "properties", - "get", - "set", - "object", - "dot" - ], - "readme": "# getobject [![Build Status](https://secure.travis-ci.org/cowboy/node-getobject.png?branch=master)](http://travis-ci.org/cowboy/node-getobject)\n\nget.and.set.deep.objects.easily = true;\n\n## Getting Started\nInstall the module with: `npm install getobject`\n\n```javascript\nvar getobject = require('getobject');\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n## Release History\n_(Nothing yet)_\n\n## License\nCopyright (c) 2013 \"Cowboy\" Ben Alman\nLicensed under the MIT license.", - "readmeFilename": "README.md", - "_id": "getobject@0.1.0", - "_from": "getobject@~0.1.0" -} diff --git a/node_modules/grunt/node_modules/getobject/test/namespace_test.js b/node_modules/grunt/node_modules/getobject/test/namespace_test.js deleted file mode 100644 index 2e1c2ae..0000000 --- a/node_modules/grunt/node_modules/getobject/test/namespace_test.js +++ /dev/null @@ -1,51 +0,0 @@ -'use strict'; - -var getobject = require('../lib/getobject'); - -exports.get = { - 'no create': function(test) { - var obj = {a: {b: {c: 1, d: '', e: null, f: undefined, 'g.h.i': 2}}}; - test.strictEqual(getobject.get(obj, 'a'), obj.a, 'should get immediate properties.'); - test.strictEqual(getobject.get(obj, 'a.b'), obj.a.b, 'should get nested properties.'); - test.strictEqual(getobject.get(obj, 'a.x'), undefined, 'should return undefined for nonexistent properties.'); - test.strictEqual(getobject.get(obj, 'a.b.c'), 1, 'should return values.'); - test.strictEqual(getobject.get(obj, 'a.b.d'), '', 'should return values.'); - test.strictEqual(getobject.get(obj, 'a.b.e'), null, 'should return values.'); - test.strictEqual(getobject.get(obj, 'a.b.f'), undefined, 'should return values.'); - test.strictEqual(getobject.get(obj, 'a.b.g\\.h\\.i'), 2, 'literal backslash should escape period in property name.'); - test.done(); - }, - 'create': function(test) { - var obj = {a: 1}; - test.strictEqual(getobject.get(obj, 'a', true), obj.a, 'should just return existing properties.'); - test.strictEqual(getobject.get(obj, 'b', true), obj.b, 'should create immediate properties.'); - test.strictEqual(getobject.get(obj, 'c.d.e', true), obj.c.d.e, 'should create nested properties.'); - test.done(); - } -}; - -exports.set = function(test) { - var obj = {}; - test.strictEqual(getobject.set(obj, 'a', 1), 1, 'should return immediate property value.'); - test.strictEqual(obj.a, 1, 'should set property value.'); - test.strictEqual(getobject.set(obj, 'b.c.d', 1), 1, 'should return nested property value.'); - test.strictEqual(obj.b.c.d, 1, 'should set property value.'); - test.strictEqual(getobject.set(obj, 'e\\.f\\.g', 1), 1, 'literal backslash should escape period in property name.'); - test.strictEqual(obj['e.f.g'], 1, 'should set property value.'); - test.done(); -}; - -exports.exists = function(test) { - var obj = {a: {b: {c: 1, d: '', e: null, f: undefined, 'g.h.i': 2}}}; - test.ok(getobject.exists(obj, 'a'), 'immediate property should exist.'); - test.ok(getobject.exists(obj, 'a.b'), 'nested property should exist.'); - test.ok(getobject.exists(obj, 'a.b.c'), 'nested property should exist.'); - test.ok(getobject.exists(obj, 'a.b.d'), 'nested property should exist.'); - test.ok(getobject.exists(obj, 'a.b.e'), 'nested property should exist.'); - test.ok(getobject.exists(obj, 'a.b.f'), 'nested property should exist.'); - test.ok(getobject.exists(obj, 'a.b.g\\.h\\.i'), 'literal backslash should escape period in property name.'); - test.equal(getobject.exists(obj, 'x'), false, 'nonexistent property should not exist.'); - test.equal(getobject.exists(obj, 'a.x'), false, 'nonexistent property should not exist.'); - test.equal(getobject.exists(obj, 'a.b.x'), false, 'nonexistent property should not exist.'); - test.done(); -}; diff --git a/node_modules/grunt/node_modules/glob/.npmignore b/node_modules/grunt/node_modules/glob/.npmignore deleted file mode 100644 index 2af4b71..0000000 --- a/node_modules/grunt/node_modules/glob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.*.swp -test/a/ diff --git a/node_modules/grunt/node_modules/glob/.travis.yml b/node_modules/grunt/node_modules/glob/.travis.yml deleted file mode 100644 index baa0031..0000000 --- a/node_modules/grunt/node_modules/glob/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - 0.8 diff --git a/node_modules/grunt/node_modules/glob/LICENSE b/node_modules/grunt/node_modules/glob/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/glob/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -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. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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/grunt/node_modules/glob/README.md b/node_modules/grunt/node_modules/glob/README.md deleted file mode 100644 index 6e27df6..0000000 --- a/node_modules/grunt/node_modules/glob/README.md +++ /dev/null @@ -1,233 +0,0 @@ -# Glob - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -## Attention: node-glob users! - -The API has changed dramatically between 2.x and 3.x. This library is -now 100% JavaScript, and the integer flags have been replaced with an -options object. - -Also, there's an event emitter class, proper tests, and all the other -things you've come to expect from node modules. - -And best of all, no compilation! - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Features - -Please see the [minimatch -documentation](https://github.com/isaacs/minimatch) for more details. - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options] - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instanting the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `error` The error encountered. When an error is encountered, the - glob object is in an undefined state, and should be discarded. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `abort` Stop the search. - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the glob object, as well. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. It will cause - ELOOP to be triggered one level sooner in the case of cyclical - symbolic links. -* `silent` When an unusual error is encountered - when attempting to read a directory, a warning will be printed to - stderr. Set the `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered - when attempting to read a directory, the process will just continue on - in search of other matches. Set the `strict` option to raise an error - in these cases. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary to - set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `sync` Perform a synchronous glob search. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. - Set this flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `nocase` Perform a case-insensitive match. Note that case-insensitive - filesystems will sometimes result in glob returning results that are - case-insensitively matched anyway, since readdir and stat will not - raise an error. -* `debug` Set to enable debug logging in minimatch and glob. -* `globDebug` Set to enable debug logging in glob, but not minimatch. - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. **Note that this is different from the way that `**` is -handled by ruby's `Dir` class.** - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the statCache object is reused between glob calls. - -Users are thus advised not to use a glob result as a -guarantee of filesystem state in the face of rapid changes. -For the vast majority of operations, this is never a problem. diff --git a/node_modules/grunt/node_modules/glob/examples/g.js b/node_modules/grunt/node_modules/glob/examples/g.js deleted file mode 100644 index be122df..0000000 --- a/node_modules/grunt/node_modules/glob/examples/g.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "test/a/**/[cg]/../[cg]" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/node_modules/grunt/node_modules/glob/examples/usr-local.js b/node_modules/grunt/node_modules/glob/examples/usr-local.js deleted file mode 100644 index 327a425..0000000 --- a/node_modules/grunt/node_modules/glob/examples/usr-local.js +++ /dev/null @@ -1,9 +0,0 @@ -var Glob = require("../").Glob - -var pattern = "{./*/*,/*,/usr/local/*}" -console.log(pattern) - -var mg = new Glob(pattern, {mark: true}, function (er, matches) { - console.log("matches", matches) -}) -console.log("after") diff --git a/node_modules/grunt/node_modules/glob/glob.js b/node_modules/grunt/node_modules/glob/glob.js deleted file mode 100644 index 891c883..0000000 --- a/node_modules/grunt/node_modules/glob/glob.js +++ /dev/null @@ -1,643 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// readdir(PREFIX) as ENTRIES -// If fails, END -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $]) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $]) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - - - -module.exports = glob - -var fs = require("graceful-fs") -, minimatch = require("minimatch") -, Minimatch = minimatch.Minimatch -, inherits = require("inherits") -, EE = require("events").EventEmitter -, path = require("path") -, isDir = {} -, assert = require("assert").ok - -function glob (pattern, options, cb) { - if (typeof options === "function") cb = options, options = {} - if (!options) options = {} - - if (typeof options === "number") { - deprecated() - return - } - - var g = new Glob(pattern, options, cb) - return g.sync ? g.found : g -} - -glob.fnmatch = deprecated - -function deprecated () { - throw new Error("glob's interface has changed. Please see the docs.") -} - -glob.sync = globSync -function globSync (pattern, options) { - if (typeof options === "number") { - deprecated() - return - } - - options = options || {} - options.sync = true - return glob(pattern, options) -} - - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (!(this instanceof Glob)) { - return new Glob(pattern, options, cb) - } - - if (typeof cb === "function") { - this.on("error", cb) - this.on("end", function (matches) { - cb(null, matches) - }) - } - - options = options || {} - - this.EOF = {} - this._emitQueue = [] - - this.maxDepth = options.maxDepth || 1000 - this.maxLength = options.maxLength || Infinity - this.statCache = options.statCache || {} - - this.changedCwd = false - var cwd = process.cwd() - if (!options.hasOwnProperty("cwd")) this.cwd = cwd - else { - this.cwd = options.cwd - this.changedCwd = path.resolve(options.cwd) !== cwd - } - - this.root = options.root || path.resolve(this.cwd, "/") - this.root = path.resolve(this.root) - if (process.platform === "win32") - this.root = this.root.replace(/\\/g, "/") - - this.nomount = !!options.nomount - - if (!pattern) { - throw new Error("must provide pattern") - } - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - this.strict = options.strict !== false - this.dot = !!options.dot - this.mark = !!options.mark - this.sync = !!options.sync - this.nounique = !!options.nounique - this.nonull = !!options.nonull - this.nosort = !!options.nosort - this.nocase = !!options.nocase - this.stat = !!options.stat - - this.debug = !!options.debug || !!options.globDebug - if (this.debug) - this.log = console.error - - this.silent = !!options.silent - - var mm = this.minimatch = new Minimatch(pattern, options) - this.options = mm.options - pattern = this.pattern = mm.pattern - - this.error = null - this.aborted = false - - EE.call(this) - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - this.minimatch.set.forEach(iterator.bind(this)) - function iterator (pattern, i, set) { - this._process(pattern, 0, i, function (er) { - if (er) this.emit("error", er) - if (-- n <= 0) this._finish() - }) - } -} - -Glob.prototype.log = function () {} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - - var nou = this.nounique - , all = nou ? [] : {} - - for (var i = 0, l = this.matches.length; i < l; i ++) { - var matches = this.matches[i] - this.log("matches[%d] =", i, matches) - // do like the shell, and spit out the literal glob - if (!matches) { - if (this.nonull) { - var literal = this.minimatch.globSet[i] - if (nou) all.push(literal) - else all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) all.push.apply(all, m) - else m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) all = Object.keys(all) - - if (!this.nosort) { - all = all.sort(this.nocase ? alphasorti : alphasort) - } - - if (this.mark) { - // at *some* point we statted all of these - all = all.map(function (m) { - var sc = this.statCache[m] - if (!sc) - return m - var isDir = (Array.isArray(sc) || sc === 2) - if (isDir && m.slice(-1) !== "/") { - return m + "/" - } - if (!isDir && m.slice(-1) === "/") { - return m.replace(/\/+$/, "") - } - return m - }, this) - } - - this.log("emitting end", all) - - this.EOF = this.found = all - this.emitMatch(this.EOF) -} - -function alphasorti (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return alphasort(a, b) -} - -function alphasort (a, b) { - return a > b ? 1 : a < b ? -1 : 0 -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit("abort") -} - -Glob.prototype.pause = function () { - if (this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = true - this.emit("pause") -} - -Glob.prototype.resume = function () { - if (!this.paused) return - if (this.sync) - this.emit("error", new Error("Can't pause/resume sync glob")) - this.paused = false - this.emit("resume") - this._processEmitQueue() - //process.nextTick(this.emit.bind(this, "resume")) -} - -Glob.prototype.emitMatch = function (m) { - this._emitQueue.push(m) - this._processEmitQueue() -} - -Glob.prototype._processEmitQueue = function (m) { - while (!this._processingEmitQueue && - !this.paused) { - this._processingEmitQueue = true - var m = this._emitQueue.shift() - if (!m) { - this._processingEmitQueue = false - break - } - - this.log('emit!', m === this.EOF ? "end" : "match") - - this.emit(m === this.EOF ? "end" : "match", m) - this._processingEmitQueue = false - } -} - -Glob.prototype._process = function (pattern, depth, index, cb_) { - assert(this instanceof Glob) - - var cb = function cb (er, res) { - assert(this instanceof Glob) - if (this.paused) { - if (!this._processQueue) { - this._processQueue = [] - this.once("resume", function () { - var q = this._processQueue - this._processQueue = null - q.forEach(function (cb) { cb() }) - }) - } - this._processQueue.push(cb_.bind(this, er, res)) - } else { - cb_.call(this, er, res) - } - }.bind(this) - - if (this.aborted) return cb() - - if (depth > this.maxDepth) return cb() - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === "string") { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - prefix = pattern.join("/") - this._stat(prefix, function (exists, isDir) { - // either it's there, or it isn't. - // nothing more to do, either way. - if (exists) { - if (prefix && isAbsolute(prefix) && !this.nomount) { - if (prefix.charAt(0) === "/") { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - } - } - - if (process.platform === "win32") - prefix = prefix.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][prefix] = true - this.emitMatch(prefix) - } - return cb() - }) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's "absolute" like /foo/bar, - // or "relative" like "../baz" - prefix = pattern.slice(0, n) - prefix = prefix.join("/") - break - } - - // get the list of entries. - var read - if (prefix === null) read = "." - else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { - if (!prefix || !isAbsolute(prefix)) { - prefix = path.join("/", prefix) - } - read = prefix = path.resolve(prefix) - - // if (process.platform === "win32") - // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") - - this.log('absolute: ', prefix, this.root, pattern, read) - } else { - read = prefix - } - - this.log('readdir(%j)', read, this.cwd, this.root) - - return this._readdir(read, function (er, entries) { - if (er) { - // not a directory! - // this means that, whatever else comes after this, it can never match - return cb() - } - - // globstar is special - if (pattern[n] === minimatch.GLOBSTAR) { - // test without the globstar, and with every child both below - // and replacing the globstar. - var s = [ pattern.slice(0, n).concat(pattern.slice(n + 1)) ] - entries.forEach(function (e) { - if (e.charAt(0) === "." && !this.dot) return - // instead of the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1))) - // below the globstar - s.push(pattern.slice(0, n).concat(e).concat(pattern.slice(n))) - }, this) - - // now asyncForEach over this - var l = s.length - , errState = null - s.forEach(function (gsPattern) { - this._process(gsPattern, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l <= 0) return cb() - }) - }, this) - - return - } - - // not a globstar - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = pattern[n] - if (typeof pn === "string") { - var found = entries.indexOf(pn) !== -1 - entries = found ? entries[pn] : [] - } else { - var rawGlob = pattern[n]._glob - , dotOk = this.dot || rawGlob.charAt(0) === "." - - entries = entries.filter(function (e) { - return (e.charAt(0) !== "." || dotOk) && - (typeof pattern[n] === "string" && e === pattern[n] || - e.match(pattern[n])) - }) - } - - // If n === pattern.length - 1, then there's no need for the extra stat - // *unless* the user has specified "mark" or "stat" explicitly. - // We know that they exist, since the readdir returned them. - if (n === pattern.length - 1 && - !this.mark && - !this.stat) { - entries.forEach(function (e) { - if (prefix) { - if (prefix !== "/") e = prefix + "/" + e - else e = prefix + e - } - if (e.charAt(0) === "/" && !this.nomount) { - e = path.join(this.root, e) - } - - if (process.platform === "win32") - e = e.replace(/\\/g, "/") - - this.matches[index] = this.matches[index] || {} - this.matches[index][e] = true - this.emitMatch(e) - }, this) - return cb.call(this) - } - - - // now test all the remaining entries as stand-ins for that part - // of the pattern. - var l = entries.length - , errState = null - if (l === 0) return cb() // no matches possible - entries.forEach(function (e) { - var p = pattern.slice(0, n).concat(e).concat(pattern.slice(n + 1)) - this._process(p, depth + 1, index, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (--l === 0) return cb.call(this) - }) - }, this) - }) - -} - -Glob.prototype._stat = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - this.log('stat', [this.cwd, f, '=', abs]) - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterStat(f, abs, cb, er) - } - - if (this.statCache.hasOwnProperty(f)) { - var exists = this.statCache[f] - , isDir = exists && (Array.isArray(exists) || exists === 2) - if (this.sync) return cb.call(this, !!exists, isDir) - return process.nextTick(cb.bind(this, !!exists, isDir)) - } - - if (this.sync) { - var er, stat - try { - stat = fs.statSync(abs) - } catch (e) { - er = e - } - this._afterStat(f, abs, cb, er, stat) - } else { - fs.stat(abs, this._afterStat.bind(this, f, abs, cb)) - } -} - -Glob.prototype._afterStat = function (f, abs, cb, er, stat) { - var exists - assert(this instanceof Glob) - - if (abs.slice(-1) === "/" && stat && !stat.isDirectory()) { - this.log("should be ENOTDIR, fake it") - - er = new Error("ENOTDIR, not a directory '" + abs + "'") - er.path = abs - er.code = "ENOTDIR" - stat = null - } - - if (er || !stat) { - exists = false - } else { - exists = stat.isDirectory() ? 2 : 1 - } - this.statCache[f] = this.statCache[f] || exists - cb.call(this, !!exists, exists === 2) -} - -Glob.prototype._readdir = function (f, cb) { - assert(this instanceof Glob) - var abs = f - if (f.charAt(0) === "/") { - abs = path.join(this.root, f) - } else if (isAbsolute(f)) { - abs = f - } else if (this.changedCwd) { - abs = path.resolve(this.cwd, f) - } - - this.log('readdir', [this.cwd, f, abs]) - if (f.length > this.maxLength) { - var er = new Error("Path name too long") - er.code = "ENAMETOOLONG" - er.path = f - return this._afterReaddir(f, abs, cb, er) - } - - if (this.statCache.hasOwnProperty(f)) { - var c = this.statCache[f] - if (Array.isArray(c)) { - if (this.sync) return cb.call(this, null, c) - return process.nextTick(cb.bind(this, null, c)) - } - - if (!c || c === 1) { - // either ENOENT or ENOTDIR - var code = c ? "ENOTDIR" : "ENOENT" - , er = new Error((c ? "Not a directory" : "Not found") + ": " + f) - er.path = f - er.code = code - this.log(f, er) - if (this.sync) return cb.call(this, er) - return process.nextTick(cb.bind(this, er)) - } - - // at this point, c === 2, meaning it's a dir, but we haven't - // had to read it yet, or c === true, meaning it's *something* - // but we don't have any idea what. Need to read it, either way. - } - - if (this.sync) { - var er, entries - try { - entries = fs.readdirSync(abs) - } catch (e) { - er = e - } - return this._afterReaddir(f, abs, cb, er, entries) - } - - fs.readdir(abs, this._afterReaddir.bind(this, f, abs, cb)) -} - -Glob.prototype._afterReaddir = function (f, abs, cb, er, entries) { - assert(this instanceof Glob) - if (entries && !er) { - this.statCache[f] = entries - // if we haven't asked to stat everything for suresies, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. This also gets us one step - // further into ELOOP territory. - if (!this.mark && !this.stat) { - entries.forEach(function (e) { - if (f === "/") e = f + e - else e = f + "/" + e - this.statCache[e] = true - }, this) - } - - return cb.call(this, er, entries) - } - - // now handle errors, and cache the information - if (er) switch (er.code) { - case "ENOTDIR": // totally normal. means it *does* exist. - this.statCache[f] = 1 - return cb.call(this, er) - case "ENOENT": // not terribly unusual - case "ELOOP": - case "ENAMETOOLONG": - case "UNKNOWN": - this.statCache[f] = false - return cb.call(this, er) - default: // some unusual error. Treat as failure. - this.statCache[f] = false - if (this.strict) this.emit("error", er) - if (!this.silent) console.error("glob error", er) - return cb.call(this, er) - } -} - -var isAbsolute = process.platform === "win32" ? absWin : absUnix - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - , result = splitDeviceRe.exec(p) - , device = result[1] || '' - , isUnc = device && device.charAt(1) !== ':' - , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -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. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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/grunt/node_modules/glob/node_modules/graceful-fs/README.md b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md deleted file mode 100644 index 01af3d6..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# graceful-fs - -graceful-fs functions as a drop-in replacement for the fs module, -making various improvements. - -The improvements are meant to normalize behavior across different -platforms and environments, and to make filesystem access more -resilient to errors. - -## Improvements over fs module - -graceful-fs: - -* keeps track of how many file descriptors are open, and by default - limits this to 1024. Any further requests to open a file are put in a - queue until new slots become available. If 1024 turns out to be too - much, it decreases the limit further. -* fixes `lchmod` for Node versions prior to 0.6.2. -* implements `fs.lutimes` if possible. Otherwise it becomes a noop. -* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or - `lchown` if the user isn't root. -* makes `lchmod` and `lchown` become noops, if not available. -* retries reading a file if `read` results in EAGAIN error. - -On Windows, it retries renaming a file for up to one second if `EACCESS` -or `EPERM` error occurs, likely because antivirus software has locked -the directory. - -## Configuration - -The maximum number of open file descriptors that graceful-fs manages may -be adjusted by setting `fs.MAX_OPEN` to a different number. The default -is 1024. diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index ca91152..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,442 +0,0 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. - -var fs = exports = module.exports = {} -fs._originalFs = require("fs") - -Object.getOwnPropertyNames(fs._originalFs).forEach(function(prop) { - var desc = Object.getOwnPropertyDescriptor(fs._originalFs, prop) - Object.defineProperty(fs, prop, desc) -}) - -var queue = [] - , constants = require("constants") - -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb -} - -function noop () {} - -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) -} - -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.open.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = fs._originalFs.openSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} - -function onclose () { - fs._curOpen -- - flush() -} - -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - switch (req.constructor.name) { - case 'OpenReq': - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - break - case 'ReaddirReq': - readdir(req.path, req.cb) - break - case 'ReadFileReq': - readFile(req.path, req.options, req.cb) - break - case 'WriteFileReq': - writeFile(req.path, req.data, req.options, req.cb) - break - default: - throw new Error('Unknown req type: ' + req.constructor.name) - } - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - fs._originalFs.close.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - try { - return fs._originalFs.closeSync.call(fs, fd) - } finally { - onclose() - } -} - - -// readdir takes a fd as well. -// however, the sync version closes it right away, so -// there's no need to wrap. -// It would be nice to catch when it throws an EMFILE, -// but that's relatively rare anyway. - -fs.readdir = gracefulReaddir - -function gracefulReaddir (path, cb) { - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new ReaddirReq(path, cb)) - setTimeout(flush) - return - } - - readdir(path, function (er, files) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.readdir(path, cb) - } - cb(er, files) - }) -} - -function readdir (path, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.readdir.call(fs, path, function (er, files) { - onclose() - cb(er, files) - }) -} - -function ReaddirReq (path, cb) { - this.path = path - this.cb = cb -} - - -fs.readFile = gracefulReadFile - -function gracefulReadFile(path, options, cb) { - if (typeof options === "function") cb = options, options = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new ReadFileReq(path, options, cb)) - setTimeout(flush) - return - } - - readFile(path, options, function (er, data) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.readFile(path, options, cb) - } - cb(er, data) - }) -} - -function readFile (path, options, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.readFile.call(fs, path, options, function (er, data) { - onclose() - cb(er, data) - }) -} - -function ReadFileReq (path, options, cb) { - this.path = path - this.options = options - this.cb = cb -} - - - - -fs.writeFile = gracefulWriteFile - -function gracefulWriteFile(path, data, options, cb) { - if (typeof options === "function") cb = options, options = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new WriteFileReq(path, data, options, cb)) - setTimeout(flush) - return - } - - writeFile(path, data, options, function (er) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - fs.MAX_OPEN = fs._curOpen - 1 - return fs.writeFile(path, data, options, cb) - } - cb(er) - }) -} - -function writeFile (path, data, options, cb) { - cb = cb || noop - fs._curOpen ++ - fs._originalFs.writeFile.call(fs, path, data, options, function (er) { - onclose() - cb(er) - }) -} - -function WriteFileReq (path, data, options, cb) { - this.path = path - this.data = data - this.options = options - this.cb = cb -} - - -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json deleted file mode 100644 index e044da3..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "A drop-in replacement for fs, making various improvements.", - "version": "1.2.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "license": "BSD", - "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n limits this to 1024. Any further requests to open a file are put in a\n queue until new slots become available. If 1024 turns out to be too\n much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@1.2.3", - "_from": "graceful-fs@~1.2.0" -} diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 930d532..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,46 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('graceful fs is not fs', function (t) { - t.notEqual(fs, require('fs')) - t.end() -}) - -test('open an existing file works', function (t) { - var start = fs._curOpen - var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) - fs.closeSync(fd) - t.equal(fs._curOpen, start) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - t.equal(fs._curOpen, start + 1) - fs.close(fd, function (er) { - if (er) throw er - t.equal(fs._curOpen, start) - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var start = fs._curOpen - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - t.end() - }) -}) diff --git a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js b/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js deleted file mode 100644 index 8d0882d..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js +++ /dev/null @@ -1,158 +0,0 @@ -var test = require('tap').test - -// simulated ulimit -// this is like graceful-fs, but in reverse -var fs_ = require('fs') -var fs = require('../graceful-fs.js') -var files = fs.readdirSync(__dirname) - -// Ok, no more actual file reading! - -var fds = 0 -var nextFd = 60 -var limit = 8 -fs_.open = function (path, flags, mode, cb) { - process.nextTick(function() { - ++fds - if (fds >= limit) { - --fds - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - return cb(er) - } else { - cb(null, nextFd++) - } - }) -} - -fs_.openSync = function (path, flags, mode) { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - throw er - } else { - ++fds - return nextFd++ - } -} - -fs_.close = function (fd, cb) { - process.nextTick(function () { - --fds - cb() - }) -} - -fs_.closeSync = function (fd) { - --fds -} - -fs_.readdir = function (path, cb) { - process.nextTick(function() { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - return cb(er) - } else { - ++fds - process.nextTick(function () { - --fds - cb(null, [__filename, "some-other-file.js"]) - }) - } - }) -} - -fs_.readdirSync = function (path) { - if (fds >= limit) { - var er = new Error('EMFILE Curses!') - er.code = 'EMFILE' - er.path = path - throw er - } else { - return [__filename, "some-other-file.js"] - } -} - - -test('open emfile autoreduce', function (t) { - fs.MIN_MAX_OPEN = 4 - t.equal(fs.MAX_OPEN, 1024) - - var max = 12 - for (var i = 0; i < max; i++) { - fs.open(__filename, 'r', next(i)) - } - - var phase = 0 - - var expect = - [ [ 0, 60, null, 1024, 4, 12, 1 ], - [ 1, 61, null, 1024, 4, 12, 2 ], - [ 2, 62, null, 1024, 4, 12, 3 ], - [ 3, 63, null, 1024, 4, 12, 4 ], - [ 4, 64, null, 1024, 4, 12, 5 ], - [ 5, 65, null, 1024, 4, 12, 6 ], - [ 6, 66, null, 1024, 4, 12, 7 ], - [ 7, 67, null, 6, 4, 5, 1 ], - [ 8, 68, null, 6, 4, 5, 2 ], - [ 9, 69, null, 6, 4, 5, 3 ], - [ 10, 70, null, 6, 4, 5, 4 ], - [ 11, 71, null, 6, 4, 5, 5 ] ] - - var actual = [] - - function next (i) { return function (er, fd) { - if (er) - throw er - actual.push([i, fd, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds]) - - if (i === max - 1) { - t.same(actual, expect) - t.ok(fs.MAX_OPEN < limit) - t.end() - } - - fs.close(fd) - } } -}) - -test('readdir emfile autoreduce', function (t) { - fs.MAX_OPEN = 1024 - var max = 12 - for (var i = 0; i < max; i ++) { - fs.readdir(__dirname, next(i)) - } - - var expect = - [ [0,[__filename,"some-other-file.js"],null,7,4,7,7], - [1,[__filename,"some-other-file.js"],null,7,4,7,6], - [2,[__filename,"some-other-file.js"],null,7,4,7,5], - [3,[__filename,"some-other-file.js"],null,7,4,7,4], - [4,[__filename,"some-other-file.js"],null,7,4,7,3], - [5,[__filename,"some-other-file.js"],null,7,4,6,2], - [6,[__filename,"some-other-file.js"],null,7,4,5,1], - [7,[__filename,"some-other-file.js"],null,7,4,4,0], - [8,[__filename,"some-other-file.js"],null,7,4,3,3], - [9,[__filename,"some-other-file.js"],null,7,4,2,2], - [10,[__filename,"some-other-file.js"],null,7,4,1,1], - [11,[__filename,"some-other-file.js"],null,7,4,0,0] ] - - var actual = [] - - function next (i) { return function (er, files) { - if (er) - throw er - var line = [i, files, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds ] - actual.push(line) - - if (i === max - 1) { - t.ok(fs.MAX_OPEN < limit) - t.same(actual, expect) - t.end() - } - } } -}) diff --git a/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md b/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md deleted file mode 100644 index b2beaed..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md +++ /dev/null @@ -1,51 +0,0 @@ -A dead simple way to do inheritance in JS. - - var inherits = require("inherits") - - function Animal () { - this.alive = true - } - Animal.prototype.say = function (what) { - console.log(what) - } - - inherits(Dog, Animal) - function Dog () { - Dog.super.apply(this) - } - Dog.prototype.sniff = function () { - this.say("sniff sniff") - } - Dog.prototype.bark = function () { - this.say("woof woof") - } - - inherits(Chihuahua, Dog) - function Chihuahua () { - Chihuahua.super.apply(this) - } - Chihuahua.prototype.bark = function () { - this.say("yip yip") - } - - // also works - function Cat () { - Cat.super.apply(this) - } - Cat.prototype.hiss = function () { - this.say("CHSKKSS!!") - } - inherits(Cat, Animal, { - meow: function () { this.say("miao miao") } - }) - Cat.prototype.purr = function () { - this.say("purr purr") - } - - - var c = new Chihuahua - assert(c instanceof Chihuahua) - assert(c instanceof Dog) - assert(c instanceof Animal) - -The actual function is laughably small. 10-lines small. diff --git a/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js b/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js deleted file mode 100644 index 061b396..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = inherits - -function inherits (c, p, proto) { - proto = proto || {} - var e = {} - ;[c.prototype, proto].forEach(function (s) { - Object.getOwnPropertyNames(s).forEach(function (k) { - e[k] = Object.getOwnPropertyDescriptor(s, k) - }) - }) - c.prototype = Object.create(p.prototype, e) - c.super = p -} - -//function Child () { -// Child.super.call(this) -// console.error([this -// ,this.constructor -// ,this.constructor === Child -// ,this.constructor.super === Parent -// ,Object.getPrototypeOf(this) === Child.prototype -// ,Object.getPrototypeOf(Object.getPrototypeOf(this)) -// === Parent.prototype -// ,this instanceof Child -// ,this instanceof Parent]) -//} -//function Parent () {} -//inherits(Child, Parent) -//new Child diff --git a/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json b/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json deleted file mode 100644 index 974e1bd..0000000 --- a/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "inherits", - "description": "A tiny simple way to do classic inheritance in js", - "version": "1.0.0", - "keywords": [ - "inheritance", - "class", - "klass", - "oop", - "object-oriented" - ], - "main": "./inherits.js", - "repository": { - "type": "git", - "url": "https://github.com/isaacs/inherits" - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "_id": "inherits@1.0.0", - "_from": "inherits@1" -} diff --git a/node_modules/grunt/node_modules/glob/package.json b/node_modules/grunt/node_modules/glob/package.json deleted file mode 100644 index e85a4ff..0000000 --- a/node_modules/grunt/node_modules/glob/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "3.1.21", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "engines": { - "node": "*" - }, - "dependencies": { - "minimatch": "~0.2.11", - "graceful-fs": "~1.2.0", - "inherits": "1" - }, - "devDependencies": { - "tap": "~0.4.0", - "mkdirp": "0", - "rimraf": "1" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "BSD", - "readme": "# Glob\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options]\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not. **Note that this is different from the way that `**` is\nhandled by ruby's `Dir` class.**\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the statCache object is reused between glob calls.\n\nUsers are thus advised not to use a glob result as a\nguarantee of filesystem state in the face of rapid changes.\nFor the vast majority of operations, this is never a problem.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "_id": "glob@3.1.21", - "_from": "glob@~3.1.21" -} diff --git a/node_modules/grunt/node_modules/glob/test/00-setup.js b/node_modules/grunt/node_modules/glob/test/00-setup.js deleted file mode 100644 index 245afaf..0000000 --- a/node_modules/grunt/node_modules/glob/test/00-setup.js +++ /dev/null @@ -1,176 +0,0 @@ -// just a little pre-run script to set up the fixtures. -// zz-finish cleans it up - -var mkdirp = require("mkdirp") -var path = require("path") -var i = 0 -var tap = require("tap") -var fs = require("fs") -var rimraf = require("rimraf") - -var files = -[ "a/.abcdef/x/y/z/a" -, "a/abcdef/g/h" -, "a/abcfed/g/h" -, "a/b/c/d" -, "a/bc/e/f" -, "a/c/d/c/b" -, "a/cb/e/f" -] - -var symlinkTo = path.resolve(__dirname, "a/symlink/a/b/c") -var symlinkFrom = "../.." - -files = files.map(function (f) { - return path.resolve(__dirname, f) -}) - -tap.test("remove fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "remove fixtures") - t.end() - }) -}) - -files.forEach(function (f) { - tap.test(f, function (t) { - var d = path.dirname(f) - mkdirp(d, 0755, function (er) { - if (er) { - t.fail(er) - return t.bailout() - } - fs.writeFile(f, "i like tests", function (er) { - t.ifError(er, "make file") - t.end() - }) - }) - }) -}) - -if (process.platform !== "win32") { - tap.test("symlinky", function (t) { - var d = path.dirname(symlinkTo) - console.error("mkdirp", d) - mkdirp(d, 0755, function (er) { - t.ifError(er) - fs.symlink(symlinkFrom, symlinkTo, "dir", function (er) { - t.ifError(er, "make symlink") - t.end() - }) - }) - }) -} - -;["foo","bar","baz","asdf","quux","qwer","rewq"].forEach(function (w) { - w = "/tmp/glob-test/" + w - tap.test("create " + w, function (t) { - mkdirp(w, function (er) { - if (er) - throw er - t.pass(w) - t.end() - }) - }) -}) - - -// generate the bash pattern test-fixtures if possible -if (process.platform === "win32" || !process.env.TEST_REGEN) { - console.error("Windows, or TEST_REGEN unset. Using cached fixtures.") - return -} - -var spawn = require("child_process").spawn; -var globs = - // put more patterns here. - // anything that would be directly in / should be in /tmp/glob-test - ["test/a/*/+(c|g)/./d" - ,"test/a/**/[cg]/../[cg]" - ,"test/a/{b,c,d,e,f}/**/g" - ,"test/a/b/**" - ,"test/**/g" - ,"test/a/abc{fed,def}/g/h" - ,"test/a/abc{fed/g,def}/**/" - ,"test/a/abc{fed/g,def}/**///**/" - ,"test/**/a/**/" - ,"test/+(a|b|c)/a{/,bc*}/**" - ,"test/*/*/*/f" - ,"test/**/f" - ,"test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**" - ,"{./*/*,/tmp/glob-test/*}" - ,"{/tmp/glob-test/*,*}" // evil owl face! how you taunt me! - ,"test/a/!(symlink)/**" - ] -var bashOutput = {} -var fs = require("fs") - -globs.forEach(function (pattern) { - tap.test("generate fixture " + pattern, function (t) { - var cmd = "shopt -s globstar && " + - "shopt -s extglob && " + - "shopt -s nullglob && " + - // "shopt >&2; " + - "eval \'for i in " + pattern + "; do echo $i; done\'" - var cp = spawn("bash", ["-c", cmd], { cwd: path.dirname(__dirname) }) - var out = [] - cp.stdout.on("data", function (c) { - out.push(c) - }) - cp.stderr.pipe(process.stderr) - cp.on("close", function (code) { - out = flatten(out) - if (!out) - out = [] - else - out = cleanResults(out.split(/\r*\n/)) - - bashOutput[pattern] = out - t.notOk(code, "bash test should finish nicely") - t.end() - }) - }) -}) - -tap.test("save fixtures", function (t) { - var fname = path.resolve(__dirname, "bash-results.json") - var data = JSON.stringify(bashOutput, null, 2) + "\n" - fs.writeFile(fname, data, function (er) { - t.ifError(er) - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -function flatten (chunks) { - var s = 0 - chunks.forEach(function (c) { s += c.length }) - var out = new Buffer(s) - s = 0 - chunks.forEach(function (c) { - c.copy(out, s) - s += c.length - }) - - return out.toString().trim() -} - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} diff --git a/node_modules/grunt/node_modules/glob/test/bash-comparison.js b/node_modules/grunt/node_modules/glob/test/bash-comparison.js deleted file mode 100644 index 239ed1a..0000000 --- a/node_modules/grunt/node_modules/glob/test/bash-comparison.js +++ /dev/null @@ -1,63 +0,0 @@ -// basic test -// show that it does the same thing by default as the shell. -var tap = require("tap") -, child_process = require("child_process") -, bashResults = require("./bash-results.json") -, globs = Object.keys(bashResults) -, glob = require("../") -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -globs.forEach(function (pattern) { - var expect = bashResults[pattern] - // anything regarding the symlink thing will fail on windows, so just skip it - if (process.platform === "win32" && - expect.some(function (m) { - return /\/symlink\//.test(m) - })) - return - - tap.test(pattern, function (t) { - glob(pattern, function (er, matches) { - if (er) - throw er - - // sort and unmark, just to match the shell results - matches = cleanResults(matches) - - t.deepEqual(matches, expect, pattern) - t.end() - }) - }) - - tap.test(pattern + " sync", function (t) { - var matches = cleanResults(glob.sync(pattern)) - - t.deepEqual(matches, expect, "should match shell") - t.end() - }) -}) - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') - }) -} diff --git a/node_modules/grunt/node_modules/glob/test/bash-results.json b/node_modules/grunt/node_modules/glob/test/bash-results.json deleted file mode 100644 index c227449..0000000 --- a/node_modules/grunt/node_modules/glob/test/bash-results.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "test/a/*/+(c|g)/./d": [ - "test/a/b/c/./d" - ], - "test/a/**/[cg]/../[cg]": [ - "test/a/abcdef/g/../g", - "test/a/abcfed/g/../g", - "test/a/b/c/../c", - "test/a/c/../c", - "test/a/c/d/c/../c", - "test/a/symlink/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/../c" - ], - "test/a/{b,c,d,e,f}/**/g": [], - "test/a/b/**": [ - "test/a/b", - "test/a/b/c", - "test/a/b/c/d" - ], - "test/**/g": [ - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed,def}/g/h": [ - "test/a/abcdef/g/h", - "test/a/abcfed/g/h" - ], - "test/a/abc{fed/g,def}/**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/a/abc{fed/g,def}/**///**/": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed/g" - ], - "test/**/a/**/": [ - "test/a", - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/b", - "test/a/b/c", - "test/a/bc", - "test/a/bc/e", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/cb", - "test/a/cb/e", - "test/a/symlink", - "test/a/symlink/a", - "test/a/symlink/a/b", - "test/a/symlink/a/b/c", - "test/a/symlink/a/b/c/a", - "test/a/symlink/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b" - ], - "test/+(a|b|c)/a{/,bc*}/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h" - ], - "test/*/*/*/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/**/f": [ - "test/a/bc/e/f", - "test/a/cb/e/f" - ], - "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**": [ - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b", - "test/a/symlink/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c/a/b/c" - ], - "{./*/*,/tmp/glob-test/*}": [ - "./examples/g.js", - "./examples/usr-local.js", - "./node_modules/graceful-fs", - "./node_modules/inherits", - "./node_modules/minimatch", - "./node_modules/mkdirp", - "./node_modules/rimraf", - "./node_modules/tap", - "./test/00-setup.js", - "./test/a", - "./test/bash-comparison.js", - "./test/bash-results.json", - "./test/cwd-test.js", - "./test/mark.js", - "./test/nocase-nomagic.js", - "./test/pause-resume.js", - "./test/root-nomount.js", - "./test/root.js", - "./test/zz-cleanup.js", - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq" - ], - "{/tmp/glob-test/*,*}": [ - "/tmp/glob-test/asdf", - "/tmp/glob-test/bar", - "/tmp/glob-test/baz", - "/tmp/glob-test/foo", - "/tmp/glob-test/quux", - "/tmp/glob-test/qwer", - "/tmp/glob-test/rewq", - "examples", - "glob.js", - "LICENSE", - "node_modules", - "package.json", - "README.md", - "test" - ], - "test/a/!(symlink)/**": [ - "test/a/abcdef", - "test/a/abcdef/g", - "test/a/abcdef/g/h", - "test/a/abcfed", - "test/a/abcfed/g", - "test/a/abcfed/g/h", - "test/a/b", - "test/a/b/c", - "test/a/b/c/d", - "test/a/bc", - "test/a/bc/e", - "test/a/bc/e/f", - "test/a/c", - "test/a/c/d", - "test/a/c/d/c", - "test/a/c/d/c/b", - "test/a/cb", - "test/a/cb/e", - "test/a/cb/e/f" - ] -} diff --git a/node_modules/grunt/node_modules/glob/test/cwd-test.js b/node_modules/grunt/node_modules/glob/test/cwd-test.js deleted file mode 100644 index 352c27e..0000000 --- a/node_modules/grunt/node_modules/glob/test/cwd-test.js +++ /dev/null @@ -1,55 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing cwd and searching for **/d", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('**/d', function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('a', function (t) { - glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'b/c/d', 'c/d' ]) - t.end() - }) - }) - - t.test('a/b', function (t) { - glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('a/b/', function (t) { - glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'c/d' ]) - t.end() - }) - }) - - t.test('.', function (t) { - glob('**/d', {cwd: process.cwd()}, function (er, matches) { - t.ifError(er) - t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/node_modules/grunt/node_modules/glob/test/mark.js b/node_modules/grunt/node_modules/glob/test/mark.js deleted file mode 100644 index ed68a33..0000000 --- a/node_modules/grunt/node_modules/glob/test/mark.js +++ /dev/null @@ -1,74 +0,0 @@ -var test = require("tap").test -var glob = require('../') -process.chdir(__dirname) - -test("mark, no / on pattern", function (t) { - glob("a/*", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - - if (process.platform !== "win32") - expect.push('a/symlink/') - - t.same(results, expect) - t.end() - }) -}) - -test("mark=false, no / on pattern", function (t) { - glob("a/*", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef', - 'a/abcfed', - 'a/b', - 'a/bc', - 'a/c', - 'a/cb' ] - - if (process.platform !== "win32") - expect.push('a/symlink') - t.same(results, expect) - t.end() - }) -}) - -test("mark=true, / on pattern", function (t) { - glob("a/*/", {mark: true}, function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }) -}) - -test("mark=false, / on pattern", function (t) { - glob("a/*/", function (er, results) { - if (er) - throw er - var expect = [ 'a/abcdef/', - 'a/abcfed/', - 'a/b/', - 'a/bc/', - 'a/c/', - 'a/cb/' ] - if (process.platform !== "win32") - expect.push('a/symlink/') - t.same(results, expect) - t.end() - }) -}) diff --git a/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js b/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js deleted file mode 100644 index d862970..0000000 --- a/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js +++ /dev/null @@ -1,113 +0,0 @@ -var fs = require('graceful-fs'); -var test = require('tap').test; -var glob = require('../'); - -test('mock fs', function(t) { - var stat = fs.stat - var statSync = fs.statSync - var readdir = fs.readdir - var readdirSync = fs.readdirSync - - function fakeStat(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': - ret = { isDirectory: function() { return true } } - break - case '/tmp/a': - ret = { isDirectory: function() { return false } } - break - } - return ret - } - - fs.stat = function(path, cb) { - var f = fakeStat(path); - if (f) { - process.nextTick(function() { - cb(null, f) - }) - } else { - stat.call(fs, path, cb) - } - } - - fs.statSync = function(path) { - return fakeStat(path) || statSync.call(fs, path) - } - - function fakeReaddir(path) { - var ret - switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': - ret = [ 'a', 'A' ] - break - case '/': - ret = ['tmp', 'tMp', 'tMP', 'TMP'] - } - return ret - } - - fs.readdir = function(path, cb) { - var f = fakeReaddir(path) - if (f) - process.nextTick(function() { - cb(null, f) - }) - else - readdir.call(fs, path, cb) - } - - fs.readdirSync = function(path) { - return fakeReaddir(path) || readdirSync.call(fs, path) - } - - t.pass('mocked') - t.end() -}) - -test('nocase, nomagic', function(t) { - var n = 2 - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - glob('/tmp/a', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) - glob('/tmp/A', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - if (--n === 0) t.end() - }) -}) - -test('nocase, with some magic', function(t) { - t.plan(2) - var want = [ '/TMP/A', - '/TMP/a', - '/tMP/A', - '/tMP/a', - '/tMp/A', - '/tMp/a', - '/tmp/A', - '/tmp/a' ] - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) - glob('/tmp/*', { nocase: true }, function(er, res) { - if (er) - throw er - t.same(res.sort(), want) - }) -}) diff --git a/node_modules/grunt/node_modules/glob/test/pause-resume.js b/node_modules/grunt/node_modules/glob/test/pause-resume.js deleted file mode 100644 index e1ffbab..0000000 --- a/node_modules/grunt/node_modules/glob/test/pause-resume.js +++ /dev/null @@ -1,73 +0,0 @@ -// show that no match events happen while paused. -var tap = require("tap") -, child_process = require("child_process") -// just some gnarly pattern with lots of matches -, pattern = "test/a/!(symlink)/**" -, bashResults = require("./bash-results.json") -, patterns = Object.keys(bashResults) -, glob = require("../") -, Glob = glob.Glob -, path = require("path") - -// run from the root of the project -// this is usually where you're at anyway, but be sure. -process.chdir(path.resolve(__dirname, "..")) - -function alphasort (a, b) { - a = a.toLowerCase() - b = b.toLowerCase() - return a > b ? 1 : a < b ? -1 : 0 -} - -function cleanResults (m) { - // normalize discrepancies in ordering, duplication, - // and ending slashes. - return m.map(function (m) { - return m.replace(/\/+/g, "/").replace(/\/$/, "") - }).sort(alphasort).reduce(function (set, f) { - if (f !== set[set.length - 1]) set.push(f) - return set - }, []).sort(alphasort).map(function (f) { - // de-windows - return (process.platform !== 'win32') ? f - : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') - }) -} - -var globResults = [] -tap.test("use a Glob object, and pause/resume it", function (t) { - var g = new Glob(pattern) - , paused = false - , res = [] - , expect = bashResults[pattern] - - g.on("pause", function () { - console.error("pause") - }) - - g.on("resume", function () { - console.error("resume") - }) - - g.on("match", function (m) { - t.notOk(g.paused, "must not be paused") - globResults.push(m) - g.pause() - t.ok(g.paused, "must be paused") - setTimeout(g.resume.bind(g), 10) - }) - - g.on("end", function (matches) { - t.pass("reached glob end") - globResults = cleanResults(globResults) - matches = cleanResults(matches) - t.deepEqual(matches, globResults, - "end event matches should be the same as match events") - - t.deepEqual(matches, expect, - "glob matches should be the same as bash results") - - t.end() - }) -}) - diff --git a/node_modules/grunt/node_modules/glob/test/root-nomount.js b/node_modules/grunt/node_modules/glob/test/root-nomount.js deleted file mode 100644 index 3ac5979..0000000 --- a/node_modules/grunt/node_modules/glob/test/root-nomount.js +++ /dev/null @@ -1,39 +0,0 @@ -var tap = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -tap.test("changing root and searching for /b*/**", function (t) { - var glob = require('../') - var path = require('path') - t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) - }) - - t.test('a', function (t) { - glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) - t.end() - }) - }) - - t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() - }) - - t.end() -}) diff --git a/node_modules/grunt/node_modules/glob/test/root.js b/node_modules/grunt/node_modules/glob/test/root.js deleted file mode 100644 index 95c23f9..0000000 --- a/node_modules/grunt/node_modules/glob/test/root.js +++ /dev/null @@ -1,46 +0,0 @@ -var t = require("tap") - -var origCwd = process.cwd() -process.chdir(__dirname) - -var glob = require('../') -var path = require('path') - -t.test('.', function (t) { - glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { - t.ifError(er) - t.like(matches, []) - t.end() - }) -}) - - -t.test('a', function (t) { - console.error("root=" + path.resolve('a')) - glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { - t.ifError(er) - var wanted = [ - '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' - ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - }) - - t.like(matches, wanted) - t.end() - }) -}) - -t.test('root=a, cwd=a/b', function (t) { - glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { - t.ifError(er) - t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { - return path.join(path.resolve('a'), m).replace(/\\/g, '/') - })) - t.end() - }) -}) - -t.test('cd -', function (t) { - process.chdir(origCwd) - t.end() -}) diff --git a/node_modules/grunt/node_modules/glob/test/zz-cleanup.js b/node_modules/grunt/node_modules/glob/test/zz-cleanup.js deleted file mode 100644 index e085f0f..0000000 --- a/node_modules/grunt/node_modules/glob/test/zz-cleanup.js +++ /dev/null @@ -1,11 +0,0 @@ -// remove the fixtures -var tap = require("tap") -, rimraf = require("rimraf") -, path = require("path") - -tap.test("cleanup fixtures", function (t) { - rimraf(path.resolve(__dirname, "a"), function (er) { - t.ifError(er, "removed") - t.end() - }) -}) diff --git a/node_modules/grunt/node_modules/hooker/LICENSE-MIT b/node_modules/grunt/node_modules/hooker/LICENSE-MIT deleted file mode 100644 index 90c336c..0000000 --- a/node_modules/grunt/node_modules/hooker/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2012 "Cowboy" Ben Alman - -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/grunt/node_modules/hooker/README.md b/node_modules/grunt/node_modules/hooker/README.md deleted file mode 100644 index 138943a..0000000 --- a/node_modules/grunt/node_modules/hooker/README.md +++ /dev/null @@ -1,186 +0,0 @@ -# JavaScript Hooker - -Monkey-patch (hook) functions for debugging and stuff. - -## Getting Started - -This code should work just fine in Node.js: - -First, install the module with: `npm install hooker` - -```javascript -var hooker = require('hooker'); -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 -``` - -Or in the browser: - -```html - - -``` - -In the browser, you can attach Hooker's methods to any object. - -```html - - - -``` - -## Documentation - -### hooker.hook -Monkey-patch (hook) one or more methods of an object. -#### Signature: -`hooker.hook(object, [ props, ] [options | prehookFunction])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked. -#### `options` -* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well. -* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments. -* `once` - (Boolean) if true, auto-unhook the function after the first execution. -* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments). - -#### Returns: -An array of hooked method names. - -### hooker.unhook -Un-monkey-patch (unhook) one or more methods of an object. -#### Signature: -`hooker.unhook(object [, props ])` -#### `props` -The optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked. -#### Returns: -An array of unhooked method names. - -### hooker.orig -Get a reference to the original method from a hooked function. -#### Signature: -`hooker.orig(object, props)` - -### hooker.override -When a pre- or post-hook returns the result of this function, the value -passed will be used in place of the original function's return value. Any -post-hook override value will take precedence over a pre-hook override value. -#### Signature: -`hooker.override(value)` - -### hooker.preempt -When a pre-hook returns the result of this function, the value passed will -be used in place of the original function's return value, and the original -function will NOT be executed. -#### Signature: -`hooker.preempt(value)` - -### hooker.filter -When a pre-hook returns the result of this function, the context and -arguments passed will be applied into the original function. -#### Signature: -`hooker.filter(context, arguments)` - - -## Examples -See the unit tests for more examples. - -```javascript -var hooker = require('hooker'); -// Simple logging. -hooker.hook(Math, "max", function() { - console.log(arguments.length + " arguments passed"); -}); -Math.max(5, 6, 7) // logs: "3 arguments passed", returns 7 - -hooker.unhook(Math, "max"); // (This is assumed between all further examples) -Math.max(5, 6, 7) // 7 - -// Returning hooker.override(value) overrides the original value. -hooker.hook(Math, "max", function() { - if (arguments.length === 0) { - return hooker.override(9000); - } -}); -Math.max(5, 6, 7) // 7 -Math.max() // 9000 - -// Auto-unhook after one execution. -hooker.hook(Math, "max", { - once: true, - pre: function() { - console.log("Init something here"); - } -}); -Math.max(5, 6, 7) // logs: "Init something here", returns 7 -Math.max(5, 6, 7) // 7 - -// Filter `this` and arguments through a pre-hook function. -hooker.hook(Math, "max", { - pre: function() { - var args = [].map.call(arguments, function(num) { - return num * 2; - }); - return hooker.filter(this, args); // thisValue, arguments - } -}); -Math.max(5, 6, 7) // 14 - -// Modify the original function's result with a post-hook function. -hooker.hook(Math, "max", { - post: function(result) { - return hooker.override(result * 100); - } -}); -Math.max(5, 6, 7) // 700 - -// Hook every Math method. Note: if Math's methods were enumerable, the second -// argument could be omitted. Since they aren't, an array of properties to hook -// must be explicitly passed. Non-method properties will be skipped. -// See a more generic example here: http://bit.ly/vvJlrS -hooker.hook(Math, Object.getOwnPropertyNames(Math), { - passName: true, - pre: function(name) { - console.log("=> Math." + name, [].slice.call(arguments, 1)); - }, - post: function(result, name) { - console.log("<= Math." + name, result); - } -}); - -var result = Math.max(5, 6, 7); -// => Math.max [ 5, 6, 7 ] -// <= Math.max 7 -result // 7 - -result = Math.ceil(3.456); -// => Math.ceil [ 3.456 ] -// <= Math.ceil 4 -result // 4 -``` - -## Contributing -In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt). - -_Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "lib" subdirectory!_ - -## Release History -2012/01/09 - v0.2.3 - First official release. - -## License -Copyright (c) 2012 "Cowboy" Ben Alman -Licensed under the MIT license. - diff --git a/node_modules/grunt/node_modules/hooker/child.js b/node_modules/grunt/node_modules/hooker/child.js deleted file mode 100644 index ae7dcf2..0000000 --- a/node_modules/grunt/node_modules/hooker/child.js +++ /dev/null @@ -1,101 +0,0 @@ -var path = require('path'); -var fs = require('fs'); -var nodeunit = require('nodeunit'); - -var filepaths = fs.readdirSync('test').map(function(filename) { - return path.join('test', filename); -}); - -var unfinished = {}; -var currentModule; -function sendMessage(message) { - process.stdout.write(JSON.stringify(message) + '\n'); -} - -// If an exception is thrown, let the parent process know and exit. -process.on('uncaughtException', function (e) { - sendMessage({error: [e.name, e.message, e.stack]}); - process.exit(); -}); - -// If Nodeunit explodes because a test was missing test.done(), handle it. -var unfinished = {}; -process.on('exit', function (e) { - var len = Object.keys(unfinished).length - if (len > 0) { - sendMessage({exit: ['UNFINISHED']}); - // process.reallyExit(len); - } else { - sendMessage({exit: ['finished']}); - } - // process.exit(); -}); - -nodeunit.reporters.test = { - run: function(files, options, callback) { - // Nodeunit needs absolute paths. - var paths = files.map(function (filepath) { - return path.resolve(filepath); - }); - nodeunit.runFiles(paths, { - // No idea. - testspec: undefined, - // Executed when the first test in a file is run. If no tests exist in - // the file, this doesn't execute. - moduleStart: function(name) { - // Keep track of this so that moduleDone output can be suppressed in - // cases where a test file contains no tests. - currentModule = name; - // Send back to the parent process. - sendMessage({moduleStart: [name.toString()]}); - }, - // Executed after a file is done being processed. This executes whether - // tests exist in the file or not. - moduleDone: function(name) { - // Abort if no tests actually ran. - if (name !== currentModule) { return; } - // Send back to the parent process. - sendMessage({moduleDone: [name.toString()]}); - }, - // Executed before each test is run. - testStart: function(name) { - // Keep track of the current test, in case test.done() was omitted - // and Nodeunit explodes. - unfinished[name] = name; - // Send back to the parent process. - sendMessage({testStart: [name.toString()]}); - }, - // Executed after each test and all its assertions are run. - testDone: function(name, assertions) { - delete unfinished[name]; - // Send back to the parent process. - sendMessage({testDone: [ - name.toString(), - assertions.failures(), - assertions.map(function(assertion) { - var e = assertion.error; - if (e) { - assertion.error = { - name: e.name, - message: e.message, - stack: e.stack - }; - } - return assertion; - }) - ]}); - }, - // Executed when everything is all done. - done: function (assertions) { - // Send back to the parent process. - sendMessage({done: [ - assertions.failures(), - assertions.duration, - assertions - ]}); - } - }); - } -} - -nodeunit.reporters.test.run(filepaths, {}); diff --git a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js b/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js deleted file mode 100644 index d10a321..0000000 --- a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js +++ /dev/null @@ -1,169 +0,0 @@ -/*! JavaScript Hooker - v0.2.3 - 1/29/2012 -* http://github.com/cowboy/javascript-hooker -* Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ - -(function(exports) { - // Get an array from an array-like object with slice.call(arrayLikeObject). - var slice = [].slice; - // Get an "[object [[Class]]]" string with toString.call(value). - var toString = {}.toString; - - // I can't think of a better way to ensure a value is a specific type other - // than to create instances and use the `instanceof` operator. - function HookerOverride(v) { this.value = v; } - function HookerPreempt(v) { this.value = v; } - function HookerFilter(c, a) { this.context = c; this.args = a; } - - // When a pre- or post-hook returns the result of this function, the value - // passed will be used in place of the original function's return value. Any - // post-hook override value will take precedence over a pre-hook override - // value. - exports.override = function(value) { - return new HookerOverride(value); - }; - - // When a pre-hook returns the result of this function, the value passed will - // be used in place of the original function's return value, and the original - // function will NOT be executed. - exports.preempt = function(value) { - return new HookerPreempt(value); - }; - - // When a pre-hook returns the result of this function, the context and - // arguments passed will be applied into the original function. - exports.filter = function(context, args) { - return new HookerFilter(context, args); - }; - - // Execute callback(s) for properties of the specified object. - function forMethods(obj, props, callback) { - var prop; - if (typeof props === "string") { - // A single prop string was passed. Create an array. - props = [props]; - } else if (props == null) { - // No props were passed, so iterate over all properties, building an - // array. Unfortunately, Object.keys(obj) doesn't work everywhere yet, so - // this has to be done manually. - props = []; - for (prop in obj) { - if (obj.hasOwnProperty(prop)) { - props.push(prop); - } - } - } - // Execute callback for every method in the props array. - var i = props.length; - while (i--) { - // If the property isn't a function... - if (toString.call(obj[props[i]]) !== "[object Function]" || - // ...or the callback returns false... - callback(obj, props[i]) === false) { - // ...remove it from the props array to be returned. - props.splice(i, 1); - } - } - // Return an array of method names for which the callback didn't fail. - return props; - } - - // Monkey-patch (hook) a method of an object. - exports.hook = function(obj, props, options) { - // If the props argument was omitted, shuffle the arguments. - if (options == null) { - options = props; - props = null; - } - // If just a function is passed instead of an options hash, use that as a - // pre-hook function. - if (typeof options === "function") { - options = {pre: options}; - } - - // Hook the specified method of the object. - return forMethods(obj, props, function(obj, prop) { - // The original (current) method. - var orig = obj[prop]; - // The new hooked function. - function hooked() { - var result, origResult, tmp; - - // Get an array of arguments. - var args = slice.call(arguments); - - // If passName option is specified, prepend prop to the args array, - // passing it as the first argument to any specified hook functions. - if (options.passName) { - args.unshift(prop); - } - - // If a pre-hook function was specified, invoke it in the current - // context with the passed-in arguments, and store its result. - if (options.pre) { - result = options.pre.apply(this, args); - } - - if (result instanceof HookerFilter) { - // If the pre-hook returned hooker.filter(context, args), invoke the - // original function with that context and arguments, and store its - // result. - origResult = result = orig.apply(result.context, result.args); - } else if (result instanceof HookerPreempt) { - // If the pre-hook returned hooker.preempt(value) just use the passed - // value and don't execute the original function. - origResult = result = result.value; - } else { - // Invoke the original function in the current context with the - // passed-in arguments, and store its result. - origResult = orig.apply(this, arguments); - // If the pre-hook returned hooker.override(value), use the passed - // value, otherwise use the original function's result. - result = result instanceof HookerOverride ? result.value : origResult; - } - - if (options.post) { - // If a post-hook function was specified, invoke it in the current - // context, passing in the result of the original function as the - // first argument, followed by any passed-in arguments. - tmp = options.post.apply(this, [origResult].concat(args)); - if (tmp instanceof HookerOverride) { - // If the post-hook returned hooker.override(value), use the passed - // value, otherwise use the previously computed result. - result = tmp.value; - } - } - - // Unhook if the "once" option was specified. - if (options.once) { - exports.unhook(obj, prop); - } - - // Return the result! - return result; - } - // Re-define the method. - obj[prop] = hooked; - // Fail if the function couldn't be hooked. - if (obj[prop] !== hooked) { return false; } - // Store a reference to the original method as a property on the new one. - obj[prop]._orig = orig; - }); - }; - - // Get a reference to the original method from a hooked function. - exports.orig = function(obj, prop) { - return obj[prop]._orig; - }; - - // Un-monkey-patch (unhook) a method of an object. - exports.unhook = function(obj, props) { - return forMethods(obj, props, function(obj, prop) { - // Get a reference to the original method, if it exists. - var orig = exports.orig(obj, prop); - // If there's no original method, it can't be unhooked, so fail. - if (!orig) { return false; } - // Unhook the method. - obj[prop] = orig; - }); - }; -}(typeof exports === "object" && exports || this)); diff --git a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js b/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js deleted file mode 100644 index 2bcdb54..0000000 --- a/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! JavaScript Hooker - v0.2.3 - 1/29/2012 -* http://github.com/cowboy/javascript-hooker -* Copyright (c) 2012 "Cowboy" Ben Alman; Licensed MIT */ -(function(a){function d(a){this.value=a}function e(a){this.value=a}function f(a,b){this.context=a,this.args=b}function g(a,b,d){var e;if(typeof b=="string")b=[b];else if(b==null){b=[];for(e in a)a.hasOwnProperty(e)&&b.push(e)}var f=b.length;while(f--)(c.call(a[b[f]])!=="[object Function]"||d(a,b[f])===!1)&&b.splice(f,1);return b}var b=[].slice,c={}.toString;a.override=function(a){return new d(a)},a.preempt=function(a){return new e(a)},a.filter=function(a,b){return new f(a,b)},a.hook=function(c,h,i){return i==null&&(i=h,h=null),typeof i=="function"&&(i={pre:i}),g(c,h,function(c,g){function j(){var j,k,l,m=b.call(arguments);return i.passName&&m.unshift(g),i.pre&&(j=i.pre.apply(this,m)),j instanceof f?k=j=h.apply(j.context,j.args):j instanceof e?k=j=j.value:(k=h.apply(this,arguments),j=j instanceof d?j.value:k),i.post&&(l=i.post.apply(this,[k].concat(m)),l instanceof d&&(j=l.value)),i.once&&a.unhook(c,g),j}var h=c[g];c[g]=j;if(c[g]!==j)return!1;c[g]._orig=h})},a.orig=function(a,b){return a[b]._orig},a.unhook=function(b,c){return g(b,c,function(b,c){var d=a.orig(b,c);if(!d)return!1;b[c]=d})}})(typeof exports=="object"&&exports||this) \ No newline at end of file diff --git a/node_modules/grunt/node_modules/hooker/grunt.js b/node_modules/grunt/node_modules/hooker/grunt.js deleted file mode 100644 index c695148..0000000 --- a/node_modules/grunt/node_modules/hooker/grunt.js +++ /dev/null @@ -1,47 +0,0 @@ -/*global config:true, task:true*/ -config.init({ - pkg: '', - meta: { - name: 'JavaScript Hooker', - banner: '/*! <%= meta.name %> - v<%= pkg.version %> - <%= template.today("m/d/yyyy") %>\n' + - '* <%= pkg.homepage %>\n' + - '* Copyright (c) <%= template.today("yyyy") %> <%= pkg.author.name %>;' + - ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' - }, - concat: { - 'dist/ba-hooker.js': ['', ''] - }, - min: { - 'dist/ba-hooker.min.js': ['', 'dist/ba-hooker.js'] - }, - test: { - files: ['test/**/*.js'] - }, - lint: { - files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js'] - }, - watch: { - files: '', - tasks: 'lint:files test:files' - }, - jshint: { - options: { - curly: true, - eqeqeq: true, - immed: true, - latedef: true, - newcap: true, - noarg: true, - sub: true, - undef: true, - eqnull: true - }, - globals: { - exports: true - } - }, - uglify: {} -}); - -// Default task. -task.registerTask('default', 'lint:files test:files concat min'); diff --git a/node_modules/grunt/node_modules/hooker/lib/hooker.js b/node_modules/grunt/node_modules/hooker/lib/hooker.js deleted file mode 100644 index 1ff9764..0000000 --- a/node_modules/grunt/node_modules/hooker/lib/hooker.js +++ /dev/null @@ -1,174 +0,0 @@ -/* - * JavaScript Hooker - * http://github.com/cowboy/javascript-hooker - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - // Get an array from an array-like object with slice.call(arrayLikeObject). - var slice = [].slice; - // Get an "[object [[Class]]]" string with toString.call(value). - var toString = {}.toString; - - // I can't think of a better way to ensure a value is a specific type other - // than to create instances and use the `instanceof` operator. - function HookerOverride(v) { this.value = v; } - function HookerPreempt(v) { this.value = v; } - function HookerFilter(c, a) { this.context = c; this.args = a; } - - // When a pre- or post-hook returns the result of this function, the value - // passed will be used in place of the original function's return value. Any - // post-hook override value will take precedence over a pre-hook override - // value. - exports.override = function(value) { - return new HookerOverride(value); - }; - - // When a pre-hook returns the result of this function, the value passed will - // be used in place of the original function's return value, and the original - // function will NOT be executed. - exports.preempt = function(value) { - return new HookerPreempt(value); - }; - - // When a pre-hook returns the result of this function, the context and - // arguments passed will be applied into the original function. - exports.filter = function(context, args) { - return new HookerFilter(context, args); - }; - - // Execute callback(s) for properties of the specified object. - function forMethods(obj, props, callback) { - var prop; - if (typeof props === "string") { - // A single prop string was passed. Create an array. - props = [props]; - } else if (props == null) { - // No props were passed, so iterate over all properties, building an - // array. Unfortunately, Object.keys(obj) doesn't work everywhere yet, so - // this has to be done manually. - props = []; - for (prop in obj) { - if (obj.hasOwnProperty(prop)) { - props.push(prop); - } - } - } - // Execute callback for every method in the props array. - var i = props.length; - while (i--) { - // If the property isn't a function... - if (toString.call(obj[props[i]]) !== "[object Function]" || - // ...or the callback returns false... - callback(obj, props[i]) === false) { - // ...remove it from the props array to be returned. - props.splice(i, 1); - } - } - // Return an array of method names for which the callback didn't fail. - return props; - } - - // Monkey-patch (hook) a method of an object. - exports.hook = function(obj, props, options) { - // If the props argument was omitted, shuffle the arguments. - if (options == null) { - options = props; - props = null; - } - // If just a function is passed instead of an options hash, use that as a - // pre-hook function. - if (typeof options === "function") { - options = {pre: options}; - } - - // Hook the specified method of the object. - return forMethods(obj, props, function(obj, prop) { - // The original (current) method. - var orig = obj[prop]; - // The new hooked function. - function hooked() { - var result, origResult, tmp; - - // Get an array of arguments. - var args = slice.call(arguments); - - // If passName option is specified, prepend prop to the args array, - // passing it as the first argument to any specified hook functions. - if (options.passName) { - args.unshift(prop); - } - - // If a pre-hook function was specified, invoke it in the current - // context with the passed-in arguments, and store its result. - if (options.pre) { - result = options.pre.apply(this, args); - } - - if (result instanceof HookerFilter) { - // If the pre-hook returned hooker.filter(context, args), invoke the - // original function with that context and arguments, and store its - // result. - origResult = result = orig.apply(result.context, result.args); - } else if (result instanceof HookerPreempt) { - // If the pre-hook returned hooker.preempt(value) just use the passed - // value and don't execute the original function. - origResult = result = result.value; - } else { - // Invoke the original function in the current context with the - // passed-in arguments, and store its result. - origResult = orig.apply(this, arguments); - // If the pre-hook returned hooker.override(value), use the passed - // value, otherwise use the original function's result. - result = result instanceof HookerOverride ? result.value : origResult; - } - - if (options.post) { - // If a post-hook function was specified, invoke it in the current - // context, passing in the result of the original function as the - // first argument, followed by any passed-in arguments. - tmp = options.post.apply(this, [origResult].concat(args)); - if (tmp instanceof HookerOverride) { - // If the post-hook returned hooker.override(value), use the passed - // value, otherwise use the previously computed result. - result = tmp.value; - } - } - - // Unhook if the "once" option was specified. - if (options.once) { - exports.unhook(obj, prop); - } - - // Return the result! - return result; - } - // Re-define the method. - obj[prop] = hooked; - // Fail if the function couldn't be hooked. - if (obj[prop] !== hooked) { return false; } - // Store a reference to the original method as a property on the new one. - obj[prop]._orig = orig; - }); - }; - - // Get a reference to the original method from a hooked function. - exports.orig = function(obj, prop) { - return obj[prop]._orig; - }; - - // Un-monkey-patch (unhook) a method of an object. - exports.unhook = function(obj, props) { - return forMethods(obj, props, function(obj, prop) { - // Get a reference to the original method, if it exists. - var orig = exports.orig(obj, prop); - // If there's no original method, it can't be unhooked, so fail. - if (!orig) { return false; } - // Unhook the method. - obj[prop] = orig; - }); - }; -}(typeof exports === "object" && exports || this)); diff --git a/node_modules/grunt/node_modules/hooker/package.json b/node_modules/grunt/node_modules/hooker/package.json deleted file mode 100644 index 97e7761..0000000 --- a/node_modules/grunt/node_modules/hooker/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "hooker", - "description": "Monkey-patch (hook) functions for debugging and stuff.", - "version": "0.2.3", - "homepage": "http://github.com/cowboy/javascript-hooker", - "author": { - "name": "\"Cowboy\" Ben Alman", - "url": "http://benalman.com/" - }, - "repository": { - "type": "git", - "url": "git://github.com/cowboy/javascript-hooker.git" - }, - "bugs": { - "url": "https://github.com/cowboy/javascript-hooker/issues" - }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/cowboy/javascript-hooker/blob/master/LICENSE-MIT" - } - ], - "dependencies": {}, - "devDependencies": { - "grunt": "~0.2.1" - }, - "keywords": [ - "patch", - "hook", - "function", - "debug", - "aop" - ], - "engines": { - "node": "*" - }, - "main": "lib/hooker", - "scripts": { - "test": "grunt test" - }, - "readme": "# JavaScript Hooker\n\nMonkey-patch (hook) functions for debugging and stuff.\n\n## Getting Started\n\nThis code should work just fine in Node.js:\n\nFirst, install the module with: `npm install hooker`\n\n```javascript\nvar hooker = require('hooker');\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n```\n\nOr in the browser:\n\n```html\n\n\n```\n\nIn the browser, you can attach Hooker's methods to any object.\n\n```html\n\n\n\n```\n\n## Documentation\n\n### hooker.hook\nMonkey-patch (hook) one or more methods of an object.\n#### Signature:\n`hooker.hook(object, [ props, ] [options | prehookFunction])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all enumerable methods of `object` will be hooked.\n#### `options`\n* `pre` - (Function) a pre-hook function to be executed before the original function. Arguments passed into the method will be passed into the pre-hook function as well.\n* `post` - (Function) a post-hook function to be executed after the original function. The original function's result is passed into the post-hook function as its first argument, followed by the method arguments.\n* `once` - (Boolean) if true, auto-unhook the function after the first execution.\n* `passName` - (Boolean) if true, pass the name of the method into the pre-hook function as its first arg (preceding all other arguments), and into the post-hook function as the second arg (after result but preceding all other arguments).\n\n#### Returns:\nAn array of hooked method names.\n\n### hooker.unhook\nUn-monkey-patch (unhook) one or more methods of an object.\n#### Signature:\n`hooker.unhook(object [, props ])`\n#### `props`\nThe optional `props` argument can be a method name, array of method names or null. If null (or omitted), all methods of `object` will be unhooked.\n#### Returns:\nAn array of unhooked method names.\n\n### hooker.orig\nGet a reference to the original method from a hooked function.\n#### Signature:\n`hooker.orig(object, props)`\n\n### hooker.override\nWhen a pre- or post-hook returns the result of this function, the value\npassed will be used in place of the original function's return value. Any\npost-hook override value will take precedence over a pre-hook override value.\n#### Signature:\n`hooker.override(value)`\n\n### hooker.preempt\nWhen a pre-hook returns the result of this function, the value passed will\nbe used in place of the original function's return value, and the original\nfunction will NOT be executed.\n#### Signature:\n`hooker.preempt(value)`\n\n### hooker.filter\nWhen a pre-hook returns the result of this function, the context and\narguments passed will be applied into the original function.\n#### Signature:\n`hooker.filter(context, arguments)`\n\n\n## Examples\nSee the unit tests for more examples.\n\n```javascript\nvar hooker = require('hooker');\n// Simple logging.\nhooker.hook(Math, \"max\", function() {\n console.log(arguments.length + \" arguments passed\");\n});\nMath.max(5, 6, 7) // logs: \"3 arguments passed\", returns 7\n\nhooker.unhook(Math, \"max\"); // (This is assumed between all further examples)\nMath.max(5, 6, 7) // 7\n\n// Returning hooker.override(value) overrides the original value.\nhooker.hook(Math, \"max\", function() {\n if (arguments.length === 0) {\n return hooker.override(9000);\n }\n});\nMath.max(5, 6, 7) // 7\nMath.max() // 9000\n\n// Auto-unhook after one execution.\nhooker.hook(Math, \"max\", {\n once: true,\n pre: function() {\n console.log(\"Init something here\");\n }\n});\nMath.max(5, 6, 7) // logs: \"Init something here\", returns 7\nMath.max(5, 6, 7) // 7\n\n// Filter `this` and arguments through a pre-hook function.\nhooker.hook(Math, \"max\", {\n pre: function() {\n var args = [].map.call(arguments, function(num) {\n return num * 2;\n });\n return hooker.filter(this, args); // thisValue, arguments\n }\n});\nMath.max(5, 6, 7) // 14\n\n// Modify the original function's result with a post-hook function.\nhooker.hook(Math, \"max\", {\n post: function(result) {\n return hooker.override(result * 100);\n }\n});\nMath.max(5, 6, 7) // 700\n\n// Hook every Math method. Note: if Math's methods were enumerable, the second\n// argument could be omitted. Since they aren't, an array of properties to hook\n// must be explicitly passed. Non-method properties will be skipped.\n// See a more generic example here: http://bit.ly/vvJlrS\nhooker.hook(Math, Object.getOwnPropertyNames(Math), {\n passName: true,\n pre: function(name) {\n console.log(\"=> Math.\" + name, [].slice.call(arguments, 1));\n },\n post: function(result, name) {\n console.log(\"<= Math.\" + name, result);\n }\n});\n\nvar result = Math.max(5, 6, 7);\n// => Math.max [ 5, 6, 7 ]\n// <= Math.max 7\nresult // 7\n\nresult = Math.ceil(3.456);\n// => Math.ceil [ 3.456 ]\n// <= Math.ceil 4\nresult // 4\n```\n\n## Contributing\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).\n\n_Also, please don't edit files in the \"dist\" subdirectory as they are generated via grunt. You'll find source code in the \"lib\" subdirectory!_\n\n## Release History\n2012/01/09 - v0.2.3 - First official release.\n\n## License\nCopyright (c) 2012 \"Cowboy\" Ben Alman \nLicensed under the MIT license. \n\n", - "readmeFilename": "README.md", - "_id": "hooker@0.2.3", - "_from": "hooker@~0.2.3" -} diff --git a/node_modules/grunt/node_modules/hooker/parent.js b/node_modules/grunt/node_modules/hooker/parent.js deleted file mode 100644 index c4a055e..0000000 --- a/node_modules/grunt/node_modules/hooker/parent.js +++ /dev/null @@ -1,17 +0,0 @@ -var spawn = require('child_process').spawn; - -function loop() { - console.log('starting'); - console.log(this); - //var child = spawn('./node_modules/nodeunit/bin/nodeunit', ['test']); - var child = spawn('node', ['child.js']); - child.stdout.on('data', function(buffer) { - process.stdout.write(buffer); - }); - child.on('exit', this.async()); -} - -var context = { - async: function() { return loop.bind(context); } -}; -loop.call(context); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/hooker/test/hooker_test.js b/node_modules/grunt/node_modules/hooker/test/hooker_test.js deleted file mode 100644 index dc5910a..0000000 --- a/node_modules/grunt/node_modules/hooker/test/hooker_test.js +++ /dev/null @@ -1,435 +0,0 @@ -/*global require:true */ -var hooker = require('../lib/hooker'); - -exports['hook'] = { - setUp: function(done) { - this.order = []; - this.track = function() { - [].push.apply(this.order, arguments); - }; - - this.prop = 1; - this.add = function(a, b) { - this.track("add", this.prop, a, b); - return this.prop + a + b; - }; - - this.obj = { - that: this, - prop: 1, - add1: function(a, b) { - this.that.track("add1", this.prop, a, b); - return this.prop + a + b; - }, - add2: function(a, b) { - this.that.track("add2", this.prop, a, b); - return this.prop + a + b; - }, - add3: function(a, b) { - this.that.track("add3", this.prop, a, b); - return this.prop + a + b; - } - }; - - done(); - }, - 'orig': function(test) { - test.expect(1); - var orig = this.add; - hooker.hook(this, "add", function() {}); - test.strictEqual(hooker.orig(this, "add"), orig, "should return a refernce to the original function."); - test.done(); - }, - 'once': function(test) { - test.expect(5); - var orig = this.add; - hooker.hook(this, "add", { - once: true, - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - } - }); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.strictEqual(this.add, orig, "should automatically unhook when once is specified."); - this.order = []; - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add", 1, 2, 3], "only the original function should execute."); - test.done(); - }, - 'pre-hook (simple syntax)': function(test) { - test.expect(3); - // Pre-hook. - var result = hooker.hook(this, "add", function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre-hook': function(test) { - test.expect(3); - // Pre-hook. - var result = hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - } - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'post-hook': function(test) { - test.expect(3); - // Post-hook. - var result = hooker.hook(this, "add", { - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result, ["add"], "add should have been hooked."); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, return value override': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // This return value will override the original function's return value. - return hooker.override("b" + this.prop + a + b); - } - }); - test.strictEqual(this.add(2, 3), "b123", "should return the overridden result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'post-hook, return value override': function(test) { - test.expect(2); - // Post-hook. - hooker.hook(this, "add", { - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1236", "should return the post-hook overridden result."); - test.deepEqual(this.order, ["add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // This return value will override the original function's return value. - return hooker.override("b" + this.prop + a + b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value - // AND the pre-hook's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1236", "should return the overridden result, and post-hook result should take precedence over pre-hook result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, filtering arguments': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - } - }); - test.strictEqual(this.add(2, 3), "xyz", "should return the original function's result, given filtered context and arguments."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z"], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, filtering arguments': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), "xyz", "should return the original function's result, given filtered context and arguments."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z", "after", 1, 2, 3, "xyz"], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, filtering arguments, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Return hooker.filter(context, arguments) and they will be passed into - // the original function. The "track" and "order" propterites are just - // set here for the same of this unit test. - return hooker.filter({prop: "x", track: this.track, order: this.order}, ["y", "z"]); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override the original function's return value - // AND the pre-hook's return value. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a123xyz", "should return the post-hook overridden result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add", "x", "y", "z", "after", 1, 2, 3, "xyz"], "functions should execute in-order."); - test.done(); - }, - - 'pre-hook, preempt original function': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(); - } - }); - test.strictEqual(this.add(2, 3), undefined, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre-hook, preempt original function with value': function(test) { - test.expect(2); - // Pre-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - } - }); - test.strictEqual(this.add(2, 3), 9000, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, preempt original function with value': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - } - }); - test.strictEqual(this.add(2, 3), 9000, "should return the value passed to preempt."); - test.deepEqual(this.order, ["before", 1, 2, 3, "after", 1, 2, 3, 9000], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, preempt original function with value, return value override': function(test) { - test.expect(2); - // Pre- & post-hook. - hooker.hook(this, "add", { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.track("before", this.prop, a, b); - // Returning hooker.preempt will prevent the original function from being - // invoked and optionally set a return value. - return hooker.preempt(9000); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.track("after", this.prop, a, b, result); - // This return value will override any preempt value set in pre-hook. - return hooker.override("a" + this.prop + a + b + result); - } - }); - test.strictEqual(this.add(2, 3), "a1239000", "should return the overridden result, and post-hook result should take precedence over preempt value."); - test.deepEqual(this.order, ["before", 1, 2, 3, "after", 1, 2, 3, 9000], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, some properties': function(test) { - test.expect(7); - // Pre- & post-hook. - var result = hooker.hook(this.obj, ["add1", "add2"], { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result.sort(), ["add1", "add2"], "both functions should have been hooked."); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add1", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add2", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["add3", 1, 2, 3], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, all properties': function(test) { - test.expect(7); - // Pre- & post-hook. - var result = hooker.hook(this.obj, { - pre: function(a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, a, b); - }, - post: function(result, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, a, b, result); - } - }); - test.deepEqual(result.sort(), ["add1", "add2", "add3"], "all functions should have been hooked."); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add1", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add2", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, 2, 3, "add3", 1, 2, 3, "after", 1, 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'pre- & post-hook, all properties, passName': function(test) { - test.expect(6); - // Pre- & post-hook. - hooker.hook(this.obj, { - passName: true, - pre: function(name, a, b) { - // Arguments are passed into pre-hook as specified. - this.that.track("before", this.prop, name, a, b); - }, - post: function(result, name, a, b) { - // Arguments to post-hook are the original function's return value, - // followed by the specified function arguments. - this.that.track("after", this.prop, name, a, b, result); - } - }); - test.strictEqual(this.obj.add1(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add1", 2, 3, "add1", 1, 2, 3, "after", 1, "add1", 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add2(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add2", 2, 3, "add2", 1, 2, 3, "after", 1, "add2", 2, 3, 6], "functions should execute in-order."); - this.order = []; - test.strictEqual(this.obj.add3(2, 3), 6, "should return the original function's result."); - test.deepEqual(this.order, ["before", 1, "add3", 2, 3, "add3", 1, 2, 3, "after", 1, "add3", 2, 3, 6], "functions should execute in-order."); - test.done(); - }, - 'unhook one property': function(test) { - test.expect(5); - var orig = this.add; - hooker.hook(this, "add", function() {}); - var result = hooker.unhook(this, "add"); - test.deepEqual(result, ["add"], "one function should have been unhooked."); - test.strictEqual(this.add, orig, "should have unhooked, restoring the original function"); - result = hooker.unhook(this, "add"); - test.deepEqual(result, [], "nothing should have been unhooked."); - test.strictEqual(this.add, orig, "shouldn't explode if already unhooked"); - test.strictEqual(this.add.orig, undefined, "original function shouldn't have an orig property"); - test.done(); - }, - 'unhook some properties': function(test) { - test.expect(6); - var add1 = this.obj.add1; - var add2 = this.obj.add2; - hooker.hook(this.obj, ["add1", "add2"], function() {}); - test.strictEqual(hooker.orig(this.obj, "add1"), add1, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add2"), add2, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add3"), undefined, "should not have been hooked, so should not have an original function"); - var result = hooker.unhook(this.obj, ["add1", "add2"]); - test.deepEqual(result.sort(), ["add1", "add2"], "both functions should have been unhooked."); - test.strictEqual(this.obj.add1, add1, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add2, add2, "should have unhooked, restoring the original function"); - test.done(); - }, - 'unhook all properties': function(test) { - test.expect(7); - var add1 = this.obj.add1; - var add2 = this.obj.add2; - var add3 = this.obj.add3; - hooker.hook(this.obj, function() {}); - test.strictEqual(hooker.orig(this.obj, "add1"), add1, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add2"), add2, "should return a refernce to the original function"); - test.strictEqual(hooker.orig(this.obj, "add3"), add3, "should return a refernce to the original function"); - var result = hooker.unhook(this.obj); - test.deepEqual(result.sort(), ["add1", "add2", "add3"], "all functions should have been unhooked."); - test.strictEqual(this.obj.add1, add1, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add2, add2, "should have unhooked, restoring the original function"); - test.strictEqual(this.obj.add3, add3, "should have unhooked, restoring the original function"); - test.done(); - } -}; diff --git a/node_modules/grunt/node_modules/iconv-lite/.npmignore b/node_modules/grunt/node_modules/iconv-lite/.npmignore deleted file mode 100644 index fe46877..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*~ -*sublime-* diff --git a/node_modules/grunt/node_modules/iconv-lite/.travis.yml b/node_modules/grunt/node_modules/iconv-lite/.travis.yml deleted file mode 100644 index 0bab9cd..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ - language: node_js - node_js: - - 0.4 - - 0.6 - - 0.8 diff --git a/node_modules/grunt/node_modules/iconv-lite/LICENSE b/node_modules/grunt/node_modules/iconv-lite/LICENSE deleted file mode 100644 index d518d83..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2011 Alexander Shtuchkin - -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/grunt/node_modules/iconv-lite/README.md b/node_modules/grunt/node_modules/iconv-lite/README.md deleted file mode 100644 index ba30a32..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/README.md +++ /dev/null @@ -1,72 +0,0 @@ -iconv-lite - pure javascript character encoding conversion -====================================================================== - -[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite) - -## Features - -* Pure javascript. Doesn't need native code compilation. -* Easy API. -* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io). -* Encoding is much faster than node-iconv (see below for performance comparison). - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.decode(buf, 'win1251'); - - // Convert from string to an encoded buffer. - buf = iconv.encode("Sample input string", 'win1251'); - - // Check if encoding is supported - iconv.encodingExists("us-ascii") - - -## Supported encodings - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64' -* All widespread single byte encodings: Windows 125x family, ISO-8859 family, - IBM/DOS codepages, Macintosh family, KOI8 family. - Aliases like 'latin1', 'us-ascii' also supported. -* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'. - -Others are easy to add, see the source. Please, participate. -Most encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors! - -Not supported yet: EUC family, Shift_JIS. - - -## Encoding/decoding speed - -Comparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). -Note: your results may vary, so please always check on your hardware. - - operation iconv@1.2.4 iconv-lite@0.2.4 - ---------------------------------------------------------- - encode('win1251') ~115 Mb/s ~230 Mb/s - decode('win1251') ~95 Mb/s ~130 Mb/s - - -## Notes - -When decoding, a 'binary'-encoded string can be used as a source buffer. -Untranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome. - -## Testing - - git clone git@github.com:ashtuchkin/iconv-lite.git - cd iconv-lite - npm install - npm test - - # To view performance: - node test/performance.js - -## TODO - -* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). -* Add more encodings. -* Add transliteration (best fit char). -* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/node_modules/grunt/node_modules/iconv-lite/README.md~ b/node_modules/grunt/node_modules/iconv-lite/README.md~ deleted file mode 100644 index 5f57561..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/README.md~ +++ /dev/null @@ -1,54 +0,0 @@ -iconv-lite - native javascript conversion between character encodings. -====================================================================== - -## Usage - - var iconv = require('iconv-lite'); - - // Convert from an encoded buffer to string. - str = iconv.fromEncoding(buf, 'win-1251'); - // Or - str = iconv.decode(buf, 'win-1251'); - - // Convert from string to an encoded buffer. - buf = iconv.toEncoding("Sample input string", 'win-1251'); - // Or - buf = iconv.encode("Sample input string", 'win-1251'); - -## Supported encodings - -Currently only a small part of encodings supported: - -* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'. -* 'latin1' -* Cyrillic encodings: 'windows-1251', 'koi8-r', 'iso 8859-5'. - -Other encodings are easy to add, see the source. Please, participate. - - -## Encoding/decoding speed - -Comparison with iconv module (1000 times 256kb, on Core i5/2.5 GHz). - - Operation\module iconv iconv-lite (this) - toEncoding('win1251') 19.57 mb/s 49.04 mb/s - fromEncoding('win1251') 16.39 mb/s 24.11 mb/s - - -## Notes - -This module is JavaScript-only, thus can be used in a sandboxed environment like [Cloud9](http://c9.io). - -Untranslatable characters are set to '?'. No transliteration is currently supported, pull requests are welcome. - -## Testing - - npm install --dev iconv-lite - vows - -## TODO - -* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')). -* Add more encodings. -* Add transliteration (best fit char). -* Add tests and correct support of variable-byte encodings (currently work is delegated to node). diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js b/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js deleted file mode 100644 index 0423d63..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js +++ /dev/null @@ -1,9 +0,0 @@ -var big5Table = require('./table/big5.js'); -module.exports = { - 'windows950': 'big5', - 'cp950': 'big5', - 'big5': { - type: 'table', - table: big5Table - } -} diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js b/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js deleted file mode 100644 index 78a63ec..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js +++ /dev/null @@ -1,9 +0,0 @@ -var gbkTable = require('./table/gbk.js'); -module.exports = { - 'windows936': 'gbk', - 'gb2312': 'gbk', - 'gbk': { - type: 'table', - table: gbkTable - } -} diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js b/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js deleted file mode 100644 index f41a7ea..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js +++ /dev/null @@ -1,340 +0,0 @@ -module.exports = { - "437": "cp437", - "737": "cp737", - "775": "cp775", - "850": "cp850", - "852": "cp852", - "855": "cp855", - "857": "cp857", - "858": "cp858", - "860": "cp860", - "861": "cp861", - "862": "cp862", - "863": "cp863", - "864": "cp864", - "865": "cp865", - "866": "cp866", - "869": "cp869", - "874": "iso885911", - "1250": "windows1250", - "1251": "windows1251", - "1252": "windows1252", - "1253": "windows1253", - "1254": "windows1254", - "1255": "windows1255", - "1256": "windows1256", - "1257": "windows1257", - "1258": "windows1258", - "10000": "macroman", - "10006": "macgreek", - "10007": "maccyrillic", - "10029": "maccenteuro", - "10079": "maciceland", - "10081": "macturkish", - "20866": "koi8r", - "21866": "koi8u", - "28591": "iso88591", - "28592": "iso88592", - "28593": "iso88593", - "28594": "iso88594", - "28595": "iso88595", - "28596": "iso88596", - "28597": "iso88597", - "28598": "iso88598", - "28599": "iso88599", - "28600": "iso885910", - "28601": "iso885911", - "28603": "iso885913", - "28604": "iso885914", - "28605": "iso885915", - "28606": "iso885916", - "ascii8bit": "ascii", - "usascii": "ascii", - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - "cp819": "iso88951", - "arabic": "iso88596", - "arabic8": "iso88596", - "greek": "iso88597", - "greek8": "iso88597", - "hebrew": "iso88598", - "hebrew8": "iso88598", - "turkish": "iso88599", - "turkish8": "iso88599", - "thai": "iso885911", - "thai8": "iso885911", - "tis620": "iso885911", - "windows874": "iso885911", - "win874": "iso885911", - "cp874": "iso885911", - "celtic": "iso885914", - "celtic8": "iso885914", - "cp20866": "koi8r", - "ibm878": "koi8r", - "cp21866": "koi8u", - "ibm1168": "koi8u", - "windows1250": { - "type": "singlebyte", - "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "win1250": "windows1250", - "cp1250": "windows1250", - "windows1251": { - "type": "singlebyte", - "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" - }, - "win1251": "windows1251", - "cp1251": "windows1251", - "windows1252": { - "type": "singlebyte", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "win1252": "windows1252", - "cp1252": "windows1252", - "windows1253": { - "type": "singlebyte", - "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "win1253": "windows1253", - "cp1253": "windows1253", - "windows1254": { - "type": "singlebyte", - "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "win1254": "windows1254", - "cp1254": "windows1254", - "windows1255": { - "type": "singlebyte", - "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ�ֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "win1255": "windows1255", - "cp1255": "windows1255", - "windows1256": { - "type": "singlebyte", - "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" - }, - "win1256": "windows1256", - "cp1256": "windows1256", - "windows1257": { - "type": "singlebyte", - "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" - }, - "win1257": "windows1257", - "cp1257": "windows1257", - "windows1258": { - "type": "singlebyte", - "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" - }, - "win1258": "windows1258", - "cp1258": "windows1258", - "iso88591": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28591": "iso88591", - "iso88592": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" - }, - "cp28592": "iso88592", - "iso88593": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" - }, - "cp28593": "iso88593", - "iso88594": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" - }, - "cp28594": "iso88594", - "iso88595": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" - }, - "cp28595": "iso88595", - "iso88596": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" - }, - "cp28596": "iso88596", - "iso88597": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" - }, - "cp28597": "iso88597", - "iso88598": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" - }, - "cp28598": "iso88598", - "iso88599": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" - }, - "cp28599": "iso88599", - "iso885910": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" - }, - "cp28600": "iso885910", - "iso885911": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" - }, - "cp28601": "iso885911", - "iso885913": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" - }, - "cp28603": "iso885913", - "iso885914": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" - }, - "cp28604": "iso885914", - "iso885915": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" - }, - "cp28605": "iso885915", - "iso885916": { - "type": "singlebyte", - "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" - }, - "cp28606": "iso885916", - "cp437": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm437": "cp437", - "cp737": { - "type": "singlebyte", - "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " - }, - "ibm737": "cp737", - "cp775": { - "type": "singlebyte", - "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " - }, - "ibm775": "cp775", - "cp850": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm850": "cp850", - "cp852": { - "type": "singlebyte", - "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " - }, - "ibm852": "cp852", - "cp855": { - "type": "singlebyte", - "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " - }, - "ibm855": "cp855", - "cp857": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " - }, - "ibm857": "cp857", - "cp858": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " - }, - "ibm858": "cp858", - "cp860": { - "type": "singlebyte", - "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm860": "cp860", - "cp861": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm861": "cp861", - "cp862": { - "type": "singlebyte", - "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm862": "cp862", - "cp863": { - "type": "singlebyte", - "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm863": "cp863", - "cp864": { - "type": "singlebyte", - "chars": "°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" - }, - "ibm864": "cp864", - "cp865": { - "type": "singlebyte", - "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " - }, - "ibm865": "cp865", - "cp866": { - "type": "singlebyte", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " - }, - "ibm866": "cp866", - "cp869": { - "type": "singlebyte", - "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " - }, - "ibm869": "cp869", - "maccenteuro": { - "type": "singlebyte", - "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" - }, - "maccroatian": { - "type": "singlebyte", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" - }, - "maccyrillic": { - "type": "singlebyte", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "macgreek": { - "type": "singlebyte", - "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" - }, - "maciceland": { - "type": "singlebyte", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macroman": { - "type": "singlebyte", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macromania": { - "type": "singlebyte", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macthai": { - "type": "singlebyte", - "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" - }, - "macturkish": { - "type": "singlebyte", - "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" - }, - "macukraine": { - "type": "singlebyte", - "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" - }, - "koi8r": { - "type": "singlebyte", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - }, - "koi8u": { - "type": "singlebyte", - "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" - } -}; diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js b/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js deleted file mode 100644 index 605c72d..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js +++ /dev/null @@ -1 +0,0 @@ -module.exports={"33088":19991,"33089":20002,"33090":20012,"33091":20053,"33092":20066,"33093":20106,"33094":20144,"33095":20203,"33096":20205,"33097":20220,"33098":20252,"33099":20362,"33100":20479,"33101":20546,"33102":20560,"33103":20600,"33104":20696,"33105":20702,"33106":20724,"33107":20758,"33108":20810,"33109":20817,"33110":20836,"33111":20842,"33112":20869,"33113":20880,"33114":20893,"33115":20902,"33116":20904,"33117":20905,"33118":20935,"33119":20950,"33120":20955,"33121":20972,"33122":20988,"33123":21003,"33124":21012,"33125":21013,"33126":21024,"33127":21035,"33128":21049,"33129":21071,"33130":21105,"33131":21136,"33132":21138,"33133":21140,"33134":21148,"33135":21167,"33136":21173,"33137":21200,"33138":21248,"33139":21255,"33140":21284,"33141":21318,"33142":21343,"33143":21395,"33144":21424,"33145":21469,"33146":21539,"33147":21584,"33148":21585,"33149":21642,"33150":21661,"33185":21667,"33186":21684,"33187":21712,"33188":21795,"33189":21823,"33190":21836,"33191":21843,"33192":21853,"33193":21868,"33194":21918,"33195":21929,"33196":21996,"33197":22005,"33198":22051,"33199":22096,"33200":22140,"33201":22154,"33202":22164,"33203":22176,"33204":22191,"33205":22232,"33206":22272,"33207":22361,"33208":22373,"33209":22399,"33210":22405,"33211":22409,"33212":22433,"33213":22444,"33214":22452,"33215":22464,"33216":22472,"33217":22483,"33218":22511,"33219":22596,"33220":22636,"33221":22674,"33222":22682,"33223":22706,"33224":22712,"33225":22757,"33226":22779,"33227":22786,"33228":22795,"33229":22800,"33230":22808,"33231":22811,"33232":29836,"33233":29837,"33234":29849,"33235":29851,"33236":29860,"33237":29876,"33238":29881,"33239":29896,"33240":29900,"33241":29904,"33242":29907,"33243":30018,"33244":30037,"33245":30062,"33246":30093,"33247":30110,"33248":30172,"33249":30252,"33250":30287,"33251":30289,"33252":30323,"33253":30324,"33254":30373,"33255":30425,"33256":30478,"33257":30479,"33258":30552,"33259":30578,"33260":30583,"33261":30584,"33262":30586,"33263":30587,"33264":30616,"33265":30639,"33266":30654,"33267":30659,"33268":30661,"33269":30667,"33270":30685,"33271":30694,"33272":30708,"33273":30750,"33274":30781,"33275":30786,"33276":30788,"33277":30795,"33278":30801,"33344":21782,"33345":22775,"33346":38964,"33347":33883,"33348":28948,"33349":33398,"33350":35158,"33351":40236,"33352":40206,"33353":36527,"33354":24674,"33355":26214,"33356":34510,"33357":25785,"33358":37772,"33359":22107,"33360":28485,"33361":35532,"33362":29001,"33363":24012,"33364":34633,"33365":39464,"33366":31658,"33367":36107,"33368":39255,"33369":23597,"33370":32331,"33371":38938,"33372":20518,"33373":25458,"33374":40568,"33375":30783,"33376":40633,"33377":40634,"33378":36046,"33379":35715,"33380":61305,"33381":33931,"33382":37284,"33383":31331,"33384":25776,"33385":24061,"33386":24214,"33387":32865,"33388":26965,"33389":31466,"33390":28710,"33391":26812,"33392":31095,"33393":28060,"33394":36841,"33395":31074,"33396":22178,"33397":34687,"33398":21093,"33399":31108,"33400":28300,"33401":37271,"33402":31622,"33403":38956,"33404":26717,"33405":20397,"33406":34222,"33441":31725,"33442":34635,"33443":20534,"33444":26893,"33445":27542,"33446":24910,"33447":20855,"33448":30495,"33449":20516,"33450":32622,"33451":30452,"33452":27097,"33453":24803,"33454":25334,"33455":21599,"33456":38788,"33457":22092,"33458":20677,"33459":22040,"33460":34398,"33461":22834,"33462":22875,"33463":22877,"33464":22883,"33465":22892,"33466":22939,"33467":22999,"33468":23019,"33469":23066,"33470":23210,"33471":23248,"33472":23281,"33473":23350,"33474":23497,"33475":23539,"33476":23571,"33477":23580,"33478":23582,"33479":23635,"33480":23705,"33481":23708,"33482":23738,"33483":23739,"33484":23745,"33485":23797,"33486":23802,"33487":23829,"33488":23832,"33489":23870,"33490":23891,"33491":23900,"33492":23917,"33493":23923,"33494":23924,"33495":23948,"33496":23952,"33497":23993,"33498":24016,"33499":24019,"33500":24135,"33501":24164,"33502":24271,"33503":24272,"33504":24298,"33505":24304,"33506":24329,"33507":24332,"33508":24337,"33509":24353,"33510":24372,"33511":24385,"33512":24389,"33513":24401,"33514":24412,"33515":24422,"33516":24451,"33517":24560,"33518":24650,"33519":24672,"33520":24715,"33521":24742,"33522":24798,"33523":24849,"33524":24864,"33525":24865,"33526":24892,"33527":24893,"33528":24984,"33529":25015,"33530":25076,"33531":25107,"33532":25117,"33533":25118,"33534":25143,"33600":24186,"33601":27664,"33602":21454,"33603":20267,"33604":20302,"33605":21556,"33606":22257,"33607":22766,"33608":22841,"33609":22918,"33610":23596,"33611":20915,"33612":20914,"33613":28798,"33614":35265,"33615":35282,"33616":36125,"33617":36710,"33618":20122,"33619":26469,"33620":20177,"33621":20004,"33622":21327,"33623":23626,"33624":20872,"33625":24213,"33626":25269,"33627":19996,"33628":20105,"33629":29366,"33630":31868,"33631":32416,"33632":21351,"33633":36711,"33634":37048,"33635":38271,"33636":38376,"33637":20384,"33638":20387,"33639":20822,"33640":21017,"33641":21170,"33642":21364,"33643":22850,"33644":24069,"33645":26594,"33646":27769,"33647":20026,"33648":32419,"33649":32418,"33650":32426,"33651":32427,"33652":32421,"33653":32422,"33654":32417,"33655":32989,"33656":33486,"33657":35745,"33658":35746,"33659":35747,"33660":36126,"33661":36127,"33662":20891,"33697":36712,"33698":38377,"33699":38886,"33700":39029,"33701":39118,"33702":39134,"33703":20457,"33704":20204,"33705":20261,"33706":20010,"33707":20262,"33708":20179,"33709":20923,"33710":21018,"33711":21093,"33712":21592,"33713":23089,"33714":23385,"33715":23777,"33716":23707,"33717":23704,"33718":24072,"33719":24211,"33720":24452,"33721":25375,"33722":26102,"33723":26187,"33724":20070,"33725":27902,"33726":27971,"33727":20044,"33728":29421,"33729":29384,"33730":20137,"33731":30757,"33732":31210,"33733":32442,"33734":32433,"33735":32441,"33736":32431,"33737":32445,"33738":32432,"33739":32423,"33740":32429,"33741":32435,"33742":32440,"33743":32439,"33744":32961,"33745":33033,"33746":21005,"33747":35760,"33748":35750,"33749":35752,"33750":35751,"33751":35754,"33752":35759,"33753":35757,"33754":35755,"33755":23682,"33756":36130,"33757":36129,"33758":36713,"33759":36715,"33760":38025,"33761":38024,"33762":38026,"33763":38027,"33764":38378,"33765":38453,"33766":38485,"33767":38473,"33768":39269,"33769":39532,"33770":39592,"33771":20266,"33772":20255,"33773":20390,"33774":20391,"33775":21153,"33776":21160,"33777":21306,"33778":21442,"33779":21713,"33780":38382,"33781":34900,"33782":22269,"33783":22362,"33784":22441,"33785":25191,"33786":22815,"33787":23044,"33788":22919,"33789":19987,"33790":23558,"33856":23625,"33857":23781,"33858":23703,"33859":24102,"33860":24080,"33861":24352,"33862":24378,"33863":20174,"33864":24469,"33865":20932,"33866":24581,"33867":25195,"33868":25346,"33869":25194,"33870":25249,"33871":25379,"33872":36133,"33873":21551,"33874":26011,"33875":26025,"33876":26172,"33877":21206,"33878":24323,"33879":26465,"33880":26541,"33881":26432,"33882":27682,"33883":20937,"33884":27973,"33885":28170,"33886":27882,"33887":27814,"33888":20928,"33889":29301,"33890":29424,"33891":29616,"33892":20135,"33893":27605,"33894":24322,"33895":20247,"33896":32458,"33897":32479,"33898":32461,"33899":32459,"33900":32460,"33901":32454,"33902":32453,"33903":32452,"33904":32456,"33905":32449,"33906":32450,"33907":38069,"33908":20064,"33909":33626,"33910":33550,"33911":33682,"33912":24196,"33913":33483,"33914":22788,"33915":26415,"33916":34926,"33917":35269,"33918":35268,"33953":35775,"33954":35766,"33955":35776,"33956":35767,"33957":35768,"33958":35774,"33959":35772,"33960":35769,"33961":36137,"33962":36131,"33963":36143,"33964":36135,"33965":36138,"33966":36139,"33967":36717,"33968":36719,"33969":36825,"33970":36830,"33971":36851,"33972":38039,"33973":38035,"33974":38031,"33975":38034,"33976":38381,"33977":38472,"33978":38470,"33979":38452,"33980":39030,"33981":39031,"33982":40060,"33983":40479,"33984":21348,"33985":40614,"33986":22791,"33987":20263,"33988":20254,"33989":20975,"33990":21056,"33991":21019,"33992":21171,"33993":21195,"33994":20007,"33995":21333,"33996":21727,"33997":21796,"33998":20052,"33999":22260,"34000":23591,"34001":22330,"34002":25253,"34003":22490,"34004":22774,"34005":23090,"34006":23547,"34007":23706,"34008":24103,"34009":24079,"34010":21397,"34011":21417,"34012":24694,"34013":38391,"34014":24812,"34015":24699,"34016":24700,"34017":25315,"34018":25381,"34019":25442,"34020":25196,"34021":26531,"34022":26635,"34023":26632,"34024":38054,"34025":27531,"34026":22771,"34027":27695,"34028":27689,"34029":28044,"34030":20945,"34031":28270,"34032":28065,"34033":27748,"34034":27979,"34035":27985,"34036":28067,"34037":26080,"34038":29369,"34039":33487,"34040":30011,"34041":30153,"34042":21457,"34043":30423,"34044":30746,"34045":31174,"34046":31383,"34112":31508,"34113":31499,"34114":32478,"34115":32467,"34116":32466,"34117":32477,"34118":19997,"34119":32476,"34120":32473,"34121":32474,"34122":32470,"34123":32475,"34124":32899,"34125":32958,"34126":32960,"34127":21326,"34128":33713,"34129":33484,"34130":34394,"34131":35270,"34132":35780,"34133":35789,"34134":35777,"34135":35778,"34136":35791,"34137":35781,"34138":35784,"34139":35787,"34140":35785,"34141":35786,"34142":35779,"34143":36142,"34144":36148,"34145":36144,"34146":36155,"34147":36146,"34148":36153,"34149":36154,"34150":36149,"34151":20080,"34152":36140,"34153":36152,"34154":36151,"34155":36722,"34156":36724,"34157":36726,"34158":36827,"34159":37038,"34160":20065,"34161":38046,"34162":38062,"34163":38041,"34164":38048,"34165":38055,"34166":38045,"34167":38052,"34168":38051,"34169":38389,"34170":38384,"34171":24320,"34172":38386,"34173":38388,"34174":38387,"34209":38431,"34210":38454,"34211":38451,"34212":38887,"34213":39033,"34214":39034,"34215":39035,"34216":39274,"34217":39277,"34218":39272,"34219":39278,"34220":39276,"34221":20911,"34222":39533,"34223":20081,"34224":20538,"34225":20256,"34226":20165,"34227":20542,"34228":20260,"34229":20588,"34230":38130,"34231":21183,"34232":31215,"34233":27719,"34234":21527,"34235":21596,"34236":21595,"34237":22253,"34238":22278,"34239":28034,"34240":22359,"34241":22366,"34242":22488,"34243":33556,"34244":22885,"34245":22920,"34246":29233,"34247":24574,"34248":24582,"34249":24698,"34250":25439,"34251":25250,"34252":25443,"34253":26500,"34254":26198,"34255":26197,"34256":26104,"34257":20250,"34258":19994,"34259":26497,"34260":26472,"34261":26722,"34262":26539,"34263":23681,"34264":27807,"34265":28781,"34266":28287,"34267":28369,"34268":27815,"34269":28902,"34270":28860,"34271":28800,"34272":28949,"34273":29239,"34274":29422,"34275":29502,"34276":29682,"34277":24403,"34278":30415,"34279":30544,"34280":30529,"34281":38606,"34282":30860,"34283":33410,"34284":31509,"34285":31908,"34286":32463,"34287":32482,"34288":32465,"34289":32485,"34290":32486,"34291":20041,"34292":32673,"34293":22307,"34294":32928,"34295":33050,"34296":32959,"34297":33041,"34298":33636,"34299":33479,"34300":21494,"34301":33716,"34302":34398,"34368":34383,"34369":21495,"34370":34568,"34371":34476,"34372":34917,"34373":35013,"34374":35815,"34375":35813,"34376":35814,"34377":35797,"34378":35799,"34379":35800,"34380":35801,"34381":35811,"34382":35802,"34383":35805,"34384":35803,"34385":35809,"34386":35810,"34387":35808,"34388":35807,"34389":36156,"34390":36164,"34391":36158,"34392":36159,"34393":36160,"34394":36161,"34395":36162,"34396":36165,"34397":36739,"34398":36733,"34399":36732,"34400":36734,"34401":20892,"34402":36816,"34403":36798,"34404":36829,"34405":36807,"34406":37049,"34407":38068,"34408":38067,"34409":38073,"34410":38072,"34411":38078,"34412":38080,"34413":38085,"34414":38057,"34415":38082,"34416":38083,"34417":38089,"34418":38091,"34419":38044,"34420":38093,"34421":38079,"34422":38086,"34423":38392,"34424":38504,"34425":38589,"34426":30005,"34427":39044,"34428":39037,"34429":39039,"34430":39036,"34465":39041,"34466":39042,"34467":39282,"34468":39284,"34469":39281,"34470":39280,"34471":39536,"34472":39534,"34473":39535,"34474":40480,"34475":20389,"34476":20392,"34477":21294,"34478":21388,"34479":23581,"34480":21589,"34481":21497,"34482":21949,"34483":21863,"34484":21716,"34485":22242,"34486":22270,"34487":23576,"34488":22443,"34489":22545,"34490":23551,"34491":26790,"34492":22842,"34493":22849,"34494":22954,"34495":23454,"34496":23517,"34497":23545,"34498":23649,"34499":23853,"34500":23702,"34501":24065,"34502":24124,"34503":24443,"34504":24577,"34505":24815,"34506":24696,"34507":24813,"34508":24808,"34509":25602,"34510":25524,"34511":25530,"34512":30021,"34513":33635,"34514":26538,"34515":28378,"34516":28173,"34517":27721,"34518":28385,"34519":28382,"34520":28176,"34521":28072,"34522":28063,"34523":27818,"34524":28180,"34525":28183,"34526":28068,"34527":33639,"34528":23572,"34529":33638,"34530":29425,"34531":29712,"34532":29595,"34533":30111,"34534":30113,"34535":30127,"34536":30186,"34537":23613,"34538":30417,"34539":30805,"34540":31087,"34541":31096,"34542":31181,"34543":31216,"34544":27964,"34545":31389,"34546":31546,"34547":31581,"34548":32509,"34549":32510,"34550":32508,"34551":32496,"34552":32491,"34553":32511,"34554":32039,"34555":32512,"34556":32434,"34557":32494,"34558":32504,"34624":32501,"34625":32438,"34626":32500,"34627":32490,"34628":32513,"34629":32502,"34630":32602,"34631":38395,"34632":33669,"34633":30422,"34634":33642,"34635":33485,"34636":34432,"34637":35829,"34638":35821,"34639":35820,"34640":35748,"34641":35819,"34642":35823,"34643":35828,"34644":35824,"34645":35826,"34646":35825,"34647":35827,"34648":35822,"34649":23486,"34650":36168,"34651":36170,"34652":36213,"34653":36214,"34654":36741,"34655":36740,"34656":36731,"34657":36828,"34658":36874,"34659":36882,"34660":38128,"34661":38134,"34662":38108,"34663":38125,"34664":38114,"34665":38124,"34666":38120,"34667":38133,"34668":38115,"34669":38402,"34670":38394,"34671":38397,"34672":38401,"34673":38400,"34674":38469,"34675":39047,"34676":39046,"34677":39122,"34678":39290,"34679":39292,"34680":39285,"34681":39287,"34682":39539,"34683":32942,"34684":39600,"34685":40483,"34686":40482,"34721":20964,"34722":40784,"34723":20159,"34724":20202,"34725":20215,"34726":20396,"34727":20393,"34728":20461,"34729":21095,"34730":21016,"34731":21073,"34732":21053,"34733":21385,"34734":21792,"34735":22068,"34736":21719,"34737":22040,"34738":21943,"34739":21880,"34740":21501,"34741":22687,"34742":22367,"34743":22368,"34744":22549,"34745":23092,"34746":23157,"34747":22953,"34748":23047,"34749":23046,"34750":23485,"34751":23457,"34752":20889,"34753":23618,"34754":23956,"34755":24092,"34756":24223,"34757":21416,"34758":24217,"34759":21422,"34760":24191,"34761":24377,"34762":24198,"34763":34385,"34764":24551,"34765":24578,"34766":24751,"34767":24814,"34768":24868,"34769":24579,"34770":25370,"34771":25169,"34772":25438,"34773":25320,"34774":25376,"34775":25242,"34776":25528,"34777":25599,"34778":25932,"34779":25968,"34780":26242,"34781":26165,"34782":26679,"34783":26729,"34784":26530,"34785":26631,"34786":27004,"34787":26728,"34788":20048,"34789":26526,"34790":27431,"34791":27527,"34792":27572,"34793":27974,"34794":27900,"34795":27905,"34796":27975,"34797":28291,"34798":28070,"34799":28071,"34800":27988,"34801":28909,"34802":22870,"34803":33721,"34804":30126,"34805":30353,"34806":30385,"34807":30424,"34808":30830,"34809":30721,"34810":31377,"34811":31351,"34812":32532,"34813":32451,"34814":32428,"34880":32516,"34881":32517,"34882":32521,"34883":32534,"34884":32536,"34885":32447,"34886":32526,"34887":32531,"34888":32525,"34889":32514,"34890":32520,"34891":32519,"34892":39554,"34893":32610,"34894":33014,"34895":32932,"34896":33714,"34897":33643,"34898":33931,"34899":34430,"34900":34583,"34901":21355,"34902":35850,"34903":35845,"34904":35848,"34905":35846,"34906":35806,"34907":35831,"34908":35832,"34909":35838,"34910":35839,"34911":35844,"34912":35843,"34913":35841,"34914":35770,"34915":35812,"34916":35847,"34917":35837,"34918":35840,"34919":31446,"34920":36180,"34921":36175,"34922":36171,"34923":36145,"34924":36134,"34925":36172,"34926":36132,"34927":21334,"34928":36176,"34929":36136,"34930":36179,"34931":36341,"34932":36745,"34933":36742,"34934":36749,"34935":36744,"34936":36743,"34937":36718,"34938":36750,"34939":36747,"34940":36746,"34941":36866,"34942":36801,"34977":37051,"34978":37073,"34979":37011,"34980":38156,"34981":38161,"34982":38144,"34983":38138,"34984":38096,"34985":38148,"34986":38109,"34987":38160,"34988":38153,"34989":38155,"34990":38049,"34991":38146,"34992":38398,"34993":38405,"34994":24041,"34995":39049,"34996":39052,"34997":20859,"34998":39295,"34999":39297,"35000":39548,"35001":39547,"35002":39543,"35003":39542,"35004":39549,"35005":39550,"35006":39545,"35007":39544,"35008":39607,"35009":38393,"35010":40063,"35011":40065,"35012":40489,"35013":40486,"35014":40632,"35015":40831,"35016":20454,"35017":20647,"35018":20394,"35019":24130,"35020":21058,"35021":21544,"35022":21725,"35023":22003,"35024":22438,"35025":22363,"35026":22859,"35027":34949,"35028":23398,"35029":23548,"35030":23466,"35031":20973,"35032":24811,"35033":25044,"35034":24518,"35035":25112,"35036":25317,"35037":25377,"35038":25374,"35039":25454,"35040":25523,"35041":25321,"35042":25441,"35043":25285,"35044":25373,"35045":21382,"35046":26195,"35047":26196,"35048":26137,"35049":26726,"35050":27178,"35051":26641,"35052":26925,"35053":26725,"35054":26426,"35055":26721,"35056":28096,"35057":27987,"35058":27901,"35059":27978,"35060":27811,"35061":28582,"35062":28177,"35063":28861,"35064":28903,"35065":28783,"35066":28907,"35067":28950,"35068":29420,"35069":29585,"35070":29935,"35136":30232,"35137":21346,"35138":30610,"35139":30742,"35140":30875,"35141":31215,"35142":39062,"35143":31267,"35144":31397,"35145":31491,"35146":31579,"35147":32546,"35148":32547,"35149":33830,"35150":32538,"35151":21439,"35152":32543,"35153":32540,"35154":32537,"35155":32457,"35156":33147,"35157":20852,"35158":33329,"35159":33633,"35160":33831,"35161":33436,"35162":34434,"35163":33828,"35164":35044,"35165":20146,"35166":35278,"35167":35867,"35168":35866,"35169":35855,"35170":35763,"35171":35851,"35172":35853,"35173":35856,"35174":35864,"35175":35834,"35176":35858,"35177":35859,"35178":35773,"35179":35861,"35180":35865,"35181":35852,"35182":35862,"35183":36182,"35184":36752,"35185":36753,"35186":36755,"35187":36751,"35188":21150,"35189":36873,"35190":36831,"35191":36797,"35192":36951,"35193":37050,"35194":38189,"35195":38191,"35196":38192,"35197":38169,"35198":38065,"35233":38050,"35234":38177,"35235":24405,"35236":38126,"35237":38181,"35238":38182,"35239":38175,"35240":38178,"35241":38193,"35242":38414,"35243":38543,"35244":38505,"35245":38745,"35246":33148,"35247":39050,"35248":39048,"35249":39057,"35250":39060,"35251":22836,"35252":39059,"35253":39056,"35254":39302,"35255":39279,"35256":39300,"35257":39301,"35258":39559,"35259":39560,"35260":39558,"35261":39608,"35262":39612,"35263":40077,"35264":40501,"35265":40490,"35266":40495,"35267":40493,"35268":40499,"35269":40857,"35270":40863,"35271":20248,"35272":20607,"35273":20648,"35274":21169,"35275":21659,"35276":21523,"35277":21387,"35278":22489,"35279":23156,"35280":23252,"35281":23351,"35282":23604,"35283":23654,"35284":23679,"35285":23896,"35286":24110,"35287":24357,"35288":24212,"35289":24691,"35290":25103,"35291":20987,"35292":25380,"35293":25319,"35294":25311,"35295":25601,"35296":25947,"35297":27609,"35298":26279,"35299":26723,"35300":26816,"35301":26727,"35302":26633,"35303":27183,"35304":27539,"35305":27617,"35306":27870,"35307":28392,"35308":27982,"35309":28059,"35310":28389,"35311":28073,"35312":28493,"35313":33829,"35314":28799,"35315":28891,"35316":28905,"35317":22681,"35318":29406,"35319":33719,"35320":29615,"35321":29815,"35322":30184,"35323":30103,"35324":30699,"35325":30970,"35326":30710,"35392":31699,"35393":31914,"35394":38214,"35395":31937,"35396":32553,"35397":32489,"35398":32554,"35399":32533,"35400":32551,"35401":32503,"35402":32541,"35403":24635,"35404":32437,"35405":32555,"35406":32420,"35407":32549,"35408":32358,"35409":32550,"35410":22768,"35411":32874,"35412":32852,"35413":32824,"35414":33043,"35415":32966,"35416":33080,"35417":33037,"35418":20020,"35419":20030,"35420":33392,"35421":34103,"35422":34015,"35423":20111,"35424":34684,"35425":34632,"35426":20149,"35427":35099,"35428":35274,"35429":35868,"35430":35876,"35431":35878,"35432":35762,"35433":35854,"35434":35875,"35435":35874,"35436":35466,"35437":35879,"35438":36186,"35439":36187,"35440":36141,"35441":36185,"35442":36235,"35443":36758,"35444":36759,"35445":27586,"35446":36757,"35447":33286,"35448":36824,"35449":36808,"35450":37213,"35451":38208,"35452":38209,"35453":38170,"35454":38190,"35489":38194,"35490":38149,"35491":38180,"35492":38202,"35493":38201,"35494":38203,"35495":38206,"35496":38199,"35497":38420,"35498":38421,"35499":38417,"35500":38385,"35501":38544,"35502":38582,"35503":34429,"35504":38889,"35505":39063,"35506":39123,"35507":39563,"35508":39567,"35509":40092,"35510":40091,"35511":40084,"35512":40081,"35513":40511,"35514":40509,"35515":28857,"35516":25995,"35517":19995,"35518":22108,"35519":22329,"35520":22418,"35521":23158,"35522":25041,"35523":25193,"35524":25527,"35525":25200,"35526":25781,"35527":25670,"35528":25822,"35529":25783,"35530":26029,"35531":27103,"35532":26588,"35533":27099,"35534":26592,"35535":27428,"35536":24402,"35537":27553,"35538":27899,"35539":28182,"35540":28388,"35541":28174,"35542":28293,"35543":27983,"35544":28908,"35545":28952,"35546":29367,"35547":29454,"35548":29934,"35549":30112,"35550":30545,"35551":30784,"35552":31036,"35553":31313,"35554":31229,"35555":31388,"35556":31373,"35557":31659,"35558":31783,"35559":31658,"35560":31697,"35561":31616,"35562":31918,"35563":32455,"35564":32558,"35565":32469,"35566":32557,"35567":32483,"35568":32559,"35569":32728,"35570":32844,"35571":32834,"35572":33040,"35573":33169,"35574":26087,"35575":33832,"35576":34013,"35577":33632,"35578":34546,"35579":34633,"35580":35280,"35581":35294,"35582":35871,"35648":35880,"35649":35884,"35650":35882,"35651":36184,"35652":36434,"35653":36857,"35654":36344,"35655":36527,"35656":36716,"35657":36761,"35658":36841,"35659":21307,"35660":37233,"35661":38225,"35662":38145,"35663":38056,"35664":38221,"35665":38215,"35666":38224,"35667":38226,"35668":38217,"35669":38422,"35670":38383,"35671":38423,"35672":38425,"35673":26434,"35674":21452,"35675":38607,"35676":40481,"35677":39069,"35678":39068,"35679":39064,"35680":39066,"35681":39067,"35682":39311,"35683":39306,"35684":39304,"35685":39569,"35686":39617,"35687":40104,"35688":40100,"35689":40107,"35690":40103,"35691":40515,"35692":40517,"35693":40516,"35694":22404,"35695":22364,"35696":23456,"35697":24222,"35698":24208,"35699":24809,"35700":24576,"35701":25042,"35702":25314,"35703":26103,"35704":27249,"35705":26911,"35706":27016,"35707":27257,"35708":28487,"35709":28625,"35710":27813,"35745":28626,"35746":27896,"35747":28865,"35748":29261,"35749":29322,"35750":20861,"35751":29549,"35752":29626,"35753":29756,"35754":30068,"35755":30250,"35756":30861,"35757":31095,"35758":31283,"35759":31614,"35760":33575,"35761":32462,"35762":32499,"35763":32472,"35764":32599,"35765":32564,"35766":33211,"35767":33402,"35768":34222,"35769":33647,"35770":34433,"35771":34631,"35772":35014,"35773":34948,"35774":35889,"35775":35782,"35776":35885,"35777":35890,"35778":35749,"35779":35887,"35780":36192,"35781":36190,"35782":36343,"35783":36762,"35784":36735,"35785":36766,"35786":36793,"35787":38236,"35788":38237,"35789":38238,"35790":38142,"35791":38231,"35792":38232,"35793":38230,"35794":38233,"35795":38197,"35796":38210,"35797":38143,"35798":37694,"35799":20851,"35800":38471,"35801":38590,"35802":38654,"35803":38892,"35804":38901,"35805":31867,"35806":39072,"35807":39125,"35808":39314,"35809":39313,"35810":39579,"35811":39575,"35812":40120,"35813":40115,"35814":40109,"35815":40119,"35816":40529,"35817":40521,"35818":40522,"35819":40524,"35820":40527,"35821":20029,"35822":40628,"35823":21149,"35824":21657,"35825":22052,"35826":20005,"35827":23453,"35828":24748,"35829":24527,"35830":25318,"35831":25600,"35832":32999,"35833":27015,"35834":28572,"35835":28491,"35836":28809,"35837":29649,"35838":30719,"35904":30778,"35905":30718,"35906":30782,"35907":31398,"35908":31454,"35909":31609,"35910":31726,"35911":36779,"35912":32548,"35913":32487,"35914":32578,"35915":33002,"35916":33328,"35917":34108,"35918":34106,"35919":33446,"35920":33529,"35921":34164,"35922":34461,"35923":35124,"35924":35273,"35925":35302,"35926":35758,"35927":35793,"35928":35893,"35929":36194,"35930":36193,"35931":36280,"35932":37322,"35933":38047,"35934":38105,"35935":38152,"35936":38416,"35937":39128,"35938":39286,"35939":39269,"35940":39582,"35941":33150,"35942":39578,"35943":40131,"35944":40133,"35945":20826,"35946":40835,"35947":40836,"35948":20458,"35949":21995,"35950":21869,"35951":22179,"35952":23646,"35953":24807,"35954":24913,"35955":25668,"35956":25658,"35957":26003,"35958":27185,"35959":26639,"35960":26818,"35961":27516,"35962":28866,"35963":29306,"35964":38262,"35965":29838,"35966":30302,"36001":32544,"36002":32493,"36003":20848,"36004":34259,"36005":34510,"36006":35272,"36007":35892,"36008":25252,"36009":35465,"36010":36163,"36011":36364,"36012":36291,"36013":36347,"36014":36720,"36015":36777,"36016":38256,"36017":38253,"36018":38081,"36019":38107,"36020":38094,"36021":38255,"36022":38220,"36023":21709,"36024":39038,"36025":39074,"36026":39144,"36027":39537,"36028":39584,"36029":34022,"36030":39585,"36031":39621,"36032":40141,"36033":40143,"36034":33722,"36035":40548,"36036":40542,"36037":40839,"36038":40840,"36039":21870,"36040":20456,"36041":20645,"36042":21587,"36043":23402,"36044":24005,"36045":23782,"36046":24367,"36047":25674,"36048":26435,"36049":27426,"36050":28393,"36051":29473,"36052":21472,"36053":30270,"36054":30307,"36055":31548,"36056":31809,"36057":32843,"36058":33039,"36059":34989,"36060":34924,"36061":35835,"36062":36174,"36063":36189,"36064":36399,"36065":36396,"36066":36756,"36067":37094,"36068":38136,"36069":37492,"36070":38657,"36071":38801,"36072":32366,"36073":39076,"36074":39556,"36075":39553,"36076":40150,"36077":40098,"36078":40148,"36079":40151,"36080":40551,"36081":40485,"36082":40761,"36083":40841,"36084":40842,"36085":40858,"36086":24651,"36087":25371,"36088":25605,"36089":29906,"36090":31363,"36091":32552,"36092":33250,"36093":33821,"36094":34506,"36160":21464,"36161":36902,"36162":36923,"36163":38259,"36164":38084,"36165":38757,"36166":26174,"36167":39181,"36168":24778,"36169":39551,"36170":39564,"36171":39635,"36172":39633,"36173":40157,"36174":40158,"36175":40156,"36176":40502,"36177":22065,"36178":22365,"36179":25597,"36180":30251,"36181":30315,"36182":32641,"36183":34453,"36184":35753,"36185":35863,"36186":35894,"36187":33395,"36188":36195,"36189":37247,"36190":38643,"36191":28789,"36192":38701,"36193":39078,"36194":39588,"36195":39699,"36196":39751,"36197":40078,"36198":40560,"36199":40557,"36200":30839,"36201":30416,"36202":40140,"36203":40844,"36204":40843,"36205":21381,"36206":27012,"36207":28286,"36208":31729,"36209":31657,"36210":34542,"36211":35266,"36212":36433,"36213":34885,"36214":38053,"36215":39045,"36216":39307,"36217":39627,"36218":40649,"36219":28390,"36220":30633,"36221":38218,"36222":38831,"36257":39540,"36258":39589,"36259":32518,"36260":35872,"36261":36495,"36262":37245,"36263":38075,"36264":37550,"36265":38179,"36266":40132,"36267":40072,"36268":40681,"36269":20991,"36270":40550,"36271":39562,"36272":40563,"36273":40510,"36274":38074,"36275":20162,"36276":34381,"36277":27538,"36278":22439,"36279":22395,"36280":25099,"36281":20451,"36282":21037,"36283":21389,"36284":21593,"36285":21370,"36286":32424,"36287":33543,"36288":38023,"36289":38022,"36290":21591,"36291":24362,"36292":31059,"36293":32446,"36294":37071,"36295":38028,"36296":21072,"36297":21286,"36298":22261,"36299":22445,"36300":23045,"36301":23741,"36302":23811,"36303":28062,"36304":28172,"36305":28867,"36306":30502,"36307":32448,"36308":32464,"36309":33003,"36310":38030,"36311":38032,"36312":38037,"36313":38029,"36314":38379,"36315":22955,"36316":23899,"36317":24701,"36318":26720,"36319":26536,"36320":27817,"36321":27976,"36322":30066,"36323":30743,"36324":32471,"36325":33757,"36326":35271,"36327":35765,"36328":35790,"36329":35794,"36330":36150,"36331":36147,"36332":36730,"36333":36725,"36334":36728,"36335":36911,"36336":37075,"36337":37124,"36338":38059,"36339":38060,"36340":38043,"36341":38063,"36342":38061,"36343":38058,"36344":38390,"36345":38503,"36346":39032,"36347":39275,"36348":40697,"36349":20251,"36350":20603,"36416":20325,"36417":21794,"36418":22450,"36419":24047,"36420":24493,"36421":28828,"36422":33557,"36423":29426,"36424":29614,"36425":32488,"36426":32480,"36427":32481,"36428":32671,"36429":33645,"36430":34545,"36431":35795,"36432":35798,"36433":35817,"36434":35796,"36435":35804,"36436":36241,"36437":36738,"36438":36737,"36439":37036,"36440":38090,"36441":38088,"36442":38064,"36443":38066,"36444":38070,"36445":38157,"36446":38092,"36447":38077,"36448":38076,"36449":39043,"36450":39040,"36451":20971,"36452":40702,"36453":20606,"36454":21787,"36455":23901,"36456":24123,"36457":24747,"36458":24749,"36459":24580,"36460":25132,"36461":25111,"36462":25247,"36463":25248,"36464":25532,"36465":26724,"36466":26473,"36467":33637,"36468":27986,"36469":27812,"36470":28829,"36471":30386,"36472":30720,"36473":32507,"36474":32498,"36475":32495,"36476":32506,"36477":33715,"36478":35275,"36513":35830,"36514":36167,"36515":38129,"36516":38098,"36517":38097,"36518":38101,"36519":38111,"36520":38123,"36521":38127,"36522":38122,"36523":38135,"36524":38102,"36525":38117,"36526":39121,"36527":21055,"36528":21154,"36529":21715,"36530":21586,"36531":23810,"36532":23780,"36533":24209,"36534":24870,"36535":25378,"36536":26912,"36537":27637,"36538":39053,"36539":28061,"36540":28514,"36541":28064,"36542":28375,"36543":29711,"36544":29825,"36545":30231,"36546":32515,"36547":32535,"36548":32524,"36549":32527,"36550":32529,"36551":33628,"36552":33932,"36553":33553,"36554":33473,"36555":35833,"36556":35836,"36557":35842,"36558":36181,"36559":37112,"36560":38162,"36561":38103,"36562":38141,"36563":38163,"36564":38154,"36565":38116,"36566":38150,"36567":38151,"36568":38164,"36569":38406,"36570":38403,"36571":38739,"36572":39055,"36573":39293,"36574":39541,"36575":39552,"36576":40066,"36577":40488,"36578":21714,"36579":21717,"36580":21721,"36581":23250,"36582":23748,"36583":24639,"36584":27546,"36585":27981,"36586":28904,"36587":29443,"36588":29423,"36589":30876,"36590":31405,"36591":32279,"36592":32539,"36593":33927,"36594":33640,"36595":33929,"36596":33630,"36597":33720,"36598":33431,"36599":34547,"36600":35816,"36601":35857,"36602":35860,"36603":35869,"36604":37072,"36605":38185,"36606":38188,"36672":38166,"36673":38167,"36674":38140,"36675":38171,"36676":38165,"36677":38174,"36678":38036,"36679":38415,"36680":38408,"36681":38409,"36682":38410,"36683":38412,"36684":38413,"36685":40498,"36686":40497,"36687":21724,"36688":24113,"36689":24697,"36690":25672,"36691":58305,"36692":27894,"36693":29461,"36694":29971,"36695":30213,"36696":30187,"36697":30807,"36698":31654,"36699":31578,"36700":31976,"36701":32545,"36702":32807,"36703":33631,"36704":33718,"36705":34544,"36706":35042,"36707":35279,"36708":35873,"36709":35788,"36710":35877,"36711":36292,"36712":38200,"36713":38196,"36714":38113,"36715":38198,"36716":38418,"36717":39271,"36718":40082,"36719":40085,"36720":40504,"36721":40505,"36722":40506,"36723":40832,"36724":24636,"36725":25669,"36726":25784,"36727":27898,"36728":30102,"36729":32523,"36730":32873,"36731":33641,"36732":34789,"36733":34414,"36734":35764,"36769":35881,"36770":36188,"36771":36157,"36772":36760,"36773":37021,"36774":38227,"36775":38112,"36776":38204,"36777":38223,"36778":34021,"36779":38890,"36780":39273,"36781":39568,"36782":39570,"36783":39571,"36784":38411,"36785":40105,"36786":40096,"36787":40520,"36788":40513,"36789":40518,"36790":21411,"36791":21590,"36792":22406,"36793":27104,"36794":26638,"36795":27655,"36796":27895,"36797":28486,"36798":31074,"36799":32562,"36800":32563,"36801":32628,"36802":33315,"36803":34511,"36804":34431,"36805":35043,"36806":35281,"36807":35311,"36808":35886,"36809":38235,"36810":38239,"36811":38250,"36812":38214,"36813":38121,"36814":38891,"36815":39073,"36816":39312,"36817":39618,"36818":40117,"36819":40118,"36820":40123,"36821":40113,"36822":40526,"36823":40491,"36824":40700,"36825":21950,"36826":25732,"36827":26634,"36828":26533,"36829":26636,"36830":32561,"36831":32845,"36832":33551,"36833":33480,"36834":34162,"36835":34548,"36836":34686,"36837":38132,"36838":38246,"36839":38248,"36840":38241,"36841":38243,"36842":38212,"36843":38251,"36844":38119,"36845":38244,"36846":38137,"36847":38426,"36848":39071,"36849":39316,"36850":39546,"36851":39581,"36852":39583,"36853":39576,"36854":40535,"36855":40538,"36856":40540,"36857":40838,"36858":40837,"36859":20649,"36860":23743,"36861":30152,"36862":25786,"36928":27017,"36929":28384,"36930":30779,"36931":31901,"36932":32425,"36933":32556,"36934":34105,"36935":36166,"36936":38257,"36937":38396,"36938":39129,"36939":39586,"36940":39574,"36941":39580,"36942":40101,"36943":40142,"36944":40144,"36945":40547,"36946":40536,"36947":40574,"36948":20865,"36949":23048,"36950":28757,"36951":25874,"36952":30271,"36953":31656,"36954":31860,"36955":33339,"36956":35276,"36957":36345,"36958":36318,"36959":36729,"36960":38228,"36961":38252,"36962":39587,"36963":39557,"36964":40149,"36965":40099,"36966":40102,"36967":40552,"36968":40503,"36969":40859,"36970":26686,"36971":26916,"36972":34016,"36973":38624,"36974":36723,"36975":40159,"36976":40095,"36977":40553,"36978":40556,"36979":40554,"36980":40555,"36981":40519,"36982":28751,"36983":31766,"36984":35888,"36985":39628,"36986":31550,"36987":31900,"36988":32565,"36989":33044,"36990":36479,"37025":38247,"37026":40090,"37027":36273,"37028":36508,"37029":37246,"37030":35891,"37031":39070,"37032":39079,"37033":39591,"37034":40492,"37035":25094,"37036":38404,"37037":40097,"37038":40514,"37039":31160,"37040":25300,"37041":36299,"37042":29648,"37043":23467,"37044":25296,"37045":27585,"37046":20943,"37047":31108,"37048":21525,"37049":28508,"37050":34972,"37051":37095,"37052":20857,"37053":25144,"37054":25243,"37055":25383,"37056":25531,"37057":25566,"37058":25594,"37059":25745,"37060":25792,"37061":25825,"37062":25846,"37063":25861,"37064":25909,"37065":25934,"37066":25963,"37067":25992,"37068":26073,"37069":26142,"37070":26171,"37071":26175,"37072":26180,"37073":26199,"37074":26217,"37075":26227,"37076":26243,"37077":26300,"37078":26303,"37079":26305,"37080":26357,"37081":26362,"37082":26363,"37083":26382,"37084":26390,"37085":26423,"37086":26468,"37087":26470,"37088":26534,"37089":26535,"37090":26537,"37091":26619,"37092":26621,"37093":26624,"37094":26625,"37095":26629,"37096":26654,"37097":26698,"37098":26706,"37099":26709,"37100":26713,"37101":26765,"37102":26809,"37103":26831,"37104":20616,"37105":38184,"37106":40087,"37107":26914,"37108":26918,"37109":220,"37110":58591,"37111":58592,"37112":252,"37113":58594,"37114":58595,"37115":220,"37116":252,"37117":26934,"37118":26977,"37184":33477,"37185":33482,"37186":33496,"37187":33560,"37188":33562,"37189":33571,"37190":33606,"37191":33627,"37192":33634,"37193":33644,"37194":33646,"37195":33692,"37196":33695,"37197":33717,"37198":33724,"37199":33783,"37200":33834,"37201":33864,"37202":33884,"37203":33890,"37204":33924,"37205":33928,"37206":34012,"37207":34019,"37208":34104,"37209":34138,"37210":34199,"37211":34219,"37212":34241,"37213":34323,"37214":34326,"37215":8715,"37216":34581,"37217":34672,"37218":34685,"37219":34699,"37220":34728,"37221":34759,"37222":34768,"37223":34823,"37224":34830,"37225":34855,"37226":34990,"37227":8712,"37228":34997,"37229":35007,"37230":35045,"37231":35061,"37232":35100,"37233":35101,"37234":35191,"37235":35303,"37236":35383,"37237":35500,"37238":35546,"37239":35675,"37240":35697,"37241":35883,"37242":35898,"37243":35964,"37244":35982,"37245":36014,"37246":36114,"37281":36169,"37282":36173,"37283":36209,"37284":36360,"37285":36410,"37286":36464,"37287":36505,"37288":36528,"37289":36529,"37290":36549,"37291":36550,"37292":36558,"37293":36579,"37294":36620,"37295":36721,"37296":36727,"37297":36775,"37298":36847,"37299":36878,"37300":36921,"37301":36965,"37302":37001,"37303":37086,"37304":37141,"37305":37334,"37306":37339,"37307":37342,"37308":37345,"37309":37349,"37310":37366,"37311":37372,"37312":37417,"37313":37420,"37314":65287,"37315":37465,"37316":37495,"37317":37613,"37318":37690,"37319":58701,"37320":58702,"37321":29227,"37322":20866,"37323":20886,"37324":20023,"37325":20843,"37326":20799,"37327":58709,"37328":58710,"37329":26409,"37330":27706,"37331":21378,"37332":30098,"37333":32896,"37334":34916,"37335":19974,"37336":58718,"37337":58719,"37338":58720,"37339":11927,"37340":21241,"37341":21269,"37342":8225,"37343":58725,"37344":13316,"37345":58727,"37346":58728,"37347":58729,"37348":58730,"37349":58731,"37350":20981,"37351":58733,"37352":23662,"37353":58735,"37354":22231,"37355":20128,"37356":20907,"37357":11904,"37358":27079,"37359":58741,"37360":9550,"37361":9688,"37362":9689,"37363":9794,"37364":9654,"37365":9668,"37366":8597,"37367":8252,"37368":182,"37369":8704,"37370":8616,"37371":8596,"37372":8962,"37373":58755,"37374":58756,"37440":20124,"37441":24746,"37442":22311,"37443":22258,"37444":21307,"37445":22769,"37446":36920,"37447":38560,"37448":26628,"37449":21942,"37450":39365,"37451":35585,"37452":20870,"37453":32257,"37454":24540,"37455":27431,"37456":27572,"37457":26716,"37458":22885,"37459":31311,"37460":20206,"37461":20385,"37462":30011,"37463":28784,"37464":20250,"37465":24724,"37466":28023,"37467":32117,"37468":22730,"37469":25040,"37470":25313,"37471":27579,"37472":35226,"37473":23398,"37474":27005,"37475":21917,"37476":28167,"37477":58794,"37478":24059,"37479":38501,"37480":21223,"37481":23515,"37482":28450,"37483":38306,"37484":27475,"37485":35251,"37486":27671,"37487":24112,"37488":25135,"37489":29344,"37490":34384,"37491":26087,"37492":24613,"37493":25312,"37494":25369,"37495":34394,"37496":23777,"37497":25375,"37498":29421,"37499":37111,"37500":38911,"37501":26241,"37502":21220,"37537":35641,"37538":21306,"37539":39366,"37540":21234,"37541":58824,"37542":24452,"37543":33550,"37544":24693,"37545":25522,"37546":28179,"37547":32076,"37548":34509,"37549":36605,"37550":32153,"37551":40335,"37552":25731,"37553":30476,"37554":20537,"37555":21091,"37556":38522,"37557":22287,"37558":26908,"37559":27177,"37560":38997,"37561":39443,"37562":21427,"37563":21577,"37564":23087,"37565":35492,"37566":24195,"37567":28207,"37568":37489,"37569":21495,"37570":22269,"37571":40658,"37572":31296,"37573":30741,"37574":28168,"37575":25998,"37576":27507,"37577":21092,"37578":38609,"37579":21442,"37580":26719,"37581":24808,"37582":36059,"37583":27531,"37584":27503,"37585":20816,"37586":36766,"37587":28287,"37588":23455,"37589":20889,"37590":33294,"37591":25448,"37592":37320,"37593":23551,"37594":21454,"37595":34886,"37596":24467,"37597":28171,"37598":29539,"37599":32294,"37600":31899,"37601":20966,"37602":23558,"37603":31216,"37604":28169,"37605":28988,"37606":22888,"37607":26465,"37608":29366,"37609":20055,"37610":27972,"37611":21104,"37612":30067,"37613":32260,"37614":22732,"37615":23330,"37616":35698,"37617":37304,"37618":35302,"37619":22065,"37620":23517,"37621":23613,"37622":22259,"37623":31883,"37624":37204,"37625":31298,"37626":38543,"37627":39620,"37628":26530,"37629":25968,"37630":25454,"37696":28716,"37697":22768,"37698":25993,"37699":38745,"37700":31363,"37701":25666,"37702":32118,"37703":23554,"37704":27973,"37705":25126,"37706":36341,"37707":37549,"37708":28508,"37709":36983,"37710":36984,"37711":32330,"37712":31109,"37713":30094,"37714":22766,"37715":20105,"37716":33624,"37717":25436,"37718":25407,"37719":24035,"37720":31379,"37721":35013,"37722":20711,"37723":23652,"37724":32207,"37725":39442,"37726":22679,"37727":24974,"37728":34101,"37729":36104,"37730":33235,"37731":23646,"37732":32154,"37733":22549,"37734":23550,"37735":24111,"37736":28382,"37737":28381,"37738":25246,"37739":27810,"37740":28655,"37741":21336,"37742":22022,"37743":22243,"37744":26029,"37745":24382,"37746":36933,"37747":26172,"37748":37619,"37749":24193,"37750":24500,"37751":32884,"37752":25074,"37753":22618,"37754":36883,"37755":37444,"37756":28857,"37757":36578,"37758":20253,"37793":38651,"37794":28783,"37795":24403,"37796":20826,"37797":30423,"37798":31282,"37799":38360,"37800":24499,"37801":27602,"37802":29420,"37803":35501,"37804":23626,"37805":38627,"37806":24336,"37807":24745,"37808":33075,"37809":25309,"37810":24259,"37811":22770,"37812":26757,"37813":21338,"37814":34180,"37815":40614,"37816":32283,"37817":30330,"37818":39658,"37819":25244,"37820":27996,"37821":27996,"37822":25935,"37823":25975,"37824":20398,"37825":25173,"37826":20175,"37827":36794,"37828":22793,"37829":27497,"37830":33303,"37831":31807,"37832":21253,"37833":23453,"37834":25265,"37835":27873,"37836":32990,"37837":30770,"37838":35914,"37839":39165,"37840":22696,"37841":27598,"37842":28288,"37843":33032,"37844":40665,"37845":35379,"37846":34220,"37847":36493,"37848":19982,"37849":35465,"37850":25671,"37851":27096,"37852":35617,"37853":26332,"37854":26469,"37855":38972,"37856":20081,"37857":35239,"37858":31452,"37859":38534,"37860":26053,"37861":20001,"37862":29471,"37863":32209,"37864":28057,"37865":22593,"37866":31036,"37867":21169,"37868":25147,"37869":38666,"37870":40802,"37871":26278,"37872":27508,"37873":24651,"37874":32244,"37875":37676,"37876":28809,"37877":21172,"37878":27004,"37879":37682,"37880":28286,"37881":24357,"37882":20096,"37883":26365,"37884":22985,"37885":23437,"37886":23947,"37952":27179,"37953":26907,"37954":21936,"37955":31874,"37956":36796,"37957":27018,"37958":21682,"37959":40235,"37960":38635,"37961":26905,"37962":25539,"37963":39364,"37964":20967,"37965":26626,"37966":36795,"37967":20685,"37968":23776,"37969":26627,"37970":20970,"37971":21250,"37972":30834,"37973":30033,"37974":30048,"37975":22138,"37976":37618,"37977":22592,"37978":26622,"37979":20451,"37980":26466,"37981":31870,"37982":21249,"37983":20452,"37984":20453,"37985":20969,"37986":21498,"37987":21720,"37988":22222,"37989":22310,"37990":22327,"37991":22328,"37992":22408,"37993":22451,"37994":22442,"37995":22448,"37996":22486,"37997":22640,"37998":22713,"37999":22743,"38000":23670,"38001":23740,"38002":23749,"38003":23742,"38004":23926,"38005":24342,"38006":24634,"38007":25525,"38008":26433,"38009":26467,"38010":26529,"38011":26810,"38012":26917,"38013":26920,"38014":27258,"38049":26915,"38050":26913,"38051":27006,"38052":27009,"38053":27101,"38054":27182,"38055":27250,"38056":27423,"38057":27615,"38058":28181,"38059":29077,"38060":29927,"38061":29938,"38062":29936,"38063":29937,"38064":29944,"38065":29957,"38066":30057,"38067":30314,"38068":30836,"38069":31437,"38070":31439,"38071":31445,"38072":31443,"38073":31457,"38074":31472,"38075":31490,"38076":31763,"38077":31767,"38078":31888,"38079":31917,"38080":31936,"38081":31960,"38082":32155,"38083":32261,"38084":32359,"38085":32387,"38086":32400,"38087":33188,"38088":33373,"38089":33826,"38090":34009,"38091":34352,"38092":34475,"38093":34543,"38094":34992,"38095":35011,"38096":35012,"38097":35076,"38098":59183,"38099":36542,"38100":36552,"38101":36684,"38102":36791,"38103":36826,"38104":36903,"38105":36950,"38106":37685,"38107":37691,"38108":37817,"38109":38282,"38110":38294,"38111":38777,"38112":38790,"38113":38800,"38114":39082,"38115":39830,"38116":39831,"38117":39860,"38118":39887,"38119":39889,"38120":39890,"38121":39922,"38122":39921,"38123":39984,"38124":40007,"38125":40026,"38126":40176,"38127":40262,"38128":40292,"38129":40363,"38130":20036,"38131":21583,"38132":25368,"38133":39857,"38134":40041,"38135":40263,"38136":40293,"38137":39983,"38138":40639,"38139":20916,"38140":21610,"38141":26528,"38142":39822,"38208":37032,"38209":20914,"38210":13869,"38211":25285,"38212":21189,"38213":26545,"38214":21709,"38215":24658,"38216":21441,"38217":28913,"38218":22531,"38219":21855,"38220":37390,"38221":30528,"38222":29756,"38223":29002,"38224":28377,"38225":21472,"38226":29486,"38227":35023,"38228":30861,"38229":32675,"38230":32171,"38231":36394,"38232":37979,"38233":25452,"38234":24487,"38235":23557,"38236":32827,"38237":23791,"38238":14776,"38239":29009,"38240":36045,"38241":38894,"38242":22642,"38243":23139,"38244":32632,"38245":23895,"38246":24943,"38247":27032,"38248":32137,"38249":31918,"38250":32179,"38251":28545,"38252":23290,"38253":22715,"38254":29269,"38255":30286,"38256":36653,"38257":37561,"38258":40286,"38259":40623,"38260":32583,"38261":40388,"38262":36120,"38263":20915,"38264":34412,"38265":21668,"38266":21414,"38267":21030,"38268":26422,"38269":20001,"38270":21364,"38305":24313,"38306":21177,"38307":21647,"38308":24312,"38309":22956,"38310":24625,"38311":29248,"38312":33047,"38313":30267,"38314":24333,"38315":26187,"38316":26280,"38317":24932,"38318":25423,"38319":28895,"38320":27940,"38321":31911,"38322":31945,"38323":21465,"38324":25933,"38325":22338,"38326":29647,"38327":32966,"38328":13649,"38329":27445,"38330":30849,"38331":21452,"38332":29483,"38333":29482,"38334":29641,"38335":30026,"38336":23033,"38337":29124,"38338":29966,"38339":32220,"38340":39393,"38341":35241,"38342":28662,"38343":14935,"38344":25834,"38345":15341,"38346":27809,"38347":28284,"38348":30055,"38349":22633,"38350":22633,"38351":20996,"38352":59338,"38353":24967,"38354":25658,"38355":33263,"38356":59342,"38357":20917,"38358":20945,"38359":27769,"38360":22815,"38361":36857,"38362":39153,"38363":25911,"38364":33033,"38365":34996,"38366":14890,"38367":36525,"38368":32663,"38369":39440,"38370":32037,"38371":27336,"38372":20876,"38373":21031,"38374":59360,"38375":33050,"38376":21408,"38377":21410,"38378":27738,"38379":27703,"38380":33304,"38381":21894,"38382":24315,"38383":20937,"38384":30897,"38385":37474,"38386":21357,"38387":20931,"38388":59374,"38389":33905,"38390":35207,"38391":38765,"38392":35728,"38393":38563,"38394":24316,"38395":38583,"38396":20814,"38397":39952,"38398":26160,"38464":37461,"38465":30728,"38466":37701,"38467":37491,"38468":37737,"38469":59390,"38470":59391,"38471":59392,"38472":59393,"38473":37343,"38474":37338,"38475":30804,"38476":30822,"38477":30856,"38478":30902,"38479":30919,"38480":30930,"38481":30935,"38482":8491,"38483":8651,"38484":30948,"38485":30958,"38486":30960,"38487":30961,"38488":30965,"38489":31026,"38490":31027,"38491":31030,"38492":31064,"38493":12307,"38494":31065,"38495":31089,"38496":31102,"38497":31107,"38498":31110,"38499":31111,"38500":31121,"38501":31129,"38502":31135,"38503":31141,"38504":31202,"38505":31217,"38506":31220,"38507":31274,"38508":31290,"38509":31301,"38510":31333,"38511":31420,"38512":31426,"38513":31433,"38514":31451,"38515":31465,"38516":31486,"38517":31500,"38518":31527,"38519":31529,"38520":31554,"38521":31555,"38522":31573,"38523":31599,"38524":31666,"38525":27102,"38526":27129,"38561":37238,"38562":33114,"38563":33527,"38564":21579,"38565":33074,"38566":32957,"38567":33816,"38568":37214,"38569":37232,"38570":37260,"38571":33096,"38572":59459,"38573":17462,"38574":33113,"38575":32927,"38576":59463,"38577":21833,"38578":21537,"38579":21722,"38580":21554,"38581":21945,"38582":21652,"38583":59470,"38584":30802,"38585":30789,"38586":30796,"38587":59474,"38588":33981,"38589":33820,"38590":33476,"38591":59478,"38592":33915,"38593":35629,"38594":59481,"38595":22347,"38596":59483,"38597":59484,"38598":22341,"38599":34766,"38600":22112,"38601":21994,"38602":22139,"38603":32956,"38604":59491,"38605":30904,"38606":27148,"38607":21708,"38608":31696,"38609":31724,"38610":31738,"38611":31765,"38612":31771,"38613":31797,"38614":31812,"38615":31853,"38616":31886,"38617":31928,"38618":31939,"38619":31974,"38620":31981,"38621":31987,"38622":31989,"38623":31993,"38624":59511,"38625":31996,"38626":32139,"38627":32151,"38628":32164,"38629":32168,"38630":32205,"38631":32208,"38632":32211,"38633":32229,"38634":32253,"38635":27154,"38636":27170,"38637":27184,"38638":27190,"38639":27237,"38640":59527,"38641":59528,"38642":59529,"38643":59530,"38644":59531,"38645":59532,"38646":59533,"38647":59534,"38648":27251,"38649":27256,"38650":59537,"38651":59538,"38652":27260,"38653":27305,"38654":27306,"38720":9450,"38721":9312,"38722":9313,"38723":9314,"38724":9315,"38725":9316,"38726":9317,"38727":9318,"38728":9319,"38729":9320,"38730":9321,"38731":9322,"38732":9323,"38733":9324,"38734":9325,"38735":9326,"38736":9327,"38737":9328,"38738":9329,"38739":9330,"38740":9331,"38741":37700,"38742":37805,"38743":37830,"38744":37861,"38745":37914,"38746":37921,"38747":37950,"38748":37953,"38749":37971,"38750":37978,"38751":38042,"38752":38071,"38753":38104,"38754":38110,"38755":38131,"38756":38147,"38757":38158,"38758":38159,"38759":38168,"38760":38173,"38761":38186,"38762":38187,"38763":38207,"38764":38213,"38765":38222,"38766":38242,"38767":38245,"38768":38249,"38769":38258,"38770":38279,"38771":38297,"38772":38304,"38773":38322,"38774":38502,"38775":38557,"38776":38575,"38777":38578,"38778":38707,"38779":38715,"38780":38733,"38781":38735,"38782":38737,"38817":38741,"38818":38756,"38819":38763,"38820":38769,"38821":38802,"38822":38834,"38823":38898,"38824":38973,"38825":38996,"38826":39077,"38827":39107,"38828":39130,"38829":39150,"38830":39197,"38831":39200,"38832":39267,"38833":39296,"38834":39303,"38835":39309,"38836":39315,"38837":39317,"38838":39356,"38839":39368,"38840":39410,"38841":39606,"38842":39641,"38843":39646,"38844":39695,"38845":39753,"38846":39794,"38847":39811,"38848":39839,"38849":39867,"38850":39907,"38851":39925,"38852":39936,"38853":39940,"38854":39963,"38855":9398,"38856":9399,"38857":9400,"38858":9401,"38859":9402,"38860":9403,"38861":9404,"38862":9405,"38863":9406,"38864":9407,"38865":9408,"38866":9409,"38867":9410,"38868":9411,"38869":9412,"38870":9413,"38871":9414,"38872":9415,"38873":9416,"38874":9417,"38875":9418,"38876":9419,"38877":9420,"38878":9421,"38879":9422,"38880":9423,"38881":9424,"38882":9425,"38883":9426,"38884":9427,"38885":9428,"38886":9429,"38887":9430,"38888":9431,"38889":9432,"38890":9433,"38891":9434,"38892":9435,"38893":9436,"38894":9437,"38895":9438,"38896":9439,"38897":9440,"38898":9441,"38899":9442,"38900":9443,"38901":9444,"38902":9445,"38903":9446,"38904":9447,"38905":9448,"38906":9449,"38907":174,"38908":8482,"38909":59697,"38910":59698,"38976":40054,"38977":10122,"38978":10123,"38979":10124,"38980":10125,"38981":10126,"38982":10127,"38983":10128,"38984":10129,"38985":10130,"38986":10131,"38987":40069,"38988":40070,"38989":40071,"38990":40075,"38991":40080,"38992":40094,"38993":40110,"38994":40112,"38995":40114,"38996":40116,"38997":40122,"38998":40124,"38999":40125,"39000":40134,"39001":40135,"39002":40138,"39003":40139,"39004":40147,"39005":40152,"39006":40153,"39007":40162,"39008":40171,"39009":40172,"39010":40234,"39011":40264,"39012":40272,"39013":40314,"39014":40390,"39015":40523,"39016":40533,"39017":40539,"39018":40561,"39019":40618,"39020":40637,"39021":40644,"39022":40674,"39023":40682,"39024":40712,"39025":40715,"39026":40717,"39027":40737,"39028":40772,"39029":40785,"39030":40861,"39031":64014,"39032":64015,"39033":64017,"39034":64019,"39035":64020,"39036":64024,"39037":64031,"39038":64032,"39073":64033,"39074":64035,"39075":64036,"39076":64039,"39077":64040,"39078":64041,"39079":19972,"39080":20015,"39081":20097,"39082":20103,"39083":20131,"39084":20151,"39085":20156,"39086":20216,"39087":20264,"39088":20265,"39089":20279,"39090":20290,"39091":20293,"39092":20299,"39093":20338,"39094":20386,"39095":20400,"39096":20413,"39097":20424,"39098":20428,"39099":20464,"39100":20466,"39101":20473,"39102":20483,"39103":20488,"39104":20532,"39105":20539,"39106":20568,"39107":20582,"39108":20609,"39109":20624,"39110":20668,"39111":20688,"39112":20703,"39113":20705,"39114":20732,"39115":20749,"39116":20779,"39117":20832,"39118":20910,"39119":20920,"39120":20946,"39121":20962,"39122":20997,"39123":21044,"39124":21052,"39125":21081,"39126":21096,"39127":21113,"39128":21156,"39129":21196,"39130":21287,"39131":21314,"39132":21341,"39133":21373,"39134":21374,"39135":21445,"39136":21456,"39137":21458,"39138":21502,"39139":21613,"39140":21637,"39141":21651,"39142":21662,"39143":21689,"39144":21731,"39145":21743,"39146":21773,"39147":21784,"39148":21797,"39149":21800,"39150":21803,"39151":21831,"39152":21881,"39153":21904,"39154":21940,"39155":21953,"39156":21975,"39157":21976,"39158":22011,"39159":20404,"39160":22049,"39161":8707,"39162":22098,"39163":59852,"39164":9787,"39165":59854,"39166":59855,"39232":22109,"39233":9332,"39234":9333,"39235":9334,"39236":9335,"39237":9336,"39238":9337,"39239":9338,"39240":9339,"39241":9340,"39242":9341,"39243":9342,"39244":9343,"39245":9344,"39246":9345,"39247":9346,"39248":9347,"39249":9348,"39250":9349,"39251":9350,"39252":9351,"39253":22113,"39254":22153,"39255":22155,"39256":22174,"39257":22177,"39258":22193,"39259":22201,"39260":22207,"39261":22230,"39262":22255,"39263":22293,"39264":22301,"39265":22322,"39266":22333,"39267":22335,"39268":22339,"39269":8660,"39270":22398,"39271":22410,"39272":22413,"39273":22416,"39274":22428,"39275":22459,"39276":22462,"39277":22468,"39278":22494,"39279":22526,"39280":22546,"39281":22562,"39282":22599,"39283":22620,"39284":22623,"39285":22643,"39286":22695,"39287":22698,"39288":22704,"39289":22709,"39290":22710,"39291":22731,"39292":22736,"39293":22752,"39294":22789,"39329":22801,"39330":22921,"39331":22932,"39332":22938,"39333":22943,"39334":22960,"39335":22968,"39336":22980,"39337":23023,"39338":23024,"39339":23032,"39340":23042,"39341":23051,"39342":23053,"39343":23058,"39344":23073,"39345":23076,"39346":23079,"39347":23082,"39348":23083,"39349":23084,"39350":23101,"39351":23109,"39352":23124,"39353":23129,"39354":23137,"39355":23144,"39356":23147,"39357":23150,"39358":23153,"39359":23161,"39360":23166,"39361":23169,"39362":23170,"39363":23174,"39364":23176,"39365":23185,"39366":23193,"39367":23200,"39368":23201,"39369":23211,"39370":23235,"39371":23246,"39372":23247,"39373":23251,"39374":23268,"39375":23280,"39376":23294,"39377":23309,"39378":23313,"39379":23317,"39380":23327,"39381":23339,"39382":23361,"39383":23364,"39384":23366,"39385":23370,"39386":23375,"39387":23400,"39388":23412,"39389":23414,"39390":23420,"39391":23426,"39392":23440,"39393":9372,"39394":9373,"39395":9374,"39396":9375,"39397":9376,"39398":9377,"39399":9378,"39400":9379,"39401":9380,"39402":9381,"39403":9382,"39404":9383,"39405":9384,"39406":9385,"39407":9386,"39408":9387,"39409":9388,"39410":9389,"39411":9390,"39412":9391,"39413":9392,"39414":9393,"39415":9394,"39416":9395,"39417":9396,"39418":9397,"39419":60009,"39420":12850,"39421":12849,"39422":27307,"39488":23446,"39489":9352,"39490":9353,"39491":9354,"39492":9355,"39493":9356,"39494":9357,"39495":9358,"39496":9359,"39497":9360,"39498":9361,"39499":9362,"39500":9363,"39501":9364,"39502":9365,"39503":9366,"39504":9367,"39505":9368,"39506":9369,"39507":9370,"39508":9371,"39509":23509,"39510":23511,"39511":23587,"39512":23685,"39513":23710,"39514":23746,"39515":23824,"39516":23852,"39517":23855,"39518":23880,"39519":23894,"39520":23920,"39521":23931,"39522":23941,"39523":23972,"39524":23979,"39525":23990,"39526":24001,"39527":24023,"39528":24073,"39529":24136,"39530":24210,"39531":24253,"39532":24334,"39533":24434,"39534":24497,"39535":24514,"39536":24539,"39537":24543,"39538":24611,"39539":24702,"39540":24791,"39541":24839,"39542":24844,"39543":24857,"39544":24866,"39545":24912,"39546":24928,"39547":24961,"39548":24981,"39549":25017,"39550":25024,"39585":25039,"39586":25043,"39587":25050,"39588":25232,"39589":25393,"39590":8835,"39591":25399,"39592":25465,"39593":25483,"39594":25537,"39595":25570,"39596":25574,"39597":25595,"39598":25598,"39599":25607,"39600":25650,"39601":25656,"39602":25659,"39603":25690,"39604":25713,"39605":25724,"39606":25741,"39607":25775,"39608":25780,"39609":25782,"39610":25821,"39611":25829,"39612":25866,"39613":25873,"39614":25887,"39615":25951,"39616":25965,"39617":25990,"39618":26037,"39619":26046,"39620":26065,"39621":26068,"39622":26083,"39623":26111,"39624":26136,"39625":26147,"39626":26211,"39627":26219,"39628":26237,"39629":26245,"39630":26258,"39631":26266,"39632":26276,"39633":26285,"39634":26291,"39635":26294,"39636":26317,"39637":26318,"39638":26370,"39639":26380,"39640":26393,"39641":26436,"39642":26475,"39643":26511,"39644":26532,"39645":26559,"39646":26582,"39647":26583,"39648":8834,"39649":26637,"39650":26640,"39651":26651,"39652":26678,"39653":26695,"39654":26710,"39655":26756,"39656":26760,"39657":26813,"39658":26819,"39659":26821,"39660":26882,"39661":26883,"39662":26889,"39663":26904,"39664":26947,"39665":26950,"39666":26980,"39667":26983,"39668":26994,"39669":27013,"39670":27039,"39671":27042,"39672":27089,"39673":27093,"39674":27094,"39675":39457,"39676":39462,"39677":39471,"39678":27329,"39744":22975,"39745":27105,"39746":27139,"39747":27162,"39748":27164,"39749":27180,"39750":27181,"39751":27187,"39752":27203,"39753":27205,"39754":27212,"39755":27219,"39756":27223,"39757":27235,"39758":27252,"39759":27266,"39760":27274,"39761":27279,"39762":27289,"39763":27303,"39764":27313,"39765":27317,"39766":27326,"39767":27337,"39768":27348,"39769":27352,"39770":27382,"39771":27479,"39772":27514,"39773":27612,"39774":27676,"39775":27697,"39776":27736,"39777":27758,"39778":27765,"39779":27775,"39780":27823,"39781":27851,"39782":27871,"39783":27903,"39784":27906,"39785":27909,"39786":27910,"39787":27942,"39788":27991,"39789":27995,"39790":28017,"39791":28033,"39792":28047,"39793":28069,"39794":28081,"39795":28158,"39796":28162,"39797":28164,"39798":28175,"39799":28184,"39800":28202,"39801":28240,"39802":28249,"39803":28314,"39804":28341,"39805":28344,"39806":28379,"39841":28410,"39842":28420,"39843":28427,"39844":28428,"39845":28438,"39846":28439,"39847":28468,"39848":28477,"39849":28502,"39850":28537,"39851":28554,"39852":28573,"39853":28575,"39854":28603,"39855":28606,"39856":28627,"39857":28633,"39858":28664,"39859":28675,"39860":28747,"39861":28749,"39862":28752,"39863":28756,"39864":28764,"39865":28775,"39866":28791,"39867":28793,"39868":28811,"39869":28815,"39870":28832,"39871":28835,"39872":28837,"39873":28838,"39874":28839,"39875":28868,"39876":28876,"39877":28880,"39878":28886,"39879":618,"39880":603,"39881":230,"39882":652,"39883":593,"39884":596,"39885":650,"39886":605,"39887":601,"39888":602,"39889":604,"39890":609,"39891":7747,"39892":7753,"39893":330,"39894":7739,"39895":629,"39896":240,"39897":643,"39898":658,"39899":679,"39900":676,"39901":227,"39902":60294,"39903":60295,"39904":623,"39905":632,"39906":647,"39907":60299,"39908":199,"39909":339,"39910":594,"39911":65351,"39912":715,"39913":719,"39914":65345,"39915":65346,"39916":65348,"39917":65349,"39918":65350,"39919":65352,"39920":65353,"39921":65354,"39922":65355,"39923":65356,"39924":65357,"39925":65358,"39926":65359,"39927":65360,"39928":65362,"39929":65363,"39930":65364,"39931":65365,"39932":65366,"39933":65367,"39934":65370,"40000":28917,"40001":12832,"40002":12833,"40003":12834,"40004":12835,"40005":12836,"40006":12837,"40007":12838,"40008":12839,"40009":12840,"40010":12841,"40011":28926,"40012":28933,"40013":28957,"40014":28969,"40015":28971,"40016":28972,"40017":28979,"40018":28981,"40019":28987,"40020":28990,"40021":28992,"40022":29007,"40023":29035,"40024":29045,"40025":29047,"40026":29052,"40027":29054,"40028":29068,"40029":29070,"40030":29073,"40031":29078,"40032":29090,"40033":29091,"40034":29101,"40035":29108,"40036":29111,"40037":29114,"40038":29137,"40039":29149,"40040":29163,"40041":29184,"40042":29193,"40043":29198,"40044":29199,"40045":29206,"40046":29207,"40047":29220,"40048":23204,"40049":29230,"40050":8838,"40051":29271,"40052":29276,"40053":29332,"40054":29444,"40055":29456,"40056":29505,"40057":29556,"40058":29580,"40059":29583,"40060":29592,"40061":29596,"40062":29598,"40097":29607,"40098":29610,"40099":29653,"40100":29665,"40101":29666,"40102":29668,"40103":29670,"40104":29679,"40105":29683,"40106":8839,"40107":29689,"40108":29691,"40109":29698,"40110":29713,"40111":29714,"40112":29716,"40113":29717,"40114":29719,"40115":29721,"40116":29724,"40117":29726,"40118":29727,"40119":29751,"40120":29752,"40121":29753,"40122":29763,"40123":29765,"40124":29767,"40125":29768,"40126":29769,"40127":29779,"40128":29782,"40129":29797,"40130":29803,"40131":29804,"40132":29812,"40133":29818,"40134":29826,"40135":21378,"40136":24191,"40137":20008,"40138":24186,"40139":20886,"40140":23424,"40141":21353,"40142":11911,"40143":60436,"40144":21251,"40145":9746,"40146":33401,"40147":17553,"40148":11916,"40149":11914,"40150":20022,"40151":60444,"40152":21274,"40153":60446,"40154":60447,"40155":11925,"40156":60449,"40157":60450,"40158":9492,"40159":20058,"40160":36790,"40161":24308,"40162":20872,"40163":20101,"40164":60457,"40165":20031,"40166":60459,"40167":60460,"40168":20059,"40169":21430,"40170":36710,"40171":32415,"40172":35744,"40173":36125,"40174":40479,"40175":38376,"40176":38021,"40177":38429,"40178":25164,"40179":27701,"40180":20155,"40181":24516,"40182":28780,"40183":11950,"40184":21475,"40185":27362,"40186":39483,"40187":39484,"40188":39512,"40189":39516,"40190":39523,"40256":9742,"40257":8594,"40258":8592,"40259":8593,"40260":8595,"40261":8680,"40262":8678,"40263":8679,"40264":8681,"40265":8680,"40266":8678,"40267":8679,"40268":8681,"40269":9758,"40270":9756,"40271":9755,"40272":9759,"40273":12310,"40274":12311,"40275":9675,"40276":10005,"40277":10003,"40278":22267,"40279":9789,"40280":22813,"40281":26189,"40282":29221,"40283":10025,"40284":10017,"40285":9786,"40286":9785,"40287":60515,"40288":60516,"40289":60517,"40290":60518,"40291":60519,"40292":23672,"40293":9836,"40294":9834,"40295":23249,"40296":23479,"40297":23804,"40298":60526,"40299":9993,"40300":9986,"40301":60529,"40302":60530,"40303":60531,"40304":60532,"40305":23765,"40306":26478,"40307":29793,"40308":29853,"40309":32595,"40310":34195,"40311":10063,"40312":60540,"40313":60541,"40314":23928,"40315":24379,"40316":60544,"40317":9473,"40318":9475,"40353":60547,"40354":60548,"40355":60549,"40356":60550,"40357":60551,"40358":60552,"40359":60553,"40360":60554,"40361":60555,"40362":60556,"40363":60557,"40364":60558,"40365":60559,"40366":60560,"40367":60561,"40368":39602,"40369":39648,"40370":39700,"40371":39732,"40372":39737,"40373":39744,"40374":39760,"40375":39807,"40376":9788,"40377":32149,"40378":9729,"40379":38708,"40380":9730,"40381":60575,"40382":60576,"40383":60577,"40384":9992,"40385":60579,"40386":60580,"40387":60581,"40388":60582,"40389":60583,"40390":60584,"40391":60585,"40392":8507,"40393":8481,"40394":26343,"40395":28247,"40396":60590,"40397":29015,"40398":31178,"40399":8470,"40400":33132,"40401":35577,"40402":38998,"40403":60597,"40404":60598,"40405":9760,"40406":60600,"40407":9828,"40408":9824,"40409":9831,"40410":9827,"40411":9826,"40412":9830,"40413":9825,"40414":9829,"40415":60609,"40416":60610,"40417":27364,"40418":8478,"40419":13250,"40420":13272,"40421":13217,"40422":60616,"40423":13221,"40424":60618,"40425":60619,"40426":60620,"40427":60621,"40428":60622,"40429":9745,"40430":39809,"40431":39819,"40432":39821,"40433":39901,"40434":39913,"40435":39917,"40436":39924,"40437":39967,"40438":39968,"40439":39974,"40440":40019,"40441":40029,"40442":40059,"40443":40204,"40444":40214,"40445":8626,"40446":27397,"40512":36073,"40513":36082,"40514":36099,"40515":36113,"40516":36124,"40517":36218,"40518":36265,"40519":36288,"40520":36353,"40521":36366,"40522":36422,"40523":36456,"40524":36465,"40525":36478,"40526":36480,"40527":36534,"40528":36537,"40529":36540,"40530":36547,"40531":36580,"40532":36589,"40533":36594,"40534":36656,"40535":36673,"40536":36682,"40537":36773,"40538":36787,"40539":36792,"40540":36810,"40541":36815,"40542":36872,"40543":36915,"40544":36919,"40545":36964,"40546":36972,"40547":37289,"40548":37302,"40549":37316,"40550":37370,"40551":37384,"40552":37395,"40553":37409,"40554":37416,"40555":37419,"40556":37429,"40557":37436,"40558":37441,"40559":37464,"40560":37469,"40561":37471,"40562":37483,"40563":37486,"40564":37505,"40565":37508,"40566":37513,"40567":37519,"40568":37553,"40569":37562,"40570":37567,"40571":37588,"40572":37595,"40573":37603,"40574":37605,"40609":37611,"40610":37612,"40611":37620,"40612":37622,"40613":37629,"40614":37635,"40615":37639,"40616":37680,"40617":37681,"40618":37696,"40619":37698,"40620":37699,"40621":37727,"40622":37730,"40623":37734,"40624":37736,"40625":37747,"40626":37748,"40627":37752,"40628":37757,"40629":37761,"40630":37764,"40631":37766,"40632":37767,"40633":37776,"40634":37788,"40635":37792,"40636":37816,"40637":37819,"40638":37821,"40639":37823,"40640":37835,"40641":37843,"40642":37851,"40643":37856,"40644":37872,"40645":37873,"40646":37875,"40647":37876,"40648":37889,"40649":37892,"40650":37896,"40651":37911,"40652":37915,"40653":37917,"40654":37924,"40655":37925,"40656":37926,"40657":37933,"40658":37954,"40659":37955,"40660":37965,"40661":37972,"40662":37976,"40663":37989,"40664":37991,"40665":37996,"40666":38009,"40667":38011,"40668":38264,"40669":38277,"40670":38310,"40671":38314,"40672":38486,"40673":38523,"40674":38565,"40675":38644,"40676":38683,"40677":38710,"40678":38720,"40679":38721,"40680":38743,"40681":38791,"40682":38793,"40683":38811,"40684":38833,"40685":38845,"40686":38848,"40687":38850,"40688":38866,"40689":38880,"40690":38932,"40691":38933,"40692":38947,"40693":38963,"40694":39016,"40695":39095,"40696":39097,"40697":39111,"40698":39114,"40699":39136,"40700":39137,"40701":39148,"40702":39157,"40768":40225,"40769":40244,"40770":40249,"40771":40265,"40772":40270,"40773":40301,"40774":8759,"40775":40302,"40776":40316,"40777":40323,"40778":40339,"40779":40357,"40780":8748,"40781":40381,"40782":27521,"40783":27569,"40784":40015,"40785":40592,"40786":40384,"40787":60817,"40788":60818,"40789":9775,"40790":9776,"40791":9783,"40792":9779,"40793":9780,"40794":9781,"40795":9778,"40796":9782,"40797":9777,"40798":40393,"40799":40404,"40800":40444,"40801":40458,"40802":40460,"40803":40462,"40804":40472,"40805":40571,"40806":40581,"40807":40610,"40808":40620,"40809":40625,"40810":40641,"40811":40646,"40812":40647,"40813":40689,"40814":40696,"40815":40743,"40816":39182,"40817":39193,"40818":39196,"40819":39223,"40820":39261,"40821":39266,"40822":39323,"40823":39332,"40824":39338,"40825":39352,"40826":39392,"40827":39398,"40828":39413,"40829":39455,"40830":32254,"40865":32263,"40866":32347,"40867":32357,"40868":32364,"40869":32567,"40870":32576,"40871":32577,"40872":32585,"40873":32594,"40874":32655,"40875":32659,"40876":32692,"40877":32733,"40878":32743,"40879":32762,"40880":32770,"40881":32776,"40882":32814,"40883":32815,"40884":32828,"40885":32935,"40886":33036,"40887":33066,"40888":33076,"40889":33090,"40890":33110,"40891":33156,"40892":33189,"40893":33252,"40894":33364,"40895":33381,"40896":33403,"40897":33415,"40898":33471,"40899":33506,"40900":33518,"40901":33528,"40902":33532,"40903":33535,"40904":33547,"40905":33565,"40906":33597,"40907":33623,"40908":33681,"40909":33708,"40910":33741,"40911":33773,"40912":33797,"40913":33812,"40914":33814,"40915":33825,"40916":33838,"40917":33854,"40918":33866,"40919":33875,"40920":33877,"40921":33880,"40922":33892,"40923":33906,"40924":33919,"40925":33920,"40926":33938,"40927":33939,"40928":33942,"40929":33955,"40930":33982,"40931":34014,"40932":34017,"40933":34018,"40934":34020,"40935":34040,"40936":34051,"40937":34053,"40938":34064,"40939":34099,"40940":8208,"40941":34114,"40942":34124,"40943":34130,"40944":34143,"40945":34159,"40946":34160,"40947":34163,"40948":34262,"40949":34272,"40950":34286,"40951":34300,"40952":34317,"40953":34319,"40954":34324,"40955":34344,"40956":34370,"40957":34373,"40958":34418,"41024":34972,"41025":23405,"41026":33079,"41027":60958,"41028":39224,"41029":21874,"41030":21867,"41031":60962,"41032":13774,"41033":21873,"41034":21946,"41035":22001,"41036":13778,"41037":22000,"41038":22021,"41039":22050,"41040":22061,"41041":22083,"41042":22046,"41043":22162,"41044":31949,"41045":21530,"41046":21523,"41047":21655,"41048":26353,"41049":30004,"41050":21581,"41051":22180,"41052":22175,"41053":25811,"41054":25390,"41055":25592,"41056":25886,"41057":20088,"41058":27626,"41059":27698,"41060":27709,"41061":27746,"41062":27826,"41063":28152,"41064":28201,"41065":28278,"41066":28290,"41067":28294,"41068":28347,"41069":28383,"41070":28386,"41071":28433,"41072":28452,"41073":28532,"41074":28561,"41075":28597,"41076":28659,"41077":28661,"41078":28859,"41079":28864,"41080":28943,"41081":8706,"41082":29013,"41083":29043,"41084":29050,"41085":61016,"41086":21027,"41121":61018,"41122":13393,"41123":61020,"41124":36812,"41125":61022,"41126":61023,"41127":192,"41128":200,"41129":204,"41130":210,"41131":217,"41132":193,"41133":205,"41134":211,"41135":218,"41136":257,"41137":275,"41138":299,"41139":333,"41140":363,"41141":470,"41142":196,"41143":203,"41144":207,"41145":214,"41146":220,"41147":198,"41148":199,"41149":209,"41150":195,"41151":213,"41152":225,"41153":233,"41154":237,"41155":243,"41156":250,"41157":472,"41158":228,"41159":235,"41160":239,"41161":246,"41162":252,"41163":230,"41164":231,"41165":241,"41166":227,"41167":245,"41168":462,"41169":283,"41170":464,"41171":466,"41172":468,"41173":474,"41174":197,"41175":201,"41176":29064,"41177":216,"41178":208,"41179":7922,"41180":222,"41181":223,"41182":170,"41183":161,"41184":224,"41185":232,"41186":236,"41187":242,"41188":249,"41189":476,"41190":229,"41191":29080,"41192":29143,"41193":248,"41194":240,"41195":7923,"41196":254,"41197":255,"41198":186,"41199":191,"41200":226,"41201":234,"41202":238,"41203":244,"41204":251,"41205":29173,"41206":194,"41207":202,"41208":206,"41209":212,"41210":219,"41211":184,"41212":164,"41213":61110,"41214":402,"41280":12288,"41281":65292,"41282":12289,"41283":12290,"41284":65294,"41285":8231,"41286":65307,"41287":65306,"41288":65311,"41289":65281,"41290":65072,"41291":8230,"41292":8229,"41293":65104,"41294":65105,"41295":65106,"41296":183,"41297":65108,"41298":65109,"41299":65110,"41300":65111,"41301":65372,"41302":8211,"41303":65073,"41304":8212,"41305":65075,"41306":9588,"41307":65076,"41308":65103,"41309":65288,"41310":65289,"41311":65077,"41312":65078,"41313":65371,"41314":65373,"41315":65079,"41316":65080,"41317":12308,"41318":12309,"41319":65081,"41320":65082,"41321":12304,"41322":12305,"41323":65083,"41324":65084,"41325":12298,"41326":12299,"41327":65085,"41328":65086,"41329":12296,"41330":12297,"41331":65087,"41332":65088,"41333":12300,"41334":12301,"41335":65089,"41336":65090,"41337":12302,"41338":12303,"41339":65091,"41340":65092,"41341":65113,"41342":65114,"41377":65115,"41378":65116,"41379":65117,"41380":65118,"41381":8216,"41382":8217,"41383":8220,"41384":8221,"41385":12317,"41386":12318,"41387":8245,"41388":8242,"41389":65283,"41390":65286,"41391":65290,"41392":8251,"41393":167,"41394":12291,"41395":9675,"41396":9679,"41397":9651,"41398":9650,"41399":9678,"41400":9734,"41401":9733,"41402":9671,"41403":9670,"41404":9633,"41405":9632,"41406":9661,"41407":9660,"41408":12963,"41409":8453,"41410":175,"41411":65507,"41412":65343,"41413":717,"41414":65097,"41415":65098,"41416":65101,"41417":65102,"41418":65099,"41419":65100,"41420":65119,"41421":65120,"41422":65121,"41423":65291,"41424":65293,"41425":215,"41426":247,"41427":177,"41428":8730,"41429":65308,"41430":65310,"41431":65309,"41432":8806,"41433":8807,"41434":8800,"41435":8734,"41436":8786,"41437":8801,"41438":65122,"41439":65123,"41440":65124,"41441":65125,"41442":65126,"41443":65374,"41444":8745,"41445":8746,"41446":8869,"41447":8736,"41448":8735,"41449":8895,"41450":13266,"41451":13265,"41452":8747,"41453":8750,"41454":8757,"41455":8756,"41456":9792,"41457":9794,"41458":8853,"41459":8857,"41460":8593,"41461":8595,"41462":8592,"41463":8594,"41464":8598,"41465":8599,"41466":8601,"41467":8600,"41468":8741,"41469":8739,"41470":65295,"41536":65340,"41537":8725,"41538":65128,"41539":65284,"41540":65509,"41541":12306,"41542":65504,"41543":65505,"41544":65285,"41545":65312,"41546":8451,"41547":8457,"41548":65129,"41549":65130,"41550":65131,"41551":13269,"41552":13212,"41553":13213,"41554":13214,"41555":13262,"41556":13217,"41557":13198,"41558":13199,"41559":13252,"41560":176,"41561":20825,"41562":20827,"41563":20830,"41564":20829,"41565":20833,"41566":20835,"41567":21991,"41568":29929,"41569":31950,"41570":9601,"41571":9602,"41572":9603,"41573":9604,"41574":9605,"41575":9606,"41576":9607,"41577":9608,"41578":9615,"41579":9614,"41580":9613,"41581":9612,"41582":9611,"41583":9610,"41584":9609,"41585":9532,"41586":9524,"41587":9516,"41588":9508,"41589":9500,"41590":9620,"41591":9472,"41592":9474,"41593":9621,"41594":9484,"41595":9488,"41596":9492,"41597":9496,"41598":9581,"41633":9582,"41634":9584,"41635":9583,"41636":9552,"41637":9566,"41638":9578,"41639":9569,"41640":9698,"41641":9699,"41642":9701,"41643":9700,"41644":9585,"41645":9586,"41646":9587,"41647":65296,"41648":65297,"41649":65298,"41650":65299,"41651":65300,"41652":65301,"41653":65302,"41654":65303,"41655":65304,"41656":65305,"41657":8544,"41658":8545,"41659":8546,"41660":8547,"41661":8548,"41662":8549,"41663":8550,"41664":8551,"41665":8552,"41666":8553,"41667":12321,"41668":12322,"41669":12323,"41670":12324,"41671":12325,"41672":12326,"41673":12327,"41674":12328,"41675":12329,"41676":21313,"41677":21316,"41678":21317,"41679":65313,"41680":65314,"41681":65315,"41682":65316,"41683":65317,"41684":65318,"41685":65319,"41686":65320,"41687":65321,"41688":65322,"41689":65323,"41690":65324,"41691":65325,"41692":65326,"41693":65327,"41694":65328,"41695":65329,"41696":65330,"41697":65331,"41698":65332,"41699":65333,"41700":65334,"41701":65335,"41702":65336,"41703":65337,"41704":65338,"41705":65345,"41706":65346,"41707":65347,"41708":65348,"41709":65349,"41710":65350,"41711":65351,"41712":65352,"41713":65353,"41714":65354,"41715":65355,"41716":65356,"41717":65357,"41718":65358,"41719":65359,"41720":65360,"41721":65361,"41722":65362,"41723":65363,"41724":65364,"41725":65365,"41726":65366,"41792":65367,"41793":65368,"41794":65369,"41795":65370,"41796":913,"41797":914,"41798":915,"41799":916,"41800":917,"41801":918,"41802":919,"41803":920,"41804":921,"41805":922,"41806":923,"41807":924,"41808":925,"41809":926,"41810":927,"41811":928,"41812":929,"41813":931,"41814":932,"41815":933,"41816":934,"41817":935,"41818":936,"41819":937,"41820":945,"41821":946,"41822":947,"41823":948,"41824":949,"41825":950,"41826":951,"41827":952,"41828":953,"41829":954,"41830":955,"41831":956,"41832":957,"41833":958,"41834":959,"41835":960,"41836":961,"41837":963,"41838":964,"41839":965,"41840":966,"41841":967,"41842":968,"41843":969,"41844":12549,"41845":12550,"41846":12551,"41847":12552,"41848":12553,"41849":12554,"41850":12555,"41851":12556,"41852":12557,"41853":12558,"41854":12559,"41889":12560,"41890":12561,"41891":12562,"41892":12563,"41893":12564,"41894":12565,"41895":12566,"41896":12567,"41897":12568,"41898":12569,"41899":12570,"41900":12571,"41901":12572,"41902":12573,"41903":12574,"41904":12575,"41905":12576,"41906":12577,"41907":12578,"41908":12579,"41909":12580,"41910":12581,"41911":12582,"41912":12583,"41913":12584,"41914":12585,"41915":729,"41916":713,"41917":714,"41918":711,"41919":715,"41920":9216,"41921":9217,"41922":9218,"41923":9219,"41924":9220,"41925":9221,"41926":9222,"41927":9223,"41928":9224,"41929":9225,"41930":9226,"41931":9227,"41932":9228,"41933":9229,"41934":9230,"41935":9231,"41936":9232,"41937":9233,"41938":9234,"41939":9235,"41940":9236,"41941":9237,"41942":9238,"41943":9239,"41944":9240,"41945":9241,"41946":9242,"41947":9243,"41948":9244,"41949":9245,"41950":9246,"41951":9247,"41952":9249,"41953":8364,"41954":63561,"41955":63562,"41956":63563,"41957":63564,"41958":63565,"41959":63566,"41960":63567,"41961":63568,"41962":63569,"41963":63570,"41964":63571,"41965":63572,"41966":63573,"41967":63574,"41968":63575,"41969":63576,"41970":63577,"41971":63578,"41972":63579,"41973":63580,"41974":63581,"41975":63582,"41976":63583,"41977":63584,"41978":63585,"41979":63586,"41980":63587,"41981":63588,"41982":63589,"42048":19968,"42049":20057,"42050":19969,"42051":19971,"42052":20035,"42053":20061,"42054":20102,"42055":20108,"42056":20154,"42057":20799,"42058":20837,"42059":20843,"42060":20960,"42061":20992,"42062":20993,"42063":21147,"42064":21269,"42065":21313,"42066":21340,"42067":21448,"42068":19977,"42069":19979,"42070":19976,"42071":19978,"42072":20011,"42073":20024,"42074":20961,"42075":20037,"42076":20040,"42077":20063,"42078":20062,"42079":20110,"42080":20129,"42081":20800,"42082":20995,"42083":21242,"42084":21315,"42085":21449,"42086":21475,"42087":22303,"42088":22763,"42089":22805,"42090":22823,"42091":22899,"42092":23376,"42093":23377,"42094":23379,"42095":23544,"42096":23567,"42097":23586,"42098":23608,"42099":23665,"42100":24029,"42101":24037,"42102":24049,"42103":24050,"42104":24051,"42105":24062,"42106":24178,"42107":24318,"42108":24331,"42109":24339,"42110":25165,"42145":19985,"42146":19984,"42147":19981,"42148":20013,"42149":20016,"42150":20025,"42151":20043,"42152":23609,"42153":20104,"42154":20113,"42155":20117,"42156":20114,"42157":20116,"42158":20130,"42159":20161,"42160":20160,"42161":20163,"42162":20166,"42163":20167,"42164":20173,"42165":20170,"42166":20171,"42167":20164,"42168":20803,"42169":20801,"42170":20839,"42171":20845,"42172":20846,"42173":20844,"42174":20887,"42175":20982,"42176":20998,"42177":20999,"42178":21000,"42179":21243,"42180":21246,"42181":21247,"42182":21270,"42183":21305,"42184":21320,"42185":21319,"42186":21317,"42187":21342,"42188":21380,"42189":21451,"42190":21450,"42191":21453,"42192":22764,"42193":22825,"42194":22827,"42195":22826,"42196":22829,"42197":23380,"42198":23569,"42199":23588,"42200":23610,"42201":23663,"42202":24052,"42203":24187,"42204":24319,"42205":24340,"42206":24341,"42207":24515,"42208":25096,"42209":25142,"42210":25163,"42211":25166,"42212":25903,"42213":25991,"42214":26007,"42215":26020,"42216":26041,"42217":26085,"42218":26352,"42219":26376,"42220":26408,"42221":27424,"42222":27490,"42223":27513,"42224":27595,"42225":27604,"42226":27611,"42227":27663,"42228":27700,"42229":28779,"42230":29226,"42231":29238,"42232":29243,"42233":29255,"42234":29273,"42235":29275,"42236":29356,"42237":29579,"42238":19993,"42304":19990,"42305":19989,"42306":19988,"42307":19992,"42308":20027,"42309":20045,"42310":20047,"42311":20046,"42312":20197,"42313":20184,"42314":20180,"42315":20181,"42316":20182,"42317":20183,"42318":20195,"42319":20196,"42320":20185,"42321":20190,"42322":20805,"42323":20804,"42324":20873,"42325":20874,"42326":20908,"42327":20985,"42328":20986,"42329":20984,"42330":21002,"42331":21152,"42332":21151,"42333":21253,"42334":21254,"42335":21271,"42336":21277,"42337":20191,"42338":21322,"42339":21321,"42340":21345,"42341":21344,"42342":21359,"42343":21358,"42344":21435,"42345":21487,"42346":21476,"42347":21491,"42348":21484,"42349":21486,"42350":21481,"42351":21480,"42352":21500,"42353":21496,"42354":21493,"42355":21483,"42356":21478,"42357":21482,"42358":21490,"42359":21489,"42360":21488,"42361":21477,"42362":21485,"42363":21499,"42364":22235,"42365":22234,"42366":22806,"42401":22830,"42402":22833,"42403":22900,"42404":22902,"42405":23381,"42406":23427,"42407":23612,"42408":24040,"42409":24039,"42410":24038,"42411":24066,"42412":24067,"42413":24179,"42414":24188,"42415":24321,"42416":24344,"42417":24343,"42418":24517,"42419":25098,"42420":25171,"42421":25172,"42422":25170,"42423":25169,"42424":26021,"42425":26086,"42426":26414,"42427":26412,"42428":26410,"42429":26411,"42430":26413,"42431":27491,"42432":27597,"42433":27665,"42434":27664,"42435":27704,"42436":27713,"42437":27712,"42438":27710,"42439":29359,"42440":29572,"42441":29577,"42442":29916,"42443":29926,"42444":29976,"42445":29983,"42446":29992,"42447":29993,"42448":30000,"42449":30001,"42450":30002,"42451":30003,"42452":30091,"42453":30333,"42454":30382,"42455":30399,"42456":30446,"42457":30683,"42458":30690,"42459":30707,"42460":31034,"42461":31166,"42462":31348,"42463":31435,"42464":19998,"42465":19999,"42466":20050,"42467":20051,"42468":20073,"42469":20121,"42470":20132,"42471":20134,"42472":20133,"42473":20223,"42474":20233,"42475":20249,"42476":20234,"42477":20245,"42478":20237,"42479":20240,"42480":20241,"42481":20239,"42482":20210,"42483":20214,"42484":20219,"42485":20208,"42486":20211,"42487":20221,"42488":20225,"42489":20235,"42490":20809,"42491":20807,"42492":20806,"42493":20808,"42494":20840,"42560":20849,"42561":20877,"42562":20912,"42563":21015,"42564":21009,"42565":21010,"42566":21006,"42567":21014,"42568":21155,"42569":21256,"42570":21281,"42571":21280,"42572":21360,"42573":21361,"42574":21513,"42575":21519,"42576":21516,"42577":21514,"42578":21520,"42579":21505,"42580":21515,"42581":21508,"42582":21521,"42583":21517,"42584":21512,"42585":21507,"42586":21518,"42587":21510,"42588":21522,"42589":22240,"42590":22238,"42591":22237,"42592":22323,"42593":22320,"42594":22312,"42595":22317,"42596":22316,"42597":22319,"42598":22313,"42599":22809,"42600":22810,"42601":22839,"42602":22840,"42603":22916,"42604":22904,"42605":22915,"42606":22909,"42607":22905,"42608":22914,"42609":22913,"42610":23383,"42611":23384,"42612":23431,"42613":23432,"42614":23429,"42615":23433,"42616":23546,"42617":23574,"42618":23673,"42619":24030,"42620":24070,"42621":24182,"42622":24180,"42657":24335,"42658":24347,"42659":24537,"42660":24534,"42661":25102,"42662":25100,"42663":25101,"42664":25104,"42665":25187,"42666":25179,"42667":25176,"42668":25910,"42669":26089,"42670":26088,"42671":26092,"42672":26093,"42673":26354,"42674":26355,"42675":26377,"42676":26429,"42677":26420,"42678":26417,"42679":26421,"42680":27425,"42681":27492,"42682":27515,"42683":27670,"42684":27741,"42685":27735,"42686":27737,"42687":27743,"42688":27744,"42689":27728,"42690":27733,"42691":27745,"42692":27739,"42693":27725,"42694":27726,"42695":28784,"42696":29279,"42697":29277,"42698":30334,"42699":31481,"42700":31859,"42701":31992,"42702":32566,"42703":32650,"42704":32701,"42705":32769,"42706":32771,"42707":32780,"42708":32786,"42709":32819,"42710":32895,"42711":32905,"42712":32907,"42713":32908,"42714":33251,"42715":33258,"42716":33267,"42717":33276,"42718":33292,"42719":33307,"42720":33311,"42721":33390,"42722":33394,"42723":33406,"42724":34411,"42725":34880,"42726":34892,"42727":34915,"42728":35199,"42729":38433,"42730":20018,"42731":20136,"42732":20301,"42733":20303,"42734":20295,"42735":20311,"42736":20318,"42737":20276,"42738":20315,"42739":20309,"42740":20272,"42741":20304,"42742":20305,"42743":20285,"42744":20282,"42745":20280,"42746":20291,"42747":20308,"42748":20284,"42749":20294,"42750":20323,"42816":20316,"42817":20320,"42818":20271,"42819":20302,"42820":20278,"42821":20313,"42822":20317,"42823":20296,"42824":20314,"42825":20812,"42826":20811,"42827":20813,"42828":20853,"42829":20918,"42830":20919,"42831":21029,"42832":21028,"42833":21033,"42834":21034,"42835":21032,"42836":21163,"42837":21161,"42838":21162,"42839":21164,"42840":21283,"42841":21363,"42842":21365,"42843":21533,"42844":21549,"42845":21534,"42846":21566,"42847":21542,"42848":21582,"42849":21543,"42850":21574,"42851":21571,"42852":21555,"42853":21576,"42854":21570,"42855":21531,"42856":21545,"42857":21578,"42858":21561,"42859":21563,"42860":21560,"42861":21550,"42862":21557,"42863":21558,"42864":21536,"42865":21564,"42866":21568,"42867":21553,"42868":21547,"42869":21535,"42870":21548,"42871":22250,"42872":22256,"42873":22244,"42874":22251,"42875":22346,"42876":22353,"42877":22336,"42878":22349,"42913":22343,"42914":22350,"42915":22334,"42916":22352,"42917":22351,"42918":22331,"42919":22767,"42920":22846,"42921":22941,"42922":22930,"42923":22952,"42924":22942,"42925":22947,"42926":22937,"42927":22934,"42928":22925,"42929":22948,"42930":22931,"42931":22922,"42932":22949,"42933":23389,"42934":23388,"42935":23386,"42936":23387,"42937":23436,"42938":23435,"42939":23439,"42940":23596,"42941":23616,"42942":23617,"42943":23615,"42944":23614,"42945":23696,"42946":23697,"42947":23700,"42948":23692,"42949":24043,"42950":24076,"42951":24207,"42952":24199,"42953":24202,"42954":24311,"42955":24324,"42956":24351,"42957":24420,"42958":24418,"42959":24439,"42960":24441,"42961":24536,"42962":24524,"42963":24535,"42964":24525,"42965":24561,"42966":24555,"42967":24568,"42968":24554,"42969":25106,"42970":25105,"42971":25220,"42972":25239,"42973":25238,"42974":25216,"42975":25206,"42976":25225,"42977":25197,"42978":25226,"42979":25212,"42980":25214,"42981":25209,"42982":25203,"42983":25234,"42984":25199,"42985":25240,"42986":25198,"42987":25237,"42988":25235,"42989":25233,"42990":25222,"42991":25913,"42992":25915,"42993":25912,"42994":26097,"42995":26356,"42996":26463,"42997":26446,"42998":26447,"42999":26448,"43000":26449,"43001":26460,"43002":26454,"43003":26462,"43004":26441,"43005":26438,"43006":26464,"43072":26451,"43073":26455,"43074":27493,"43075":27599,"43076":27714,"43077":27742,"43078":27801,"43079":27777,"43080":27784,"43081":27785,"43082":27781,"43083":27803,"43084":27754,"43085":27770,"43086":27792,"43087":27760,"43088":27788,"43089":27752,"43090":27798,"43091":27794,"43092":27773,"43093":27779,"43094":27762,"43095":27774,"43096":27764,"43097":27782,"43098":27766,"43099":27789,"43100":27796,"43101":27800,"43102":27778,"43103":28790,"43104":28796,"43105":28797,"43106":28792,"43107":29282,"43108":29281,"43109":29280,"43110":29380,"43111":29378,"43112":29590,"43113":29996,"43114":29995,"43115":30007,"43116":30008,"43117":30338,"43118":30447,"43119":30691,"43120":31169,"43121":31168,"43122":31167,"43123":31350,"43124":31995,"43125":32597,"43126":32918,"43127":32915,"43128":32925,"43129":32920,"43130":32923,"43131":32922,"43132":32946,"43133":33391,"43134":33426,"43169":33419,"43170":33421,"43171":35211,"43172":35282,"43173":35328,"43174":35895,"43175":35910,"43176":35925,"43177":35997,"43178":36196,"43179":36208,"43180":36275,"43181":36523,"43182":36554,"43183":36763,"43184":36784,"43185":36802,"43186":36806,"43187":36805,"43188":36804,"43189":24033,"43190":37009,"43191":37026,"43192":37034,"43193":37030,"43194":37027,"43195":37193,"43196":37318,"43197":37324,"43198":38450,"43199":38446,"43200":38449,"43201":38442,"43202":38444,"43203":20006,"43204":20054,"43205":20083,"43206":20107,"43207":20123,"43208":20126,"43209":20139,"43210":20140,"43211":20335,"43212":20381,"43213":20365,"43214":20339,"43215":20351,"43216":20332,"43217":20379,"43218":20363,"43219":20358,"43220":20355,"43221":20336,"43222":20341,"43223":20360,"43224":20329,"43225":20347,"43226":20374,"43227":20350,"43228":20367,"43229":20369,"43230":20346,"43231":20820,"43232":20818,"43233":20821,"43234":20841,"43235":20855,"43236":20854,"43237":20856,"43238":20925,"43239":20989,"43240":21051,"43241":21048,"43242":21047,"43243":21050,"43244":21040,"43245":21038,"43246":21046,"43247":21057,"43248":21182,"43249":21179,"43250":21330,"43251":21332,"43252":21331,"43253":21329,"43254":21350,"43255":21367,"43256":21368,"43257":21369,"43258":21462,"43259":21460,"43260":21463,"43261":21619,"43262":21621,"43328":21654,"43329":21624,"43330":21653,"43331":21632,"43332":21627,"43333":21623,"43334":21636,"43335":21650,"43336":21638,"43337":21628,"43338":21648,"43339":21617,"43340":21622,"43341":21644,"43342":21658,"43343":21602,"43344":21608,"43345":21643,"43346":21629,"43347":21646,"43348":22266,"43349":22403,"43350":22391,"43351":22378,"43352":22377,"43353":22369,"43354":22374,"43355":22372,"43356":22396,"43357":22812,"43358":22857,"43359":22855,"43360":22856,"43361":22852,"43362":22868,"43363":22974,"43364":22971,"43365":22996,"43366":22969,"43367":22958,"43368":22993,"43369":22982,"43370":22992,"43371":22989,"43372":22987,"43373":22995,"43374":22986,"43375":22959,"43376":22963,"43377":22994,"43378":22981,"43379":23391,"43380":23396,"43381":23395,"43382":23447,"43383":23450,"43384":23448,"43385":23452,"43386":23449,"43387":23451,"43388":23578,"43389":23624,"43390":23621,"43425":23622,"43426":23735,"43427":23713,"43428":23736,"43429":23721,"43430":23723,"43431":23729,"43432":23731,"43433":24088,"43434":24090,"43435":24086,"43436":24085,"43437":24091,"43438":24081,"43439":24184,"43440":24218,"43441":24215,"43442":24220,"43443":24213,"43444":24214,"43445":24310,"43446":24358,"43447":24359,"43448":24361,"43449":24448,"43450":24449,"43451":24447,"43452":24444,"43453":24541,"43454":24544,"43455":24573,"43456":24565,"43457":24575,"43458":24591,"43459":24596,"43460":24623,"43461":24629,"43462":24598,"43463":24618,"43464":24597,"43465":24609,"43466":24615,"43467":24617,"43468":24619,"43469":24603,"43470":25110,"43471":25109,"43472":25151,"43473":25150,"43474":25152,"43475":25215,"43476":25289,"43477":25292,"43478":25284,"43479":25279,"43480":25282,"43481":25273,"43482":25298,"43483":25307,"43484":25259,"43485":25299,"43486":25300,"43487":25291,"43488":25288,"43489":25256,"43490":25277,"43491":25276,"43492":25296,"43493":25305,"43494":25287,"43495":25293,"43496":25269,"43497":25306,"43498":25265,"43499":25304,"43500":25302,"43501":25303,"43502":25286,"43503":25260,"43504":25294,"43505":25918,"43506":26023,"43507":26044,"43508":26106,"43509":26132,"43510":26131,"43511":26124,"43512":26118,"43513":26114,"43514":26126,"43515":26112,"43516":26127,"43517":26133,"43518":26122,"43584":26119,"43585":26381,"43586":26379,"43587":26477,"43588":26507,"43589":26517,"43590":26481,"43591":26524,"43592":26483,"43593":26487,"43594":26503,"43595":26525,"43596":26519,"43597":26479,"43598":26480,"43599":26495,"43600":26505,"43601":26494,"43602":26512,"43603":26485,"43604":26522,"43605":26515,"43606":26492,"43607":26474,"43608":26482,"43609":27427,"43610":27494,"43611":27495,"43612":27519,"43613":27667,"43614":27675,"43615":27875,"43616":27880,"43617":27891,"43618":27825,"43619":27852,"43620":27877,"43621":27827,"43622":27837,"43623":27838,"43624":27836,"43625":27874,"43626":27819,"43627":27861,"43628":27859,"43629":27832,"43630":27844,"43631":27833,"43632":27841,"43633":27822,"43634":27863,"43635":27845,"43636":27889,"43637":27839,"43638":27835,"43639":27873,"43640":27867,"43641":27850,"43642":27820,"43643":27887,"43644":27868,"43645":27862,"43646":27872,"43681":28821,"43682":28814,"43683":28818,"43684":28810,"43685":28825,"43686":29228,"43687":29229,"43688":29240,"43689":29256,"43690":29287,"43691":29289,"43692":29376,"43693":29390,"43694":29401,"43695":29399,"43696":29392,"43697":29609,"43698":29608,"43699":29599,"43700":29611,"43701":29605,"43702":30013,"43703":30109,"43704":30105,"43705":30106,"43706":30340,"43707":30402,"43708":30450,"43709":30452,"43710":30693,"43711":30717,"43712":31038,"43713":31040,"43714":31041,"43715":31177,"43716":31176,"43717":31354,"43718":31353,"43719":31482,"43720":31998,"43721":32596,"43722":32652,"43723":32651,"43724":32773,"43725":32954,"43726":32933,"43727":32930,"43728":32945,"43729":32929,"43730":32939,"43731":32937,"43732":32948,"43733":32938,"43734":32943,"43735":33253,"43736":33278,"43737":33293,"43738":33459,"43739":33437,"43740":33433,"43741":33453,"43742":33469,"43743":33439,"43744":33465,"43745":33457,"43746":33452,"43747":33445,"43748":33455,"43749":33464,"43750":33443,"43751":33456,"43752":33470,"43753":33463,"43754":34382,"43755":34417,"43756":21021,"43757":34920,"43758":36555,"43759":36814,"43760":36820,"43761":36817,"43762":37045,"43763":37048,"43764":37041,"43765":37046,"43766":37319,"43767":37329,"43768":38263,"43769":38272,"43770":38428,"43771":38464,"43772":38463,"43773":38459,"43774":38468,"43840":38466,"43841":38585,"43842":38632,"43843":38738,"43844":38750,"43845":20127,"43846":20141,"43847":20142,"43848":20449,"43849":20405,"43850":20399,"43851":20415,"43852":20448,"43853":20433,"43854":20431,"43855":20445,"43856":20419,"43857":20406,"43858":20440,"43859":20447,"43860":20426,"43861":20439,"43862":20398,"43863":20432,"43864":20420,"43865":20418,"43866":20442,"43867":20430,"43868":20446,"43869":20407,"43870":20823,"43871":20882,"43872":20881,"43873":20896,"43874":21070,"43875":21059,"43876":21066,"43877":21069,"43878":21068,"43879":21067,"43880":21063,"43881":21191,"43882":21193,"43883":21187,"43884":21185,"43885":21261,"43886":21335,"43887":21371,"43888":21402,"43889":21467,"43890":21676,"43891":21696,"43892":21672,"43893":21710,"43894":21705,"43895":21688,"43896":21670,"43897":21683,"43898":21703,"43899":21698,"43900":21693,"43901":21674,"43902":21697,"43937":21700,"43938":21704,"43939":21679,"43940":21675,"43941":21681,"43942":21691,"43943":21673,"43944":21671,"43945":21695,"43946":22271,"43947":22402,"43948":22411,"43949":22432,"43950":22435,"43951":22434,"43952":22478,"43953":22446,"43954":22419,"43955":22869,"43956":22865,"43957":22863,"43958":22862,"43959":22864,"43960":23004,"43961":23000,"43962":23039,"43963":23011,"43964":23016,"43965":23043,"43966":23013,"43967":23018,"43968":23002,"43969":23014,"43970":23041,"43971":23035,"43972":23401,"43973":23459,"43974":23462,"43975":23460,"43976":23458,"43977":23461,"43978":23553,"43979":23630,"43980":23631,"43981":23629,"43982":23627,"43983":23769,"43984":23762,"43985":24055,"43986":24093,"43987":24101,"43988":24095,"43989":24189,"43990":24224,"43991":24230,"43992":24314,"43993":24328,"43994":24365,"43995":24421,"43996":24456,"43997":24453,"43998":24458,"43999":24459,"44000":24455,"44001":24460,"44002":24457,"44003":24594,"44004":24605,"44005":24608,"44006":24613,"44007":24590,"44008":24616,"44009":24653,"44010":24688,"44011":24680,"44012":24674,"44013":24646,"44014":24643,"44015":24684,"44016":24683,"44017":24682,"44018":24676,"44019":25153,"44020":25308,"44021":25366,"44022":25353,"44023":25340,"44024":25325,"44025":25345,"44026":25326,"44027":25341,"44028":25351,"44029":25329,"44030":25335,"44096":25327,"44097":25324,"44098":25342,"44099":25332,"44100":25361,"44101":25346,"44102":25919,"44103":25925,"44104":26027,"44105":26045,"44106":26082,"44107":26149,"44108":26157,"44109":26144,"44110":26151,"44111":26159,"44112":26143,"44113":26152,"44114":26161,"44115":26148,"44116":26359,"44117":26623,"44118":26579,"44119":26609,"44120":26580,"44121":26576,"44122":26604,"44123":26550,"44124":26543,"44125":26613,"44126":26601,"44127":26607,"44128":26564,"44129":26577,"44130":26548,"44131":26586,"44132":26597,"44133":26552,"44134":26575,"44135":26590,"44136":26611,"44137":26544,"44138":26585,"44139":26594,"44140":26589,"44141":26578,"44142":27498,"44143":27523,"44144":27526,"44145":27573,"44146":27602,"44147":27607,"44148":27679,"44149":27849,"44150":27915,"44151":27954,"44152":27946,"44153":27969,"44154":27941,"44155":27916,"44156":27953,"44157":27934,"44158":27927,"44193":27963,"44194":27965,"44195":27966,"44196":27958,"44197":27931,"44198":27893,"44199":27961,"44200":27943,"44201":27960,"44202":27945,"44203":27950,"44204":27957,"44205":27918,"44206":27947,"44207":28843,"44208":28858,"44209":28851,"44210":28844,"44211":28847,"44212":28845,"44213":28856,"44214":28846,"44215":28836,"44216":29232,"44217":29298,"44218":29295,"44219":29300,"44220":29417,"44221":29408,"44222":29409,"44223":29623,"44224":29642,"44225":29627,"44226":29618,"44227":29645,"44228":29632,"44229":29619,"44230":29978,"44231":29997,"44232":30031,"44233":30028,"44234":30030,"44235":30027,"44236":30123,"44237":30116,"44238":30117,"44239":30114,"44240":30115,"44241":30328,"44242":30342,"44243":30343,"44244":30344,"44245":30408,"44246":30406,"44247":30403,"44248":30405,"44249":30465,"44250":30457,"44251":30456,"44252":30473,"44253":30475,"44254":30462,"44255":30460,"44256":30471,"44257":30684,"44258":30722,"44259":30740,"44260":30732,"44261":30733,"44262":31046,"44263":31049,"44264":31048,"44265":31047,"44266":31161,"44267":31162,"44268":31185,"44269":31186,"44270":31179,"44271":31359,"44272":31361,"44273":31487,"44274":31485,"44275":31869,"44276":32002,"44277":32005,"44278":32000,"44279":32009,"44280":32007,"44281":32004,"44282":32006,"44283":32568,"44284":32654,"44285":32703,"44286":32772,"44352":32784,"44353":32781,"44354":32785,"44355":32822,"44356":32982,"44357":32997,"44358":32986,"44359":32963,"44360":32964,"44361":32972,"44362":32993,"44363":32987,"44364":32974,"44365":32990,"44366":32996,"44367":32989,"44368":33268,"44369":33314,"44370":33511,"44371":33539,"44372":33541,"44373":33507,"44374":33499,"44375":33510,"44376":33540,"44377":33509,"44378":33538,"44379":33545,"44380":33490,"44381":33495,"44382":33521,"44383":33537,"44384":33500,"44385":33492,"44386":33489,"44387":33502,"44388":33491,"44389":33503,"44390":33519,"44391":33542,"44392":34384,"44393":34425,"44394":34427,"44395":34426,"44396":34893,"44397":34923,"44398":35201,"44399":35284,"44400":35336,"44401":35330,"44402":35331,"44403":35998,"44404":36000,"44405":36212,"44406":36211,"44407":36276,"44408":36557,"44409":36556,"44410":36848,"44411":36838,"44412":36834,"44413":36842,"44414":36837,"44449":36845,"44450":36843,"44451":36836,"44452":36840,"44453":37066,"44454":37070,"44455":37057,"44456":37059,"44457":37195,"44458":37194,"44459":37325,"44460":38274,"44461":38480,"44462":38475,"44463":38476,"44464":38477,"44465":38754,"44466":38761,"44467":38859,"44468":38893,"44469":38899,"44470":38913,"44471":39080,"44472":39131,"44473":39135,"44474":39318,"44475":39321,"44476":20056,"44477":20147,"44478":20492,"44479":20493,"44480":20515,"44481":20463,"44482":20518,"44483":20517,"44484":20472,"44485":20521,"44486":20502,"44487":20486,"44488":20540,"44489":20511,"44490":20506,"44491":20498,"44492":20497,"44493":20474,"44494":20480,"44495":20500,"44496":20520,"44497":20465,"44498":20513,"44499":20491,"44500":20505,"44501":20504,"44502":20467,"44503":20462,"44504":20525,"44505":20522,"44506":20478,"44507":20523,"44508":20489,"44509":20860,"44510":20900,"44511":20901,"44512":20898,"44513":20941,"44514":20940,"44515":20934,"44516":20939,"44517":21078,"44518":21084,"44519":21076,"44520":21083,"44521":21085,"44522":21290,"44523":21375,"44524":21407,"44525":21405,"44526":21471,"44527":21736,"44528":21776,"44529":21761,"44530":21815,"44531":21756,"44532":21733,"44533":21746,"44534":21766,"44535":21754,"44536":21780,"44537":21737,"44538":21741,"44539":21729,"44540":21769,"44541":21742,"44542":21738,"44608":21734,"44609":21799,"44610":21767,"44611":21757,"44612":21775,"44613":22275,"44614":22276,"44615":22466,"44616":22484,"44617":22475,"44618":22467,"44619":22537,"44620":22799,"44621":22871,"44622":22872,"44623":22874,"44624":23057,"44625":23064,"44626":23068,"44627":23071,"44628":23067,"44629":23059,"44630":23020,"44631":23072,"44632":23075,"44633":23081,"44634":23077,"44635":23052,"44636":23049,"44637":23403,"44638":23640,"44639":23472,"44640":23475,"44641":23478,"44642":23476,"44643":23470,"44644":23477,"44645":23481,"44646":23480,"44647":23556,"44648":23633,"44649":23637,"44650":23632,"44651":23789,"44652":23805,"44653":23803,"44654":23786,"44655":23784,"44656":23792,"44657":23798,"44658":23809,"44659":23796,"44660":24046,"44661":24109,"44662":24107,"44663":24235,"44664":24237,"44665":24231,"44666":24369,"44667":24466,"44668":24465,"44669":24464,"44670":24665,"44705":24675,"44706":24677,"44707":24656,"44708":24661,"44709":24685,"44710":24681,"44711":24687,"44712":24708,"44713":24735,"44714":24730,"44715":24717,"44716":24724,"44717":24716,"44718":24709,"44719":24726,"44720":25159,"44721":25331,"44722":25352,"44723":25343,"44724":25422,"44725":25406,"44726":25391,"44727":25429,"44728":25410,"44729":25414,"44730":25423,"44731":25417,"44732":25402,"44733":25424,"44734":25405,"44735":25386,"44736":25387,"44737":25384,"44738":25421,"44739":25420,"44740":25928,"44741":25929,"44742":26009,"44743":26049,"44744":26053,"44745":26178,"44746":26185,"44747":26191,"44748":26179,"44749":26194,"44750":26188,"44751":26181,"44752":26177,"44753":26360,"44754":26388,"44755":26389,"44756":26391,"44757":26657,"44758":26680,"44759":26696,"44760":26694,"44761":26707,"44762":26681,"44763":26690,"44764":26708,"44765":26665,"44766":26803,"44767":26647,"44768":26700,"44769":26705,"44770":26685,"44771":26612,"44772":26704,"44773":26688,"44774":26684,"44775":26691,"44776":26666,"44777":26693,"44778":26643,"44779":26648,"44780":26689,"44781":27530,"44782":27529,"44783":27575,"44784":27683,"44785":27687,"44786":27688,"44787":27686,"44788":27684,"44789":27888,"44790":28010,"44791":28053,"44792":28040,"44793":28039,"44794":28006,"44795":28024,"44796":28023,"44797":27993,"44798":28051,"44864":28012,"44865":28041,"44866":28014,"44867":27994,"44868":28020,"44869":28009,"44870":28044,"44871":28042,"44872":28025,"44873":28037,"44874":28005,"44875":28052,"44876":28874,"44877":28888,"44878":28900,"44879":28889,"44880":28872,"44881":28879,"44882":29241,"44883":29305,"44884":29436,"44885":29433,"44886":29437,"44887":29432,"44888":29431,"44889":29574,"44890":29677,"44891":29705,"44892":29678,"44893":29664,"44894":29674,"44895":29662,"44896":30036,"44897":30045,"44898":30044,"44899":30042,"44900":30041,"44901":30142,"44902":30149,"44903":30151,"44904":30130,"44905":30131,"44906":30141,"44907":30140,"44908":30137,"44909":30146,"44910":30136,"44911":30347,"44912":30384,"44913":30410,"44914":30413,"44915":30414,"44916":30505,"44917":30495,"44918":30496,"44919":30504,"44920":30697,"44921":30768,"44922":30759,"44923":30776,"44924":30749,"44925":30772,"44926":30775,"44961":30757,"44962":30765,"44963":30752,"44964":30751,"44965":30770,"44966":31061,"44967":31056,"44968":31072,"44969":31071,"44970":31062,"44971":31070,"44972":31069,"44973":31063,"44974":31066,"44975":31204,"44976":31203,"44977":31207,"44978":31199,"44979":31206,"44980":31209,"44981":31192,"44982":31364,"44983":31368,"44984":31449,"44985":31494,"44986":31505,"44987":31881,"44988":32033,"44989":32023,"44990":32011,"44991":32010,"44992":32032,"44993":32034,"44994":32020,"44995":32016,"44996":32021,"44997":32026,"44998":32028,"44999":32013,"45000":32025,"45001":32027,"45002":32570,"45003":32607,"45004":32660,"45005":32709,"45006":32705,"45007":32774,"45008":32792,"45009":32789,"45010":32793,"45011":32791,"45012":32829,"45013":32831,"45014":33009,"45015":33026,"45016":33008,"45017":33029,"45018":33005,"45019":33012,"45020":33030,"45021":33016,"45022":33011,"45023":33032,"45024":33021,"45025":33034,"45026":33020,"45027":33007,"45028":33261,"45029":33260,"45030":33280,"45031":33296,"45032":33322,"45033":33323,"45034":33320,"45035":33324,"45036":33467,"45037":33579,"45038":33618,"45039":33620,"45040":33610,"45041":33592,"45042":33616,"45043":33609,"45044":33589,"45045":33588,"45046":33615,"45047":33586,"45048":33593,"45049":33590,"45050":33559,"45051":33600,"45052":33585,"45053":33576,"45054":33603,"45120":34388,"45121":34442,"45122":34474,"45123":34451,"45124":34468,"45125":34473,"45126":34444,"45127":34467,"45128":34460,"45129":34928,"45130":34935,"45131":34945,"45132":34946,"45133":34941,"45134":34937,"45135":35352,"45136":35344,"45137":35342,"45138":35340,"45139":35349,"45140":35338,"45141":35351,"45142":35347,"45143":35350,"45144":35343,"45145":35345,"45146":35912,"45147":35962,"45148":35961,"45149":36001,"45150":36002,"45151":36215,"45152":36524,"45153":36562,"45154":36564,"45155":36559,"45156":36785,"45157":36865,"45158":36870,"45159":36855,"45160":36864,"45161":36858,"45162":36852,"45163":36867,"45164":36861,"45165":36869,"45166":36856,"45167":37013,"45168":37089,"45169":37085,"45170":37090,"45171":37202,"45172":37197,"45173":37196,"45174":37336,"45175":37341,"45176":37335,"45177":37340,"45178":37337,"45179":38275,"45180":38498,"45181":38499,"45182":38497,"45217":38491,"45218":38493,"45219":38500,"45220":38488,"45221":38494,"45222":38587,"45223":39138,"45224":39340,"45225":39592,"45226":39640,"45227":39717,"45228":39730,"45229":39740,"45230":20094,"45231":20602,"45232":20605,"45233":20572,"45234":20551,"45235":20547,"45236":20556,"45237":20570,"45238":20553,"45239":20581,"45240":20598,"45241":20558,"45242":20565,"45243":20597,"45244":20596,"45245":20599,"45246":20559,"45247":20495,"45248":20591,"45249":20589,"45250":20828,"45251":20885,"45252":20976,"45253":21098,"45254":21103,"45255":21202,"45256":21209,"45257":21208,"45258":21205,"45259":21264,"45260":21263,"45261":21273,"45262":21311,"45263":21312,"45264":21310,"45265":21443,"45266":26364,"45267":21830,"45268":21866,"45269":21862,"45270":21828,"45271":21854,"45272":21857,"45273":21827,"45274":21834,"45275":21809,"45276":21846,"45277":21839,"45278":21845,"45279":21807,"45280":21860,"45281":21816,"45282":21806,"45283":21852,"45284":21804,"45285":21859,"45286":21811,"45287":21825,"45288":21847,"45289":22280,"45290":22283,"45291":22281,"45292":22495,"45293":22533,"45294":22538,"45295":22534,"45296":22496,"45297":22500,"45298":22522,"45299":22530,"45300":22581,"45301":22519,"45302":22521,"45303":22816,"45304":22882,"45305":23094,"45306":23105,"45307":23113,"45308":23142,"45309":23146,"45310":23104,"45376":23100,"45377":23138,"45378":23130,"45379":23110,"45380":23114,"45381":23408,"45382":23495,"45383":23493,"45384":23492,"45385":23490,"45386":23487,"45387":23494,"45388":23561,"45389":23560,"45390":23559,"45391":23648,"45392":23644,"45393":23645,"45394":23815,"45395":23814,"45396":23822,"45397":23835,"45398":23830,"45399":23842,"45400":23825,"45401":23849,"45402":23828,"45403":23833,"45404":23844,"45405":23847,"45406":23831,"45407":24034,"45408":24120,"45409":24118,"45410":24115,"45411":24119,"45412":24247,"45413":24248,"45414":24246,"45415":24245,"45416":24254,"45417":24373,"45418":24375,"45419":24407,"45420":24428,"45421":24425,"45422":24427,"45423":24471,"45424":24473,"45425":24478,"45426":24472,"45427":24481,"45428":24480,"45429":24476,"45430":24703,"45431":24739,"45432":24713,"45433":24736,"45434":24744,"45435":24779,"45436":24756,"45437":24806,"45438":24765,"45473":24773,"45474":24763,"45475":24757,"45476":24796,"45477":24764,"45478":24792,"45479":24789,"45480":24774,"45481":24799,"45482":24760,"45483":24794,"45484":24775,"45485":25114,"45486":25115,"45487":25160,"45488":25504,"45489":25511,"45490":25458,"45491":25494,"45492":25506,"45493":25509,"45494":25463,"45495":25447,"45496":25496,"45497":25514,"45498":25457,"45499":25513,"45500":25481,"45501":25475,"45502":25499,"45503":25451,"45504":25512,"45505":25476,"45506":25480,"45507":25497,"45508":25505,"45509":25516,"45510":25490,"45511":25487,"45512":25472,"45513":25467,"45514":25449,"45515":25448,"45516":25466,"45517":25949,"45518":25942,"45519":25937,"45520":25945,"45521":25943,"45522":21855,"45523":25935,"45524":25944,"45525":25941,"45526":25940,"45527":26012,"45528":26011,"45529":26028,"45530":26063,"45531":26059,"45532":26060,"45533":26062,"45534":26205,"45535":26202,"45536":26212,"45537":26216,"45538":26214,"45539":26206,"45540":26361,"45541":21207,"45542":26395,"45543":26753,"45544":26799,"45545":26786,"45546":26771,"45547":26805,"45548":26751,"45549":26742,"45550":26801,"45551":26791,"45552":26775,"45553":26800,"45554":26755,"45555":26820,"45556":26797,"45557":26758,"45558":26757,"45559":26772,"45560":26781,"45561":26792,"45562":26783,"45563":26785,"45564":26754,"45565":27442,"45566":27578,"45632":27627,"45633":27628,"45634":27691,"45635":28046,"45636":28092,"45637":28147,"45638":28121,"45639":28082,"45640":28129,"45641":28108,"45642":28132,"45643":28155,"45644":28154,"45645":28165,"45646":28103,"45647":28107,"45648":28079,"45649":28113,"45650":28078,"45651":28126,"45652":28153,"45653":28088,"45654":28151,"45655":28149,"45656":28101,"45657":28114,"45658":28186,"45659":28085,"45660":28122,"45661":28139,"45662":28120,"45663":28138,"45664":28145,"45665":28142,"45666":28136,"45667":28102,"45668":28100,"45669":28074,"45670":28140,"45671":28095,"45672":28134,"45673":28921,"45674":28937,"45675":28938,"45676":28925,"45677":28911,"45678":29245,"45679":29309,"45680":29313,"45681":29468,"45682":29467,"45683":29462,"45684":29459,"45685":29465,"45686":29575,"45687":29701,"45688":29706,"45689":29699,"45690":29702,"45691":29694,"45692":29709,"45693":29920,"45694":29942,"45729":29943,"45730":29980,"45731":29986,"45732":30053,"45733":30054,"45734":30050,"45735":30064,"45736":30095,"45737":30164,"45738":30165,"45739":30133,"45740":30154,"45741":30157,"45742":30350,"45743":30420,"45744":30418,"45745":30427,"45746":30519,"45747":30526,"45748":30524,"45749":30518,"45750":30520,"45751":30522,"45752":30827,"45753":30787,"45754":30798,"45755":31077,"45756":31080,"45757":31085,"45758":31227,"45759":31378,"45760":31381,"45761":31520,"45762":31528,"45763":31515,"45764":31532,"45765":31526,"45766":31513,"45767":31518,"45768":31534,"45769":31890,"45770":31895,"45771":31893,"45772":32070,"45773":32067,"45774":32113,"45775":32046,"45776":32057,"45777":32060,"45778":32064,"45779":32048,"45780":32051,"45781":32068,"45782":32047,"45783":32066,"45784":32050,"45785":32049,"45786":32573,"45787":32670,"45788":32666,"45789":32716,"45790":32718,"45791":32722,"45792":32796,"45793":32842,"45794":32838,"45795":33071,"45796":33046,"45797":33059,"45798":33067,"45799":33065,"45800":33072,"45801":33060,"45802":33282,"45803":33333,"45804":33335,"45805":33334,"45806":33337,"45807":33678,"45808":33694,"45809":33688,"45810":33656,"45811":33698,"45812":33686,"45813":33725,"45814":33707,"45815":33682,"45816":33674,"45817":33683,"45818":33673,"45819":33696,"45820":33655,"45821":33659,"45822":33660,"45888":33670,"45889":33703,"45890":34389,"45891":24426,"45892":34503,"45893":34496,"45894":34486,"45895":34500,"45896":34485,"45897":34502,"45898":34507,"45899":34481,"45900":34479,"45901":34505,"45902":34899,"45903":34974,"45904":34952,"45905":34987,"45906":34962,"45907":34966,"45908":34957,"45909":34955,"45910":35219,"45911":35215,"45912":35370,"45913":35357,"45914":35363,"45915":35365,"45916":35377,"45917":35373,"45918":35359,"45919":35355,"45920":35362,"45921":35913,"45922":35930,"45923":36009,"45924":36012,"45925":36011,"45926":36008,"45927":36010,"45928":36007,"45929":36199,"45930":36198,"45931":36286,"45932":36282,"45933":36571,"45934":36575,"45935":36889,"45936":36877,"45937":36890,"45938":36887,"45939":36899,"45940":36895,"45941":36893,"45942":36880,"45943":36885,"45944":36894,"45945":36896,"45946":36879,"45947":36898,"45948":36886,"45949":36891,"45950":36884,"45985":37096,"45986":37101,"45987":37117,"45988":37207,"45989":37326,"45990":37365,"45991":37350,"45992":37347,"45993":37351,"45994":37357,"45995":37353,"45996":38281,"45997":38506,"45998":38517,"45999":38515,"46000":38520,"46001":38512,"46002":38516,"46003":38518,"46004":38519,"46005":38508,"46006":38592,"46007":38634,"46008":38633,"46009":31456,"46010":31455,"46011":38914,"46012":38915,"46013":39770,"46014":40165,"46015":40565,"46016":40575,"46017":40613,"46018":40635,"46019":20642,"46020":20621,"46021":20613,"46022":20633,"46023":20625,"46024":20608,"46025":20630,"46026":20632,"46027":20634,"46028":26368,"46029":20977,"46030":21106,"46031":21108,"46032":21109,"46033":21097,"46034":21214,"46035":21213,"46036":21211,"46037":21338,"46038":21413,"46039":21883,"46040":21888,"46041":21927,"46042":21884,"46043":21898,"46044":21917,"46045":21912,"46046":21890,"46047":21916,"46048":21930,"46049":21908,"46050":21895,"46051":21899,"46052":21891,"46053":21939,"46054":21934,"46055":21919,"46056":21822,"46057":21938,"46058":21914,"46059":21947,"46060":21932,"46061":21937,"46062":21886,"46063":21897,"46064":21931,"46065":21913,"46066":22285,"46067":22575,"46068":22570,"46069":22580,"46070":22564,"46071":22576,"46072":22577,"46073":22561,"46074":22557,"46075":22560,"46076":22777,"46077":22778,"46078":22880,"46144":23159,"46145":23194,"46146":23167,"46147":23186,"46148":23195,"46149":23207,"46150":23411,"46151":23409,"46152":23506,"46153":23500,"46154":23507,"46155":23504,"46156":23562,"46157":23563,"46158":23601,"46159":23884,"46160":23888,"46161":23860,"46162":23879,"46163":24061,"46164":24133,"46165":24125,"46166":24128,"46167":24131,"46168":24190,"46169":24266,"46170":24257,"46171":24258,"46172":24260,"46173":24380,"46174":24429,"46175":24489,"46176":24490,"46177":24488,"46178":24785,"46179":24801,"46180":24754,"46181":24758,"46182":24800,"46183":24860,"46184":24867,"46185":24826,"46186":24853,"46187":24816,"46188":24827,"46189":24820,"46190":24936,"46191":24817,"46192":24846,"46193":24822,"46194":24841,"46195":24832,"46196":24850,"46197":25119,"46198":25161,"46199":25507,"46200":25484,"46201":25551,"46202":25536,"46203":25577,"46204":25545,"46205":25542,"46206":25549,"46241":25554,"46242":25571,"46243":25552,"46244":25569,"46245":25558,"46246":25581,"46247":25582,"46248":25462,"46249":25588,"46250":25578,"46251":25563,"46252":25682,"46253":25562,"46254":25593,"46255":25950,"46256":25958,"46257":25954,"46258":25955,"46259":26001,"46260":26000,"46261":26031,"46262":26222,"46263":26224,"46264":26228,"46265":26230,"46266":26223,"46267":26257,"46268":26234,"46269":26238,"46270":26231,"46271":26366,"46272":26367,"46273":26399,"46274":26397,"46275":26874,"46276":26837,"46277":26848,"46278":26840,"46279":26839,"46280":26885,"46281":26847,"46282":26869,"46283":26862,"46284":26855,"46285":26873,"46286":26834,"46287":26866,"46288":26851,"46289":26827,"46290":26829,"46291":26893,"46292":26898,"46293":26894,"46294":26825,"46295":26842,"46296":26990,"46297":26875,"46298":27454,"46299":27450,"46300":27453,"46301":27544,"46302":27542,"46303":27580,"46304":27631,"46305":27694,"46306":27695,"46307":27692,"46308":28207,"46309":28216,"46310":28244,"46311":28193,"46312":28210,"46313":28263,"46314":28234,"46315":28192,"46316":28197,"46317":28195,"46318":28187,"46319":28251,"46320":28248,"46321":28196,"46322":28246,"46323":28270,"46324":28205,"46325":28198,"46326":28271,"46327":28212,"46328":28237,"46329":28218,"46330":28204,"46331":28227,"46332":28189,"46333":28222,"46334":28363,"46400":28297,"46401":28185,"46402":28238,"46403":28259,"46404":28228,"46405":28274,"46406":28265,"46407":28255,"46408":28953,"46409":28954,"46410":28966,"46411":28976,"46412":28961,"46413":28982,"46414":29038,"46415":28956,"46416":29260,"46417":29316,"46418":29312,"46419":29494,"46420":29477,"46421":29492,"46422":29481,"46423":29754,"46424":29738,"46425":29747,"46426":29730,"46427":29733,"46428":29749,"46429":29750,"46430":29748,"46431":29743,"46432":29723,"46433":29734,"46434":29736,"46435":29989,"46436":29990,"46437":30059,"46438":30058,"46439":30178,"46440":30171,"46441":30179,"46442":30169,"46443":30168,"46444":30174,"46445":30176,"46446":30331,"46447":30332,"46448":30358,"46449":30355,"46450":30388,"46451":30428,"46452":30543,"46453":30701,"46454":30813,"46455":30828,"46456":30831,"46457":31245,"46458":31240,"46459":31243,"46460":31237,"46461":31232,"46462":31384,"46497":31383,"46498":31382,"46499":31461,"46500":31459,"46501":31561,"46502":31574,"46503":31558,"46504":31568,"46505":31570,"46506":31572,"46507":31565,"46508":31563,"46509":31567,"46510":31569,"46511":31903,"46512":31909,"46513":32094,"46514":32080,"46515":32104,"46516":32085,"46517":32043,"46518":32110,"46519":32114,"46520":32097,"46521":32102,"46522":32098,"46523":32112,"46524":32115,"46525":21892,"46526":32724,"46527":32725,"46528":32779,"46529":32850,"46530":32901,"46531":33109,"46532":33108,"46533":33099,"46534":33105,"46535":33102,"46536":33081,"46537":33094,"46538":33086,"46539":33100,"46540":33107,"46541":33140,"46542":33298,"46543":33308,"46544":33769,"46545":33795,"46546":33784,"46547":33805,"46548":33760,"46549":33733,"46550":33803,"46551":33729,"46552":33775,"46553":33777,"46554":33780,"46555":33879,"46556":33802,"46557":33776,"46558":33804,"46559":33740,"46560":33789,"46561":33778,"46562":33738,"46563":33848,"46564":33806,"46565":33796,"46566":33756,"46567":33799,"46568":33748,"46569":33759,"46570":34395,"46571":34527,"46572":34521,"46573":34541,"46574":34516,"46575":34523,"46576":34532,"46577":34512,"46578":34526,"46579":34903,"46580":35009,"46581":35010,"46582":34993,"46583":35203,"46584":35222,"46585":35387,"46586":35424,"46587":35413,"46588":35422,"46589":35388,"46590":35393,"46656":35412,"46657":35419,"46658":35408,"46659":35398,"46660":35380,"46661":35386,"46662":35382,"46663":35414,"46664":35937,"46665":35970,"46666":36015,"46667":36028,"46668":36019,"46669":36029,"46670":36033,"46671":36027,"46672":36032,"46673":36020,"46674":36023,"46675":36022,"46676":36031,"46677":36024,"46678":36234,"46679":36229,"46680":36225,"46681":36302,"46682":36317,"46683":36299,"46684":36314,"46685":36305,"46686":36300,"46687":36315,"46688":36294,"46689":36603,"46690":36600,"46691":36604,"46692":36764,"46693":36910,"46694":36917,"46695":36913,"46696":36920,"46697":36914,"46698":36918,"46699":37122,"46700":37109,"46701":37129,"46702":37118,"46703":37219,"46704":37221,"46705":37327,"46706":37396,"46707":37397,"46708":37411,"46709":37385,"46710":37406,"46711":37389,"46712":37392,"46713":37383,"46714":37393,"46715":38292,"46716":38287,"46717":38283,"46718":38289,"46753":38291,"46754":38290,"46755":38286,"46756":38538,"46757":38542,"46758":38539,"46759":38525,"46760":38533,"46761":38534,"46762":38541,"46763":38514,"46764":38532,"46765":38593,"46766":38597,"46767":38596,"46768":38598,"46769":38599,"46770":38639,"46771":38642,"46772":38860,"46773":38917,"46774":38918,"46775":38920,"46776":39143,"46777":39146,"46778":39151,"46779":39145,"46780":39154,"46781":39149,"46782":39342,"46783":39341,"46784":40643,"46785":40653,"46786":40657,"46787":20098,"46788":20653,"46789":20661,"46790":20658,"46791":20659,"46792":20677,"46793":20670,"46794":20652,"46795":20663,"46796":20667,"46797":20655,"46798":20679,"46799":21119,"46800":21111,"46801":21117,"46802":21215,"46803":21222,"46804":21220,"46805":21218,"46806":21219,"46807":21295,"46808":21983,"46809":21992,"46810":21971,"46811":21990,"46812":21966,"46813":21980,"46814":21959,"46815":21969,"46816":21987,"46817":21988,"46818":21999,"46819":21978,"46820":21985,"46821":21957,"46822":21958,"46823":21989,"46824":21961,"46825":22290,"46826":22291,"46827":22622,"46828":22609,"46829":22616,"46830":22615,"46831":22618,"46832":22612,"46833":22635,"46834":22604,"46835":22637,"46836":22602,"46837":22626,"46838":22610,"46839":22603,"46840":22887,"46841":23233,"46842":23241,"46843":23244,"46844":23230,"46845":23229,"46846":23228,"46912":23219,"46913":23234,"46914":23218,"46915":23913,"46916":23919,"46917":24140,"46918":24185,"46919":24265,"46920":24264,"46921":24338,"46922":24409,"46923":24492,"46924":24494,"46925":24858,"46926":24847,"46927":24904,"46928":24863,"46929":24819,"46930":24859,"46931":24825,"46932":24833,"46933":24840,"46934":24910,"46935":24908,"46936":24900,"46937":24909,"46938":24894,"46939":24884,"46940":24871,"46941":24845,"46942":24838,"46943":24887,"46944":25121,"46945":25122,"46946":25619,"46947":25662,"46948":25630,"46949":25642,"46950":25645,"46951":25661,"46952":25644,"46953":25615,"46954":25628,"46955":25620,"46956":25613,"46957":25654,"46958":25622,"46959":25623,"46960":25606,"46961":25964,"46962":26015,"46963":26032,"46964":26263,"46965":26249,"46966":26247,"46967":26248,"46968":26262,"46969":26244,"46970":26264,"46971":26253,"46972":26371,"46973":27028,"46974":26989,"47009":26970,"47010":26999,"47011":26976,"47012":26964,"47013":26997,"47014":26928,"47015":27010,"47016":26954,"47017":26984,"47018":26987,"47019":26974,"47020":26963,"47021":27001,"47022":27014,"47023":26973,"47024":26979,"47025":26971,"47026":27463,"47027":27506,"47028":27584,"47029":27583,"47030":27603,"47031":27645,"47032":28322,"47033":28335,"47034":28371,"47035":28342,"47036":28354,"47037":28304,"47038":28317,"47039":28359,"47040":28357,"47041":28325,"47042":28312,"47043":28348,"47044":28346,"47045":28331,"47046":28369,"47047":28310,"47048":28316,"47049":28356,"47050":28372,"47051":28330,"47052":28327,"47053":28340,"47054":29006,"47055":29017,"47056":29033,"47057":29028,"47058":29001,"47059":29031,"47060":29020,"47061":29036,"47062":29030,"47063":29004,"47064":29029,"47065":29022,"47066":28998,"47067":29032,"47068":29014,"47069":29242,"47070":29266,"47071":29495,"47072":29509,"47073":29503,"47074":29502,"47075":29807,"47076":29786,"47077":29781,"47078":29791,"47079":29790,"47080":29761,"47081":29759,"47082":29785,"47083":29787,"47084":29788,"47085":30070,"47086":30072,"47087":30208,"47088":30192,"47089":30209,"47090":30194,"47091":30193,"47092":30202,"47093":30207,"47094":30196,"47095":30195,"47096":30430,"47097":30431,"47098":30555,"47099":30571,"47100":30566,"47101":30558,"47102":30563,"47168":30585,"47169":30570,"47170":30572,"47171":30556,"47172":30565,"47173":30568,"47174":30562,"47175":30702,"47176":30862,"47177":30896,"47178":30871,"47179":30872,"47180":30860,"47181":30857,"47182":30844,"47183":30865,"47184":30867,"47185":30847,"47186":31098,"47187":31103,"47188":31105,"47189":33836,"47190":31165,"47191":31260,"47192":31258,"47193":31264,"47194":31252,"47195":31263,"47196":31262,"47197":31391,"47198":31392,"47199":31607,"47200":31680,"47201":31584,"47202":31598,"47203":31591,"47204":31921,"47205":31923,"47206":31925,"47207":32147,"47208":32121,"47209":32145,"47210":32129,"47211":32143,"47212":32091,"47213":32622,"47214":32617,"47215":32618,"47216":32626,"47217":32681,"47218":32680,"47219":32676,"47220":32854,"47221":32856,"47222":32902,"47223":32900,"47224":33137,"47225":33136,"47226":33144,"47227":33125,"47228":33134,"47229":33139,"47230":33131,"47265":33145,"47266":33146,"47267":33126,"47268":33285,"47269":33351,"47270":33922,"47271":33911,"47272":33853,"47273":33841,"47274":33909,"47275":33894,"47276":33899,"47277":33865,"47278":33900,"47279":33883,"47280":33852,"47281":33845,"47282":33889,"47283":33891,"47284":33897,"47285":33901,"47286":33862,"47287":34398,"47288":34396,"47289":34399,"47290":34553,"47291":34579,"47292":34568,"47293":34567,"47294":34560,"47295":34558,"47296":34555,"47297":34562,"47298":34563,"47299":34566,"47300":34570,"47301":34905,"47302":35039,"47303":35028,"47304":35033,"47305":35036,"47306":35032,"47307":35037,"47308":35041,"47309":35018,"47310":35029,"47311":35026,"47312":35228,"47313":35299,"47314":35435,"47315":35442,"47316":35443,"47317":35430,"47318":35433,"47319":35440,"47320":35463,"47321":35452,"47322":35427,"47323":35488,"47324":35441,"47325":35461,"47326":35437,"47327":35426,"47328":35438,"47329":35436,"47330":35449,"47331":35451,"47332":35390,"47333":35432,"47334":35938,"47335":35978,"47336":35977,"47337":36042,"47338":36039,"47339":36040,"47340":36036,"47341":36018,"47342":36035,"47343":36034,"47344":36037,"47345":36321,"47346":36319,"47347":36328,"47348":36335,"47349":36339,"47350":36346,"47351":36330,"47352":36324,"47353":36326,"47354":36530,"47355":36611,"47356":36617,"47357":36606,"47358":36618,"47424":36767,"47425":36786,"47426":36939,"47427":36938,"47428":36947,"47429":36930,"47430":36948,"47431":36924,"47432":36949,"47433":36944,"47434":36935,"47435":36943,"47436":36942,"47437":36941,"47438":36945,"47439":36926,"47440":36929,"47441":37138,"47442":37143,"47443":37228,"47444":37226,"47445":37225,"47446":37321,"47447":37431,"47448":37463,"47449":37432,"47450":37437,"47451":37440,"47452":37438,"47453":37467,"47454":37451,"47455":37476,"47456":37457,"47457":37428,"47458":37449,"47459":37453,"47460":37445,"47461":37433,"47462":37439,"47463":37466,"47464":38296,"47465":38552,"47466":38548,"47467":38549,"47468":38605,"47469":38603,"47470":38601,"47471":38602,"47472":38647,"47473":38651,"47474":38649,"47475":38646,"47476":38742,"47477":38772,"47478":38774,"47479":38928,"47480":38929,"47481":38931,"47482":38922,"47483":38930,"47484":38924,"47485":39164,"47486":39156,"47521":39165,"47522":39166,"47523":39347,"47524":39345,"47525":39348,"47526":39649,"47527":40169,"47528":40578,"47529":40718,"47530":40723,"47531":40736,"47532":20711,"47533":20718,"47534":20709,"47535":20694,"47536":20717,"47537":20698,"47538":20693,"47539":20687,"47540":20689,"47541":20721,"47542":20686,"47543":20713,"47544":20834,"47545":20979,"47546":21123,"47547":21122,"47548":21297,"47549":21421,"47550":22014,"47551":22016,"47552":22043,"47553":22039,"47554":22013,"47555":22036,"47556":22022,"47557":22025,"47558":22029,"47559":22030,"47560":22007,"47561":22038,"47562":22047,"47563":22024,"47564":22032,"47565":22006,"47566":22296,"47567":22294,"47568":22645,"47569":22654,"47570":22659,"47571":22675,"47572":22666,"47573":22649,"47574":22661,"47575":22653,"47576":22781,"47577":22821,"47578":22818,"47579":22820,"47580":22890,"47581":22889,"47582":23265,"47583":23270,"47584":23273,"47585":23255,"47586":23254,"47587":23256,"47588":23267,"47589":23413,"47590":23518,"47591":23527,"47592":23521,"47593":23525,"47594":23526,"47595":23528,"47596":23522,"47597":23524,"47598":23519,"47599":23565,"47600":23650,"47601":23940,"47602":23943,"47603":24155,"47604":24163,"47605":24149,"47606":24151,"47607":24148,"47608":24275,"47609":24278,"47610":24330,"47611":24390,"47612":24432,"47613":24505,"47614":24903,"47680":24895,"47681":24907,"47682":24951,"47683":24930,"47684":24931,"47685":24927,"47686":24922,"47687":24920,"47688":24949,"47689":25130,"47690":25735,"47691":25688,"47692":25684,"47693":25764,"47694":25720,"47695":25695,"47696":25722,"47697":25681,"47698":25703,"47699":25652,"47700":25709,"47701":25723,"47702":25970,"47703":26017,"47704":26071,"47705":26070,"47706":26274,"47707":26280,"47708":26269,"47709":27036,"47710":27048,"47711":27029,"47712":27073,"47713":27054,"47714":27091,"47715":27083,"47716":27035,"47717":27063,"47718":27067,"47719":27051,"47720":27060,"47721":27088,"47722":27085,"47723":27053,"47724":27084,"47725":27046,"47726":27075,"47727":27043,"47728":27465,"47729":27468,"47730":27699,"47731":28467,"47732":28436,"47733":28414,"47734":28435,"47735":28404,"47736":28457,"47737":28478,"47738":28448,"47739":28460,"47740":28431,"47741":28418,"47742":28450,"47777":28415,"47778":28399,"47779":28422,"47780":28465,"47781":28472,"47782":28466,"47783":28451,"47784":28437,"47785":28459,"47786":28463,"47787":28552,"47788":28458,"47789":28396,"47790":28417,"47791":28402,"47792":28364,"47793":28407,"47794":29076,"47795":29081,"47796":29053,"47797":29066,"47798":29060,"47799":29074,"47800":29246,"47801":29330,"47802":29334,"47803":29508,"47804":29520,"47805":29796,"47806":29795,"47807":29802,"47808":29808,"47809":29805,"47810":29956,"47811":30097,"47812":30247,"47813":30221,"47814":30219,"47815":30217,"47816":30227,"47817":30433,"47818":30435,"47819":30596,"47820":30589,"47821":30591,"47822":30561,"47823":30913,"47824":30879,"47825":30887,"47826":30899,"47827":30889,"47828":30883,"47829":31118,"47830":31119,"47831":31117,"47832":31278,"47833":31281,"47834":31402,"47835":31401,"47836":31469,"47837":31471,"47838":31649,"47839":31637,"47840":31627,"47841":31605,"47842":31639,"47843":31645,"47844":31636,"47845":31631,"47846":31672,"47847":31623,"47848":31620,"47849":31929,"47850":31933,"47851":31934,"47852":32187,"47853":32176,"47854":32156,"47855":32189,"47856":32190,"47857":32160,"47858":32202,"47859":32180,"47860":32178,"47861":32177,"47862":32186,"47863":32162,"47864":32191,"47865":32181,"47866":32184,"47867":32173,"47868":32210,"47869":32199,"47870":32172,"47936":32624,"47937":32736,"47938":32737,"47939":32735,"47940":32862,"47941":32858,"47942":32903,"47943":33104,"47944":33152,"47945":33167,"47946":33160,"47947":33162,"47948":33151,"47949":33154,"47950":33255,"47951":33274,"47952":33287,"47953":33300,"47954":33310,"47955":33355,"47956":33993,"47957":33983,"47958":33990,"47959":33988,"47960":33945,"47961":33950,"47962":33970,"47963":33948,"47964":33995,"47965":33976,"47966":33984,"47967":34003,"47968":33936,"47969":33980,"47970":34001,"47971":33994,"47972":34623,"47973":34588,"47974":34619,"47975":34594,"47976":34597,"47977":34612,"47978":34584,"47979":34645,"47980":34615,"47981":34601,"47982":35059,"47983":35074,"47984":35060,"47985":35065,"47986":35064,"47987":35069,"47988":35048,"47989":35098,"47990":35055,"47991":35494,"47992":35468,"47993":35486,"47994":35491,"47995":35469,"47996":35489,"47997":35475,"47998":35492,"48033":35498,"48034":35493,"48035":35496,"48036":35480,"48037":35473,"48038":35482,"48039":35495,"48040":35946,"48041":35981,"48042":35980,"48043":36051,"48044":36049,"48045":36050,"48046":36203,"48047":36249,"48048":36245,"48049":36348,"48050":36628,"48051":36626,"48052":36629,"48053":36627,"48054":36771,"48055":36960,"48056":36952,"48057":36956,"48058":36963,"48059":36953,"48060":36958,"48061":36962,"48062":36957,"48063":36955,"48064":37145,"48065":37144,"48066":37150,"48067":37237,"48068":37240,"48069":37239,"48070":37236,"48071":37496,"48072":37504,"48073":37509,"48074":37528,"48075":37526,"48076":37499,"48077":37523,"48078":37532,"48079":37544,"48080":37500,"48081":37521,"48082":38305,"48083":38312,"48084":38313,"48085":38307,"48086":38309,"48087":38308,"48088":38553,"48089":38556,"48090":38555,"48091":38604,"48092":38610,"48093":38656,"48094":38780,"48095":38789,"48096":38902,"48097":38935,"48098":38936,"48099":39087,"48100":39089,"48101":39171,"48102":39173,"48103":39180,"48104":39177,"48105":39361,"48106":39599,"48107":39600,"48108":39654,"48109":39745,"48110":39746,"48111":40180,"48112":40182,"48113":40179,"48114":40636,"48115":40763,"48116":40778,"48117":20740,"48118":20736,"48119":20731,"48120":20725,"48121":20729,"48122":20738,"48123":20744,"48124":20745,"48125":20741,"48126":20956,"48192":21127,"48193":21128,"48194":21129,"48195":21133,"48196":21130,"48197":21232,"48198":21426,"48199":22062,"48200":22075,"48201":22073,"48202":22066,"48203":22079,"48204":22068,"48205":22057,"48206":22099,"48207":22094,"48208":22103,"48209":22132,"48210":22070,"48211":22063,"48212":22064,"48213":22656,"48214":22687,"48215":22686,"48216":22707,"48217":22684,"48218":22702,"48219":22697,"48220":22694,"48221":22893,"48222":23305,"48223":23291,"48224":23307,"48225":23285,"48226":23308,"48227":23304,"48228":23534,"48229":23532,"48230":23529,"48231":23531,"48232":23652,"48233":23653,"48234":23965,"48235":23956,"48236":24162,"48237":24159,"48238":24161,"48239":24290,"48240":24282,"48241":24287,"48242":24285,"48243":24291,"48244":24288,"48245":24392,"48246":24433,"48247":24503,"48248":24501,"48249":24950,"48250":24935,"48251":24942,"48252":24925,"48253":24917,"48254":24962,"48289":24956,"48290":24944,"48291":24939,"48292":24958,"48293":24999,"48294":24976,"48295":25003,"48296":24974,"48297":25004,"48298":24986,"48299":24996,"48300":24980,"48301":25006,"48302":25134,"48303":25705,"48304":25711,"48305":25721,"48306":25758,"48307":25778,"48308":25736,"48309":25744,"48310":25776,"48311":25765,"48312":25747,"48313":25749,"48314":25769,"48315":25746,"48316":25774,"48317":25773,"48318":25771,"48319":25754,"48320":25772,"48321":25753,"48322":25762,"48323":25779,"48324":25973,"48325":25975,"48326":25976,"48327":26286,"48328":26283,"48329":26292,"48330":26289,"48331":27171,"48332":27167,"48333":27112,"48334":27137,"48335":27166,"48336":27161,"48337":27133,"48338":27169,"48339":27155,"48340":27146,"48341":27123,"48342":27138,"48343":27141,"48344":27117,"48345":27153,"48346":27472,"48347":27470,"48348":27556,"48349":27589,"48350":27590,"48351":28479,"48352":28540,"48353":28548,"48354":28497,"48355":28518,"48356":28500,"48357":28550,"48358":28525,"48359":28507,"48360":28536,"48361":28526,"48362":28558,"48363":28538,"48364":28528,"48365":28516,"48366":28567,"48367":28504,"48368":28373,"48369":28527,"48370":28512,"48371":28511,"48372":29087,"48373":29100,"48374":29105,"48375":29096,"48376":29270,"48377":29339,"48378":29518,"48379":29527,"48380":29801,"48381":29835,"48382":29827,"48448":29822,"48449":29824,"48450":30079,"48451":30240,"48452":30249,"48453":30239,"48454":30244,"48455":30246,"48456":30241,"48457":30242,"48458":30362,"48459":30394,"48460":30436,"48461":30606,"48462":30599,"48463":30604,"48464":30609,"48465":30603,"48466":30923,"48467":30917,"48468":30906,"48469":30922,"48470":30910,"48471":30933,"48472":30908,"48473":30928,"48474":31295,"48475":31292,"48476":31296,"48477":31293,"48478":31287,"48479":31291,"48480":31407,"48481":31406,"48482":31661,"48483":31665,"48484":31684,"48485":31668,"48486":31686,"48487":31687,"48488":31681,"48489":31648,"48490":31692,"48491":31946,"48492":32224,"48493":32244,"48494":32239,"48495":32251,"48496":32216,"48497":32236,"48498":32221,"48499":32232,"48500":32227,"48501":32218,"48502":32222,"48503":32233,"48504":32158,"48505":32217,"48506":32242,"48507":32249,"48508":32629,"48509":32631,"48510":32687,"48545":32745,"48546":32806,"48547":33179,"48548":33180,"48549":33181,"48550":33184,"48551":33178,"48552":33176,"48553":34071,"48554":34109,"48555":34074,"48556":34030,"48557":34092,"48558":34093,"48559":34067,"48560":34065,"48561":34083,"48562":34081,"48563":34068,"48564":34028,"48565":34085,"48566":34047,"48567":34054,"48568":34690,"48569":34676,"48570":34678,"48571":34656,"48572":34662,"48573":34680,"48574":34664,"48575":34649,"48576":34647,"48577":34636,"48578":34643,"48579":34907,"48580":34909,"48581":35088,"48582":35079,"48583":35090,"48584":35091,"48585":35093,"48586":35082,"48587":35516,"48588":35538,"48589":35527,"48590":35524,"48591":35477,"48592":35531,"48593":35576,"48594":35506,"48595":35529,"48596":35522,"48597":35519,"48598":35504,"48599":35542,"48600":35533,"48601":35510,"48602":35513,"48603":35547,"48604":35916,"48605":35918,"48606":35948,"48607":36064,"48608":36062,"48609":36070,"48610":36068,"48611":36076,"48612":36077,"48613":36066,"48614":36067,"48615":36060,"48616":36074,"48617":36065,"48618":36205,"48619":36255,"48620":36259,"48621":36395,"48622":36368,"48623":36381,"48624":36386,"48625":36367,"48626":36393,"48627":36383,"48628":36385,"48629":36382,"48630":36538,"48631":36637,"48632":36635,"48633":36639,"48634":36649,"48635":36646,"48636":36650,"48637":36636,"48638":36638,"48704":36645,"48705":36969,"48706":36974,"48707":36968,"48708":36973,"48709":36983,"48710":37168,"48711":37165,"48712":37159,"48713":37169,"48714":37255,"48715":37257,"48716":37259,"48717":37251,"48718":37573,"48719":37563,"48720":37559,"48721":37610,"48722":37548,"48723":37604,"48724":37569,"48725":37555,"48726":37564,"48727":37586,"48728":37575,"48729":37616,"48730":37554,"48731":38317,"48732":38321,"48733":38660,"48734":38662,"48735":38663,"48736":38665,"48737":38752,"48738":38797,"48739":38795,"48740":38799,"48741":38945,"48742":38955,"48743":38940,"48744":39091,"48745":39178,"48746":39187,"48747":39186,"48748":39192,"48749":39389,"48750":39376,"48751":39391,"48752":39387,"48753":39377,"48754":39381,"48755":39378,"48756":39385,"48757":39607,"48758":39662,"48759":39663,"48760":39719,"48761":39749,"48762":39748,"48763":39799,"48764":39791,"48765":40198,"48766":40201,"48801":40195,"48802":40617,"48803":40638,"48804":40654,"48805":22696,"48806":40786,"48807":20754,"48808":20760,"48809":20756,"48810":20752,"48811":20757,"48812":20864,"48813":20906,"48814":20957,"48815":21137,"48816":21139,"48817":21235,"48818":22105,"48819":22123,"48820":22137,"48821":22121,"48822":22116,"48823":22136,"48824":22122,"48825":22120,"48826":22117,"48827":22129,"48828":22127,"48829":22124,"48830":22114,"48831":22134,"48832":22721,"48833":22718,"48834":22727,"48835":22725,"48836":22894,"48837":23325,"48838":23348,"48839":23416,"48840":23536,"48841":23566,"48842":24394,"48843":25010,"48844":24977,"48845":25001,"48846":24970,"48847":25037,"48848":25014,"48849":25022,"48850":25034,"48851":25032,"48852":25136,"48853":25797,"48854":25793,"48855":25803,"48856":25787,"48857":25788,"48858":25818,"48859":25796,"48860":25799,"48861":25794,"48862":25805,"48863":25791,"48864":25810,"48865":25812,"48866":25790,"48867":25972,"48868":26310,"48869":26313,"48870":26297,"48871":26308,"48872":26311,"48873":26296,"48874":27197,"48875":27192,"48876":27194,"48877":27225,"48878":27243,"48879":27224,"48880":27193,"48881":27204,"48882":27234,"48883":27233,"48884":27211,"48885":27207,"48886":27189,"48887":27231,"48888":27208,"48889":27481,"48890":27511,"48891":27653,"48892":28610,"48893":28593,"48894":28577,"48960":28611,"48961":28580,"48962":28609,"48963":28583,"48964":28595,"48965":28608,"48966":28601,"48967":28598,"48968":28582,"48969":28576,"48970":28596,"48971":29118,"48972":29129,"48973":29136,"48974":29138,"48975":29128,"48976":29141,"48977":29113,"48978":29134,"48979":29145,"48980":29148,"48981":29123,"48982":29124,"48983":29544,"48984":29852,"48985":29859,"48986":29848,"48987":29855,"48988":29854,"48989":29922,"48990":29964,"48991":29965,"48992":30260,"48993":30264,"48994":30266,"48995":30439,"48996":30437,"48997":30624,"48998":30622,"48999":30623,"49000":30629,"49001":30952,"49002":30938,"49003":30956,"49004":30951,"49005":31142,"49006":31309,"49007":31310,"49008":31302,"49009":31308,"49010":31307,"49011":31418,"49012":31705,"49013":31761,"49014":31689,"49015":31716,"49016":31707,"49017":31713,"49018":31721,"49019":31718,"49020":31957,"49021":31958,"49022":32266,"49057":32273,"49058":32264,"49059":32283,"49060":32291,"49061":32286,"49062":32285,"49063":32265,"49064":32272,"49065":32633,"49066":32690,"49067":32752,"49068":32753,"49069":32750,"49070":32808,"49071":33203,"49072":33193,"49073":33192,"49074":33275,"49075":33288,"49076":33368,"49077":33369,"49078":34122,"49079":34137,"49080":34120,"49081":34152,"49082":34153,"49083":34115,"49084":34121,"49085":34157,"49086":34154,"49087":34142,"49088":34691,"49089":34719,"49090":34718,"49091":34722,"49092":34701,"49093":34913,"49094":35114,"49095":35122,"49096":35109,"49097":35115,"49098":35105,"49099":35242,"49100":35238,"49101":35558,"49102":35578,"49103":35563,"49104":35569,"49105":35584,"49106":35548,"49107":35559,"49108":35566,"49109":35582,"49110":35585,"49111":35586,"49112":35575,"49113":35565,"49114":35571,"49115":35574,"49116":35580,"49117":35947,"49118":35949,"49119":35987,"49120":36084,"49121":36420,"49122":36401,"49123":36404,"49124":36418,"49125":36409,"49126":36405,"49127":36667,"49128":36655,"49129":36664,"49130":36659,"49131":36776,"49132":36774,"49133":36981,"49134":36980,"49135":36984,"49136":36978,"49137":36988,"49138":36986,"49139":37172,"49140":37266,"49141":37664,"49142":37686,"49143":37624,"49144":37683,"49145":37679,"49146":37666,"49147":37628,"49148":37675,"49149":37636,"49150":37658,"49216":37648,"49217":37670,"49218":37665,"49219":37653,"49220":37678,"49221":37657,"49222":38331,"49223":38567,"49224":38568,"49225":38570,"49226":38613,"49227":38670,"49228":38673,"49229":38678,"49230":38669,"49231":38675,"49232":38671,"49233":38747,"49234":38748,"49235":38758,"49236":38808,"49237":38960,"49238":38968,"49239":38971,"49240":38967,"49241":38957,"49242":38969,"49243":38948,"49244":39184,"49245":39208,"49246":39198,"49247":39195,"49248":39201,"49249":39194,"49250":39405,"49251":39394,"49252":39409,"49253":39608,"49254":39612,"49255":39675,"49256":39661,"49257":39720,"49258":39825,"49259":40213,"49260":40227,"49261":40230,"49262":40232,"49263":40210,"49264":40219,"49265":40664,"49266":40660,"49267":40845,"49268":40860,"49269":20778,"49270":20767,"49271":20769,"49272":20786,"49273":21237,"49274":22158,"49275":22144,"49276":22160,"49277":22149,"49278":22151,"49313":22159,"49314":22741,"49315":22739,"49316":22737,"49317":22734,"49318":23344,"49319":23338,"49320":23332,"49321":23418,"49322":23607,"49323":23656,"49324":23996,"49325":23994,"49326":23997,"49327":23992,"49328":24171,"49329":24396,"49330":24509,"49331":25033,"49332":25026,"49333":25031,"49334":25062,"49335":25035,"49336":25138,"49337":25140,"49338":25806,"49339":25802,"49340":25816,"49341":25824,"49342":25840,"49343":25830,"49344":25836,"49345":25841,"49346":25826,"49347":25837,"49348":25986,"49349":25987,"49350":26329,"49351":26326,"49352":27264,"49353":27284,"49354":27268,"49355":27298,"49356":27292,"49357":27355,"49358":27299,"49359":27262,"49360":27287,"49361":27280,"49362":27296,"49363":27484,"49364":27566,"49365":27610,"49366":27656,"49367":28632,"49368":28657,"49369":28639,"49370":28640,"49371":28635,"49372":28644,"49373":28651,"49374":28655,"49375":28544,"49376":28652,"49377":28641,"49378":28649,"49379":28629,"49380":28654,"49381":28656,"49382":29159,"49383":29151,"49384":29166,"49385":29158,"49386":29157,"49387":29165,"49388":29164,"49389":29172,"49390":29152,"49391":29237,"49392":29254,"49393":29552,"49394":29554,"49395":29865,"49396":29872,"49397":29862,"49398":29864,"49399":30278,"49400":30274,"49401":30284,"49402":30442,"49403":30643,"49404":30634,"49405":30640,"49406":30636,"49472":30631,"49473":30637,"49474":30703,"49475":30967,"49476":30970,"49477":30964,"49478":30959,"49479":30977,"49480":31143,"49481":31146,"49482":31319,"49483":31423,"49484":31751,"49485":31757,"49486":31742,"49487":31735,"49488":31756,"49489":31712,"49490":31968,"49491":31964,"49492":31966,"49493":31970,"49494":31967,"49495":31961,"49496":31965,"49497":32302,"49498":32318,"49499":32326,"49500":32311,"49501":32306,"49502":32323,"49503":32299,"49504":32317,"49505":32305,"49506":32325,"49507":32321,"49508":32308,"49509":32313,"49510":32328,"49511":32309,"49512":32319,"49513":32303,"49514":32580,"49515":32755,"49516":32764,"49517":32881,"49518":32882,"49519":32880,"49520":32879,"49521":32883,"49522":33222,"49523":33219,"49524":33210,"49525":33218,"49526":33216,"49527":33215,"49528":33213,"49529":33225,"49530":33214,"49531":33256,"49532":33289,"49533":33393,"49534":34218,"49569":34180,"49570":34174,"49571":34204,"49572":34193,"49573":34196,"49574":34223,"49575":34203,"49576":34183,"49577":34216,"49578":34186,"49579":34407,"49580":34752,"49581":34769,"49582":34739,"49583":34770,"49584":34758,"49585":34731,"49586":34747,"49587":34746,"49588":34760,"49589":34763,"49590":35131,"49591":35126,"49592":35140,"49593":35128,"49594":35133,"49595":35244,"49596":35598,"49597":35607,"49598":35609,"49599":35611,"49600":35594,"49601":35616,"49602":35613,"49603":35588,"49604":35600,"49605":35905,"49606":35903,"49607":35955,"49608":36090,"49609":36093,"49610":36092,"49611":36088,"49612":36091,"49613":36264,"49614":36425,"49615":36427,"49616":36424,"49617":36426,"49618":36676,"49619":36670,"49620":36674,"49621":36677,"49622":36671,"49623":36991,"49624":36989,"49625":36996,"49626":36993,"49627":36994,"49628":36992,"49629":37177,"49630":37283,"49631":37278,"49632":37276,"49633":37709,"49634":37762,"49635":37672,"49636":37749,"49637":37706,"49638":37733,"49639":37707,"49640":37656,"49641":37758,"49642":37740,"49643":37723,"49644":37744,"49645":37722,"49646":37716,"49647":38346,"49648":38347,"49649":38348,"49650":38344,"49651":38342,"49652":38577,"49653":38584,"49654":38614,"49655":38684,"49656":38686,"49657":38816,"49658":38867,"49659":38982,"49660":39094,"49661":39221,"49662":39425,"49728":39423,"49729":39854,"49730":39851,"49731":39850,"49732":39853,"49733":40251,"49734":40255,"49735":40587,"49736":40655,"49737":40670,"49738":40668,"49739":40669,"49740":40667,"49741":40766,"49742":40779,"49743":21474,"49744":22165,"49745":22190,"49746":22745,"49747":22744,"49748":23352,"49749":24413,"49750":25059,"49751":25139,"49752":25844,"49753":25842,"49754":25854,"49755":25862,"49756":25850,"49757":25851,"49758":25847,"49759":26039,"49760":26332,"49761":26406,"49762":27315,"49763":27308,"49764":27331,"49765":27323,"49766":27320,"49767":27330,"49768":27310,"49769":27311,"49770":27487,"49771":27512,"49772":27567,"49773":28681,"49774":28683,"49775":28670,"49776":28678,"49777":28666,"49778":28689,"49779":28687,"49780":29179,"49781":29180,"49782":29182,"49783":29176,"49784":29559,"49785":29557,"49786":29863,"49787":29887,"49788":29973,"49789":30294,"49790":30296,"49825":30290,"49826":30653,"49827":30655,"49828":30651,"49829":30652,"49830":30990,"49831":31150,"49832":31329,"49833":31330,"49834":31328,"49835":31428,"49836":31429,"49837":31787,"49838":31783,"49839":31786,"49840":31774,"49841":31779,"49842":31777,"49843":31975,"49844":32340,"49845":32341,"49846":32350,"49847":32346,"49848":32353,"49849":32338,"49850":32345,"49851":32584,"49852":32761,"49853":32763,"49854":32887,"49855":32886,"49856":33229,"49857":33231,"49858":33290,"49859":34255,"49860":34217,"49861":34253,"49862":34256,"49863":34249,"49864":34224,"49865":34234,"49866":34233,"49867":34214,"49868":34799,"49869":34796,"49870":34802,"49871":34784,"49872":35206,"49873":35250,"49874":35316,"49875":35624,"49876":35641,"49877":35628,"49878":35627,"49879":35920,"49880":36101,"49881":36441,"49882":36451,"49883":36454,"49884":36452,"49885":36447,"49886":36437,"49887":36544,"49888":36681,"49889":36685,"49890":36999,"49891":36995,"49892":37000,"49893":37291,"49894":37292,"49895":37328,"49896":37780,"49897":37770,"49898":37782,"49899":37794,"49900":37811,"49901":37806,"49902":37804,"49903":37808,"49904":37784,"49905":37786,"49906":37783,"49907":38356,"49908":38358,"49909":38352,"49910":38357,"49911":38626,"49912":38620,"49913":38617,"49914":38619,"49915":38622,"49916":38692,"49917":38819,"49918":38822,"49984":38829,"49985":38905,"49986":38989,"49987":38991,"49988":38988,"49989":38990,"49990":38995,"49991":39098,"49992":39230,"49993":39231,"49994":39229,"49995":39214,"49996":39333,"49997":39438,"49998":39617,"49999":39683,"50000":39686,"50001":39759,"50002":39758,"50003":39757,"50004":39882,"50005":39881,"50006":39933,"50007":39880,"50008":39872,"50009":40273,"50010":40285,"50011":40288,"50012":40672,"50013":40725,"50014":40748,"50015":20787,"50016":22181,"50017":22750,"50018":22751,"50019":22754,"50020":23541,"50021":40848,"50022":24300,"50023":25074,"50024":25079,"50025":25078,"50026":25077,"50027":25856,"50028":25871,"50029":26336,"50030":26333,"50031":27365,"50032":27357,"50033":27354,"50034":27347,"50035":28699,"50036":28703,"50037":28712,"50038":28698,"50039":28701,"50040":28693,"50041":28696,"50042":29190,"50043":29197,"50044":29272,"50045":29346,"50046":29560,"50081":29562,"50082":29885,"50083":29898,"50084":29923,"50085":30087,"50086":30086,"50087":30303,"50088":30305,"50089":30663,"50090":31001,"50091":31153,"50092":31339,"50093":31337,"50094":31806,"50095":31807,"50096":31800,"50097":31805,"50098":31799,"50099":31808,"50100":32363,"50101":32365,"50102":32377,"50103":32361,"50104":32362,"50105":32645,"50106":32371,"50107":32694,"50108":32697,"50109":32696,"50110":33240,"50111":34281,"50112":34269,"50113":34282,"50114":34261,"50115":34276,"50116":34277,"50117":34295,"50118":34811,"50119":34821,"50120":34829,"50121":34809,"50122":34814,"50123":35168,"50124":35167,"50125":35158,"50126":35166,"50127":35649,"50128":35676,"50129":35672,"50130":35657,"50131":35674,"50132":35662,"50133":35663,"50134":35654,"50135":35673,"50136":36104,"50137":36106,"50138":36476,"50139":36466,"50140":36487,"50141":36470,"50142":36460,"50143":36474,"50144":36468,"50145":36692,"50146":36686,"50147":36781,"50148":37002,"50149":37003,"50150":37297,"50151":37294,"50152":37857,"50153":37841,"50154":37855,"50155":37827,"50156":37832,"50157":37852,"50158":37853,"50159":37846,"50160":37858,"50161":37837,"50162":37848,"50163":37860,"50164":37847,"50165":37864,"50166":38364,"50167":38580,"50168":38627,"50169":38698,"50170":38695,"50171":38753,"50172":38876,"50173":38907,"50174":39006,"50240":39000,"50241":39003,"50242":39100,"50243":39237,"50244":39241,"50245":39446,"50246":39449,"50247":39693,"50248":39912,"50249":39911,"50250":39894,"50251":39899,"50252":40329,"50253":40289,"50254":40306,"50255":40298,"50256":40300,"50257":40594,"50258":40599,"50259":40595,"50260":40628,"50261":21240,"50262":22184,"50263":22199,"50264":22198,"50265":22196,"50266":22204,"50267":22756,"50268":23360,"50269":23363,"50270":23421,"50271":23542,"50272":24009,"50273":25080,"50274":25082,"50275":25880,"50276":25876,"50277":25881,"50278":26342,"50279":26407,"50280":27372,"50281":28734,"50282":28720,"50283":28722,"50284":29200,"50285":29563,"50286":29903,"50287":30306,"50288":30309,"50289":31014,"50290":31018,"50291":31020,"50292":31019,"50293":31431,"50294":31478,"50295":31820,"50296":31811,"50297":31821,"50298":31983,"50299":31984,"50300":36782,"50301":32381,"50302":32380,"50337":32386,"50338":32588,"50339":32768,"50340":33242,"50341":33382,"50342":34299,"50343":34297,"50344":34321,"50345":34298,"50346":34310,"50347":34315,"50348":34311,"50349":34314,"50350":34836,"50351":34837,"50352":35172,"50353":35258,"50354":35320,"50355":35696,"50356":35692,"50357":35686,"50358":35695,"50359":35679,"50360":35691,"50361":36111,"50362":36109,"50363":36489,"50364":36481,"50365":36485,"50366":36482,"50367":37300,"50368":37323,"50369":37912,"50370":37891,"50371":37885,"50372":38369,"50373":38704,"50374":39108,"50375":39250,"50376":39249,"50377":39336,"50378":39467,"50379":39472,"50380":39479,"50381":39477,"50382":39955,"50383":39949,"50384":40569,"50385":40629,"50386":40680,"50387":40751,"50388":40799,"50389":40803,"50390":40801,"50391":20791,"50392":20792,"50393":22209,"50394":22208,"50395":22210,"50396":22804,"50397":23660,"50398":24013,"50399":25084,"50400":25086,"50401":25885,"50402":25884,"50403":26005,"50404":26345,"50405":27387,"50406":27396,"50407":27386,"50408":27570,"50409":28748,"50410":29211,"50411":29351,"50412":29910,"50413":29908,"50414":30313,"50415":30675,"50416":31824,"50417":32399,"50418":32396,"50419":32700,"50420":34327,"50421":34349,"50422":34330,"50423":34851,"50424":34850,"50425":34849,"50426":34847,"50427":35178,"50428":35180,"50429":35261,"50430":35700,"50496":35703,"50497":35709,"50498":36115,"50499":36490,"50500":36493,"50501":36491,"50502":36703,"50503":36783,"50504":37306,"50505":37934,"50506":37939,"50507":37941,"50508":37946,"50509":37944,"50510":37938,"50511":37931,"50512":38370,"50513":38712,"50514":38713,"50515":38706,"50516":38911,"50517":39015,"50518":39013,"50519":39255,"50520":39493,"50521":39491,"50522":39488,"50523":39486,"50524":39631,"50525":39764,"50526":39761,"50527":39981,"50528":39973,"50529":40367,"50530":40372,"50531":40386,"50532":40376,"50533":40605,"50534":40687,"50535":40729,"50536":40796,"50537":40806,"50538":40807,"50539":20796,"50540":20795,"50541":22216,"50542":22218,"50543":22217,"50544":23423,"50545":24020,"50546":24018,"50547":24398,"50548":25087,"50549":25892,"50550":27402,"50551":27489,"50552":28753,"50553":28760,"50554":29568,"50555":29924,"50556":30090,"50557":30318,"50558":30316,"50593":31155,"50594":31840,"50595":31839,"50596":32894,"50597":32893,"50598":33247,"50599":35186,"50600":35183,"50601":35324,"50602":35712,"50603":36118,"50604":36119,"50605":36497,"50606":36499,"50607":36705,"50608":37192,"50609":37956,"50610":37969,"50611":37970,"50612":38717,"50613":38718,"50614":38851,"50615":38849,"50616":39019,"50617":39253,"50618":39509,"50619":39501,"50620":39634,"50621":39706,"50622":40009,"50623":39985,"50624":39998,"50625":39995,"50626":40403,"50627":40407,"50628":40756,"50629":40812,"50630":40810,"50631":40852,"50632":22220,"50633":24022,"50634":25088,"50635":25891,"50636":25899,"50637":25898,"50638":26348,"50639":27408,"50640":29914,"50641":31434,"50642":31844,"50643":31843,"50644":31845,"50645":32403,"50646":32406,"50647":32404,"50648":33250,"50649":34360,"50650":34367,"50651":34865,"50652":35722,"50653":37008,"50654":37007,"50655":37987,"50656":37984,"50657":37988,"50658":38760,"50659":39023,"50660":39260,"50661":39514,"50662":39515,"50663":39511,"50664":39635,"50665":39636,"50666":39633,"50667":40020,"50668":40023,"50669":40022,"50670":40421,"50671":40607,"50672":40692,"50673":22225,"50674":22761,"50675":25900,"50676":28766,"50677":30321,"50678":30322,"50679":30679,"50680":32592,"50681":32648,"50682":34870,"50683":34873,"50684":34914,"50685":35731,"50686":35730,"50752":35734,"50753":33399,"50754":36123,"50755":37312,"50756":37994,"50757":38722,"50758":38728,"50759":38724,"50760":38854,"50761":39024,"50762":39519,"50763":39714,"50764":39768,"50765":40031,"50766":40441,"50767":40442,"50768":40572,"50769":40573,"50770":40711,"50771":40823,"50772":40818,"50773":24307,"50774":27414,"50775":28771,"50776":31852,"50777":31854,"50778":34875,"50779":35264,"50780":36513,"50781":37313,"50782":38002,"50783":38000,"50784":39025,"50785":39262,"50786":39638,"50787":39715,"50788":40652,"50789":28772,"50790":30682,"50791":35738,"50792":38007,"50793":38857,"50794":39522,"50795":39525,"50796":32412,"50797":35740,"50798":36522,"50799":37317,"50800":38013,"50801":38014,"50802":38012,"50803":40055,"50804":40056,"50805":40695,"50806":35924,"50807":38015,"50808":40474,"50809":29224,"50810":39530,"50811":39729,"50812":40475,"50813":40478,"50814":31858,"50849":9312,"50850":9313,"50851":9314,"50852":9315,"50853":9316,"50854":9317,"50855":9318,"50856":9319,"50857":9320,"50858":9321,"50859":9332,"50860":9333,"50861":9334,"50862":9335,"50863":9336,"50864":9337,"50865":9338,"50866":9339,"50867":9340,"50868":9341,"50869":8560,"50870":8561,"50871":8562,"50872":8563,"50873":8564,"50874":8565,"50875":8566,"50876":8567,"50877":8568,"50878":8569,"50879":20022,"50880":20031,"50881":20101,"50882":20128,"50883":20866,"50884":20886,"50885":20907,"50886":21241,"50887":21304,"50888":21353,"50889":21430,"50890":22794,"50891":23424,"50892":24027,"50893":24186,"50894":24191,"50895":24308,"50896":24400,"50897":24417,"50898":25908,"50899":26080,"50900":30098,"50901":30326,"50902":36789,"50903":38582,"50904":168,"50905":710,"50906":12541,"50907":12542,"50908":12445,"50909":12446,"50910":12291,"50911":20189,"50912":12293,"50913":12294,"50914":12295,"50915":12540,"50916":65339,"50917":65341,"50918":10045,"50919":12353,"50920":12354,"50921":12355,"50922":12356,"50923":12357,"50924":12358,"50925":12359,"50926":12360,"50927":12361,"50928":12362,"50929":12363,"50930":12364,"50931":12365,"50932":12366,"50933":12367,"50934":12368,"50935":12369,"50936":12370,"50937":12371,"50938":12372,"50939":12373,"50940":12374,"50941":12375,"50942":12376,"51008":12377,"51009":12378,"51010":12379,"51011":12380,"51012":12381,"51013":12382,"51014":12383,"51015":12384,"51016":12385,"51017":12386,"51018":12387,"51019":12388,"51020":12389,"51021":12390,"51022":12391,"51023":12392,"51024":12393,"51025":12394,"51026":12395,"51027":12396,"51028":12397,"51029":12398,"51030":12399,"51031":12400,"51032":12401,"51033":12402,"51034":12403,"51035":12404,"51036":12405,"51037":12406,"51038":12407,"51039":12408,"51040":12409,"51041":12410,"51042":12411,"51043":12412,"51044":12413,"51045":12414,"51046":12415,"51047":12416,"51048":12417,"51049":12418,"51050":12419,"51051":12420,"51052":12421,"51053":12422,"51054":12423,"51055":12424,"51056":12425,"51057":12426,"51058":12427,"51059":12428,"51060":12429,"51061":12430,"51062":12431,"51063":12432,"51064":12433,"51065":12434,"51066":12435,"51067":12449,"51068":12450,"51069":12451,"51070":12452,"51105":12453,"51106":12454,"51107":12455,"51108":12456,"51109":12457,"51110":12458,"51111":12459,"51112":12460,"51113":12461,"51114":12462,"51115":12463,"51116":12464,"51117":12465,"51118":12466,"51119":12467,"51120":12468,"51121":12469,"51122":12470,"51123":12471,"51124":12472,"51125":12473,"51126":12474,"51127":12475,"51128":12476,"51129":12477,"51130":12478,"51131":12479,"51132":12480,"51133":12481,"51134":12482,"51135":12483,"51136":12484,"51137":12485,"51138":12486,"51139":12487,"51140":12488,"51141":12489,"51142":12490,"51143":12491,"51144":12492,"51145":12493,"51146":12494,"51147":12495,"51148":12496,"51149":12497,"51150":12498,"51151":12499,"51152":12500,"51153":12501,"51154":12502,"51155":12503,"51156":12504,"51157":12505,"51158":12506,"51159":12507,"51160":12508,"51161":12509,"51162":12510,"51163":12511,"51164":12512,"51165":12513,"51166":12514,"51167":12515,"51168":12516,"51169":12517,"51170":12518,"51171":12519,"51172":12520,"51173":12521,"51174":12522,"51175":12523,"51176":12524,"51177":12525,"51178":12526,"51179":12527,"51180":12528,"51181":12529,"51182":12530,"51183":12531,"51184":12532,"51185":12533,"51186":12534,"51187":1040,"51188":1041,"51189":1042,"51190":1043,"51191":1044,"51192":1045,"51193":1025,"51194":1046,"51195":1047,"51196":1048,"51197":1049,"51198":1050,"51264":1051,"51265":1052,"51266":1053,"51267":1054,"51268":1055,"51269":1056,"51270":1057,"51271":1058,"51272":1059,"51273":1060,"51274":1061,"51275":1062,"51276":1063,"51277":1064,"51278":1065,"51279":1066,"51280":1067,"51281":1068,"51282":1069,"51283":1070,"51284":1071,"51285":1072,"51286":1073,"51287":1074,"51288":1075,"51289":1076,"51290":1077,"51291":1105,"51292":1078,"51293":1079,"51294":1080,"51295":1081,"51296":1082,"51297":1083,"51298":1084,"51299":1085,"51300":1086,"51301":1087,"51302":1088,"51303":1089,"51304":1090,"51305":1091,"51306":1092,"51307":1093,"51308":1094,"51309":1095,"51310":1096,"51311":1097,"51312":1098,"51313":1099,"51314":1100,"51315":1101,"51316":1102,"51317":1103,"51318":8679,"51319":8632,"51320":8633,"51321":12751,"51322":63462,"51323":20058,"51324":63464,"51325":20994,"51326":17553,"51361":40880,"51362":20872,"51363":40881,"51364":63470,"51365":63471,"51366":63472,"51367":63473,"51368":63474,"51369":63475,"51370":63476,"51371":63477,"51372":63478,"51373":63479,"51374":63480,"51375":63481,"51376":63482,"51377":12443,"51378":12444,"51379":12436,"51380":12535,"51381":12536,"51382":12537,"51383":12538,"51384":12539,"51385":65377,"51386":65378,"51387":65379,"51388":65380,"51389":65381,"51390":65382,"51391":65383,"51392":65384,"51393":65385,"51394":65386,"51395":65387,"51396":65388,"51397":65389,"51398":65390,"51399":65391,"51400":65392,"51401":65393,"51402":65394,"51403":65395,"51404":65396,"51405":65506,"51406":65508,"51407":65287,"51408":65282,"51409":12849,"51410":8470,"51411":8481,"51412":65397,"51413":65398,"51414":65399,"51415":65400,"51416":65401,"51417":65402,"51418":65403,"51419":65404,"51420":65405,"51421":65406,"51422":65407,"51423":65408,"51424":65409,"51425":65410,"51426":65411,"51427":65412,"51428":65413,"51429":65414,"51430":65415,"51431":65416,"51432":65417,"51433":65418,"51434":65419,"51435":65420,"51436":65421,"51437":65422,"51438":65423,"51439":65424,"51440":65425,"51441":65426,"51442":65427,"51443":65428,"51444":65429,"51445":65430,"51446":65431,"51447":65432,"51448":65433,"51449":65434,"51450":65435,"51451":65436,"51452":65437,"51453":65438,"51454":65439,"51520":20034,"51521":20060,"51522":20981,"51523":21274,"51524":21378,"51525":19975,"51526":19980,"51527":20039,"51528":20109,"51529":22231,"51530":64012,"51531":23662,"51532":24435,"51533":19983,"51534":20871,"51535":19982,"51536":20014,"51537":20115,"51538":20162,"51539":20169,"51540":20168,"51541":20888,"51542":21244,"51543":21356,"51544":21433,"51545":22304,"51546":22787,"51547":22828,"51548":23568,"51549":24063,"51550":26081,"51551":27571,"51552":27596,"51553":27668,"51554":29247,"51555":20017,"51556":20028,"51557":20200,"51558":20188,"51559":20201,"51560":20193,"51561":20189,"51562":20186,"51563":21004,"51564":21276,"51565":21324,"51566":22306,"51567":22307,"51568":22807,"51569":22831,"51570":23425,"51571":23428,"51572":23570,"51573":23611,"51574":23668,"51575":23667,"51576":24068,"51577":24192,"51578":24194,"51579":24521,"51580":25097,"51581":25168,"51582":27669,"51617":27702,"51618":27715,"51619":27711,"51620":27707,"51621":29358,"51622":29360,"51623":29578,"51624":31160,"51625":32906,"51626":38430,"51627":20238,"51628":20248,"51629":20268,"51630":20213,"51631":20244,"51632":20209,"51633":20224,"51634":20215,"51635":20232,"51636":20253,"51637":20226,"51638":20229,"51639":20258,"51640":20243,"51641":20228,"51642":20212,"51643":20242,"51644":20913,"51645":21011,"51646":21001,"51647":21008,"51648":21158,"51649":21282,"51650":21279,"51651":21325,"51652":21386,"51653":21511,"51654":22241,"51655":22239,"51656":22318,"51657":22314,"51658":22324,"51659":22844,"51660":22912,"51661":22908,"51662":22917,"51663":22907,"51664":22910,"51665":22903,"51666":22911,"51667":23382,"51668":23573,"51669":23589,"51670":23676,"51671":23674,"51672":23675,"51673":23678,"51674":24031,"51675":24181,"51676":24196,"51677":24322,"51678":24346,"51679":24436,"51680":24533,"51681":24532,"51682":24527,"51683":25180,"51684":25182,"51685":25188,"51686":25185,"51687":25190,"51688":25186,"51689":25177,"51690":25184,"51691":25178,"51692":25189,"51693":26095,"51694":26094,"51695":26430,"51696":26425,"51697":26424,"51698":26427,"51699":26426,"51700":26431,"51701":26428,"51702":26419,"51703":27672,"51704":27718,"51705":27730,"51706":27740,"51707":27727,"51708":27722,"51709":27732,"51710":27723,"51776":27724,"51777":28785,"51778":29278,"51779":29364,"51780":29365,"51781":29582,"51782":29994,"51783":30335,"51784":31349,"51785":32593,"51786":33400,"51787":33404,"51788":33408,"51789":33405,"51790":33407,"51791":34381,"51792":35198,"51793":37017,"51794":37015,"51795":37016,"51796":37019,"51797":37012,"51798":38434,"51799":38436,"51800":38432,"51801":38435,"51802":20310,"51803":20283,"51804":20322,"51805":20297,"51806":20307,"51807":20324,"51808":20286,"51809":20327,"51810":20306,"51811":20319,"51812":20289,"51813":20312,"51814":20269,"51815":20275,"51816":20287,"51817":20321,"51818":20879,"51819":20921,"51820":21020,"51821":21022,"51822":21025,"51823":21165,"51824":21166,"51825":21257,"51826":21347,"51827":21362,"51828":21390,"51829":21391,"51830":21552,"51831":21559,"51832":21546,"51833":21588,"51834":21573,"51835":21529,"51836":21532,"51837":21541,"51838":21528,"51873":21565,"51874":21583,"51875":21569,"51876":21544,"51877":21540,"51878":21575,"51879":22254,"51880":22247,"51881":22245,"51882":22337,"51883":22341,"51884":22348,"51885":22345,"51886":22347,"51887":22354,"51888":22790,"51889":22848,"51890":22950,"51891":22936,"51892":22944,"51893":22935,"51894":22926,"51895":22946,"51896":22928,"51897":22927,"51898":22951,"51899":22945,"51900":23438,"51901":23442,"51902":23592,"51903":23594,"51904":23693,"51905":23695,"51906":23688,"51907":23691,"51908":23689,"51909":23698,"51910":23690,"51911":23686,"51912":23699,"51913":23701,"51914":24032,"51915":24074,"51916":24078,"51917":24203,"51918":24201,"51919":24204,"51920":24200,"51921":24205,"51922":24325,"51923":24349,"51924":24440,"51925":24438,"51926":24530,"51927":24529,"51928":24528,"51929":24557,"51930":24552,"51931":24558,"51932":24563,"51933":24545,"51934":24548,"51935":24547,"51936":24570,"51937":24559,"51938":24567,"51939":24571,"51940":24576,"51941":24564,"51942":25146,"51943":25219,"51944":25228,"51945":25230,"51946":25231,"51947":25236,"51948":25223,"51949":25201,"51950":25211,"51951":25210,"51952":25200,"51953":25217,"51954":25224,"51955":25207,"51956":25213,"51957":25202,"51958":25204,"51959":25911,"51960":26096,"51961":26100,"51962":26099,"51963":26098,"51964":26101,"51965":26437,"51966":26439,"52032":26457,"52033":26453,"52034":26444,"52035":26440,"52036":26461,"52037":26445,"52038":26458,"52039":26443,"52040":27600,"52041":27673,"52042":27674,"52043":27768,"52044":27751,"52045":27755,"52046":27780,"52047":27787,"52048":27791,"52049":27761,"52050":27759,"52051":27753,"52052":27802,"52053":27757,"52054":27783,"52055":27797,"52056":27804,"52057":27750,"52058":27763,"52059":27749,"52060":27771,"52061":27790,"52062":28788,"52063":28794,"52064":29283,"52065":29375,"52066":29373,"52067":29379,"52068":29382,"52069":29377,"52070":29370,"52071":29381,"52072":29589,"52073":29591,"52074":29587,"52075":29588,"52076":29586,"52077":30010,"52078":30009,"52079":30100,"52080":30101,"52081":30337,"52082":31037,"52083":32820,"52084":32917,"52085":32921,"52086":32912,"52087":32914,"52088":32924,"52089":33424,"52090":33423,"52091":33413,"52092":33422,"52093":33425,"52094":33427,"52129":33418,"52130":33411,"52131":33412,"52132":35960,"52133":36809,"52134":36799,"52135":37023,"52136":37025,"52137":37029,"52138":37022,"52139":37031,"52140":37024,"52141":38448,"52142":38440,"52143":38447,"52144":38445,"52145":20019,"52146":20376,"52147":20348,"52148":20357,"52149":20349,"52150":20352,"52151":20359,"52152":20342,"52153":20340,"52154":20361,"52155":20356,"52156":20343,"52157":20300,"52158":20375,"52159":20330,"52160":20378,"52161":20345,"52162":20353,"52163":20344,"52164":20368,"52165":20380,"52166":20372,"52167":20382,"52168":20370,"52169":20354,"52170":20373,"52171":20331,"52172":20334,"52173":20894,"52174":20924,"52175":20926,"52176":21045,"52177":21042,"52178":21043,"52179":21062,"52180":21041,"52181":21180,"52182":21258,"52183":21259,"52184":21308,"52185":21394,"52186":21396,"52187":21639,"52188":21631,"52189":21633,"52190":21649,"52191":21634,"52192":21640,"52193":21611,"52194":21626,"52195":21630,"52196":21605,"52197":21612,"52198":21620,"52199":21606,"52200":21645,"52201":21615,"52202":21601,"52203":21600,"52204":21656,"52205":21603,"52206":21607,"52207":21604,"52208":22263,"52209":22265,"52210":22383,"52211":22386,"52212":22381,"52213":22379,"52214":22385,"52215":22384,"52216":22390,"52217":22400,"52218":22389,"52219":22395,"52220":22387,"52221":22388,"52222":22370,"52288":22376,"52289":22397,"52290":22796,"52291":22853,"52292":22965,"52293":22970,"52294":22991,"52295":22990,"52296":22962,"52297":22988,"52298":22977,"52299":22966,"52300":22972,"52301":22979,"52302":22998,"52303":22961,"52304":22973,"52305":22976,"52306":22984,"52307":22964,"52308":22983,"52309":23394,"52310":23397,"52311":23443,"52312":23445,"52313":23620,"52314":23623,"52315":23726,"52316":23716,"52317":23712,"52318":23733,"52319":23727,"52320":23720,"52321":23724,"52322":23711,"52323":23715,"52324":23725,"52325":23714,"52326":23722,"52327":23719,"52328":23709,"52329":23717,"52330":23734,"52331":23728,"52332":23718,"52333":24087,"52334":24084,"52335":24089,"52336":24360,"52337":24354,"52338":24355,"52339":24356,"52340":24404,"52341":24450,"52342":24446,"52343":24445,"52344":24542,"52345":24549,"52346":24621,"52347":24614,"52348":24601,"52349":24626,"52350":24587,"52385":24628,"52386":24586,"52387":24599,"52388":24627,"52389":24602,"52390":24606,"52391":24620,"52392":24610,"52393":24589,"52394":24592,"52395":24622,"52396":24595,"52397":24593,"52398":24588,"52399":24585,"52400":24604,"52401":25108,"52402":25149,"52403":25261,"52404":25268,"52405":25297,"52406":25278,"52407":25258,"52408":25270,"52409":25290,"52410":25262,"52411":25267,"52412":25263,"52413":25275,"52414":25257,"52415":25264,"52416":25272,"52417":25917,"52418":26024,"52419":26043,"52420":26121,"52421":26108,"52422":26116,"52423":26130,"52424":26120,"52425":26107,"52426":26115,"52427":26123,"52428":26125,"52429":26117,"52430":26109,"52431":26129,"52432":26128,"52433":26358,"52434":26378,"52435":26501,"52436":26476,"52437":26510,"52438":26514,"52439":26486,"52440":26491,"52441":26520,"52442":26502,"52443":26500,"52444":26484,"52445":26509,"52446":26508,"52447":26490,"52448":26527,"52449":26513,"52450":26521,"52451":26499,"52452":26493,"52453":26497,"52454":26488,"52455":26489,"52456":26516,"52457":27429,"52458":27520,"52459":27518,"52460":27614,"52461":27677,"52462":27795,"52463":27884,"52464":27883,"52465":27886,"52466":27865,"52467":27830,"52468":27860,"52469":27821,"52470":27879,"52471":27831,"52472":27856,"52473":27842,"52474":27834,"52475":27843,"52476":27846,"52477":27885,"52478":27890,"52544":27858,"52545":27869,"52546":27828,"52547":27786,"52548":27805,"52549":27776,"52550":27870,"52551":27840,"52552":27952,"52553":27853,"52554":27847,"52555":27824,"52556":27897,"52557":27855,"52558":27881,"52559":27857,"52560":28820,"52561":28824,"52562":28805,"52563":28819,"52564":28806,"52565":28804,"52566":28817,"52567":28822,"52568":28802,"52569":28826,"52570":28803,"52571":29290,"52572":29398,"52573":29387,"52574":29400,"52575":29385,"52576":29404,"52577":29394,"52578":29396,"52579":29402,"52580":29388,"52581":29393,"52582":29604,"52583":29601,"52584":29613,"52585":29606,"52586":29602,"52587":29600,"52588":29612,"52589":29597,"52590":29917,"52591":29928,"52592":30015,"52593":30016,"52594":30014,"52595":30092,"52596":30104,"52597":30383,"52598":30451,"52599":30449,"52600":30448,"52601":30453,"52602":30712,"52603":30716,"52604":30713,"52605":30715,"52606":30714,"52641":30711,"52642":31042,"52643":31039,"52644":31173,"52645":31352,"52646":31355,"52647":31483,"52648":31861,"52649":31997,"52650":32821,"52651":32911,"52652":32942,"52653":32931,"52654":32952,"52655":32949,"52656":32941,"52657":33312,"52658":33440,"52659":33472,"52660":33451,"52661":33434,"52662":33432,"52663":33435,"52664":33461,"52665":33447,"52666":33454,"52667":33468,"52668":33438,"52669":33466,"52670":33460,"52671":33448,"52672":33441,"52673":33449,"52674":33474,"52675":33444,"52676":33475,"52677":33462,"52678":33442,"52679":34416,"52680":34415,"52681":34413,"52682":34414,"52683":35926,"52684":36818,"52685":36811,"52686":36819,"52687":36813,"52688":36822,"52689":36821,"52690":36823,"52691":37042,"52692":37044,"52693":37039,"52694":37043,"52695":37040,"52696":38457,"52697":38461,"52698":38460,"52699":38458,"52700":38467,"52701":20429,"52702":20421,"52703":20435,"52704":20402,"52705":20425,"52706":20427,"52707":20417,"52708":20436,"52709":20444,"52710":20441,"52711":20411,"52712":20403,"52713":20443,"52714":20423,"52715":20438,"52716":20410,"52717":20416,"52718":20409,"52719":20460,"52720":21060,"52721":21065,"52722":21184,"52723":21186,"52724":21309,"52725":21372,"52726":21399,"52727":21398,"52728":21401,"52729":21400,"52730":21690,"52731":21665,"52732":21677,"52733":21669,"52734":21711,"52800":21699,"52801":33549,"52802":21687,"52803":21678,"52804":21718,"52805":21686,"52806":21701,"52807":21702,"52808":21664,"52809":21616,"52810":21692,"52811":21666,"52812":21694,"52813":21618,"52814":21726,"52815":21680,"52816":22453,"52817":22430,"52818":22431,"52819":22436,"52820":22412,"52821":22423,"52822":22429,"52823":22427,"52824":22420,"52825":22424,"52826":22415,"52827":22425,"52828":22437,"52829":22426,"52830":22421,"52831":22772,"52832":22797,"52833":22867,"52834":23009,"52835":23006,"52836":23022,"52837":23040,"52838":23025,"52839":23005,"52840":23034,"52841":23037,"52842":23036,"52843":23030,"52844":23012,"52845":23026,"52846":23031,"52847":23003,"52848":23017,"52849":23027,"52850":23029,"52851":23008,"52852":23038,"52853":23028,"52854":23021,"52855":23464,"52856":23628,"52857":23760,"52858":23768,"52859":23756,"52860":23767,"52861":23755,"52862":23771,"52897":23774,"52898":23770,"52899":23753,"52900":23751,"52901":23754,"52902":23766,"52903":23763,"52904":23764,"52905":23759,"52906":23752,"52907":23750,"52908":23758,"52909":23775,"52910":23800,"52911":24057,"52912":24097,"52913":24098,"52914":24099,"52915":24096,"52916":24100,"52917":24240,"52918":24228,"52919":24226,"52920":24219,"52921":24227,"52922":24229,"52923":24327,"52924":24366,"52925":24406,"52926":24454,"52927":24631,"52928":24633,"52929":24660,"52930":24690,"52931":24670,"52932":24645,"52933":24659,"52934":24647,"52935":24649,"52936":24667,"52937":24652,"52938":24640,"52939":24642,"52940":24671,"52941":24612,"52942":24644,"52943":24664,"52944":24678,"52945":24686,"52946":25154,"52947":25155,"52948":25295,"52949":25357,"52950":25355,"52951":25333,"52952":25358,"52953":25347,"52954":25323,"52955":25337,"52956":25359,"52957":25356,"52958":25336,"52959":25334,"52960":25344,"52961":25363,"52962":25364,"52963":25338,"52964":25365,"52965":25339,"52966":25328,"52967":25921,"52968":25923,"52969":26026,"52970":26047,"52971":26166,"52972":26145,"52973":26162,"52974":26165,"52975":26140,"52976":26150,"52977":26146,"52978":26163,"52979":26155,"52980":26170,"52981":26141,"52982":26164,"52983":26169,"52984":26158,"52985":26383,"52986":26384,"52987":26561,"52988":26610,"52989":26568,"52990":26554,"53056":26588,"53057":26555,"53058":26616,"53059":26584,"53060":26560,"53061":26551,"53062":26565,"53063":26603,"53064":26596,"53065":26591,"53066":26549,"53067":26573,"53068":26547,"53069":26615,"53070":26614,"53071":26606,"53072":26595,"53073":26562,"53074":26553,"53075":26574,"53076":26599,"53077":26608,"53078":26546,"53079":26620,"53080":26566,"53081":26605,"53082":26572,"53083":26542,"53084":26598,"53085":26587,"53086":26618,"53087":26569,"53088":26570,"53089":26563,"53090":26602,"53091":26571,"53092":27432,"53093":27522,"53094":27524,"53095":27574,"53096":27606,"53097":27608,"53098":27616,"53099":27680,"53100":27681,"53101":27944,"53102":27956,"53103":27949,"53104":27935,"53105":27964,"53106":27967,"53107":27922,"53108":27914,"53109":27866,"53110":27955,"53111":27908,"53112":27929,"53113":27962,"53114":27930,"53115":27921,"53116":27904,"53117":27933,"53118":27970,"53153":27905,"53154":27928,"53155":27959,"53156":27907,"53157":27919,"53158":27968,"53159":27911,"53160":27936,"53161":27948,"53162":27912,"53163":27938,"53164":27913,"53165":27920,"53166":28855,"53167":28831,"53168":28862,"53169":28849,"53170":28848,"53171":28833,"53172":28852,"53173":28853,"53174":28841,"53175":29249,"53176":29257,"53177":29258,"53178":29292,"53179":29296,"53180":29299,"53181":29294,"53182":29386,"53183":29412,"53184":29416,"53185":29419,"53186":29407,"53187":29418,"53188":29414,"53189":29411,"53190":29573,"53191":29644,"53192":29634,"53193":29640,"53194":29637,"53195":29625,"53196":29622,"53197":29621,"53198":29620,"53199":29675,"53200":29631,"53201":29639,"53202":29630,"53203":29635,"53204":29638,"53205":29624,"53206":29643,"53207":29932,"53208":29934,"53209":29998,"53210":30023,"53211":30024,"53212":30119,"53213":30122,"53214":30329,"53215":30404,"53216":30472,"53217":30467,"53218":30468,"53219":30469,"53220":30474,"53221":30455,"53222":30459,"53223":30458,"53224":30695,"53225":30696,"53226":30726,"53227":30737,"53228":30738,"53229":30725,"53230":30736,"53231":30735,"53232":30734,"53233":30729,"53234":30723,"53235":30739,"53236":31050,"53237":31052,"53238":31051,"53239":31045,"53240":31044,"53241":31189,"53242":31181,"53243":31183,"53244":31190,"53245":31182,"53246":31360,"53312":31358,"53313":31441,"53314":31488,"53315":31489,"53316":31866,"53317":31864,"53318":31865,"53319":31871,"53320":31872,"53321":31873,"53322":32003,"53323":32008,"53324":32001,"53325":32600,"53326":32657,"53327":32653,"53328":32702,"53329":32775,"53330":32782,"53331":32783,"53332":32788,"53333":32823,"53334":32984,"53335":32967,"53336":32992,"53337":32977,"53338":32968,"53339":32962,"53340":32976,"53341":32965,"53342":32995,"53343":32985,"53344":32988,"53345":32970,"53346":32981,"53347":32969,"53348":32975,"53349":32983,"53350":32998,"53351":32973,"53352":33279,"53353":33313,"53354":33428,"53355":33497,"53356":33534,"53357":33529,"53358":33543,"53359":33512,"53360":33536,"53361":33493,"53362":33594,"53363":33515,"53364":33494,"53365":33524,"53366":33516,"53367":33505,"53368":33522,"53369":33525,"53370":33548,"53371":33531,"53372":33526,"53373":33520,"53374":33514,"53409":33508,"53410":33504,"53411":33530,"53412":33523,"53413":33517,"53414":34423,"53415":34420,"53416":34428,"53417":34419,"53418":34881,"53419":34894,"53420":34919,"53421":34922,"53422":34921,"53423":35283,"53424":35332,"53425":35335,"53426":36210,"53427":36835,"53428":36833,"53429":36846,"53430":36832,"53431":37105,"53432":37053,"53433":37055,"53434":37077,"53435":37061,"53436":37054,"53437":37063,"53438":37067,"53439":37064,"53440":37332,"53441":37331,"53442":38484,"53443":38479,"53444":38481,"53445":38483,"53446":38474,"53447":38478,"53448":20510,"53449":20485,"53450":20487,"53451":20499,"53452":20514,"53453":20528,"53454":20507,"53455":20469,"53456":20468,"53457":20531,"53458":20535,"53459":20524,"53460":20470,"53461":20471,"53462":20503,"53463":20508,"53464":20512,"53465":20519,"53466":20533,"53467":20527,"53468":20529,"53469":20494,"53470":20826,"53471":20884,"53472":20883,"53473":20938,"53474":20932,"53475":20933,"53476":20936,"53477":20942,"53478":21089,"53479":21082,"53480":21074,"53481":21086,"53482":21087,"53483":21077,"53484":21090,"53485":21197,"53486":21262,"53487":21406,"53488":21798,"53489":21730,"53490":21783,"53491":21778,"53492":21735,"53493":21747,"53494":21732,"53495":21786,"53496":21759,"53497":21764,"53498":21768,"53499":21739,"53500":21777,"53501":21765,"53502":21745,"53568":21770,"53569":21755,"53570":21751,"53571":21752,"53572":21728,"53573":21774,"53574":21763,"53575":21771,"53576":22273,"53577":22274,"53578":22476,"53579":22578,"53580":22485,"53581":22482,"53582":22458,"53583":22470,"53584":22461,"53585":22460,"53586":22456,"53587":22454,"53588":22463,"53589":22471,"53590":22480,"53591":22457,"53592":22465,"53593":22798,"53594":22858,"53595":23065,"53596":23062,"53597":23085,"53598":23086,"53599":23061,"53600":23055,"53601":23063,"53602":23050,"53603":23070,"53604":23091,"53605":23404,"53606":23463,"53607":23469,"53608":23468,"53609":23555,"53610":23638,"53611":23636,"53612":23788,"53613":23807,"53614":23790,"53615":23793,"53616":23799,"53617":23808,"53618":23801,"53619":24105,"53620":24104,"53621":24232,"53622":24238,"53623":24234,"53624":24236,"53625":24371,"53626":24368,"53627":24423,"53628":24669,"53629":24666,"53630":24679,"53665":24641,"53666":24738,"53667":24712,"53668":24704,"53669":24722,"53670":24705,"53671":24733,"53672":24707,"53673":24725,"53674":24731,"53675":24727,"53676":24711,"53677":24732,"53678":24718,"53679":25113,"53680":25158,"53681":25330,"53682":25360,"53683":25430,"53684":25388,"53685":25412,"53686":25413,"53687":25398,"53688":25411,"53689":25572,"53690":25401,"53691":25419,"53692":25418,"53693":25404,"53694":25385,"53695":25409,"53696":25396,"53697":25432,"53698":25428,"53699":25433,"53700":25389,"53701":25415,"53702":25395,"53703":25434,"53704":25425,"53705":25400,"53706":25431,"53707":25408,"53708":25416,"53709":25930,"53710":25926,"53711":26054,"53712":26051,"53713":26052,"53714":26050,"53715":26186,"53716":26207,"53717":26183,"53718":26193,"53719":26386,"53720":26387,"53721":26655,"53722":26650,"53723":26697,"53724":26674,"53725":26675,"53726":26683,"53727":26699,"53728":26703,"53729":26646,"53730":26673,"53731":26652,"53732":26677,"53733":26667,"53734":26669,"53735":26671,"53736":26702,"53737":26692,"53738":26676,"53739":26653,"53740":26642,"53741":26644,"53742":26662,"53743":26664,"53744":26670,"53745":26701,"53746":26682,"53747":26661,"53748":26656,"53749":27436,"53750":27439,"53751":27437,"53752":27441,"53753":27444,"53754":27501,"53755":32898,"53756":27528,"53757":27622,"53758":27620,"53824":27624,"53825":27619,"53826":27618,"53827":27623,"53828":27685,"53829":28026,"53830":28003,"53831":28004,"53832":28022,"53833":27917,"53834":28001,"53835":28050,"53836":27992,"53837":28002,"53838":28013,"53839":28015,"53840":28049,"53841":28045,"53842":28143,"53843":28031,"53844":28038,"53845":27998,"53846":28007,"53847":28000,"53848":28055,"53849":28016,"53850":28028,"53851":27999,"53852":28034,"53853":28056,"53854":27951,"53855":28008,"53856":28043,"53857":28030,"53858":28032,"53859":28036,"53860":27926,"53861":28035,"53862":28027,"53863":28029,"53864":28021,"53865":28048,"53866":28892,"53867":28883,"53868":28881,"53869":28893,"53870":28875,"53871":32569,"53872":28898,"53873":28887,"53874":28882,"53875":28894,"53876":28896,"53877":28884,"53878":28877,"53879":28869,"53880":28870,"53881":28871,"53882":28890,"53883":28878,"53884":28897,"53885":29250,"53886":29304,"53921":29303,"53922":29302,"53923":29440,"53924":29434,"53925":29428,"53926":29438,"53927":29430,"53928":29427,"53929":29435,"53930":29441,"53931":29651,"53932":29657,"53933":29669,"53934":29654,"53935":29628,"53936":29671,"53937":29667,"53938":29673,"53939":29660,"53940":29650,"53941":29659,"53942":29652,"53943":29661,"53944":29658,"53945":29655,"53946":29656,"53947":29672,"53948":29918,"53949":29919,"53950":29940,"53951":29941,"53952":29985,"53953":30043,"53954":30047,"53955":30128,"53956":30145,"53957":30139,"53958":30148,"53959":30144,"53960":30143,"53961":30134,"53962":30138,"53963":30346,"53964":30409,"53965":30493,"53966":30491,"53967":30480,"53968":30483,"53969":30482,"53970":30499,"53971":30481,"53972":30485,"53973":30489,"53974":30490,"53975":30498,"53976":30503,"53977":30755,"53978":30764,"53979":30754,"53980":30773,"53981":30767,"53982":30760,"53983":30766,"53984":30763,"53985":30753,"53986":30761,"53987":30771,"53988":30762,"53989":30769,"53990":31060,"53991":31067,"53992":31055,"53993":31068,"53994":31059,"53995":31058,"53996":31057,"53997":31211,"53998":31212,"53999":31200,"54000":31214,"54001":31213,"54002":31210,"54003":31196,"54004":31198,"54005":31197,"54006":31366,"54007":31369,"54008":31365,"54009":31371,"54010":31372,"54011":31370,"54012":31367,"54013":31448,"54014":31504,"54080":31492,"54081":31507,"54082":31493,"54083":31503,"54084":31496,"54085":31498,"54086":31502,"54087":31497,"54088":31506,"54089":31876,"54090":31889,"54091":31882,"54092":31884,"54093":31880,"54094":31885,"54095":31877,"54096":32030,"54097":32029,"54098":32017,"54099":32014,"54100":32024,"54101":32022,"54102":32019,"54103":32031,"54104":32018,"54105":32015,"54106":32012,"54107":32604,"54108":32609,"54109":32606,"54110":32608,"54111":32605,"54112":32603,"54113":32662,"54114":32658,"54115":32707,"54116":32706,"54117":32704,"54118":32790,"54119":32830,"54120":32825,"54121":33018,"54122":33010,"54123":33017,"54124":33013,"54125":33025,"54126":33019,"54127":33024,"54128":33281,"54129":33327,"54130":33317,"54131":33587,"54132":33581,"54133":33604,"54134":33561,"54135":33617,"54136":33573,"54137":33622,"54138":33599,"54139":33601,"54140":33574,"54141":33564,"54142":33570,"54177":33602,"54178":33614,"54179":33563,"54180":33578,"54181":33544,"54182":33596,"54183":33613,"54184":33558,"54185":33572,"54186":33568,"54187":33591,"54188":33583,"54189":33577,"54190":33607,"54191":33605,"54192":33612,"54193":33619,"54194":33566,"54195":33580,"54196":33611,"54197":33575,"54198":33608,"54199":34387,"54200":34386,"54201":34466,"54202":34472,"54203":34454,"54204":34445,"54205":34449,"54206":34462,"54207":34439,"54208":34455,"54209":34438,"54210":34443,"54211":34458,"54212":34437,"54213":34469,"54214":34457,"54215":34465,"54216":34471,"54217":34453,"54218":34456,"54219":34446,"54220":34461,"54221":34448,"54222":34452,"54223":34883,"54224":34884,"54225":34925,"54226":34933,"54227":34934,"54228":34930,"54229":34944,"54230":34929,"54231":34943,"54232":34927,"54233":34947,"54234":34942,"54235":34932,"54236":34940,"54237":35346,"54238":35911,"54239":35927,"54240":35963,"54241":36004,"54242":36003,"54243":36214,"54244":36216,"54245":36277,"54246":36279,"54247":36278,"54248":36561,"54249":36563,"54250":36862,"54251":36853,"54252":36866,"54253":36863,"54254":36859,"54255":36868,"54256":36860,"54257":36854,"54258":37078,"54259":37088,"54260":37081,"54261":37082,"54262":37091,"54263":37087,"54264":37093,"54265":37080,"54266":37083,"54267":37079,"54268":37084,"54269":37092,"54270":37200,"54336":37198,"54337":37199,"54338":37333,"54339":37346,"54340":37338,"54341":38492,"54342":38495,"54343":38588,"54344":39139,"54345":39647,"54346":39727,"54347":20095,"54348":20592,"54349":20586,"54350":20577,"54351":20574,"54352":20576,"54353":20563,"54354":20555,"54355":20573,"54356":20594,"54357":20552,"54358":20557,"54359":20545,"54360":20571,"54361":20554,"54362":20578,"54363":20501,"54364":20549,"54365":20575,"54366":20585,"54367":20587,"54368":20579,"54369":20580,"54370":20550,"54371":20544,"54372":20590,"54373":20595,"54374":20567,"54375":20561,"54376":20944,"54377":21099,"54378":21101,"54379":21100,"54380":21102,"54381":21206,"54382":21203,"54383":21293,"54384":21404,"54385":21877,"54386":21878,"54387":21820,"54388":21837,"54389":21840,"54390":21812,"54391":21802,"54392":21841,"54393":21858,"54394":21814,"54395":21813,"54396":21808,"54397":21842,"54398":21829,"54433":21772,"54434":21810,"54435":21861,"54436":21838,"54437":21817,"54438":21832,"54439":21805,"54440":21819,"54441":21824,"54442":21835,"54443":22282,"54444":22279,"54445":22523,"54446":22548,"54447":22498,"54448":22518,"54449":22492,"54450":22516,"54451":22528,"54452":22509,"54453":22525,"54454":22536,"54455":22520,"54456":22539,"54457":22515,"54458":22479,"54459":22535,"54460":22510,"54461":22499,"54462":22514,"54463":22501,"54464":22508,"54465":22497,"54466":22542,"54467":22524,"54468":22544,"54469":22503,"54470":22529,"54471":22540,"54472":22513,"54473":22505,"54474":22512,"54475":22541,"54476":22532,"54477":22876,"54478":23136,"54479":23128,"54480":23125,"54481":23143,"54482":23134,"54483":23096,"54484":23093,"54485":23149,"54486":23120,"54487":23135,"54488":23141,"54489":23148,"54490":23123,"54491":23140,"54492":23127,"54493":23107,"54494":23133,"54495":23122,"54496":23108,"54497":23131,"54498":23112,"54499":23182,"54500":23102,"54501":23117,"54502":23097,"54503":23116,"54504":23152,"54505":23145,"54506":23111,"54507":23121,"54508":23126,"54509":23106,"54510":23132,"54511":23410,"54512":23406,"54513":23489,"54514":23488,"54515":23641,"54516":23838,"54517":23819,"54518":23837,"54519":23834,"54520":23840,"54521":23820,"54522":23848,"54523":23821,"54524":23846,"54525":23845,"54526":23823,"54592":23856,"54593":23826,"54594":23843,"54595":23839,"54596":23854,"54597":24126,"54598":24116,"54599":24241,"54600":24244,"54601":24249,"54602":24242,"54603":24243,"54604":24374,"54605":24376,"54606":24475,"54607":24470,"54608":24479,"54609":24714,"54610":24720,"54611":24710,"54612":24766,"54613":24752,"54614":24762,"54615":24787,"54616":24788,"54617":24783,"54618":24804,"54619":24793,"54620":24797,"54621":24776,"54622":24753,"54623":24795,"54624":24759,"54625":24778,"54626":24767,"54627":24771,"54628":24781,"54629":24768,"54630":25394,"54631":25445,"54632":25482,"54633":25474,"54634":25469,"54635":25533,"54636":25502,"54637":25517,"54638":25501,"54639":25495,"54640":25515,"54641":25486,"54642":25455,"54643":25479,"54644":25488,"54645":25454,"54646":25519,"54647":25461,"54648":25500,"54649":25453,"54650":25518,"54651":25468,"54652":25508,"54653":25403,"54654":25503,"54689":25464,"54690":25477,"54691":25473,"54692":25489,"54693":25485,"54694":25456,"54695":25939,"54696":26061,"54697":26213,"54698":26209,"54699":26203,"54700":26201,"54701":26204,"54702":26210,"54703":26392,"54704":26745,"54705":26759,"54706":26768,"54707":26780,"54708":26733,"54709":26734,"54710":26798,"54711":26795,"54712":26966,"54713":26735,"54714":26787,"54715":26796,"54716":26793,"54717":26741,"54718":26740,"54719":26802,"54720":26767,"54721":26743,"54722":26770,"54723":26748,"54724":26731,"54725":26738,"54726":26794,"54727":26752,"54728":26737,"54729":26750,"54730":26779,"54731":26774,"54732":26763,"54733":26784,"54734":26761,"54735":26788,"54736":26744,"54737":26747,"54738":26769,"54739":26764,"54740":26762,"54741":26749,"54742":27446,"54743":27443,"54744":27447,"54745":27448,"54746":27537,"54747":27535,"54748":27533,"54749":27534,"54750":27532,"54751":27690,"54752":28096,"54753":28075,"54754":28084,"54755":28083,"54756":28276,"54757":28076,"54758":28137,"54759":28130,"54760":28087,"54761":28150,"54762":28116,"54763":28160,"54764":28104,"54765":28128,"54766":28127,"54767":28118,"54768":28094,"54769":28133,"54770":28124,"54771":28125,"54772":28123,"54773":28148,"54774":28106,"54775":28093,"54776":28141,"54777":28144,"54778":28090,"54779":28117,"54780":28098,"54781":28111,"54782":28105,"54848":28112,"54849":28146,"54850":28115,"54851":28157,"54852":28119,"54853":28109,"54854":28131,"54855":28091,"54856":28922,"54857":28941,"54858":28919,"54859":28951,"54860":28916,"54861":28940,"54862":28912,"54863":28932,"54864":28915,"54865":28944,"54866":28924,"54867":28927,"54868":28934,"54869":28947,"54870":28928,"54871":28920,"54872":28918,"54873":28939,"54874":28930,"54875":28942,"54876":29310,"54877":29307,"54878":29308,"54879":29311,"54880":29469,"54881":29463,"54882":29447,"54883":29457,"54884":29464,"54885":29450,"54886":29448,"54887":29439,"54888":29455,"54889":29470,"54890":29576,"54891":29686,"54892":29688,"54893":29685,"54894":29700,"54895":29697,"54896":29693,"54897":29703,"54898":29696,"54899":29690,"54900":29692,"54901":29695,"54902":29708,"54903":29707,"54904":29684,"54905":29704,"54906":30052,"54907":30051,"54908":30158,"54909":30162,"54910":30159,"54945":30155,"54946":30156,"54947":30161,"54948":30160,"54949":30351,"54950":30345,"54951":30419,"54952":30521,"54953":30511,"54954":30509,"54955":30513,"54956":30514,"54957":30516,"54958":30515,"54959":30525,"54960":30501,"54961":30523,"54962":30517,"54963":30792,"54964":30802,"54965":30793,"54966":30797,"54967":30794,"54968":30796,"54969":30758,"54970":30789,"54971":30800,"54972":31076,"54973":31079,"54974":31081,"54975":31082,"54976":31075,"54977":31083,"54978":31073,"54979":31163,"54980":31226,"54981":31224,"54982":31222,"54983":31223,"54984":31375,"54985":31380,"54986":31376,"54987":31541,"54988":31559,"54989":31540,"54990":31525,"54991":31536,"54992":31522,"54993":31524,"54994":31539,"54995":31512,"54996":31530,"54997":31517,"54998":31537,"54999":31531,"55000":31533,"55001":31535,"55002":31538,"55003":31544,"55004":31514,"55005":31523,"55006":31892,"55007":31896,"55008":31894,"55009":31907,"55010":32053,"55011":32061,"55012":32056,"55013":32054,"55014":32058,"55015":32069,"55016":32044,"55017":32041,"55018":32065,"55019":32071,"55020":32062,"55021":32063,"55022":32074,"55023":32059,"55024":32040,"55025":32611,"55026":32661,"55027":32668,"55028":32669,"55029":32667,"55030":32714,"55031":32715,"55032":32717,"55033":32720,"55034":32721,"55035":32711,"55036":32719,"55037":32713,"55038":32799,"55104":32798,"55105":32795,"55106":32839,"55107":32835,"55108":32840,"55109":33048,"55110":33061,"55111":33049,"55112":33051,"55113":33069,"55114":33055,"55115":33068,"55116":33054,"55117":33057,"55118":33045,"55119":33063,"55120":33053,"55121":33058,"55122":33297,"55123":33336,"55124":33331,"55125":33338,"55126":33332,"55127":33330,"55128":33396,"55129":33680,"55130":33699,"55131":33704,"55132":33677,"55133":33658,"55134":33651,"55135":33700,"55136":33652,"55137":33679,"55138":33665,"55139":33685,"55140":33689,"55141":33653,"55142":33684,"55143":33705,"55144":33661,"55145":33667,"55146":33676,"55147":33693,"55148":33691,"55149":33706,"55150":33675,"55151":33662,"55152":33701,"55153":33711,"55154":33672,"55155":33687,"55156":33712,"55157":33663,"55158":33702,"55159":33671,"55160":33710,"55161":33654,"55162":33690,"55163":34393,"55164":34390,"55165":34495,"55166":34487,"55201":34498,"55202":34497,"55203":34501,"55204":34490,"55205":34480,"55206":34504,"55207":34489,"55208":34483,"55209":34488,"55210":34508,"55211":34484,"55212":34491,"55213":34492,"55214":34499,"55215":34493,"55216":34494,"55217":34898,"55218":34953,"55219":34965,"55220":34984,"55221":34978,"55222":34986,"55223":34970,"55224":34961,"55225":34977,"55226":34975,"55227":34968,"55228":34983,"55229":34969,"55230":34971,"55231":34967,"55232":34980,"55233":34988,"55234":34956,"55235":34963,"55236":34958,"55237":35202,"55238":35286,"55239":35289,"55240":35285,"55241":35376,"55242":35367,"55243":35372,"55244":35358,"55245":35897,"55246":35899,"55247":35932,"55248":35933,"55249":35965,"55250":36005,"55251":36221,"55252":36219,"55253":36217,"55254":36284,"55255":36290,"55256":36281,"55257":36287,"55258":36289,"55259":36568,"55260":36574,"55261":36573,"55262":36572,"55263":36567,"55264":36576,"55265":36577,"55266":36900,"55267":36875,"55268":36881,"55269":36892,"55270":36876,"55271":36897,"55272":37103,"55273":37098,"55274":37104,"55275":37108,"55276":37106,"55277":37107,"55278":37076,"55279":37099,"55280":37100,"55281":37097,"55282":37206,"55283":37208,"55284":37210,"55285":37203,"55286":37205,"55287":37356,"55288":37364,"55289":37361,"55290":37363,"55291":37368,"55292":37348,"55293":37369,"55294":37354,"55360":37355,"55361":37367,"55362":37352,"55363":37358,"55364":38266,"55365":38278,"55366":38280,"55367":38524,"55368":38509,"55369":38507,"55370":38513,"55371":38511,"55372":38591,"55373":38762,"55374":38916,"55375":39141,"55376":39319,"55377":20635,"55378":20629,"55379":20628,"55380":20638,"55381":20619,"55382":20643,"55383":20611,"55384":20620,"55385":20622,"55386":20637,"55387":20584,"55388":20636,"55389":20626,"55390":20610,"55391":20615,"55392":20831,"55393":20948,"55394":21266,"55395":21265,"55396":21412,"55397":21415,"55398":21905,"55399":21928,"55400":21925,"55401":21933,"55402":21879,"55403":22085,"55404":21922,"55405":21907,"55406":21896,"55407":21903,"55408":21941,"55409":21889,"55410":21923,"55411":21906,"55412":21924,"55413":21885,"55414":21900,"55415":21926,"55416":21887,"55417":21909,"55418":21921,"55419":21902,"55420":22284,"55421":22569,"55422":22583,"55457":22553,"55458":22558,"55459":22567,"55460":22563,"55461":22568,"55462":22517,"55463":22600,"55464":22565,"55465":22556,"55466":22555,"55467":22579,"55468":22591,"55469":22582,"55470":22574,"55471":22585,"55472":22584,"55473":22573,"55474":22572,"55475":22587,"55476":22881,"55477":23215,"55478":23188,"55479":23199,"55480":23162,"55481":23202,"55482":23198,"55483":23160,"55484":23206,"55485":23164,"55486":23205,"55487":23212,"55488":23189,"55489":23214,"55490":23095,"55491":23172,"55492":23178,"55493":23191,"55494":23171,"55495":23179,"55496":23209,"55497":23163,"55498":23165,"55499":23180,"55500":23196,"55501":23183,"55502":23187,"55503":23197,"55504":23530,"55505":23501,"55506":23499,"55507":23508,"55508":23505,"55509":23498,"55510":23502,"55511":23564,"55512":23600,"55513":23863,"55514":23875,"55515":23915,"55516":23873,"55517":23883,"55518":23871,"55519":23861,"55520":23889,"55521":23886,"55522":23893,"55523":23859,"55524":23866,"55525":23890,"55526":23869,"55527":23857,"55528":23897,"55529":23874,"55530":23865,"55531":23881,"55532":23864,"55533":23868,"55534":23858,"55535":23862,"55536":23872,"55537":23877,"55538":24132,"55539":24129,"55540":24408,"55541":24486,"55542":24485,"55543":24491,"55544":24777,"55545":24761,"55546":24780,"55547":24802,"55548":24782,"55549":24772,"55550":24852,"55616":24818,"55617":24842,"55618":24854,"55619":24837,"55620":24821,"55621":24851,"55622":24824,"55623":24828,"55624":24830,"55625":24769,"55626":24835,"55627":24856,"55628":24861,"55629":24848,"55630":24831,"55631":24836,"55632":24843,"55633":25162,"55634":25492,"55635":25521,"55636":25520,"55637":25550,"55638":25573,"55639":25576,"55640":25583,"55641":25539,"55642":25757,"55643":25587,"55644":25546,"55645":25568,"55646":25590,"55647":25557,"55648":25586,"55649":25589,"55650":25697,"55651":25567,"55652":25534,"55653":25565,"55654":25564,"55655":25540,"55656":25560,"55657":25555,"55658":25538,"55659":25543,"55660":25548,"55661":25547,"55662":25544,"55663":25584,"55664":25559,"55665":25561,"55666":25906,"55667":25959,"55668":25962,"55669":25956,"55670":25948,"55671":25960,"55672":25957,"55673":25996,"55674":26013,"55675":26014,"55676":26030,"55677":26064,"55678":26066,"55713":26236,"55714":26220,"55715":26235,"55716":26240,"55717":26225,"55718":26233,"55719":26218,"55720":26226,"55721":26369,"55722":26892,"55723":26835,"55724":26884,"55725":26844,"55726":26922,"55727":26860,"55728":26858,"55729":26865,"55730":26895,"55731":26838,"55732":26871,"55733":26859,"55734":26852,"55735":26870,"55736":26899,"55737":26896,"55738":26867,"55739":26849,"55740":26887,"55741":26828,"55742":26888,"55743":26992,"55744":26804,"55745":26897,"55746":26863,"55747":26822,"55748":26900,"55749":26872,"55750":26832,"55751":26877,"55752":26876,"55753":26856,"55754":26891,"55755":26890,"55756":26903,"55757":26830,"55758":26824,"55759":26845,"55760":26846,"55761":26854,"55762":26868,"55763":26833,"55764":26886,"55765":26836,"55766":26857,"55767":26901,"55768":26917,"55769":26823,"55770":27449,"55771":27451,"55772":27455,"55773":27452,"55774":27540,"55775":27543,"55776":27545,"55777":27541,"55778":27581,"55779":27632,"55780":27634,"55781":27635,"55782":27696,"55783":28156,"55784":28230,"55785":28231,"55786":28191,"55787":28233,"55788":28296,"55789":28220,"55790":28221,"55791":28229,"55792":28258,"55793":28203,"55794":28223,"55795":28225,"55796":28253,"55797":28275,"55798":28188,"55799":28211,"55800":28235,"55801":28224,"55802":28241,"55803":28219,"55804":28163,"55805":28206,"55806":28254,"55872":28264,"55873":28252,"55874":28257,"55875":28209,"55876":28200,"55877":28256,"55878":28273,"55879":28267,"55880":28217,"55881":28194,"55882":28208,"55883":28243,"55884":28261,"55885":28199,"55886":28280,"55887":28260,"55888":28279,"55889":28245,"55890":28281,"55891":28242,"55892":28262,"55893":28213,"55894":28214,"55895":28250,"55896":28960,"55897":28958,"55898":28975,"55899":28923,"55900":28974,"55901":28977,"55902":28963,"55903":28965,"55904":28962,"55905":28978,"55906":28959,"55907":28968,"55908":28986,"55909":28955,"55910":29259,"55911":29274,"55912":29320,"55913":29321,"55914":29318,"55915":29317,"55916":29323,"55917":29458,"55918":29451,"55919":29488,"55920":29474,"55921":29489,"55922":29491,"55923":29479,"55924":29490,"55925":29485,"55926":29478,"55927":29475,"55928":29493,"55929":29452,"55930":29742,"55931":29740,"55932":29744,"55933":29739,"55934":29718,"55969":29722,"55970":29729,"55971":29741,"55972":29745,"55973":29732,"55974":29731,"55975":29725,"55976":29737,"55977":29728,"55978":29746,"55979":29947,"55980":29999,"55981":30063,"55982":30060,"55983":30183,"55984":30170,"55985":30177,"55986":30182,"55987":30173,"55988":30175,"55989":30180,"55990":30167,"55991":30357,"55992":30354,"55993":30426,"55994":30534,"55995":30535,"55996":30532,"55997":30541,"55998":30533,"55999":30538,"56000":30542,"56001":30539,"56002":30540,"56003":30686,"56004":30700,"56005":30816,"56006":30820,"56007":30821,"56008":30812,"56009":30829,"56010":30833,"56011":30826,"56012":30830,"56013":30832,"56014":30825,"56015":30824,"56016":30814,"56017":30818,"56018":31092,"56019":31091,"56020":31090,"56021":31088,"56022":31234,"56023":31242,"56024":31235,"56025":31244,"56026":31236,"56027":31385,"56028":31462,"56029":31460,"56030":31562,"56031":31547,"56032":31556,"56033":31560,"56034":31564,"56035":31566,"56036":31552,"56037":31576,"56038":31557,"56039":31906,"56040":31902,"56041":31912,"56042":31905,"56043":32088,"56044":32111,"56045":32099,"56046":32083,"56047":32086,"56048":32103,"56049":32106,"56050":32079,"56051":32109,"56052":32092,"56053":32107,"56054":32082,"56055":32084,"56056":32105,"56057":32081,"56058":32095,"56059":32078,"56060":32574,"56061":32575,"56062":32613,"56128":32614,"56129":32674,"56130":32672,"56131":32673,"56132":32727,"56133":32849,"56134":32847,"56135":32848,"56136":33022,"56137":32980,"56138":33091,"56139":33098,"56140":33106,"56141":33103,"56142":33095,"56143":33085,"56144":33101,"56145":33082,"56146":33254,"56147":33262,"56148":33271,"56149":33272,"56150":33273,"56151":33284,"56152":33340,"56153":33341,"56154":33343,"56155":33397,"56156":33595,"56157":33743,"56158":33785,"56159":33827,"56160":33728,"56161":33768,"56162":33810,"56163":33767,"56164":33764,"56165":33788,"56166":33782,"56167":33808,"56168":33734,"56169":33736,"56170":33771,"56171":33763,"56172":33727,"56173":33793,"56174":33757,"56175":33765,"56176":33752,"56177":33791,"56178":33761,"56179":33739,"56180":33742,"56181":33750,"56182":33781,"56183":33737,"56184":33801,"56185":33807,"56186":33758,"56187":33809,"56188":33798,"56189":33730,"56190":33779,"56225":33749,"56226":33786,"56227":33735,"56228":33745,"56229":33770,"56230":33811,"56231":33731,"56232":33772,"56233":33774,"56234":33732,"56235":33787,"56236":33751,"56237":33762,"56238":33819,"56239":33755,"56240":33790,"56241":34520,"56242":34530,"56243":34534,"56244":34515,"56245":34531,"56246":34522,"56247":34538,"56248":34525,"56249":34539,"56250":34524,"56251":34540,"56252":34537,"56253":34519,"56254":34536,"56255":34513,"56256":34888,"56257":34902,"56258":34901,"56259":35002,"56260":35031,"56261":35001,"56262":35000,"56263":35008,"56264":35006,"56265":34998,"56266":35004,"56267":34999,"56268":35005,"56269":34994,"56270":35073,"56271":35017,"56272":35221,"56273":35224,"56274":35223,"56275":35293,"56276":35290,"56277":35291,"56278":35406,"56279":35405,"56280":35385,"56281":35417,"56282":35392,"56283":35415,"56284":35416,"56285":35396,"56286":35397,"56287":35410,"56288":35400,"56289":35409,"56290":35402,"56291":35404,"56292":35407,"56293":35935,"56294":35969,"56295":35968,"56296":36026,"56297":36030,"56298":36016,"56299":36025,"56300":36021,"56301":36228,"56302":36224,"56303":36233,"56304":36312,"56305":36307,"56306":36301,"56307":36295,"56308":36310,"56309":36316,"56310":36303,"56311":36309,"56312":36313,"56313":36296,"56314":36311,"56315":36293,"56316":36591,"56317":36599,"56318":36602,"56384":36601,"56385":36582,"56386":36590,"56387":36581,"56388":36597,"56389":36583,"56390":36584,"56391":36598,"56392":36587,"56393":36593,"56394":36588,"56395":36596,"56396":36585,"56397":36909,"56398":36916,"56399":36911,"56400":37126,"56401":37164,"56402":37124,"56403":37119,"56404":37116,"56405":37128,"56406":37113,"56407":37115,"56408":37121,"56409":37120,"56410":37127,"56411":37125,"56412":37123,"56413":37217,"56414":37220,"56415":37215,"56416":37218,"56417":37216,"56418":37377,"56419":37386,"56420":37413,"56421":37379,"56422":37402,"56423":37414,"56424":37391,"56425":37388,"56426":37376,"56427":37394,"56428":37375,"56429":37373,"56430":37382,"56431":37380,"56432":37415,"56433":37378,"56434":37404,"56435":37412,"56436":37401,"56437":37399,"56438":37381,"56439":37398,"56440":38267,"56441":38285,"56442":38284,"56443":38288,"56444":38535,"56445":38526,"56446":38536,"56481":38537,"56482":38531,"56483":38528,"56484":38594,"56485":38600,"56486":38595,"56487":38641,"56488":38640,"56489":38764,"56490":38768,"56491":38766,"56492":38919,"56493":39081,"56494":39147,"56495":40166,"56496":40697,"56497":20099,"56498":20100,"56499":20150,"56500":20669,"56501":20671,"56502":20678,"56503":20654,"56504":20676,"56505":20682,"56506":20660,"56507":20680,"56508":20674,"56509":20656,"56510":20673,"56511":20666,"56512":20657,"56513":20683,"56514":20681,"56515":20662,"56516":20664,"56517":20951,"56518":21114,"56519":21112,"56520":21115,"56521":21116,"56522":21955,"56523":21979,"56524":21964,"56525":21968,"56526":21963,"56527":21962,"56528":21981,"56529":21952,"56530":21972,"56531":21956,"56532":21993,"56533":21951,"56534":21970,"56535":21901,"56536":21967,"56537":21973,"56538":21986,"56539":21974,"56540":21960,"56541":22002,"56542":21965,"56543":21977,"56544":21954,"56545":22292,"56546":22611,"56547":22632,"56548":22628,"56549":22607,"56550":22605,"56551":22601,"56552":22639,"56553":22613,"56554":22606,"56555":22621,"56556":22617,"56557":22629,"56558":22619,"56559":22589,"56560":22627,"56561":22641,"56562":22780,"56563":23239,"56564":23236,"56565":23243,"56566":23226,"56567":23224,"56568":23217,"56569":23221,"56570":23216,"56571":23231,"56572":23240,"56573":23227,"56574":23238,"56640":23223,"56641":23232,"56642":23242,"56643":23220,"56644":23222,"56645":23245,"56646":23225,"56647":23184,"56648":23510,"56649":23512,"56650":23513,"56651":23583,"56652":23603,"56653":23921,"56654":23907,"56655":23882,"56656":23909,"56657":23922,"56658":23916,"56659":23902,"56660":23912,"56661":23911,"56662":23906,"56663":24048,"56664":24143,"56665":24142,"56666":24138,"56667":24141,"56668":24139,"56669":24261,"56670":24268,"56671":24262,"56672":24267,"56673":24263,"56674":24384,"56675":24495,"56676":24493,"56677":24823,"56678":24905,"56679":24906,"56680":24875,"56681":24901,"56682":24886,"56683":24882,"56684":24878,"56685":24902,"56686":24879,"56687":24911,"56688":24873,"56689":24896,"56690":25120,"56691":37224,"56692":25123,"56693":25125,"56694":25124,"56695":25541,"56696":25585,"56697":25579,"56698":25616,"56699":25618,"56700":25609,"56701":25632,"56702":25636,"56737":25651,"56738":25667,"56739":25631,"56740":25621,"56741":25624,"56742":25657,"56743":25655,"56744":25634,"56745":25635,"56746":25612,"56747":25638,"56748":25648,"56749":25640,"56750":25665,"56751":25653,"56752":25647,"56753":25610,"56754":25626,"56755":25664,"56756":25637,"56757":25639,"56758":25611,"56759":25575,"56760":25627,"56761":25646,"56762":25633,"56763":25614,"56764":25967,"56765":26002,"56766":26067,"56767":26246,"56768":26252,"56769":26261,"56770":26256,"56771":26251,"56772":26250,"56773":26265,"56774":26260,"56775":26232,"56776":26400,"56777":26982,"56778":26975,"56779":26936,"56780":26958,"56781":26978,"56782":26993,"56783":26943,"56784":26949,"56785":26986,"56786":26937,"56787":26946,"56788":26967,"56789":26969,"56790":27002,"56791":26952,"56792":26953,"56793":26933,"56794":26988,"56795":26931,"56796":26941,"56797":26981,"56798":26864,"56799":27000,"56800":26932,"56801":26985,"56802":26944,"56803":26991,"56804":26948,"56805":26998,"56806":26968,"56807":26945,"56808":26996,"56809":26956,"56810":26939,"56811":26955,"56812":26935,"56813":26972,"56814":26959,"56815":26961,"56816":26930,"56817":26962,"56818":26927,"56819":27003,"56820":26940,"56821":27462,"56822":27461,"56823":27459,"56824":27458,"56825":27464,"56826":27457,"56827":27547,"56828":64013,"56829":27643,"56830":27644,"56896":27641,"56897":27639,"56898":27640,"56899":28315,"56900":28374,"56901":28360,"56902":28303,"56903":28352,"56904":28319,"56905":28307,"56906":28308,"56907":28320,"56908":28337,"56909":28345,"56910":28358,"56911":28370,"56912":28349,"56913":28353,"56914":28318,"56915":28361,"56916":28343,"56917":28336,"56918":28365,"56919":28326,"56920":28367,"56921":28338,"56922":28350,"56923":28355,"56924":28380,"56925":28376,"56926":28313,"56927":28306,"56928":28302,"56929":28301,"56930":28324,"56931":28321,"56932":28351,"56933":28339,"56934":28368,"56935":28362,"56936":28311,"56937":28334,"56938":28323,"56939":28999,"56940":29012,"56941":29010,"56942":29027,"56943":29024,"56944":28993,"56945":29021,"56946":29026,"56947":29042,"56948":29048,"56949":29034,"56950":29025,"56951":28994,"56952":29016,"56953":28995,"56954":29003,"56955":29040,"56956":29023,"56957":29008,"56958":29011,"56993":28996,"56994":29005,"56995":29018,"56996":29263,"56997":29325,"56998":29324,"56999":29329,"57000":29328,"57001":29326,"57002":29500,"57003":29506,"57004":29499,"57005":29498,"57006":29504,"57007":29514,"57008":29513,"57009":29764,"57010":29770,"57011":29771,"57012":29778,"57013":29777,"57014":29783,"57015":29760,"57016":29775,"57017":29776,"57018":29774,"57019":29762,"57020":29766,"57021":29773,"57022":29780,"57023":29921,"57024":29951,"57025":29950,"57026":29949,"57027":29981,"57028":30073,"57029":30071,"57030":27011,"57031":30191,"57032":30223,"57033":30211,"57034":30199,"57035":30206,"57036":30204,"57037":30201,"57038":30200,"57039":30224,"57040":30203,"57041":30198,"57042":30189,"57043":30197,"57044":30205,"57045":30361,"57046":30389,"57047":30429,"57048":30549,"57049":30559,"57050":30560,"57051":30546,"57052":30550,"57053":30554,"57054":30569,"57055":30567,"57056":30548,"57057":30553,"57058":30573,"57059":30688,"57060":30855,"57061":30874,"57062":30868,"57063":30863,"57064":30852,"57065":30869,"57066":30853,"57067":30854,"57068":30881,"57069":30851,"57070":30841,"57071":30873,"57072":30848,"57073":30870,"57074":30843,"57075":31100,"57076":31106,"57077":31101,"57078":31097,"57079":31249,"57080":31256,"57081":31257,"57082":31250,"57083":31255,"57084":31253,"57085":31266,"57086":31251,"57152":31259,"57153":31248,"57154":31395,"57155":31394,"57156":31390,"57157":31467,"57158":31590,"57159":31588,"57160":31597,"57161":31604,"57162":31593,"57163":31602,"57164":31589,"57165":31603,"57166":31601,"57167":31600,"57168":31585,"57169":31608,"57170":31606,"57171":31587,"57172":31922,"57173":31924,"57174":31919,"57175":32136,"57176":32134,"57177":32128,"57178":32141,"57179":32127,"57180":32133,"57181":32122,"57182":32142,"57183":32123,"57184":32131,"57185":32124,"57186":32140,"57187":32148,"57188":32132,"57189":32125,"57190":32146,"57191":32621,"57192":32619,"57193":32615,"57194":32616,"57195":32620,"57196":32678,"57197":32677,"57198":32679,"57199":32731,"57200":32732,"57201":32801,"57202":33124,"57203":33120,"57204":33143,"57205":33116,"57206":33129,"57207":33115,"57208":33122,"57209":33138,"57210":26401,"57211":33118,"57212":33142,"57213":33127,"57214":33135,"57249":33092,"57250":33121,"57251":33309,"57252":33353,"57253":33348,"57254":33344,"57255":33346,"57256":33349,"57257":34033,"57258":33855,"57259":33878,"57260":33910,"57261":33913,"57262":33935,"57263":33933,"57264":33893,"57265":33873,"57266":33856,"57267":33926,"57268":33895,"57269":33840,"57270":33869,"57271":33917,"57272":33882,"57273":33881,"57274":33908,"57275":33907,"57276":33885,"57277":34055,"57278":33886,"57279":33847,"57280":33850,"57281":33844,"57282":33914,"57283":33859,"57284":33912,"57285":33842,"57286":33861,"57287":33833,"57288":33753,"57289":33867,"57290":33839,"57291":33858,"57292":33837,"57293":33887,"57294":33904,"57295":33849,"57296":33870,"57297":33868,"57298":33874,"57299":33903,"57300":33989,"57301":33934,"57302":33851,"57303":33863,"57304":33846,"57305":33843,"57306":33896,"57307":33918,"57308":33860,"57309":33835,"57310":33888,"57311":33876,"57312":33902,"57313":33872,"57314":34571,"57315":34564,"57316":34551,"57317":34572,"57318":34554,"57319":34518,"57320":34549,"57321":34637,"57322":34552,"57323":34574,"57324":34569,"57325":34561,"57326":34550,"57327":34573,"57328":34565,"57329":35030,"57330":35019,"57331":35021,"57332":35022,"57333":35038,"57334":35035,"57335":35034,"57336":35020,"57337":35024,"57338":35205,"57339":35227,"57340":35295,"57341":35301,"57342":35300,"57408":35297,"57409":35296,"57410":35298,"57411":35292,"57412":35302,"57413":35446,"57414":35462,"57415":35455,"57416":35425,"57417":35391,"57418":35447,"57419":35458,"57420":35460,"57421":35445,"57422":35459,"57423":35457,"57424":35444,"57425":35450,"57426":35900,"57427":35915,"57428":35914,"57429":35941,"57430":35940,"57431":35942,"57432":35974,"57433":35972,"57434":35973,"57435":36044,"57436":36200,"57437":36201,"57438":36241,"57439":36236,"57440":36238,"57441":36239,"57442":36237,"57443":36243,"57444":36244,"57445":36240,"57446":36242,"57447":36336,"57448":36320,"57449":36332,"57450":36337,"57451":36334,"57452":36304,"57453":36329,"57454":36323,"57455":36322,"57456":36327,"57457":36338,"57458":36331,"57459":36340,"57460":36614,"57461":36607,"57462":36609,"57463":36608,"57464":36613,"57465":36615,"57466":36616,"57467":36610,"57468":36619,"57469":36946,"57470":36927,"57505":36932,"57506":36937,"57507":36925,"57508":37136,"57509":37133,"57510":37135,"57511":37137,"57512":37142,"57513":37140,"57514":37131,"57515":37134,"57516":37230,"57517":37231,"57518":37448,"57519":37458,"57520":37424,"57521":37434,"57522":37478,"57523":37427,"57524":37477,"57525":37470,"57526":37507,"57527":37422,"57528":37450,"57529":37446,"57530":37485,"57531":37484,"57532":37455,"57533":37472,"57534":37479,"57535":37487,"57536":37430,"57537":37473,"57538":37488,"57539":37425,"57540":37460,"57541":37475,"57542":37456,"57543":37490,"57544":37454,"57545":37459,"57546":37452,"57547":37462,"57548":37426,"57549":38303,"57550":38300,"57551":38302,"57552":38299,"57553":38546,"57554":38547,"57555":38545,"57556":38551,"57557":38606,"57558":38650,"57559":38653,"57560":38648,"57561":38645,"57562":38771,"57563":38775,"57564":38776,"57565":38770,"57566":38927,"57567":38925,"57568":38926,"57569":39084,"57570":39158,"57571":39161,"57572":39343,"57573":39346,"57574":39344,"57575":39349,"57576":39597,"57577":39595,"57578":39771,"57579":40170,"57580":40173,"57581":40167,"57582":40576,"57583":40701,"57584":20710,"57585":20692,"57586":20695,"57587":20712,"57588":20723,"57589":20699,"57590":20714,"57591":20701,"57592":20708,"57593":20691,"57594":20716,"57595":20720,"57596":20719,"57597":20707,"57598":20704,"57664":20952,"57665":21120,"57666":21121,"57667":21225,"57668":21227,"57669":21296,"57670":21420,"57671":22055,"57672":22037,"57673":22028,"57674":22034,"57675":22012,"57676":22031,"57677":22044,"57678":22017,"57679":22035,"57680":22018,"57681":22010,"57682":22045,"57683":22020,"57684":22015,"57685":22009,"57686":22665,"57687":22652,"57688":22672,"57689":22680,"57690":22662,"57691":22657,"57692":22655,"57693":22644,"57694":22667,"57695":22650,"57696":22663,"57697":22673,"57698":22670,"57699":22646,"57700":22658,"57701":22664,"57702":22651,"57703":22676,"57704":22671,"57705":22782,"57706":22891,"57707":23260,"57708":23278,"57709":23269,"57710":23253,"57711":23274,"57712":23258,"57713":23277,"57714":23275,"57715":23283,"57716":23266,"57717":23264,"57718":23259,"57719":23276,"57720":23262,"57721":23261,"57722":23257,"57723":23272,"57724":23263,"57725":23415,"57726":23520,"57761":23523,"57762":23651,"57763":23938,"57764":23936,"57765":23933,"57766":23942,"57767":23930,"57768":23937,"57769":23927,"57770":23946,"57771":23945,"57772":23944,"57773":23934,"57774":23932,"57775":23949,"57776":23929,"57777":23935,"57778":24152,"57779":24153,"57780":24147,"57781":24280,"57782":24273,"57783":24279,"57784":24270,"57785":24284,"57786":24277,"57787":24281,"57788":24274,"57789":24276,"57790":24388,"57791":24387,"57792":24431,"57793":24502,"57794":24876,"57795":24872,"57796":24897,"57797":24926,"57798":24945,"57799":24947,"57800":24914,"57801":24915,"57802":24946,"57803":24940,"57804":24960,"57805":24948,"57806":24916,"57807":24954,"57808":24923,"57809":24933,"57810":24891,"57811":24938,"57812":24929,"57813":24918,"57814":25129,"57815":25127,"57816":25131,"57817":25643,"57818":25677,"57819":25691,"57820":25693,"57821":25716,"57822":25718,"57823":25714,"57824":25715,"57825":25725,"57826":25717,"57827":25702,"57828":25766,"57829":25678,"57830":25730,"57831":25694,"57832":25692,"57833":25675,"57834":25683,"57835":25696,"57836":25680,"57837":25727,"57838":25663,"57839":25708,"57840":25707,"57841":25689,"57842":25701,"57843":25719,"57844":25971,"57845":26016,"57846":26273,"57847":26272,"57848":26271,"57849":26373,"57850":26372,"57851":26402,"57852":27057,"57853":27062,"57854":27081,"57920":27040,"57921":27086,"57922":27030,"57923":27056,"57924":27052,"57925":27068,"57926":27025,"57927":27033,"57928":27022,"57929":27047,"57930":27021,"57931":27049,"57932":27070,"57933":27055,"57934":27071,"57935":27076,"57936":27069,"57937":27044,"57938":27092,"57939":27065,"57940":27082,"57941":27034,"57942":27087,"57943":27059,"57944":27027,"57945":27050,"57946":27041,"57947":27038,"57948":27097,"57949":27031,"57950":27024,"57951":27074,"57952":27061,"57953":27045,"57954":27078,"57955":27466,"57956":27469,"57957":27467,"57958":27550,"57959":27551,"57960":27552,"57961":27587,"57962":27588,"57963":27646,"57964":28366,"57965":28405,"57966":28401,"57967":28419,"57968":28453,"57969":28408,"57970":28471,"57971":28411,"57972":28462,"57973":28425,"57974":28494,"57975":28441,"57976":28442,"57977":28455,"57978":28440,"57979":28475,"57980":28434,"57981":28397,"57982":28426,"58017":28470,"58018":28531,"58019":28409,"58020":28398,"58021":28461,"58022":28480,"58023":28464,"58024":28476,"58025":28469,"58026":28395,"58027":28423,"58028":28430,"58029":28483,"58030":28421,"58031":28413,"58032":28406,"58033":28473,"58034":28444,"58035":28412,"58036":28474,"58037":28447,"58038":28429,"58039":28446,"58040":28424,"58041":28449,"58042":29063,"58043":29072,"58044":29065,"58045":29056,"58046":29061,"58047":29058,"58048":29071,"58049":29051,"58050":29062,"58051":29057,"58052":29079,"58053":29252,"58054":29267,"58055":29335,"58056":29333,"58057":29331,"58058":29507,"58059":29517,"58060":29521,"58061":29516,"58062":29794,"58063":29811,"58064":29809,"58065":29813,"58066":29810,"58067":29799,"58068":29806,"58069":29952,"58070":29954,"58071":29955,"58072":30077,"58073":30096,"58074":30230,"58075":30216,"58076":30220,"58077":30229,"58078":30225,"58079":30218,"58080":30228,"58081":30392,"58082":30593,"58083":30588,"58084":30597,"58085":30594,"58086":30574,"58087":30592,"58088":30575,"58089":30590,"58090":30595,"58091":30898,"58092":30890,"58093":30900,"58094":30893,"58095":30888,"58096":30846,"58097":30891,"58098":30878,"58099":30885,"58100":30880,"58101":30892,"58102":30882,"58103":30884,"58104":31128,"58105":31114,"58106":31115,"58107":31126,"58108":31125,"58109":31124,"58110":31123,"58176":31127,"58177":31112,"58178":31122,"58179":31120,"58180":31275,"58181":31306,"58182":31280,"58183":31279,"58184":31272,"58185":31270,"58186":31400,"58187":31403,"58188":31404,"58189":31470,"58190":31624,"58191":31644,"58192":31626,"58193":31633,"58194":31632,"58195":31638,"58196":31629,"58197":31628,"58198":31643,"58199":31630,"58200":31621,"58201":31640,"58202":21124,"58203":31641,"58204":31652,"58205":31618,"58206":31931,"58207":31935,"58208":31932,"58209":31930,"58210":32167,"58211":32183,"58212":32194,"58213":32163,"58214":32170,"58215":32193,"58216":32192,"58217":32197,"58218":32157,"58219":32206,"58220":32196,"58221":32198,"58222":32203,"58223":32204,"58224":32175,"58225":32185,"58226":32150,"58227":32188,"58228":32159,"58229":32166,"58230":32174,"58231":32169,"58232":32161,"58233":32201,"58234":32627,"58235":32738,"58236":32739,"58237":32741,"58238":32734,"58273":32804,"58274":32861,"58275":32860,"58276":33161,"58277":33158,"58278":33155,"58279":33159,"58280":33165,"58281":33164,"58282":33163,"58283":33301,"58284":33943,"58285":33956,"58286":33953,"58287":33951,"58288":33978,"58289":33998,"58290":33986,"58291":33964,"58292":33966,"58293":33963,"58294":33977,"58295":33972,"58296":33985,"58297":33997,"58298":33962,"58299":33946,"58300":33969,"58301":34000,"58302":33949,"58303":33959,"58304":33979,"58305":33954,"58306":33940,"58307":33991,"58308":33996,"58309":33947,"58310":33961,"58311":33967,"58312":33960,"58313":34006,"58314":33944,"58315":33974,"58316":33999,"58317":33952,"58318":34007,"58319":34004,"58320":34002,"58321":34011,"58322":33968,"58323":33937,"58324":34401,"58325":34611,"58326":34595,"58327":34600,"58328":34667,"58329":34624,"58330":34606,"58331":34590,"58332":34593,"58333":34585,"58334":34587,"58335":34627,"58336":34604,"58337":34625,"58338":34622,"58339":34630,"58340":34592,"58341":34610,"58342":34602,"58343":34605,"58344":34620,"58345":34578,"58346":34618,"58347":34609,"58348":34613,"58349":34626,"58350":34598,"58351":34599,"58352":34616,"58353":34596,"58354":34586,"58355":34608,"58356":34577,"58357":35063,"58358":35047,"58359":35057,"58360":35058,"58361":35066,"58362":35070,"58363":35054,"58364":35068,"58365":35062,"58366":35067,"58432":35056,"58433":35052,"58434":35051,"58435":35229,"58436":35233,"58437":35231,"58438":35230,"58439":35305,"58440":35307,"58441":35304,"58442":35499,"58443":35481,"58444":35467,"58445":35474,"58446":35471,"58447":35478,"58448":35901,"58449":35944,"58450":35945,"58451":36053,"58452":36047,"58453":36055,"58454":36246,"58455":36361,"58456":36354,"58457":36351,"58458":36365,"58459":36349,"58460":36362,"58461":36355,"58462":36359,"58463":36358,"58464":36357,"58465":36350,"58466":36352,"58467":36356,"58468":36624,"58469":36625,"58470":36622,"58471":36621,"58472":37155,"58473":37148,"58474":37152,"58475":37154,"58476":37151,"58477":37149,"58478":37146,"58479":37156,"58480":37153,"58481":37147,"58482":37242,"58483":37234,"58484":37241,"58485":37235,"58486":37541,"58487":37540,"58488":37494,"58489":37531,"58490":37498,"58491":37536,"58492":37524,"58493":37546,"58494":37517,"58529":37542,"58530":37530,"58531":37547,"58532":37497,"58533":37527,"58534":37503,"58535":37539,"58536":37614,"58537":37518,"58538":37506,"58539":37525,"58540":37538,"58541":37501,"58542":37512,"58543":37537,"58544":37514,"58545":37510,"58546":37516,"58547":37529,"58548":37543,"58549":37502,"58550":37511,"58551":37545,"58552":37533,"58553":37515,"58554":37421,"58555":38558,"58556":38561,"58557":38655,"58558":38744,"58559":38781,"58560":38778,"58561":38782,"58562":38787,"58563":38784,"58564":38786,"58565":38779,"58566":38788,"58567":38785,"58568":38783,"58569":38862,"58570":38861,"58571":38934,"58572":39085,"58573":39086,"58574":39170,"58575":39168,"58576":39175,"58577":39325,"58578":39324,"58579":39363,"58580":39353,"58581":39355,"58582":39354,"58583":39362,"58584":39357,"58585":39367,"58586":39601,"58587":39651,"58588":39655,"58589":39742,"58590":39743,"58591":39776,"58592":39777,"58593":39775,"58594":40177,"58595":40178,"58596":40181,"58597":40615,"58598":20735,"58599":20739,"58600":20784,"58601":20728,"58602":20742,"58603":20743,"58604":20726,"58605":20734,"58606":20747,"58607":20748,"58608":20733,"58609":20746,"58610":21131,"58611":21132,"58612":21233,"58613":21231,"58614":22088,"58615":22082,"58616":22092,"58617":22069,"58618":22081,"58619":22090,"58620":22089,"58621":22086,"58622":22104,"58688":22106,"58689":22080,"58690":22067,"58691":22077,"58692":22060,"58693":22078,"58694":22072,"58695":22058,"58696":22074,"58697":22298,"58698":22699,"58699":22685,"58700":22705,"58701":22688,"58702":22691,"58703":22703,"58704":22700,"58705":22693,"58706":22689,"58707":22783,"58708":23295,"58709":23284,"58710":23293,"58711":23287,"58712":23286,"58713":23299,"58714":23288,"58715":23298,"58716":23289,"58717":23297,"58718":23303,"58719":23301,"58720":23311,"58721":23655,"58722":23961,"58723":23959,"58724":23967,"58725":23954,"58726":23970,"58727":23955,"58728":23957,"58729":23968,"58730":23964,"58731":23969,"58732":23962,"58733":23966,"58734":24169,"58735":24157,"58736":24160,"58737":24156,"58738":32243,"58739":24283,"58740":24286,"58741":24289,"58742":24393,"58743":24498,"58744":24971,"58745":24963,"58746":24953,"58747":25009,"58748":25008,"58749":24994,"58750":24969,"58785":24987,"58786":24979,"58787":25007,"58788":25005,"58789":24991,"58790":24978,"58791":25002,"58792":24993,"58793":24973,"58794":24934,"58795":25011,"58796":25133,"58797":25710,"58798":25712,"58799":25750,"58800":25760,"58801":25733,"58802":25751,"58803":25756,"58804":25743,"58805":25739,"58806":25738,"58807":25740,"58808":25763,"58809":25759,"58810":25704,"58811":25777,"58812":25752,"58813":25974,"58814":25978,"58815":25977,"58816":25979,"58817":26034,"58818":26035,"58819":26293,"58820":26288,"58821":26281,"58822":26290,"58823":26295,"58824":26282,"58825":26287,"58826":27136,"58827":27142,"58828":27159,"58829":27109,"58830":27128,"58831":27157,"58832":27121,"58833":27108,"58834":27168,"58835":27135,"58836":27116,"58837":27106,"58838":27163,"58839":27165,"58840":27134,"58841":27175,"58842":27122,"58843":27118,"58844":27156,"58845":27127,"58846":27111,"58847":27200,"58848":27144,"58849":27110,"58850":27131,"58851":27149,"58852":27132,"58853":27115,"58854":27145,"58855":27140,"58856":27160,"58857":27173,"58858":27151,"58859":27126,"58860":27174,"58861":27143,"58862":27124,"58863":27158,"58864":27473,"58865":27557,"58866":27555,"58867":27554,"58868":27558,"58869":27649,"58870":27648,"58871":27647,"58872":27650,"58873":28481,"58874":28454,"58875":28542,"58876":28551,"58877":28614,"58878":28562,"58944":28557,"58945":28553,"58946":28556,"58947":28514,"58948":28495,"58949":28549,"58950":28506,"58951":28566,"58952":28534,"58953":28524,"58954":28546,"58955":28501,"58956":28530,"58957":28498,"58958":28496,"58959":28503,"58960":28564,"58961":28563,"58962":28509,"58963":28416,"58964":28513,"58965":28523,"58966":28541,"58967":28519,"58968":28560,"58969":28499,"58970":28555,"58971":28521,"58972":28543,"58973":28565,"58974":28515,"58975":28535,"58976":28522,"58977":28539,"58978":29106,"58979":29103,"58980":29083,"58981":29104,"58982":29088,"58983":29082,"58984":29097,"58985":29109,"58986":29085,"58987":29093,"58988":29086,"58989":29092,"58990":29089,"58991":29098,"58992":29084,"58993":29095,"58994":29107,"58995":29336,"58996":29338,"58997":29528,"58998":29522,"58999":29534,"59000":29535,"59001":29536,"59002":29533,"59003":29531,"59004":29537,"59005":29530,"59006":29529,"59041":29538,"59042":29831,"59043":29833,"59044":29834,"59045":29830,"59046":29825,"59047":29821,"59048":29829,"59049":29832,"59050":29820,"59051":29817,"59052":29960,"59053":29959,"59054":30078,"59055":30245,"59056":30238,"59057":30233,"59058":30237,"59059":30236,"59060":30243,"59061":30234,"59062":30248,"59063":30235,"59064":30364,"59065":30365,"59066":30366,"59067":30363,"59068":30605,"59069":30607,"59070":30601,"59071":30600,"59072":30925,"59073":30907,"59074":30927,"59075":30924,"59076":30929,"59077":30926,"59078":30932,"59079":30920,"59080":30915,"59081":30916,"59082":30921,"59083":31130,"59084":31137,"59085":31136,"59086":31132,"59087":31138,"59088":31131,"59089":27510,"59090":31289,"59091":31410,"59092":31412,"59093":31411,"59094":31671,"59095":31691,"59096":31678,"59097":31660,"59098":31694,"59099":31663,"59100":31673,"59101":31690,"59102":31669,"59103":31941,"59104":31944,"59105":31948,"59106":31947,"59107":32247,"59108":32219,"59109":32234,"59110":32231,"59111":32215,"59112":32225,"59113":32259,"59114":32250,"59115":32230,"59116":32246,"59117":32241,"59118":32240,"59119":32238,"59120":32223,"59121":32630,"59122":32684,"59123":32688,"59124":32685,"59125":32749,"59126":32747,"59127":32746,"59128":32748,"59129":32742,"59130":32744,"59131":32868,"59132":32871,"59133":33187,"59134":33183,"59200":33182,"59201":33173,"59202":33186,"59203":33177,"59204":33175,"59205":33302,"59206":33359,"59207":33363,"59208":33362,"59209":33360,"59210":33358,"59211":33361,"59212":34084,"59213":34107,"59214":34063,"59215":34048,"59216":34089,"59217":34062,"59218":34057,"59219":34061,"59220":34079,"59221":34058,"59222":34087,"59223":34076,"59224":34043,"59225":34091,"59226":34042,"59227":34056,"59228":34060,"59229":34036,"59230":34090,"59231":34034,"59232":34069,"59233":34039,"59234":34027,"59235":34035,"59236":34044,"59237":34066,"59238":34026,"59239":34025,"59240":34070,"59241":34046,"59242":34088,"59243":34077,"59244":34094,"59245":34050,"59246":34045,"59247":34078,"59248":34038,"59249":34097,"59250":34086,"59251":34023,"59252":34024,"59253":34032,"59254":34031,"59255":34041,"59256":34072,"59257":34080,"59258":34096,"59259":34059,"59260":34073,"59261":34095,"59262":34402,"59297":34646,"59298":34659,"59299":34660,"59300":34679,"59301":34785,"59302":34675,"59303":34648,"59304":34644,"59305":34651,"59306":34642,"59307":34657,"59308":34650,"59309":34641,"59310":34654,"59311":34669,"59312":34666,"59313":34640,"59314":34638,"59315":34655,"59316":34653,"59317":34671,"59318":34668,"59319":34682,"59320":34670,"59321":34652,"59322":34661,"59323":34639,"59324":34683,"59325":34677,"59326":34658,"59327":34663,"59328":34665,"59329":34906,"59330":35077,"59331":35084,"59332":35092,"59333":35083,"59334":35095,"59335":35096,"59336":35097,"59337":35078,"59338":35094,"59339":35089,"59340":35086,"59341":35081,"59342":35234,"59343":35236,"59344":35235,"59345":35309,"59346":35312,"59347":35308,"59348":35535,"59349":35526,"59350":35512,"59351":35539,"59352":35537,"59353":35540,"59354":35541,"59355":35515,"59356":35543,"59357":35518,"59358":35520,"59359":35525,"59360":35544,"59361":35523,"59362":35514,"59363":35517,"59364":35545,"59365":35902,"59366":35917,"59367":35983,"59368":36069,"59369":36063,"59370":36057,"59371":36072,"59372":36058,"59373":36061,"59374":36071,"59375":36256,"59376":36252,"59377":36257,"59378":36251,"59379":36384,"59380":36387,"59381":36389,"59382":36388,"59383":36398,"59384":36373,"59385":36379,"59386":36374,"59387":36369,"59388":36377,"59389":36390,"59390":36391,"59456":36372,"59457":36370,"59458":36376,"59459":36371,"59460":36380,"59461":36375,"59462":36378,"59463":36652,"59464":36644,"59465":36632,"59466":36634,"59467":36640,"59468":36643,"59469":36630,"59470":36631,"59471":36979,"59472":36976,"59473":36975,"59474":36967,"59475":36971,"59476":37167,"59477":37163,"59478":37161,"59479":37162,"59480":37170,"59481":37158,"59482":37166,"59483":37253,"59484":37254,"59485":37258,"59486":37249,"59487":37250,"59488":37252,"59489":37248,"59490":37584,"59491":37571,"59492":37572,"59493":37568,"59494":37593,"59495":37558,"59496":37583,"59497":37617,"59498":37599,"59499":37592,"59500":37609,"59501":37591,"59502":37597,"59503":37580,"59504":37615,"59505":37570,"59506":37608,"59507":37578,"59508":37576,"59509":37582,"59510":37606,"59511":37581,"59512":37589,"59513":37577,"59514":37600,"59515":37598,"59516":37607,"59517":37585,"59518":37587,"59553":37557,"59554":37601,"59555":37574,"59556":37556,"59557":38268,"59558":38316,"59559":38315,"59560":38318,"59561":38320,"59562":38564,"59563":38562,"59564":38611,"59565":38661,"59566":38664,"59567":38658,"59568":38746,"59569":38794,"59570":38798,"59571":38792,"59572":38864,"59573":38863,"59574":38942,"59575":38941,"59576":38950,"59577":38953,"59578":38952,"59579":38944,"59580":38939,"59581":38951,"59582":39090,"59583":39176,"59584":39162,"59585":39185,"59586":39188,"59587":39190,"59588":39191,"59589":39189,"59590":39388,"59591":39373,"59592":39375,"59593":39379,"59594":39380,"59595":39374,"59596":39369,"59597":39382,"59598":39384,"59599":39371,"59600":39383,"59601":39372,"59602":39603,"59603":39660,"59604":39659,"59605":39667,"59606":39666,"59607":39665,"59608":39750,"59609":39747,"59610":39783,"59611":39796,"59612":39793,"59613":39782,"59614":39798,"59615":39797,"59616":39792,"59617":39784,"59618":39780,"59619":39788,"59620":40188,"59621":40186,"59622":40189,"59623":40191,"59624":40183,"59625":40199,"59626":40192,"59627":40185,"59628":40187,"59629":40200,"59630":40197,"59631":40196,"59632":40579,"59633":40659,"59634":40719,"59635":40720,"59636":20764,"59637":20755,"59638":20759,"59639":20762,"59640":20753,"59641":20958,"59642":21300,"59643":21473,"59644":22128,"59645":22112,"59646":22126,"59712":22131,"59713":22118,"59714":22115,"59715":22125,"59716":22130,"59717":22110,"59718":22135,"59719":22300,"59720":22299,"59721":22728,"59722":22717,"59723":22729,"59724":22719,"59725":22714,"59726":22722,"59727":22716,"59728":22726,"59729":23319,"59730":23321,"59731":23323,"59732":23329,"59733":23316,"59734":23315,"59735":23312,"59736":23318,"59737":23336,"59738":23322,"59739":23328,"59740":23326,"59741":23535,"59742":23980,"59743":23985,"59744":23977,"59745":23975,"59746":23989,"59747":23984,"59748":23982,"59749":23978,"59750":23976,"59751":23986,"59752":23981,"59753":23983,"59754":23988,"59755":24167,"59756":24168,"59757":24166,"59758":24175,"59759":24297,"59760":24295,"59761":24294,"59762":24296,"59763":24293,"59764":24395,"59765":24508,"59766":24989,"59767":25000,"59768":24982,"59769":25029,"59770":25012,"59771":25030,"59772":25025,"59773":25036,"59774":25018,"59809":25023,"59810":25016,"59811":24972,"59812":25815,"59813":25814,"59814":25808,"59815":25807,"59816":25801,"59817":25789,"59818":25737,"59819":25795,"59820":25819,"59821":25843,"59822":25817,"59823":25907,"59824":25983,"59825":25980,"59826":26018,"59827":26312,"59828":26302,"59829":26304,"59830":26314,"59831":26315,"59832":26319,"59833":26301,"59834":26299,"59835":26298,"59836":26316,"59837":26403,"59838":27188,"59839":27238,"59840":27209,"59841":27239,"59842":27186,"59843":27240,"59844":27198,"59845":27229,"59846":27245,"59847":27254,"59848":27227,"59849":27217,"59850":27176,"59851":27226,"59852":27195,"59853":27199,"59854":27201,"59855":27242,"59856":27236,"59857":27216,"59858":27215,"59859":27220,"59860":27247,"59861":27241,"59862":27232,"59863":27196,"59864":27230,"59865":27222,"59866":27221,"59867":27213,"59868":27214,"59869":27206,"59870":27477,"59871":27476,"59872":27478,"59873":27559,"59874":27562,"59875":27563,"59876":27592,"59877":27591,"59878":27652,"59879":27651,"59880":27654,"59881":28589,"59882":28619,"59883":28579,"59884":28615,"59885":28604,"59886":28622,"59887":28616,"59888":28510,"59889":28612,"59890":28605,"59891":28574,"59892":28618,"59893":28584,"59894":28676,"59895":28581,"59896":28590,"59897":28602,"59898":28588,"59899":28586,"59900":28623,"59901":28607,"59902":28600,"59968":28578,"59969":28617,"59970":28587,"59971":28621,"59972":28591,"59973":28594,"59974":28592,"59975":29125,"59976":29122,"59977":29119,"59978":29112,"59979":29142,"59980":29120,"59981":29121,"59982":29131,"59983":29140,"59984":29130,"59985":29127,"59986":29135,"59987":29117,"59988":29144,"59989":29116,"59990":29126,"59991":29146,"59992":29147,"59993":29341,"59994":29342,"59995":29545,"59996":29542,"59997":29543,"59998":29548,"59999":29541,"60000":29547,"60001":29546,"60002":29823,"60003":29850,"60004":29856,"60005":29844,"60006":29842,"60007":29845,"60008":29857,"60009":29963,"60010":30080,"60011":30255,"60012":30253,"60013":30257,"60014":30269,"60015":30259,"60016":30268,"60017":30261,"60018":30258,"60019":30256,"60020":30395,"60021":30438,"60022":30618,"60023":30621,"60024":30625,"60025":30620,"60026":30619,"60027":30626,"60028":30627,"60029":30613,"60030":30617,"60065":30615,"60066":30941,"60067":30953,"60068":30949,"60069":30954,"60070":30942,"60071":30947,"60072":30939,"60073":30945,"60074":30946,"60075":30957,"60076":30943,"60077":30944,"60078":31140,"60079":31300,"60080":31304,"60081":31303,"60082":31414,"60083":31416,"60084":31413,"60085":31409,"60086":31415,"60087":31710,"60088":31715,"60089":31719,"60090":31709,"60091":31701,"60092":31717,"60093":31706,"60094":31720,"60095":31737,"60096":31700,"60097":31722,"60098":31714,"60099":31708,"60100":31723,"60101":31704,"60102":31711,"60103":31954,"60104":31956,"60105":31959,"60106":31952,"60107":31953,"60108":32274,"60109":32289,"60110":32279,"60111":32268,"60112":32287,"60113":32288,"60114":32275,"60115":32270,"60116":32284,"60117":32277,"60118":32282,"60119":32290,"60120":32267,"60121":32271,"60122":32278,"60123":32269,"60124":32276,"60125":32293,"60126":32292,"60127":32579,"60128":32635,"60129":32636,"60130":32634,"60131":32689,"60132":32751,"60133":32810,"60134":32809,"60135":32876,"60136":33201,"60137":33190,"60138":33198,"60139":33209,"60140":33205,"60141":33195,"60142":33200,"60143":33196,"60144":33204,"60145":33202,"60146":33207,"60147":33191,"60148":33266,"60149":33365,"60150":33366,"60151":33367,"60152":34134,"60153":34117,"60154":34155,"60155":34125,"60156":34131,"60157":34145,"60158":34136,"60224":34112,"60225":34118,"60226":34148,"60227":34113,"60228":34146,"60229":34116,"60230":34129,"60231":34119,"60232":34147,"60233":34110,"60234":34139,"60235":34161,"60236":34126,"60237":34158,"60238":34165,"60239":34133,"60240":34151,"60241":34144,"60242":34188,"60243":34150,"60244":34141,"60245":34132,"60246":34149,"60247":34156,"60248":34403,"60249":34405,"60250":34404,"60251":34715,"60252":34703,"60253":34711,"60254":34707,"60255":34706,"60256":34696,"60257":34689,"60258":34710,"60259":34712,"60260":34681,"60261":34695,"60262":34723,"60263":34693,"60264":34704,"60265":34705,"60266":34717,"60267":34692,"60268":34708,"60269":34716,"60270":34714,"60271":34697,"60272":35102,"60273":35110,"60274":35120,"60275":35117,"60276":35118,"60277":35111,"60278":35121,"60279":35106,"60280":35113,"60281":35107,"60282":35119,"60283":35116,"60284":35103,"60285":35313,"60286":35552,"60321":35554,"60322":35570,"60323":35572,"60324":35573,"60325":35549,"60326":35604,"60327":35556,"60328":35551,"60329":35568,"60330":35528,"60331":35550,"60332":35553,"60333":35560,"60334":35583,"60335":35567,"60336":35579,"60337":35985,"60338":35986,"60339":35984,"60340":36085,"60341":36078,"60342":36081,"60343":36080,"60344":36083,"60345":36204,"60346":36206,"60347":36261,"60348":36263,"60349":36403,"60350":36414,"60351":36408,"60352":36416,"60353":36421,"60354":36406,"60355":36412,"60356":36413,"60357":36417,"60358":36400,"60359":36415,"60360":36541,"60361":36662,"60362":36654,"60363":36661,"60364":36658,"60365":36665,"60366":36663,"60367":36660,"60368":36982,"60369":36985,"60370":36987,"60371":36998,"60372":37114,"60373":37171,"60374":37173,"60375":37174,"60376":37267,"60377":37264,"60378":37265,"60379":37261,"60380":37263,"60381":37671,"60382":37662,"60383":37640,"60384":37663,"60385":37638,"60386":37647,"60387":37754,"60388":37688,"60389":37692,"60390":37659,"60391":37667,"60392":37650,"60393":37633,"60394":37702,"60395":37677,"60396":37646,"60397":37645,"60398":37579,"60399":37661,"60400":37626,"60401":37669,"60402":37651,"60403":37625,"60404":37623,"60405":37684,"60406":37634,"60407":37668,"60408":37631,"60409":37673,"60410":37689,"60411":37685,"60412":37674,"60413":37652,"60414":37644,"60480":37643,"60481":37630,"60482":37641,"60483":37632,"60484":37627,"60485":37654,"60486":38332,"60487":38349,"60488":38334,"60489":38329,"60490":38330,"60491":38326,"60492":38335,"60493":38325,"60494":38333,"60495":38569,"60496":38612,"60497":38667,"60498":38674,"60499":38672,"60500":38809,"60501":38807,"60502":38804,"60503":38896,"60504":38904,"60505":38965,"60506":38959,"60507":38962,"60508":39204,"60509":39199,"60510":39207,"60511":39209,"60512":39326,"60513":39406,"60514":39404,"60515":39397,"60516":39396,"60517":39408,"60518":39395,"60519":39402,"60520":39401,"60521":39399,"60522":39609,"60523":39615,"60524":39604,"60525":39611,"60526":39670,"60527":39674,"60528":39673,"60529":39671,"60530":39731,"60531":39808,"60532":39813,"60533":39815,"60534":39804,"60535":39806,"60536":39803,"60537":39810,"60538":39827,"60539":39826,"60540":39824,"60541":39802,"60542":39829,"60577":39805,"60578":39816,"60579":40229,"60580":40215,"60581":40224,"60582":40222,"60583":40212,"60584":40233,"60585":40221,"60586":40216,"60587":40226,"60588":40208,"60589":40217,"60590":40223,"60591":40584,"60592":40582,"60593":40583,"60594":40622,"60595":40621,"60596":40661,"60597":40662,"60598":40698,"60599":40722,"60600":40765,"60601":20774,"60602":20773,"60603":20770,"60604":20772,"60605":20768,"60606":20777,"60607":21236,"60608":22163,"60609":22156,"60610":22157,"60611":22150,"60612":22148,"60613":22147,"60614":22142,"60615":22146,"60616":22143,"60617":22145,"60618":22742,"60619":22740,"60620":22735,"60621":22738,"60622":23341,"60623":23333,"60624":23346,"60625":23331,"60626":23340,"60627":23335,"60628":23334,"60629":23343,"60630":23342,"60631":23419,"60632":23537,"60633":23538,"60634":23991,"60635":24172,"60636":24170,"60637":24510,"60638":24507,"60639":25027,"60640":25013,"60641":25020,"60642":25063,"60643":25056,"60644":25061,"60645":25060,"60646":25064,"60647":25054,"60648":25839,"60649":25833,"60650":25827,"60651":25835,"60652":25828,"60653":25832,"60654":25985,"60655":25984,"60656":26038,"60657":26074,"60658":26322,"60659":27277,"60660":27286,"60661":27265,"60662":27301,"60663":27273,"60664":27295,"60665":27291,"60666":27297,"60667":27294,"60668":27271,"60669":27283,"60670":27278,"60736":27285,"60737":27267,"60738":27304,"60739":27300,"60740":27281,"60741":27263,"60742":27302,"60743":27290,"60744":27269,"60745":27276,"60746":27282,"60747":27483,"60748":27565,"60749":27657,"60750":28620,"60751":28585,"60752":28660,"60753":28628,"60754":28643,"60755":28636,"60756":28653,"60757":28647,"60758":28646,"60759":28638,"60760":28658,"60761":28637,"60762":28642,"60763":28648,"60764":29153,"60765":29169,"60766":29160,"60767":29170,"60768":29156,"60769":29168,"60770":29154,"60771":29555,"60772":29550,"60773":29551,"60774":29847,"60775":29874,"60776":29867,"60777":29840,"60778":29866,"60779":29869,"60780":29873,"60781":29861,"60782":29871,"60783":29968,"60784":29969,"60785":29970,"60786":29967,"60787":30084,"60788":30275,"60789":30280,"60790":30281,"60791":30279,"60792":30372,"60793":30441,"60794":30645,"60795":30635,"60796":30642,"60797":30647,"60798":30646,"60833":30644,"60834":30641,"60835":30632,"60836":30704,"60837":30963,"60838":30973,"60839":30978,"60840":30971,"60841":30972,"60842":30962,"60843":30981,"60844":30969,"60845":30974,"60846":30980,"60847":31147,"60848":31144,"60849":31324,"60850":31323,"60851":31318,"60852":31320,"60853":31316,"60854":31322,"60855":31422,"60856":31424,"60857":31425,"60858":31749,"60859":31759,"60860":31730,"60861":31744,"60862":31743,"60863":31739,"60864":31758,"60865":31732,"60866":31755,"60867":31731,"60868":31746,"60869":31753,"60870":31747,"60871":31745,"60872":31736,"60873":31741,"60874":31750,"60875":31728,"60876":31729,"60877":31760,"60878":31754,"60879":31976,"60880":32301,"60881":32316,"60882":32322,"60883":32307,"60884":38984,"60885":32312,"60886":32298,"60887":32329,"60888":32320,"60889":32327,"60890":32297,"60891":32332,"60892":32304,"60893":32315,"60894":32310,"60895":32324,"60896":32314,"60897":32581,"60898":32639,"60899":32638,"60900":32637,"60901":32756,"60902":32754,"60903":32812,"60904":33211,"60905":33220,"60906":33228,"60907":33226,"60908":33221,"60909":33223,"60910":33212,"60911":33257,"60912":33371,"60913":33370,"60914":33372,"60915":34179,"60916":34176,"60917":34191,"60918":34215,"60919":34197,"60920":34208,"60921":34187,"60922":34211,"60923":34171,"60924":34212,"60925":34202,"60926":34206,"60992":34167,"60993":34172,"60994":34185,"60995":34209,"60996":34170,"60997":34168,"60998":34135,"60999":34190,"61000":34198,"61001":34182,"61002":34189,"61003":34201,"61004":34205,"61005":34177,"61006":34210,"61007":34178,"61008":34184,"61009":34181,"61010":34169,"61011":34166,"61012":34200,"61013":34192,"61014":34207,"61015":34408,"61016":34750,"61017":34730,"61018":34733,"61019":34757,"61020":34736,"61021":34732,"61022":34745,"61023":34741,"61024":34748,"61025":34734,"61026":34761,"61027":34755,"61028":34754,"61029":34764,"61030":34743,"61031":34735,"61032":34756,"61033":34762,"61034":34740,"61035":34742,"61036":34751,"61037":34744,"61038":34749,"61039":34782,"61040":34738,"61041":35125,"61042":35123,"61043":35132,"61044":35134,"61045":35137,"61046":35154,"61047":35127,"61048":35138,"61049":35245,"61050":35247,"61051":35246,"61052":35314,"61053":35315,"61054":35614,"61089":35608,"61090":35606,"61091":35601,"61092":35589,"61093":35595,"61094":35618,"61095":35599,"61096":35602,"61097":35605,"61098":35591,"61099":35597,"61100":35592,"61101":35590,"61102":35612,"61103":35603,"61104":35610,"61105":35919,"61106":35952,"61107":35954,"61108":35953,"61109":35951,"61110":35989,"61111":35988,"61112":36089,"61113":36207,"61114":36430,"61115":36429,"61116":36435,"61117":36432,"61118":36428,"61119":36423,"61120":36675,"61121":36672,"61122":36997,"61123":36990,"61124":37176,"61125":37274,"61126":37282,"61127":37275,"61128":37273,"61129":37279,"61130":37281,"61131":37277,"61132":37280,"61133":37793,"61134":37763,"61135":37807,"61136":37732,"61137":37718,"61138":37703,"61139":37756,"61140":37720,"61141":37724,"61142":37750,"61143":37705,"61144":37712,"61145":37713,"61146":37728,"61147":37741,"61148":37775,"61149":37708,"61150":37738,"61151":37753,"61152":37719,"61153":37717,"61154":37714,"61155":37711,"61156":37745,"61157":37751,"61158":37755,"61159":37729,"61160":37726,"61161":37731,"61162":37735,"61163":37760,"61164":37710,"61165":37721,"61166":38343,"61167":38336,"61168":38345,"61169":38339,"61170":38341,"61171":38327,"61172":38574,"61173":38576,"61174":38572,"61175":38688,"61176":38687,"61177":38680,"61178":38685,"61179":38681,"61180":38810,"61181":38817,"61182":38812,"61248":38814,"61249":38813,"61250":38869,"61251":38868,"61252":38897,"61253":38977,"61254":38980,"61255":38986,"61256":38985,"61257":38981,"61258":38979,"61259":39205,"61260":39211,"61261":39212,"61262":39210,"61263":39219,"61264":39218,"61265":39215,"61266":39213,"61267":39217,"61268":39216,"61269":39320,"61270":39331,"61271":39329,"61272":39426,"61273":39418,"61274":39412,"61275":39415,"61276":39417,"61277":39416,"61278":39414,"61279":39419,"61280":39421,"61281":39422,"61282":39420,"61283":39427,"61284":39614,"61285":39678,"61286":39677,"61287":39681,"61288":39676,"61289":39752,"61290":39834,"61291":39848,"61292":39838,"61293":39835,"61294":39846,"61295":39841,"61296":39845,"61297":39844,"61298":39814,"61299":39842,"61300":39840,"61301":39855,"61302":40243,"61303":40257,"61304":40295,"61305":40246,"61306":40238,"61307":40239,"61308":40241,"61309":40248,"61310":40240,"61345":40261,"61346":40258,"61347":40259,"61348":40254,"61349":40247,"61350":40256,"61351":40253,"61352":32757,"61353":40237,"61354":40586,"61355":40585,"61356":40589,"61357":40624,"61358":40648,"61359":40666,"61360":40699,"61361":40703,"61362":40740,"61363":40739,"61364":40738,"61365":40788,"61366":40864,"61367":20785,"61368":20781,"61369":20782,"61370":22168,"61371":22172,"61372":22167,"61373":22170,"61374":22173,"61375":22169,"61376":22896,"61377":23356,"61378":23657,"61379":23658,"61380":24000,"61381":24173,"61382":24174,"61383":25048,"61384":25055,"61385":25069,"61386":25070,"61387":25073,"61388":25066,"61389":25072,"61390":25067,"61391":25046,"61392":25065,"61393":25855,"61394":25860,"61395":25853,"61396":25848,"61397":25857,"61398":25859,"61399":25852,"61400":26004,"61401":26075,"61402":26330,"61403":26331,"61404":26328,"61405":27333,"61406":27321,"61407":27325,"61408":27361,"61409":27334,"61410":27322,"61411":27318,"61412":27319,"61413":27335,"61414":27316,"61415":27309,"61416":27486,"61417":27593,"61418":27659,"61419":28679,"61420":28684,"61421":28685,"61422":28673,"61423":28677,"61424":28692,"61425":28686,"61426":28671,"61427":28672,"61428":28667,"61429":28710,"61430":28668,"61431":28663,"61432":28682,"61433":29185,"61434":29183,"61435":29177,"61436":29187,"61437":29181,"61438":29558,"61504":29880,"61505":29888,"61506":29877,"61507":29889,"61508":29886,"61509":29878,"61510":29883,"61511":29890,"61512":29972,"61513":29971,"61514":30300,"61515":30308,"61516":30297,"61517":30288,"61518":30291,"61519":30295,"61520":30298,"61521":30374,"61522":30397,"61523":30444,"61524":30658,"61525":30650,"61526":30975,"61527":30988,"61528":30995,"61529":30996,"61530":30985,"61531":30992,"61532":30994,"61533":30993,"61534":31149,"61535":31148,"61536":31327,"61537":31772,"61538":31785,"61539":31769,"61540":31776,"61541":31775,"61542":31789,"61543":31773,"61544":31782,"61545":31784,"61546":31778,"61547":31781,"61548":31792,"61549":32348,"61550":32336,"61551":32342,"61552":32355,"61553":32344,"61554":32354,"61555":32351,"61556":32337,"61557":32352,"61558":32343,"61559":32339,"61560":32693,"61561":32691,"61562":32759,"61563":32760,"61564":32885,"61565":33233,"61566":33234,"61601":33232,"61602":33375,"61603":33374,"61604":34228,"61605":34246,"61606":34240,"61607":34243,"61608":34242,"61609":34227,"61610":34229,"61611":34237,"61612":34247,"61613":34244,"61614":34239,"61615":34251,"61616":34254,"61617":34248,"61618":34245,"61619":34225,"61620":34230,"61621":34258,"61622":34340,"61623":34232,"61624":34231,"61625":34238,"61626":34409,"61627":34791,"61628":34790,"61629":34786,"61630":34779,"61631":34795,"61632":34794,"61633":34789,"61634":34783,"61635":34803,"61636":34788,"61637":34772,"61638":34780,"61639":34771,"61640":34797,"61641":34776,"61642":34787,"61643":34724,"61644":34775,"61645":34777,"61646":34817,"61647":34804,"61648":34792,"61649":34781,"61650":35155,"61651":35147,"61652":35151,"61653":35148,"61654":35142,"61655":35152,"61656":35153,"61657":35145,"61658":35626,"61659":35623,"61660":35619,"61661":35635,"61662":35632,"61663":35637,"61664":35655,"61665":35631,"61666":35644,"61667":35646,"61668":35633,"61669":35621,"61670":35639,"61671":35622,"61672":35638,"61673":35630,"61674":35620,"61675":35643,"61676":35645,"61677":35642,"61678":35906,"61679":35957,"61680":35993,"61681":35992,"61682":35991,"61683":36094,"61684":36100,"61685":36098,"61686":36096,"61687":36444,"61688":36450,"61689":36448,"61690":36439,"61691":36438,"61692":36446,"61693":36453,"61694":36455,"61760":36443,"61761":36442,"61762":36449,"61763":36445,"61764":36457,"61765":36436,"61766":36678,"61767":36679,"61768":36680,"61769":36683,"61770":37160,"61771":37178,"61772":37179,"61773":37182,"61774":37288,"61775":37285,"61776":37287,"61777":37295,"61778":37290,"61779":37813,"61780":37772,"61781":37778,"61782":37815,"61783":37787,"61784":37789,"61785":37769,"61786":37799,"61787":37774,"61788":37802,"61789":37790,"61790":37798,"61791":37781,"61792":37768,"61793":37785,"61794":37791,"61795":37773,"61796":37809,"61797":37777,"61798":37810,"61799":37796,"61800":37800,"61801":37812,"61802":37795,"61803":37797,"61804":38354,"61805":38355,"61806":38353,"61807":38579,"61808":38615,"61809":38618,"61810":24002,"61811":38623,"61812":38616,"61813":38621,"61814":38691,"61815":38690,"61816":38693,"61817":38828,"61818":38830,"61819":38824,"61820":38827,"61821":38820,"61822":38826,"61857":38818,"61858":38821,"61859":38871,"61860":38873,"61861":38870,"61862":38872,"61863":38906,"61864":38992,"61865":38993,"61866":38994,"61867":39096,"61868":39233,"61869":39228,"61870":39226,"61871":39439,"61872":39435,"61873":39433,"61874":39437,"61875":39428,"61876":39441,"61877":39434,"61878":39429,"61879":39431,"61880":39430,"61881":39616,"61882":39644,"61883":39688,"61884":39684,"61885":39685,"61886":39721,"61887":39733,"61888":39754,"61889":39756,"61890":39755,"61891":39879,"61892":39878,"61893":39875,"61894":39871,"61895":39873,"61896":39861,"61897":39864,"61898":39891,"61899":39862,"61900":39876,"61901":39865,"61902":39869,"61903":40284,"61904":40275,"61905":40271,"61906":40266,"61907":40283,"61908":40267,"61909":40281,"61910":40278,"61911":40268,"61912":40279,"61913":40274,"61914":40276,"61915":40287,"61916":40280,"61917":40282,"61918":40590,"61919":40588,"61920":40671,"61921":40705,"61922":40704,"61923":40726,"61924":40741,"61925":40747,"61926":40746,"61927":40745,"61928":40744,"61929":40780,"61930":40789,"61931":20788,"61932":20789,"61933":21142,"61934":21239,"61935":21428,"61936":22187,"61937":22189,"61938":22182,"61939":22183,"61940":22186,"61941":22188,"61942":22746,"61943":22749,"61944":22747,"61945":22802,"61946":23357,"61947":23358,"61948":23359,"61949":24003,"61950":24176,"62016":24511,"62017":25083,"62018":25863,"62019":25872,"62020":25869,"62021":25865,"62022":25868,"62023":25870,"62024":25988,"62025":26078,"62026":26077,"62027":26334,"62028":27367,"62029":27360,"62030":27340,"62031":27345,"62032":27353,"62033":27339,"62034":27359,"62035":27356,"62036":27344,"62037":27371,"62038":27343,"62039":27341,"62040":27358,"62041":27488,"62042":27568,"62043":27660,"62044":28697,"62045":28711,"62046":28704,"62047":28694,"62048":28715,"62049":28705,"62050":28706,"62051":28707,"62052":28713,"62053":28695,"62054":28708,"62055":28700,"62056":28714,"62057":29196,"62058":29194,"62059":29191,"62060":29186,"62061":29189,"62062":29349,"62063":29350,"62064":29348,"62065":29347,"62066":29345,"62067":29899,"62068":29893,"62069":29879,"62070":29891,"62071":29974,"62072":30304,"62073":30665,"62074":30666,"62075":30660,"62076":30705,"62077":31005,"62078":31003,"62113":31009,"62114":31004,"62115":30999,"62116":31006,"62117":31152,"62118":31335,"62119":31336,"62120":31795,"62121":31804,"62122":31801,"62123":31788,"62124":31803,"62125":31980,"62126":31978,"62127":32374,"62128":32373,"62129":32376,"62130":32368,"62131":32375,"62132":32367,"62133":32378,"62134":32370,"62135":32372,"62136":32360,"62137":32587,"62138":32586,"62139":32643,"62140":32646,"62141":32695,"62142":32765,"62143":32766,"62144":32888,"62145":33239,"62146":33237,"62147":33380,"62148":33377,"62149":33379,"62150":34283,"62151":34289,"62152":34285,"62153":34265,"62154":34273,"62155":34280,"62156":34266,"62157":34263,"62158":34284,"62159":34290,"62160":34296,"62161":34264,"62162":34271,"62163":34275,"62164":34268,"62165":34257,"62166":34288,"62167":34278,"62168":34287,"62169":34270,"62170":34274,"62171":34816,"62172":34810,"62173":34819,"62174":34806,"62175":34807,"62176":34825,"62177":34828,"62178":34827,"62179":34822,"62180":34812,"62181":34824,"62182":34815,"62183":34826,"62184":34818,"62185":35170,"62186":35162,"62187":35163,"62188":35159,"62189":35169,"62190":35164,"62191":35160,"62192":35165,"62193":35161,"62194":35208,"62195":35255,"62196":35254,"62197":35318,"62198":35664,"62199":35656,"62200":35658,"62201":35648,"62202":35667,"62203":35670,"62204":35668,"62205":35659,"62206":35669,"62272":35665,"62273":35650,"62274":35666,"62275":35671,"62276":35907,"62277":35959,"62278":35958,"62279":35994,"62280":36102,"62281":36103,"62282":36105,"62283":36268,"62284":36266,"62285":36269,"62286":36267,"62287":36461,"62288":36472,"62289":36467,"62290":36458,"62291":36463,"62292":36475,"62293":36546,"62294":36690,"62295":36689,"62296":36687,"62297":36688,"62298":36691,"62299":36788,"62300":37184,"62301":37183,"62302":37296,"62303":37293,"62304":37854,"62305":37831,"62306":37839,"62307":37826,"62308":37850,"62309":37840,"62310":37881,"62311":37868,"62312":37836,"62313":37849,"62314":37801,"62315":37862,"62316":37834,"62317":37844,"62318":37870,"62319":37859,"62320":37845,"62321":37828,"62322":37838,"62323":37824,"62324":37842,"62325":37863,"62326":38269,"62327":38362,"62328":38363,"62329":38625,"62330":38697,"62331":38699,"62332":38700,"62333":38696,"62334":38694,"62369":38835,"62370":38839,"62371":38838,"62372":38877,"62373":38878,"62374":38879,"62375":39004,"62376":39001,"62377":39005,"62378":38999,"62379":39103,"62380":39101,"62381":39099,"62382":39102,"62383":39240,"62384":39239,"62385":39235,"62386":39334,"62387":39335,"62388":39450,"62389":39445,"62390":39461,"62391":39453,"62392":39460,"62393":39451,"62394":39458,"62395":39456,"62396":39463,"62397":39459,"62398":39454,"62399":39452,"62400":39444,"62401":39618,"62402":39691,"62403":39690,"62404":39694,"62405":39692,"62406":39735,"62407":39914,"62408":39915,"62409":39904,"62410":39902,"62411":39908,"62412":39910,"62413":39906,"62414":39920,"62415":39892,"62416":39895,"62417":39916,"62418":39900,"62419":39897,"62420":39909,"62421":39893,"62422":39905,"62423":39898,"62424":40311,"62425":40321,"62426":40330,"62427":40324,"62428":40328,"62429":40305,"62430":40320,"62431":40312,"62432":40326,"62433":40331,"62434":40332,"62435":40317,"62436":40299,"62437":40308,"62438":40309,"62439":40304,"62440":40297,"62441":40325,"62442":40307,"62443":40315,"62444":40322,"62445":40303,"62446":40313,"62447":40319,"62448":40327,"62449":40296,"62450":40596,"62451":40593,"62452":40640,"62453":40700,"62454":40749,"62455":40768,"62456":40769,"62457":40781,"62458":40790,"62459":40791,"62460":40792,"62461":21303,"62462":22194,"62528":22197,"62529":22195,"62530":22755,"62531":23365,"62532":24006,"62533":24007,"62534":24302,"62535":24303,"62536":24512,"62537":24513,"62538":25081,"62539":25879,"62540":25878,"62541":25877,"62542":25875,"62543":26079,"62544":26344,"62545":26339,"62546":26340,"62547":27379,"62548":27376,"62549":27370,"62550":27368,"62551":27385,"62552":27377,"62553":27374,"62554":27375,"62555":28732,"62556":28725,"62557":28719,"62558":28727,"62559":28724,"62560":28721,"62561":28738,"62562":28728,"62563":28735,"62564":28730,"62565":28729,"62566":28736,"62567":28731,"62568":28723,"62569":28737,"62570":29203,"62571":29204,"62572":29352,"62573":29565,"62574":29564,"62575":29882,"62576":30379,"62577":30378,"62578":30398,"62579":30445,"62580":30668,"62581":30670,"62582":30671,"62583":30669,"62584":30706,"62585":31013,"62586":31011,"62587":31015,"62588":31016,"62589":31012,"62590":31017,"62625":31154,"62626":31342,"62627":31340,"62628":31341,"62629":31479,"62630":31817,"62631":31816,"62632":31818,"62633":31815,"62634":31813,"62635":31982,"62636":32379,"62637":32382,"62638":32385,"62639":32384,"62640":32698,"62641":32767,"62642":32889,"62643":33243,"62644":33241,"62645":33291,"62646":33384,"62647":33385,"62648":34338,"62649":34303,"62650":34305,"62651":34302,"62652":34331,"62653":34304,"62654":34294,"62655":34308,"62656":34313,"62657":34309,"62658":34316,"62659":34301,"62660":34841,"62661":34832,"62662":34833,"62663":34839,"62664":34835,"62665":34838,"62666":35171,"62667":35174,"62668":35257,"62669":35319,"62670":35680,"62671":35690,"62672":35677,"62673":35688,"62674":35683,"62675":35685,"62676":35687,"62677":35693,"62678":36270,"62679":36486,"62680":36488,"62681":36484,"62682":36697,"62683":36694,"62684":36695,"62685":36693,"62686":36696,"62687":36698,"62688":37005,"62689":37187,"62690":37185,"62691":37303,"62692":37301,"62693":37298,"62694":37299,"62695":37899,"62696":37907,"62697":37883,"62698":37920,"62699":37903,"62700":37908,"62701":37886,"62702":37909,"62703":37904,"62704":37928,"62705":37913,"62706":37901,"62707":37877,"62708":37888,"62709":37879,"62710":37895,"62711":37902,"62712":37910,"62713":37906,"62714":37882,"62715":37897,"62716":37880,"62717":37898,"62718":37887,"62784":37884,"62785":37900,"62786":37878,"62787":37905,"62788":37894,"62789":38366,"62790":38368,"62791":38367,"62792":38702,"62793":38703,"62794":38841,"62795":38843,"62796":38909,"62797":38910,"62798":39008,"62799":39010,"62800":39011,"62801":39007,"62802":39105,"62803":39106,"62804":39248,"62805":39246,"62806":39257,"62807":39244,"62808":39243,"62809":39251,"62810":39474,"62811":39476,"62812":39473,"62813":39468,"62814":39466,"62815":39478,"62816":39465,"62817":39470,"62818":39480,"62819":39469,"62820":39623,"62821":39626,"62822":39622,"62823":39696,"62824":39698,"62825":39697,"62826":39947,"62827":39944,"62828":39927,"62829":39941,"62830":39954,"62831":39928,"62832":40000,"62833":39943,"62834":39950,"62835":39942,"62836":39959,"62837":39956,"62838":39945,"62839":40351,"62840":40345,"62841":40356,"62842":40349,"62843":40338,"62844":40344,"62845":40336,"62846":40347,"62881":40352,"62882":40340,"62883":40348,"62884":40362,"62885":40343,"62886":40353,"62887":40346,"62888":40354,"62889":40360,"62890":40350,"62891":40355,"62892":40383,"62893":40361,"62894":40342,"62895":40358,"62896":40359,"62897":40601,"62898":40603,"62899":40602,"62900":40677,"62901":40676,"62902":40679,"62903":40678,"62904":40752,"62905":40750,"62906":40795,"62907":40800,"62908":40798,"62909":40797,"62910":40793,"62911":40849,"62912":20794,"62913":20793,"62914":21144,"62915":21143,"62916":22211,"62917":22205,"62918":22206,"62919":23368,"62920":23367,"62921":24011,"62922":24015,"62923":24305,"62924":25085,"62925":25883,"62926":27394,"62927":27388,"62928":27395,"62929":27384,"62930":27392,"62931":28739,"62932":28740,"62933":28746,"62934":28744,"62935":28745,"62936":28741,"62937":28742,"62938":29213,"62939":29210,"62940":29209,"62941":29566,"62942":29975,"62943":30314,"62944":30672,"62945":31021,"62946":31025,"62947":31023,"62948":31828,"62949":31827,"62950":31986,"62951":32394,"62952":32391,"62953":32392,"62954":32395,"62955":32390,"62956":32397,"62957":32589,"62958":32699,"62959":32816,"62960":33245,"62961":34328,"62962":34346,"62963":34342,"62964":34335,"62965":34339,"62966":34332,"62967":34329,"62968":34343,"62969":34350,"62970":34337,"62971":34336,"62972":34345,"62973":34334,"62974":34341,"63040":34857,"63041":34845,"63042":34843,"63043":34848,"63044":34852,"63045":34844,"63046":34859,"63047":34890,"63048":35181,"63049":35177,"63050":35182,"63051":35179,"63052":35322,"63053":35705,"63054":35704,"63055":35653,"63056":35706,"63057":35707,"63058":36112,"63059":36116,"63060":36271,"63061":36494,"63062":36492,"63063":36702,"63064":36699,"63065":36701,"63066":37190,"63067":37188,"63068":37189,"63069":37305,"63070":37951,"63071":37947,"63072":37942,"63073":37929,"63074":37949,"63075":37948,"63076":37936,"63077":37945,"63078":37930,"63079":37943,"63080":37932,"63081":37952,"63082":37937,"63083":38373,"63084":38372,"63085":38371,"63086":38709,"63087":38714,"63088":38847,"63089":38881,"63090":39012,"63091":39113,"63092":39110,"63093":39104,"63094":39256,"63095":39254,"63096":39481,"63097":39485,"63098":39494,"63099":39492,"63100":39490,"63101":39489,"63102":39482,"63137":39487,"63138":39629,"63139":39701,"63140":39703,"63141":39704,"63142":39702,"63143":39738,"63144":39762,"63145":39979,"63146":39965,"63147":39964,"63148":39980,"63149":39971,"63150":39976,"63151":39977,"63152":39972,"63153":39969,"63154":40375,"63155":40374,"63156":40380,"63157":40385,"63158":40391,"63159":40394,"63160":40399,"63161":40382,"63162":40389,"63163":40387,"63164":40379,"63165":40373,"63166":40398,"63167":40377,"63168":40378,"63169":40364,"63170":40392,"63171":40369,"63172":40365,"63173":40396,"63174":40371,"63175":40397,"63176":40370,"63177":40570,"63178":40604,"63179":40683,"63180":40686,"63181":40685,"63182":40731,"63183":40728,"63184":40730,"63185":40753,"63186":40782,"63187":40805,"63188":40804,"63189":40850,"63190":20153,"63191":22214,"63192":22213,"63193":22219,"63194":22897,"63195":23371,"63196":23372,"63197":24021,"63198":24017,"63199":24306,"63200":25889,"63201":25888,"63202":25894,"63203":25890,"63204":27403,"63205":27400,"63206":27401,"63207":27661,"63208":28757,"63209":28758,"63210":28759,"63211":28754,"63212":29214,"63213":29215,"63214":29353,"63215":29567,"63216":29912,"63217":29909,"63218":29913,"63219":29911,"63220":30317,"63221":30381,"63222":31029,"63223":31156,"63224":31344,"63225":31345,"63226":31831,"63227":31836,"63228":31833,"63229":31835,"63230":31834,"63296":31988,"63297":31985,"63298":32401,"63299":32591,"63300":32647,"63301":33246,"63302":33387,"63303":34356,"63304":34357,"63305":34355,"63306":34348,"63307":34354,"63308":34358,"63309":34860,"63310":34856,"63311":34854,"63312":34858,"63313":34853,"63314":35185,"63315":35263,"63316":35262,"63317":35323,"63318":35710,"63319":35716,"63320":35714,"63321":35718,"63322":35717,"63323":35711,"63324":36117,"63325":36501,"63326":36500,"63327":36506,"63328":36498,"63329":36496,"63330":36502,"63331":36503,"63332":36704,"63333":36706,"63334":37191,"63335":37964,"63336":37968,"63337":37962,"63338":37963,"63339":37967,"63340":37959,"63341":37957,"63342":37960,"63343":37961,"63344":37958,"63345":38719,"63346":38883,"63347":39018,"63348":39017,"63349":39115,"63350":39252,"63351":39259,"63352":39502,"63353":39507,"63354":39508,"63355":39500,"63356":39503,"63357":39496,"63358":39498,"63393":39497,"63394":39506,"63395":39504,"63396":39632,"63397":39705,"63398":39723,"63399":39739,"63400":39766,"63401":39765,"63402":40006,"63403":40008,"63404":39999,"63405":40004,"63406":39993,"63407":39987,"63408":40001,"63409":39996,"63410":39991,"63411":39988,"63412":39986,"63413":39997,"63414":39990,"63415":40411,"63416":40402,"63417":40414,"63418":40410,"63419":40395,"63420":40400,"63421":40412,"63422":40401,"63423":40415,"63424":40425,"63425":40409,"63426":40408,"63427":40406,"63428":40437,"63429":40405,"63430":40413,"63431":40630,"63432":40688,"63433":40757,"63434":40755,"63435":40754,"63436":40770,"63437":40811,"63438":40853,"63439":40866,"63440":20797,"63441":21145,"63442":22760,"63443":22759,"63444":22898,"63445":23373,"63446":24024,"63447":34863,"63448":24399,"63449":25089,"63450":25091,"63451":25092,"63452":25897,"63453":25893,"63454":26006,"63455":26347,"63456":27409,"63457":27410,"63458":27407,"63459":27594,"63460":28763,"63461":28762,"63462":29218,"63463":29570,"63464":29569,"63465":29571,"63466":30320,"63467":30676,"63468":31847,"63469":31846,"63470":32405,"63471":33388,"63472":34362,"63473":34368,"63474":34361,"63475":34364,"63476":34353,"63477":34363,"63478":34366,"63479":34864,"63480":34866,"63481":34862,"63482":34867,"63483":35190,"63484":35188,"63485":35187,"63486":35326,"63552":35724,"63553":35726,"63554":35723,"63555":35720,"63556":35909,"63557":36121,"63558":36504,"63559":36708,"63560":36707,"63561":37308,"63562":37986,"63563":37973,"63564":37981,"63565":37975,"63566":37982,"63567":38852,"63568":38853,"63569":38912,"63570":39510,"63571":39513,"63572":39710,"63573":39711,"63574":39712,"63575":40018,"63576":40024,"63577":40016,"63578":40010,"63579":40013,"63580":40011,"63581":40021,"63582":40025,"63583":40012,"63584":40014,"63585":40443,"63586":40439,"63587":40431,"63588":40419,"63589":40427,"63590":40440,"63591":40420,"63592":40438,"63593":40417,"63594":40430,"63595":40422,"63596":40434,"63597":40432,"63598":40418,"63599":40428,"63600":40436,"63601":40435,"63602":40424,"63603":40429,"63604":40642,"63605":40656,"63606":40690,"63607":40691,"63608":40710,"63609":40732,"63610":40760,"63611":40759,"63612":40758,"63613":40771,"63614":40783,"63649":40817,"63650":40816,"63651":40814,"63652":40815,"63653":22227,"63654":22221,"63655":23374,"63656":23661,"63657":25901,"63658":26349,"63659":26350,"63660":27411,"63661":28767,"63662":28769,"63663":28765,"63664":28768,"63665":29219,"63666":29915,"63667":29925,"63668":30677,"63669":31032,"63670":31159,"63671":31158,"63672":31850,"63673":32407,"63674":32649,"63675":33389,"63676":34371,"63677":34872,"63678":34871,"63679":34869,"63680":34891,"63681":35732,"63682":35733,"63683":36510,"63684":36511,"63685":36512,"63686":36509,"63687":37310,"63688":37309,"63689":37314,"63690":37995,"63691":37992,"63692":37993,"63693":38629,"63694":38726,"63695":38723,"63696":38727,"63697":38855,"63698":38885,"63699":39518,"63700":39637,"63701":39769,"63702":40035,"63703":40039,"63704":40038,"63705":40034,"63706":40030,"63707":40032,"63708":40450,"63709":40446,"63710":40455,"63711":40451,"63712":40454,"63713":40453,"63714":40448,"63715":40449,"63716":40457,"63717":40447,"63718":40445,"63719":40452,"63720":40608,"63721":40734,"63722":40774,"63723":40820,"63724":40821,"63725":40822,"63726":22228,"63727":25902,"63728":26040,"63729":27416,"63730":27417,"63731":27415,"63732":27418,"63733":28770,"63734":29222,"63735":29354,"63736":30680,"63737":30681,"63738":31033,"63739":31849,"63740":31851,"63741":31990,"63742":32410,"63808":32408,"63809":32411,"63810":32409,"63811":33248,"63812":33249,"63813":34374,"63814":34375,"63815":34376,"63816":35193,"63817":35194,"63818":35196,"63819":35195,"63820":35327,"63821":35736,"63822":35737,"63823":36517,"63824":36516,"63825":36515,"63826":37998,"63827":37997,"63828":37999,"63829":38001,"63830":38003,"63831":38729,"63832":39026,"63833":39263,"63834":40040,"63835":40046,"63836":40045,"63837":40459,"63838":40461,"63839":40464,"63840":40463,"63841":40466,"63842":40465,"63843":40609,"63844":40693,"63845":40713,"63846":40775,"63847":40824,"63848":40827,"63849":40826,"63850":40825,"63851":22302,"63852":28774,"63853":31855,"63854":34876,"63855":36274,"63856":36518,"63857":37315,"63858":38004,"63859":38008,"63860":38006,"63861":38005,"63862":39520,"63863":40052,"63864":40051,"63865":40049,"63866":40053,"63867":40468,"63868":40467,"63869":40694,"63870":40714,"63905":40868,"63906":28776,"63907":28773,"63908":31991,"63909":34410,"63910":34878,"63911":34877,"63912":34879,"63913":35742,"63914":35996,"63915":36521,"63916":36553,"63917":38731,"63918":39027,"63919":39028,"63920":39116,"63921":39265,"63922":39339,"63923":39524,"63924":39526,"63925":39527,"63926":39716,"63927":40469,"63928":40471,"63929":40776,"63930":25095,"63931":27422,"63932":29223,"63933":34380,"63934":36520,"63935":38018,"63936":38016,"63937":38017,"63938":39529,"63939":39528,"63940":39726,"63941":40473,"63942":29225,"63943":34379,"63944":35743,"63945":38019,"63946":40057,"63947":40631,"63948":30325,"63949":39531,"63950":40058,"63951":40477,"63952":28777,"63953":28778,"63954":40612,"63955":40830,"63956":40777,"63957":40856,"63958":30849,"63959":37561,"63960":35023,"63961":22715,"63962":24658,"63963":31911,"63964":23290,"63965":9556,"63966":9574,"63967":9559,"63968":9568,"63969":9580,"63970":9571,"63971":9562,"63972":9577,"63973":9565,"63974":9554,"63975":9572,"63976":9557,"63977":9566,"63978":9578,"63979":9569,"63980":9560,"63981":9575,"63982":9563,"63983":9555,"63984":9573,"63985":9558,"63986":9567,"63987":9579,"63988":9570,"63989":9561,"63990":9576,"63991":9564,"63992":9553,"63993":9552,"63994":9581,"63995":9582,"63996":9584,"63997":9583,"63998":9619,"64064":57344,"64065":57345,"64066":57346,"64067":57347,"64068":57348,"64069":57349,"64070":57350,"64071":57351,"64072":57352,"64073":57353,"64074":57354,"64075":57355,"64076":57356,"64077":57357,"64078":57358,"64079":57359,"64080":57360,"64081":57361,"64082":57362,"64083":57363,"64084":57364,"64085":57365,"64086":57366,"64087":57367,"64088":57368,"64089":57369,"64090":57370,"64091":57371,"64092":57372,"64093":57373,"64094":57374,"64095":57375,"64096":57376,"64097":57377,"64098":57378,"64099":57379,"64100":29234,"64101":29244,"64102":29286,"64103":29314,"64104":29327,"64105":29343,"64106":29357,"64107":29361,"64108":29368,"64109":29374,"64110":29389,"64111":29403,"64112":29476,"64113":29487,"64114":29496,"64115":29497,"64116":29629,"64117":29646,"64118":29681,"64119":29814,"64120":29858,"64121":29953,"64122":29977,"64123":29987,"64124":30012,"64125":30020,"64126":30025,"64161":30029,"64162":30061,"64163":30082,"64164":30083,"64165":30089,"64166":30124,"64167":30166,"64168":30185,"64169":30272,"64170":30285,"64171":30292,"64172":30312,"64173":30336,"64174":30339,"64175":30352,"64176":30391,"64177":30393,"64178":30477,"64179":30494,"64180":30531,"64181":30744,"64182":30748,"64183":30777,"64184":30780,"64185":30791,"64186":30806,"64187":30842,"64188":30901,"64189":30905,"64190":30918,"64191":30937,"64192":30983,"64193":31024,"64194":31028,"64195":31035,"64196":31104,"64197":31133,"64198":31171,"64199":31201,"64200":31238,"64201":31246,"64202":31299,"64203":31312,"64204":31427,"64205":31442,"64206":31458,"64207":31463,"64208":31480,"64209":31542,"64210":31586,"64211":31596,"64212":31610,"64213":31611,"64214":31642,"64215":31646,"64216":31647,"64217":31650,"64218":31655,"64219":31734,"64220":31762,"64221":31764,"64222":31823,"64223":31830,"64224":31832,"64225":31915,"64226":31994,"64227":32072,"64228":32075,"64229":32119,"64230":32212,"64231":32213,"64232":32214,"64233":32228,"64234":32333,"64235":32349,"64236":32383,"64237":32393,"64238":32398,"64239":32402,"64240":32468,"64241":32497,"64242":32530,"64243":32560,"64244":32625,"64245":32642,"64246":32686,"64247":32710,"64248":32800,"64249":32802,"64250":32805,"64251":32817,"64252":32863,"64253":32872,"64254":32940,"64320":32951,"64321":20890,"64322":21526,"64323":21524,"64324":13535,"64325":19581,"64326":25283,"64327":57508,"64328":57509,"64329":57510,"64330":21707,"64331":57512,"64332":21948,"64333":32950,"64334":20903,"64335":57516,"64336":57517,"64337":57518,"64338":21779,"64339":33318,"64340":57521,"64341":21790,"64342":21982,"64343":25529,"64344":26776,"64345":57526,"64346":21762,"64347":21865,"64348":30132,"64349":25596,"64350":40580,"64351":37418,"64352":57533,"64353":57534,"64354":57535,"64355":35015,"64356":24734,"64357":22053,"64358":28997,"64359":23282,"64360":57541,"64361":21135,"64362":22095,"64363":30611,"64364":34694,"64365":36397,"64366":33206,"64367":13822,"64368":29174,"64369":57550,"64370":34820,"64371":37765,"64372":57553,"64373":57554,"64374":30310,"64375":57556,"64376":40050,"64377":57558,"64378":25294,"64379":57560,"64380":40598,"64381":18825,"64382":31955,"64417":36570,"64418":40619,"64419":25831,"64420":57567,"64421":33450,"64422":26471,"64423":28018,"64424":30982,"64425":31172,"64426":32590,"64427":34798,"64428":57575,"64429":33726,"64430":34351,"64431":35237,"64432":17935,"64433":57580,"64434":39112,"64435":39232,"64436":39245,"64437":39436,"64438":39639,"64439":40600,"64440":40742,"64441":57588,"64442":20227,"64443":57590,"64444":20281,"64445":20274,"64446":20395,"64447":20566,"64448":57595,"64449":20526,"64450":20646,"64451":20697,"64452":20750,"64453":20717,"64454":20737,"64455":20980,"64456":21023,"64457":21088,"64458":21079,"64459":21146,"64460":21201,"64461":21216,"64462":21217,"64463":20947,"64464":20959,"64465":30022,"64466":20990,"64467":21298,"64468":21292,"64469":21299,"64470":21419,"64471":21418,"64472":40846,"64473":21609,"64474":21660,"64475":21466,"64476":27338,"64477":21875,"64478":57625,"64479":13782,"64480":57627,"64481":22033,"64482":22093,"64483":57630,"64484":22100,"64485":13811,"64486":57633,"64487":22342,"64488":22394,"64489":22375,"64490":22586,"64491":22502,"64492":22493,"64493":22592,"64494":57641,"64495":22566,"64496":22748,"64497":22967,"64498":23001,"64499":23584,"64500":57647,"64501":23761,"64502":23785,"64503":23878,"64504":23950,"64505":57652,"64506":24053,"64507":24075,"64508":24082,"64509":24110,"64510":24158,"64576":57658,"64577":24397,"64578":31357,"64579":23491,"64580":31419,"64581":57663,"64582":57664,"64583":24484,"64584":24506,"64585":24508,"64586":57668,"64587":24695,"64588":24740,"64589":24755,"64590":24829,"64591":24880,"64592":57674,"64593":24988,"64594":24921,"64595":24957,"64596":24924,"64597":25471,"64598":25058,"64599":28885,"64600":25145,"64601":25192,"64602":25221,"64603":25218,"64604":25254,"64605":25301,"64606":25444,"64607":25397,"64608":25744,"64609":14940,"64610":26184,"64611":26215,"64612":26398,"64613":26627,"64614":26540,"64615":26617,"64616":26806,"64617":26924,"64618":26881,"64619":26880,"64620":26826,"64621":26995,"64622":27008,"64623":26942,"64624":57706,"64625":27058,"64626":27072,"64627":27018,"64628":27130,"64629":27113,"64630":27314,"64631":27218,"64632":27293,"64633":27421,"64634":27474,"64635":27642,"64636":15569,"64637":27854,"64638":28239,"64673":28089,"64674":28484,"64675":57723,"64676":28634,"64677":28801,"64678":31180,"64679":28980,"64680":15820,"64681":29046,"64682":57730,"64683":57731,"64684":29205,"64685":29264,"64686":29319,"64687":29484,"64688":29362,"64689":29410,"64690":29442,"64691":29512,"64692":29480,"64693":29519,"64694":29553,"64695":25989,"64696":57744,"64697":29789,"64698":29800,"64699":29982,"64700":30035,"64701":30074,"64702":30369,"64703":30412,"64704":30500,"64705":30507,"64706":16485,"64707":30803,"64708":30931,"64709":30936,"64710":40318,"64711":30895,"64712":57760,"64713":24898,"64714":31145,"64715":39994,"64716":31188,"64717":57765,"64718":31277,"64719":31294,"64720":31305,"64721":31453,"64722":31450,"64723":30147,"64724":30215,"64725":30210,"64726":57774,"64727":30311,"64728":30319,"64729":22048,"64730":35431,"64731":40727,"64732":31519,"64733":31634,"64734":31651,"64735":31695,"64736":57784,"64737":31740,"64738":31810,"64739":31825,"64740":31837,"64741":31856,"64742":31870,"64743":31878,"64744":31875,"64745":31916,"64746":31943,"64747":31938,"64748":57796,"64749":31962,"64750":57798,"64751":32077,"64752":32090,"64753":32245,"64754":32295,"64755":32366,"64756":40597,"64757":21107,"64758":32797,"64759":32866,"64760":32867,"64761":32870,"64762":32859,"64763":32934,"64764":33027,"64765":40577,"64766":33224,"64832":57815,"64833":36768,"64834":33270,"64835":33306,"64836":57819,"64837":34673,"64838":34729,"64839":34700,"64840":40606,"64841":34753,"64842":40476,"64843":57826,"64844":34774,"64845":34805,"64846":34831,"64847":34840,"64848":34861,"64849":34882,"64850":34885,"64851":39989,"64852":34926,"64853":34986,"64854":34976,"64855":25245,"64856":35139,"64857":35149,"64858":29042,"64859":34910,"64860":57843,"64861":33533,"64862":17591,"64863":33488,"64864":33669,"64865":40194,"64866":40809,"64867":33824,"64868":57851,"64869":34010,"64870":33965,"64871":17659,"64872":34123,"64873":57856,"64874":34306,"64875":34320,"64876":25553,"64877":35209,"64878":35210,"64879":35220,"64880":40005,"64881":35260,"64882":35454,"64883":35401,"64884":35596,"64885":35651,"64886":35713,"64887":35660,"64888":57871,"64889":36013,"64890":36075,"64891":36087,"64892":36108,"64893":36226,"64894":36262,"64929":36308,"64930":36392,"64931":36431,"64932":36471,"64933":36469,"64934":36519,"64935":36633,"64936":57885,"64937":36700,"64938":40260,"64939":37060,"64940":37201,"64941":57890,"64942":37212,"64943":37209,"64944":37223,"64945":37244,"64946":37262,"64947":37307,"64948":40616,"64949":36950,"64950":36940,"64951":37374,"64952":37474,"64953":37566,"64954":37739,"64955":37742,"64956":37818,"64957":37927,"64958":38295,"64959":38311,"64960":57909,"64961":38456,"64962":57911,"64963":38531,"64964":38550,"64965":38529,"64966":38589,"64967":38659,"64968":38689,"64969":38705,"64970":38751,"64971":38815,"64972":38836,"64973":38840,"64974":38842,"64975":38846,"64976":38856,"64977":40639,"64978":38943,"64979":38958,"64980":40869,"64981":38983,"64982":38987,"64983":39014,"64984":39020,"64985":39092,"64986":40794,"64987":39132,"64988":39142,"64989":39234,"64990":39225,"64991":39227,"64992":40787,"64993":39242,"64994":40773,"64995":19326,"64996":39386,"64997":31432,"64998":39610,"64999":39613,"65000":40706,"65001":39722,"65002":57951,"65003":39725,"65004":39650,"65005":39682,"65006":39679,"65007":19463,"65008":39689,"65009":19460,"65010":19515,"65011":39823,"65012":39837,"65013":39856,"65014":39948,"65015":39957,"65016":39946,"65017":39935,"65018":39982,"65019":33000,"65020":33001,"65021":33004,"65022":33038,"65088":27705,"65089":20074,"65090":38465,"65091":22770,"65092":31074,"65093":26658,"65094":57978,"65095":57979,"65096":33031,"65097":22487,"65098":17642,"65099":25653,"65100":34100,"65101":16607,"65102":57986,"65103":26906,"65104":39938,"65105":30129,"65106":33747,"65107":29041,"65108":27147,"65109":57993,"65110":27258,"65111":39668,"65112":57996,"65113":57997,"65114":30649,"65115":25904,"65116":28054,"65117":22071,"65118":26405,"65119":27179,"65120":32093,"65121":36961,"65122":20120,"65123":31910,"65124":31545,"65125":58009,"65126":22901,"65127":14023,"65128":28799,"65129":58013,"65130":28299,"65131":58015,"65132":58016,"65133":38749,"65134":37584,"65135":22356,"65136":58020,"65137":16089,"65138":58022,"65139":58023,"65140":24985,"65141":29792,"65142":28991,"65143":31022,"65144":23190,"65145":37704,"65146":26254,"65147":20477,"65148":37697,"65149":13908,"65150":23925,"65185":28702,"65186":25979,"65187":28813,"65188":24269,"65189":58039,"65190":24743,"65191":31408,"65192":24419,"65193":58043,"65194":29687,"65195":58045,"65196":29800,"65197":30132,"65198":58048,"65199":39785,"65200":189,"65201":8531,"65202":8532,"65203":188,"65204":190,"65205":8533,"65206":8534,"65207":8535,"65208":8536,"65209":8537,"65210":8538,"65211":34450,"65212":34464,"65213":34477,"65214":34482,"65215":34725,"65216":34737,"65217":8539,"65218":8540,"65219":8541,"65220":8542,"65221":34778,"65222":34895,"65223":34912,"65224":34951,"65225":34959,"65226":34960,"65227":35046,"65228":35071,"65229":35072,"65230":35108,"65231":35143,"65232":35156,"65233":35173,"65234":35200,"65235":35217,"65236":35356,"65237":35369,"65238":35371,"65239":35384,"65240":35389,"65241":8978,"65242":35472,"65243":35476,"65244":35484,"65245":35497,"65246":35503,"65247":35508,"65248":35562,"65249":35615,"65250":8240,"65251":35647,"65252":35661,"65253":35678,"65254":35682,"65255":35689,"65256":35739,"65257":35921,"65258":35995,"65259":35999,"65260":36052,"65261":36054,"65262":33042,"65263":33073,"65264":33078,"65265":33119,"65266":33133,"65267":33149,"65268":33171,"65269":33194,"65270":33208,"65271":33217,"65272":33321,"65273":33325,"65274":33326,"65275":33342,"65276":33378,"65277":33386,"65278":33416,"NaN":null} \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js b/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js deleted file mode 100644 index c464623..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js +++ /dev/null @@ -1 +0,0 @@ -module.exports={33088:19970,33089:19972,33090:19973,33091:19974,33092:19983,33093:19986,33094:19991,33095:19999,33096:20000,33097:20001,33098:20003,33099:20006,33100:20009,33101:20014,33102:20015,33103:20017,33104:20019,33105:20021,33106:20023,33107:20028,33108:20032,33109:20033,33110:20034,33111:20036,33112:20038,33113:20042,33114:20049,33115:20053,33116:20055,33117:20058,33118:20059,33119:20066,33120:20067,33121:20068,33122:20069,33123:20071,33124:20072,33125:20074,33126:20075,33127:20076,33128:20077,33129:20078,33130:20079,33131:20082,33132:20084,33133:20085,33134:20086,33135:20087,33136:20088,33137:20089,33138:20090,33139:20091,33140:20092,33141:20093,33142:20095,33143:20096,33144:20097,33145:20098,33146:20099,33147:20100,33148:20101,33149:20103,33150:20106,33152:20112,33153:20118,33154:20119,33155:20121,33156:20124,33157:20125,33158:20126,33159:20131,33160:20138,33161:20143,33162:20144,33163:20145,33164:20148,33165:20150,33166:20151,33167:20152,33168:20153,33169:20156,33170:20157,33171:20158,33172:20168,33173:20172,33174:20175,33175:20176,33176:20178,33177:20186,33178:20187,33179:20188,33180:20192,33181:20194,33182:20198,33183:20199,33184:20201,33185:20205,33186:20206,33187:20207,33188:20209,33189:20212,33190:20216,33191:20217,33192:20218,33193:20220,33194:20222,33195:20224,33196:20226,33197:20227,33198:20228,33199:20229,33200:20230,33201:20231,33202:20232,33203:20235,33204:20236,33205:20242,33206:20243,33207:20244,33208:20245,33209:20246,33210:20252,33211:20253,33212:20257,33213:20259,33214:20264,33215:20265,33216:20268,33217:20269,33218:20270,33219:20273,33220:20275,33221:20277,33222:20279,33223:20281,33224:20283,33225:20286,33226:20287,33227:20288,33228:20289,33229:20290,33230:20292,33231:20293,33232:20295,33233:20296,33234:20297,33235:20298,33236:20299,33237:20300,33238:20306,33239:20308,33240:20310,33241:20321,33242:20322,33243:20326,33244:20328,33245:20330,33246:20331,33247:20333,33248:20334,33249:20337,33250:20338,33251:20341,33252:20343,33253:20344,33254:20345,33255:20346,33256:20349,33257:20352,33258:20353,33259:20354,33260:20357,33261:20358,33262:20359,33263:20362,33264:20364,33265:20366,33266:20368,33267:20370,33268:20371,33269:20373,33270:20374,33271:20376,33272:20377,33273:20378,33274:20380,33275:20382,33276:20383,33277:20385,33278:20386,33344:20388,33345:20395,33346:20397,33347:20400,33348:20401,33349:20402,33350:20403,33351:20404,33352:20406,33353:20407,33354:20408,33355:20409,33356:20410,33357:20411,33358:20412,33359:20413,33360:20414,33361:20416,33362:20417,33363:20418,33364:20422,33365:20423,33366:20424,33367:20425,33368:20427,33369:20428,33370:20429,33371:20434,33372:20435,33373:20436,33374:20437,33375:20438,33376:20441,33377:20443,33378:20448,33379:20450,33380:20452,33381:20453,33382:20455,33383:20459,33384:20460,33385:20464,33386:20466,33387:20468,33388:20469,33389:20470,33390:20471,33391:20473,33392:20475,33393:20476,33394:20477,33395:20479,33396:20480,33397:20481,33398:20482,33399:20483,33400:20484,33401:20485,33402:20486,33403:20487,33404:20488,33405:20489,33406:20490,33408:20491,33409:20494,33410:20496,33411:20497,33412:20499,33413:20501,33414:20502,33415:20503,33416:20507,33417:20509,33418:20510,33419:20512,33420:20514,33421:20515,33422:20516,33423:20519,33424:20523,33425:20527,33426:20528,33427:20529,33428:20530,33429:20531,33430:20532,33431:20533,33432:20534,33433:20535,33434:20536,33435:20537,33436:20539,33437:20541,33438:20543,33439:20544,33440:20545,33441:20546,33442:20548,33443:20549,33444:20550,33445:20553,33446:20554,33447:20555,33448:20557,33449:20560,33450:20561,33451:20562,33452:20563,33453:20564,33454:20566,33455:20567,33456:20568,33457:20569,33458:20571,33459:20573,33460:20574,33461:20575,33462:20576,33463:20577,33464:20578,33465:20579,33466:20580,33467:20582,33468:20583,33469:20584,33470:20585,33471:20586,33472:20587,33473:20589,33474:20590,33475:20591,33476:20592,33477:20593,33478:20594,33479:20595,33480:20596,33481:20597,33482:20600,33483:20601,33484:20602,33485:20604,33486:20605,33487:20609,33488:20610,33489:20611,33490:20612,33491:20614,33492:20615,33493:20617,33494:20618,33495:20619,33496:20620,33497:20622,33498:20623,33499:20624,33500:20625,33501:20626,33502:20627,33503:20628,33504:20629,33505:20630,33506:20631,33507:20632,33508:20633,33509:20634,33510:20635,33511:20636,33512:20637,33513:20638,33514:20639,33515:20640,33516:20641,33517:20642,33518:20644,33519:20646,33520:20650,33521:20651,33522:20653,33523:20654,33524:20655,33525:20656,33526:20657,33527:20659,33528:20660,33529:20661,33530:20662,33531:20663,33532:20664,33533:20665,33534:20668,33600:20669,33601:20670,33602:20671,33603:20672,33604:20673,33605:20674,33606:20675,33607:20676,33608:20677,33609:20678,33610:20679,33611:20680,33612:20681,33613:20682,33614:20683,33615:20684,33616:20685,33617:20686,33618:20688,33619:20689,33620:20690,33621:20691,33622:20692,33623:20693,33624:20695,33625:20696,33626:20697,33627:20699,33628:20700,33629:20701,33630:20702,33631:20703,33632:20704,33633:20705,33634:20706,33635:20707,33636:20708,33637:20709,33638:20712,33639:20713,33640:20714,33641:20715,33642:20719,33643:20720,33644:20721,33645:20722,33646:20724,33647:20726,33648:20727,33649:20728,33650:20729,33651:20730,33652:20732,33653:20733,33654:20734,33655:20735,33656:20736,33657:20737,33658:20738,33659:20739,33660:20740,33661:20741,33662:20744,33664:20745,33665:20746,33666:20748,33667:20749,33668:20750,33669:20751,33670:20752,33671:20753,33672:20755,33673:20756,33674:20757,33675:20758,33676:20759,33677:20760,33678:20761,33679:20762,33680:20763,33681:20764,33682:20765,33683:20766,33684:20767,33685:20768,33686:20770,33687:20771,33688:20772,33689:20773,33690:20774,33691:20775,33692:20776,33693:20777,33694:20778,33695:20779,33696:20780,33697:20781,33698:20782,33699:20783,33700:20784,33701:20785,33702:20786,33703:20787,33704:20788,33705:20789,33706:20790,33707:20791,33708:20792,33709:20793,33710:20794,33711:20795,33712:20796,33713:20797,33714:20798,33715:20802,33716:20807,33717:20810,33718:20812,33719:20814,33720:20815,33721:20816,33722:20818,33723:20819,33724:20823,33725:20824,33726:20825,33727:20827,33728:20829,33729:20830,33730:20831,33731:20832,33732:20833,33733:20835,33734:20836,33735:20838,33736:20839,33737:20841,33738:20842,33739:20847,33740:20850,33741:20858,33742:20862,33743:20863,33744:20867,33745:20868,33746:20870,33747:20871,33748:20874,33749:20875,33750:20878,33751:20879,33752:20880,33753:20881,33754:20883,33755:20884,33756:20888,33757:20890,33758:20893,33759:20894,33760:20895,33761:20897,33762:20899,33763:20902,33764:20903,33765:20904,33766:20905,33767:20906,33768:20909,33769:20910,33770:20916,33771:20920,33772:20921,33773:20922,33774:20926,33775:20927,33776:20929,33777:20930,33778:20931,33779:20933,33780:20936,33781:20938,33782:20941,33783:20942,33784:20944,33785:20946,33786:20947,33787:20948,33788:20949,33789:20950,33790:20951,33856:20952,33857:20953,33858:20954,33859:20956,33860:20958,33861:20959,33862:20962,33863:20963,33864:20965,33865:20966,33866:20967,33867:20968,33868:20969,33869:20970,33870:20972,33871:20974,33872:20977,33873:20978,33874:20980,33875:20983,33876:20990,33877:20996,33878:20997,33879:21001,33880:21003,33881:21004,33882:21007,33883:21008,33884:21011,33885:21012,33886:21013,33887:21020,33888:21022,33889:21023,33890:21025,33891:21026,33892:21027,33893:21029,33894:21030,33895:21031,33896:21034,33897:21036,33898:21039,33899:21041,33900:21042,33901:21044,33902:21045,33903:21052,33904:21054,33905:21060,33906:21061,33907:21062,33908:21063,33909:21064,33910:21065,33911:21067,33912:21070,33913:21071,33914:21074,33915:21075,33916:21077,33917:21079,33918:21080,33920:21081,33921:21082,33922:21083,33923:21085,33924:21087,33925:21088,33926:21090,33927:21091,33928:21092,33929:21094,33930:21096,33931:21099,33932:21100,33933:21101,33934:21102,33935:21104,33936:21105,33937:21107,33938:21108,33939:21109,33940:21110,33941:21111,33942:21112,33943:21113,33944:21114,33945:21115,33946:21116,33947:21118,33948:21120,33949:21123,33950:21124,33951:21125,33952:21126,33953:21127,33954:21129,33955:21130,33956:21131,33957:21132,33958:21133,33959:21134,33960:21135,33961:21137,33962:21138,33963:21140,33964:21141,33965:21142,33966:21143,33967:21144,33968:21145,33969:21146,33970:21148,33971:21156,33972:21157,33973:21158,33974:21159,33975:21166,33976:21167,33977:21168,33978:21172,33979:21173,33980:21174,33981:21175,33982:21176,33983:21177,33984:21178,33985:21179,33986:21180,33987:21181,33988:21184,33989:21185,33990:21186,33991:21188,33992:21189,33993:21190,33994:21192,33995:21194,33996:21196,33997:21197,33998:21198,33999:21199,34000:21201,34001:21203,34002:21204,34003:21205,34004:21207,34005:21209,34006:21210,34007:21211,34008:21212,34009:21213,34010:21214,34011:21216,34012:21217,34013:21218,34014:21219,34015:21221,34016:21222,34017:21223,34018:21224,34019:21225,34020:21226,34021:21227,34022:21228,34023:21229,34024:21230,34025:21231,34026:21233,34027:21234,34028:21235,34029:21236,34030:21237,34031:21238,34032:21239,34033:21240,34034:21243,34035:21244,34036:21245,34037:21249,34038:21250,34039:21251,34040:21252,34041:21255,34042:21257,34043:21258,34044:21259,34045:21260,34046:21262,34112:21265,34113:21266,34114:21267,34115:21268,34116:21272,34117:21275,34118:21276,34119:21278,34120:21279,34121:21282,34122:21284,34123:21285,34124:21287,34125:21288,34126:21289,34127:21291,34128:21292,34129:21293,34130:21295,34131:21296,34132:21297,34133:21298,34134:21299,34135:21300,34136:21301,34137:21302,34138:21303,34139:21304,34140:21308,34141:21309,34142:21312,34143:21314,34144:21316,34145:21318,34146:21323,34147:21324,34148:21325,34149:21328,34150:21332,34151:21336,34152:21337,34153:21339,34154:21341,34155:21349,34156:21352,34157:21354,34158:21356,34159:21357,34160:21362,34161:21366,34162:21369,34163:21371,34164:21372,34165:21373,34166:21374,34167:21376,34168:21377,34169:21379,34170:21383,34171:21384,34172:21386,34173:21390,34174:21391,34176:21392,34177:21393,34178:21394,34179:21395,34180:21396,34181:21398,34182:21399,34183:21401,34184:21403,34185:21404,34186:21406,34187:21408,34188:21409,34189:21412,34190:21415,34191:21418,34192:21419,34193:21420,34194:21421,34195:21423,34196:21424,34197:21425,34198:21426,34199:21427,34200:21428,34201:21429,34202:21431,34203:21432,34204:21433,34205:21434,34206:21436,34207:21437,34208:21438,34209:21440,34210:21443,34211:21444,34212:21445,34213:21446,34214:21447,34215:21454,34216:21455,34217:21456,34218:21458,34219:21459,34220:21461,34221:21466,34222:21468,34223:21469,34224:21470,34225:21473,34226:21474,34227:21479,34228:21492,34229:21498,34230:21502,34231:21503,34232:21504,34233:21506,34234:21509,34235:21511,34236:21515,34237:21524,34238:21528,34239:21529,34240:21530,34241:21532,34242:21538,34243:21540,34244:21541,34245:21546,34246:21552,34247:21555,34248:21558,34249:21559,34250:21562,34251:21565,34252:21567,34253:21569,34254:21570,34255:21572,34256:21573,34257:21575,34258:21577,34259:21580,34260:21581,34261:21582,34262:21583,34263:21585,34264:21594,34265:21597,34266:21598,34267:21599,34268:21600,34269:21601,34270:21603,34271:21605,34272:21607,34273:21609,34274:21610,34275:21611,34276:21612,34277:21613,34278:21614,34279:21615,34280:21616,34281:21620,34282:21625,34283:21626,34284:21630,34285:21631,34286:21633,34287:21635,34288:21637,34289:21639,34290:21640,34291:21641,34292:21642,34293:21645,34294:21649,34295:21651,34296:21655,34297:21656,34298:21660,34299:21662,34300:21663,34301:21664,34302:21665,34368:21666,34369:21669,34370:21678,34371:21680,34372:21682,34373:21685,34374:21686,34375:21687,34376:21689,34377:21690,34378:21692,34379:21694,34380:21699,34381:21701,34382:21706,34383:21707,34384:21718,34385:21720,34386:21723,34387:21728,34388:21729,34389:21730,34390:21731,34391:21732,34392:21739,34393:21740,34394:21743,34395:21744,34396:21745,34397:21748,34398:21749,34399:21750,34400:21751,34401:21752,34402:21753,34403:21755,34404:21758,34405:21760,34406:21762,34407:21763,34408:21764,34409:21765,34410:21768,34411:21770,34412:21771,34413:21772,34414:21773,34415:21774,34416:21778,34417:21779,34418:21781,34419:21782,34420:21783,34421:21784,34422:21785,34423:21786,34424:21788,34425:21789,34426:21790,34427:21791,34428:21793,34429:21797,34430:21798,34432:21800,34433:21801,34434:21803,34435:21805,34436:21810,34437:21812,34438:21813,34439:21814,34440:21816,34441:21817,34442:21818,34443:21819,34444:21821,34445:21824,34446:21826,34447:21829,34448:21831,34449:21832,34450:21835,34451:21836,34452:21837,34453:21838,34454:21839,34455:21841,34456:21842,34457:21843,34458:21844,34459:21847,34460:21848,34461:21849,34462:21850,34463:21851,34464:21853,34465:21854,34466:21855,34467:21856,34468:21858,34469:21859,34470:21864,34471:21865,34472:21867,34473:21871,34474:21872,34475:21873,34476:21874,34477:21875,34478:21876,34479:21881,34480:21882,34481:21885,34482:21887,34483:21893,34484:21894,34485:21900,34486:21901,34487:21902,34488:21904,34489:21906,34490:21907,34491:21909,34492:21910,34493:21911,34494:21914,34495:21915,34496:21918,34497:21920,34498:21921,34499:21922,34500:21923,34501:21924,34502:21925,34503:21926,34504:21928,34505:21929,34506:21930,34507:21931,34508:21932,34509:21933,34510:21934,34511:21935,34512:21936,34513:21938,34514:21940,34515:21942,34516:21944,34517:21946,34518:21948,34519:21951,34520:21952,34521:21953,34522:21954,34523:21955,34524:21958,34525:21959,34526:21960,34527:21962,34528:21963,34529:21966,34530:21967,34531:21968,34532:21973,34533:21975,34534:21976,34535:21977,34536:21978,34537:21979,34538:21982,34539:21984,34540:21986,34541:21991,34542:21993,34543:21997,34544:21998,34545:22000,34546:22001,34547:22004,34548:22006,34549:22008,34550:22009,34551:22010,34552:22011,34553:22012,34554:22015,34555:22018,34556:22019,34557:22020,34558:22021,34624:22022,34625:22023,34626:22026,34627:22027,34628:22029,34629:22032,34630:22033,34631:22034,34632:22035,34633:22036,34634:22037,34635:22038,34636:22039,34637:22041,34638:22042,34639:22044,34640:22045,34641:22048,34642:22049,34643:22050,34644:22053,34645:22054,34646:22056,34647:22057,34648:22058,34649:22059,34650:22062,34651:22063,34652:22064,34653:22067,34654:22069,34655:22071,34656:22072,34657:22074,34658:22076,34659:22077,34660:22078,34661:22080,34662:22081,34663:22082,34664:22083,34665:22084,34666:22085,34667:22086,34668:22087,34669:22088,34670:22089,34671:22090,34672:22091,34673:22095,34674:22096,34675:22097,34676:22098,34677:22099,34678:22101,34679:22102,34680:22106,34681:22107,34682:22109,34683:22110,34684:22111,34685:22112,34686:22113,34688:22115,34689:22117,34690:22118,34691:22119,34692:22125,34693:22126,34694:22127,34695:22128,34696:22130,34697:22131,34698:22132,34699:22133,34700:22135,34701:22136,34702:22137,34703:22138,34704:22141,34705:22142,34706:22143,34707:22144,34708:22145,34709:22146,34710:22147,34711:22148,34712:22151,34713:22152,34714:22153,34715:22154,34716:22155,34717:22156,34718:22157,34719:22160,34720:22161,34721:22162,34722:22164,34723:22165,34724:22166,34725:22167,34726:22168,34727:22169,34728:22170,34729:22171,34730:22172,34731:22173,34732:22174,34733:22175,34734:22176,34735:22177,34736:22178,34737:22180,34738:22181,34739:22182,34740:22183,34741:22184,34742:22185,34743:22186,34744:22187,34745:22188,34746:22189,34747:22190,34748:22192,34749:22193,34750:22194,34751:22195,34752:22196,34753:22197,34754:22198,34755:22200,34756:22201,34757:22202,34758:22203,34759:22205,34760:22206,34761:22207,34762:22208,34763:22209,34764:22210,34765:22211,34766:22212,34767:22213,34768:22214,34769:22215,34770:22216,34771:22217,34772:22219,34773:22220,34774:22221,34775:22222,34776:22223,34777:22224,34778:22225,34779:22226,34780:22227,34781:22229,34782:22230,34783:22232,34784:22233,34785:22236,34786:22243,34787:22245,34788:22246,34789:22247,34790:22248,34791:22249,34792:22250,34793:22252,34794:22254,34795:22255,34796:22258,34797:22259,34798:22262,34799:22263,34800:22264,34801:22267,34802:22268,34803:22272,34804:22273,34805:22274,34806:22277,34807:22279,34808:22283,34809:22284,34810:22285,34811:22286,34812:22287,34813:22288,34814:22289,34880:22290,34881:22291,34882:22292,34883:22293,34884:22294,34885:22295,34886:22296,34887:22297,34888:22298,34889:22299,34890:22301,34891:22302,34892:22304,34893:22305,34894:22306,34895:22308,34896:22309,34897:22310,34898:22311,34899:22315,34900:22321,34901:22322,34902:22324,34903:22325,34904:22326,34905:22327,34906:22328,34907:22332,34908:22333,34909:22335,34910:22337,34911:22339,34912:22340,34913:22341,34914:22342,34915:22344,34916:22345,34917:22347,34918:22354,34919:22355,34920:22356,34921:22357,34922:22358,34923:22360,34924:22361,34925:22370,34926:22371,34927:22373,34928:22375,34929:22380,34930:22382,34931:22384,34932:22385,34933:22386,34934:22388,34935:22389,34936:22392,34937:22393,34938:22394,34939:22397,34940:22398,34941:22399,34942:22400,34944:22401,34945:22407,34946:22408,34947:22409,34948:22410,34949:22413,34950:22414,34951:22415,34952:22416,34953:22417,34954:22420,34955:22421,34956:22422,34957:22423,34958:22424,34959:22425,34960:22426,34961:22428,34962:22429,34963:22430,34964:22431,34965:22437,34966:22440,34967:22442,34968:22444,34969:22447,34970:22448,34971:22449,34972:22451,34973:22453,34974:22454,34975:22455,34976:22457,34977:22458,34978:22459,34979:22460,34980:22461,34981:22462,34982:22463,34983:22464,34984:22465,34985:22468,34986:22469,34987:22470,34988:22471,34989:22472,34990:22473,34991:22474,34992:22476,34993:22477,34994:22480,34995:22481,34996:22483,34997:22486,34998:22487,34999:22491,35000:22492,35001:22494,35002:22497,35003:22498,35004:22499,35005:22501,35006:22502,35007:22503,35008:22504,35009:22505,35010:22506,35011:22507,35012:22508,35013:22510,35014:22512,35015:22513,35016:22514,35017:22515,35018:22517,35019:22518,35020:22519,35021:22523,35022:22524,35023:22526,35024:22527,35025:22529,35026:22531,35027:22532,35028:22533,35029:22536,35030:22537,35031:22538,35032:22540,35033:22542,35034:22543,35035:22544,35036:22546,35037:22547,35038:22548,35039:22550,35040:22551,35041:22552,35042:22554,35043:22555,35044:22556,35045:22557,35046:22559,35047:22562,35048:22563,35049:22565,35050:22566,35051:22567,35052:22568,35053:22569,35054:22571,35055:22572,35056:22573,35057:22574,35058:22575,35059:22577,35060:22578,35061:22579,35062:22580,35063:22582,35064:22583,35065:22584,35066:22585,35067:22586,35068:22587,35069:22588,35070:22589,35136:22590,35137:22591,35138:22592,35139:22593,35140:22594,35141:22595,35142:22597,35143:22598,35144:22599,35145:22600,35146:22601,35147:22602,35148:22603,35149:22606,35150:22607,35151:22608,35152:22610,35153:22611,35154:22613,35155:22614,35156:22615,35157:22617,35158:22618,35159:22619,35160:22620,35161:22621,35162:22623,35163:22624,35164:22625,35165:22626,35166:22627,35167:22628,35168:22630,35169:22631,35170:22632,35171:22633,35172:22634,35173:22637,35174:22638,35175:22639,35176:22640,35177:22641,35178:22642,35179:22643,35180:22644,35181:22645,35182:22646,35183:22647,35184:22648,35185:22649,35186:22650,35187:22651,35188:22652,35189:22653,35190:22655,35191:22658,35192:22660,35193:22662,35194:22663,35195:22664,35196:22666,35197:22667,35198:22668,35200:22669,35201:22670,35202:22671,35203:22672,35204:22673,35205:22676,35206:22677,35207:22678,35208:22679,35209:22680,35210:22683,35211:22684,35212:22685,35213:22688,35214:22689,35215:22690,35216:22691,35217:22692,35218:22693,35219:22694,35220:22695,35221:22698,35222:22699,35223:22700,35224:22701,35225:22702,35226:22703,35227:22704,35228:22705,35229:22706,35230:22707,35231:22708,35232:22709,35233:22710,35234:22711,35235:22712,35236:22713,35237:22714,35238:22715,35239:22717,35240:22718,35241:22719,35242:22720,35243:22722,35244:22723,35245:22724,35246:22726,35247:22727,35248:22728,35249:22729,35250:22730,35251:22731,35252:22732,35253:22733,35254:22734,35255:22735,35256:22736,35257:22738,35258:22739,35259:22740,35260:22742,35261:22743,35262:22744,35263:22745,35264:22746,35265:22747,35266:22748,35267:22749,35268:22750,35269:22751,35270:22752,35271:22753,35272:22754,35273:22755,35274:22757,35275:22758,35276:22759,35277:22760,35278:22761,35279:22762,35280:22765,35281:22767,35282:22769,35283:22770,35284:22772,35285:22773,35286:22775,35287:22776,35288:22778,35289:22779,35290:22780,35291:22781,35292:22782,35293:22783,35294:22784,35295:22785,35296:22787,35297:22789,35298:22790,35299:22792,35300:22793,35301:22794,35302:22795,35303:22796,35304:22798,35305:22800,35306:22801,35307:22802,35308:22803,35309:22807,35310:22808,35311:22811,35312:22813,35313:22814,35314:22816,35315:22817,35316:22818,35317:22819,35318:22822,35319:22824,35320:22828,35321:22832,35322:22834,35323:22835,35324:22837,35325:22838,35326:22843,35392:22845,35393:22846,35394:22847,35395:22848,35396:22851,35397:22853,35398:22854,35399:22858,35400:22860,35401:22861,35402:22864,35403:22866,35404:22867,35405:22873,35406:22875,35407:22876,35408:22877,35409:22878,35410:22879,35411:22881,35412:22883,35413:22884,35414:22886,35415:22887,35416:22888,35417:22889,35418:22890,35419:22891,35420:22892,35421:22893,35422:22894,35423:22895,35424:22896,35425:22897,35426:22898,35427:22901,35428:22903,35429:22906,35430:22907,35431:22908,35432:22910,35433:22911,35434:22912,35435:22917,35436:22921,35437:22923,35438:22924,35439:22926,35440:22927,35441:22928,35442:22929,35443:22932,35444:22933,35445:22936,35446:22938,35447:22939,35448:22940,35449:22941,35450:22943,35451:22944,35452:22945,35453:22946,35454:22950,35456:22951,35457:22956,35458:22957,35459:22960,35460:22961,35461:22963,35462:22964,35463:22965,35464:22966,35465:22967,35466:22968,35467:22970,35468:22972,35469:22973,35470:22975,35471:22976,35472:22977,35473:22978,35474:22979,35475:22980,35476:22981,35477:22983,35478:22984,35479:22985,35480:22988,35481:22989,35482:22990,35483:22991,35484:22997,35485:22998,35486:23001,35487:23003,35488:23006,35489:23007,35490:23008,35491:23009,35492:23010,35493:23012,35494:23014,35495:23015,35496:23017,35497:23018,35498:23019,35499:23021,35500:23022,35501:23023,35502:23024,35503:23025,35504:23026,35505:23027,35506:23028,35507:23029,35508:23030,35509:23031,35510:23032,35511:23034,35512:23036,35513:23037,35514:23038,35515:23040,35516:23042,35517:23050,35518:23051,35519:23053,35520:23054,35521:23055,35522:23056,35523:23058,35524:23060,35525:23061,35526:23062,35527:23063,35528:23065,35529:23066,35530:23067,35531:23069,35532:23070,35533:23073,35534:23074,35535:23076,35536:23078,35537:23079,35538:23080,35539:23082,35540:23083,35541:23084,35542:23085,35543:23086,35544:23087,35545:23088,35546:23091,35547:23093,35548:23095,35549:23096,35550:23097,35551:23098,35552:23099,35553:23101,35554:23102,35555:23103,35556:23105,35557:23106,35558:23107,35559:23108,35560:23109,35561:23111,35562:23112,35563:23115,35564:23116,35565:23117,35566:23118,35567:23119,35568:23120,35569:23121,35570:23122,35571:23123,35572:23124,35573:23126,35574:23127,35575:23128,35576:23129,35577:23131,35578:23132,35579:23133,35580:23134,35581:23135,35582:23136,35648:23137,35649:23139,35650:23140,35651:23141,35652:23142,35653:23144,35654:23145,35655:23147,35656:23148,35657:23149,35658:23150,35659:23151,35660:23152,35661:23153,35662:23154,35663:23155,35664:23160,35665:23161,35666:23163,35667:23164,35668:23165,35669:23166,35670:23168,35671:23169,35672:23170,35673:23171,35674:23172,35675:23173,35676:23174,35677:23175,35678:23176,35679:23177,35680:23178,35681:23179,35682:23180,35683:23181,35684:23182,35685:23183,35686:23184,35687:23185,35688:23187,35689:23188,35690:23189,35691:23190,35692:23191,35693:23192,35694:23193,35695:23196,35696:23197,35697:23198,35698:23199,35699:23200,35700:23201,35701:23202,35702:23203,35703:23204,35704:23205,35705:23206,35706:23207,35707:23208,35708:23209,35709:23211,35710:23212,35712:23213,35713:23214,35714:23215,35715:23216,35716:23217,35717:23220,35718:23222,35719:23223,35720:23225,35721:23226,35722:23227,35723:23228,35724:23229,35725:23231,35726:23232,35727:23235,35728:23236,35729:23237,35730:23238,35731:23239,35732:23240,35733:23242,35734:23243,35735:23245,35736:23246,35737:23247,35738:23248,35739:23249,35740:23251,35741:23253,35742:23255,35743:23257,35744:23258,35745:23259,35746:23261,35747:23262,35748:23263,35749:23266,35750:23268,35751:23269,35752:23271,35753:23272,35754:23274,35755:23276,35756:23277,35757:23278,35758:23279,35759:23280,35760:23282,35761:23283,35762:23284,35763:23285,35764:23286,35765:23287,35766:23288,35767:23289,35768:23290,35769:23291,35770:23292,35771:23293,35772:23294,35773:23295,35774:23296,35775:23297,35776:23298,35777:23299,35778:23300,35779:23301,35780:23302,35781:23303,35782:23304,35783:23306,35784:23307,35785:23308,35786:23309,35787:23310,35788:23311,35789:23312,35790:23313,35791:23314,35792:23315,35793:23316,35794:23317,35795:23320,35796:23321,35797:23322,35798:23323,35799:23324,35800:23325,35801:23326,35802:23327,35803:23328,35804:23329,35805:23330,35806:23331,35807:23332,35808:23333,35809:23334,35810:23335,35811:23336,35812:23337,35813:23338,35814:23339,35815:23340,35816:23341,35817:23342,35818:23343,35819:23344,35820:23345,35821:23347,35822:23349,35823:23350,35824:23352,35825:23353,35826:23354,35827:23355,35828:23356,35829:23357,35830:23358,35831:23359,35832:23361,35833:23362,35834:23363,35835:23364,35836:23365,35837:23366,35838:23367,35904:23368,35905:23369,35906:23370,35907:23371,35908:23372,35909:23373,35910:23374,35911:23375,35912:23378,35913:23382,35914:23390,35915:23392,35916:23393,35917:23399,35918:23400,35919:23403,35920:23405,35921:23406,35922:23407,35923:23410,35924:23412,35925:23414,35926:23415,35927:23416,35928:23417,35929:23419,35930:23420,35931:23422,35932:23423,35933:23426,35934:23430,35935:23434,35936:23437,35937:23438,35938:23440,35939:23441,35940:23442,35941:23444,35942:23446,35943:23455,35944:23463,35945:23464,35946:23465,35947:23468,35948:23469,35949:23470,35950:23471,35951:23473,35952:23474,35953:23479,35954:23482,35955:23483,35956:23484,35957:23488,35958:23489,35959:23491,35960:23496,35961:23497,35962:23498,35963:23499,35964:23501,35965:23502,35966:23503,35968:23505,35969:23508,35970:23509,35971:23510,35972:23511,35973:23512,35974:23513,35975:23514,35976:23515,35977:23516,35978:23520,35979:23522,35980:23523,35981:23526,35982:23527,35983:23529,35984:23530,35985:23531,35986:23532,35987:23533,35988:23535,35989:23537,35990:23538,35991:23539,35992:23540,35993:23541,35994:23542,35995:23543,35996:23549,35997:23550,35998:23552,35999:23554,36000:23555,36001:23557,36002:23559,36003:23560,36004:23563,36005:23564,36006:23565,36007:23566,36008:23568,36009:23570,36010:23571,36011:23575,36012:23577,36013:23579,36014:23582,36015:23583,36016:23584,36017:23585,36018:23587,36019:23590,36020:23592,36021:23593,36022:23594,36023:23595,36024:23597,36025:23598,36026:23599,36027:23600,36028:23602,36029:23603,36030:23605,36031:23606,36032:23607,36033:23619,36034:23620,36035:23622,36036:23623,36037:23628,36038:23629,36039:23634,36040:23635,36041:23636,36042:23638,36043:23639,36044:23640,36045:23642,36046:23643,36047:23644,36048:23645,36049:23647,36050:23650,36051:23652,36052:23655,36053:23656,36054:23657,36055:23658,36056:23659,36057:23660,36058:23661,36059:23664,36060:23666,36061:23667,36062:23668,36063:23669,36064:23670,36065:23671,36066:23672,36067:23675,36068:23676,36069:23677,36070:23678,36071:23680,36072:23683,36073:23684,36074:23685,36075:23686,36076:23687,36077:23689,36078:23690,36079:23691,36080:23694,36081:23695,36082:23698,36083:23699,36084:23701,36085:23709,36086:23710,36087:23711,36088:23712,36089:23713,36090:23716,36091:23717,36092:23718,36093:23719,36094:23720,36160:23722,36161:23726,36162:23727,36163:23728,36164:23730,36165:23732,36166:23734,36167:23737,36168:23738,36169:23739,36170:23740,36171:23742,36172:23744,36173:23746,36174:23747,36175:23749,36176:23750,36177:23751,36178:23752,36179:23753,36180:23754,36181:23756,36182:23757,36183:23758,36184:23759,36185:23760,36186:23761,36187:23763,36188:23764,36189:23765,36190:23766,36191:23767,36192:23768,36193:23770,36194:23771,36195:23772,36196:23773,36197:23774,36198:23775,36199:23776,36200:23778,36201:23779,36202:23783,36203:23785,36204:23787,36205:23788,36206:23790,36207:23791,36208:23793,36209:23794,36210:23795,36211:23796,36212:23797,36213:23798,36214:23799,36215:23800,36216:23801,36217:23802,36218:23804,36219:23805,36220:23806,36221:23807,36222:23808,36224:23809,36225:23812,36226:23813,36227:23816,36228:23817,36229:23818,36230:23819,36231:23820,36232:23821,36233:23823,36234:23824,36235:23825,36236:23826,36237:23827,36238:23829,36239:23831,36240:23832,36241:23833,36242:23834,36243:23836,36244:23837,36245:23839,36246:23840,36247:23841,36248:23842,36249:23843,36250:23845,36251:23848,36252:23850,36253:23851,36254:23852,36255:23855,36256:23856,36257:23857,36258:23858,36259:23859,36260:23861,36261:23862,36262:23863,36263:23864,36264:23865,36265:23866,36266:23867,36267:23868,36268:23871,36269:23872,36270:23873,36271:23874,36272:23875,36273:23876,36274:23877,36275:23878,36276:23880,36277:23881,36278:23885,36279:23886,36280:23887,36281:23888,36282:23889,36283:23890,36284:23891,36285:23892,36286:23893,36287:23894,36288:23895,36289:23897,36290:23898,36291:23900,36292:23902,36293:23903,36294:23904,36295:23905,36296:23906,36297:23907,36298:23908,36299:23909,36300:23910,36301:23911,36302:23912,36303:23914,36304:23917,36305:23918,36306:23920,36307:23921,36308:23922,36309:23923,36310:23925,36311:23926,36312:23927,36313:23928,36314:23929,36315:23930,36316:23931,36317:23932,36318:23933,36319:23934,36320:23935,36321:23936,36322:23937,36323:23939,36324:23940,36325:23941,36326:23942,36327:23943,36328:23944,36329:23945,36330:23946,36331:23947,36332:23948,36333:23949,36334:23950,36335:23951,36336:23952,36337:23953,36338:23954,36339:23955,36340:23956,36341:23957,36342:23958,36343:23959,36344:23960,36345:23962,36346:23963,36347:23964,36348:23966,36349:23967,36350:23968,36416:23969,36417:23970,36418:23971,36419:23972,36420:23973,36421:23974,36422:23975,36423:23976,36424:23977,36425:23978,36426:23979,36427:23980,36428:23981,36429:23982,36430:23983,36431:23984,36432:23985,36433:23986,36434:23987,36435:23988,36436:23989,36437:23990,36438:23992,36439:23993,36440:23994,36441:23995,36442:23996,36443:23997,36444:23998,36445:23999,36446:24000,36447:24001,36448:24002,36449:24003,36450:24004,36451:24006,36452:24007,36453:24008,36454:24009,36455:24010,36456:24011,36457:24012,36458:24014,36459:24015,36460:24016,36461:24017,36462:24018,36463:24019,36464:24020,36465:24021,36466:24022,36467:24023,36468:24024,36469:24025,36470:24026,36471:24028,36472:24031,36473:24032,36474:24035,36475:24036,36476:24042,36477:24044,36478:24045,36480:24048,36481:24053,36482:24054,36483:24056,36484:24057,36485:24058,36486:24059,36487:24060,36488:24063,36489:24064,36490:24068,36491:24071,36492:24073,36493:24074,36494:24075,36495:24077,36496:24078,36497:24082,36498:24083,36499:24087,36500:24094,36501:24095,36502:24096,36503:24097,36504:24098,36505:24099,36506:24100,36507:24101,36508:24104,36509:24105,36510:24106,36511:24107,36512:24108,36513:24111,36514:24112,36515:24114,36516:24115,36517:24116,36518:24117,36519:24118,36520:24121,36521:24122,36522:24126,36523:24127,36524:24128,36525:24129,36526:24131,36527:24134,36528:24135,36529:24136,36530:24137,36531:24138,36532:24139,36533:24141,36534:24142,36535:24143,36536:24144,36537:24145,36538:24146,36539:24147,36540:24150,36541:24151,36542:24152,36543:24153,36544:24154,36545:24156,36546:24157,36547:24159,36548:24160,36549:24163,36550:24164,36551:24165,36552:24166,36553:24167,36554:24168,36555:24169,36556:24170,36557:24171,36558:24172,36559:24173,36560:24174,36561:24175,36562:24176,36563:24177,36564:24181,36565:24183,36566:24185,36567:24190,36568:24193,36569:24194,36570:24195,36571:24197,36572:24200,36573:24201,36574:24204,36575:24205,36576:24206,36577:24210,36578:24216,36579:24219,36580:24221,36581:24225,36582:24226,36583:24227,36584:24228,36585:24232,36586:24233,36587:24234,36588:24235,36589:24236,36590:24238,36591:24239,36592:24240,36593:24241,36594:24242,36595:24244,36596:24250,36597:24251,36598:24252,36599:24253,36600:24255,36601:24256,36602:24257,36603:24258,36604:24259,36605:24260,36606:24261,36672:24262,36673:24263,36674:24264,36675:24267,36676:24268,36677:24269,36678:24270,36679:24271,36680:24272,36681:24276,36682:24277,36683:24279,36684:24280,36685:24281,36686:24282,36687:24284,36688:24285,36689:24286,36690:24287,36691:24288,36692:24289,36693:24290,36694:24291,36695:24292,36696:24293,36697:24294,36698:24295,36699:24297,36700:24299,36701:24300,36702:24301,36703:24302,36704:24303,36705:24304,36706:24305,36707:24306,36708:24307,36709:24309,36710:24312,36711:24313,36712:24315,36713:24316,36714:24317,36715:24325,36716:24326,36717:24327,36718:24329,36719:24332,36720:24333,36721:24334,36722:24336,36723:24338,36724:24340,36725:24342,36726:24345,36727:24346,36728:24348,36729:24349,36730:24350,36731:24353,36732:24354,36733:24355,36734:24356,36736:24360,36737:24363,36738:24364,36739:24366,36740:24368,36741:24370,36742:24371,36743:24372,36744:24373,36745:24374,36746:24375,36747:24376,36748:24379,36749:24381,36750:24382,36751:24383,36752:24385,36753:24386,36754:24387,36755:24388,36756:24389,36757:24390,36758:24391,36759:24392,36760:24393,36761:24394,36762:24395,36763:24396,36764:24397,36765:24398,36766:24399,36767:24401,36768:24404,36769:24409,36770:24410,36771:24411,36772:24412,36773:24414,36774:24415,36775:24416,36776:24419,36777:24421,36778:24423,36779:24424,36780:24427,36781:24430,36782:24431,36783:24434,36784:24436,36785:24437,36786:24438,36787:24440,36788:24442,36789:24445,36790:24446,36791:24447,36792:24451,36793:24454,36794:24461,36795:24462,36796:24463,36797:24465,36798:24467,36799:24468,36800:24470,36801:24474,36802:24475,36803:24477,36804:24478,36805:24479,36806:24480,36807:24482,36808:24483,36809:24484,36810:24485,36811:24486,36812:24487,36813:24489,36814:24491,36815:24492,36816:24495,36817:24496,36818:24497,36819:24498,36820:24499,36821:24500,36822:24502,36823:24504,36824:24505,36825:24506,36826:24507,36827:24510,36828:24511,36829:24512,36830:24513,36831:24514,36832:24519,36833:24520,36834:24522,36835:24523,36836:24526,36837:24531,36838:24532,36839:24533,36840:24538,36841:24539,36842:24540,36843:24542,36844:24543,36845:24546,36846:24547,36847:24549,36848:24550,36849:24552,36850:24553,36851:24556,36852:24559,36853:24560,36854:24562,36855:24563,36856:24564,36857:24566,36858:24567,36859:24569,36860:24570,36861:24572,36862:24583,36928:24584,36929:24585,36930:24587,36931:24588,36932:24592,36933:24593,36934:24595,36935:24599,36936:24600,36937:24602,36938:24606,36939:24607,36940:24610,36941:24611,36942:24612,36943:24620,36944:24621,36945:24622,36946:24624,36947:24625,36948:24626,36949:24627,36950:24628,36951:24630,36952:24631,36953:24632,36954:24633,36955:24634,36956:24637,36957:24638,36958:24640,36959:24644,36960:24645,36961:24646,36962:24647,36963:24648,36964:24649,36965:24650,36966:24652,36967:24654,36968:24655,36969:24657,36970:24659,36971:24660,36972:24662,36973:24663,36974:24664,36975:24667,36976:24668,36977:24670,36978:24671,36979:24672,36980:24673,36981:24677,36982:24678,36983:24686,36984:24689,36985:24690,36986:24692,36987:24693,36988:24695,36989:24702,36990:24704,36992:24705,36993:24706,36994:24709,36995:24710,36996:24711,36997:24712,36998:24714,36999:24715,37000:24718,37001:24719,37002:24720,37003:24721,37004:24723,37005:24725,37006:24727,37007:24728,37008:24729,37009:24732,37010:24734,37011:24737,37012:24738,37013:24740,37014:24741,37015:24743,37016:24745,37017:24746,37018:24750,37019:24752,37020:24755,37021:24757,37022:24758,37023:24759,37024:24761,37025:24762,37026:24765,37027:24766,37028:24767,37029:24768,37030:24769,37031:24770,37032:24771,37033:24772,37034:24775,37035:24776,37036:24777,37037:24780,37038:24781,37039:24782,37040:24783,37041:24784,37042:24786,37043:24787,37044:24788,37045:24790,37046:24791,37047:24793,37048:24795,37049:24798,37050:24801,37051:24802,37052:24803,37053:24804,37054:24805,37055:24810,37056:24817,37057:24818,37058:24821,37059:24823,37060:24824,37061:24827,37062:24828,37063:24829,37064:24830,37065:24831,37066:24834,37067:24835,37068:24836,37069:24837,37070:24839,37071:24842,37072:24843,37073:24844,37074:24848,37075:24849,37076:24850,37077:24851,37078:24852,37079:24854,37080:24855,37081:24856,37082:24857,37083:24859,37084:24860,37085:24861,37086:24862,37087:24865,37088:24866,37089:24869,37090:24872,37091:24873,37092:24874,37093:24876,37094:24877,37095:24878,37096:24879,37097:24880,37098:24881,37099:24882,37100:24883,37101:24884,37102:24885,37103:24886,37104:24887,37105:24888,37106:24889,37107:24890,37108:24891,37109:24892,37110:24893,37111:24894,37112:24896,37113:24897,37114:24898,37115:24899,37116:24900,37117:24901,37118:24902,37184:24903,37185:24905,37186:24907,37187:24909,37188:24911,37189:24912,37190:24914,37191:24915,37192:24916,37193:24918,37194:24919,37195:24920,37196:24921,37197:24922,37198:24923,37199:24924,37200:24926,37201:24927,37202:24928,37203:24929,37204:24931,37205:24932,37206:24933,37207:24934,37208:24937,37209:24938,37210:24939,37211:24940,37212:24941,37213:24942,37214:24943,37215:24945,37216:24946,37217:24947,37218:24948,37219:24950,37220:24952,37221:24953,37222:24954,37223:24955,37224:24956,37225:24957,37226:24958,37227:24959,37228:24960,37229:24961,37230:24962,37231:24963,37232:24964,37233:24965,37234:24966,37235:24967,37236:24968,37237:24969,37238:24970,37239:24972,37240:24973,37241:24975,37242:24976,37243:24977,37244:24978,37245:24979,37246:24981,37248:24982,37249:24983,37250:24984,37251:24985,37252:24986,37253:24987,37254:24988,37255:24990,37256:24991,37257:24992,37258:24993,37259:24994,37260:24995,37261:24996,37262:24997,37263:24998,37264:25002,37265:25003,37266:25005,37267:25006,37268:25007,37269:25008,37270:25009,37271:25010,37272:25011,37273:25012,37274:25013,37275:25014,37276:25016,37277:25017,37278:25018,37279:25019,37280:25020,37281:25021,37282:25023,37283:25024,37284:25025,37285:25027,37286:25028,37287:25029,37288:25030,37289:25031,37290:25033,37291:25036,37292:25037,37293:25038,37294:25039,37295:25040,37296:25043,37297:25045,37298:25046,37299:25047,37300:25048,37301:25049,37302:25050,37303:25051,37304:25052,37305:25053,37306:25054,37307:25055,37308:25056,37309:25057,37310:25058,37311:25059,37312:25060,37313:25061,37314:25063,37315:25064,37316:25065,37317:25066,37318:25067,37319:25068,37320:25069,37321:25070,37322:25071,37323:25072,37324:25073,37325:25074,37326:25075,37327:25076,37328:25078,37329:25079,37330:25080,37331:25081,37332:25082,37333:25083,37334:25084,37335:25085,37336:25086,37337:25088,37338:25089,37339:25090,37340:25091,37341:25092,37342:25093,37343:25095,37344:25097,37345:25107,37346:25108,37347:25113,37348:25116,37349:25117,37350:25118,37351:25120,37352:25123,37353:25126,37354:25127,37355:25128,37356:25129,37357:25131,37358:25133,37359:25135,37360:25136,37361:25137,37362:25138,37363:25141,37364:25142,37365:25144,37366:25145,37367:25146,37368:25147,37369:25148,37370:25154,37371:25156,37372:25157,37373:25158,37374:25162,37440:25167,37441:25168,37442:25173,37443:25174,37444:25175,37445:25177,37446:25178,37447:25180,37448:25181,37449:25182,37450:25183,37451:25184,37452:25185,37453:25186,37454:25188,37455:25189,37456:25192,37457:25201,37458:25202,37459:25204,37460:25205,37461:25207,37462:25208,37463:25210,37464:25211,37465:25213,37466:25217,37467:25218,37468:25219,37469:25221,37470:25222,37471:25223,37472:25224,37473:25227,37474:25228,37475:25229,37476:25230,37477:25231,37478:25232,37479:25236,37480:25241,37481:25244,37482:25245,37483:25246,37484:25251,37485:25254,37486:25255,37487:25257,37488:25258,37489:25261,37490:25262,37491:25263,37492:25264,37493:25266,37494:25267,37495:25268,37496:25270,37497:25271,37498:25272,37499:25274,37500:25278,37501:25280,37502:25281,37504:25283,37505:25291,37506:25295,37507:25297,37508:25301,37509:25309,37510:25310,37511:25312,37512:25313,37513:25316,37514:25322,37515:25323,37516:25328,37517:25330,37518:25333,37519:25336,37520:25337,37521:25338,37522:25339,37523:25344,37524:25347,37525:25348,37526:25349,37527:25350,37528:25354,37529:25355,37530:25356,37531:25357,37532:25359,37533:25360,37534:25362,37535:25363,37536:25364,37537:25365,37538:25367,37539:25368,37540:25369,37541:25372,37542:25382,37543:25383,37544:25385,37545:25388,37546:25389,37547:25390,37548:25392,37549:25393,37550:25395,37551:25396,37552:25397,37553:25398,37554:25399,37555:25400,37556:25403,37557:25404,37558:25406,37559:25407,37560:25408,37561:25409,37562:25412,37563:25415,37564:25416,37565:25418,37566:25425,37567:25426,37568:25427,37569:25428,37570:25430,37571:25431,37572:25432,37573:25433,37574:25434,37575:25435,37576:25436,37577:25437,37578:25440,37579:25444,37580:25445,37581:25446,37582:25448,37583:25450,37584:25451,37585:25452,37586:25455,37587:25456,37588:25458,37589:25459,37590:25460,37591:25461,37592:25464,37593:25465,37594:25468,37595:25469,37596:25470,37597:25471,37598:25473,37599:25475,37600:25476,37601:25477,37602:25478,37603:25483,37604:25485,37605:25489,37606:25491,37607:25492,37608:25493,37609:25495,37610:25497,37611:25498,37612:25499,37613:25500,37614:25501,37615:25502,37616:25503,37617:25505,37618:25508,37619:25510,37620:25515,37621:25519,37622:25521,37623:25522,37624:25525,37625:25526,37626:25529,37627:25531,37628:25533,37629:25535,37630:25536,37696:25537,37697:25538,37698:25539,37699:25541,37700:25543,37701:25544,37702:25546,37703:25547,37704:25548,37705:25553,37706:25555,37707:25556,37708:25557,37709:25559,37710:25560,37711:25561,37712:25562,37713:25563,37714:25564,37715:25565,37716:25567,37717:25570,37718:25572,37719:25573,37720:25574,37721:25575,37722:25576,37723:25579,37724:25580,37725:25582,37726:25583,37727:25584,37728:25585,37729:25587,37730:25589,37731:25591,37732:25593,37733:25594,37734:25595,37735:25596,37736:25598,37737:25603,37738:25604,37739:25606,37740:25607,37741:25608,37742:25609,37743:25610,37744:25613,37745:25614,37746:25617,37747:25618,37748:25621,37749:25622,37750:25623,37751:25624,37752:25625,37753:25626,37754:25629,37755:25631,37756:25634,37757:25635,37758:25636,37760:25637,37761:25639,37762:25640,37763:25641,37764:25643,37765:25646,37766:25647,37767:25648,37768:25649,37769:25650,37770:25651,37771:25653,37772:25654,37773:25655,37774:25656,37775:25657,37776:25659,37777:25660,37778:25662,37779:25664,37780:25666,37781:25667,37782:25673,37783:25675,37784:25676,37785:25677,37786:25678,37787:25679,37788:25680,37789:25681,37790:25683,37791:25685,37792:25686,37793:25687,37794:25689,37795:25690,37796:25691,37797:25692,37798:25693,37799:25695,37800:25696,37801:25697,37802:25698,37803:25699,37804:25700,37805:25701,37806:25702,37807:25704,37808:25706,37809:25707,37810:25708,37811:25710,37812:25711,37813:25712,37814:25713,37815:25714,37816:25715,37817:25716,37818:25717,37819:25718,37820:25719,37821:25723,37822:25724,37823:25725,37824:25726,37825:25727,37826:25728,37827:25729,37828:25731,37829:25734,37830:25736,37831:25737,37832:25738,37833:25739,37834:25740,37835:25741,37836:25742,37837:25743,37838:25744,37839:25747,37840:25748,37841:25751,37842:25752,37843:25754,37844:25755,37845:25756,37846:25757,37847:25759,37848:25760,37849:25761,37850:25762,37851:25763,37852:25765,37853:25766,37854:25767,37855:25768,37856:25770,37857:25771,37858:25775,37859:25777,37860:25778,37861:25779,37862:25780,37863:25782,37864:25785,37865:25787,37866:25789,37867:25790,37868:25791,37869:25793,37870:25795,37871:25796,37872:25798,37873:25799,37874:25800,37875:25801,37876:25802,37877:25803,37878:25804,37879:25807,37880:25809,37881:25811,37882:25812,37883:25813,37884:25814,37885:25817,37886:25818,37952:25819,37953:25820,37954:25821,37955:25823,37956:25824,37957:25825,37958:25827,37959:25829,37960:25831,37961:25832,37962:25833,37963:25834,37964:25835,37965:25836,37966:25837,37967:25838,37968:25839,37969:25840,37970:25841,37971:25842,37972:25843,37973:25844,37974:25845,37975:25846,37976:25847,37977:25848,37978:25849,37979:25850,37980:25851,37981:25852,37982:25853,37983:25854,37984:25855,37985:25857,37986:25858,37987:25859,37988:25860,37989:25861,37990:25862,37991:25863,37992:25864,37993:25866,37994:25867,37995:25868,37996:25869,37997:25870,37998:25871,37999:25872,38000:25873,38001:25875,38002:25876,38003:25877,38004:25878,38005:25879,38006:25881,38007:25882,38008:25883,38009:25884,38010:25885,38011:25886,38012:25887,38013:25888,38014:25889,38016:25890,38017:25891,38018:25892,38019:25894,38020:25895,38021:25896,38022:25897,38023:25898,38024:25900,38025:25901,38026:25904,38027:25905,38028:25906,38029:25907,38030:25911,38031:25914,38032:25916,38033:25917,38034:25920,38035:25921,38036:25922,38037:25923,38038:25924,38039:25926,38040:25927,38041:25930,38042:25931,38043:25933,38044:25934,38045:25936,38046:25938,38047:25939,38048:25940,38049:25943,38050:25944,38051:25946,38052:25948,38053:25951,38054:25952,38055:25953,38056:25956,38057:25957,38058:25959,38059:25960,38060:25961,38061:25962,38062:25965,38063:25966,38064:25967,38065:25969,38066:25971,38067:25973,38068:25974,38069:25976,38070:25977,38071:25978,38072:25979,38073:25980,38074:25981,38075:25982,38076:25983,38077:25984,38078:25985,38079:25986,38080:25987,38081:25988,38082:25989,38083:25990,38084:25992,38085:25993,38086:25994,38087:25997,38088:25998,38089:25999,38090:26002,38091:26004,38092:26005,38093:26006,38094:26008,38095:26010,38096:26013,38097:26014,38098:26016,38099:26018,38100:26019,38101:26022,38102:26024,38103:26026,38104:26028,38105:26030,38106:26033,38107:26034,38108:26035,38109:26036,38110:26037,38111:26038,38112:26039,38113:26040,38114:26042,38115:26043,38116:26046,38117:26047,38118:26048,38119:26050,38120:26055,38121:26056,38122:26057,38123:26058,38124:26061,38125:26064,38126:26065,38127:26067,38128:26068,38129:26069,38130:26072,38131:26073,38132:26074,38133:26075,38134:26076,38135:26077,38136:26078,38137:26079,38138:26081,38139:26083,38140:26084,38141:26090,38142:26091,38208:26098,38209:26099,38210:26100,38211:26101,38212:26104,38213:26105,38214:26107,38215:26108,38216:26109,38217:26110,38218:26111,38219:26113,38220:26116,38221:26117,38222:26119,38223:26120,38224:26121,38225:26123,38226:26125,38227:26128,38228:26129,38229:26130,38230:26134,38231:26135,38232:26136,38233:26138,38234:26139,38235:26140,38236:26142,38237:26145,38238:26146,38239:26147,38240:26148,38241:26150,38242:26153,38243:26154,38244:26155,38245:26156,38246:26158,38247:26160,38248:26162,38249:26163,38250:26167,38251:26168,38252:26169,38253:26170,38254:26171,38255:26173,38256:26175,38257:26176,38258:26178,38259:26180,38260:26181,38261:26182,38262:26183,38263:26184,38264:26185,38265:26186,38266:26189,38267:26190,38268:26192,38269:26193,38270:26200,38272:26201,38273:26203,38274:26204,38275:26205,38276:26206,38277:26208,38278:26210,38279:26211,38280:26213,38281:26215,38282:26217,38283:26218,38284:26219,38285:26220,38286:26221,38287:26225,38288:26226,38289:26227,38290:26229,38291:26232,38292:26233,38293:26235,38294:26236,38295:26237,38296:26239,38297:26240,38298:26241,38299:26243,38300:26245,38301:26246,38302:26248,38303:26249,38304:26250,38305:26251,38306:26253,38307:26254,38308:26255,38309:26256,38310:26258,38311:26259,38312:26260,38313:26261,38314:26264,38315:26265,38316:26266,38317:26267,38318:26268,38319:26270,38320:26271,38321:26272,38322:26273,38323:26274,38324:26275,38325:26276,38326:26277,38327:26278,38328:26281,38329:26282,38330:26283,38331:26284,38332:26285,38333:26287,38334:26288,38335:26289,38336:26290,38337:26291,38338:26293,38339:26294,38340:26295,38341:26296,38342:26298,38343:26299,38344:26300,38345:26301,38346:26303,38347:26304,38348:26305,38349:26306,38350:26307,38351:26308,38352:26309,38353:26310,38354:26311,38355:26312,38356:26313,38357:26314,38358:26315,38359:26316,38360:26317,38361:26318,38362:26319,38363:26320,38364:26321,38365:26322,38366:26323,38367:26324,38368:26325,38369:26326,38370:26327,38371:26328,38372:26330,38373:26334,38374:26335,38375:26336,38376:26337,38377:26338,38378:26339,38379:26340,38380:26341,38381:26343,38382:26344,38383:26346,38384:26347,38385:26348,38386:26349,38387:26350,38388:26351,38389:26353,38390:26357,38391:26358,38392:26360,38393:26362,38394:26363,38395:26365,38396:26369,38397:26370,38398:26371,38464:26372,38465:26373,38466:26374,38467:26375,38468:26380,38469:26382,38470:26383,38471:26385,38472:26386,38473:26387,38474:26390,38475:26392,38476:26393,38477:26394,38478:26396,38479:26398,38480:26400,38481:26401,38482:26402,38483:26403,38484:26404,38485:26405,38486:26407,38487:26409,38488:26414,38489:26416,38490:26418,38491:26419,38492:26422,38493:26423,38494:26424,38495:26425,38496:26427,38497:26428,38498:26430,38499:26431,38500:26433,38501:26436,38502:26437,38503:26439,38504:26442,38505:26443,38506:26445,38507:26450,38508:26452,38509:26453,38510:26455,38511:26456,38512:26457,38513:26458,38514:26459,38515:26461,38516:26466,38517:26467,38518:26468,38519:26470,38520:26471,38521:26475,38522:26476,38523:26478,38524:26481,38525:26484,38526:26486,38528:26488,38529:26489,38530:26490,38531:26491,38532:26493,38533:26496,38534:26498,38535:26499,38536:26501,38537:26502,38538:26504,38539:26506,38540:26508,38541:26509,38542:26510,38543:26511,38544:26513,38545:26514,38546:26515,38547:26516,38548:26518,38549:26521,38550:26523,38551:26527,38552:26528,38553:26529,38554:26532,38555:26534,38556:26537,38557:26540,38558:26542,38559:26545,38560:26546,38561:26548,38562:26553,38563:26554,38564:26555,38565:26556,38566:26557,38567:26558,38568:26559,38569:26560,38570:26562,38571:26565,38572:26566,38573:26567,38574:26568,38575:26569,38576:26570,38577:26571,38578:26572,38579:26573,38580:26574,38581:26581,38582:26582,38583:26583,38584:26587,38585:26591,38586:26593,38587:26595,38588:26596,38589:26598,38590:26599,38591:26600,38592:26602,38593:26603,38594:26605,38595:26606,38596:26610,38597:26613,38598:26614,38599:26615,38600:26616,38601:26617,38602:26618,38603:26619,38604:26620,38605:26622,38606:26625,38607:26626,38608:26627,38609:26628,38610:26630,38611:26637,38612:26640,38613:26642,38614:26644,38615:26645,38616:26648,38617:26649,38618:26650,38619:26651,38620:26652,38621:26654,38622:26655,38623:26656,38624:26658,38625:26659,38626:26660,38627:26661,38628:26662,38629:26663,38630:26664,38631:26667,38632:26668,38633:26669,38634:26670,38635:26671,38636:26672,38637:26673,38638:26676,38639:26677,38640:26678,38641:26682,38642:26683,38643:26687,38644:26695,38645:26699,38646:26701,38647:26703,38648:26706,38649:26710,38650:26711,38651:26712,38652:26713,38653:26714,38654:26715,38720:26716,38721:26717,38722:26718,38723:26719,38724:26730,38725:26732,38726:26733,38727:26734,38728:26735,38729:26736,38730:26737,38731:26738,38732:26739,38733:26741,38734:26744,38735:26745,38736:26746,38737:26747,38738:26748,38739:26749,38740:26750,38741:26751,38742:26752,38743:26754,38744:26756,38745:26759,38746:26760,38747:26761,38748:26762,38749:26763,38750:26764,38751:26765,38752:26766,38753:26768,38754:26769,38755:26770,38756:26772,38757:26773,38758:26774,38759:26776,38760:26777,38761:26778,38762:26779,38763:26780,38764:26781,38765:26782,38766:26783,38767:26784,38768:26785,38769:26787,38770:26788,38771:26789,38772:26793,38773:26794,38774:26795,38775:26796,38776:26798,38777:26801,38778:26802,38779:26804,38780:26806,38781:26807,38782:26808,38784:26809,38785:26810,38786:26811,38787:26812,38788:26813,38789:26814,38790:26815,38791:26817,38792:26819,38793:26820,38794:26821,38795:26822,38796:26823,38797:26824,38798:26826,38799:26828,38800:26830,38801:26831,38802:26832,38803:26833,38804:26835,38805:26836,38806:26838,38807:26839,38808:26841,38809:26843,38810:26844,38811:26845,38812:26846,38813:26847,38814:26849,38815:26850,38816:26852,38817:26853,38818:26854,38819:26855,38820:26856,38821:26857,38822:26858,38823:26859,38824:26860,38825:26861,38826:26863,38827:26866,38828:26867,38829:26868,38830:26870,38831:26871,38832:26872,38833:26875,38834:26877,38835:26878,38836:26879,38837:26880,38838:26882,38839:26883,38840:26884,38841:26886,38842:26887,38843:26888,38844:26889,38845:26890,38846:26892,38847:26895,38848:26897,38849:26899,38850:26900,38851:26901,38852:26902,38853:26903,38854:26904,38855:26905,38856:26906,38857:26907,38858:26908,38859:26909,38860:26910,38861:26913,38862:26914,38863:26915,38864:26917,38865:26918,38866:26919,38867:26920,38868:26921,38869:26922,38870:26923,38871:26924,38872:26926,38873:26927,38874:26929,38875:26930,38876:26931,38877:26933,38878:26934,38879:26935,38880:26936,38881:26938,38882:26939,38883:26940,38884:26942,38885:26944,38886:26945,38887:26947,38888:26948,38889:26949,38890:26950,38891:26951,38892:26952,38893:26953,38894:26954,38895:26955,38896:26956,38897:26957,38898:26958,38899:26959,38900:26960,38901:26961,38902:26962,38903:26963,38904:26965,38905:26966,38906:26968,38907:26969,38908:26971,38909:26972,38910:26975,38976:26977,38977:26978,38978:26980,38979:26981,38980:26983,38981:26984,38982:26985,38983:26986,38984:26988,38985:26989,38986:26991,38987:26992,38988:26994,38989:26995,38990:26996,38991:26997,38992:26998,38993:27002,38994:27003,38995:27005,38996:27006,38997:27007,38998:27009,38999:27011,39000:27013,39001:27018,39002:27019,39003:27020,39004:27022,39005:27023,39006:27024,39007:27025,39008:27026,39009:27027,39010:27030,39011:27031,39012:27033,39013:27034,39014:27037,39015:27038,39016:27039,39017:27040,39018:27041,39019:27042,39020:27043,39021:27044,39022:27045,39023:27046,39024:27049,39025:27050,39026:27052,39027:27054,39028:27055,39029:27056,39030:27058,39031:27059,39032:27061,39033:27062,39034:27064,39035:27065,39036:27066,39037:27068,39038:27069,39040:27070,39041:27071,39042:27072,39043:27074,39044:27075,39045:27076,39046:27077,39047:27078,39048:27079,39049:27080,39050:27081,39051:27083,39052:27085,39053:27087,39054:27089,39055:27090,39056:27091,39057:27093,39058:27094,39059:27095,39060:27096,39061:27097,39062:27098,39063:27100,39064:27101,39065:27102,39066:27105,39067:27106,39068:27107,39069:27108,39070:27109,39071:27110,39072:27111,39073:27112,39074:27113,39075:27114,39076:27115,39077:27116,39078:27118,39079:27119,39080:27120,39081:27121,39082:27123,39083:27124,39084:27125,39085:27126,39086:27127,39087:27128,39088:27129,39089:27130,39090:27131,39091:27132,39092:27134,39093:27136,39094:27137,39095:27138,39096:27139,39097:27140,39098:27141,39099:27142,39100:27143,39101:27144,39102:27145,39103:27147,39104:27148,39105:27149,39106:27150,39107:27151,39108:27152,39109:27153,39110:27154,39111:27155,39112:27156,39113:27157,39114:27158,39115:27161,39116:27162,39117:27163,39118:27164,39119:27165,39120:27166,39121:27168,39122:27170,39123:27171,39124:27172,39125:27173,39126:27174,39127:27175,39128:27177,39129:27179,39130:27180,39131:27181,39132:27182,39133:27184,39134:27186,39135:27187,39136:27188,39137:27190,39138:27191,39139:27192,39140:27193,39141:27194,39142:27195,39143:27196,39144:27199,39145:27200,39146:27201,39147:27202,39148:27203,39149:27205,39150:27206,39151:27208,39152:27209,39153:27210,39154:27211,39155:27212,39156:27213,39157:27214,39158:27215,39159:27217,39160:27218,39161:27219,39162:27220,39163:27221,39164:27222,39165:27223,39166:27226,39232:27228,39233:27229,39234:27230,39235:27231,39236:27232,39237:27234,39238:27235,39239:27236,39240:27238,39241:27239,39242:27240,39243:27241,39244:27242,39245:27243,39246:27244,39247:27245,39248:27246,39249:27247,39250:27248,39251:27250,39252:27251,39253:27252,39254:27253,39255:27254,39256:27255,39257:27256,39258:27258,39259:27259,39260:27261,39261:27262,39262:27263,39263:27265,39264:27266,39265:27267,39266:27269,39267:27270,39268:27271,39269:27272,39270:27273,39271:27274,39272:27275,39273:27276,39274:27277,39275:27279,39276:27282,39277:27283,39278:27284,39279:27285,39280:27286,39281:27288,39282:27289,39283:27290,39284:27291,39285:27292,39286:27293,39287:27294,39288:27295,39289:27297,39290:27298,39291:27299,39292:27300,39293:27301,39294:27302,39296:27303,39297:27304,39298:27306,39299:27309,39300:27310,39301:27311,39302:27312,39303:27313,39304:27314,39305:27315,39306:27316,39307:27317,39308:27318,39309:27319,39310:27320,39311:27321,39312:27322,39313:27323,39314:27324,39315:27325,39316:27326,39317:27327,39318:27328,39319:27329,39320:27330,39321:27331,39322:27332,39323:27333,39324:27334,39325:27335,39326:27336,39327:27337,39328:27338,39329:27339,39330:27340,39331:27341,39332:27342,39333:27343,39334:27344,39335:27345,39336:27346,39337:27347,39338:27348,39339:27349,39340:27350,39341:27351,39342:27352,39343:27353,39344:27354,39345:27355,39346:27356,39347:27357,39348:27358,39349:27359,39350:27360,39351:27361,39352:27362,39353:27363,39354:27364,39355:27365,39356:27366,39357:27367,39358:27368,39359:27369,39360:27370,39361:27371,39362:27372,39363:27373,39364:27374,39365:27375,39366:27376,39367:27377,39368:27378,39369:27379,39370:27380,39371:27381,39372:27382,39373:27383,39374:27384,39375:27385,39376:27386,39377:27387,39378:27388,39379:27389,39380:27390,39381:27391,39382:27392,39383:27393,39384:27394,39385:27395,39386:27396,39387:27397,39388:27398,39389:27399,39390:27400,39391:27401,39392:27402,39393:27403,39394:27404,39395:27405,39396:27406,39397:27407,39398:27408,39399:27409,39400:27410,39401:27411,39402:27412,39403:27413,39404:27414,39405:27415,39406:27416,39407:27417,39408:27418,39409:27419,39410:27420,39411:27421,39412:27422,39413:27423,39414:27429,39415:27430,39416:27432,39417:27433,39418:27434,39419:27435,39420:27436,39421:27437,39422:27438,39488:27439,39489:27440,39490:27441,39491:27443,39492:27444,39493:27445,39494:27446,39495:27448,39496:27451,39497:27452,39498:27453,39499:27455,39500:27456,39501:27457,39502:27458,39503:27460,39504:27461,39505:27464,39506:27466,39507:27467,39508:27469,39509:27470,39510:27471,39511:27472,39512:27473,39513:27474,39514:27475,39515:27476,39516:27477,39517:27478,39518:27479,39519:27480,39520:27482,39521:27483,39522:27484,39523:27485,39524:27486,39525:27487,39526:27488,39527:27489,39528:27496,39529:27497,39530:27499,39531:27500,39532:27501,39533:27502,39534:27503,39535:27504,39536:27505,39537:27506,39538:27507,39539:27508,39540:27509,39541:27510,39542:27511,39543:27512,39544:27514,39545:27517,39546:27518,39547:27519,39548:27520,39549:27525,39550:27528,39552:27532,39553:27534,39554:27535,39555:27536,39556:27537,39557:27540,39558:27541,39559:27543,39560:27544,39561:27545,39562:27548,39563:27549,39564:27550,39565:27551,39566:27552,39567:27554,39568:27555,39569:27556,39570:27557,39571:27558,39572:27559,39573:27560,39574:27561,39575:27563,39576:27564,39577:27565,39578:27566,39579:27567,39580:27568,39581:27569,39582:27570,39583:27574,39584:27576,39585:27577,39586:27578,39587:27579,39588:27580,39589:27581,39590:27582,39591:27584,39592:27587,39593:27588,39594:27590,39595:27591,39596:27592,39597:27593,39598:27594,39599:27596,39600:27598,39601:27600,39602:27601,39603:27608,39604:27610,39605:27612,39606:27613,39607:27614,39608:27615,39609:27616,39610:27618,39611:27619,39612:27620,39613:27621,39614:27622,39615:27623,39616:27624,39617:27625,39618:27628,39619:27629,39620:27630,39621:27632,39622:27633,39623:27634,39624:27636,39625:27638,39626:27639,39627:27640,39628:27642,39629:27643,39630:27644,39631:27646,39632:27647,39633:27648,39634:27649,39635:27650,39636:27651,39637:27652,39638:27656,39639:27657,39640:27658,39641:27659,39642:27660,39643:27662,39644:27666,39645:27671,39646:27676,39647:27677,39648:27678,39649:27680,39650:27683,39651:27685,39652:27691,39653:27692,39654:27693,39655:27697,39656:27699,39657:27702,39658:27703,39659:27705,39660:27706,39661:27707,39662:27708,39663:27710,39664:27711,39665:27715,39666:27716,39667:27717,39668:27720,39669:27723,39670:27724,39671:27725,39672:27726,39673:27727,39674:27729,39675:27730,39676:27731,39677:27734,39678:27736,39744:27737,39745:27738,39746:27746,39747:27747,39748:27749,39749:27750,39750:27751,39751:27755,39752:27756,39753:27757,39754:27758,39755:27759,39756:27761,39757:27763,39758:27765,39759:27767,39760:27768,39761:27770,39762:27771,39763:27772,39764:27775,39765:27776,39766:27780,39767:27783,39768:27786,39769:27787,39770:27789,39771:27790,39772:27793,39773:27794,39774:27797,39775:27798,39776:27799,39777:27800,39778:27802,39779:27804,39780:27805,39781:27806,39782:27808,39783:27810,39784:27816,39785:27820,39786:27823,39787:27824,39788:27828,39789:27829,39790:27830,39791:27831,39792:27834,39793:27840,39794:27841,39795:27842,39796:27843,39797:27846,39798:27847,39799:27848,39800:27851,39801:27853,39802:27854,39803:27855,39804:27857,39805:27858,39806:27864,39808:27865,39809:27866,39810:27868,39811:27869,39812:27871,39813:27876,39814:27878,39815:27879,39816:27881,39817:27884,39818:27885,39819:27890,39820:27892,39821:27897,39822:27903,39823:27904,39824:27906,39825:27907,39826:27909,39827:27910,39828:27912,39829:27913,39830:27914,39831:27917,39832:27919,39833:27920,39834:27921,39835:27923,39836:27924,39837:27925,39838:27926,39839:27928,39840:27932,39841:27933,39842:27935,39843:27936,39844:27937,39845:27938,39846:27939,39847:27940,39848:27942,39849:27944,39850:27945,39851:27948,39852:27949,39853:27951,39854:27952,39855:27956,39856:27958,39857:27959,39858:27960,39859:27962,39860:27967,39861:27968,39862:27970,39863:27972,39864:27977,39865:27980,39866:27984,39867:27989,39868:27990,39869:27991,39870:27992,39871:27995,39872:27997,39873:27999,39874:28001,39875:28002,39876:28004,39877:28005,39878:28007,39879:28008,39880:28011,39881:28012,39882:28013,39883:28016,39884:28017,39885:28018,39886:28019,39887:28021,39888:28022,39889:28025,39890:28026,39891:28027,39892:28029,39893:28030,39894:28031,39895:28032,39896:28033,39897:28035,39898:28036,39899:28038,39900:28039,39901:28042,39902:28043,39903:28045,39904:28047,39905:28048,39906:28050,39907:28054,39908:28055,39909:28056,39910:28057,39911:28058,39912:28060,39913:28066,39914:28069,39915:28076,39916:28077,39917:28080,39918:28081,39919:28083,39920:28084,39921:28086,39922:28087,39923:28089,39924:28090,39925:28091,39926:28092,39927:28093,39928:28094,39929:28097,39930:28098,39931:28099,39932:28104,39933:28105,39934:28106,40000:28109,40001:28110,40002:28111,40003:28112,40004:28114,40005:28115,40006:28116,40007:28117,40008:28119,40009:28122,40010:28123,40011:28124,40012:28127,40013:28130,40014:28131,40015:28133,40016:28135,40017:28136,40018:28137,40019:28138,40020:28141,40021:28143,40022:28144,40023:28146,40024:28148,40025:28149,40026:28150,40027:28152,40028:28154,40029:28157,40030:28158,40031:28159,40032:28160,40033:28161,40034:28162,40035:28163,40036:28164,40037:28166,40038:28167,40039:28168,40040:28169,40041:28171,40042:28175,40043:28178,40044:28179,40045:28181,40046:28184,40047:28185,40048:28187,40049:28188,40050:28190,40051:28191,40052:28194,40053:28198,40054:28199,40055:28200,40056:28202,40057:28204,40058:28206,40059:28208,40060:28209,40061:28211,40062:28213,40064:28214,40065:28215,40066:28217,40067:28219,40068:28220,40069:28221,40070:28222,40071:28223,40072:28224,40073:28225,40074:28226,40075:28229,40076:28230,40077:28231,40078:28232,40079:28233,40080:28234,40081:28235,40082:28236,40083:28239,40084:28240,40085:28241,40086:28242,40087:28245,40088:28247,40089:28249,40090:28250,40091:28252,40092:28253,40093:28254,40094:28256,40095:28257,40096:28258,40097:28259,40098:28260,40099:28261,40100:28262,40101:28263,40102:28264,40103:28265,40104:28266,40105:28268,40106:28269,40107:28271,40108:28272,40109:28273,40110:28274,40111:28275,40112:28276,40113:28277,40114:28278,40115:28279,40116:28280,40117:28281,40118:28282,40119:28283,40120:28284,40121:28285,40122:28288,40123:28289,40124:28290,40125:28292,40126:28295,40127:28296,40128:28298,40129:28299,40130:28300,40131:28301,40132:28302,40133:28305,40134:28306,40135:28307,40136:28308,40137:28309,40138:28310,40139:28311,40140:28313,40141:28314,40142:28315,40143:28317,40144:28318,40145:28320,40146:28321,40147:28323,40148:28324,40149:28326,40150:28328,40151:28329,40152:28331,40153:28332,40154:28333,40155:28334,40156:28336,40157:28339,40158:28341,40159:28344,40160:28345,40161:28348,40162:28350,40163:28351,40164:28352,40165:28355,40166:28356,40167:28357,40168:28358,40169:28360,40170:28361,40171:28362,40172:28364,40173:28365,40174:28366,40175:28368,40176:28370,40177:28374,40178:28376,40179:28377,40180:28379,40181:28380,40182:28381,40183:28387,40184:28391,40185:28394,40186:28395,40187:28396,40188:28397,40189:28398,40190:28399,40256:28400,40257:28401,40258:28402,40259:28403,40260:28405,40261:28406,40262:28407,40263:28408,40264:28410,40265:28411,40266:28412,40267:28413,40268:28414,40269:28415,40270:28416,40271:28417,40272:28419,40273:28420,40274:28421,40275:28423,40276:28424,40277:28426,40278:28427,40279:28428,40280:28429,40281:28430,40282:28432,40283:28433,40284:28434,40285:28438,40286:28439,40287:28440,40288:28441,40289:28442,40290:28443,40291:28444,40292:28445,40293:28446,40294:28447,40295:28449,40296:28450,40297:28451,40298:28453,40299:28454,40300:28455,40301:28456,40302:28460,40303:28462,40304:28464,40305:28466,40306:28468,40307:28469,40308:28471,40309:28472,40310:28473,40311:28474,40312:28475,40313:28476,40314:28477,40315:28479,40316:28480,40317:28481,40318:28482,40320:28483,40321:28484,40322:28485,40323:28488,40324:28489,40325:28490,40326:28492,40327:28494,40328:28495,40329:28496,40330:28497,40331:28498,40332:28499,40333:28500,40334:28501,40335:28502,40336:28503,40337:28505,40338:28506,40339:28507,40340:28509,40341:28511,40342:28512,40343:28513,40344:28515,40345:28516,40346:28517,40347:28519,40348:28520,40349:28521,40350:28522,40351:28523,40352:28524,40353:28527,40354:28528,40355:28529,40356:28531,40357:28533,40358:28534,40359:28535,40360:28537,40361:28539,40362:28541,40363:28542,40364:28543,40365:28544,40366:28545,40367:28546,40368:28547,40369:28549,40370:28550,40371:28551,40372:28554,40373:28555,40374:28559,40375:28560,40376:28561,40377:28562,40378:28563,40379:28564,40380:28565,40381:28566,40382:28567,40383:28568,40384:28569,40385:28570,40386:28571,40387:28573,40388:28574,40389:28575,40390:28576,40391:28578,40392:28579,40393:28580,40394:28581,40395:28582,40396:28584,40397:28585,40398:28586,40399:28587,40400:28588,40401:28589,40402:28590,40403:28591,40404:28592,40405:28593,40406:28594,40407:28596,40408:28597,40409:28599,40410:28600,40411:28602,40412:28603,40413:28604,40414:28605,40415:28606,40416:28607,40417:28609,40418:28611,40419:28612,40420:28613,40421:28614,40422:28615,40423:28616,40424:28618,40425:28619,40426:28620,40427:28621,40428:28622,40429:28623,40430:28624,40431:28627,40432:28628,40433:28629,40434:28630,40435:28631,40436:28632,40437:28633,40438:28634,40439:28635,40440:28636,40441:28637,40442:28639,40443:28642,40444:28643,40445:28644,40446:28645,40512:28646,40513:28647,40514:28648,40515:28649,40516:28650,40517:28651,40518:28652,40519:28653,40520:28656,40521:28657,40522:28658,40523:28659,40524:28660,40525:28661,40526:28662,40527:28663,40528:28664,40529:28665,40530:28666,40531:28667,40532:28668,40533:28669,40534:28670,40535:28671,40536:28672,40537:28673,40538:28674,40539:28675,40540:28676,40541:28677,40542:28678,40543:28679,40544:28680,40545:28681,40546:28682,40547:28683,40548:28684,40549:28685,40550:28686,40551:28687,40552:28688,40553:28690,40554:28691,40555:28692,40556:28693,40557:28694,40558:28695,40559:28696,40560:28697,40561:28700,40562:28701,40563:28702,40564:28703,40565:28704,40566:28705,40567:28706,40568:28708,40569:28709,40570:28710,40571:28711,40572:28712,40573:28713,40574:28714,40576:28715,40577:28716,40578:28717,40579:28718,40580:28719,40581:28720,40582:28721,40583:28722,40584:28723,40585:28724,40586:28726,40587:28727,40588:28728,40589:28730,40590:28731,40591:28732,40592:28733,40593:28734,40594:28735,40595:28736,40596:28737,40597:28738,40598:28739,40599:28740,40600:28741,40601:28742,40602:28743,40603:28744,40604:28745,40605:28746,40606:28747,40607:28749,40608:28750,40609:28752,40610:28753,40611:28754,40612:28755,40613:28756,40614:28757,40615:28758,40616:28759,40617:28760,40618:28761,40619:28762,40620:28763,40621:28764,40622:28765,40623:28767,40624:28768,40625:28769,40626:28770,40627:28771,40628:28772,40629:28773,40630:28774,40631:28775,40632:28776,40633:28777,40634:28778,40635:28782,40636:28785,40637:28786,40638:28787,40639:28788,40640:28791,40641:28793,40642:28794,40643:28795,40644:28797,40645:28801,40646:28802,40647:28803,40648:28804,40649:28806,40650:28807,40651:28808,40652:28811,40653:28812,40654:28813,40655:28815,40656:28816,40657:28817,40658:28819,40659:28823,40660:28824,40661:28826,40662:28827,40663:28830,40664:28831,40665:28832,40666:28833,40667:28834,40668:28835,40669:28836,40670:28837,40671:28838,40672:28839,40673:28840,40674:28841,40675:28842,40676:28848,40677:28850,40678:28852,40679:28853,40680:28854,40681:28858,40682:28862,40683:28863,40684:28868,40685:28869,40686:28870,40687:28871,40688:28873,40689:28875,40690:28876,40691:28877,40692:28878,40693:28879,40694:28880,40695:28881,40696:28882,40697:28883,40698:28884,40699:28885,40700:28886,40701:28887,40702:28890,40768:28892,40769:28893,40770:28894,40771:28896,40772:28897,40773:28898,40774:28899,40775:28901,40776:28906,40777:28910,40778:28912,40779:28913,40780:28914,40781:28915,40782:28916,40783:28917,40784:28918,40785:28920,40786:28922,40787:28923,40788:28924,40789:28926,40790:28927,40791:28928,40792:28929,40793:28930,40794:28931,40795:28932,40796:28933,40797:28934,40798:28935,40799:28936,40800:28939,40801:28940,40802:28941,40803:28942,40804:28943,40805:28945,40806:28946,40807:28948,40808:28951,40809:28955,40810:28956,40811:28957,40812:28958,40813:28959,40814:28960,40815:28961,40816:28962,40817:28963,40818:28964,40819:28965,40820:28967,40821:28968,40822:28969,40823:28970,40824:28971,40825:28972,40826:28973,40827:28974,40828:28978,40829:28979,40830:28980,40832:28981,40833:28983,40834:28984,40835:28985,40836:28986,40837:28987,40838:28988,40839:28989,40840:28990,40841:28991,40842:28992,40843:28993,40844:28994,40845:28995,40846:28996,40847:28998,40848:28999,40849:29000,40850:29001,40851:29003,40852:29005,40853:29007,40854:29008,40855:29009,40856:29010,40857:29011,40858:29012,40859:29013,40860:29014,40861:29015,40862:29016,40863:29017,40864:29018,40865:29019,40866:29021,40867:29023,40868:29024,40869:29025,40870:29026,40871:29027,40872:29029,40873:29033,40874:29034,40875:29035,40876:29036,40877:29037,40878:29039,40879:29040,40880:29041,40881:29044,40882:29045,40883:29046,40884:29047,40885:29049,40886:29051,40887:29052,40888:29054,40889:29055,40890:29056,40891:29057,40892:29058,40893:29059,40894:29061,40895:29062,40896:29063,40897:29064,40898:29065,40899:29067,40900:29068,40901:29069,40902:29070,40903:29072,40904:29073,40905:29074,40906:29075,40907:29077,40908:29078,40909:29079,40910:29082,40911:29083,40912:29084,40913:29085,40914:29086,40915:29089,40916:29090,40917:29091,40918:29092,40919:29093,40920:29094,40921:29095,40922:29097,40923:29098,40924:29099,40925:29101,40926:29102,40927:29103,40928:29104,40929:29105,40930:29106,40931:29108,40932:29110,40933:29111,40934:29112,40935:29114,40936:29115,40937:29116,40938:29117,40939:29118,40940:29119,40941:29120,40942:29121,40943:29122,40944:29124,40945:29125,40946:29126,40947:29127,40948:29128,40949:29129,40950:29130,40951:29131,40952:29132,40953:29133,40954:29135,40955:29136,40956:29137,40957:29138,40958:29139,41024:29142,41025:29143,41026:29144,41027:29145,41028:29146,41029:29147,41030:29148,41031:29149,41032:29150,41033:29151,41034:29153,41035:29154,41036:29155,41037:29156,41038:29158,41039:29160,41040:29161,41041:29162,41042:29163,41043:29164,41044:29165,41045:29167,41046:29168,41047:29169,41048:29170,41049:29171,41050:29172,41051:29173,41052:29174,41053:29175,41054:29176,41055:29178,41056:29179,41057:29180,41058:29181,41059:29182,41060:29183,41061:29184,41062:29185,41063:29186,41064:29187,41065:29188,41066:29189,41067:29191,41068:29192,41069:29193,41070:29194,41071:29195,41072:29196,41073:29197,41074:29198,41075:29199,41076:29200,41077:29201,41078:29202,41079:29203,41080:29204,41081:29205,41082:29206,41083:29207,41084:29208,41085:29209,41086:29210,41088:29211,41089:29212,41090:29214,41091:29215,41092:29216,41093:29217,41094:29218,41095:29219,41096:29220,41097:29221,41098:29222,41099:29223,41100:29225,41101:29227,41102:29229,41103:29230,41104:29231,41105:29234,41106:29235,41107:29236,41108:29242,41109:29244,41110:29246,41111:29248,41112:29249,41113:29250,41114:29251,41115:29252,41116:29253,41117:29254,41118:29257,41119:29258,41120:29259,41121:29262,41122:29263,41123:29264,41124:29265,41125:29267,41126:29268,41127:29269,41128:29271,41129:29272,41130:29274,41131:29276,41132:29278,41133:29280,41134:29283,41135:29284,41136:29285,41137:29288,41138:29290,41139:29291,41140:29292,41141:29293,41142:29296,41143:29297,41144:29299,41145:29300,41146:29302,41147:29303,41148:29304,41149:29307,41150:29308,41151:29309,41152:29314,41153:29315,41154:29317,41155:29318,41156:29319,41157:29320,41158:29321,41159:29324,41160:29326,41161:29328,41162:29329,41163:29331,41164:29332,41165:29333,41166:29334,41167:29335,41168:29336,41169:29337,41170:29338,41171:29339,41172:29340,41173:29341,41174:29342,41175:29344,41176:29345,41177:29346,41178:29347,41179:29348,41180:29349,41181:29350,41182:29351,41183:29352,41184:29353,41185:29354,41186:29355,41187:29358,41188:29361,41189:29362,41190:29363,41191:29365,41192:29370,41193:29371,41194:29372,41195:29373,41196:29374,41197:29375,41198:29376,41199:29381,41200:29382,41201:29383,41202:29385,41203:29386,41204:29387,41205:29388,41206:29391,41207:29393,41208:29395,41209:29396,41210:29397,41211:29398,41212:29400,41213:29402,41214:29403,41280:58566,41281:58567,41282:58568,41283:58569,41284:58570,41285:58571,41286:58572,41287:58573,41288:58574,41289:58575,41290:58576,41291:58577,41292:58578,41293:58579,41294:58580,41295:58581,41296:58582,41297:58583,41298:58584,41299:58585,41300:58586,41301:58587,41302:58588,41303:58589,41304:58590,41305:58591,41306:58592,41307:58593,41308:58594,41309:58595,41310:58596,41311:58597,41312:58598,41313:58599,41314:58600,41315:58601,41316:58602,41317:58603,41318:58604,41319:58605,41320:58606,41321:58607,41322:58608,41323:58609,41324:58610,41325:58611,41326:58612,41327:58613,41328:58614,41329:58615,41330:58616,41331:58617,41332:58618,41333:58619,41334:58620,41335:58621,41336:58622,41337:58623,41338:58624,41339:58625,41340:58626,41341:58627,41342:58628,41344:58629,41345:58630,41346:58631,41347:58632,41348:58633,41349:58634,41350:58635,41351:58636,41352:58637,41353:58638,41354:58639,41355:58640,41356:58641,41357:58642,41358:58643,41359:58644,41360:58645,41361:58646,41362:58647,41363:58648,41364:58649,41365:58650,41366:58651,41367:58652,41368:58653,41369:58654,41370:58655,41371:58656,41372:58657,41373:58658,41374:58659,41375:58660,41376:58661,41377:12288,41378:12289,41379:12290,41380:183,41381:713,41382:711,41383:168,41384:12291,41385:12293,41386:8212,41387:65374,41388:8214,41389:8230,41390:8216,41391:8217,41392:8220,41393:8221,41394:12308,41395:12309,41396:12296,41397:12297,41398:12298,41399:12299,41400:12300,41401:12301,41402:12302,41403:12303,41404:12310,41405:12311,41406:12304,41407:12305,41408:177,41409:215,41410:247,41411:8758,41412:8743,41413:8744,41414:8721,41415:8719,41416:8746,41417:8745,41418:8712,41419:8759,41420:8730,41421:8869,41422:8741,41423:8736,41424:8978,41425:8857,41426:8747,41427:8750,41428:8801,41429:8780,41430:8776,41431:8765,41432:8733,41433:8800,41434:8814,41435:8815,41436:8804,41437:8805,41438:8734,41439:8757,41440:8756,41441:9794,41442:9792,41443:176,41444:8242,41445:8243,41446:8451,41447:65284,41448:164,41449:65504,41450:65505,41451:8240,41452:167,41453:8470,41454:9734,41455:9733,41456:9675,41457:9679,41458:9678,41459:9671,41460:9670,41461:9633,41462:9632,41463:9651,41464:9650,41465:8251,41466:8594,41467:8592,41468:8593,41469:8595,41470:12307,41536:58662,41537:58663,41538:58664,41539:58665,41540:58666,41541:58667,41542:58668,41543:58669,41544:58670,41545:58671,41546:58672,41547:58673,41548:58674,41549:58675,41550:58676,41551:58677,41552:58678,41553:58679,41554:58680,41555:58681,41556:58682,41557:58683,41558:58684,41559:58685,41560:58686,41561:58687,41562:58688,41563:58689,41564:58690,41565:58691,41566:58692,41567:58693,41568:58694,41569:58695,41570:58696,41571:58697,41572:58698,41573:58699,41574:58700,41575:58701,41576:58702,41577:58703,41578:58704,41579:58705,41580:58706,41581:58707,41582:58708,41583:58709,41584:58710,41585:58711,41586:58712,41587:58713,41588:58714,41589:58715,41590:58716,41591:58717,41592:58718,41593:58719,41594:58720,41595:58721,41596:58722,41597:58723,41598:58724,41600:58725,41601:58726,41602:58727,41603:58728,41604:58729,41605:58730,41606:58731,41607:58732,41608:58733,41609:58734,41610:58735,41611:58736,41612:58737,41613:58738,41614:58739,41615:58740,41616:58741,41617:58742,41618:58743,41619:58744,41620:58745,41621:58746,41622:58747,41623:58748,41624:58749,41625:58750,41626:58751,41627:58752,41628:58753,41629:58754,41630:58755,41631:58756,41632:58757,41633:8560,41634:8561,41635:8562,41636:8563,41637:8564,41638:8565,41639:8566,41640:8567,41641:8568,41642:8569,41643:59238,41644:59239,41645:59240,41646:59241,41647:59242,41648:59243,41649:9352,41650:9353,41651:9354,41652:9355,41653:9356,41654:9357,41655:9358,41656:9359,41657:9360,41658:9361,41659:9362,41660:9363,41661:9364,41662:9365,41663:9366,41664:9367,41665:9368,41666:9369,41667:9370,41668:9371,41669:9332,41670:9333,41671:9334,41672:9335,41673:9336,41674:9337,41675:9338,41676:9339,41677:9340,41678:9341,41679:9342,41680:9343,41681:9344,41682:9345,41683:9346,41684:9347,41685:9348,41686:9349,41687:9350,41688:9351,41689:9312,41690:9313,41691:9314,41692:9315,41693:9316,41694:9317,41695:9318,41696:9319,41697:9320,41698:9321,41699:8364,41700:59245,41701:12832,41702:12833,41703:12834,41704:12835,41705:12836,41706:12837,41707:12838,41708:12839,41709:12840,41710:12841,41711:59246,41712:59247,41713:8544,41714:8545,41715:8546,41716:8547,41717:8548,41718:8549,41719:8550,41720:8551,41721:8552,41722:8553,41723:8554,41724:8555,41725:59248,41726:59249,41792:58758,41793:58759,41794:58760,41795:58761,41796:58762,41797:58763,41798:58764,41799:58765,41800:58766,41801:58767,41802:58768,41803:58769,41804:58770,41805:58771,41806:58772,41807:58773,41808:58774,41809:58775,41810:58776,41811:58777,41812:58778,41813:58779,41814:58780,41815:58781,41816:58782,41817:58783,41818:58784,41819:58785,41820:58786,41821:58787,41822:58788,41823:58789,41824:58790,41825:58791,41826:58792,41827:58793,41828:58794,41829:58795,41830:58796,41831:58797,41832:58798,41833:58799,41834:58800,41835:58801,41836:58802,41837:58803,41838:58804,41839:58805,41840:58806,41841:58807,41842:58808,41843:58809,41844:58810,41845:58811,41846:58812,41847:58813,41848:58814,41849:58815,41850:58816,41851:58817,41852:58818,41853:58819,41854:58820,41856:58821,41857:58822,41858:58823,41859:58824,41860:58825,41861:58826,41862:58827,41863:58828,41864:58829,41865:58830,41866:58831,41867:58832,41868:58833,41869:58834,41870:58835,41871:58836,41872:58837,41873:58838,41874:58839,41875:58840,41876:58841,41877:58842,41878:58843,41879:58844,41880:58845,41881:58846,41882:58847,41883:58848,41884:58849,41885:58850,41886:58851,41887:58852,41888:58853,41889:65281,41890:65282,41891:65283,41892:65509,41893:65285,41894:65286,41895:65287,41896:65288,41897:65289,41898:65290,41899:65291,41900:65292,41901:65293,41902:65294,41903:65295,41904:65296,41905:65297,41906:65298,41907:65299,41908:65300,41909:65301,41910:65302,41911:65303,41912:65304,41913:65305,41914:65306,41915:65307,41916:65308,41917:65309,41918:65310,41919:65311,41920:65312,41921:65313,41922:65314,41923:65315,41924:65316,41925:65317,41926:65318,41927:65319,41928:65320,41929:65321,41930:65322,41931:65323,41932:65324,41933:65325,41934:65326,41935:65327,41936:65328,41937:65329,41938:65330,41939:65331,41940:65332,41941:65333,41942:65334,41943:65335,41944:65336,41945:65337,41946:65338,41947:65339,41948:65340,41949:65341,41950:65342,41951:65343,41952:65344,41953:65345,41954:65346,41955:65347,41956:65348,41957:65349,41958:65350,41959:65351,41960:65352,41961:65353,41962:65354,41963:65355,41964:65356,41965:65357,41966:65358,41967:65359,41968:65360,41969:65361,41970:65362,41971:65363,41972:65364,41973:65365,41974:65366,41975:65367,41976:65368,41977:65369,41978:65370,41979:65371,41980:65372,41981:65373,41982:65507,42048:58854,42049:58855,42050:58856,42051:58857,42052:58858,42053:58859,42054:58860,42055:58861,42056:58862,42057:58863,42058:58864,42059:58865,42060:58866,42061:58867,42062:58868,42063:58869,42064:58870,42065:58871,42066:58872,42067:58873,42068:58874,42069:58875,42070:58876,42071:58877,42072:58878,42073:58879,42074:58880,42075:58881,42076:58882,42077:58883,42078:58884,42079:58885,42080:58886,42081:58887,42082:58888,42083:58889,42084:58890,42085:58891,42086:58892,42087:58893,42088:58894,42089:58895,42090:58896,42091:58897,42092:58898,42093:58899,42094:58900,42095:58901,42096:58902,42097:58903,42098:58904,42099:58905,42100:58906,42101:58907,42102:58908,42103:58909,42104:58910,42105:58911,42106:58912,42107:58913,42108:58914,42109:58915,42110:58916,42112:58917,42113:58918,42114:58919,42115:58920,42116:58921,42117:58922,42118:58923,42119:58924,42120:58925,42121:58926,42122:58927,42123:58928,42124:58929,42125:58930,42126:58931,42127:58932,42128:58933,42129:58934,42130:58935,42131:58936,42132:58937,42133:58938,42134:58939,42135:58940,42136:58941,42137:58942,42138:58943,42139:58944,42140:58945,42141:58946,42142:58947,42143:58948,42144:58949,42145:12353,42146:12354,42147:12355,42148:12356,42149:12357,42150:12358,42151:12359,42152:12360,42153:12361,42154:12362,42155:12363,42156:12364,42157:12365,42158:12366,42159:12367,42160:12368,42161:12369,42162:12370,42163:12371,42164:12372,42165:12373,42166:12374,42167:12375,42168:12376,42169:12377,42170:12378,42171:12379,42172:12380,42173:12381,42174:12382,42175:12383,42176:12384,42177:12385,42178:12386,42179:12387,42180:12388,42181:12389,42182:12390,42183:12391,42184:12392,42185:12393,42186:12394,42187:12395,42188:12396,42189:12397,42190:12398,42191:12399,42192:12400,42193:12401,42194:12402,42195:12403,42196:12404,42197:12405,42198:12406,42199:12407,42200:12408,42201:12409,42202:12410,42203:12411,42204:12412,42205:12413,42206:12414,42207:12415,42208:12416,42209:12417,42210:12418,42211:12419,42212:12420,42213:12421,42214:12422,42215:12423,42216:12424,42217:12425,42218:12426,42219:12427,42220:12428,42221:12429,42222:12430,42223:12431,42224:12432,42225:12433,42226:12434,42227:12435,42228:59250,42229:59251,42230:59252,42231:59253,42232:59254,42233:59255,42234:59256,42235:59257,42236:59258,42237:59259,42238:59260,42304:58950,42305:58951,42306:58952,42307:58953,42308:58954,42309:58955,42310:58956,42311:58957,42312:58958,42313:58959,42314:58960,42315:58961,42316:58962,42317:58963,42318:58964,42319:58965,42320:58966,42321:58967,42322:58968,42323:58969,42324:58970,42325:58971,42326:58972,42327:58973,42328:58974,42329:58975,42330:58976,42331:58977,42332:58978,42333:58979,42334:58980,42335:58981,42336:58982,42337:58983,42338:58984,42339:58985,42340:58986,42341:58987,42342:58988,42343:58989,42344:58990,42345:58991,42346:58992,42347:58993,42348:58994,42349:58995,42350:58996,42351:58997,42352:58998,42353:58999,42354:59000,42355:59001,42356:59002,42357:59003,42358:59004,42359:59005,42360:59006,42361:59007,42362:59008,42363:59009,42364:59010,42365:59011,42366:59012,42368:59013,42369:59014,42370:59015,42371:59016,42372:59017,42373:59018,42374:59019,42375:59020,42376:59021,42377:59022,42378:59023,42379:59024,42380:59025,42381:59026,42382:59027,42383:59028,42384:59029,42385:59030,42386:59031,42387:59032,42388:59033,42389:59034,42390:59035,42391:59036,42392:59037,42393:59038,42394:59039,42395:59040,42396:59041,42397:59042,42398:59043,42399:59044,42400:59045,42401:12449,42402:12450,42403:12451,42404:12452,42405:12453,42406:12454,42407:12455,42408:12456,42409:12457,42410:12458,42411:12459,42412:12460,42413:12461,42414:12462,42415:12463,42416:12464,42417:12465,42418:12466,42419:12467,42420:12468,42421:12469,42422:12470,42423:12471,42424:12472,42425:12473,42426:12474,42427:12475,42428:12476,42429:12477,42430:12478,42431:12479,42432:12480,42433:12481,42434:12482,42435:12483,42436:12484,42437:12485,42438:12486,42439:12487,42440:12488,42441:12489,42442:12490,42443:12491,42444:12492,42445:12493,42446:12494,42447:12495,42448:12496,42449:12497,42450:12498,42451:12499,42452:12500,42453:12501,42454:12502,42455:12503,42456:12504,42457:12505,42458:12506,42459:12507,42460:12508,42461:12509,42462:12510,42463:12511,42464:12512,42465:12513,42466:12514,42467:12515,42468:12516,42469:12517,42470:12518,42471:12519,42472:12520,42473:12521,42474:12522,42475:12523,42476:12524,42477:12525,42478:12526,42479:12527,42480:12528,42481:12529,42482:12530,42483:12531,42484:12532,42485:12533,42486:12534,42487:59261,42488:59262,42489:59263,42490:59264,42491:59265,42492:59266,42493:59267,42494:59268,42560:59046,42561:59047,42562:59048,42563:59049,42564:59050,42565:59051,42566:59052,42567:59053,42568:59054,42569:59055,42570:59056,42571:59057,42572:59058,42573:59059,42574:59060,42575:59061,42576:59062,42577:59063,42578:59064,42579:59065,42580:59066,42581:59067,42582:59068,42583:59069,42584:59070,42585:59071,42586:59072,42587:59073,42588:59074,42589:59075,42590:59076,42591:59077,42592:59078,42593:59079,42594:59080,42595:59081,42596:59082,42597:59083,42598:59084,42599:59085,42600:59086,42601:59087,42602:59088,42603:59089,42604:59090,42605:59091,42606:59092,42607:59093,42608:59094,42609:59095,42610:59096,42611:59097,42612:59098,42613:59099,42614:59100,42615:59101,42616:59102,42617:59103,42618:59104,42619:59105,42620:59106,42621:59107,42622:59108,42624:59109,42625:59110,42626:59111,42627:59112,42628:59113,42629:59114,42630:59115,42631:59116,42632:59117,42633:59118,42634:59119,42635:59120,42636:59121,42637:59122,42638:59123,42639:59124,42640:59125,42641:59126,42642:59127,42643:59128,42644:59129,42645:59130,42646:59131,42647:59132,42648:59133,42649:59134,42650:59135,42651:59136,42652:59137,42653:59138,42654:59139,42655:59140,42656:59141,42657:913,42658:914,42659:915,42660:916,42661:917,42662:918,42663:919,42664:920,42665:921,42666:922,42667:923,42668:924,42669:925,42670:926,42671:927,42672:928,42673:929,42674:931,42675:932,42676:933,42677:934,42678:935,42679:936,42680:937,42681:59269,42682:59270,42683:59271,42684:59272,42685:59273,42686:59274,42687:59275,42688:59276,42689:945,42690:946,42691:947,42692:948,42693:949,42694:950,42695:951,42696:952,42697:953,42698:954,42699:955,42700:956,42701:957,42702:958,42703:959,42704:960,42705:961,42706:963,42707:964,42708:965,42709:966,42710:967,42711:968,42712:969,42713:59277,42714:59278,42715:59279,42716:59280,42717:59281,42718:59282,42719:59283,42720:65077,42721:65078,42722:65081,42723:65082,42724:65087,42725:65088,42726:65085,42727:65086,42728:65089,42729:65090,42730:65091,42731:65092,42732:59284,42733:59285,42734:65083,42735:65084,42736:65079,42737:65080,42738:65073,42739:59286,42740:65075,42741:65076,42742:59287,42743:59288,42744:59289,42745:59290,42746:59291,42747:59292,42748:59293,42749:59294,42750:59295,42816:59142,42817:59143,42818:59144,42819:59145,42820:59146,42821:59147,42822:59148,42823:59149,42824:59150,42825:59151,42826:59152,42827:59153,42828:59154,42829:59155,42830:59156,42831:59157,42832:59158,42833:59159,42834:59160,42835:59161,42836:59162,42837:59163,42838:59164,42839:59165,42840:59166,42841:59167,42842:59168,42843:59169,42844:59170,42845:59171,42846:59172,42847:59173,42848:59174,42849:59175,42850:59176,42851:59177,42852:59178,42853:59179,42854:59180,42855:59181,42856:59182,42857:59183,42858:59184,42859:59185,42860:59186,42861:59187,42862:59188,42863:59189,42864:59190,42865:59191,42866:59192,42867:59193,42868:59194,42869:59195,42870:59196,42871:59197,42872:59198,42873:59199,42874:59200,42875:59201,42876:59202,42877:59203,42878:59204,42880:59205,42881:59206,42882:59207,42883:59208,42884:59209,42885:59210,42886:59211,42887:59212,42888:59213,42889:59214,42890:59215,42891:59216,42892:59217,42893:59218,42894:59219,42895:59220,42896:59221,42897:59222,42898:59223,42899:59224,42900:59225,42901:59226,42902:59227,42903:59228,42904:59229,42905:59230,42906:59231,42907:59232,42908:59233,42909:59234,42910:59235,42911:59236,42912:59237,42913:1040,42914:1041,42915:1042,42916:1043,42917:1044,42918:1045,42919:1025,42920:1046,42921:1047,42922:1048,42923:1049,42924:1050,42925:1051,42926:1052,42927:1053,42928:1054,42929:1055,42930:1056,42931:1057,42932:1058,42933:1059,42934:1060,42935:1061,42936:1062,42937:1063,42938:1064,42939:1065,42940:1066,42941:1067,42942:1068,42943:1069,42944:1070,42945:1071,42946:59296,42947:59297,42948:59298,42949:59299,42950:59300,42951:59301,42952:59302,42953:59303,42954:59304,42955:59305,42956:59306,42957:59307,42958:59308,42959:59309,42960:59310,42961:1072,42962:1073,42963:1074,42964:1075,42965:1076,42966:1077,42967:1105,42968:1078,42969:1079,42970:1080,42971:1081,42972:1082,42973:1083,42974:1084,42975:1085,42976:1086,42977:1087,42978:1088,42979:1089,42980:1090,42981:1091,42982:1092,42983:1093,42984:1094,42985:1095,42986:1096,42987:1097,42988:1098,42989:1099,42990:1100,42991:1101,42992:1102,42993:1103,42994:59311,42995:59312,42996:59313,42997:59314,42998:59315,42999:59316,43000:59317,43001:59318,43002:59319,43003:59320,43004:59321,43005:59322,43006:59323,43072:714,43073:715,43074:729,43075:8211,43076:8213,43077:8229,43078:8245,43079:8453,43080:8457,43081:8598,43082:8599,43083:8600,43084:8601,43085:8725,43086:8735,43087:8739,43088:8786,43089:8806,43090:8807,43091:8895,43092:9552,43093:9553,43094:9554,43095:9555,43096:9556,43097:9557,43098:9558,43099:9559,43100:9560,43101:9561,43102:9562,43103:9563,43104:9564,43105:9565,43106:9566,43107:9567,43108:9568,43109:9569,43110:9570,43111:9571,43112:9572,43113:9573,43114:9574,43115:9575,43116:9576,43117:9577,43118:9578,43119:9579,43120:9580,43121:9581,43122:9582,43123:9583,43124:9584,43125:9585,43126:9586,43127:9587,43128:9601,43129:9602,43130:9603,43131:9604,43132:9605,43133:9606,43134:9607,43136:9608,43137:9609,43138:9610,43139:9611,43140:9612,43141:9613,43142:9614,43143:9615,43144:9619,43145:9620,43146:9621,43147:9660,43148:9661,43149:9698,43150:9699,43151:9700,43152:9701,43153:9737,43154:8853,43155:12306,43156:12317,43157:12318,43158:59324,43159:59325,43160:59326,43161:59327,43162:59328,43163:59329,43164:59330,43165:59331,43166:59332,43167:59333,43168:59334,43169:257,43170:225,43171:462,43172:224,43173:275,43174:233,43175:283,43176:232,43177:299,43178:237,43179:464,43180:236,43181:333,43182:243,43183:466,43184:242,43185:363,43186:250,43187:468,43188:249,43189:470,43190:472,43191:474,43192:476,43193:252,43194:234,43195:593,43196:59335,43197:324,43198:328,43199:505,43200:609,43201:59337,43202:59338,43203:59339,43204:59340,43205:12549,43206:12550,43207:12551,43208:12552,43209:12553,43210:12554,43211:12555,43212:12556,43213:12557,43214:12558,43215:12559,43216:12560,43217:12561,43218:12562,43219:12563,43220:12564,43221:12565,43222:12566,43223:12567,43224:12568,43225:12569,43226:12570,43227:12571,43228:12572,43229:12573,43230:12574,43231:12575,43232:12576,43233:12577,43234:12578,43235:12579,43236:12580,43237:12581,43238:12582,43239:12583,43240:12584,43241:12585,43242:59341,43243:59342,43244:59343,43245:59344,43246:59345,43247:59346,43248:59347,43249:59348,43250:59349,43251:59350,43252:59351,43253:59352,43254:59353,43255:59354,43256:59355,43257:59356,43258:59357,43259:59358,43260:59359,43261:59360,43262:59361,43328:12321,43329:12322,43330:12323,43331:12324,43332:12325,43333:12326,43334:12327,43335:12328,43336:12329,43337:12963,43338:13198,43339:13199,43340:13212,43341:13213,43342:13214,43343:13217,43344:13252,43345:13262,43346:13265,43347:13266,43348:13269,43349:65072,43350:65506,43351:65508,43352:59362,43353:8481,43354:12849,43355:59363,43356:8208,43357:59364,43358:59365,43359:59366,43360:12540,43361:12443,43362:12444,43363:12541,43364:12542,43365:12294,43366:12445,43367:12446,43368:65097,43369:65098,43370:65099,43371:65100,43372:65101,43373:65102,43374:65103,43375:65104,43376:65105,43377:65106,43378:65108,43379:65109,43380:65110,43381:65111,43382:65113,43383:65114,43384:65115,43385:65116,43386:65117,43387:65118,43388:65119,43389:65120,43390:65121,43392:65122,43393:65123,43394:65124,43395:65125,43396:65126,43397:65128,43398:65129,43399:65130,43400:65131,43401:12350,43402:12272,43403:12273,43404:12274,43405:12275,43406:12276,43407:12277,43408:12278,43409:12279,43410:12280,43411:12281,43412:12282,43413:12283,43414:12295,43415:59380,43416:59381,43417:59382,43418:59383,43419:59384,43420:59385,43421:59386,43422:59387,43423:59388,43424:59389,43425:59390,43426:59391,43427:59392,43428:9472,43429:9473,43430:9474,43431:9475,43432:9476,43433:9477,43434:9478,43435:9479,43436:9480,43437:9481,43438:9482,43439:9483,43440:9484,43441:9485,43442:9486,43443:9487,43444:9488,43445:9489,43446:9490,43447:9491,43448:9492,43449:9493,43450:9494,43451:9495,43452:9496,43453:9497,43454:9498,43455:9499,43456:9500,43457:9501,43458:9502,43459:9503,43460:9504,43461:9505,43462:9506,43463:9507,43464:9508,43465:9509,43466:9510,43467:9511,43468:9512,43469:9513,43470:9514,43471:9515,43472:9516,43473:9517,43474:9518,43475:9519,43476:9520,43477:9521,43478:9522,43479:9523,43480:9524,43481:9525,43482:9526,43483:9527,43484:9528,43485:9529,43486:9530,43487:9531,43488:9532,43489:9533,43490:9534,43491:9535,43492:9536,43493:9537,43494:9538,43495:9539,43496:9540,43497:9541,43498:9542,43499:9543,43500:9544,43501:9545,43502:9546,43503:9547,43504:59393,43505:59394,43506:59395,43507:59396,43508:59397,43509:59398,43510:59399,43511:59400,43512:59401,43513:59402,43514:59403,43515:59404,43516:59405,43517:59406,43518:59407,43584:29404,43585:29405,43586:29407,43587:29410,43588:29411,43589:29412,43590:29413,43591:29414,43592:29415,43593:29418,43594:29419,43595:29429,43596:29430,43597:29433,43598:29437,43599:29438,43600:29439,43601:29440,43602:29442,43603:29444,43604:29445,43605:29446,43606:29447,43607:29448,43608:29449,43609:29451,43610:29452,43611:29453,43612:29455,43613:29456,43614:29457,43615:29458,43616:29460,43617:29464,43618:29465,43619:29466,43620:29471,43621:29472,43622:29475,43623:29476,43624:29478,43625:29479,43626:29480,43627:29485,43628:29487,43629:29488,43630:29490,43631:29491,43632:29493,43633:29494,43634:29498,43635:29499,43636:29500,43637:29501,43638:29504,43639:29505,43640:29506,43641:29507,43642:29508,43643:29509,43644:29510,43645:29511,43646:29512,43648:29513,43649:29514,43650:29515,43651:29516,43652:29518,43653:29519,43654:29521,43655:29523,43656:29524,43657:29525,43658:29526,43659:29528,43660:29529,43661:29530,43662:29531,43663:29532,43664:29533,43665:29534,43666:29535,43667:29537,43668:29538,43669:29539,43670:29540,43671:29541,43672:29542,43673:29543,43674:29544,43675:29545,43676:29546,43677:29547,43678:29550,43679:29552,43680:29553,43681:57344,43682:57345,43683:57346,43684:57347,43685:57348,43686:57349,43687:57350,43688:57351,43689:57352,43690:57353,43691:57354,43692:57355,43693:57356,43694:57357,43695:57358,43696:57359,43697:57360,43698:57361,43699:57362,43700:57363,43701:57364,43702:57365,43703:57366,43704:57367,43705:57368,43706:57369,43707:57370,43708:57371,43709:57372,43710:57373,43711:57374,43712:57375,43713:57376,43714:57377,43715:57378,43716:57379,43717:57380,43718:57381,43719:57382,43720:57383,43721:57384,43722:57385,43723:57386,43724:57387,43725:57388,43726:57389,43727:57390,43728:57391,43729:57392,43730:57393,43731:57394,43732:57395,43733:57396,43734:57397,43735:57398,43736:57399,43737:57400,43738:57401,43739:57402,43740:57403,43741:57404,43742:57405,43743:57406,43744:57407,43745:57408,43746:57409,43747:57410,43748:57411,43749:57412,43750:57413,43751:57414,43752:57415,43753:57416,43754:57417,43755:57418,43756:57419,43757:57420,43758:57421,43759:57422,43760:57423,43761:57424,43762:57425,43763:57426,43764:57427,43765:57428,43766:57429,43767:57430,43768:57431,43769:57432,43770:57433,43771:57434,43772:57435,43773:57436,43774:57437,43840:29554,43841:29555,43842:29556,43843:29557,43844:29558,43845:29559,43846:29560,43847:29561,43848:29562,43849:29563,43850:29564,43851:29565,43852:29567,43853:29568,43854:29569,43855:29570,43856:29571,43857:29573,43858:29574,43859:29576,43860:29578,43861:29580,43862:29581,43863:29583,43864:29584,43865:29586,43866:29587,43867:29588,43868:29589,43869:29591,43870:29592,43871:29593,43872:29594,43873:29596,43874:29597,43875:29598,43876:29600,43877:29601,43878:29603,43879:29604,43880:29605,43881:29606,43882:29607,43883:29608,43884:29610,43885:29612,43886:29613,43887:29617,43888:29620,43889:29621,43890:29622,43891:29624,43892:29625,43893:29628,43894:29629,43895:29630,43896:29631,43897:29633,43898:29635,43899:29636,43900:29637,43901:29638,43902:29639,43904:29643,43905:29644,43906:29646,43907:29650,43908:29651,43909:29652,43910:29653,43911:29654,43912:29655,43913:29656,43914:29658,43915:29659,43916:29660,43917:29661,43918:29663,43919:29665,43920:29666,43921:29667,43922:29668,43923:29670,43924:29672,43925:29674,43926:29675,43927:29676,43928:29678,43929:29679,43930:29680,43931:29681,43932:29683,43933:29684,43934:29685,43935:29686,43936:29687,43937:57438,43938:57439,43939:57440,43940:57441,43941:57442,43942:57443,43943:57444,43944:57445,43945:57446,43946:57447,43947:57448,43948:57449,43949:57450,43950:57451,43951:57452,43952:57453,43953:57454,43954:57455,43955:57456,43956:57457,43957:57458,43958:57459,43959:57460,43960:57461,43961:57462,43962:57463,43963:57464,43964:57465,43965:57466,43966:57467,43967:57468,43968:57469,43969:57470,43970:57471,43971:57472,43972:57473,43973:57474,43974:57475,43975:57476,43976:57477,43977:57478,43978:57479,43979:57480,43980:57481,43981:57482,43982:57483,43983:57484,43984:57485,43985:57486,43986:57487,43987:57488,43988:57489,43989:57490,43990:57491,43991:57492,43992:57493,43993:57494,43994:57495,43995:57496,43996:57497,43997:57498,43998:57499,43999:57500,44000:57501,44001:57502,44002:57503,44003:57504,44004:57505,44005:57506,44006:57507,44007:57508,44008:57509,44009:57510,44010:57511,44011:57512,44012:57513,44013:57514,44014:57515,44015:57516,44016:57517,44017:57518,44018:57519,44019:57520,44020:57521,44021:57522,44022:57523,44023:57524,44024:57525,44025:57526,44026:57527,44027:57528,44028:57529,44029:57530,44030:57531,44096:29688,44097:29689,44098:29690,44099:29691,44100:29692,44101:29693,44102:29694,44103:29695,44104:29696,44105:29697,44106:29698,44107:29700,44108:29703,44109:29704,44110:29707,44111:29708,44112:29709,44113:29710,44114:29713,44115:29714,44116:29715,44117:29716,44118:29717,44119:29718,44120:29719,44121:29720,44122:29721,44123:29724,44124:29725,44125:29726,44126:29727,44127:29728,44128:29729,44129:29731,44130:29732,44131:29735,44132:29737,44133:29739,44134:29741,44135:29743,44136:29745,44137:29746,44138:29751,44139:29752,44140:29753,44141:29754,44142:29755,44143:29757,44144:29758,44145:29759,44146:29760,44147:29762,44148:29763,44149:29764,44150:29765,44151:29766,44152:29767,44153:29768,44154:29769,44155:29770,44156:29771,44157:29772,44158:29773,44160:29774,44161:29775,44162:29776,44163:29777,44164:29778,44165:29779,44166:29780,44167:29782,44168:29784,44169:29789,44170:29792,44171:29793,44172:29794,44173:29795,44174:29796,44175:29797,44176:29798,44177:29799,44178:29800,44179:29801,44180:29802,44181:29803,44182:29804,44183:29806,44184:29807,44185:29809,44186:29810,44187:29811,44188:29812,44189:29813,44190:29816,44191:29817,44192:29818,44193:57532,44194:57533,44195:57534,44196:57535,44197:57536,44198:57537,44199:57538,44200:57539,44201:57540,44202:57541,44203:57542,44204:57543,44205:57544,44206:57545,44207:57546,44208:57547,44209:57548,44210:57549,44211:57550,44212:57551,44213:57552,44214:57553,44215:57554,44216:57555,44217:57556,44218:57557,44219:57558,44220:57559,44221:57560,44222:57561,44223:57562,44224:57563,44225:57564,44226:57565,44227:57566,44228:57567,44229:57568,44230:57569,44231:57570,44232:57571,44233:57572,44234:57573,44235:57574,44236:57575,44237:57576,44238:57577,44239:57578,44240:57579,44241:57580,44242:57581,44243:57582,44244:57583,44245:57584,44246:57585,44247:57586,44248:57587,44249:57588,44250:57589,44251:57590,44252:57591,44253:57592,44254:57593,44255:57594,44256:57595,44257:57596,44258:57597,44259:57598,44260:57599,44261:57600,44262:57601,44263:57602,44264:57603,44265:57604,44266:57605,44267:57606,44268:57607,44269:57608,44270:57609,44271:57610,44272:57611,44273:57612,44274:57613,44275:57614,44276:57615,44277:57616,44278:57617,44279:57618,44280:57619,44281:57620,44282:57621,44283:57622,44284:57623,44285:57624,44286:57625,44352:29819,44353:29820,44354:29821,44355:29823,44356:29826,44357:29828,44358:29829,44359:29830,44360:29832,44361:29833,44362:29834,44363:29836,44364:29837,44365:29839,44366:29841,44367:29842,44368:29843,44369:29844,44370:29845,44371:29846,44372:29847,44373:29848,44374:29849,44375:29850,44376:29851,44377:29853,44378:29855,44379:29856,44380:29857,44381:29858,44382:29859,44383:29860,44384:29861,44385:29862,44386:29866,44387:29867,44388:29868,44389:29869,44390:29870,44391:29871,44392:29872,44393:29873,44394:29874,44395:29875,44396:29876,44397:29877,44398:29878,44399:29879,44400:29880,44401:29881,44402:29883,44403:29884,44404:29885,44405:29886,44406:29887,44407:29888,44408:29889,44409:29890,44410:29891,44411:29892,44412:29893,44413:29894,44414:29895,44416:29896,44417:29897,44418:29898,44419:29899,44420:29900,44421:29901,44422:29902,44423:29903,44424:29904,44425:29905,44426:29907,44427:29908,44428:29909,44429:29910,44430:29911,44431:29912,44432:29913,44433:29914,44434:29915,44435:29917,44436:29919,44437:29921,44438:29925,44439:29927,44440:29928,44441:29929,44442:29930,44443:29931,44444:29932,44445:29933,44446:29936,44447:29937,44448:29938,44449:57626,44450:57627,44451:57628,44452:57629,44453:57630,44454:57631,44455:57632,44456:57633,44457:57634,44458:57635,44459:57636,44460:57637,44461:57638,44462:57639,44463:57640,44464:57641,44465:57642,44466:57643,44467:57644,44468:57645,44469:57646,44470:57647,44471:57648,44472:57649,44473:57650,44474:57651,44475:57652,44476:57653,44477:57654,44478:57655,44479:57656,44480:57657,44481:57658,44482:57659,44483:57660,44484:57661,44485:57662,44486:57663,44487:57664,44488:57665,44489:57666,44490:57667,44491:57668,44492:57669,44493:57670,44494:57671,44495:57672,44496:57673,44497:57674,44498:57675,44499:57676,44500:57677,44501:57678,44502:57679,44503:57680,44504:57681,44505:57682,44506:57683,44507:57684,44508:57685,44509:57686,44510:57687,44511:57688,44512:57689,44513:57690,44514:57691,44515:57692,44516:57693,44517:57694,44518:57695,44519:57696,44520:57697,44521:57698,44522:57699,44523:57700,44524:57701,44525:57702,44526:57703,44527:57704,44528:57705,44529:57706,44530:57707,44531:57708,44532:57709,44533:57710,44534:57711,44535:57712,44536:57713,44537:57714,44538:57715,44539:57716,44540:57717,44541:57718,44542:57719,44608:29939,44609:29941,44610:29944,44611:29945,44612:29946,44613:29947,44614:29948,44615:29949,44616:29950,44617:29952,44618:29953,44619:29954,44620:29955,44621:29957,44622:29958,44623:29959,44624:29960,44625:29961,44626:29962,44627:29963,44628:29964,44629:29966,44630:29968,44631:29970,44632:29972,44633:29973,44634:29974,44635:29975,44636:29979,44637:29981,44638:29982,44639:29984,44640:29985,44641:29986,44642:29987,44643:29988,44644:29990,44645:29991,44646:29994,44647:29998,44648:30004,44649:30006,44650:30009,44651:30012,44652:30013,44653:30015,44654:30017,44655:30018,44656:30019,44657:30020,44658:30022,44659:30023,44660:30025,44661:30026,44662:30029,44663:30032,44664:30033,44665:30034,44666:30035,44667:30037,44668:30038,44669:30039,44670:30040,44672:30045,44673:30046,44674:30047,44675:30048,44676:30049,44677:30050,44678:30051,44679:30052,44680:30055,44681:30056,44682:30057,44683:30059,44684:30060,44685:30061,44686:30062,44687:30063,44688:30064,44689:30065,44690:30067,44691:30069,44692:30070,44693:30071,44694:30074,44695:30075,44696:30076,44697:30077,44698:30078,44699:30080,44700:30081,44701:30082,44702:30084,44703:30085,44704:30087,44705:57720,44706:57721,44707:57722,44708:57723,44709:57724,44710:57725,44711:57726,44712:57727,44713:57728,44714:57729,44715:57730,44716:57731,44717:57732,44718:57733,44719:57734,44720:57735,44721:57736,44722:57737,44723:57738,44724:57739,44725:57740,44726:57741,44727:57742,44728:57743,44729:57744,44730:57745,44731:57746,44732:57747,44733:57748,44734:57749,44735:57750,44736:57751,44737:57752,44738:57753,44739:57754,44740:57755,44741:57756,44742:57757,44743:57758,44744:57759,44745:57760,44746:57761,44747:57762,44748:57763,44749:57764,44750:57765,44751:57766,44752:57767,44753:57768,44754:57769,44755:57770,44756:57771,44757:57772,44758:57773,44759:57774,44760:57775,44761:57776,44762:57777,44763:57778,44764:57779,44765:57780,44766:57781,44767:57782,44768:57783,44769:57784,44770:57785,44771:57786,44772:57787,44773:57788,44774:57789,44775:57790,44776:57791,44777:57792,44778:57793,44779:57794,44780:57795,44781:57796,44782:57797,44783:57798,44784:57799,44785:57800,44786:57801,44787:57802,44788:57803,44789:57804,44790:57805,44791:57806,44792:57807,44793:57808,44794:57809,44795:57810,44796:57811,44797:57812,44798:57813,44864:30088,44865:30089,44866:30090,44867:30092,44868:30093,44869:30094,44870:30096,44871:30099,44872:30101,44873:30104,44874:30107,44875:30108,44876:30110,44877:30114,44878:30118,44879:30119,44880:30120,44881:30121,44882:30122,44883:30125,44884:30134,44885:30135,44886:30138,44887:30139,44888:30143,44889:30144,44890:30145,44891:30150,44892:30155,44893:30156,44894:30158,44895:30159,44896:30160,44897:30161,44898:30163,44899:30167,44900:30169,44901:30170,44902:30172,44903:30173,44904:30175,44905:30176,44906:30177,44907:30181,44908:30185,44909:30188,44910:30189,44911:30190,44912:30191,44913:30194,44914:30195,44915:30197,44916:30198,44917:30199,44918:30200,44919:30202,44920:30203,44921:30205,44922:30206,44923:30210,44924:30212,44925:30214,44926:30215,44928:30216,44929:30217,44930:30219,44931:30221,44932:30222,44933:30223,44934:30225,44935:30226,44936:30227,44937:30228,44938:30230,44939:30234,44940:30236,44941:30237,44942:30238,44943:30241,44944:30243,44945:30247,44946:30248,44947:30252,44948:30254,44949:30255,44950:30257,44951:30258,44952:30262,44953:30263,44954:30265,44955:30266,44956:30267,44957:30269,44958:30273,44959:30274,44960:30276,44961:57814,44962:57815,44963:57816,44964:57817,44965:57818,44966:57819,44967:57820,44968:57821,44969:57822,44970:57823,44971:57824,44972:57825,44973:57826,44974:57827,44975:57828,44976:57829,44977:57830,44978:57831,44979:57832,44980:57833,44981:57834,44982:57835,44983:57836,44984:57837,44985:57838,44986:57839,44987:57840,44988:57841,44989:57842,44990:57843,44991:57844,44992:57845,44993:57846,44994:57847,44995:57848,44996:57849,44997:57850,44998:57851,44999:57852,45000:57853,45001:57854,45002:57855,45003:57856,45004:57857,45005:57858,45006:57859,45007:57860,45008:57861,45009:57862,45010:57863,45011:57864,45012:57865,45013:57866,45014:57867,45015:57868,45016:57869,45017:57870,45018:57871,45019:57872,45020:57873,45021:57874,45022:57875,45023:57876,45024:57877,45025:57878,45026:57879,45027:57880,45028:57881,45029:57882,45030:57883,45031:57884,45032:57885,45033:57886,45034:57887,45035:57888,45036:57889,45037:57890,45038:57891,45039:57892,45040:57893,45041:57894,45042:57895,45043:57896,45044:57897,45045:57898,45046:57899,45047:57900,45048:57901,45049:57902,45050:57903,45051:57904,45052:57905,45053:57906,45054:57907,45120:30277,45121:30278,45122:30279,45123:30280,45124:30281,45125:30282,45126:30283,45127:30286,45128:30287,45129:30288,45130:30289,45131:30290,45132:30291,45133:30293,45134:30295,45135:30296,45136:30297,45137:30298,45138:30299,45139:30301,45140:30303,45141:30304,45142:30305,45143:30306,45144:30308,45145:30309,45146:30310,45147:30311,45148:30312,45149:30313,45150:30314,45151:30316,45152:30317,45153:30318,45154:30320,45155:30321,45156:30322,45157:30323,45158:30324,45159:30325,45160:30326,45161:30327,45162:30329,45163:30330,45164:30332,45165:30335,45166:30336,45167:30337,45168:30339,45169:30341,45170:30345,45171:30346,45172:30348,45173:30349,45174:30351,45175:30352,45176:30354,45177:30356,45178:30357,45179:30359,45180:30360,45181:30362,45182:30363,45184:30364,45185:30365,45186:30366,45187:30367,45188:30368,45189:30369,45190:30370,45191:30371,45192:30373,45193:30374,45194:30375,45195:30376,45196:30377,45197:30378,45198:30379,45199:30380,45200:30381,45201:30383,45202:30384,45203:30387,45204:30389,45205:30390,45206:30391,45207:30392,45208:30393,45209:30394,45210:30395,45211:30396,45212:30397,45213:30398,45214:30400,45215:30401,45216:30403,45217:21834,45218:38463,45219:22467,45220:25384,45221:21710,45222:21769,45223:21696,45224:30353,45225:30284,45226:34108,45227:30702,45228:33406,45229:30861,45230:29233,45231:38552,45232:38797,45233:27688,45234:23433,45235:20474,45236:25353,45237:26263,45238:23736,45239:33018,45240:26696,45241:32942,45242:26114,45243:30414,45244:20985,45245:25942,45246:29100,45247:32753,45248:34948,45249:20658,45250:22885,45251:25034,45252:28595,45253:33453,45254:25420,45255:25170,45256:21485,45257:21543,45258:31494,45259:20843,45260:30116,45261:24052,45262:25300,45263:36299,45264:38774,45265:25226,45266:32793,45267:22365,45268:38712,45269:32610,45270:29240,45271:30333,45272:26575,45273:30334,45274:25670,45275:20336,45276:36133,45277:25308,45278:31255,45279:26001,45280:29677,45281:25644,45282:25203,45283:33324,45284:39041,45285:26495,45286:29256,45287:25198,45288:25292,45289:20276,45290:29923,45291:21322,45292:21150,45293:32458,45294:37030,45295:24110,45296:26758,45297:27036,45298:33152,45299:32465,45300:26834,45301:30917,45302:34444,45303:38225,45304:20621,45305:35876,45306:33502,45307:32990,45308:21253,45309:35090,45310:21093,45376:30404,45377:30407,45378:30409,45379:30411,45380:30412,45381:30419,45382:30421,45383:30425,45384:30426,45385:30428,45386:30429,45387:30430,45388:30432,45389:30433,45390:30434,45391:30435,45392:30436,45393:30438,45394:30439,45395:30440,45396:30441,45397:30442,45398:30443,45399:30444,45400:30445,45401:30448,45402:30451,45403:30453,45404:30454,45405:30455,45406:30458,45407:30459,45408:30461,45409:30463,45410:30464,45411:30466,45412:30467,45413:30469,45414:30470,45415:30474,45416:30476,45417:30478,45418:30479,45419:30480,45420:30481,45421:30482,45422:30483,45423:30484,45424:30485,45425:30486,45426:30487,45427:30488,45428:30491,45429:30492,45430:30493,45431:30494,45432:30497,45433:30499,45434:30500,45435:30501,45436:30503,45437:30506,45438:30507,45440:30508,45441:30510,45442:30512,45443:30513,45444:30514,45445:30515,45446:30516,45447:30521,45448:30523,45449:30525,45450:30526,45451:30527,45452:30530,45453:30532,45454:30533,45455:30534,45456:30536,45457:30537,45458:30538,45459:30539,45460:30540,45461:30541,45462:30542,45463:30543,45464:30546,45465:30547,45466:30548,45467:30549,45468:30550,45469:30551,45470:30552,45471:30553,45472:30556,45473:34180,45474:38649,45475:20445,45476:22561,45477:39281,45478:23453,45479:25265,45480:25253,45481:26292,45482:35961,45483:40077,45484:29190,45485:26479,45486:30865,45487:24754,45488:21329,45489:21271,45490:36744,45491:32972,45492:36125,45493:38049,45494:20493,45495:29384,45496:22791,45497:24811,45498:28953,45499:34987,45500:22868,45501:33519,45502:26412,45503:31528,45504:23849,45505:32503,45506:29997,45507:27893,45508:36454,45509:36856,45510:36924,45511:40763,45512:27604,45513:37145,45514:31508,45515:24444,45516:30887,45517:34006,45518:34109,45519:27605,45520:27609,45521:27606,45522:24065,45523:24199,45524:30201,45525:38381,45526:25949,45527:24330,45528:24517,45529:36767,45530:22721,45531:33218,45532:36991,45533:38491,45534:38829,45535:36793,45536:32534,45537:36140,45538:25153,45539:20415,45540:21464,45541:21342,45542:36776,45543:36777,45544:36779,45545:36941,45546:26631,45547:24426,45548:33176,45549:34920,45550:40150,45551:24971,45552:21035,45553:30250,45554:24428,45555:25996,45556:28626,45557:28392,45558:23486,45559:25672,45560:20853,45561:20912,45562:26564,45563:19993,45564:31177,45565:39292,45566:28851,45632:30557,45633:30558,45634:30559,45635:30560,45636:30564,45637:30567,45638:30569,45639:30570,45640:30573,45641:30574,45642:30575,45643:30576,45644:30577,45645:30578,45646:30579,45647:30580,45648:30581,45649:30582,45650:30583,45651:30584,45652:30586,45653:30587,45654:30588,45655:30593,45656:30594,45657:30595,45658:30598,45659:30599,45660:30600,45661:30601,45662:30602,45663:30603,45664:30607,45665:30608,45666:30611,45667:30612,45668:30613,45669:30614,45670:30615,45671:30616,45672:30617,45673:30618,45674:30619,45675:30620,45676:30621,45677:30622,45678:30625,45679:30627,45680:30628,45681:30630,45682:30632,45683:30635,45684:30637,45685:30638,45686:30639,45687:30641,45688:30642,45689:30644,45690:30646,45691:30647,45692:30648,45693:30649,45694:30650,45696:30652,45697:30654,45698:30656,45699:30657,45700:30658,45701:30659,45702:30660,45703:30661,45704:30662,45705:30663,45706:30664,45707:30665,45708:30666,45709:30667,45710:30668,45711:30670,45712:30671,45713:30672,45714:30673,45715:30674,45716:30675,45717:30676,45718:30677,45719:30678,45720:30680,45721:30681,45722:30682,45723:30685,45724:30686,45725:30687,45726:30688,45727:30689,45728:30692,45729:30149,45730:24182,45731:29627,45732:33760,45733:25773,45734:25320,45735:38069,45736:27874,45737:21338,45738:21187,45739:25615,45740:38082,45741:31636,45742:20271,45743:24091,45744:33334,45745:33046,45746:33162,45747:28196,45748:27850,45749:39539,45750:25429,45751:21340,45752:21754,45753:34917,45754:22496,45755:19981,45756:24067,45757:27493,45758:31807,45759:37096,45760:24598,45761:25830,45762:29468,45763:35009,45764:26448,45765:25165,45766:36130,45767:30572,45768:36393,45769:37319,45770:24425,45771:33756,45772:34081,45773:39184,45774:21442,45775:34453,45776:27531,45777:24813,45778:24808,45779:28799,45780:33485,45781:33329,45782:20179,45783:27815,45784:34255,45785:25805,45786:31961,45787:27133,45788:26361,45789:33609,45790:21397,45791:31574,45792:20391,45793:20876,45794:27979,45795:23618,45796:36461,45797:25554,45798:21449,45799:33580,45800:33590,45801:26597,45802:30900,45803:25661,45804:23519,45805:23700,45806:24046,45807:35815,45808:25286,45809:26612,45810:35962,45811:25600,45812:25530,45813:34633,45814:39307,45815:35863,45816:32544,45817:38130,45818:20135,45819:38416,45820:39076,45821:26124,45822:29462,45888:30694,45889:30696,45890:30698,45891:30703,45892:30704,45893:30705,45894:30706,45895:30708,45896:30709,45897:30711,45898:30713,45899:30714,45900:30715,45901:30716,45902:30723,45903:30724,45904:30725,45905:30726,45906:30727,45907:30728,45908:30730,45909:30731,45910:30734,45911:30735,45912:30736,45913:30739,45914:30741,45915:30745,45916:30747,45917:30750,45918:30752,45919:30753,45920:30754,45921:30756,45922:30760,45923:30762,45924:30763,45925:30766,45926:30767,45927:30769,45928:30770,45929:30771,45930:30773,45931:30774,45932:30781,45933:30783,45934:30785,45935:30786,45936:30787,45937:30788,45938:30790,45939:30792,45940:30793,45941:30794,45942:30795,45943:30797,45944:30799,45945:30801,45946:30803,45947:30804,45948:30808,45949:30809,45950:30810,45952:30811,45953:30812,45954:30814,45955:30815,45956:30816,45957:30817,45958:30818,45959:30819,45960:30820,45961:30821,45962:30822,45963:30823,45964:30824,45965:30825,45966:30831,45967:30832,45968:30833,45969:30834,45970:30835,45971:30836,45972:30837,45973:30838,45974:30840,45975:30841,45976:30842,45977:30843,45978:30845,45979:30846,45980:30847,45981:30848,45982:30849,45983:30850,45984:30851,45985:22330,45986:23581,45987:24120,45988:38271,45989:20607,45990:32928,45991:21378,45992:25950,45993:30021,45994:21809,45995:20513,45996:36229,45997:25220,45998:38046,45999:26397,46000:22066,46001:28526,46002:24034,46003:21557,46004:28818,46005:36710,46006:25199,46007:25764,46008:25507,46009:24443,46010:28552,46011:37108,46012:33251,46013:36784,46014:23576,46015:26216,46016:24561,46017:27785,46018:38472,46019:36225,46020:34924,46021:25745,46022:31216,46023:22478,46024:27225,46025:25104,46026:21576,46027:20056,46028:31243,46029:24809,46030:28548,46031:35802,46032:25215,46033:36894,46034:39563,46035:31204,46036:21507,46037:30196,46038:25345,46039:21273,46040:27744,46041:36831,46042:24347,46043:39536,46044:32827,46045:40831,46046:20360,46047:23610,46048:36196,46049:32709,46050:26021,46051:28861,46052:20805,46053:20914,46054:34411,46055:23815,46056:23456,46057:25277,46058:37228,46059:30068,46060:36364,46061:31264,46062:24833,46063:31609,46064:20167,46065:32504,46066:30597,46067:19985,46068:33261,46069:21021,46070:20986,46071:27249,46072:21416,46073:36487,46074:38148,46075:38607,46076:28353,46077:38500,46078:26970,46144:30852,46145:30853,46146:30854,46147:30856,46148:30858,46149:30859,46150:30863,46151:30864,46152:30866,46153:30868,46154:30869,46155:30870,46156:30873,46157:30877,46158:30878,46159:30880,46160:30882,46161:30884,46162:30886,46163:30888,46164:30889,46165:30890,46166:30891,46167:30892,46168:30893,46169:30894,46170:30895,46171:30901,46172:30902,46173:30903,46174:30904,46175:30906,46176:30907,46177:30908,46178:30909,46179:30911,46180:30912,46181:30914,46182:30915,46183:30916,46184:30918,46185:30919,46186:30920,46187:30924,46188:30925,46189:30926,46190:30927,46191:30929,46192:30930,46193:30931,46194:30934,46195:30935,46196:30936,46197:30938,46198:30939,46199:30940,46200:30941,46201:30942,46202:30943,46203:30944,46204:30945,46205:30946,46206:30947,46208:30948,46209:30949,46210:30950,46211:30951,46212:30953,46213:30954,46214:30955,46215:30957,46216:30958,46217:30959,46218:30960,46219:30961,46220:30963,46221:30965,46222:30966,46223:30968,46224:30969,46225:30971,46226:30972,46227:30973,46228:30974,46229:30975,46230:30976,46231:30978,46232:30979,46233:30980,46234:30982,46235:30983,46236:30984,46237:30985,46238:30986,46239:30987,46240:30988,46241:30784,46242:20648,46243:30679,46244:25616,46245:35302,46246:22788,46247:25571,46248:24029,46249:31359,46250:26941,46251:20256,46252:33337,46253:21912,46254:20018,46255:30126,46256:31383,46257:24162,46258:24202,46259:38383,46260:21019,46261:21561,46262:28810,46263:25462,46264:38180,46265:22402,46266:26149,46267:26943,46268:37255,46269:21767,46270:28147,46271:32431,46272:34850,46273:25139,46274:32496,46275:30133,46276:33576,46277:30913,46278:38604,46279:36766,46280:24904,46281:29943,46282:35789,46283:27492,46284:21050,46285:36176,46286:27425,46287:32874,46288:33905,46289:22257,46290:21254,46291:20174,46292:19995,46293:20945,46294:31895,46295:37259,46296:31751,46297:20419,46298:36479,46299:31713,46300:31388,46301:25703,46302:23828,46303:20652,46304:33030,46305:30209,46306:31929,46307:28140,46308:32736,46309:26449,46310:23384,46311:23544,46312:30923,46313:25774,46314:25619,46315:25514,46316:25387,46317:38169,46318:25645,46319:36798,46320:31572,46321:30249,46322:25171,46323:22823,46324:21574,46325:27513,46326:20643,46327:25140,46328:24102,46329:27526,46330:20195,46331:36151,46332:34955,46333:24453,46334:36910,46400:30989,46401:30990,46402:30991,46403:30992,46404:30993,46405:30994,46406:30996,46407:30997,46408:30998,46409:30999,46410:31000,46411:31001,46412:31002,46413:31003,46414:31004,46415:31005,46416:31007,46417:31008,46418:31009,46419:31010,46420:31011,46421:31013,46422:31014,46423:31015,46424:31016,46425:31017,46426:31018,46427:31019,46428:31020,46429:31021,46430:31022,46431:31023,46432:31024,46433:31025,46434:31026,46435:31027,46436:31029,46437:31030,46438:31031,46439:31032,46440:31033,46441:31037,46442:31039,46443:31042,46444:31043,46445:31044,46446:31045,46447:31047,46448:31050,46449:31051,46450:31052,46451:31053,46452:31054,46453:31055,46454:31056,46455:31057,46456:31058,46457:31060,46458:31061,46459:31064,46460:31065,46461:31073,46462:31075,46464:31076,46465:31078,46466:31081,46467:31082,46468:31083,46469:31084,46470:31086,46471:31088,46472:31089,46473:31090,46474:31091,46475:31092,46476:31093,46477:31094,46478:31097,46479:31099,46480:31100,46481:31101,46482:31102,46483:31103,46484:31106,46485:31107,46486:31110,46487:31111,46488:31112,46489:31113,46490:31115,46491:31116,46492:31117,46493:31118,46494:31120,46495:31121,46496:31122,46497:24608,46498:32829,46499:25285,46500:20025,46501:21333,46502:37112,46503:25528,46504:32966,46505:26086,46506:27694,46507:20294,46508:24814,46509:28129,46510:35806,46511:24377,46512:34507,46513:24403,46514:25377,46515:20826,46516:33633,46517:26723,46518:20992,46519:25443,46520:36424,46521:20498,46522:23707,46523:31095,46524:23548,46525:21040,46526:31291,46527:24764,46528:36947,46529:30423,46530:24503,46531:24471,46532:30340,46533:36460,46534:28783,46535:30331,46536:31561,46537:30634,46538:20979,46539:37011,46540:22564,46541:20302,46542:28404,46543:36842,46544:25932,46545:31515,46546:29380,46547:28068,46548:32735,46549:23265,46550:25269,46551:24213,46552:22320,46553:33922,46554:31532,46555:24093,46556:24351,46557:36882,46558:32532,46559:39072,46560:25474,46561:28359,46562:30872,46563:28857,46564:20856,46565:38747,46566:22443,46567:30005,46568:20291,46569:30008,46570:24215,46571:24806,46572:22880,46573:28096,46574:27583,46575:30857,46576:21500,46577:38613,46578:20939,46579:20993,46580:25481,46581:21514,46582:38035,46583:35843,46584:36300,46585:29241,46586:30879,46587:34678,46588:36845,46589:35853,46590:21472,46656:31123,46657:31124,46658:31125,46659:31126,46660:31127,46661:31128,46662:31129,46663:31131,46664:31132,46665:31133,46666:31134,46667:31135,46668:31136,46669:31137,46670:31138,46671:31139,46672:31140,46673:31141,46674:31142,46675:31144,46676:31145,46677:31146,46678:31147,46679:31148,46680:31149,46681:31150,46682:31151,46683:31152,46684:31153,46685:31154,46686:31156,46687:31157,46688:31158,46689:31159,46690:31160,46691:31164,46692:31167,46693:31170,46694:31172,46695:31173,46696:31175,46697:31176,46698:31178,46699:31180,46700:31182,46701:31183,46702:31184,46703:31187,46704:31188,46705:31190,46706:31191,46707:31193,46708:31194,46709:31195,46710:31196,46711:31197,46712:31198,46713:31200,46714:31201,46715:31202,46716:31205,46717:31208,46718:31210,46720:31212,46721:31214,46722:31217,46723:31218,46724:31219,46725:31220,46726:31221,46727:31222,46728:31223,46729:31225,46730:31226,46731:31228,46732:31230,46733:31231,46734:31233,46735:31236,46736:31237,46737:31239,46738:31240,46739:31241,46740:31242,46741:31244,46742:31247,46743:31248,46744:31249,46745:31250,46746:31251,46747:31253,46748:31254,46749:31256,46750:31257,46751:31259,46752:31260,46753:19969,46754:30447,46755:21486,46756:38025,46757:39030,46758:40718,46759:38189,46760:23450,46761:35746,46762:20002,46763:19996,46764:20908,46765:33891,46766:25026,46767:21160,46768:26635,46769:20375,46770:24683,46771:20923,46772:27934,46773:20828,46774:25238,46775:26007,46776:38497,46777:35910,46778:36887,46779:30168,46780:37117,46781:30563,46782:27602,46783:29322,46784:29420,46785:35835,46786:22581,46787:30585,46788:36172,46789:26460,46790:38208,46791:32922,46792:24230,46793:28193,46794:22930,46795:31471,46796:30701,46797:38203,46798:27573,46799:26029,46800:32526,46801:22534,46802:20817,46803:38431,46804:23545,46805:22697,46806:21544,46807:36466,46808:25958,46809:39039,46810:22244,46811:38045,46812:30462,46813:36929,46814:25479,46815:21702,46816:22810,46817:22842,46818:22427,46819:36530,46820:26421,46821:36346,46822:33333,46823:21057,46824:24816,46825:22549,46826:34558,46827:23784,46828:40517,46829:20420,46830:39069,46831:35769,46832:23077,46833:24694,46834:21380,46835:25212,46836:36943,46837:37122,46838:39295,46839:24681,46840:32780,46841:20799,46842:32819,46843:23572,46844:39285,46845:27953,46846:20108,46912:31261,46913:31263,46914:31265,46915:31266,46916:31268,46917:31269,46918:31270,46919:31271,46920:31272,46921:31273,46922:31274,46923:31275,46924:31276,46925:31277,46926:31278,46927:31279,46928:31280,46929:31281,46930:31282,46931:31284,46932:31285,46933:31286,46934:31288,46935:31290,46936:31294,46937:31296,46938:31297,46939:31298,46940:31299,46941:31300,46942:31301,46943:31303,46944:31304,46945:31305,46946:31306,46947:31307,46948:31308,46949:31309,46950:31310,46951:31311,46952:31312,46953:31314,46954:31315,46955:31316,46956:31317,46957:31318,46958:31320,46959:31321,46960:31322,46961:31323,46962:31324,46963:31325,46964:31326,46965:31327,46966:31328,46967:31329,46968:31330,46969:31331,46970:31332,46971:31333,46972:31334,46973:31335,46974:31336,46976:31337,46977:31338,46978:31339,46979:31340,46980:31341,46981:31342,46982:31343,46983:31345,46984:31346,46985:31347,46986:31349,46987:31355,46988:31356,46989:31357,46990:31358,46991:31362,46992:31365,46993:31367,46994:31369,46995:31370,46996:31371,46997:31372,46998:31374,46999:31375,47000:31376,47001:31379,47002:31380,47003:31385,47004:31386,47005:31387,47006:31390,47007:31393,47008:31394,47009:36144,47010:21457,47011:32602,47012:31567,47013:20240,47014:20047,47015:38400,47016:27861,47017:29648,47018:34281,47019:24070,47020:30058,47021:32763,47022:27146,47023:30718,47024:38034,47025:32321,47026:20961,47027:28902,47028:21453,47029:36820,47030:33539,47031:36137,47032:29359,47033:39277,47034:27867,47035:22346,47036:33459,47037:26041,47038:32938,47039:25151,47040:38450,47041:22952,47042:20223,47043:35775,47044:32442,47045:25918,47046:33778,47047:38750,47048:21857,47049:39134,47050:32933,47051:21290,47052:35837,47053:21536,47054:32954,47055:24223,47056:27832,47057:36153,47058:33452,47059:37210,47060:21545,47061:27675,47062:20998,47063:32439,47064:22367,47065:28954,47066:27774,47067:31881,47068:22859,47069:20221,47070:24575,47071:24868,47072:31914,47073:20016,47074:23553,47075:26539,47076:34562,47077:23792,47078:38155,47079:39118,47080:30127,47081:28925,47082:36898,47083:20911,47084:32541,47085:35773,47086:22857,47087:20964,47088:20315,47089:21542,47090:22827,47091:25975,47092:32932,47093:23413,47094:25206,47095:25282,47096:36752,47097:24133,47098:27679,47099:31526,47100:20239,47101:20440,47102:26381,47168:31395,47169:31396,47170:31399,47171:31401,47172:31402,47173:31403,47174:31406,47175:31407,47176:31408,47177:31409,47178:31410,47179:31412,47180:31413,47181:31414,47182:31415,47183:31416,47184:31417,47185:31418,47186:31419,47187:31420,47188:31421,47189:31422,47190:31424,47191:31425,47192:31426,47193:31427,47194:31428,47195:31429,47196:31430,47197:31431,47198:31432,47199:31433,47200:31434,47201:31436,47202:31437,47203:31438,47204:31439,47205:31440,47206:31441,47207:31442,47208:31443,47209:31444,47210:31445,47211:31447,47212:31448,47213:31450,47214:31451,47215:31452,47216:31453,47217:31457,47218:31458,47219:31460,47220:31463,47221:31464,47222:31465,47223:31466,47224:31467,47225:31468,47226:31470,47227:31472,47228:31473,47229:31474,47230:31475,47232:31476,47233:31477,47234:31478,47235:31479,47236:31480,47237:31483,47238:31484,47239:31486,47240:31488,47241:31489,47242:31490,47243:31493,47244:31495,47245:31497,47246:31500,47247:31501,47248:31502,47249:31504,47250:31506,47251:31507,47252:31510,47253:31511,47254:31512,47255:31514,47256:31516,47257:31517,47258:31519,47259:31521,47260:31522,47261:31523,47262:31527,47263:31529,47264:31533,47265:28014,47266:28074,47267:31119,47268:34993,47269:24343,47270:29995,47271:25242,47272:36741,47273:20463,47274:37340,47275:26023,47276:33071,47277:33105,47278:24220,47279:33104,47280:36212,47281:21103,47282:35206,47283:36171,47284:22797,47285:20613,47286:20184,47287:38428,47288:29238,47289:33145,47290:36127,47291:23500,47292:35747,47293:38468,47294:22919,47295:32538,47296:21648,47297:22134,47298:22030,47299:35813,47300:25913,47301:27010,47302:38041,47303:30422,47304:28297,47305:24178,47306:29976,47307:26438,47308:26577,47309:31487,47310:32925,47311:36214,47312:24863,47313:31174,47314:25954,47315:36195,47316:20872,47317:21018,47318:38050,47319:32568,47320:32923,47321:32434,47322:23703,47323:28207,47324:26464,47325:31705,47326:30347,47327:39640,47328:33167,47329:32660,47330:31957,47331:25630,47332:38224,47333:31295,47334:21578,47335:21733,47336:27468,47337:25601,47338:25096,47339:40509,47340:33011,47341:30105,47342:21106,47343:38761,47344:33883,47345:26684,47346:34532,47347:38401,47348:38548,47349:38124,47350:20010,47351:21508,47352:32473,47353:26681,47354:36319,47355:32789,47356:26356,47357:24218,47358:32697,47424:31535,47425:31536,47426:31538,47427:31540,47428:31541,47429:31542,47430:31543,47431:31545,47432:31547,47433:31549,47434:31551,47435:31552,47436:31553,47437:31554,47438:31555,47439:31556,47440:31558,47441:31560,47442:31562,47443:31565,47444:31566,47445:31571,47446:31573,47447:31575,47448:31577,47449:31580,47450:31582,47451:31583,47452:31585,47453:31587,47454:31588,47455:31589,47456:31590,47457:31591,47458:31592,47459:31593,47460:31594,47461:31595,47462:31596,47463:31597,47464:31599,47465:31600,47466:31603,47467:31604,47468:31606,47469:31608,47470:31610,47471:31612,47472:31613,47473:31615,47474:31617,47475:31618,47476:31619,47477:31620,47478:31622,47479:31623,47480:31624,47481:31625,47482:31626,47483:31627,47484:31628,47485:31630,47486:31631,47488:31633,47489:31634,47490:31635,47491:31638,47492:31640,47493:31641,47494:31642,47495:31643,47496:31646,47497:31647,47498:31648,47499:31651,47500:31652,47501:31653,47502:31662,47503:31663,47504:31664,47505:31666,47506:31667,47507:31669,47508:31670,47509:31671,47510:31673,47511:31674,47512:31675,47513:31676,47514:31677,47515:31678,47516:31679,47517:31680,47518:31682,47519:31683,47520:31684,47521:22466,47522:32831,47523:26775,47524:24037,47525:25915,47526:21151,47527:24685,47528:40858,47529:20379,47530:36524,47531:20844,47532:23467,47533:24339,47534:24041,47535:27742,47536:25329,47537:36129,47538:20849,47539:38057,47540:21246,47541:27807,47542:33503,47543:29399,47544:22434,47545:26500,47546:36141,47547:22815,47548:36764,47549:33735,47550:21653,47551:31629,47552:20272,47553:27837,47554:23396,47555:22993,47556:40723,47557:21476,47558:34506,47559:39592,47560:35895,47561:32929,47562:25925,47563:39038,47564:22266,47565:38599,47566:21038,47567:29916,47568:21072,47569:23521,47570:25346,47571:35074,47572:20054,47573:25296,47574:24618,47575:26874,47576:20851,47577:23448,47578:20896,47579:35266,47580:31649,47581:39302,47582:32592,47583:24815,47584:28748,47585:36143,47586:20809,47587:24191,47588:36891,47589:29808,47590:35268,47591:22317,47592:30789,47593:24402,47594:40863,47595:38394,47596:36712,47597:39740,47598:35809,47599:30328,47600:26690,47601:26588,47602:36330,47603:36149,47604:21053,47605:36746,47606:28378,47607:26829,47608:38149,47609:37101,47610:22269,47611:26524,47612:35065,47613:36807,47614:21704,47680:31685,47681:31688,47682:31689,47683:31690,47684:31691,47685:31693,47686:31694,47687:31695,47688:31696,47689:31698,47690:31700,47691:31701,47692:31702,47693:31703,47694:31704,47695:31707,47696:31708,47697:31710,47698:31711,47699:31712,47700:31714,47701:31715,47702:31716,47703:31719,47704:31720,47705:31721,47706:31723,47707:31724,47708:31725,47709:31727,47710:31728,47711:31730,47712:31731,47713:31732,47714:31733,47715:31734,47716:31736,47717:31737,47718:31738,47719:31739,47720:31741,47721:31743,47722:31744,47723:31745,47724:31746,47725:31747,47726:31748,47727:31749,47728:31750,47729:31752,47730:31753,47731:31754,47732:31757,47733:31758,47734:31760,47735:31761,47736:31762,47737:31763,47738:31764,47739:31765,47740:31767,47741:31768,47742:31769,47744:31770,47745:31771,47746:31772,47747:31773,47748:31774,47749:31776,47750:31777,47751:31778,47752:31779,47753:31780,47754:31781,47755:31784,47756:31785,47757:31787,47758:31788,47759:31789,47760:31790,47761:31791,47762:31792,47763:31793,47764:31794,47765:31795,47766:31796,47767:31797,47768:31798,47769:31799,47770:31801,47771:31802,47772:31803,47773:31804,47774:31805,47775:31806,47776:31810,47777:39608,47778:23401,47779:28023,47780:27686,47781:20133,47782:23475,47783:39559,47784:37219,47785:25000,47786:37039,47787:38889,47788:21547,47789:28085,47790:23506,47791:20989,47792:21898,47793:32597,47794:32752,47795:25788,47796:25421,47797:26097,47798:25022,47799:24717,47800:28938,47801:27735,47802:27721,47803:22831,47804:26477,47805:33322,47806:22741,47807:22158,47808:35946,47809:27627,47810:37085,47811:22909,47812:32791,47813:21495,47814:28009,47815:21621,47816:21917,47817:33655,47818:33743,47819:26680,47820:31166,47821:21644,47822:20309,47823:21512,47824:30418,47825:35977,47826:38402,47827:27827,47828:28088,47829:36203,47830:35088,47831:40548,47832:36154,47833:22079,47834:40657,47835:30165,47836:24456,47837:29408,47838:24680,47839:21756,47840:20136,47841:27178,47842:34913,47843:24658,47844:36720,47845:21700,47846:28888,47847:34425,47848:40511,47849:27946,47850:23439,47851:24344,47852:32418,47853:21897,47854:20399,47855:29492,47856:21564,47857:21402,47858:20505,47859:21518,47860:21628,47861:20046,47862:24573,47863:29786,47864:22774,47865:33899,47866:32993,47867:34676,47868:29392,47869:31946,47870:28246,47936:31811,47937:31812,47938:31813,47939:31814,47940:31815,47941:31816,47942:31817,47943:31818,47944:31819,47945:31820,47946:31822,47947:31823,47948:31824,47949:31825,47950:31826,47951:31827,47952:31828,47953:31829,47954:31830,47955:31831,47956:31832,47957:31833,47958:31834,47959:31835,47960:31836,47961:31837,47962:31838,47963:31839,47964:31840,47965:31841,47966:31842,47967:31843,47968:31844,47969:31845,47970:31846,47971:31847,47972:31848,47973:31849,47974:31850,47975:31851,47976:31852,47977:31853,47978:31854,47979:31855,47980:31856,47981:31857,47982:31858,47983:31861,47984:31862,47985:31863,47986:31864,47987:31865,47988:31866,47989:31870,47990:31871,47991:31872,47992:31873,47993:31874,47994:31875,47995:31876,47996:31877,47997:31878,47998:31879,48000:31880,48001:31882,48002:31883,48003:31884,48004:31885,48005:31886,48006:31887,48007:31888,48008:31891,48009:31892,48010:31894,48011:31897,48012:31898,48013:31899,48014:31904,48015:31905,48016:31907,48017:31910,48018:31911,48019:31912,48020:31913,48021:31915,48022:31916,48023:31917,48024:31919,48025:31920,48026:31924,48027:31925,48028:31926,48029:31927,48030:31928,48031:31930,48032:31931,48033:24359,48034:34382,48035:21804,48036:25252,48037:20114,48038:27818,48039:25143,48040:33457,48041:21719,48042:21326,48043:29502,48044:28369,48045:30011,48046:21010,48047:21270,48048:35805,48049:27088,48050:24458,48051:24576,48052:28142,48053:22351,48054:27426,48055:29615,48056:26707,48057:36824,48058:32531,48059:25442,48060:24739,48061:21796,48062:30186,48063:35938,48064:28949,48065:28067,48066:23462,48067:24187,48068:33618,48069:24908,48070:40644,48071:30970,48072:34647,48073:31783,48074:30343,48075:20976,48076:24822,48077:29004,48078:26179,48079:24140,48080:24653,48081:35854,48082:28784,48083:25381,48084:36745,48085:24509,48086:24674,48087:34516,48088:22238,48089:27585,48090:24724,48091:24935,48092:21321,48093:24800,48094:26214,48095:36159,48096:31229,48097:20250,48098:28905,48099:27719,48100:35763,48101:35826,48102:32472,48103:33636,48104:26127,48105:23130,48106:39746,48107:27985,48108:28151,48109:35905,48110:27963,48111:20249,48112:28779,48113:33719,48114:25110,48115:24785,48116:38669,48117:36135,48118:31096,48119:20987,48120:22334,48121:22522,48122:26426,48123:30072,48124:31293,48125:31215,48126:31637,48192:31935,48193:31936,48194:31938,48195:31939,48196:31940,48197:31942,48198:31945,48199:31947,48200:31950,48201:31951,48202:31952,48203:31953,48204:31954,48205:31955,48206:31956,48207:31960,48208:31962,48209:31963,48210:31965,48211:31966,48212:31969,48213:31970,48214:31971,48215:31972,48216:31973,48217:31974,48218:31975,48219:31977,48220:31978,48221:31979,48222:31980,48223:31981,48224:31982,48225:31984,48226:31985,48227:31986,48228:31987,48229:31988,48230:31989,48231:31990,48232:31991,48233:31993,48234:31994,48235:31996,48236:31997,48237:31998,48238:31999,48239:32000,48240:32001,48241:32002,48242:32003,48243:32004,48244:32005,48245:32006,48246:32007,48247:32008,48248:32009,48249:32011,48250:32012,48251:32013,48252:32014,48253:32015,48254:32016,48256:32017,48257:32018,48258:32019,48259:32020,48260:32021,48261:32022,48262:32023,48263:32024,48264:32025,48265:32026,48266:32027,48267:32028,48268:32029,48269:32030,48270:32031,48271:32033,48272:32035,48273:32036,48274:32037,48275:32038,48276:32040,48277:32041,48278:32042,48279:32044,48280:32045,48281:32046,48282:32048,48283:32049,48284:32050,48285:32051,48286:32052,48287:32053,48288:32054,48289:32908,48290:39269,48291:36857,48292:28608,48293:35749,48294:40481,48295:23020,48296:32489,48297:32521,48298:21513,48299:26497,48300:26840,48301:36753,48302:31821,48303:38598,48304:21450,48305:24613,48306:30142,48307:27762,48308:21363,48309:23241,48310:32423,48311:25380,48312:20960,48313:33034,48314:24049,48315:34015,48316:25216,48317:20864,48318:23395,48319:20238,48320:31085,48321:21058,48322:24760,48323:27982,48324:23492,48325:23490,48326:35745,48327:35760,48328:26082,48329:24524,48330:38469,48331:22931,48332:32487,48333:32426,48334:22025,48335:26551,48336:22841,48337:20339,48338:23478,48339:21152,48340:33626,48341:39050,48342:36158,48343:30002,48344:38078,48345:20551,48346:31292,48347:20215,48348:26550,48349:39550,48350:23233,48351:27516,48352:30417,48353:22362,48354:23574,48355:31546,48356:38388,48357:29006,48358:20860,48359:32937,48360:33392,48361:22904,48362:32516,48363:33575,48364:26816,48365:26604,48366:30897,48367:30839,48368:25315,48369:25441,48370:31616,48371:20461,48372:21098,48373:20943,48374:33616,48375:27099,48376:37492,48377:36341,48378:36145,48379:35265,48380:38190,48381:31661,48382:20214,48448:32055,48449:32056,48450:32057,48451:32058,48452:32059,48453:32060,48454:32061,48455:32062,48456:32063,48457:32064,48458:32065,48459:32066,48460:32067,48461:32068,48462:32069,48463:32070,48464:32071,48465:32072,48466:32073,48467:32074,48468:32075,48469:32076,48470:32077,48471:32078,48472:32079,48473:32080,48474:32081,48475:32082,48476:32083,48477:32084,48478:32085,48479:32086,48480:32087,48481:32088,48482:32089,48483:32090,48484:32091,48485:32092,48486:32093,48487:32094,48488:32095,48489:32096,48490:32097,48491:32098,48492:32099,48493:32100,48494:32101,48495:32102,48496:32103,48497:32104,48498:32105,48499:32106,48500:32107,48501:32108,48502:32109,48503:32111,48504:32112,48505:32113,48506:32114,48507:32115,48508:32116,48509:32117,48510:32118,48512:32120,48513:32121,48514:32122,48515:32123,48516:32124,48517:32125,48518:32126,48519:32127,48520:32128,48521:32129,48522:32130,48523:32131,48524:32132,48525:32133,48526:32134,48527:32135,48528:32136,48529:32137,48530:32138,48531:32139,48532:32140,48533:32141,48534:32142,48535:32143,48536:32144,48537:32145,48538:32146,48539:32147,48540:32148,48541:32149,48542:32150,48543:32151,48544:32152,48545:20581,48546:33328,48547:21073,48548:39279,48549:28176,48550:28293,48551:28071,48552:24314,48553:20725,48554:23004,48555:23558,48556:27974,48557:27743,48558:30086,48559:33931,48560:26728,48561:22870,48562:35762,48563:21280,48564:37233,48565:38477,48566:34121,48567:26898,48568:30977,48569:28966,48570:33014,48571:20132,48572:37066,48573:27975,48574:39556,48575:23047,48576:22204,48577:25605,48578:38128,48579:30699,48580:20389,48581:33050,48582:29409,48583:35282,48584:39290,48585:32564,48586:32478,48587:21119,48588:25945,48589:37237,48590:36735,48591:36739,48592:21483,48593:31382,48594:25581,48595:25509,48596:30342,48597:31224,48598:34903,48599:38454,48600:25130,48601:21163,48602:33410,48603:26708,48604:26480,48605:25463,48606:30571,48607:31469,48608:27905,48609:32467,48610:35299,48611:22992,48612:25106,48613:34249,48614:33445,48615:30028,48616:20511,48617:20171,48618:30117,48619:35819,48620:23626,48621:24062,48622:31563,48623:26020,48624:37329,48625:20170,48626:27941,48627:35167,48628:32039,48629:38182,48630:20165,48631:35880,48632:36827,48633:38771,48634:26187,48635:31105,48636:36817,48637:28908,48638:28024,48704:32153,48705:32154,48706:32155,48707:32156,48708:32157,48709:32158,48710:32159,48711:32160,48712:32161,48713:32162,48714:32163,48715:32164,48716:32165,48717:32167,48718:32168,48719:32169,48720:32170,48721:32171,48722:32172,48723:32173,48724:32175,48725:32176,48726:32177,48727:32178,48728:32179,48729:32180,48730:32181,48731:32182,48732:32183,48733:32184,48734:32185,48735:32186,48736:32187,48737:32188,48738:32189,48739:32190,48740:32191,48741:32192,48742:32193,48743:32194,48744:32195,48745:32196,48746:32197,48747:32198,48748:32199,48749:32200,48750:32201,48751:32202,48752:32203,48753:32204,48754:32205,48755:32206,48756:32207,48757:32208,48758:32209,48759:32210,48760:32211,48761:32212,48762:32213,48763:32214,48764:32215,48765:32216,48766:32217,48768:32218,48769:32219,48770:32220,48771:32221,48772:32222,48773:32223,48774:32224,48775:32225,48776:32226,48777:32227,48778:32228,48779:32229,48780:32230,48781:32231,48782:32232,48783:32233,48784:32234,48785:32235,48786:32236,48787:32237,48788:32238,48789:32239,48790:32240,48791:32241,48792:32242,48793:32243,48794:32244,48795:32245,48796:32246,48797:32247,48798:32248,48799:32249,48800:32250,48801:23613,48802:21170,48803:33606,48804:20834,48805:33550,48806:30555,48807:26230,48808:40120,48809:20140,48810:24778,48811:31934,48812:31923,48813:32463,48814:20117,48815:35686,48816:26223,48817:39048,48818:38745,48819:22659,48820:25964,48821:38236,48822:24452,48823:30153,48824:38742,48825:31455,48826:31454,48827:20928,48828:28847,48829:31384,48830:25578,48831:31350,48832:32416,48833:29590,48834:38893,48835:20037,48836:28792,48837:20061,48838:37202,48839:21417,48840:25937,48841:26087,48842:33276,48843:33285,48844:21646,48845:23601,48846:30106,48847:38816,48848:25304,48849:29401,48850:30141,48851:23621,48852:39545,48853:33738,48854:23616,48855:21632,48856:30697,48857:20030,48858:27822,48859:32858,48860:25298,48861:25454,48862:24040,48863:20855,48864:36317,48865:36382,48866:38191,48867:20465,48868:21477,48869:24807,48870:28844,48871:21095,48872:25424,48873:40515,48874:23071,48875:20518,48876:30519,48877:21367,48878:32482,48879:25733,48880:25899,48881:25225,48882:25496,48883:20500,48884:29237,48885:35273,48886:20915,48887:35776,48888:32477,48889:22343,48890:33740,48891:38055,48892:20891,48893:21531,48894:23803,48960:32251,48961:32252,48962:32253,48963:32254,48964:32255,48965:32256,48966:32257,48967:32258,48968:32259,48969:32260,48970:32261,48971:32262,48972:32263,48973:32264,48974:32265,48975:32266,48976:32267,48977:32268,48978:32269,48979:32270,48980:32271,48981:32272,48982:32273,48983:32274,48984:32275,48985:32276,48986:32277,48987:32278,48988:32279,48989:32280,48990:32281,48991:32282,48992:32283,48993:32284,48994:32285,48995:32286,48996:32287,48997:32288,48998:32289,48999:32290,49000:32291,49001:32292,49002:32293,49003:32294,49004:32295,49005:32296,49006:32297,49007:32298,49008:32299,49009:32300,49010:32301,49011:32302,49012:32303,49013:32304,49014:32305,49015:32306,49016:32307,49017:32308,49018:32309,49019:32310,49020:32311,49021:32312,49022:32313,49024:32314,49025:32316,49026:32317,49027:32318,49028:32319,49029:32320,49030:32322,49031:32323,49032:32324,49033:32325,49034:32326,49035:32328,49036:32329,49037:32330,49038:32331,49039:32332,49040:32333,49041:32334,49042:32335,49043:32336,49044:32337,49045:32338,49046:32339,49047:32340,49048:32341,49049:32342,49050:32343,49051:32344,49052:32345,49053:32346,49054:32347,49055:32348,49056:32349,49057:20426,49058:31459,49059:27994,49060:37089,49061:39567,49062:21888,49063:21654,49064:21345,49065:21679,49066:24320,49067:25577,49068:26999,49069:20975,49070:24936,49071:21002,49072:22570,49073:21208,49074:22350,49075:30733,49076:30475,49077:24247,49078:24951,49079:31968,49080:25179,49081:25239,49082:20130,49083:28821,49084:32771,49085:25335,49086:28900,49087:38752,49088:22391,49089:33499,49090:26607,49091:26869,49092:30933,49093:39063,49094:31185,49095:22771,49096:21683,49097:21487,49098:28212,49099:20811,49100:21051,49101:23458,49102:35838,49103:32943,49104:21827,49105:22438,49106:24691,49107:22353,49108:21549,49109:31354,49110:24656,49111:23380,49112:25511,49113:25248,49114:21475,49115:25187,49116:23495,49117:26543,49118:21741,49119:31391,49120:33510,49121:37239,49122:24211,49123:35044,49124:22840,49125:22446,49126:25358,49127:36328,49128:33007,49129:22359,49130:31607,49131:20393,49132:24555,49133:23485,49134:27454,49135:21281,49136:31568,49137:29378,49138:26694,49139:30719,49140:30518,49141:26103,49142:20917,49143:20111,49144:30420,49145:23743,49146:31397,49147:33909,49148:22862,49149:39745,49150:20608,49216:32350,49217:32351,49218:32352,49219:32353,49220:32354,49221:32355,49222:32356,49223:32357,49224:32358,49225:32359,49226:32360,49227:32361,49228:32362,49229:32363,49230:32364,49231:32365,49232:32366,49233:32367,49234:32368,49235:32369,49236:32370,49237:32371,49238:32372,49239:32373,49240:32374,49241:32375,49242:32376,49243:32377,49244:32378,49245:32379,49246:32380,49247:32381,49248:32382,49249:32383,49250:32384,49251:32385,49252:32387,49253:32388,49254:32389,49255:32390,49256:32391,49257:32392,49258:32393,49259:32394,49260:32395,49261:32396,49262:32397,49263:32398,49264:32399,49265:32400,49266:32401,49267:32402,49268:32403,49269:32404,49270:32405,49271:32406,49272:32407,49273:32408,49274:32409,49275:32410,49276:32412,49277:32413,49278:32414,49280:32430,49281:32436,49282:32443,49283:32444,49284:32470,49285:32484,49286:32492,49287:32505,49288:32522,49289:32528,49290:32542,49291:32567,49292:32569,49293:32571,49294:32572,49295:32573,49296:32574,49297:32575,49298:32576,49299:32577,49300:32579,49301:32582,49302:32583,49303:32584,49304:32585,49305:32586,49306:32587,49307:32588,49308:32589,49309:32590,49310:32591,49311:32594,49312:32595,49313:39304,49314:24871,49315:28291,49316:22372,49317:26118,49318:25414,49319:22256,49320:25324,49321:25193,49322:24275,49323:38420,49324:22403,49325:25289,49326:21895,49327:34593,49328:33098,49329:36771,49330:21862,49331:33713,49332:26469,49333:36182,49334:34013,49335:23146,49336:26639,49337:25318,49338:31726,49339:38417,49340:20848,49341:28572,49342:35888,49343:25597,49344:35272,49345:25042,49346:32518,49347:28866,49348:28389,49349:29701,49350:27028,49351:29436,49352:24266,49353:37070,49354:26391,49355:28010,49356:25438,49357:21171,49358:29282,49359:32769,49360:20332,49361:23013,49362:37226,49363:28889,49364:28061,49365:21202,49366:20048,49367:38647,49368:38253,49369:34174,49370:30922,49371:32047,49372:20769,49373:22418,49374:25794,49375:32907,49376:31867,49377:27882,49378:26865,49379:26974,49380:20919,49381:21400,49382:26792,49383:29313,49384:40654,49385:31729,49386:29432,49387:31163,49388:28435,49389:29702,49390:26446,49391:37324,49392:40100,49393:31036,49394:33673,49395:33620,49396:21519,49397:26647,49398:20029,49399:21385,49400:21169,49401:30782,49402:21382,49403:21033,49404:20616,49405:20363,49406:20432,49472:32598,49473:32601,49474:32603,49475:32604,49476:32605,49477:32606,49478:32608,49479:32611,49480:32612,49481:32613,49482:32614,49483:32615,49484:32619,49485:32620,49486:32621,49487:32623,49488:32624,49489:32627,49490:32629,49491:32630,49492:32631,49493:32632,49494:32634,49495:32635,49496:32636,49497:32637,49498:32639,49499:32640,49500:32642,49501:32643,49502:32644,49503:32645,49504:32646,49505:32647,49506:32648,49507:32649,49508:32651,49509:32653,49510:32655,49511:32656,49512:32657,49513:32658,49514:32659,49515:32661,49516:32662,49517:32663,49518:32664,49519:32665,49520:32667,49521:32668,49522:32672,49523:32674,49524:32675,49525:32677,49526:32678,49527:32680,49528:32681,49529:32682,49530:32683,49531:32684,49532:32685,49533:32686,49534:32689,49536:32691,49537:32692,49538:32693,49539:32694,49540:32695,49541:32698,49542:32699,49543:32702,49544:32704,49545:32706,49546:32707,49547:32708,49548:32710,49549:32711,49550:32712,49551:32713,49552:32715,49553:32717,49554:32719,49555:32720,49556:32721,49557:32722,49558:32723,49559:32726,49560:32727,49561:32729,49562:32730,49563:32731,49564:32732,49565:32733,49566:32734,49567:32738,49568:32739,49569:30178,49570:31435,49571:31890,49572:27813,49573:38582,49574:21147,49575:29827,49576:21737,49577:20457,49578:32852,49579:33714,49580:36830,49581:38256,49582:24265,49583:24604,49584:28063,49585:24088,49586:25947,49587:33080,49588:38142,49589:24651,49590:28860,49591:32451,49592:31918,49593:20937,49594:26753,49595:31921,49596:33391,49597:20004,49598:36742,49599:37327,49600:26238,49601:20142,49602:35845,49603:25769,49604:32842,49605:20698,49606:30103,49607:29134,49608:23525,49609:36797,49610:28518,49611:20102,49612:25730,49613:38243,49614:24278,49615:26009,49616:21015,49617:35010,49618:28872,49619:21155,49620:29454,49621:29747,49622:26519,49623:30967,49624:38678,49625:20020,49626:37051,49627:40158,49628:28107,49629:20955,49630:36161,49631:21533,49632:25294,49633:29618,49634:33777,49635:38646,49636:40836,49637:38083,49638:20278,49639:32666,49640:20940,49641:28789,49642:38517,49643:23725,49644:39046,49645:21478,49646:20196,49647:28316,49648:29705,49649:27060,49650:30827,49651:39311,49652:30041,49653:21016,49654:30244,49655:27969,49656:26611,49657:20845,49658:40857,49659:32843,49660:21657,49661:31548,49662:31423,49728:32740,49729:32743,49730:32744,49731:32746,49732:32747,49733:32748,49734:32749,49735:32751,49736:32754,49737:32756,49738:32757,49739:32758,49740:32759,49741:32760,49742:32761,49743:32762,49744:32765,49745:32766,49746:32767,49747:32770,49748:32775,49749:32776,49750:32777,49751:32778,49752:32782,49753:32783,49754:32785,49755:32787,49756:32794,49757:32795,49758:32797,49759:32798,49760:32799,49761:32801,49762:32803,49763:32804,49764:32811,49765:32812,49766:32813,49767:32814,49768:32815,49769:32816,49770:32818,49771:32820,49772:32825,49773:32826,49774:32828,49775:32830,49776:32832,49777:32833,49778:32836,49779:32837,49780:32839,49781:32840,49782:32841,49783:32846,49784:32847,49785:32848,49786:32849,49787:32851,49788:32853,49789:32854,49790:32855,49792:32857,49793:32859,49794:32860,49795:32861,49796:32862,49797:32863,49798:32864,49799:32865,49800:32866,49801:32867,49802:32868,49803:32869,49804:32870,49805:32871,49806:32872,49807:32875,49808:32876,49809:32877,49810:32878,49811:32879,49812:32880,49813:32882,49814:32883,49815:32884,49816:32885,49817:32886,49818:32887,49819:32888,49820:32889,49821:32890,49822:32891,49823:32892,49824:32893,49825:38534,49826:22404,49827:25314,49828:38471,49829:27004,49830:23044,49831:25602,49832:31699,49833:28431,49834:38475,49835:33446,49836:21346,49837:39045,49838:24208,49839:28809,49840:25523,49841:21348,49842:34383,49843:40065,49844:40595,49845:30860,49846:38706,49847:36335,49848:36162,49849:40575,49850:28510,49851:31108,49852:24405,49853:38470,49854:25134,49855:39540,49856:21525,49857:38109,49858:20387,49859:26053,49860:23653,49861:23649,49862:32533,49863:34385,49864:27695,49865:24459,49866:29575,49867:28388,49868:32511,49869:23782,49870:25371,49871:23402,49872:28390,49873:21365,49874:20081,49875:25504,49876:30053,49877:25249,49878:36718,49879:20262,49880:20177,49881:27814,49882:32438,49883:35770,49884:33821,49885:34746,49886:32599,49887:36923,49888:38179,49889:31657,49890:39585,49891:35064,49892:33853,49893:27931,49894:39558,49895:32476,49896:22920,49897:40635,49898:29595,49899:30721,49900:34434,49901:39532,49902:39554,49903:22043,49904:21527,49905:22475,49906:20080,49907:40614,49908:21334,49909:36808,49910:33033,49911:30610,49912:39314,49913:34542,49914:28385,49915:34067,49916:26364,49917:24930,49918:28459,49984:32894,49985:32897,49986:32898,49987:32901,49988:32904,49989:32906,49990:32909,49991:32910,49992:32911,49993:32912,49994:32913,49995:32914,49996:32916,49997:32917,49998:32919,49999:32921,50000:32926,50001:32931,50002:32934,50003:32935,50004:32936,50005:32940,50006:32944,50007:32947,50008:32949,50009:32950,50010:32952,50011:32953,50012:32955,50013:32965,50014:32967,50015:32968,50016:32969,50017:32970,50018:32971,50019:32975,50020:32976,50021:32977,50022:32978,50023:32979,50024:32980,50025:32981,50026:32984,50027:32991,50028:32992,50029:32994,50030:32995,50031:32998,50032:33006,50033:33013,50034:33015,50035:33017,50036:33019,50037:33022,50038:33023,50039:33024,50040:33025,50041:33027,50042:33028,50043:33029,50044:33031,50045:33032,50046:33035,50048:33036,50049:33045,50050:33047,50051:33049,50052:33051,50053:33052,50054:33053,50055:33055,50056:33056,50057:33057,50058:33058,50059:33059,50060:33060,50061:33061,50062:33062,50063:33063,50064:33064,50065:33065,50066:33066,50067:33067,50068:33069,50069:33070,50070:33072,50071:33075,50072:33076,50073:33077,50074:33079,50075:33081,50076:33082,50077:33083,50078:33084,50079:33085,50080:33087,50081:35881,50082:33426,50083:33579,50084:30450,50085:27667,50086:24537,50087:33725,50088:29483,50089:33541,50090:38170,50091:27611,50092:30683,50093:38086,50094:21359,50095:33538,50096:20882,50097:24125,50098:35980,50099:36152,50100:20040,50101:29611,50102:26522,50103:26757,50104:37238,50105:38665,50106:29028,50107:27809,50108:30473,50109:23186,50110:38209,50111:27599,50112:32654,50113:26151,50114:23504,50115:22969,50116:23194,50117:38376,50118:38391,50119:20204,50120:33804,50121:33945,50122:27308,50123:30431,50124:38192,50125:29467,50126:26790,50127:23391,50128:30511,50129:37274,50130:38753,50131:31964,50132:36855,50133:35868,50134:24357,50135:31859,50136:31192,50137:35269,50138:27852,50139:34588,50140:23494,50141:24130,50142:26825,50143:30496,50144:32501,50145:20885,50146:20813,50147:21193,50148:23081,50149:32517,50150:38754,50151:33495,50152:25551,50153:30596,50154:34256,50155:31186,50156:28218,50157:24217,50158:22937,50159:34065,50160:28781,50161:27665,50162:25279,50163:30399,50164:25935,50165:24751,50166:38397,50167:26126,50168:34719,50169:40483,50170:38125,50171:21517,50172:21629,50173:35884,50174:25720,50240:33088,50241:33089,50242:33090,50243:33091,50244:33092,50245:33093,50246:33095,50247:33097,50248:33101,50249:33102,50250:33103,50251:33106,50252:33110,50253:33111,50254:33112,50255:33115,50256:33116,50257:33117,50258:33118,50259:33119,50260:33121,50261:33122,50262:33123,50263:33124,50264:33126,50265:33128,50266:33130,50267:33131,50268:33132,50269:33135,50270:33138,50271:33139,50272:33141,50273:33142,50274:33143,50275:33144,50276:33153,50277:33155,50278:33156,50279:33157,50280:33158,50281:33159,50282:33161,50283:33163,50284:33164,50285:33165,50286:33166,50287:33168,50288:33170,50289:33171,50290:33172,50291:33173,50292:33174,50293:33175,50294:33177,50295:33178,50296:33182,50297:33183,50298:33184,50299:33185,50300:33186,50301:33188,50302:33189,50304:33191,50305:33193,50306:33195,50307:33196,50308:33197,50309:33198,50310:33199,50311:33200,50312:33201,50313:33202,50314:33204,50315:33205,50316:33206,50317:33207,50318:33208,50319:33209,50320:33212,50321:33213,50322:33214,50323:33215,50324:33220,50325:33221,50326:33223,50327:33224,50328:33225,50329:33227,50330:33229,50331:33230,50332:33231,50333:33232,50334:33233,50335:33234,50336:33235,50337:25721,50338:34321,50339:27169,50340:33180,50341:30952,50342:25705,50343:39764,50344:25273,50345:26411,50346:33707,50347:22696,50348:40664,50349:27819,50350:28448,50351:23518,50352:38476,50353:35851,50354:29279,50355:26576,50356:25287,50357:29281,50358:20137,50359:22982,50360:27597,50361:22675,50362:26286,50363:24149,50364:21215,50365:24917,50366:26408,50367:30446,50368:30566,50369:29287,50370:31302,50371:25343,50372:21738,50373:21584,50374:38048,50375:37027,50376:23068,50377:32435,50378:27670,50379:20035,50380:22902,50381:32784,50382:22856,50383:21335,50384:30007,50385:38590,50386:22218,50387:25376,50388:33041,50389:24700,50390:38393,50391:28118,50392:21602,50393:39297,50394:20869,50395:23273,50396:33021,50397:22958,50398:38675,50399:20522,50400:27877,50401:23612,50402:25311,50403:20320,50404:21311,50405:33147,50406:36870,50407:28346,50408:34091,50409:25288,50410:24180,50411:30910,50412:25781,50413:25467,50414:24565,50415:23064,50416:37247,50417:40479,50418:23615,50419:25423,50420:32834,50421:23421,50422:21870,50423:38218,50424:38221,50425:28037,50426:24744,50427:26592,50428:29406,50429:20957,50430:23425,50496:33236,50497:33237,50498:33238,50499:33239,50500:33240,50501:33241,50502:33242,50503:33243,50504:33244,50505:33245,50506:33246,50507:33247,50508:33248,50509:33249,50510:33250,50511:33252,50512:33253,50513:33254,50514:33256,50515:33257,50516:33259,50517:33262,50518:33263,50519:33264,50520:33265,50521:33266,50522:33269,50523:33270,50524:33271,50525:33272,50526:33273,50527:33274,50528:33277,50529:33279,50530:33283,50531:33287,50532:33288,50533:33289,50534:33290,50535:33291,50536:33294,50537:33295,50538:33297,50539:33299,50540:33301,50541:33302,50542:33303,50543:33304,50544:33305,50545:33306,50546:33309,50547:33312,50548:33316,50549:33317,50550:33318,50551:33319,50552:33321,50553:33326,50554:33330,50555:33338,50556:33340,50557:33341,50558:33343,50560:33344,50561:33345,50562:33346,50563:33347,50564:33349,50565:33350,50566:33352,50567:33354,50568:33356,50569:33357,50570:33358,50571:33360,50572:33361,50573:33362,50574:33363,50575:33364,50576:33365,50577:33366,50578:33367,50579:33369,50580:33371,50581:33372,50582:33373,50583:33374,50584:33376,50585:33377,50586:33378,50587:33379,50588:33380,50589:33381,50590:33382,50591:33383,50592:33385,50593:25319,50594:27870,50595:29275,50596:25197,50597:38062,50598:32445,50599:33043,50600:27987,50601:20892,50602:24324,50603:22900,50604:21162,50605:24594,50606:22899,50607:26262,50608:34384,50609:30111,50610:25386,50611:25062,50612:31983,50613:35834,50614:21734,50615:27431,50616:40485,50617:27572,50618:34261,50619:21589,50620:20598,50621:27812,50622:21866,50623:36276,50624:29228,50625:24085,50626:24597,50627:29750,50628:25293,50629:25490,50630:29260,50631:24472,50632:28227,50633:27966,50634:25856,50635:28504,50636:30424,50637:30928,50638:30460,50639:30036,50640:21028,50641:21467,50642:20051,50643:24222,50644:26049,50645:32810,50646:32982,50647:25243,50648:21638,50649:21032,50650:28846,50651:34957,50652:36305,50653:27873,50654:21624,50655:32986,50656:22521,50657:35060,50658:36180,50659:38506,50660:37197,50661:20329,50662:27803,50663:21943,50664:30406,50665:30768,50666:25256,50667:28921,50668:28558,50669:24429,50670:34028,50671:26842,50672:30844,50673:31735,50674:33192,50675:26379,50676:40527,50677:25447,50678:30896,50679:22383,50680:30738,50681:38713,50682:25209,50683:25259,50684:21128,50685:29749,50686:27607,50752:33386,50753:33387,50754:33388,50755:33389,50756:33393,50757:33397,50758:33398,50759:33399,50760:33400,50761:33403,50762:33404,50763:33408,50764:33409,50765:33411,50766:33413,50767:33414,50768:33415,50769:33417,50770:33420,50771:33424,50772:33427,50773:33428,50774:33429,50775:33430,50776:33434,50777:33435,50778:33438,50779:33440,50780:33442,50781:33443,50782:33447,50783:33458,50784:33461,50785:33462,50786:33466,50787:33467,50788:33468,50789:33471,50790:33472,50791:33474,50792:33475,50793:33477,50794:33478,50795:33481,50796:33488,50797:33494,50798:33497,50799:33498,50800:33501,50801:33506,50802:33511,50803:33512,50804:33513,50805:33514,50806:33516,50807:33517,50808:33518,50809:33520,50810:33522,50811:33523,50812:33525,50813:33526,50814:33528,50816:33530,50817:33532,50818:33533,50819:33534,50820:33535,50821:33536,50822:33546,50823:33547,50824:33549,50825:33552,50826:33554,50827:33555,50828:33558,50829:33560,50830:33561,50831:33565,50832:33566,50833:33567,50834:33568,50835:33569,50836:33570,50837:33571,50838:33572,50839:33573,50840:33574,50841:33577,50842:33578,50843:33582,50844:33584,50845:33586,50846:33591,50847:33595,50848:33597,50849:21860,50850:33086,50851:30130,50852:30382,50853:21305,50854:30174,50855:20731,50856:23617,50857:35692,50858:31687,50859:20559,50860:29255,50861:39575,50862:39128,50863:28418,50864:29922,50865:31080,50866:25735,50867:30629,50868:25340,50869:39057,50870:36139,50871:21697,50872:32856,50873:20050,50874:22378,50875:33529,50876:33805,50877:24179,50878:20973,50879:29942,50880:35780,50881:23631,50882:22369,50883:27900,50884:39047,50885:23110,50886:30772,50887:39748,50888:36843,50889:31893,50890:21078,50891:25169,50892:38138,50893:20166,50894:33670,50895:33889,50896:33769,50897:33970,50898:22484,50899:26420,50900:22275,50901:26222,50902:28006,50903:35889,50904:26333,50905:28689,50906:26399,50907:27450,50908:26646,50909:25114,50910:22971,50911:19971,50912:20932,50913:28422,50914:26578,50915:27791,50916:20854,50917:26827,50918:22855,50919:27495,50920:30054,50921:23822,50922:33040,50923:40784,50924:26071,50925:31048,50926:31041,50927:39569,50928:36215,50929:23682,50930:20062,50931:20225,50932:21551,50933:22865,50934:30732,50935:22120,50936:27668,50937:36804,50938:24323,50939:27773,50940:27875,50941:35755,50942:25488,51008:33598,51009:33599,51010:33601,51011:33602,51012:33604,51013:33605,51014:33608,51015:33610,51016:33611,51017:33612,51018:33613,51019:33614,51020:33619,51021:33621,51022:33622,51023:33623,51024:33624,51025:33625,51026:33629,51027:33634,51028:33648,51029:33649,51030:33650,51031:33651,51032:33652,51033:33653,51034:33654,51035:33657,51036:33658,51037:33662,51038:33663,51039:33664,51040:33665,51041:33666,51042:33667,51043:33668,51044:33671,51045:33672,51046:33674,51047:33675,51048:33676,51049:33677,51050:33679,51051:33680,51052:33681,51053:33684,51054:33685,51055:33686,51056:33687,51057:33689,51058:33690,51059:33693,51060:33695,51061:33697,51062:33698,51063:33699,51064:33700,51065:33701,51066:33702,51067:33703,51068:33708,51069:33709,51070:33710,51072:33711,51073:33717,51074:33723,51075:33726,51076:33727,51077:33730,51078:33731,51079:33732,51080:33734,51081:33736,51082:33737,51083:33739,51084:33741,51085:33742,51086:33744,51087:33745,51088:33746,51089:33747,51090:33749,51091:33751,51092:33753,51093:33754,51094:33755,51095:33758,51096:33762,51097:33763,51098:33764,51099:33766,51100:33767,51101:33768,51102:33771,51103:33772,51104:33773,51105:24688,51106:27965,51107:29301,51108:25190,51109:38030,51110:38085,51111:21315,51112:36801,51113:31614,51114:20191,51115:35878,51116:20094,51117:40660,51118:38065,51119:38067,51120:21069,51121:28508,51122:36963,51123:27973,51124:35892,51125:22545,51126:23884,51127:27424,51128:27465,51129:26538,51130:21595,51131:33108,51132:32652,51133:22681,51134:34103,51135:24378,51136:25250,51137:27207,51138:38201,51139:25970,51140:24708,51141:26725,51142:30631,51143:20052,51144:20392,51145:24039,51146:38808,51147:25772,51148:32728,51149:23789,51150:20431,51151:31373,51152:20999,51153:33540,51154:19988,51155:24623,51156:31363,51157:38054,51158:20405,51159:20146,51160:31206,51161:29748,51162:21220,51163:33465,51164:25810,51165:31165,51166:23517,51167:27777,51168:38738,51169:36731,51170:27682,51171:20542,51172:21375,51173:28165,51174:25806,51175:26228,51176:27696,51177:24773,51178:39031,51179:35831,51180:24198,51181:29756,51182:31351,51183:31179,51184:19992,51185:37041,51186:29699,51187:27714,51188:22234,51189:37195,51190:27845,51191:36235,51192:21306,51193:34502,51194:26354,51195:36527,51196:23624,51197:39537,51198:28192,51264:33774,51265:33775,51266:33779,51267:33780,51268:33781,51269:33782,51270:33783,51271:33786,51272:33787,51273:33788,51274:33790,51275:33791,51276:33792,51277:33794,51278:33797,51279:33799,51280:33800,51281:33801,51282:33802,51283:33808,51284:33810,51285:33811,51286:33812,51287:33813,51288:33814,51289:33815,51290:33817,51291:33818,51292:33819,51293:33822,51294:33823,51295:33824,51296:33825,51297:33826,51298:33827,51299:33833,51300:33834,51301:33835,51302:33836,51303:33837,51304:33838,51305:33839,51306:33840,51307:33842,51308:33843,51309:33844,51310:33845,51311:33846,51312:33847,51313:33849,51314:33850,51315:33851,51316:33854,51317:33855,51318:33856,51319:33857,51320:33858,51321:33859,51322:33860,51323:33861,51324:33863,51325:33864,51326:33865,51328:33866,51329:33867,51330:33868,51331:33869,51332:33870,51333:33871,51334:33872,51335:33874,51336:33875,51337:33876,51338:33877,51339:33878,51340:33880,51341:33885,51342:33886,51343:33887,51344:33888,51345:33890,51346:33892,51347:33893,51348:33894,51349:33895,51350:33896,51351:33898,51352:33902,51353:33903,51354:33904,51355:33906,51356:33908,51357:33911,51358:33913,51359:33915,51360:33916,51361:21462,51362:23094,51363:40843,51364:36259,51365:21435,51366:22280,51367:39079,51368:26435,51369:37275,51370:27849,51371:20840,51372:30154,51373:25331,51374:29356,51375:21048,51376:21149,51377:32570,51378:28820,51379:30264,51380:21364,51381:40522,51382:27063,51383:30830,51384:38592,51385:35033,51386:32676,51387:28982,51388:29123,51389:20873,51390:26579,51391:29924,51392:22756,51393:25880,51394:22199,51395:35753,51396:39286,51397:25200,51398:32469,51399:24825,51400:28909,51401:22764,51402:20161,51403:20154,51404:24525,51405:38887,51406:20219,51407:35748,51408:20995,51409:22922,51410:32427,51411:25172,51412:20173,51413:26085,51414:25102,51415:33592,51416:33993,51417:33635,51418:34701,51419:29076,51420:28342,51421:23481,51422:32466,51423:20887,51424:25545,51425:26580,51426:32905,51427:33593,51428:34837,51429:20754,51430:23418,51431:22914,51432:36785,51433:20083,51434:27741,51435:20837,51436:35109,51437:36719,51438:38446,51439:34122,51440:29790,51441:38160,51442:38384,51443:28070,51444:33509,51445:24369,51446:25746,51447:27922,51448:33832,51449:33134,51450:40131,51451:22622,51452:36187,51453:19977,51454:21441,51520:33917,51521:33918,51522:33919,51523:33920,51524:33921,51525:33923,51526:33924,51527:33925,51528:33926,51529:33930,51530:33933,51531:33935,51532:33936,51533:33937,51534:33938,51535:33939,51536:33940,51537:33941,51538:33942,51539:33944,51540:33946,51541:33947,51542:33949,51543:33950,51544:33951,51545:33952,51546:33954,51547:33955,51548:33956,51549:33957,51550:33958,51551:33959,51552:33960,51553:33961,51554:33962,51555:33963,51556:33964,51557:33965,51558:33966,51559:33968,51560:33969,51561:33971,51562:33973,51563:33974,51564:33975,51565:33979,51566:33980,51567:33982,51568:33984,51569:33986,51570:33987,51571:33989,51572:33990,51573:33991,51574:33992,51575:33995,51576:33996,51577:33998,51578:33999,51579:34002,51580:34004,51581:34005,51582:34007,51584:34008,51585:34009,51586:34010,51587:34011,51588:34012,51589:34014,51590:34017,51591:34018,51592:34020,51593:34023,51594:34024,51595:34025,51596:34026,51597:34027,51598:34029,51599:34030,51600:34031,51601:34033,51602:34034,51603:34035,51604:34036,51605:34037,51606:34038,51607:34039,51608:34040,51609:34041,51610:34042,51611:34043,51612:34045,51613:34046,51614:34048,51615:34049,51616:34050,51617:20254,51618:25955,51619:26705,51620:21971,51621:20007,51622:25620,51623:39578,51624:25195,51625:23234,51626:29791,51627:33394,51628:28073,51629:26862,51630:20711,51631:33678,51632:30722,51633:26432,51634:21049,51635:27801,51636:32433,51637:20667,51638:21861,51639:29022,51640:31579,51641:26194,51642:29642,51643:33515,51644:26441,51645:23665,51646:21024,51647:29053,51648:34923,51649:38378,51650:38485,51651:25797,51652:36193,51653:33203,51654:21892,51655:27733,51656:25159,51657:32558,51658:22674,51659:20260,51660:21830,51661:36175,51662:26188,51663:19978,51664:23578,51665:35059,51666:26786,51667:25422,51668:31245,51669:28903,51670:33421,51671:21242,51672:38902,51673:23569,51674:21736,51675:37045,51676:32461,51677:22882,51678:36170,51679:34503,51680:33292,51681:33293,51682:36198,51683:25668,51684:23556,51685:24913,51686:28041,51687:31038,51688:35774,51689:30775,51690:30003,51691:21627,51692:20280,51693:36523,51694:28145,51695:23072,51696:32453,51697:31070,51698:27784,51699:23457,51700:23158,51701:29978,51702:32958,51703:24910,51704:28183,51705:22768,51706:29983,51707:29989,51708:29298,51709:21319,51710:32499,51776:34051,51777:34052,51778:34053,51779:34054,51780:34055,51781:34056,51782:34057,51783:34058,51784:34059,51785:34061,51786:34062,51787:34063,51788:34064,51789:34066,51790:34068,51791:34069,51792:34070,51793:34072,51794:34073,51795:34075,51796:34076,51797:34077,51798:34078,51799:34080,51800:34082,51801:34083,51802:34084,51803:34085,51804:34086,51805:34087,51806:34088,51807:34089,51808:34090,51809:34093,51810:34094,51811:34095,51812:34096,51813:34097,51814:34098,51815:34099,51816:34100,51817:34101,51818:34102,51819:34110,51820:34111,51821:34112,51822:34113,51823:34114,51824:34116,51825:34117,51826:34118,51827:34119,51828:34123,51829:34124,51830:34125,51831:34126,51832:34127,51833:34128,51834:34129,51835:34130,51836:34131,51837:34132,51838:34133,51840:34135,51841:34136,51842:34138,51843:34139,51844:34140,51845:34141,51846:34143,51847:34144,51848:34145,51849:34146,51850:34147,51851:34149,51852:34150,51853:34151,51854:34153,51855:34154,51856:34155,51857:34156,51858:34157,51859:34158,51860:34159,51861:34160,51862:34161,51863:34163,51864:34165,51865:34166,51866:34167,51867:34168,51868:34172,51869:34173,51870:34175,51871:34176,51872:34177,51873:30465,51874:30427,51875:21097,51876:32988,51877:22307,51878:24072,51879:22833,51880:29422,51881:26045,51882:28287,51883:35799,51884:23608,51885:34417,51886:21313,51887:30707,51888:25342,51889:26102,51890:20160,51891:39135,51892:34432,51893:23454,51894:35782,51895:21490,51896:30690,51897:20351,51898:23630,51899:39542,51900:22987,51901:24335,51902:31034,51903:22763,51904:19990,51905:26623,51906:20107,51907:25325,51908:35475,51909:36893,51910:21183,51911:26159,51912:21980,51913:22124,51914:36866,51915:20181,51916:20365,51917:37322,51918:39280,51919:27663,51920:24066,51921:24643,51922:23460,51923:35270,51924:35797,51925:25910,51926:25163,51927:39318,51928:23432,51929:23551,51930:25480,51931:21806,51932:21463,51933:30246,51934:20861,51935:34092,51936:26530,51937:26803,51938:27530,51939:25234,51940:36755,51941:21460,51942:33298,51943:28113,51944:30095,51945:20070,51946:36174,51947:23408,51948:29087,51949:34223,51950:26257,51951:26329,51952:32626,51953:34560,51954:40653,51955:40736,51956:23646,51957:26415,51958:36848,51959:26641,51960:26463,51961:25101,51962:31446,51963:22661,51964:24246,51965:25968,51966:28465,52032:34178,52033:34179,52034:34182,52035:34184,52036:34185,52037:34186,52038:34187,52039:34188,52040:34189,52041:34190,52042:34192,52043:34193,52044:34194,52045:34195,52046:34196,52047:34197,52048:34198,52049:34199,52050:34200,52051:34201,52052:34202,52053:34205,52054:34206,52055:34207,52056:34208,52057:34209,52058:34210,52059:34211,52060:34213,52061:34214,52062:34215,52063:34217,52064:34219,52065:34220,52066:34221,52067:34225,52068:34226,52069:34227,52070:34228,52071:34229,52072:34230,52073:34232,52074:34234,52075:34235,52076:34236,52077:34237,52078:34238,52079:34239,52080:34240,52081:34242,52082:34243,52083:34244,52084:34245,52085:34246,52086:34247,52087:34248,52088:34250,52089:34251,52090:34252,52091:34253,52092:34254,52093:34257,52094:34258,52096:34260,52097:34262,52098:34263,52099:34264,52100:34265,52101:34266,52102:34267,52103:34269,52104:34270,52105:34271,52106:34272,52107:34273,52108:34274,52109:34275,52110:34277,52111:34278,52112:34279,52113:34280,52114:34282,52115:34283,52116:34284,52117:34285,52118:34286,52119:34287,52120:34288,52121:34289,52122:34290,52123:34291,52124:34292,52125:34293,52126:34294,52127:34295,52128:34296,52129:24661,52130:21047,52131:32781,52132:25684,52133:34928,52134:29993,52135:24069,52136:26643,52137:25332,52138:38684,52139:21452,52140:29245,52141:35841,52142:27700,52143:30561,52144:31246,52145:21550,52146:30636,52147:39034,52148:33308,52149:35828,52150:30805,52151:26388,52152:28865,52153:26031,52154:25749,52155:22070,52156:24605,52157:31169,52158:21496,52159:19997,52160:27515,52161:32902,52162:23546,52163:21987,52164:22235,52165:20282,52166:20284,52167:39282,52168:24051,52169:26494,52170:32824,52171:24578,52172:39042,52173:36865,52174:23435,52175:35772,52176:35829,52177:25628,52178:33368,52179:25822,52180:22013,52181:33487,52182:37221,52183:20439,52184:32032,52185:36895,52186:31903,52187:20723,52188:22609,52189:28335,52190:23487,52191:35785,52192:32899,52193:37240,52194:33948,52195:31639,52196:34429,52197:38539,52198:38543,52199:32485,52200:39635,52201:30862,52202:23681,52203:31319,52204:36930,52205:38567,52206:31071,52207:23385,52208:25439,52209:31499,52210:34001,52211:26797,52212:21766,52213:32553,52214:29712,52215:32034,52216:38145,52217:25152,52218:22604,52219:20182,52220:23427,52221:22905,52222:22612,52288:34297,52289:34298,52290:34300,52291:34301,52292:34302,52293:34304,52294:34305,52295:34306,52296:34307,52297:34308,52298:34310,52299:34311,52300:34312,52301:34313,52302:34314,52303:34315,52304:34316,52305:34317,52306:34318,52307:34319,52308:34320,52309:34322,52310:34323,52311:34324,52312:34325,52313:34327,52314:34328,52315:34329,52316:34330,52317:34331,52318:34332,52319:34333,52320:34334,52321:34335,52322:34336,52323:34337,52324:34338,52325:34339,52326:34340,52327:34341,52328:34342,52329:34344,52330:34346,52331:34347,52332:34348,52333:34349,52334:34350,52335:34351,52336:34352,52337:34353,52338:34354,52339:34355,52340:34356,52341:34357,52342:34358,52343:34359,52344:34361,52345:34362,52346:34363,52347:34365,52348:34366,52349:34367,52350:34368,52352:34369,52353:34370,52354:34371,52355:34372,52356:34373,52357:34374,52358:34375,52359:34376,52360:34377,52361:34378,52362:34379,52363:34380,52364:34386,52365:34387,52366:34389,52367:34390,52368:34391,52369:34392,52370:34393,52371:34395,52372:34396,52373:34397,52374:34399,52375:34400,52376:34401,52377:34403,52378:34404,52379:34405,52380:34406,52381:34407,52382:34408,52383:34409,52384:34410,52385:29549,52386:25374,52387:36427,52388:36367,52389:32974,52390:33492,52391:25260,52392:21488,52393:27888,52394:37214,52395:22826,52396:24577,52397:27760,52398:22349,52399:25674,52400:36138,52401:30251,52402:28393,52403:22363,52404:27264,52405:30192,52406:28525,52407:35885,52408:35848,52409:22374,52410:27631,52411:34962,52412:30899,52413:25506,52414:21497,52415:28845,52416:27748,52417:22616,52418:25642,52419:22530,52420:26848,52421:33179,52422:21776,52423:31958,52424:20504,52425:36538,52426:28108,52427:36255,52428:28907,52429:25487,52430:28059,52431:28372,52432:32486,52433:33796,52434:26691,52435:36867,52436:28120,52437:38518,52438:35752,52439:22871,52440:29305,52441:34276,52442:33150,52443:30140,52444:35466,52445:26799,52446:21076,52447:36386,52448:38161,52449:25552,52450:39064,52451:36420,52452:21884,52453:20307,52454:26367,52455:22159,52456:24789,52457:28053,52458:21059,52459:23625,52460:22825,52461:28155,52462:22635,52463:30000,52464:29980,52465:24684,52466:33300,52467:33094,52468:25361,52469:26465,52470:36834,52471:30522,52472:36339,52473:36148,52474:38081,52475:24086,52476:21381,52477:21548,52478:28867,52544:34413,52545:34415,52546:34416,52547:34418,52548:34419,52549:34420,52550:34421,52551:34422,52552:34423,52553:34424,52554:34435,52555:34436,52556:34437,52557:34438,52558:34439,52559:34440,52560:34441,52561:34446,52562:34447,52563:34448,52564:34449,52565:34450,52566:34452,52567:34454,52568:34455,52569:34456,52570:34457,52571:34458,52572:34459,52573:34462,52574:34463,52575:34464,52576:34465,52577:34466,52578:34469,52579:34470,52580:34475,52581:34477,52582:34478,52583:34482,52584:34483,52585:34487,52586:34488,52587:34489,52588:34491,52589:34492,52590:34493,52591:34494,52592:34495,52593:34497,52594:34498,52595:34499,52596:34501,52597:34504,52598:34508,52599:34509,52600:34514,52601:34515,52602:34517,52603:34518,52604:34519,52605:34522,52606:34524,52608:34525,52609:34528,52610:34529,52611:34530,52612:34531,52613:34533,52614:34534,52615:34535,52616:34536,52617:34538,52618:34539,52619:34540,52620:34543,52621:34549,52622:34550,52623:34551,52624:34554,52625:34555,52626:34556,52627:34557,52628:34559,52629:34561,52630:34564,52631:34565,52632:34566,52633:34571,52634:34572,52635:34574,52636:34575,52637:34576,52638:34577,52639:34580,52640:34582,52641:27712,52642:24311,52643:20572,52644:20141,52645:24237,52646:25402,52647:33351,52648:36890,52649:26704,52650:37230,52651:30643,52652:21516,52653:38108,52654:24420,52655:31461,52656:26742,52657:25413,52658:31570,52659:32479,52660:30171,52661:20599,52662:25237,52663:22836,52664:36879,52665:20984,52666:31171,52667:31361,52668:22270,52669:24466,52670:36884,52671:28034,52672:23648,52673:22303,52674:21520,52675:20820,52676:28237,52677:22242,52678:25512,52679:39059,52680:33151,52681:34581,52682:35114,52683:36864,52684:21534,52685:23663,52686:33216,52687:25302,52688:25176,52689:33073,52690:40501,52691:38464,52692:39534,52693:39548,52694:26925,52695:22949,52696:25299,52697:21822,52698:25366,52699:21703,52700:34521,52701:27964,52702:23043,52703:29926,52704:34972,52705:27498,52706:22806,52707:35916,52708:24367,52709:28286,52710:29609,52711:39037,52712:20024,52713:28919,52714:23436,52715:30871,52716:25405,52717:26202,52718:30358,52719:24779,52720:23451,52721:23113,52722:19975,52723:33109,52724:27754,52725:29579,52726:20129,52727:26505,52728:32593,52729:24448,52730:26106,52731:26395,52732:24536,52733:22916,52734:23041,52800:34585,52801:34587,52802:34589,52803:34591,52804:34592,52805:34596,52806:34598,52807:34599,52808:34600,52809:34602,52810:34603,52811:34604,52812:34605,52813:34607,52814:34608,52815:34610,52816:34611,52817:34613,52818:34614,52819:34616,52820:34617,52821:34618,52822:34620,52823:34621,52824:34624,52825:34625,52826:34626,52827:34627,52828:34628,52829:34629,52830:34630,52831:34634,52832:34635,52833:34637,52834:34639,52835:34640,52836:34641,52837:34642,52838:34644,52839:34645,52840:34646,52841:34648,52842:34650,52843:34651,52844:34652,52845:34653,52846:34654,52847:34655,52848:34657,52849:34658,52850:34662,52851:34663,52852:34664,52853:34665,52854:34666,52855:34667,52856:34668,52857:34669,52858:34671,52859:34673,52860:34674,52861:34675,52862:34677,52864:34679,52865:34680,52866:34681,52867:34682,52868:34687,52869:34688,52870:34689,52871:34692,52872:34694,52873:34695,52874:34697,52875:34698,52876:34700,52877:34702,52878:34703,52879:34704,52880:34705,52881:34706,52882:34708,52883:34709,52884:34710,52885:34712,52886:34713,52887:34714,52888:34715,52889:34716,52890:34717,52891:34718,52892:34720,52893:34721,52894:34722,52895:34723,52896:34724,52897:24013,52898:24494,52899:21361,52900:38886,52901:36829,52902:26693,52903:22260,52904:21807,52905:24799,52906:20026,52907:28493,52908:32500,52909:33479,52910:33806,52911:22996,52912:20255,52913:20266,52914:23614,52915:32428,52916:26410,52917:34074,52918:21619,52919:30031,52920:32963,52921:21890,52922:39759,52923:20301,52924:28205,52925:35859,52926:23561,52927:24944,52928:21355,52929:30239,52930:28201,52931:34442,52932:25991,52933:38395,52934:32441,52935:21563,52936:31283,52937:32010,52938:38382,52939:21985,52940:32705,52941:29934,52942:25373,52943:34583,52944:28065,52945:31389,52946:25105,52947:26017,52948:21351,52949:25569,52950:27779,52951:24043,52952:21596,52953:38056,52954:20044,52955:27745,52956:35820,52957:23627,52958:26080,52959:33436,52960:26791,52961:21566,52962:21556,52963:27595,52964:27494,52965:20116,52966:25410,52967:21320,52968:33310,52969:20237,52970:20398,52971:22366,52972:25098,52973:38654,52974:26212,52975:29289,52976:21247,52977:21153,52978:24735,52979:35823,52980:26132,52981:29081,52982:26512,52983:35199,52984:30802,52985:30717,52986:26224,52987:22075,52988:21560,52989:38177,52990:29306,53056:34725,53057:34726,53058:34727,53059:34729,53060:34730,53061:34734,53062:34736,53063:34737,53064:34738,53065:34740,53066:34742,53067:34743,53068:34744,53069:34745,53070:34747,53071:34748,53072:34750,53073:34751,53074:34753,53075:34754,53076:34755,53077:34756,53078:34757,53079:34759,53080:34760,53081:34761,53082:34764,53083:34765,53084:34766,53085:34767,53086:34768,53087:34772,53088:34773,53089:34774,53090:34775,53091:34776,53092:34777,53093:34778,53094:34780,53095:34781,53096:34782,53097:34783,53098:34785,53099:34786,53100:34787,53101:34788,53102:34790,53103:34791,53104:34792,53105:34793,53106:34795,53107:34796,53108:34797,53109:34799,53110:34800,53111:34801,53112:34802,53113:34803,53114:34804,53115:34805,53116:34806,53117:34807,53118:34808,53120:34810,53121:34811,53122:34812,53123:34813,53124:34815,53125:34816,53126:34817,53127:34818,53128:34820,53129:34821,53130:34822,53131:34823,53132:34824,53133:34825,53134:34827,53135:34828,53136:34829,53137:34830,53138:34831,53139:34832,53140:34833,53141:34834,53142:34836,53143:34839,53144:34840,53145:34841,53146:34842,53147:34844,53148:34845,53149:34846,53150:34847,53151:34848,53152:34851,53153:31232,53154:24687,53155:24076,53156:24713,53157:33181,53158:22805,53159:24796,53160:29060,53161:28911,53162:28330,53163:27728,53164:29312,53165:27268,53166:34989,53167:24109,53168:20064,53169:23219,53170:21916,53171:38115,53172:27927,53173:31995,53174:38553,53175:25103,53176:32454,53177:30606,53178:34430,53179:21283,53180:38686,53181:36758,53182:26247,53183:23777,53184:20384,53185:29421,53186:19979,53187:21414,53188:22799,53189:21523,53190:25472,53191:38184,53192:20808,53193:20185,53194:40092,53195:32420,53196:21688,53197:36132,53198:34900,53199:33335,53200:38386,53201:28046,53202:24358,53203:23244,53204:26174,53205:38505,53206:29616,53207:29486,53208:21439,53209:33146,53210:39301,53211:32673,53212:23466,53213:38519,53214:38480,53215:32447,53216:30456,53217:21410,53218:38262,53219:39321,53220:31665,53221:35140,53222:28248,53223:20065,53224:32724,53225:31077,53226:35814,53227:24819,53228:21709,53229:20139,53230:39033,53231:24055,53232:27233,53233:20687,53234:21521,53235:35937,53236:33831,53237:30813,53238:38660,53239:21066,53240:21742,53241:22179,53242:38144,53243:28040,53244:23477,53245:28102,53246:26195,53312:34852,53313:34853,53314:34854,53315:34855,53316:34856,53317:34857,53318:34858,53319:34859,53320:34860,53321:34861,53322:34862,53323:34863,53324:34864,53325:34865,53326:34867,53327:34868,53328:34869,53329:34870,53330:34871,53331:34872,53332:34874,53333:34875,53334:34877,53335:34878,53336:34879,53337:34881,53338:34882,53339:34883,53340:34886,53341:34887,53342:34888,53343:34889,53344:34890,53345:34891,53346:34894,53347:34895,53348:34896,53349:34897,53350:34898,53351:34899,53352:34901,53353:34902,53354:34904,53355:34906,53356:34907,53357:34908,53358:34909,53359:34910,53360:34911,53361:34912,53362:34918,53363:34919,53364:34922,53365:34925,53366:34927,53367:34929,53368:34931,53369:34932,53370:34933,53371:34934,53372:34936,53373:34937,53374:34938,53376:34939,53377:34940,53378:34944,53379:34947,53380:34950,53381:34951,53382:34953,53383:34954,53384:34956,53385:34958,53386:34959,53387:34960,53388:34961,53389:34963,53390:34964,53391:34965,53392:34967,53393:34968,53394:34969,53395:34970,53396:34971,53397:34973,53398:34974,53399:34975,53400:34976,53401:34977,53402:34979,53403:34981,53404:34982,53405:34983,53406:34984,53407:34985,53408:34986,53409:23567,53410:23389,53411:26657,53412:32918,53413:21880,53414:31505,53415:25928,53416:26964,53417:20123,53418:27463,53419:34638,53420:38795,53421:21327,53422:25375,53423:25658,53424:37034,53425:26012,53426:32961,53427:35856,53428:20889,53429:26800,53430:21368,53431:34809,53432:25032,53433:27844,53434:27899,53435:35874,53436:23633,53437:34218,53438:33455,53439:38156,53440:27427,53441:36763,53442:26032,53443:24571,53444:24515,53445:20449,53446:34885,53447:26143,53448:33125,53449:29481,53450:24826,53451:20852,53452:21009,53453:22411,53454:24418,53455:37026,53456:34892,53457:37266,53458:24184,53459:26447,53460:24615,53461:22995,53462:20804,53463:20982,53464:33016,53465:21256,53466:27769,53467:38596,53468:29066,53469:20241,53470:20462,53471:32670,53472:26429,53473:21957,53474:38152,53475:31168,53476:34966,53477:32483,53478:22687,53479:25100,53480:38656,53481:34394,53482:22040,53483:39035,53484:24464,53485:35768,53486:33988,53487:37207,53488:21465,53489:26093,53490:24207,53491:30044,53492:24676,53493:32110,53494:23167,53495:32490,53496:32493,53497:36713,53498:21927,53499:23459,53500:24748,53501:26059,53502:29572,53568:34988,53569:34990,53570:34991,53571:34992,53572:34994,53573:34995,53574:34996,53575:34997,53576:34998,53577:35000,53578:35001,53579:35002,53580:35003,53581:35005,53582:35006,53583:35007,53584:35008,53585:35011,53586:35012,53587:35015,53588:35016,53589:35018,53590:35019,53591:35020,53592:35021,53593:35023,53594:35024,53595:35025,53596:35027,53597:35030,53598:35031,53599:35034,53600:35035,53601:35036,53602:35037,53603:35038,53604:35040,53605:35041,53606:35046,53607:35047,53608:35049,53609:35050,53610:35051,53611:35052,53612:35053,53613:35054,53614:35055,53615:35058,53616:35061,53617:35062,53618:35063,53619:35066,53620:35067,53621:35069,53622:35071,53623:35072,53624:35073,53625:35075,53626:35076,53627:35077,53628:35078,53629:35079,53630:35080,53632:35081,53633:35083,53634:35084,53635:35085,53636:35086,53637:35087,53638:35089,53639:35092,53640:35093,53641:35094,53642:35095,53643:35096,53644:35100,53645:35101,53646:35102,53647:35103,53648:35104,53649:35106,53650:35107,53651:35108,53652:35110,53653:35111,53654:35112,53655:35113,53656:35116,53657:35117,53658:35118,53659:35119,53660:35121,53661:35122,53662:35123,53663:35125,53664:35127,53665:36873,53666:30307,53667:30505,53668:32474,53669:38772,53670:34203,53671:23398,53672:31348,53673:38634,53674:34880,53675:21195,53676:29071,53677:24490,53678:26092,53679:35810,53680:23547,53681:39535,53682:24033,53683:27529,53684:27739,53685:35757,53686:35759,53687:36874,53688:36805,53689:21387,53690:25276,53691:40486,53692:40493,53693:21568,53694:20011,53695:33469,53696:29273,53697:34460,53698:23830,53699:34905,53700:28079,53701:38597,53702:21713,53703:20122,53704:35766,53705:28937,53706:21693,53707:38409,53708:28895,53709:28153,53710:30416,53711:20005,53712:30740,53713:34578,53714:23721,53715:24310,53716:35328,53717:39068,53718:38414,53719:28814,53720:27839,53721:22852,53722:25513,53723:30524,53724:34893,53725:28436,53726:33395,53727:22576,53728:29141,53729:21388,53730:30746,53731:38593,53732:21761,53733:24422,53734:28976,53735:23476,53736:35866,53737:39564,53738:27523,53739:22830,53740:40495,53741:31207,53742:26472,53743:25196,53744:20335,53745:30113,53746:32650,53747:27915,53748:38451,53749:27687,53750:20208,53751:30162,53752:20859,53753:26679,53754:28478,53755:36992,53756:33136,53757:22934,53758:29814,53824:35128,53825:35129,53826:35130,53827:35131,53828:35132,53829:35133,53830:35134,53831:35135,53832:35136,53833:35138,53834:35139,53835:35141,53836:35142,53837:35143,53838:35144,53839:35145,53840:35146,53841:35147,53842:35148,53843:35149,53844:35150,53845:35151,53846:35152,53847:35153,53848:35154,53849:35155,53850:35156,53851:35157,53852:35158,53853:35159,53854:35160,53855:35161,53856:35162,53857:35163,53858:35164,53859:35165,53860:35168,53861:35169,53862:35170,53863:35171,53864:35172,53865:35173,53866:35175,53867:35176,53868:35177,53869:35178,53870:35179,53871:35180,53872:35181,53873:35182,53874:35183,53875:35184,53876:35185,53877:35186,53878:35187,53879:35188,53880:35189,53881:35190,53882:35191,53883:35192,53884:35193,53885:35194,53886:35196,53888:35197,53889:35198,53890:35200,53891:35202,53892:35204,53893:35205,53894:35207,53895:35208,53896:35209,53897:35210,53898:35211,53899:35212,53900:35213,53901:35214,53902:35215,53903:35216,53904:35217,53905:35218,53906:35219,53907:35220,53908:35221,53909:35222,53910:35223,53911:35224,53912:35225,53913:35226,53914:35227,53915:35228,53916:35229,53917:35230,53918:35231,53919:35232,53920:35233,53921:25671,53922:23591,53923:36965,53924:31377,53925:35875,53926:23002,53927:21676,53928:33280,53929:33647,53930:35201,53931:32768,53932:26928,53933:22094,53934:32822,53935:29239,53936:37326,53937:20918,53938:20063,53939:39029,53940:25494,53941:19994,53942:21494,53943:26355,53944:33099,53945:22812,53946:28082,53947:19968,53948:22777,53949:21307,53950:25558,53951:38129,53952:20381,53953:20234,53954:34915,53955:39056,53956:22839,53957:36951,53958:31227,53959:20202,53960:33008,53961:30097,53962:27778,53963:23452,53964:23016,53965:24413,53966:26885,53967:34433,53968:20506,53969:24050,53970:20057,53971:30691,53972:20197,53973:33402,53974:25233,53975:26131,53976:37009,53977:23673,53978:20159,53979:24441,53980:33222,53981:36920,53982:32900,53983:30123,53984:20134,53985:35028,53986:24847,53987:27589,53988:24518,53989:20041,53990:30410,53991:28322,53992:35811,53993:35758,53994:35850,53995:35793,53996:24322,53997:32764,53998:32716,53999:32462,54000:33589,54001:33643,54002:22240,54003:27575,54004:38899,54005:38452,54006:23035,54007:21535,54008:38134,54009:28139,54010:23493,54011:39278,54012:23609,54013:24341,54014:38544,54080:35234,54081:35235,54082:35236,54083:35237,54084:35238,54085:35239,54086:35240,54087:35241,54088:35242,54089:35243,54090:35244,54091:35245,54092:35246,54093:35247,54094:35248,54095:35249,54096:35250,54097:35251,54098:35252,54099:35253,54100:35254,54101:35255,54102:35256,54103:35257,54104:35258,54105:35259,54106:35260,54107:35261,54108:35262,54109:35263,54110:35264,54111:35267,54112:35277,54113:35283,54114:35284,54115:35285,54116:35287,54117:35288,54118:35289,54119:35291,54120:35293,54121:35295,54122:35296,54123:35297,54124:35298,54125:35300,54126:35303,54127:35304,54128:35305,54129:35306,54130:35308,54131:35309,54132:35310,54133:35312,54134:35313,54135:35314,54136:35316,54137:35317,54138:35318,54139:35319,54140:35320,54141:35321,54142:35322,54144:35323,54145:35324,54146:35325,54147:35326,54148:35327,54149:35329,54150:35330,54151:35331,54152:35332,54153:35333,54154:35334,54155:35336,54156:35337,54157:35338,54158:35339,54159:35340,54160:35341,54161:35342,54162:35343,54163:35344,54164:35345,54165:35346,54166:35347,54167:35348,54168:35349,54169:35350,54170:35351,54171:35352,54172:35353,54173:35354,54174:35355,54175:35356,54176:35357,54177:21360,54178:33521,54179:27185,54180:23156,54181:40560,54182:24212,54183:32552,54184:33721,54185:33828,54186:33829,54187:33639,54188:34631,54189:36814,54190:36194,54191:30408,54192:24433,54193:39062,54194:30828,54195:26144,54196:21727,54197:25317,54198:20323,54199:33219,54200:30152,54201:24248,54202:38605,54203:36362,54204:34553,54205:21647,54206:27891,54207:28044,54208:27704,54209:24703,54210:21191,54211:29992,54212:24189,54213:20248,54214:24736,54215:24551,54216:23588,54217:30001,54218:37038,54219:38080,54220:29369,54221:27833,54222:28216,54223:37193,54224:26377,54225:21451,54226:21491,54227:20305,54228:37321,54229:35825,54230:21448,54231:24188,54232:36802,54233:28132,54234:20110,54235:30402,54236:27014,54237:34398,54238:24858,54239:33286,54240:20313,54241:20446,54242:36926,54243:40060,54244:24841,54245:28189,54246:28180,54247:38533,54248:20104,54249:23089,54250:38632,54251:19982,54252:23679,54253:31161,54254:23431,54255:35821,54256:32701,54257:29577,54258:22495,54259:33419,54260:37057,54261:21505,54262:36935,54263:21947,54264:23786,54265:24481,54266:24840,54267:27442,54268:29425,54269:32946,54270:35465,54336:35358,54337:35359,54338:35360,54339:35361,54340:35362,54341:35363,54342:35364,54343:35365,54344:35366,54345:35367,54346:35368,54347:35369,54348:35370,54349:35371,54350:35372,54351:35373,54352:35374,54353:35375,54354:35376,54355:35377,54356:35378,54357:35379,54358:35380,54359:35381,54360:35382,54361:35383,54362:35384,54363:35385,54364:35386,54365:35387,54366:35388,54367:35389,54368:35391,54369:35392,54370:35393,54371:35394,54372:35395,54373:35396,54374:35397,54375:35398,54376:35399,54377:35401,54378:35402,54379:35403,54380:35404,54381:35405,54382:35406,54383:35407,54384:35408,54385:35409,54386:35410,54387:35411,54388:35412,54389:35413,54390:35414,54391:35415,54392:35416,54393:35417,54394:35418,54395:35419,54396:35420,54397:35421,54398:35422,54400:35423,54401:35424,54402:35425,54403:35426,54404:35427,54405:35428,54406:35429,54407:35430,54408:35431,54409:35432,54410:35433,54411:35434,54412:35435,54413:35436,54414:35437,54415:35438,54416:35439,54417:35440,54418:35441,54419:35442,54420:35443,54421:35444,54422:35445,54423:35446,54424:35447,54425:35448,54426:35450,54427:35451,54428:35452,54429:35453,54430:35454,54431:35455,54432:35456,54433:28020,54434:23507,54435:35029,54436:39044,54437:35947,54438:39533,54439:40499,54440:28170,54441:20900,54442:20803,54443:22435,54444:34945,54445:21407,54446:25588,54447:36757,54448:22253,54449:21592,54450:22278,54451:29503,54452:28304,54453:32536,54454:36828,54455:33489,54456:24895,54457:24616,54458:38498,54459:26352,54460:32422,54461:36234,54462:36291,54463:38053,54464:23731,54465:31908,54466:26376,54467:24742,54468:38405,54469:32792,54470:20113,54471:37095,54472:21248,54473:38504,54474:20801,54475:36816,54476:34164,54477:37213,54478:26197,54479:38901,54480:23381,54481:21277,54482:30776,54483:26434,54484:26685,54485:21705,54486:28798,54487:23472,54488:36733,54489:20877,54490:22312,54491:21681,54492:25874,54493:26242,54494:36190,54495:36163,54496:33039,54497:33900,54498:36973,54499:31967,54500:20991,54501:34299,54502:26531,54503:26089,54504:28577,54505:34468,54506:36481,54507:22122,54508:36896,54509:30338,54510:28790,54511:29157,54512:36131,54513:25321,54514:21017,54515:27901,54516:36156,54517:24590,54518:22686,54519:24974,54520:26366,54521:36192,54522:25166,54523:21939,54524:28195,54525:26413,54526:36711,54592:35457,54593:35458,54594:35459,54595:35460,54596:35461,54597:35462,54598:35463,54599:35464,54600:35467,54601:35468,54602:35469,54603:35470,54604:35471,54605:35472,54606:35473,54607:35474,54608:35476,54609:35477,54610:35478,54611:35479,54612:35480,54613:35481,54614:35482,54615:35483,54616:35484,54617:35485,54618:35486,54619:35487,54620:35488,54621:35489,54622:35490,54623:35491,54624:35492,54625:35493,54626:35494,54627:35495,54628:35496,54629:35497,54630:35498,54631:35499,54632:35500,54633:35501,54634:35502,54635:35503,54636:35504,54637:35505,54638:35506,54639:35507,54640:35508,54641:35509,54642:35510,54643:35511,54644:35512,54645:35513,54646:35514,54647:35515,54648:35516,54649:35517,54650:35518,54651:35519,54652:35520,54653:35521,54654:35522,54656:35523,54657:35524,54658:35525,54659:35526,54660:35527,54661:35528,54662:35529,54663:35530,54664:35531,54665:35532,54666:35533,54667:35534,54668:35535,54669:35536,54670:35537,54671:35538,54672:35539,54673:35540,54674:35541,54675:35542,54676:35543,54677:35544,54678:35545,54679:35546,54680:35547,54681:35548,54682:35549,54683:35550,54684:35551,54685:35552,54686:35553,54687:35554,54688:35555,54689:38113,54690:38392,54691:30504,54692:26629,54693:27048,54694:21643,54695:20045,54696:28856,54697:35784,54698:25688,54699:25995,54700:23429,54701:31364,54702:20538,54703:23528,54704:30651,54705:27617,54706:35449,54707:31896,54708:27838,54709:30415,54710:26025,54711:36759,54712:23853,54713:23637,54714:34360,54715:26632,54716:21344,54717:25112,54718:31449,54719:28251,54720:32509,54721:27167,54722:31456,54723:24432,54724:28467,54725:24352,54726:25484,54727:28072,54728:26454,54729:19976,54730:24080,54731:36134,54732:20183,54733:32960,54734:30260,54735:38556,54736:25307,54737:26157,54738:25214,54739:27836,54740:36213,54741:29031,54742:32617,54743:20806,54744:32903,54745:21484,54746:36974,54747:25240,54748:21746,54749:34544,54750:36761,54751:32773,54752:38167,54753:34071,54754:36825,54755:27993,54756:29645,54757:26015,54758:30495,54759:29956,54760:30759,54761:33275,54762:36126,54763:38024,54764:20390,54765:26517,54766:30137,54767:35786,54768:38663,54769:25391,54770:38215,54771:38453,54772:33976,54773:25379,54774:30529,54775:24449,54776:29424,54777:20105,54778:24596,54779:25972,54780:25327,54781:27491,54782:25919,54848:35556,54849:35557,54850:35558,54851:35559,54852:35560,54853:35561,54854:35562,54855:35563,54856:35564,54857:35565,54858:35566,54859:35567,54860:35568,54861:35569,54862:35570,54863:35571,54864:35572,54865:35573,54866:35574,54867:35575,54868:35576,54869:35577,54870:35578,54871:35579,54872:35580,54873:35581,54874:35582,54875:35583,54876:35584,54877:35585,54878:35586,54879:35587,54880:35588,54881:35589,54882:35590,54883:35592,54884:35593,54885:35594,54886:35595,54887:35596,54888:35597,54889:35598,54890:35599,54891:35600,54892:35601,54893:35602,54894:35603,54895:35604,54896:35605,54897:35606,54898:35607,54899:35608,54900:35609,54901:35610,54902:35611,54903:35612,54904:35613,54905:35614,54906:35615,54907:35616,54908:35617,54909:35618,54910:35619,54912:35620,54913:35621,54914:35623,54915:35624,54916:35625,54917:35626,54918:35627,54919:35628,54920:35629,54921:35630,54922:35631,54923:35632,54924:35633,54925:35634,54926:35635,54927:35636,54928:35637,54929:35638,54930:35639,54931:35640,54932:35641,54933:35642,54934:35643,54935:35644,54936:35645,54937:35646,54938:35647,54939:35648,54940:35649,54941:35650,54942:35651,54943:35652,54944:35653,54945:24103,54946:30151,54947:37073,54948:35777,54949:33437,54950:26525,54951:25903,54952:21553,54953:34584,54954:30693,54955:32930,54956:33026,54957:27713,54958:20043,54959:32455,54960:32844,54961:30452,54962:26893,54963:27542,54964:25191,54965:20540,54966:20356,54967:22336,54968:25351,54969:27490,54970:36286,54971:21482,54972:26088,54973:32440,54974:24535,54975:25370,54976:25527,54977:33267,54978:33268,54979:32622,54980:24092,54981:23769,54982:21046,54983:26234,54984:31209,54985:31258,54986:36136,54987:28825,54988:30164,54989:28382,54990:27835,54991:31378,54992:20013,54993:30405,54994:24544,54995:38047,54996:34935,54997:32456,54998:31181,54999:32959,55000:37325,55001:20210,55002:20247,55003:33311,55004:21608,55005:24030,55006:27954,55007:35788,55008:31909,55009:36724,55010:32920,55011:24090,55012:21650,55013:30385,55014:23449,55015:26172,55016:39588,55017:29664,55018:26666,55019:34523,55020:26417,55021:29482,55022:35832,55023:35803,55024:36880,55025:31481,55026:28891,55027:29038,55028:25284,55029:30633,55030:22065,55031:20027,55032:33879,55033:26609,55034:21161,55035:34496,55036:36142,55037:38136,55038:31569,55104:35654,55105:35655,55106:35656,55107:35657,55108:35658,55109:35659,55110:35660,55111:35661,55112:35662,55113:35663,55114:35664,55115:35665,55116:35666,55117:35667,55118:35668,55119:35669,55120:35670,55121:35671,55122:35672,55123:35673,55124:35674,55125:35675,55126:35676,55127:35677,55128:35678,55129:35679,55130:35680,55131:35681,55132:35682,55133:35683,55134:35684,55135:35685,55136:35687,55137:35688,55138:35689,55139:35690,55140:35691,55141:35693,55142:35694,55143:35695,55144:35696,55145:35697,55146:35698,55147:35699,55148:35700,55149:35701,55150:35702,55151:35703,55152:35704,55153:35705,55154:35706,55155:35707,55156:35708,55157:35709,55158:35710,55159:35711,55160:35712,55161:35713,55162:35714,55163:35715,55164:35716,55165:35717,55166:35718,55168:35719,55169:35720,55170:35721,55171:35722,55172:35723,55173:35724,55174:35725,55175:35726,55176:35727,55177:35728,55178:35729,55179:35730,55180:35731,55181:35732,55182:35733,55183:35734,55184:35735,55185:35736,55186:35737,55187:35738,55188:35739,55189:35740,55190:35741,55191:35742,55192:35743,55193:35756,55194:35761,55195:35771,55196:35783,55197:35792,55198:35818,55199:35849,55200:35870,55201:20303,55202:27880,55203:31069,55204:39547,55205:25235,55206:29226,55207:25341,55208:19987,55209:30742,55210:36716,55211:25776,55212:36186,55213:31686,55214:26729,55215:24196,55216:35013,55217:22918,55218:25758,55219:22766,55220:29366,55221:26894,55222:38181,55223:36861,55224:36184,55225:22368,55226:32512,55227:35846,55228:20934,55229:25417,55230:25305,55231:21331,55232:26700,55233:29730,55234:33537,55235:37196,55236:21828,55237:30528,55238:28796,55239:27978,55240:20857,55241:21672,55242:36164,55243:23039,55244:28363,55245:28100,55246:23388,55247:32043,55248:20180,55249:31869,55250:28371,55251:23376,55252:33258,55253:28173,55254:23383,55255:39683,55256:26837,55257:36394,55258:23447,55259:32508,55260:24635,55261:32437,55262:37049,55263:36208,55264:22863,55265:25549,55266:31199,55267:36275,55268:21330,55269:26063,55270:31062,55271:35781,55272:38459,55273:32452,55274:38075,55275:32386,55276:22068,55277:37257,55278:26368,55279:32618,55280:23562,55281:36981,55282:26152,55283:24038,55284:20304,55285:26590,55286:20570,55287:20316,55288:22352,55289:24231,55290:59408,55291:59409,55292:59410,55293:59411,55294:59412,55360:35896,55361:35897,55362:35898,55363:35899,55364:35900,55365:35901,55366:35902,55367:35903,55368:35904,55369:35906,55370:35907,55371:35908,55372:35909,55373:35912,55374:35914,55375:35915,55376:35917,55377:35918,55378:35919,55379:35920,55380:35921,55381:35922,55382:35923,55383:35924,55384:35926,55385:35927,55386:35928,55387:35929,55388:35931,55389:35932,55390:35933,55391:35934,55392:35935,55393:35936,55394:35939,55395:35940,55396:35941,55397:35942,55398:35943,55399:35944,55400:35945,55401:35948,55402:35949,55403:35950,55404:35951,55405:35952,55406:35953,55407:35954,55408:35956,55409:35957,55410:35958,55411:35959,55412:35963,55413:35964,55414:35965,55415:35966,55416:35967,55417:35968,55418:35969,55419:35971,55420:35972,55421:35974,55422:35975,55424:35976,55425:35979,55426:35981,55427:35982,55428:35983,55429:35984,55430:35985,55431:35986,55432:35987,55433:35989,55434:35990,55435:35991,55436:35993,55437:35994,55438:35995,55439:35996,55440:35997,55441:35998,55442:35999,55443:36000,55444:36001,55445:36002,55446:36003,55447:36004,55448:36005,55449:36006,55450:36007,55451:36008,55452:36009,55453:36010,55454:36011,55455:36012,55456:36013,55457:20109,55458:19980,55459:20800,55460:19984,55461:24319,55462:21317,55463:19989,55464:20120,55465:19998,55466:39730,55467:23404,55468:22121,55469:20008,55470:31162,55471:20031,55472:21269,55473:20039,55474:22829,55475:29243,55476:21358,55477:27664,55478:22239,55479:32996,55480:39319,55481:27603,55482:30590,55483:40727,55484:20022,55485:20127,55486:40720,55487:20060,55488:20073,55489:20115,55490:33416,55491:23387,55492:21868,55493:22031,55494:20164,55495:21389,55496:21405,55497:21411,55498:21413,55499:21422,55500:38757,55501:36189,55502:21274,55503:21493,55504:21286,55505:21294,55506:21310,55507:36188,55508:21350,55509:21347,55510:20994,55511:21000,55512:21006,55513:21037,55514:21043,55515:21055,55516:21056,55517:21068,55518:21086,55519:21089,55520:21084,55521:33967,55522:21117,55523:21122,55524:21121,55525:21136,55526:21139,55527:20866,55528:32596,55529:20155,55530:20163,55531:20169,55532:20162,55533:20200,55534:20193,55535:20203,55536:20190,55537:20251,55538:20211,55539:20258,55540:20324,55541:20213,55542:20261,55543:20263,55544:20233,55545:20267,55546:20318,55547:20327,55548:25912,55549:20314,55550:20317,55616:36014,55617:36015,55618:36016,55619:36017,55620:36018,55621:36019,55622:36020,55623:36021,55624:36022,55625:36023,55626:36024,55627:36025,55628:36026,55629:36027,55630:36028,55631:36029,55632:36030,55633:36031,55634:36032,55635:36033,55636:36034,55637:36035,55638:36036,55639:36037,55640:36038,55641:36039,55642:36040,55643:36041,55644:36042,55645:36043,55646:36044,55647:36045,55648:36046,55649:36047,55650:36048,55651:36049,55652:36050,55653:36051,55654:36052,55655:36053,55656:36054,55657:36055,55658:36056,55659:36057,55660:36058,55661:36059,55662:36060,55663:36061,55664:36062,55665:36063,55666:36064,55667:36065,55668:36066,55669:36067,55670:36068,55671:36069,55672:36070,55673:36071,55674:36072,55675:36073,55676:36074,55677:36075,55678:36076,55680:36077,55681:36078,55682:36079,55683:36080,55684:36081,55685:36082,55686:36083,55687:36084,55688:36085,55689:36086,55690:36087,55691:36088,55692:36089,55693:36090,55694:36091,55695:36092,55696:36093,55697:36094,55698:36095,55699:36096,55700:36097,55701:36098,55702:36099,55703:36100,55704:36101,55705:36102,55706:36103,55707:36104,55708:36105,55709:36106,55710:36107,55711:36108,55712:36109,55713:20319,55714:20311,55715:20274,55716:20285,55717:20342,55718:20340,55719:20369,55720:20361,55721:20355,55722:20367,55723:20350,55724:20347,55725:20394,55726:20348,55727:20396,55728:20372,55729:20454,55730:20456,55731:20458,55732:20421,55733:20442,55734:20451,55735:20444,55736:20433,55737:20447,55738:20472,55739:20521,55740:20556,55741:20467,55742:20524,55743:20495,55744:20526,55745:20525,55746:20478,55747:20508,55748:20492,55749:20517,55750:20520,55751:20606,55752:20547,55753:20565,55754:20552,55755:20558,55756:20588,55757:20603,55758:20645,55759:20647,55760:20649,55761:20666,55762:20694,55763:20742,55764:20717,55765:20716,55766:20710,55767:20718,55768:20743,55769:20747,55770:20189,55771:27709,55772:20312,55773:20325,55774:20430,55775:40864,55776:27718,55777:31860,55778:20846,55779:24061,55780:40649,55781:39320,55782:20865,55783:22804,55784:21241,55785:21261,55786:35335,55787:21264,55788:20971,55789:22809,55790:20821,55791:20128,55792:20822,55793:20147,55794:34926,55795:34980,55796:20149,55797:33044,55798:35026,55799:31104,55800:23348,55801:34819,55802:32696,55803:20907,55804:20913,55805:20925,55806:20924,55872:36110,55873:36111,55874:36112,55875:36113,55876:36114,55877:36115,55878:36116,55879:36117,55880:36118,55881:36119,55882:36120,55883:36121,55884:36122,55885:36123,55886:36124,55887:36128,55888:36177,55889:36178,55890:36183,55891:36191,55892:36197,55893:36200,55894:36201,55895:36202,55896:36204,55897:36206,55898:36207,55899:36209,55900:36210,55901:36216,55902:36217,55903:36218,55904:36219,55905:36220,55906:36221,55907:36222,55908:36223,55909:36224,55910:36226,55911:36227,55912:36230,55913:36231,55914:36232,55915:36233,55916:36236,55917:36237,55918:36238,55919:36239,55920:36240,55921:36242,55922:36243,55923:36245,55924:36246,55925:36247,55926:36248,55927:36249,55928:36250,55929:36251,55930:36252,55931:36253,55932:36254,55933:36256,55934:36257,55936:36258,55937:36260,55938:36261,55939:36262,55940:36263,55941:36264,55942:36265,55943:36266,55944:36267,55945:36268,55946:36269,55947:36270,55948:36271,55949:36272,55950:36274,55951:36278,55952:36279,55953:36281,55954:36283,55955:36285,55956:36288,55957:36289,55958:36290,55959:36293,55960:36295,55961:36296,55962:36297,55963:36298,55964:36301,55965:36304,55966:36306,55967:36307,55968:36308,55969:20935,55970:20886,55971:20898,55972:20901,55973:35744,55974:35750,55975:35751,55976:35754,55977:35764,55978:35765,55979:35767,55980:35778,55981:35779,55982:35787,55983:35791,55984:35790,55985:35794,55986:35795,55987:35796,55988:35798,55989:35800,55990:35801,55991:35804,55992:35807,55993:35808,55994:35812,55995:35816,55996:35817,55997:35822,55998:35824,55999:35827,56000:35830,56001:35833,56002:35836,56003:35839,56004:35840,56005:35842,56006:35844,56007:35847,56008:35852,56009:35855,56010:35857,56011:35858,56012:35860,56013:35861,56014:35862,56015:35865,56016:35867,56017:35864,56018:35869,56019:35871,56020:35872,56021:35873,56022:35877,56023:35879,56024:35882,56025:35883,56026:35886,56027:35887,56028:35890,56029:35891,56030:35893,56031:35894,56032:21353,56033:21370,56034:38429,56035:38434,56036:38433,56037:38449,56038:38442,56039:38461,56040:38460,56041:38466,56042:38473,56043:38484,56044:38495,56045:38503,56046:38508,56047:38514,56048:38516,56049:38536,56050:38541,56051:38551,56052:38576,56053:37015,56054:37019,56055:37021,56056:37017,56057:37036,56058:37025,56059:37044,56060:37043,56061:37046,56062:37050,56128:36309,56129:36312,56130:36313,56131:36316,56132:36320,56133:36321,56134:36322,56135:36325,56136:36326,56137:36327,56138:36329,56139:36333,56140:36334,56141:36336,56142:36337,56143:36338,56144:36340,56145:36342,56146:36348,56147:36350,56148:36351,56149:36352,56150:36353,56151:36354,56152:36355,56153:36356,56154:36358,56155:36359,56156:36360,56157:36363,56158:36365,56159:36366,56160:36368,56161:36369,56162:36370,56163:36371,56164:36373,56165:36374,56166:36375,56167:36376,56168:36377,56169:36378,56170:36379,56171:36380,56172:36384,56173:36385,56174:36388,56175:36389,56176:36390,56177:36391,56178:36392,56179:36395,56180:36397,56181:36400,56182:36402,56183:36403,56184:36404,56185:36406,56186:36407,56187:36408,56188:36411,56189:36412,56190:36414,56192:36415,56193:36419,56194:36421,56195:36422,56196:36428,56197:36429,56198:36430,56199:36431,56200:36432,56201:36435,56202:36436,56203:36437,56204:36438,56205:36439,56206:36440,56207:36442,56208:36443,56209:36444,56210:36445,56211:36446,56212:36447,56213:36448,56214:36449,56215:36450,56216:36451,56217:36452,56218:36453,56219:36455,56220:36456,56221:36458,56222:36459,56223:36462,56224:36465,56225:37048,56226:37040,56227:37071,56228:37061,56229:37054,56230:37072,56231:37060,56232:37063,56233:37075,56234:37094,56235:37090,56236:37084,56237:37079,56238:37083,56239:37099,56240:37103,56241:37118,56242:37124,56243:37154,56244:37150,56245:37155,56246:37169,56247:37167,56248:37177,56249:37187,56250:37190,56251:21005,56252:22850,56253:21154,56254:21164,56255:21165,56256:21182,56257:21759,56258:21200,56259:21206,56260:21232,56261:21471,56262:29166,56263:30669,56264:24308,56265:20981,56266:20988,56267:39727,56268:21430,56269:24321,56270:30042,56271:24047,56272:22348,56273:22441,56274:22433,56275:22654,56276:22716,56277:22725,56278:22737,56279:22313,56280:22316,56281:22314,56282:22323,56283:22329,56284:22318,56285:22319,56286:22364,56287:22331,56288:22338,56289:22377,56290:22405,56291:22379,56292:22406,56293:22396,56294:22395,56295:22376,56296:22381,56297:22390,56298:22387,56299:22445,56300:22436,56301:22412,56302:22450,56303:22479,56304:22439,56305:22452,56306:22419,56307:22432,56308:22485,56309:22488,56310:22490,56311:22489,56312:22482,56313:22456,56314:22516,56315:22511,56316:22520,56317:22500,56318:22493,56384:36467,56385:36469,56386:36471,56387:36472,56388:36473,56389:36474,56390:36475,56391:36477,56392:36478,56393:36480,56394:36482,56395:36483,56396:36484,56397:36486,56398:36488,56399:36489,56400:36490,56401:36491,56402:36492,56403:36493,56404:36494,56405:36497,56406:36498,56407:36499,56408:36501,56409:36502,56410:36503,56411:36504,56412:36505,56413:36506,56414:36507,56415:36509,56416:36511,56417:36512,56418:36513,56419:36514,56420:36515,56421:36516,56422:36517,56423:36518,56424:36519,56425:36520,56426:36521,56427:36522,56428:36525,56429:36526,56430:36528,56431:36529,56432:36531,56433:36532,56434:36533,56435:36534,56436:36535,56437:36536,56438:36537,56439:36539,56440:36540,56441:36541,56442:36542,56443:36543,56444:36544,56445:36545,56446:36546,56448:36547,56449:36548,56450:36549,56451:36550,56452:36551,56453:36552,56454:36553,56455:36554,56456:36555,56457:36556,56458:36557,56459:36559,56460:36560,56461:36561,56462:36562,56463:36563,56464:36564,56465:36565,56466:36566,56467:36567,56468:36568,56469:36569,56470:36570,56471:36571,56472:36572,56473:36573,56474:36574,56475:36575,56476:36576,56477:36577,56478:36578,56479:36579,56480:36580,56481:22539,56482:22541,56483:22525,56484:22509,56485:22528,56486:22558,56487:22553,56488:22596,56489:22560,56490:22629,56491:22636,56492:22657,56493:22665,56494:22682,56495:22656,56496:39336,56497:40729,56498:25087,56499:33401,56500:33405,56501:33407,56502:33423,56503:33418,56504:33448,56505:33412,56506:33422,56507:33425,56508:33431,56509:33433,56510:33451,56511:33464,56512:33470,56513:33456,56514:33480,56515:33482,56516:33507,56517:33432,56518:33463,56519:33454,56520:33483,56521:33484,56522:33473,56523:33449,56524:33460,56525:33441,56526:33450,56527:33439,56528:33476,56529:33486,56530:33444,56531:33505,56532:33545,56533:33527,56534:33508,56535:33551,56536:33543,56537:33500,56538:33524,56539:33490,56540:33496,56541:33548,56542:33531,56543:33491,56544:33553,56545:33562,56546:33542,56547:33556,56548:33557,56549:33504,56550:33493,56551:33564,56552:33617,56553:33627,56554:33628,56555:33544,56556:33682,56557:33596,56558:33588,56559:33585,56560:33691,56561:33630,56562:33583,56563:33615,56564:33607,56565:33603,56566:33631,56567:33600,56568:33559,56569:33632,56570:33581,56571:33594,56572:33587,56573:33638,56574:33637,56640:36581,56641:36582,56642:36583,56643:36584,56644:36585,56645:36586,56646:36587,56647:36588,56648:36589,56649:36590,56650:36591,56651:36592,56652:36593,56653:36594,56654:36595,56655:36596,56656:36597,56657:36598,56658:36599,56659:36600,56660:36601,56661:36602,56662:36603,56663:36604,56664:36605,56665:36606,56666:36607,56667:36608,56668:36609,56669:36610,56670:36611,56671:36612,56672:36613,56673:36614,56674:36615,56675:36616,56676:36617,56677:36618,56678:36619,56679:36620,56680:36621,56681:36622,56682:36623,56683:36624,56684:36625,56685:36626,56686:36627,56687:36628,56688:36629,56689:36630,56690:36631,56691:36632,56692:36633,56693:36634,56694:36635,56695:36636,56696:36637,56697:36638,56698:36639,56699:36640,56700:36641,56701:36642,56702:36643,56704:36644,56705:36645,56706:36646,56707:36647,56708:36648,56709:36649,56710:36650,56711:36651,56712:36652,56713:36653,56714:36654,56715:36655,56716:36656,56717:36657,56718:36658,56719:36659,56720:36660,56721:36661,56722:36662,56723:36663,56724:36664,56725:36665,56726:36666,56727:36667,56728:36668,56729:36669,56730:36670,56731:36671,56732:36672,56733:36673,56734:36674,56735:36675,56736:36676,56737:33640,56738:33563,56739:33641,56740:33644,56741:33642,56742:33645,56743:33646,56744:33712,56745:33656,56746:33715,56747:33716,56748:33696,56749:33706,56750:33683,56751:33692,56752:33669,56753:33660,56754:33718,56755:33705,56756:33661,56757:33720,56758:33659,56759:33688,56760:33694,56761:33704,56762:33722,56763:33724,56764:33729,56765:33793,56766:33765,56767:33752,56768:22535,56769:33816,56770:33803,56771:33757,56772:33789,56773:33750,56774:33820,56775:33848,56776:33809,56777:33798,56778:33748,56779:33759,56780:33807,56781:33795,56782:33784,56783:33785,56784:33770,56785:33733,56786:33728,56787:33830,56788:33776,56789:33761,56790:33884,56791:33873,56792:33882,56793:33881,56794:33907,56795:33927,56796:33928,56797:33914,56798:33929,56799:33912,56800:33852,56801:33862,56802:33897,56803:33910,56804:33932,56805:33934,56806:33841,56807:33901,56808:33985,56809:33997,56810:34000,56811:34022,56812:33981,56813:34003,56814:33994,56815:33983,56816:33978,56817:34016,56818:33953,56819:33977,56820:33972,56821:33943,56822:34021,56823:34019,56824:34060,56825:29965,56826:34104,56827:34032,56828:34105,56829:34079,56830:34106,56896:36677,56897:36678,56898:36679,56899:36680,56900:36681,56901:36682,56902:36683,56903:36684,56904:36685,56905:36686,56906:36687,56907:36688,56908:36689,56909:36690,56910:36691,56911:36692,56912:36693,56913:36694,56914:36695,56915:36696,56916:36697,56917:36698,56918:36699,56919:36700,56920:36701,56921:36702,56922:36703,56923:36704,56924:36705,56925:36706,56926:36707,56927:36708,56928:36709,56929:36714,56930:36736,56931:36748,56932:36754,56933:36765,56934:36768,56935:36769,56936:36770,56937:36772,56938:36773,56939:36774,56940:36775,56941:36778,56942:36780,56943:36781,56944:36782,56945:36783,56946:36786,56947:36787,56948:36788,56949:36789,56950:36791,56951:36792,56952:36794,56953:36795,56954:36796,56955:36799,56956:36800,56957:36803,56958:36806,56960:36809,56961:36810,56962:36811,56963:36812,56964:36813,56965:36815,56966:36818,56967:36822,56968:36823,56969:36826,56970:36832,56971:36833,56972:36835,56973:36839,56974:36844,56975:36847,56976:36849,56977:36850,56978:36852,56979:36853,56980:36854,56981:36858,56982:36859,56983:36860,56984:36862,56985:36863,56986:36871,56987:36872,56988:36876,56989:36878,56990:36883,56991:36885,56992:36888,56993:34134,56994:34107,56995:34047,56996:34044,56997:34137,56998:34120,56999:34152,57000:34148,57001:34142,57002:34170,57003:30626,57004:34115,57005:34162,57006:34171,57007:34212,57008:34216,57009:34183,57010:34191,57011:34169,57012:34222,57013:34204,57014:34181,57015:34233,57016:34231,57017:34224,57018:34259,57019:34241,57020:34268,57021:34303,57022:34343,57023:34309,57024:34345,57025:34326,57026:34364,57027:24318,57028:24328,57029:22844,57030:22849,57031:32823,57032:22869,57033:22874,57034:22872,57035:21263,57036:23586,57037:23589,57038:23596,57039:23604,57040:25164,57041:25194,57042:25247,57043:25275,57044:25290,57045:25306,57046:25303,57047:25326,57048:25378,57049:25334,57050:25401,57051:25419,57052:25411,57053:25517,57054:25590,57055:25457,57056:25466,57057:25486,57058:25524,57059:25453,57060:25516,57061:25482,57062:25449,57063:25518,57064:25532,57065:25586,57066:25592,57067:25568,57068:25599,57069:25540,57070:25566,57071:25550,57072:25682,57073:25542,57074:25534,57075:25669,57076:25665,57077:25611,57078:25627,57079:25632,57080:25612,57081:25638,57082:25633,57083:25694,57084:25732,57085:25709,57086:25750,57152:36889,57153:36892,57154:36899,57155:36900,57156:36901,57157:36903,57158:36904,57159:36905,57160:36906,57161:36907,57162:36908,57163:36912,57164:36913,57165:36914,57166:36915,57167:36916,57168:36919,57169:36921,57170:36922,57171:36925,57172:36927,57173:36928,57174:36931,57175:36933,57176:36934,57177:36936,57178:36937,57179:36938,57180:36939,57181:36940,57182:36942,57183:36948,57184:36949,57185:36950,57186:36953,57187:36954,57188:36956,57189:36957,57190:36958,57191:36959,57192:36960,57193:36961,57194:36964,57195:36966,57196:36967,57197:36969,57198:36970,57199:36971,57200:36972,57201:36975,57202:36976,57203:36977,57204:36978,57205:36979,57206:36982,57207:36983,57208:36984,57209:36985,57210:36986,57211:36987,57212:36988,57213:36990,57214:36993,57216:36996,57217:36997,57218:36998,57219:36999,57220:37001,57221:37002,57222:37004,57223:37005,57224:37006,57225:37007,57226:37008,57227:37010,57228:37012,57229:37014,57230:37016,57231:37018,57232:37020,57233:37022,57234:37023,57235:37024,57236:37028,57237:37029,57238:37031,57239:37032,57240:37033,57241:37035,57242:37037,57243:37042,57244:37047,57245:37052,57246:37053,57247:37055,57248:37056,57249:25722,57250:25783,57251:25784,57252:25753,57253:25786,57254:25792,57255:25808,57256:25815,57257:25828,57258:25826,57259:25865,57260:25893,57261:25902,57262:24331,57263:24530,57264:29977,57265:24337,57266:21343,57267:21489,57268:21501,57269:21481,57270:21480,57271:21499,57272:21522,57273:21526,57274:21510,57275:21579,57276:21586,57277:21587,57278:21588,57279:21590,57280:21571,57281:21537,57282:21591,57283:21593,57284:21539,57285:21554,57286:21634,57287:21652,57288:21623,57289:21617,57290:21604,57291:21658,57292:21659,57293:21636,57294:21622,57295:21606,57296:21661,57297:21712,57298:21677,57299:21698,57300:21684,57301:21714,57302:21671,57303:21670,57304:21715,57305:21716,57306:21618,57307:21667,57308:21717,57309:21691,57310:21695,57311:21708,57312:21721,57313:21722,57314:21724,57315:21673,57316:21674,57317:21668,57318:21725,57319:21711,57320:21726,57321:21787,57322:21735,57323:21792,57324:21757,57325:21780,57326:21747,57327:21794,57328:21795,57329:21775,57330:21777,57331:21799,57332:21802,57333:21863,57334:21903,57335:21941,57336:21833,57337:21869,57338:21825,57339:21845,57340:21823,57341:21840,57342:21820,57408:37058,57409:37059,57410:37062,57411:37064,57412:37065,57413:37067,57414:37068,57415:37069,57416:37074,57417:37076,57418:37077,57419:37078,57420:37080,57421:37081,57422:37082,57423:37086,57424:37087,57425:37088,57426:37091,57427:37092,57428:37093,57429:37097,57430:37098,57431:37100,57432:37102,57433:37104,57434:37105,57435:37106,57436:37107,57437:37109,57438:37110,57439:37111,57440:37113,57441:37114,57442:37115,57443:37116,57444:37119,57445:37120,57446:37121,57447:37123,57448:37125,57449:37126,57450:37127,57451:37128,57452:37129,57453:37130,57454:37131,57455:37132,57456:37133,57457:37134,57458:37135,57459:37136,57460:37137,57461:37138,57462:37139,57463:37140,57464:37141,57465:37142,57466:37143,57467:37144,57468:37146,57469:37147,57470:37148,57472:37149,57473:37151,57474:37152,57475:37153,57476:37156,57477:37157,57478:37158,57479:37159,57480:37160,57481:37161,57482:37162,57483:37163,57484:37164,57485:37165,57486:37166,57487:37168,57488:37170,57489:37171,57490:37172,57491:37173,57492:37174,57493:37175,57494:37176,57495:37178,57496:37179,57497:37180,57498:37181,57499:37182,57500:37183,57501:37184,57502:37185,57503:37186,57504:37188,57505:21815,57506:21846,57507:21877,57508:21878,57509:21879,57510:21811,57511:21808,57512:21852,57513:21899,57514:21970,57515:21891,57516:21937,57517:21945,57518:21896,57519:21889,57520:21919,57521:21886,57522:21974,57523:21905,57524:21883,57525:21983,57526:21949,57527:21950,57528:21908,57529:21913,57530:21994,57531:22007,57532:21961,57533:22047,57534:21969,57535:21995,57536:21996,57537:21972,57538:21990,57539:21981,57540:21956,57541:21999,57542:21989,57543:22002,57544:22003,57545:21964,57546:21965,57547:21992,57548:22005,57549:21988,57550:36756,57551:22046,57552:22024,57553:22028,57554:22017,57555:22052,57556:22051,57557:22014,57558:22016,57559:22055,57560:22061,57561:22104,57562:22073,57563:22103,57564:22060,57565:22093,57566:22114,57567:22105,57568:22108,57569:22092,57570:22100,57571:22150,57572:22116,57573:22129,57574:22123,57575:22139,57576:22140,57577:22149,57578:22163,57579:22191,57580:22228,57581:22231,57582:22237,57583:22241,57584:22261,57585:22251,57586:22265,57587:22271,57588:22276,57589:22282,57590:22281,57591:22300,57592:24079,57593:24089,57594:24084,57595:24081,57596:24113,57597:24123,57598:24124,57664:37189,57665:37191,57666:37192,57667:37201,57668:37203,57669:37204,57670:37205,57671:37206,57672:37208,57673:37209,57674:37211,57675:37212,57676:37215,57677:37216,57678:37222,57679:37223,57680:37224,57681:37227,57682:37229,57683:37235,57684:37242,57685:37243,57686:37244,57687:37248,57688:37249,57689:37250,57690:37251,57691:37252,57692:37254,57693:37256,57694:37258,57695:37262,57696:37263,57697:37267,57698:37268,57699:37269,57700:37270,57701:37271,57702:37272,57703:37273,57704:37276,57705:37277,57706:37278,57707:37279,57708:37280,57709:37281,57710:37284,57711:37285,57712:37286,57713:37287,57714:37288,57715:37289,57716:37291,57717:37292,57718:37296,57719:37297,57720:37298,57721:37299,57722:37302,57723:37303,57724:37304,57725:37305,57726:37307,57728:37308,57729:37309,57730:37310,57731:37311,57732:37312,57733:37313,57734:37314,57735:37315,57736:37316,57737:37317,57738:37318,57739:37320,57740:37323,57741:37328,57742:37330,57743:37331,57744:37332,57745:37333,57746:37334,57747:37335,57748:37336,57749:37337,57750:37338,57751:37339,57752:37341,57753:37342,57754:37343,57755:37344,57756:37345,57757:37346,57758:37347,57759:37348,57760:37349,57761:24119,57762:24132,57763:24148,57764:24155,57765:24158,57766:24161,57767:23692,57768:23674,57769:23693,57770:23696,57771:23702,57772:23688,57773:23704,57774:23705,57775:23697,57776:23706,57777:23708,57778:23733,57779:23714,57780:23741,57781:23724,57782:23723,57783:23729,57784:23715,57785:23745,57786:23735,57787:23748,57788:23762,57789:23780,57790:23755,57791:23781,57792:23810,57793:23811,57794:23847,57795:23846,57796:23854,57797:23844,57798:23838,57799:23814,57800:23835,57801:23896,57802:23870,57803:23860,57804:23869,57805:23916,57806:23899,57807:23919,57808:23901,57809:23915,57810:23883,57811:23882,57812:23913,57813:23924,57814:23938,57815:23961,57816:23965,57817:35955,57818:23991,57819:24005,57820:24435,57821:24439,57822:24450,57823:24455,57824:24457,57825:24460,57826:24469,57827:24473,57828:24476,57829:24488,57830:24493,57831:24501,57832:24508,57833:34914,57834:24417,57835:29357,57836:29360,57837:29364,57838:29367,57839:29368,57840:29379,57841:29377,57842:29390,57843:29389,57844:29394,57845:29416,57846:29423,57847:29417,57848:29426,57849:29428,57850:29431,57851:29441,57852:29427,57853:29443,57854:29434,57920:37350,57921:37351,57922:37352,57923:37353,57924:37354,57925:37355,57926:37356,57927:37357,57928:37358,57929:37359,57930:37360,57931:37361,57932:37362,57933:37363,57934:37364,57935:37365,57936:37366,57937:37367,57938:37368,57939:37369,57940:37370,57941:37371,57942:37372,57943:37373,57944:37374,57945:37375,57946:37376,57947:37377,57948:37378,57949:37379,57950:37380,57951:37381,57952:37382,57953:37383,57954:37384,57955:37385,57956:37386,57957:37387,57958:37388,57959:37389,57960:37390,57961:37391,57962:37392,57963:37393,57964:37394,57965:37395,57966:37396,57967:37397,57968:37398,57969:37399,57970:37400,57971:37401,57972:37402,57973:37403,57974:37404,57975:37405,57976:37406,57977:37407,57978:37408,57979:37409,57980:37410,57981:37411,57982:37412,57984:37413,57985:37414,57986:37415,57987:37416,57988:37417,57989:37418,57990:37419,57991:37420,57992:37421,57993:37422,57994:37423,57995:37424,57996:37425,57997:37426,57998:37427,57999:37428,58000:37429,58001:37430,58002:37431,58003:37432,58004:37433,58005:37434,58006:37435,58007:37436,58008:37437,58009:37438,58010:37439,58011:37440,58012:37441,58013:37442,58014:37443,58015:37444,58016:37445,58017:29435,58018:29463,58019:29459,58020:29473,58021:29450,58022:29470,58023:29469,58024:29461,58025:29474,58026:29497,58027:29477,58028:29484,58029:29496,58030:29489,58031:29520,58032:29517,58033:29527,58034:29536,58035:29548,58036:29551,58037:29566,58038:33307,58039:22821,58040:39143,58041:22820,58042:22786,58043:39267,58044:39271,58045:39272,58046:39273,58047:39274,58048:39275,58049:39276,58050:39284,58051:39287,58052:39293,58053:39296,58054:39300,58055:39303,58056:39306,58057:39309,58058:39312,58059:39313,58060:39315,58061:39316,58062:39317,58063:24192,58064:24209,58065:24203,58066:24214,58067:24229,58068:24224,58069:24249,58070:24245,58071:24254,58072:24243,58073:36179,58074:24274,58075:24273,58076:24283,58077:24296,58078:24298,58079:33210,58080:24516,58081:24521,58082:24534,58083:24527,58084:24579,58085:24558,58086:24580,58087:24545,58088:24548,58089:24574,58090:24581,58091:24582,58092:24554,58093:24557,58094:24568,58095:24601,58096:24629,58097:24614,58098:24603,58099:24591,58100:24589,58101:24617,58102:24619,58103:24586,58104:24639,58105:24609,58106:24696,58107:24697,58108:24699,58109:24698,58110:24642,58176:37446,58177:37447,58178:37448,58179:37449,58180:37450,58181:37451,58182:37452,58183:37453,58184:37454,58185:37455,58186:37456,58187:37457,58188:37458,58189:37459,58190:37460,58191:37461,58192:37462,58193:37463,58194:37464,58195:37465,58196:37466,58197:37467,58198:37468,58199:37469,58200:37470,58201:37471,58202:37472,58203:37473,58204:37474,58205:37475,58206:37476,58207:37477,58208:37478,58209:37479,58210:37480,58211:37481,58212:37482,58213:37483,58214:37484,58215:37485,58216:37486,58217:37487,58218:37488,58219:37489,58220:37490,58221:37491,58222:37493,58223:37494,58224:37495,58225:37496,58226:37497,58227:37498,58228:37499,58229:37500,58230:37501,58231:37502,58232:37503,58233:37504,58234:37505,58235:37506,58236:37507,58237:37508,58238:37509,58240:37510,58241:37511,58242:37512,58243:37513,58244:37514,58245:37515,58246:37516,58247:37517,58248:37519,58249:37520,58250:37521,58251:37522,58252:37523,58253:37524,58254:37525,58255:37526,58256:37527,58257:37528,58258:37529,58259:37530,58260:37531,58261:37532,58262:37533,58263:37534,58264:37535,58265:37536,58266:37537,58267:37538,58268:37539,58269:37540,58270:37541,58271:37542,58272:37543,58273:24682,58274:24701,58275:24726,58276:24730,58277:24749,58278:24733,58279:24707,58280:24722,58281:24716,58282:24731,58283:24812,58284:24763,58285:24753,58286:24797,58287:24792,58288:24774,58289:24794,58290:24756,58291:24864,58292:24870,58293:24853,58294:24867,58295:24820,58296:24832,58297:24846,58298:24875,58299:24906,58300:24949,58301:25004,58302:24980,58303:24999,58304:25015,58305:25044,58306:25077,58307:24541,58308:38579,58309:38377,58310:38379,58311:38385,58312:38387,58313:38389,58314:38390,58315:38396,58316:38398,58317:38403,58318:38404,58319:38406,58320:38408,58321:38410,58322:38411,58323:38412,58324:38413,58325:38415,58326:38418,58327:38421,58328:38422,58329:38423,58330:38425,58331:38426,58332:20012,58333:29247,58334:25109,58335:27701,58336:27732,58337:27740,58338:27722,58339:27811,58340:27781,58341:27792,58342:27796,58343:27788,58344:27752,58345:27753,58346:27764,58347:27766,58348:27782,58349:27817,58350:27856,58351:27860,58352:27821,58353:27895,58354:27896,58355:27889,58356:27863,58357:27826,58358:27872,58359:27862,58360:27898,58361:27883,58362:27886,58363:27825,58364:27859,58365:27887,58366:27902,58432:37544,58433:37545,58434:37546,58435:37547,58436:37548,58437:37549,58438:37551,58439:37552,58440:37553,58441:37554,58442:37555,58443:37556,58444:37557,58445:37558,58446:37559,58447:37560,58448:37561,58449:37562,58450:37563,58451:37564,58452:37565,58453:37566,58454:37567,58455:37568,58456:37569,58457:37570,58458:37571,58459:37572,58460:37573,58461:37574,58462:37575,58463:37577,58464:37578,58465:37579,58466:37580,58467:37581,58468:37582,58469:37583,58470:37584,58471:37585,58472:37586,58473:37587,58474:37588,58475:37589,58476:37590,58477:37591,58478:37592,58479:37593,58480:37594,58481:37595,58482:37596,58483:37597,58484:37598,58485:37599,58486:37600,58487:37601,58488:37602,58489:37603,58490:37604,58491:37605,58492:37606,58493:37607,58494:37608,58496:37609,58497:37610,58498:37611,58499:37612,58500:37613,58501:37614,58502:37615,58503:37616,58504:37617,58505:37618,58506:37619,58507:37620,58508:37621,58509:37622,58510:37623,58511:37624,58512:37625,58513:37626,58514:37627,58515:37628,58516:37629,58517:37630,58518:37631,58519:37632,58520:37633,58521:37634,58522:37635,58523:37636,58524:37637,58525:37638,58526:37639,58527:37640,58528:37641,58529:27961,58530:27943,58531:27916,58532:27971,58533:27976,58534:27911,58535:27908,58536:27929,58537:27918,58538:27947,58539:27981,58540:27950,58541:27957,58542:27930,58543:27983,58544:27986,58545:27988,58546:27955,58547:28049,58548:28015,58549:28062,58550:28064,58551:27998,58552:28051,58553:28052,58554:27996,58555:28000,58556:28028,58557:28003,58558:28186,58559:28103,58560:28101,58561:28126,58562:28174,58563:28095,58564:28128,58565:28177,58566:28134,58567:28125,58568:28121,58569:28182,58570:28075,58571:28172,58572:28078,58573:28203,58574:28270,58575:28238,58576:28267,58577:28338,58578:28255,58579:28294,58580:28243,58581:28244,58582:28210,58583:28197,58584:28228,58585:28383,58586:28337,58587:28312,58588:28384,58589:28461,58590:28386,58591:28325,58592:28327,58593:28349,58594:28347,58595:28343,58596:28375,58597:28340,58598:28367,58599:28303,58600:28354,58601:28319,58602:28514,58603:28486,58604:28487,58605:28452,58606:28437,58607:28409,58608:28463,58609:28470,58610:28491,58611:28532,58612:28458,58613:28425,58614:28457,58615:28553,58616:28557,58617:28556,58618:28536,58619:28530,58620:28540,58621:28538,58622:28625,58688:37642,58689:37643,58690:37644,58691:37645,58692:37646,58693:37647,58694:37648,58695:37649,58696:37650,58697:37651,58698:37652,58699:37653,58700:37654,58701:37655,58702:37656,58703:37657,58704:37658,58705:37659,58706:37660,58707:37661,58708:37662,58709:37663,58710:37664,58711:37665,58712:37666,58713:37667,58714:37668,58715:37669,58716:37670,58717:37671,58718:37672,58719:37673,58720:37674,58721:37675,58722:37676,58723:37677,58724:37678,58725:37679,58726:37680,58727:37681,58728:37682,58729:37683,58730:37684,58731:37685,58732:37686,58733:37687,58734:37688,58735:37689,58736:37690,58737:37691,58738:37692,58739:37693,58740:37695,58741:37696,58742:37697,58743:37698,58744:37699,58745:37700,58746:37701,58747:37702,58748:37703,58749:37704,58750:37705,58752:37706,58753:37707,58754:37708,58755:37709,58756:37710,58757:37711,58758:37712,58759:37713,58760:37714,58761:37715,58762:37716,58763:37717,58764:37718,58765:37719,58766:37720,58767:37721,58768:37722,58769:37723,58770:37724,58771:37725,58772:37726,58773:37727,58774:37728,58775:37729,58776:37730,58777:37731,58778:37732,58779:37733,58780:37734,58781:37735,58782:37736,58783:37737,58784:37739,58785:28617,58786:28583,58787:28601,58788:28598,58789:28610,58790:28641,58791:28654,58792:28638,58793:28640,58794:28655,58795:28698,58796:28707,58797:28699,58798:28729,58799:28725,58800:28751,58801:28766,58802:23424,58803:23428,58804:23445,58805:23443,58806:23461,58807:23480,58808:29999,58809:39582,58810:25652,58811:23524,58812:23534,58813:35120,58814:23536,58815:36423,58816:35591,58817:36790,58818:36819,58819:36821,58820:36837,58821:36846,58822:36836,58823:36841,58824:36838,58825:36851,58826:36840,58827:36869,58828:36868,58829:36875,58830:36902,58831:36881,58832:36877,58833:36886,58834:36897,58835:36917,58836:36918,58837:36909,58838:36911,58839:36932,58840:36945,58841:36946,58842:36944,58843:36968,58844:36952,58845:36962,58846:36955,58847:26297,58848:36980,58849:36989,58850:36994,58851:37000,58852:36995,58853:37003,58854:24400,58855:24407,58856:24406,58857:24408,58858:23611,58859:21675,58860:23632,58861:23641,58862:23409,58863:23651,58864:23654,58865:32700,58866:24362,58867:24361,58868:24365,58869:33396,58870:24380,58871:39739,58872:23662,58873:22913,58874:22915,58875:22925,58876:22953,58877:22954,58878:22947,58944:37740,58945:37741,58946:37742,58947:37743,58948:37744,58949:37745,58950:37746,58951:37747,58952:37748,58953:37749,58954:37750,58955:37751,58956:37752,58957:37753,58958:37754,58959:37755,58960:37756,58961:37757,58962:37758,58963:37759,58964:37760,58965:37761,58966:37762,58967:37763,58968:37764,58969:37765,58970:37766,58971:37767,58972:37768,58973:37769,58974:37770,58975:37771,58976:37772,58977:37773,58978:37774,58979:37776,58980:37777,58981:37778,58982:37779,58983:37780,58984:37781,58985:37782,58986:37783,58987:37784,58988:37785,58989:37786,58990:37787,58991:37788,58992:37789,58993:37790,58994:37791,58995:37792,58996:37793,58997:37794,58998:37795,58999:37796,59000:37797,59001:37798,59002:37799,59003:37800,59004:37801,59005:37802,59006:37803,59008:37804,59009:37805,59010:37806,59011:37807,59012:37808,59013:37809,59014:37810,59015:37811,59016:37812,59017:37813,59018:37814,59019:37815,59020:37816,59021:37817,59022:37818,59023:37819,59024:37820,59025:37821,59026:37822,59027:37823,59028:37824,59029:37825,59030:37826,59031:37827,59032:37828,59033:37829,59034:37830,59035:37831,59036:37832,59037:37833,59038:37835,59039:37836,59040:37837,59041:22935,59042:22986,59043:22955,59044:22942,59045:22948,59046:22994,59047:22962,59048:22959,59049:22999,59050:22974,59051:23045,59052:23046,59053:23005,59054:23048,59055:23011,59056:23000,59057:23033,59058:23052,59059:23049,59060:23090,59061:23092,59062:23057,59063:23075,59064:23059,59065:23104,59066:23143,59067:23114,59068:23125,59069:23100,59070:23138,59071:23157,59072:33004,59073:23210,59074:23195,59075:23159,59076:23162,59077:23230,59078:23275,59079:23218,59080:23250,59081:23252,59082:23224,59083:23264,59084:23267,59085:23281,59086:23254,59087:23270,59088:23256,59089:23260,59090:23305,59091:23319,59092:23318,59093:23346,59094:23351,59095:23360,59096:23573,59097:23580,59098:23386,59099:23397,59100:23411,59101:23377,59102:23379,59103:23394,59104:39541,59105:39543,59106:39544,59107:39546,59108:39551,59109:39549,59110:39552,59111:39553,59112:39557,59113:39560,59114:39562,59115:39568,59116:39570,59117:39571,59118:39574,59119:39576,59120:39579,59121:39580,59122:39581,59123:39583,59124:39584,59125:39586,59126:39587,59127:39589,59128:39591,59129:32415,59130:32417,59131:32419,59132:32421,59133:32424,59134:32425,59200:37838,59201:37839,59202:37840,59203:37841,59204:37842,59205:37843,59206:37844,59207:37845,59208:37847,59209:37848,59210:37849,59211:37850,59212:37851,59213:37852,59214:37853,59215:37854,59216:37855,59217:37856,59218:37857,59219:37858,59220:37859,59221:37860,59222:37861,59223:37862,59224:37863,59225:37864,59226:37865,59227:37866,59228:37867,59229:37868,59230:37869,59231:37870,59232:37871,59233:37872,59234:37873,59235:37874,59236:37875,59237:37876,59238:37877,59239:37878,59240:37879,59241:37880,59242:37881,59243:37882,59244:37883,59245:37884,59246:37885,59247:37886,59248:37887,59249:37888,59250:37889,59251:37890,59252:37891,59253:37892,59254:37893,59255:37894,59256:37895,59257:37896,59258:37897,59259:37898,59260:37899,59261:37900,59262:37901,59264:37902,59265:37903,59266:37904,59267:37905,59268:37906,59269:37907,59270:37908,59271:37909,59272:37910,59273:37911,59274:37912,59275:37913,59276:37914,59277:37915,59278:37916,59279:37917,59280:37918,59281:37919,59282:37920,59283:37921,59284:37922,59285:37923,59286:37924,59287:37925,59288:37926,59289:37927,59290:37928,59291:37929,59292:37930,59293:37931,59294:37932,59295:37933,59296:37934,59297:32429,59298:32432,59299:32446,59300:32448,59301:32449,59302:32450,59303:32457,59304:32459,59305:32460,59306:32464,59307:32468,59308:32471,59309:32475,59310:32480,59311:32481,59312:32488,59313:32491,59314:32494,59315:32495,59316:32497,59317:32498,59318:32525,59319:32502,59320:32506,59321:32507,59322:32510,59323:32513,59324:32514,59325:32515,59326:32519,59327:32520,59328:32523,59329:32524,59330:32527,59331:32529,59332:32530,59333:32535,59334:32537,59335:32540,59336:32539,59337:32543,59338:32545,59339:32546,59340:32547,59341:32548,59342:32549,59343:32550,59344:32551,59345:32554,59346:32555,59347:32556,59348:32557,59349:32559,59350:32560,59351:32561,59352:32562,59353:32563,59354:32565,59355:24186,59356:30079,59357:24027,59358:30014,59359:37013,59360:29582,59361:29585,59362:29614,59363:29602,59364:29599,59365:29647,59366:29634,59367:29649,59368:29623,59369:29619,59370:29632,59371:29641,59372:29640,59373:29669,59374:29657,59375:39036,59376:29706,59377:29673,59378:29671,59379:29662,59380:29626,59381:29682,59382:29711,59383:29738,59384:29787,59385:29734,59386:29733,59387:29736,59388:29744,59389:29742,59390:29740,59456:37935,59457:37936,59458:37937,59459:37938,59460:37939,59461:37940,59462:37941,59463:37942,59464:37943,59465:37944,59466:37945,59467:37946,59468:37947,59469:37948,59470:37949,59471:37951,59472:37952,59473:37953,59474:37954,59475:37955,59476:37956,59477:37957,59478:37958,59479:37959,59480:37960,59481:37961,59482:37962,59483:37963,59484:37964,59485:37965,59486:37966,59487:37967,59488:37968,59489:37969,59490:37970,59491:37971,59492:37972,59493:37973,59494:37974,59495:37975,59496:37976,59497:37977,59498:37978,59499:37979,59500:37980,59501:37981,59502:37982,59503:37983,59504:37984,59505:37985,59506:37986,59507:37987,59508:37988,59509:37989,59510:37990,59511:37991,59512:37992,59513:37993,59514:37994,59515:37996,59516:37997,59517:37998,59518:37999,59520:38000,59521:38001,59522:38002,59523:38003,59524:38004,59525:38005,59526:38006,59527:38007,59528:38008,59529:38009,59530:38010,59531:38011,59532:38012,59533:38013,59534:38014,59535:38015,59536:38016,59537:38017,59538:38018,59539:38019,59540:38020,59541:38033,59542:38038,59543:38040,59544:38087,59545:38095,59546:38099,59547:38100,59548:38106,59549:38118,59550:38139,59551:38172,59552:38176,59553:29723,59554:29722,59555:29761,59556:29788,59557:29783,59558:29781,59559:29785,59560:29815,59561:29805,59562:29822,59563:29852,59564:29838,59565:29824,59566:29825,59567:29831,59568:29835,59569:29854,59570:29864,59571:29865,59572:29840,59573:29863,59574:29906,59575:29882,59576:38890,59577:38891,59578:38892,59579:26444,59580:26451,59581:26462,59582:26440,59583:26473,59584:26533,59585:26503,59586:26474,59587:26483,59588:26520,59589:26535,59590:26485,59591:26536,59592:26526,59593:26541,59594:26507,59595:26487,59596:26492,59597:26608,59598:26633,59599:26584,59600:26634,59601:26601,59602:26544,59603:26636,59604:26585,59605:26549,59606:26586,59607:26547,59608:26589,59609:26624,59610:26563,59611:26552,59612:26594,59613:26638,59614:26561,59615:26621,59616:26674,59617:26675,59618:26720,59619:26721,59620:26702,59621:26722,59622:26692,59623:26724,59624:26755,59625:26653,59626:26709,59627:26726,59628:26689,59629:26727,59630:26688,59631:26686,59632:26698,59633:26697,59634:26665,59635:26805,59636:26767,59637:26740,59638:26743,59639:26771,59640:26731,59641:26818,59642:26990,59643:26876,59644:26911,59645:26912,59646:26873,59712:38183,59713:38195,59714:38205,59715:38211,59716:38216,59717:38219,59718:38229,59719:38234,59720:38240,59721:38254,59722:38260,59723:38261,59724:38263,59725:38264,59726:38265,59727:38266,59728:38267,59729:38268,59730:38269,59731:38270,59732:38272,59733:38273,59734:38274,59735:38275,59736:38276,59737:38277,59738:38278,59739:38279,59740:38280,59741:38281,59742:38282,59743:38283,59744:38284,59745:38285,59746:38286,59747:38287,59748:38288,59749:38289,59750:38290,59751:38291,59752:38292,59753:38293,59754:38294,59755:38295,59756:38296,59757:38297,59758:38298,59759:38299,59760:38300,59761:38301,59762:38302,59763:38303,59764:38304,59765:38305,59766:38306,59767:38307,59768:38308,59769:38309,59770:38310,59771:38311,59772:38312,59773:38313,59774:38314,59776:38315,59777:38316,59778:38317,59779:38318,59780:38319,59781:38320,59782:38321,59783:38322,59784:38323,59785:38324,59786:38325,59787:38326,59788:38327,59789:38328,59790:38329,59791:38330,59792:38331,59793:38332,59794:38333,59795:38334,59796:38335,59797:38336,59798:38337,59799:38338,59800:38339,59801:38340,59802:38341,59803:38342,59804:38343,59805:38344,59806:38345,59807:38346,59808:38347,59809:26916,59810:26864,59811:26891,59812:26881,59813:26967,59814:26851,59815:26896,59816:26993,59817:26937,59818:26976,59819:26946,59820:26973,59821:27012,59822:26987,59823:27008,59824:27032,59825:27000,59826:26932,59827:27084,59828:27015,59829:27016,59830:27086,59831:27017,59832:26982,59833:26979,59834:27001,59835:27035,59836:27047,59837:27067,59838:27051,59839:27053,59840:27092,59841:27057,59842:27073,59843:27082,59844:27103,59845:27029,59846:27104,59847:27021,59848:27135,59849:27183,59850:27117,59851:27159,59852:27160,59853:27237,59854:27122,59855:27204,59856:27198,59857:27296,59858:27216,59859:27227,59860:27189,59861:27278,59862:27257,59863:27197,59864:27176,59865:27224,59866:27260,59867:27281,59868:27280,59869:27305,59870:27287,59871:27307,59872:29495,59873:29522,59874:27521,59875:27522,59876:27527,59877:27524,59878:27538,59879:27539,59880:27533,59881:27546,59882:27547,59883:27553,59884:27562,59885:36715,59886:36717,59887:36721,59888:36722,59889:36723,59890:36725,59891:36726,59892:36728,59893:36727,59894:36729,59895:36730,59896:36732,59897:36734,59898:36737,59899:36738,59900:36740,59901:36743,59902:36747,59968:38348,59969:38349,59970:38350,59971:38351,59972:38352,59973:38353,59974:38354,59975:38355,59976:38356,59977:38357,59978:38358,59979:38359,59980:38360,59981:38361,59982:38362,59983:38363,59984:38364,59985:38365,59986:38366,59987:38367,59988:38368,59989:38369,59990:38370,59991:38371,59992:38372,59993:38373,59994:38374,59995:38375,59996:38380,59997:38399,59998:38407,59999:38419,60000:38424,60001:38427,60002:38430,60003:38432,60004:38435,60005:38436,60006:38437,60007:38438,60008:38439,60009:38440,60010:38441,60011:38443,60012:38444,60013:38445,60014:38447,60015:38448,60016:38455,60017:38456,60018:38457,60019:38458,60020:38462,60021:38465,60022:38467,60023:38474,60024:38478,60025:38479,60026:38481,60027:38482,60028:38483,60029:38486,60030:38487,60032:38488,60033:38489,60034:38490,60035:38492,60036:38493,60037:38494,60038:38496,60039:38499,60040:38501,60041:38502,60042:38507,60043:38509,60044:38510,60045:38511,60046:38512,60047:38513,60048:38515,60049:38520,60050:38521,60051:38522,60052:38523,60053:38524,60054:38525,60055:38526,60056:38527,60057:38528,60058:38529,60059:38530,60060:38531,60061:38532,60062:38535,60063:38537,60064:38538,60065:36749,60066:36750,60067:36751,60068:36760,60069:36762,60070:36558,60071:25099,60072:25111,60073:25115,60074:25119,60075:25122,60076:25121,60077:25125,60078:25124,60079:25132,60080:33255,60081:29935,60082:29940,60083:29951,60084:29967,60085:29969,60086:29971,60087:25908,60088:26094,60089:26095,60090:26096,60091:26122,60092:26137,60093:26482,60094:26115,60095:26133,60096:26112,60097:28805,60098:26359,60099:26141,60100:26164,60101:26161,60102:26166,60103:26165,60104:32774,60105:26207,60106:26196,60107:26177,60108:26191,60109:26198,60110:26209,60111:26199,60112:26231,60113:26244,60114:26252,60115:26279,60116:26269,60117:26302,60118:26331,60119:26332,60120:26342,60121:26345,60122:36146,60123:36147,60124:36150,60125:36155,60126:36157,60127:36160,60128:36165,60129:36166,60130:36168,60131:36169,60132:36167,60133:36173,60134:36181,60135:36185,60136:35271,60137:35274,60138:35275,60139:35276,60140:35278,60141:35279,60142:35280,60143:35281,60144:29294,60145:29343,60146:29277,60147:29286,60148:29295,60149:29310,60150:29311,60151:29316,60152:29323,60153:29325,60154:29327,60155:29330,60156:25352,60157:25394,60158:25520,60224:38540,60225:38542,60226:38545,60227:38546,60228:38547,60229:38549,60230:38550,60231:38554,60232:38555,60233:38557,60234:38558,60235:38559,60236:38560,60237:38561,60238:38562,60239:38563,60240:38564,60241:38565,60242:38566,60243:38568,60244:38569,60245:38570,60246:38571,60247:38572,60248:38573,60249:38574,60250:38575,60251:38577,60252:38578,60253:38580,60254:38581,60255:38583,60256:38584,60257:38586,60258:38587,60259:38591,60260:38594,60261:38595,60262:38600,60263:38602,60264:38603,60265:38608,60266:38609,60267:38611,60268:38612,60269:38614,60270:38615,60271:38616,60272:38617,60273:38618,60274:38619,60275:38620,60276:38621,60277:38622,60278:38623,60279:38625,60280:38626,60281:38627,60282:38628,60283:38629,60284:38630,60285:38631,60286:38635,60288:38636,60289:38637,60290:38638,60291:38640,60292:38641,60293:38642,60294:38644,60295:38645,60296:38648,60297:38650,60298:38651,60299:38652,60300:38653,60301:38655,60302:38658,60303:38659,60304:38661,60305:38666,60306:38667,60307:38668,60308:38672,60309:38673,60310:38674,60311:38676,60312:38677,60313:38679,60314:38680,60315:38681,60316:38682,60317:38683,60318:38685,60319:38687,60320:38688,60321:25663,60322:25816,60323:32772,60324:27626,60325:27635,60326:27645,60327:27637,60328:27641,60329:27653,60330:27655,60331:27654,60332:27661,60333:27669,60334:27672,60335:27673,60336:27674,60337:27681,60338:27689,60339:27684,60340:27690,60341:27698,60342:25909,60343:25941,60344:25963,60345:29261,60346:29266,60347:29270,60348:29232,60349:34402,60350:21014,60351:32927,60352:32924,60353:32915,60354:32956,60355:26378,60356:32957,60357:32945,60358:32939,60359:32941,60360:32948,60361:32951,60362:32999,60363:33000,60364:33001,60365:33002,60366:32987,60367:32962,60368:32964,60369:32985,60370:32973,60371:32983,60372:26384,60373:32989,60374:33003,60375:33009,60376:33012,60377:33005,60378:33037,60379:33038,60380:33010,60381:33020,60382:26389,60383:33042,60384:35930,60385:33078,60386:33054,60387:33068,60388:33048,60389:33074,60390:33096,60391:33100,60392:33107,60393:33140,60394:33113,60395:33114,60396:33137,60397:33120,60398:33129,60399:33148,60400:33149,60401:33133,60402:33127,60403:22605,60404:23221,60405:33160,60406:33154,60407:33169,60408:28373,60409:33187,60410:33194,60411:33228,60412:26406,60413:33226,60414:33211,60480:38689,60481:38690,60482:38691,60483:38692,60484:38693,60485:38694,60486:38695,60487:38696,60488:38697,60489:38699,60490:38700,60491:38702,60492:38703,60493:38705,60494:38707,60495:38708,60496:38709,60497:38710,60498:38711,60499:38714,60500:38715,60501:38716,60502:38717,60503:38719,60504:38720,60505:38721,60506:38722,60507:38723,60508:38724,60509:38725,60510:38726,60511:38727,60512:38728,60513:38729,60514:38730,60515:38731,60516:38732,60517:38733,60518:38734,60519:38735,60520:38736,60521:38737,60522:38740,60523:38741,60524:38743,60525:38744,60526:38746,60527:38748,60528:38749,60529:38751,60530:38755,60531:38756,60532:38758,60533:38759,60534:38760,60535:38762,60536:38763,60537:38764,60538:38765,60539:38766,60540:38767,60541:38768,60542:38769,60544:38770,60545:38773,60546:38775,60547:38776,60548:38777,60549:38778,60550:38779,60551:38781,60552:38782,60553:38783,60554:38784,60555:38785,60556:38786,60557:38787,60558:38788,60559:38790,60560:38791,60561:38792,60562:38793,60563:38794,60564:38796,60565:38798,60566:38799,60567:38800,60568:38803,60569:38805,60570:38806,60571:38807,60572:38809,60573:38810,60574:38811,60575:38812,60576:38813,60577:33217,60578:33190,60579:27428,60580:27447,60581:27449,60582:27459,60583:27462,60584:27481,60585:39121,60586:39122,60587:39123,60588:39125,60589:39129,60590:39130,60591:27571,60592:24384,60593:27586,60594:35315,60595:26000,60596:40785,60597:26003,60598:26044,60599:26054,60600:26052,60601:26051,60602:26060,60603:26062,60604:26066,60605:26070,60606:28800,60607:28828,60608:28822,60609:28829,60610:28859,60611:28864,60612:28855,60613:28843,60614:28849,60615:28904,60616:28874,60617:28944,60618:28947,60619:28950,60620:28975,60621:28977,60622:29043,60623:29020,60624:29032,60625:28997,60626:29042,60627:29002,60628:29048,60629:29050,60630:29080,60631:29107,60632:29109,60633:29096,60634:29088,60635:29152,60636:29140,60637:29159,60638:29177,60639:29213,60640:29224,60641:28780,60642:28952,60643:29030,60644:29113,60645:25150,60646:25149,60647:25155,60648:25160,60649:25161,60650:31035,60651:31040,60652:31046,60653:31049,60654:31067,60655:31068,60656:31059,60657:31066,60658:31074,60659:31063,60660:31072,60661:31087,60662:31079,60663:31098,60664:31109,60665:31114,60666:31130,60667:31143,60668:31155,60669:24529,60670:24528,60736:38814,60737:38815,60738:38817,60739:38818,60740:38820,60741:38821,60742:38822,60743:38823,60744:38824,60745:38825,60746:38826,60747:38828,60748:38830,60749:38832,60750:38833,60751:38835,60752:38837,60753:38838,60754:38839,60755:38840,60756:38841,60757:38842,60758:38843,60759:38844,60760:38845,60761:38846,60762:38847,60763:38848,60764:38849,60765:38850,60766:38851,60767:38852,60768:38853,60769:38854,60770:38855,60771:38856,60772:38857,60773:38858,60774:38859,60775:38860,60776:38861,60777:38862,60778:38863,60779:38864,60780:38865,60781:38866,60782:38867,60783:38868,60784:38869,60785:38870,60786:38871,60787:38872,60788:38873,60789:38874,60790:38875,60791:38876,60792:38877,60793:38878,60794:38879,60795:38880,60796:38881,60797:38882,60798:38883,60800:38884,60801:38885,60802:38888,60803:38894,60804:38895,60805:38896,60806:38897,60807:38898,60808:38900,60809:38903,60810:38904,60811:38905,60812:38906,60813:38907,60814:38908,60815:38909,60816:38910,60817:38911,60818:38912,60819:38913,60820:38914,60821:38915,60822:38916,60823:38917,60824:38918,60825:38919,60826:38920,60827:38921,60828:38922,60829:38923,60830:38924,60831:38925,60832:38926,60833:24636,60834:24669,60835:24666,60836:24679,60837:24641,60838:24665,60839:24675,60840:24747,60841:24838,60842:24845,60843:24925,60844:25001,60845:24989,60846:25035,60847:25041,60848:25094,60849:32896,60850:32895,60851:27795,60852:27894,60853:28156,60854:30710,60855:30712,60856:30720,60857:30729,60858:30743,60859:30744,60860:30737,60861:26027,60862:30765,60863:30748,60864:30749,60865:30777,60866:30778,60867:30779,60868:30751,60869:30780,60870:30757,60871:30764,60872:30755,60873:30761,60874:30798,60875:30829,60876:30806,60877:30807,60878:30758,60879:30800,60880:30791,60881:30796,60882:30826,60883:30875,60884:30867,60885:30874,60886:30855,60887:30876,60888:30881,60889:30883,60890:30898,60891:30905,60892:30885,60893:30932,60894:30937,60895:30921,60896:30956,60897:30962,60898:30981,60899:30964,60900:30995,60901:31012,60902:31006,60903:31028,60904:40859,60905:40697,60906:40699,60907:40700,60908:30449,60909:30468,60910:30477,60911:30457,60912:30471,60913:30472,60914:30490,60915:30498,60916:30489,60917:30509,60918:30502,60919:30517,60920:30520,60921:30544,60922:30545,60923:30535,60924:30531,60925:30554,60926:30568,60992:38927,60993:38928,60994:38929,60995:38930,60996:38931,60997:38932,60998:38933,60999:38934,61000:38935,61001:38936,61002:38937,61003:38938,61004:38939,61005:38940,61006:38941,61007:38942,61008:38943,61009:38944,61010:38945,61011:38946,61012:38947,61013:38948,61014:38949,61015:38950,61016:38951,61017:38952,61018:38953,61019:38954,61020:38955,61021:38956,61022:38957,61023:38958,61024:38959,61025:38960,61026:38961,61027:38962,61028:38963,61029:38964,61030:38965,61031:38966,61032:38967,61033:38968,61034:38969,61035:38970,61036:38971,61037:38972,61038:38973,61039:38974,61040:38975,61041:38976,61042:38977,61043:38978,61044:38979,61045:38980,61046:38981,61047:38982,61048:38983,61049:38984,61050:38985,61051:38986,61052:38987,61053:38988,61054:38989,61056:38990,61057:38991,61058:38992,61059:38993,61060:38994,61061:38995,61062:38996,61063:38997,61064:38998,61065:38999,61066:39000,61067:39001,61068:39002,61069:39003,61070:39004,61071:39005,61072:39006,61073:39007,61074:39008,61075:39009,61076:39010,61077:39011,61078:39012,61079:39013,61080:39014,61081:39015,61082:39016,61083:39017,61084:39018,61085:39019,61086:39020,61087:39021,61088:39022,61089:30562,61090:30565,61091:30591,61092:30605,61093:30589,61094:30592,61095:30604,61096:30609,61097:30623,61098:30624,61099:30640,61100:30645,61101:30653,61102:30010,61103:30016,61104:30030,61105:30027,61106:30024,61107:30043,61108:30066,61109:30073,61110:30083,61111:32600,61112:32609,61113:32607,61114:35400,61115:32616,61116:32628,61117:32625,61118:32633,61119:32641,61120:32638,61121:30413,61122:30437,61123:34866,61124:38021,61125:38022,61126:38023,61127:38027,61128:38026,61129:38028,61130:38029,61131:38031,61132:38032,61133:38036,61134:38039,61135:38037,61136:38042,61137:38043,61138:38044,61139:38051,61140:38052,61141:38059,61142:38058,61143:38061,61144:38060,61145:38063,61146:38064,61147:38066,61148:38068,61149:38070,61150:38071,61151:38072,61152:38073,61153:38074,61154:38076,61155:38077,61156:38079,61157:38084,61158:38088,61159:38089,61160:38090,61161:38091,61162:38092,61163:38093,61164:38094,61165:38096,61166:38097,61167:38098,61168:38101,61169:38102,61170:38103,61171:38105,61172:38104,61173:38107,61174:38110,61175:38111,61176:38112,61177:38114,61178:38116,61179:38117,61180:38119,61181:38120,61182:38122,61248:39023,61249:39024,61250:39025,61251:39026,61252:39027,61253:39028,61254:39051,61255:39054,61256:39058,61257:39061,61258:39065,61259:39075,61260:39080,61261:39081,61262:39082,61263:39083,61264:39084,61265:39085,61266:39086,61267:39087,61268:39088,61269:39089,61270:39090,61271:39091,61272:39092,61273:39093,61274:39094,61275:39095,61276:39096,61277:39097,61278:39098,61279:39099,61280:39100,61281:39101,61282:39102,61283:39103,61284:39104,61285:39105,61286:39106,61287:39107,61288:39108,61289:39109,61290:39110,61291:39111,61292:39112,61293:39113,61294:39114,61295:39115,61296:39116,61297:39117,61298:39119,61299:39120,61300:39124,61301:39126,61302:39127,61303:39131,61304:39132,61305:39133,61306:39136,61307:39137,61308:39138,61309:39139,61310:39140,61312:39141,61313:39142,61314:39145,61315:39146,61316:39147,61317:39148,61318:39149,61319:39150,61320:39151,61321:39152,61322:39153,61323:39154,61324:39155,61325:39156,61326:39157,61327:39158,61328:39159,61329:39160,61330:39161,61331:39162,61332:39163,61333:39164,61334:39165,61335:39166,61336:39167,61337:39168,61338:39169,61339:39170,61340:39171,61341:39172,61342:39173,61343:39174,61344:39175,61345:38121,61346:38123,61347:38126,61348:38127,61349:38131,61350:38132,61351:38133,61352:38135,61353:38137,61354:38140,61355:38141,61356:38143,61357:38147,61358:38146,61359:38150,61360:38151,61361:38153,61362:38154,61363:38157,61364:38158,61365:38159,61366:38162,61367:38163,61368:38164,61369:38165,61370:38166,61371:38168,61372:38171,61373:38173,61374:38174,61375:38175,61376:38178,61377:38186,61378:38187,61379:38185,61380:38188,61381:38193,61382:38194,61383:38196,61384:38198,61385:38199,61386:38200,61387:38204,61388:38206,61389:38207,61390:38210,61391:38197,61392:38212,61393:38213,61394:38214,61395:38217,61396:38220,61397:38222,61398:38223,61399:38226,61400:38227,61401:38228,61402:38230,61403:38231,61404:38232,61405:38233,61406:38235,61407:38238,61408:38239,61409:38237,61410:38241,61411:38242,61412:38244,61413:38245,61414:38246,61415:38247,61416:38248,61417:38249,61418:38250,61419:38251,61420:38252,61421:38255,61422:38257,61423:38258,61424:38259,61425:38202,61426:30695,61427:30700,61428:38601,61429:31189,61430:31213,61431:31203,61432:31211,61433:31238,61434:23879,61435:31235,61436:31234,61437:31262,61438:31252,61504:39176,61505:39177,61506:39178,61507:39179,61508:39180,61509:39182,61510:39183,61511:39185,61512:39186,61513:39187,61514:39188,61515:39189,61516:39190,61517:39191,61518:39192,61519:39193,61520:39194,61521:39195,61522:39196,61523:39197,61524:39198,61525:39199,61526:39200,61527:39201,61528:39202,61529:39203,61530:39204,61531:39205,61532:39206,61533:39207,61534:39208,61535:39209,61536:39210,61537:39211,61538:39212,61539:39213,61540:39215,61541:39216,61542:39217,61543:39218,61544:39219,61545:39220,61546:39221,61547:39222,61548:39223,61549:39224,61550:39225,61551:39226,61552:39227,61553:39228,61554:39229,61555:39230,61556:39231,61557:39232,61558:39233,61559:39234,61560:39235,61561:39236,61562:39237,61563:39238,61564:39239,61565:39240,61566:39241,61568:39242,61569:39243,61570:39244,61571:39245,61572:39246,61573:39247,61574:39248,61575:39249,61576:39250,61577:39251,61578:39254,61579:39255,61580:39256,61581:39257,61582:39258,61583:39259,61584:39260,61585:39261,61586:39262,61587:39263,61588:39264,61589:39265,61590:39266,61591:39268,61592:39270,61593:39283,61594:39288,61595:39289,61596:39291,61597:39294,61598:39298,61599:39299,61600:39305,61601:31289,61602:31287,61603:31313,61604:40655,61605:39333,61606:31344,61607:30344,61608:30350,61609:30355,61610:30361,61611:30372,61612:29918,61613:29920,61614:29996,61615:40480,61616:40482,61617:40488,61618:40489,61619:40490,61620:40491,61621:40492,61622:40498,61623:40497,61624:40502,61625:40504,61626:40503,61627:40505,61628:40506,61629:40510,61630:40513,61631:40514,61632:40516,61633:40518,61634:40519,61635:40520,61636:40521,61637:40523,61638:40524,61639:40526,61640:40529,61641:40533,61642:40535,61643:40538,61644:40539,61645:40540,61646:40542,61647:40547,61648:40550,61649:40551,61650:40552,61651:40553,61652:40554,61653:40555,61654:40556,61655:40561,61656:40557,61657:40563,61658:30098,61659:30100,61660:30102,61661:30112,61662:30109,61663:30124,61664:30115,61665:30131,61666:30132,61667:30136,61668:30148,61669:30129,61670:30128,61671:30147,61672:30146,61673:30166,61674:30157,61675:30179,61676:30184,61677:30182,61678:30180,61679:30187,61680:30183,61681:30211,61682:30193,61683:30204,61684:30207,61685:30224,61686:30208,61687:30213,61688:30220,61689:30231,61690:30218,61691:30245,61692:30232,61693:30229,61694:30233,61760:39308,61761:39310,61762:39322,61763:39323,61764:39324,61765:39325,61766:39326,61767:39327,61768:39328,61769:39329,61770:39330,61771:39331,61772:39332,61773:39334,61774:39335,61775:39337,61776:39338,61777:39339,61778:39340,61779:39341,61780:39342,61781:39343,61782:39344,61783:39345,61784:39346,61785:39347,61786:39348,61787:39349,61788:39350,61789:39351,61790:39352,61791:39353,61792:39354,61793:39355,61794:39356,61795:39357,61796:39358,61797:39359,61798:39360,61799:39361,61800:39362,61801:39363,61802:39364,61803:39365,61804:39366,61805:39367,61806:39368,61807:39369,61808:39370,61809:39371,61810:39372,61811:39373,61812:39374,61813:39375,61814:39376,61815:39377,61816:39378,61817:39379,61818:39380,61819:39381,61820:39382,61821:39383,61822:39384,61824:39385,61825:39386,61826:39387,61827:39388,61828:39389,61829:39390,61830:39391,61831:39392,61832:39393,61833:39394,61834:39395,61835:39396,61836:39397,61837:39398,61838:39399,61839:39400,61840:39401,61841:39402,61842:39403,61843:39404,61844:39405,61845:39406,61846:39407,61847:39408,61848:39409,61849:39410,61850:39411,61851:39412,61852:39413,61853:39414,61854:39415,61855:39416,61856:39417,61857:30235,61858:30268,61859:30242,61860:30240,61861:30272,61862:30253,61863:30256,61864:30271,61865:30261,61866:30275,61867:30270,61868:30259,61869:30285,61870:30302,61871:30292,61872:30300,61873:30294,61874:30315,61875:30319,61876:32714,61877:31462,61878:31352,61879:31353,61880:31360,61881:31366,61882:31368,61883:31381,61884:31398,61885:31392,61886:31404,61887:31400,61888:31405,61889:31411,61890:34916,61891:34921,61892:34930,61893:34941,61894:34943,61895:34946,61896:34978,61897:35014,61898:34999,61899:35004,61900:35017,61901:35042,61902:35022,61903:35043,61904:35045,61905:35057,61906:35098,61907:35068,61908:35048,61909:35070,61910:35056,61911:35105,61912:35097,61913:35091,61914:35099,61915:35082,61916:35124,61917:35115,61918:35126,61919:35137,61920:35174,61921:35195,61922:30091,61923:32997,61924:30386,61925:30388,61926:30684,61927:32786,61928:32788,61929:32790,61930:32796,61931:32800,61932:32802,61933:32805,61934:32806,61935:32807,61936:32809,61937:32808,61938:32817,61939:32779,61940:32821,61941:32835,61942:32838,61943:32845,61944:32850,61945:32873,61946:32881,61947:35203,61948:39032,61949:39040,61950:39043,62016:39418,62017:39419,62018:39420,62019:39421,62020:39422,62021:39423,62022:39424,62023:39425,62024:39426,62025:39427,62026:39428,62027:39429,62028:39430,62029:39431,62030:39432,62031:39433,62032:39434,62033:39435,62034:39436,62035:39437,62036:39438,62037:39439,62038:39440,62039:39441,62040:39442,62041:39443,62042:39444,62043:39445,62044:39446,62045:39447,62046:39448,62047:39449,62048:39450,62049:39451,62050:39452,62051:39453,62052:39454,62053:39455,62054:39456,62055:39457,62056:39458,62057:39459,62058:39460,62059:39461,62060:39462,62061:39463,62062:39464,62063:39465,62064:39466,62065:39467,62066:39468,62067:39469,62068:39470,62069:39471,62070:39472,62071:39473,62072:39474,62073:39475,62074:39476,62075:39477,62076:39478,62077:39479,62078:39480,62080:39481,62081:39482,62082:39483,62083:39484,62084:39485,62085:39486,62086:39487,62087:39488,62088:39489,62089:39490,62090:39491,62091:39492,62092:39493,62093:39494,62094:39495,62095:39496,62096:39497,62097:39498,62098:39499,62099:39500,62100:39501,62101:39502,62102:39503,62103:39504,62104:39505,62105:39506,62106:39507,62107:39508,62108:39509,62109:39510,62110:39511,62111:39512,62112:39513,62113:39049,62114:39052,62115:39053,62116:39055,62117:39060,62118:39066,62119:39067,62120:39070,62121:39071,62122:39073,62123:39074,62124:39077,62125:39078,62126:34381,62127:34388,62128:34412,62129:34414,62130:34431,62131:34426,62132:34428,62133:34427,62134:34472,62135:34445,62136:34443,62137:34476,62138:34461,62139:34471,62140:34467,62141:34474,62142:34451,62143:34473,62144:34486,62145:34500,62146:34485,62147:34510,62148:34480,62149:34490,62150:34481,62151:34479,62152:34505,62153:34511,62154:34484,62155:34537,62156:34545,62157:34546,62158:34541,62159:34547,62160:34512,62161:34579,62162:34526,62163:34548,62164:34527,62165:34520,62166:34513,62167:34563,62168:34567,62169:34552,62170:34568,62171:34570,62172:34573,62173:34569,62174:34595,62175:34619,62176:34590,62177:34597,62178:34606,62179:34586,62180:34622,62181:34632,62182:34612,62183:34609,62184:34601,62185:34615,62186:34623,62187:34690,62188:34594,62189:34685,62190:34686,62191:34683,62192:34656,62193:34672,62194:34636,62195:34670,62196:34699,62197:34643,62198:34659,62199:34684,62200:34660,62201:34649,62202:34661,62203:34707,62204:34735,62205:34728,62206:34770,62272:39514,62273:39515,62274:39516,62275:39517,62276:39518,62277:39519,62278:39520,62279:39521,62280:39522,62281:39523,62282:39524,62283:39525,62284:39526,62285:39527,62286:39528,62287:39529,62288:39530,62289:39531,62290:39538,62291:39555,62292:39561,62293:39565,62294:39566,62295:39572,62296:39573,62297:39577,62298:39590,62299:39593,62300:39594,62301:39595,62302:39596,62303:39597,62304:39598,62305:39599,62306:39602,62307:39603,62308:39604,62309:39605,62310:39609,62311:39611,62312:39613,62313:39614,62314:39615,62315:39619,62316:39620,62317:39622,62318:39623,62319:39624,62320:39625,62321:39626,62322:39629,62323:39630,62324:39631,62325:39632,62326:39634,62327:39636,62328:39637,62329:39638,62330:39639,62331:39641,62332:39642,62333:39643,62334:39644,62336:39645,62337:39646,62338:39648,62339:39650,62340:39651,62341:39652,62342:39653,62343:39655,62344:39656,62345:39657,62346:39658,62347:39660,62348:39662,62349:39664,62350:39665,62351:39666,62352:39667,62353:39668,62354:39669,62355:39670,62356:39671,62357:39672,62358:39674,62359:39676,62360:39677,62361:39678,62362:39679,62363:39680,62364:39681,62365:39682,62366:39684,62367:39685,62368:39686,62369:34758,62370:34696,62371:34693,62372:34733,62373:34711,62374:34691,62375:34731,62376:34789,62377:34732,62378:34741,62379:34739,62380:34763,62381:34771,62382:34749,62383:34769,62384:34752,62385:34762,62386:34779,62387:34794,62388:34784,62389:34798,62390:34838,62391:34835,62392:34814,62393:34826,62394:34843,62395:34849,62396:34873,62397:34876,62398:32566,62399:32578,62400:32580,62401:32581,62402:33296,62403:31482,62404:31485,62405:31496,62406:31491,62407:31492,62408:31509,62409:31498,62410:31531,62411:31503,62412:31559,62413:31544,62414:31530,62415:31513,62416:31534,62417:31537,62418:31520,62419:31525,62420:31524,62421:31539,62422:31550,62423:31518,62424:31576,62425:31578,62426:31557,62427:31605,62428:31564,62429:31581,62430:31584,62431:31598,62432:31611,62433:31586,62434:31602,62435:31601,62436:31632,62437:31654,62438:31655,62439:31672,62440:31660,62441:31645,62442:31656,62443:31621,62444:31658,62445:31644,62446:31650,62447:31659,62448:31668,62449:31697,62450:31681,62451:31692,62452:31709,62453:31706,62454:31717,62455:31718,62456:31722,62457:31756,62458:31742,62459:31740,62460:31759,62461:31766,62462:31755,62528:39687,62529:39689,62530:39690,62531:39691,62532:39692,62533:39693,62534:39694,62535:39696,62536:39697,62537:39698,62538:39700,62539:39701,62540:39702,62541:39703,62542:39704,62543:39705,62544:39706,62545:39707,62546:39708,62547:39709,62548:39710,62549:39712,62550:39713,62551:39714,62552:39716,62553:39717,62554:39718,62555:39719,62556:39720,62557:39721,62558:39722,62559:39723,62560:39724,62561:39725,62562:39726,62563:39728,62564:39729,62565:39731,62566:39732,62567:39733,62568:39734,62569:39735,62570:39736,62571:39737,62572:39738,62573:39741,62574:39742,62575:39743,62576:39744,62577:39750,62578:39754,62579:39755,62580:39756,62581:39758,62582:39760,62583:39762,62584:39763,62585:39765,62586:39766,62587:39767,62588:39768,62589:39769,62590:39770,62592:39771,62593:39772,62594:39773,62595:39774,62596:39775,62597:39776,62598:39777,62599:39778,62600:39779,62601:39780,62602:39781,62603:39782,62604:39783,62605:39784,62606:39785,62607:39786,62608:39787,62609:39788,62610:39789,62611:39790,62612:39791,62613:39792,62614:39793,62615:39794,62616:39795,62617:39796,62618:39797,62619:39798,62620:39799,62621:39800,62622:39801,62623:39802,62624:39803,62625:31775,62626:31786,62627:31782,62628:31800,62629:31809,62630:31808,62631:33278,62632:33281,62633:33282,62634:33284,62635:33260,62636:34884,62637:33313,62638:33314,62639:33315,62640:33325,62641:33327,62642:33320,62643:33323,62644:33336,62645:33339,62646:33331,62647:33332,62648:33342,62649:33348,62650:33353,62651:33355,62652:33359,62653:33370,62654:33375,62655:33384,62656:34942,62657:34949,62658:34952,62659:35032,62660:35039,62661:35166,62662:32669,62663:32671,62664:32679,62665:32687,62666:32688,62667:32690,62668:31868,62669:25929,62670:31889,62671:31901,62672:31900,62673:31902,62674:31906,62675:31922,62676:31932,62677:31933,62678:31937,62679:31943,62680:31948,62681:31949,62682:31944,62683:31941,62684:31959,62685:31976,62686:33390,62687:26280,62688:32703,62689:32718,62690:32725,62691:32741,62692:32737,62693:32742,62694:32745,62695:32750,62696:32755,62697:31992,62698:32119,62699:32166,62700:32174,62701:32327,62702:32411,62703:40632,62704:40628,62705:36211,62706:36228,62707:36244,62708:36241,62709:36273,62710:36199,62711:36205,62712:35911,62713:35913,62714:37194,62715:37200,62716:37198,62717:37199,62718:37220,62784:39804,62785:39805,62786:39806,62787:39807,62788:39808,62789:39809,62790:39810,62791:39811,62792:39812,62793:39813,62794:39814,62795:39815,62796:39816,62797:39817,62798:39818,62799:39819,62800:39820,62801:39821,62802:39822,62803:39823,62804:39824,62805:39825,62806:39826,62807:39827,62808:39828,62809:39829,62810:39830,62811:39831,62812:39832,62813:39833,62814:39834,62815:39835,62816:39836,62817:39837,62818:39838,62819:39839,62820:39840,62821:39841,62822:39842,62823:39843,62824:39844,62825:39845,62826:39846,62827:39847,62828:39848,62829:39849,62830:39850,62831:39851,62832:39852,62833:39853,62834:39854,62835:39855,62836:39856,62837:39857,62838:39858,62839:39859,62840:39860,62841:39861,62842:39862,62843:39863,62844:39864,62845:39865,62846:39866,62848:39867,62849:39868,62850:39869,62851:39870,62852:39871,62853:39872,62854:39873,62855:39874,62856:39875,62857:39876,62858:39877,62859:39878,62860:39879,62861:39880,62862:39881,62863:39882,62864:39883,62865:39884,62866:39885,62867:39886,62868:39887,62869:39888,62870:39889,62871:39890,62872:39891,62873:39892,62874:39893,62875:39894,62876:39895,62877:39896,62878:39897,62879:39898,62880:39899,62881:37218,62882:37217,62883:37232,62884:37225,62885:37231,62886:37245,62887:37246,62888:37234,62889:37236,62890:37241,62891:37260,62892:37253,62893:37264,62894:37261,62895:37265,62896:37282,62897:37283,62898:37290,62899:37293,62900:37294,62901:37295,62902:37301,62903:37300,62904:37306,62905:35925,62906:40574,62907:36280,62908:36331,62909:36357,62910:36441,62911:36457,62912:36277,62913:36287,62914:36284,62915:36282,62916:36292,62917:36310,62918:36311,62919:36314,62920:36318,62921:36302,62922:36303,62923:36315,62924:36294,62925:36332,62926:36343,62927:36344,62928:36323,62929:36345,62930:36347,62931:36324,62932:36361,62933:36349,62934:36372,62935:36381,62936:36383,62937:36396,62938:36398,62939:36387,62940:36399,62941:36410,62942:36416,62943:36409,62944:36405,62945:36413,62946:36401,62947:36425,62948:36417,62949:36418,62950:36433,62951:36434,62952:36426,62953:36464,62954:36470,62955:36476,62956:36463,62957:36468,62958:36485,62959:36495,62960:36500,62961:36496,62962:36508,62963:36510,62964:35960,62965:35970,62966:35978,62967:35973,62968:35992,62969:35988,62970:26011,62971:35286,62972:35294,62973:35290,62974:35292,63040:39900,63041:39901,63042:39902,63043:39903,63044:39904,63045:39905,63046:39906,63047:39907,63048:39908,63049:39909,63050:39910,63051:39911,63052:39912,63053:39913,63054:39914,63055:39915,63056:39916,63057:39917,63058:39918,63059:39919,63060:39920,63061:39921,63062:39922,63063:39923,63064:39924,63065:39925,63066:39926,63067:39927,63068:39928,63069:39929,63070:39930,63071:39931,63072:39932,63073:39933,63074:39934,63075:39935,63076:39936,63077:39937,63078:39938,63079:39939,63080:39940,63081:39941,63082:39942,63083:39943,63084:39944,63085:39945,63086:39946,63087:39947,63088:39948,63089:39949,63090:39950,63091:39951,63092:39952,63093:39953,63094:39954,63095:39955,63096:39956,63097:39957,63098:39958,63099:39959,63100:39960,63101:39961,63102:39962,63104:39963,63105:39964,63106:39965,63107:39966,63108:39967,63109:39968,63110:39969,63111:39970,63112:39971,63113:39972,63114:39973,63115:39974,63116:39975,63117:39976,63118:39977,63119:39978,63120:39979,63121:39980,63122:39981,63123:39982,63124:39983,63125:39984,63126:39985,63127:39986,63128:39987,63129:39988,63130:39989,63131:39990,63132:39991,63133:39992,63134:39993,63135:39994,63136:39995,63137:35301,63138:35307,63139:35311,63140:35390,63141:35622,63142:38739,63143:38633,63144:38643,63145:38639,63146:38662,63147:38657,63148:38664,63149:38671,63150:38670,63151:38698,63152:38701,63153:38704,63154:38718,63155:40832,63156:40835,63157:40837,63158:40838,63159:40839,63160:40840,63161:40841,63162:40842,63163:40844,63164:40702,63165:40715,63166:40717,63167:38585,63168:38588,63169:38589,63170:38606,63171:38610,63172:30655,63173:38624,63174:37518,63175:37550,63176:37576,63177:37694,63178:37738,63179:37834,63180:37775,63181:37950,63182:37995,63183:40063,63184:40066,63185:40069,63186:40070,63187:40071,63188:40072,63189:31267,63190:40075,63191:40078,63192:40080,63193:40081,63194:40082,63195:40084,63196:40085,63197:40090,63198:40091,63199:40094,63200:40095,63201:40096,63202:40097,63203:40098,63204:40099,63205:40101,63206:40102,63207:40103,63208:40104,63209:40105,63210:40107,63211:40109,63212:40110,63213:40112,63214:40113,63215:40114,63216:40115,63217:40116,63218:40117,63219:40118,63220:40119,63221:40122,63222:40123,63223:40124,63224:40125,63225:40132,63226:40133,63227:40134,63228:40135,63229:40138,63230:40139,63296:39996,63297:39997,63298:39998,63299:39999,63300:40000,63301:40001,63302:40002,63303:40003,63304:40004,63305:40005,63306:40006,63307:40007,63308:40008,63309:40009,63310:40010,63311:40011,63312:40012,63313:40013,63314:40014,63315:40015,63316:40016,63317:40017,63318:40018,63319:40019,63320:40020,63321:40021,63322:40022,63323:40023,63324:40024,63325:40025,63326:40026,63327:40027,63328:40028,63329:40029,63330:40030,63331:40031,63332:40032,63333:40033,63334:40034,63335:40035,63336:40036,63337:40037,63338:40038,63339:40039,63340:40040,63341:40041,63342:40042,63343:40043,63344:40044,63345:40045,63346:40046,63347:40047,63348:40048,63349:40049,63350:40050,63351:40051,63352:40052,63353:40053,63354:40054,63355:40055,63356:40056,63357:40057,63358:40058,63360:40059,63361:40061,63362:40062,63363:40064,63364:40067,63365:40068,63366:40073,63367:40074,63368:40076,63369:40079,63370:40083,63371:40086,63372:40087,63373:40088,63374:40089,63375:40093,63376:40106,63377:40108,63378:40111,63379:40121,63380:40126,63381:40127,63382:40128,63383:40129,63384:40130,63385:40136,63386:40137,63387:40145,63388:40146,63389:40154,63390:40155,63391:40160,63392:40161,63393:40140,63394:40141,63395:40142,63396:40143,63397:40144,63398:40147,63399:40148,63400:40149,63401:40151,63402:40152,63403:40153,63404:40156,63405:40157,63406:40159,63407:40162,63408:38780,63409:38789,63410:38801,63411:38802,63412:38804,63413:38831,63414:38827,63415:38819,63416:38834,63417:38836,63418:39601,63419:39600,63420:39607,63421:40536,63422:39606,63423:39610,63424:39612,63425:39617,63426:39616,63427:39621,63428:39618,63429:39627,63430:39628,63431:39633,63432:39749,63433:39747,63434:39751,63435:39753,63436:39752,63437:39757,63438:39761,63439:39144,63440:39181,63441:39214,63442:39253,63443:39252,63444:39647,63445:39649,63446:39654,63447:39663,63448:39659,63449:39675,63450:39661,63451:39673,63452:39688,63453:39695,63454:39699,63455:39711,63456:39715,63457:40637,63458:40638,63459:32315,63460:40578,63461:40583,63462:40584,63463:40587,63464:40594,63465:37846,63466:40605,63467:40607,63468:40667,63469:40668,63470:40669,63471:40672,63472:40671,63473:40674,63474:40681,63475:40679,63476:40677,63477:40682,63478:40687,63479:40738,63480:40748,63481:40751,63482:40761,63483:40759,63484:40765,63485:40766,63486:40772,63552:40163,63553:40164,63554:40165,63555:40166,63556:40167,63557:40168,63558:40169,63559:40170,63560:40171,63561:40172,63562:40173,63563:40174,63564:40175,63565:40176,63566:40177,63567:40178,63568:40179,63569:40180,63570:40181,63571:40182,63572:40183,63573:40184,63574:40185,63575:40186,63576:40187,63577:40188,63578:40189,63579:40190,63580:40191,63581:40192,63582:40193,63583:40194,63584:40195,63585:40196,63586:40197,63587:40198,63588:40199,63589:40200,63590:40201,63591:40202,63592:40203,63593:40204,63594:40205,63595:40206,63596:40207,63597:40208,63598:40209,63599:40210,63600:40211,63601:40212,63602:40213,63603:40214,63604:40215,63605:40216,63606:40217,63607:40218,63608:40219,63609:40220,63610:40221,63611:40222,63612:40223,63613:40224,63614:40225,63616:40226,63617:40227,63618:40228,63619:40229,63620:40230,63621:40231,63622:40232,63623:40233,63624:40234,63625:40235,63626:40236,63627:40237,63628:40238,63629:40239,63630:40240,63631:40241,63632:40242,63633:40243,63634:40244,63635:40245,63636:40246,63637:40247,63638:40248,63639:40249,63640:40250,63641:40251,63642:40252,63643:40253,63644:40254,63645:40255,63646:40256,63647:40257,63648:40258,63649:57908,63650:57909,63651:57910,63652:57911,63653:57912,63654:57913,63655:57914,63656:57915,63657:57916,63658:57917,63659:57918,63660:57919,63661:57920,63662:57921,63663:57922,63664:57923,63665:57924,63666:57925,63667:57926,63668:57927,63669:57928,63670:57929,63671:57930,63672:57931,63673:57932,63674:57933,63675:57934,63676:57935,63677:57936,63678:57937,63679:57938,63680:57939,63681:57940,63682:57941,63683:57942,63684:57943,63685:57944,63686:57945,63687:57946,63688:57947,63689:57948,63690:57949,63691:57950,63692:57951,63693:57952,63694:57953,63695:57954,63696:57955,63697:57956,63698:57957,63699:57958,63700:57959,63701:57960,63702:57961,63703:57962,63704:57963,63705:57964,63706:57965,63707:57966,63708:57967,63709:57968,63710:57969,63711:57970,63712:57971,63713:57972,63714:57973,63715:57974,63716:57975,63717:57976,63718:57977,63719:57978,63720:57979,63721:57980,63722:57981,63723:57982,63724:57983,63725:57984,63726:57985,63727:57986,63728:57987,63729:57988,63730:57989,63731:57990,63732:57991,63733:57992,63734:57993,63735:57994,63736:57995,63737:57996,63738:57997,63739:57998,63740:57999,63741:58000,63742:58001,63808:40259,63809:40260,63810:40261,63811:40262,63812:40263,63813:40264,63814:40265,63815:40266,63816:40267,63817:40268,63818:40269,63819:40270,63820:40271,63821:40272,63822:40273,63823:40274,63824:40275,63825:40276,63826:40277,63827:40278,63828:40279,63829:40280,63830:40281,63831:40282,63832:40283,63833:40284,63834:40285,63835:40286,63836:40287,63837:40288,63838:40289,63839:40290,63840:40291,63841:40292,63842:40293,63843:40294,63844:40295,63845:40296,63846:40297,63847:40298,63848:40299,63849:40300,63850:40301,63851:40302,63852:40303,63853:40304,63854:40305,63855:40306,63856:40307,63857:40308,63858:40309,63859:40310,63860:40311,63861:40312,63862:40313,63863:40314,63864:40315,63865:40316,63866:40317,63867:40318,63868:40319,63869:40320,63870:40321,63872:40322,63873:40323,63874:40324,63875:40325,63876:40326,63877:40327,63878:40328,63879:40329,63880:40330,63881:40331,63882:40332,63883:40333,63884:40334,63885:40335,63886:40336,63887:40337,63888:40338,63889:40339,63890:40340,63891:40341,63892:40342,63893:40343,63894:40344,63895:40345,63896:40346,63897:40347,63898:40348,63899:40349,63900:40350,63901:40351,63902:40352,63903:40353,63904:40354,63905:58002,63906:58003,63907:58004,63908:58005,63909:58006,63910:58007,63911:58008,63912:58009,63913:58010,63914:58011,63915:58012,63916:58013,63917:58014,63918:58015,63919:58016,63920:58017,63921:58018,63922:58019,63923:58020,63924:58021,63925:58022,63926:58023,63927:58024,63928:58025,63929:58026,63930:58027,63931:58028,63932:58029,63933:58030,63934:58031,63935:58032,63936:58033,63937:58034,63938:58035,63939:58036,63940:58037,63941:58038,63942:58039,63943:58040,63944:58041,63945:58042,63946:58043,63947:58044,63948:58045,63949:58046,63950:58047,63951:58048,63952:58049,63953:58050,63954:58051,63955:58052,63956:58053,63957:58054,63958:58055,63959:58056,63960:58057,63961:58058,63962:58059,63963:58060,63964:58061,63965:58062,63966:58063,63967:58064,63968:58065,63969:58066,63970:58067,63971:58068,63972:58069,63973:58070,63974:58071,63975:58072,63976:58073,63977:58074,63978:58075,63979:58076,63980:58077,63981:58078,63982:58079,63983:58080,63984:58081,63985:58082,63986:58083,63987:58084,63988:58085,63989:58086,63990:58087,63991:58088,63992:58089,63993:58090,63994:58091,63995:58092,63996:58093,63997:58094,63998:58095,64064:40355,64065:40356,64066:40357,64067:40358,64068:40359,64069:40360,64070:40361,64071:40362,64072:40363,64073:40364,64074:40365,64075:40366,64076:40367,64077:40368,64078:40369,64079:40370,64080:40371,64081:40372,64082:40373,64083:40374,64084:40375,64085:40376,64086:40377,64087:40378,64088:40379,64089:40380,64090:40381,64091:40382,64092:40383,64093:40384,64094:40385,64095:40386,64096:40387,64097:40388,64098:40389,64099:40390,64100:40391,64101:40392,64102:40393,64103:40394,64104:40395,64105:40396,64106:40397,64107:40398,64108:40399,64109:40400,64110:40401,64111:40402,64112:40403,64113:40404,64114:40405,64115:40406,64116:40407,64117:40408,64118:40409,64119:40410,64120:40411,64121:40412,64122:40413,64123:40414,64124:40415,64125:40416,64126:40417,64128:40418,64129:40419,64130:40420,64131:40421,64132:40422,64133:40423,64134:40424,64135:40425,64136:40426,64137:40427,64138:40428,64139:40429,64140:40430,64141:40431,64142:40432,64143:40433,64144:40434,64145:40435,64146:40436,64147:40437,64148:40438,64149:40439,64150:40440,64151:40441,64152:40442,64153:40443,64154:40444,64155:40445,64156:40446,64157:40447,64158:40448,64159:40449,64160:40450,64161:58096,64162:58097,64163:58098,64164:58099,64165:58100,64166:58101,64167:58102,64168:58103,64169:58104,64170:58105,64171:58106,64172:58107,64173:58108,64174:58109,64175:58110,64176:58111,64177:58112,64178:58113,64179:58114,64180:58115,64181:58116,64182:58117,64183:58118,64184:58119,64185:58120,64186:58121,64187:58122,64188:58123,64189:58124,64190:58125,64191:58126,64192:58127,64193:58128,64194:58129,64195:58130,64196:58131,64197:58132,64198:58133,64199:58134,64200:58135,64201:58136,64202:58137,64203:58138,64204:58139,64205:58140,64206:58141,64207:58142,64208:58143,64209:58144,64210:58145,64211:58146,64212:58147,64213:58148,64214:58149,64215:58150,64216:58151,64217:58152,64218:58153,64219:58154,64220:58155,64221:58156,64222:58157,64223:58158,64224:58159,64225:58160,64226:58161,64227:58162,64228:58163,64229:58164,64230:58165,64231:58166,64232:58167,64233:58168,64234:58169,64235:58170,64236:58171,64237:58172,64238:58173,64239:58174,64240:58175,64241:58176,64242:58177,64243:58178,64244:58179,64245:58180,64246:58181,64247:58182,64248:58183,64249:58184,64250:58185,64251:58186,64252:58187,64253:58188,64254:58189,64320:40451,64321:40452,64322:40453,64323:40454,64324:40455,64325:40456,64326:40457,64327:40458,64328:40459,64329:40460,64330:40461,64331:40462,64332:40463,64333:40464,64334:40465,64335:40466,64336:40467,64337:40468,64338:40469,64339:40470,64340:40471,64341:40472,64342:40473,64343:40474,64344:40475,64345:40476,64346:40477,64347:40478,64348:40484,64349:40487,64350:40494,64351:40496,64352:40500,64353:40507,64354:40508,64355:40512,64356:40525,64357:40528,64358:40530,64359:40531,64360:40532,64361:40534,64362:40537,64363:40541,64364:40543,64365:40544,64366:40545,64367:40546,64368:40549,64369:40558,64370:40559,64371:40562,64372:40564,64373:40565,64374:40566,64375:40567,64376:40568,64377:40569,64378:40570,64379:40571,64380:40572,64381:40573,64382:40576,64384:40577,64385:40579,64386:40580,64387:40581,64388:40582,64389:40585,64390:40586,64391:40588,64392:40589,64393:40590,64394:40591,64395:40592,64396:40593,64397:40596,64398:40597,64399:40598,64400:40599,64401:40600,64402:40601,64403:40602,64404:40603,64405:40604,64406:40606,64407:40608,64408:40609,64409:40610,64410:40611,64411:40612,64412:40613,64413:40615,64414:40616,64415:40617,64416:40618,64417:58190,64418:58191,64419:58192,64420:58193,64421:58194,64422:58195,64423:58196,64424:58197,64425:58198,64426:58199,64427:58200,64428:58201,64429:58202,64430:58203,64431:58204,64432:58205,64433:58206,64434:58207,64435:58208,64436:58209,64437:58210,64438:58211,64439:58212,64440:58213,64441:58214,64442:58215,64443:58216,64444:58217,64445:58218,64446:58219,64447:58220,64448:58221,64449:58222,64450:58223,64451:58224,64452:58225,64453:58226,64454:58227,64455:58228,64456:58229,64457:58230,64458:58231,64459:58232,64460:58233,64461:58234,64462:58235,64463:58236,64464:58237,64465:58238,64466:58239,64467:58240,64468:58241,64469:58242,64470:58243,64471:58244,64472:58245,64473:58246,64474:58247,64475:58248,64476:58249,64477:58250,64478:58251,64479:58252,64480:58253,64481:58254,64482:58255,64483:58256,64484:58257,64485:58258,64486:58259,64487:58260,64488:58261,64489:58262,64490:58263,64491:58264,64492:58265,64493:58266,64494:58267,64495:58268,64496:58269,64497:58270,64498:58271,64499:58272,64500:58273,64501:58274,64502:58275,64503:58276,64504:58277,64505:58278,64506:58279,64507:58280,64508:58281,64509:58282,64510:58283,64576:40619,64577:40620,64578:40621,64579:40622,64580:40623,64581:40624,64582:40625,64583:40626,64584:40627,64585:40629,64586:40630,64587:40631,64588:40633,64589:40634,64590:40636,64591:40639,64592:40640,64593:40641,64594:40642,64595:40643,64596:40645,64597:40646,64598:40647,64599:40648,64600:40650,64601:40651,64602:40652,64603:40656,64604:40658,64605:40659,64606:40661,64607:40662,64608:40663,64609:40665,64610:40666,64611:40670,64612:40673,64613:40675,64614:40676,64615:40678,64616:40680,64617:40683,64618:40684,64619:40685,64620:40686,64621:40688,64622:40689,64623:40690,64624:40691,64625:40692,64626:40693,64627:40694,64628:40695,64629:40696,64630:40698,64631:40701,64632:40703,64633:40704,64634:40705,64635:40706,64636:40707,64637:40708,64638:40709,64640:40710,64641:40711,64642:40712,64643:40713,64644:40714,64645:40716,64646:40719,64647:40721,64648:40722,64649:40724,64650:40725,64651:40726,64652:40728,64653:40730,64654:40731,64655:40732,64656:40733,64657:40734,64658:40735,64659:40737,64660:40739,64661:40740,64662:40741,64663:40742,64664:40743,64665:40744,64666:40745,64667:40746,64668:40747,64669:40749,64670:40750,64671:40752,64672:40753,64673:58284,64674:58285,64675:58286,64676:58287,64677:58288,64678:58289,64679:58290,64680:58291,64681:58292,64682:58293,64683:58294,64684:58295,64685:58296,64686:58297,64687:58298,64688:58299,64689:58300,64690:58301,64691:58302,64692:58303,64693:58304,64694:58305,64695:58306,64696:58307,64697:58308,64698:58309,64699:58310,64700:58311,64701:58312,64702:58313,64703:58314,64704:58315,64705:58316,64706:58317,64707:58318,64708:58319,64709:58320,64710:58321,64711:58322,64712:58323,64713:58324,64714:58325,64715:58326,64716:58327,64717:58328,64718:58329,64719:58330,64720:58331,64721:58332,64722:58333,64723:58334,64724:58335,64725:58336,64726:58337,64727:58338,64728:58339,64729:58340,64730:58341,64731:58342,64732:58343,64733:58344,64734:58345,64735:58346,64736:58347,64737:58348,64738:58349,64739:58350,64740:58351,64741:58352,64742:58353,64743:58354,64744:58355,64745:58356,64746:58357,64747:58358,64748:58359,64749:58360,64750:58361,64751:58362,64752:58363,64753:58364,64754:58365,64755:58366,64756:58367,64757:58368,64758:58369,64759:58370,64760:58371,64761:58372,64762:58373,64763:58374,64764:58375,64765:58376,64766:58377,64832:40754,64833:40755,64834:40756,64835:40757,64836:40758,64837:40760,64838:40762,64839:40764,64840:40767,64841:40768,64842:40769,64843:40770,64844:40771,64845:40773,64846:40774,64847:40775,64848:40776,64849:40777,64850:40778,64851:40779,64852:40780,64853:40781,64854:40782,64855:40783,64856:40786,64857:40787,64858:40788,64859:40789,64860:40790,64861:40791,64862:40792,64863:40793,64864:40794,64865:40795,64866:40796,64867:40797,64868:40798,64869:40799,64870:40800,64871:40801,64872:40802,64873:40803,64874:40804,64875:40805,64876:40806,64877:40807,64878:40808,64879:40809,64880:40810,64881:40811,64882:40812,64883:40813,64884:40814,64885:40815,64886:40816,64887:40817,64888:40818,64889:40819,64890:40820,64891:40821,64892:40822,64893:40823,64894:40824,64896:40825,64897:40826,64898:40827,64899:40828,64900:40829,64901:40830,64902:40833,64903:40834,64904:40845,64905:40846,64906:40847,64907:40848,64908:40849,64909:40850,64910:40851,64911:40852,64912:40853,64913:40854,64914:40855,64915:40856,64916:40860,64917:40861,64918:40862,64919:40865,64920:40866,64921:40867,64922:40868,64923:40869,64924:63788,64925:63865,64926:63893,64927:63975,64928:63985,64929:58378,64930:58379,64931:58380,64932:58381,64933:58382,64934:58383,64935:58384,64936:58385,64937:58386,64938:58387,64939:58388,64940:58389,64941:58390,64942:58391,64943:58392,64944:58393,64945:58394,64946:58395,64947:58396,64948:58397,64949:58398,64950:58399,64951:58400,64952:58401,64953:58402,64954:58403,64955:58404,64956:58405,64957:58406,64958:58407,64959:58408,64960:58409,64961:58410,64962:58411,64963:58412,64964:58413,64965:58414,64966:58415,64967:58416,64968:58417,64969:58418,64970:58419,64971:58420,64972:58421,64973:58422,64974:58423,64975:58424,64976:58425,64977:58426,64978:58427,64979:58428,64980:58429,64981:58430,64982:58431,64983:58432,64984:58433,64985:58434,64986:58435,64987:58436,64988:58437,64989:58438,64990:58439,64991:58440,64992:58441,64993:58442,64994:58443,64995:58444,64996:58445,64997:58446,64998:58447,64999:58448,65000:58449,65001:58450,65002:58451,65003:58452,65004:58453,65005:58454,65006:58455,65007:58456,65008:58457,65009:58458,65010:58459,65011:58460,65012:58461,65013:58462,65014:58463,65015:58464,65016:58465,65017:58466,65018:58467,65019:58468,65020:58469,65021:58470,65022:58471,65088:64012,65089:64013,65090:64014,65091:64015,65092:64017,65093:64019,65094:64020,65095:64024,65096:64031,65097:64032,65098:64033,65099:64035,65100:64036,65101:64039,65102:64040,65103:64041,65104:11905,65105:59414,65106:59415,65107:59416,65108:11908,65109:13427,65110:13383,65111:11912,65112:11915,65113:59422,65114:13726,65115:13850,65116:13838,65117:11916,65118:11927,65119:14702,65120:14616,65121:59430,65122:14799,65123:14815,65124:14963,65125:14800,65126:59435,65127:59436,65128:15182,65129:15470,65130:15584,65131:11943,65132:59441,65133:59442,65134:11946,65135:16470,65136:16735,65137:11950,65138:17207,65139:11955,65140:11958,65141:11959,65142:59451,65143:17329,65144:17324,65145:11963,65146:17373,65147:17622,65148:18017,65149:17996,65150:59459,65152:18211,65153:18217,65154:18300,65155:18317,65156:11978,65157:18759,65158:18810,65159:18813,65160:18818,65161:18819,65162:18821,65163:18822,65164:18847,65165:18843,65166:18871,65167:18870,65168:59476,65169:59477,65170:19619,65171:19615,65172:19616,65173:19617,65174:19575,65175:19618,65176:19731,65177:19732,65178:19733,65179:19734,65180:19735,65181:19736,65182:19737,65183:19886,65184:59492,65185:58472,65186:58473,65187:58474,65188:58475,65189:58476,65190:58477,65191:58478,65192:58479,65193:58480,65194:58481,65195:58482,65196:58483,65197:58484,65198:58485,65199:58486,65200:58487,65201:58488,65202:58489,65203:58490,65204:58491,65205:58492,65206:58493,65207:58494,65208:58495,65209:58496,65210:58497,65211:58498,65212:58499,65213:58500,65214:58501,65215:58502,65216:58503,65217:58504,65218:58505,65219:58506,65220:58507,65221:58508,65222:58509,65223:58510,65224:58511,65225:58512,65226:58513,65227:58514,65228:58515,65229:58516,65230:58517,65231:58518,65232:58519,65233:58520,65234:58521,65235:58522,65236:58523,65237:58524,65238:58525,65239:58526,65240:58527,65241:58528,65242:58529,65243:58530,65244:58531,65245:58532,65246:58533,65247:58534,65248:58535,65249:58536,65250:58537,65251:58538,65252:58539,65253:58540,65254:58541,65255:58542,65256:58543,65257:58544,65258:58545,65259:58546,65260:58547,65261:58548,65262:58549,65263:58550,65264:58551,65265:58552,65266:58553,65267:58554,65268:58555,65269:58556,65270:58557,65271:58558,65272:58559,65273:58560,65274:58561,65275:58562,65276:58563,65277:58564,65278:58565} \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js b/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js deleted file mode 100644 index 909e433..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js +++ /dev/null @@ -1,25 +0,0 @@ -var http = require('http'); -var fs = require('fs'); -// BIG5 -var cp950_b2u = {host:'moztw.org',path:'/docs/big5/table/cp950-b2u.txt'}, - cp950_u2b = {host:'moztw.org',path:'/docs/big5/table/cp950-u2b.txt'}, - cp950_moz18_b2u = {host:'moztw.org',path:'/docs/big5/table/moz18-b2u.txt'}; - -http.get(cp950_moz18_b2u, function(res) { - var data = ''; - res.on('data', function(chunk) { - data += chunk; - }); - res.on('end', function() { - var table = {}; - data = data.split('\n').slice(1); - data.forEach(function(line, idx) { - var pair = line.split(' '); - var key = parseInt(pair[0]); - var val = parseInt(pair[1]); - table[key] = val; - }); - fs.createWriteSync('encodings/table/big5.js', - 'module.exports = ' + JSON.stringify(table) + ';'); - }); -}); diff --git a/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js b/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js deleted file mode 100644 index 2cbebec..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js +++ /dev/null @@ -1,142 +0,0 @@ -var fs = require("fs"); -var Iconv = require("iconv").Iconv; - - -var encodingFamilies = [ - { - // Windows code pages - encodings: [1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258], - convert: function(cp) { - return { - name: "windows-"+cp, - aliases: ["win"+cp, "cp"+cp, ""+cp], - } - } - }, - { - // ISO-8859 code pages - encodings: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16], - convert: function(i) { - return { - name: "iso-8859-"+i, - aliases: ["cp"+(28590+i), (28590+i)], - } - } - }, - { - // IBM/DOS code pages - encodings: [437, 737, 775, 850, 852, 855, 857, 858, 860, 861, 862, 863, 864, 865, 866, 869], - convert: function(cp) { - return { - name: "CP"+cp, - aliases: ["ibm"+cp, ""+cp], - } - } - }, - { - // Macintosh code pages - encodings: ["macCroatian", "macCyrillic", "macGreek", - "macIceland", "macRoman", "macRomania", - "macThai", "macTurkish", "macUkraine"], - }, - { - // KOI8 code pages - encodings: ["KOI8-R", "KOI8-U"], - }, -]; - - -var encodings = { - // Aliases. - "ascii8bit": "ascii", - "usascii": "ascii", - - "latin1": "iso88591", - "latin2": "iso88592", - "latin3": "iso88593", - "latin4": "iso88594", - "latin6": "iso885910", - "latin7": "iso885913", - "latin8": "iso885914", - "latin9": "iso885915", - "latin10": "iso885916", - - "cp819": "iso88951", - "arabic": "iso88596", - "arabic8": "iso88596", - "greek" : "iso88597", - "greek8" : "iso88597", - "hebrew": "iso88598", - "hebrew8": "iso88598", - "turkish": "iso88599", - "turkish8": "iso88599", - "thai": "iso885911", - "thai8": "iso885911", - "tis620": "iso885911", - "windows874": "iso885911", - "win874": "iso885911", - "cp874": "iso885911", - "874": "iso885911", - "celtic": "iso885914", - "celtic8": "iso885914", - - "cp20866": "koi8r", - "20866": "koi8r", - "ibm878": "koi8r", - "cp21866": "koi8u", - "21866": "koi8u", - "ibm1168": "koi8u", - -}; - -// Add all encodings from encodingFamilies. -encodingFamilies.forEach(function(family){ - family.encodings.forEach(function(encoding){ - if (family.convert) - encoding = family.convert(encoding); - - var encodingIconvName = encoding.name ? encoding.name : encoding; - var encodingName = encodingIconvName.replace(/[-_]/g, "").toLowerCase(); - - encodings[encodingName] = { - type: "singlebyte", - chars: generateCharsString(encodingIconvName) - }; - - if (encoding.aliases) - encoding.aliases.forEach(function(alias){ - encodings[alias] = encodingName; - }); - }); -}); - -// Write encodings. -fs.writeFileSync("encodings/singlebyte.js", - "module.exports = " + JSON.stringify(encodings, undefined, " ") + ";"); - - -function generateCharsString(encoding) { - console.log("Generate encoding for " + encoding); - var iconvToUtf8 = new Iconv(encoding, "UTF-8"); - var chars = ""; - - for (var b = 0x80; b < 0x100; b++) { - - try { - var convertedChar = iconvToUtf8.convert(new Buffer([b])).toString(); - - if (convertedChar.length != 1) - throw new Error("Single-byte encoding error: Must return single char."); - } catch (exception) { - if (exception.code === "EILSEQ") { - convertedChar = "\ufffd"; - } else { - throw exception; - } - } - - chars += convertedChar; - } - - return chars; -} diff --git a/node_modules/grunt/node_modules/iconv-lite/index.js b/node_modules/grunt/node_modules/iconv-lite/index.js deleted file mode 100644 index a55691b..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/index.js +++ /dev/null @@ -1,231 +0,0 @@ -var RE_SPACEDASH = /[- ]/g; -// Module exports -var iconv = module.exports = { - toEncoding: function(str, encoding) { - return iconv.getCodec(encoding).toEncoding(str); - }, - fromEncoding: function(buf, encoding) { - return iconv.getCodec(encoding).fromEncoding(buf); - }, - encodingExists: function(enc) { - loadEncodings(); - enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); - return (iconv.encodings[enc] !== undefined); - }, - - defaultCharUnicode: '�', - defaultCharSingleByte: '?', - - encodingsLoaded: false, - - // Get correct codec for given encoding. - getCodec: function(encoding) { - loadEncodings(); - var enc = encoding || "utf8"; - var codecOptions = undefined; - while (1) { - if (getType(enc) === "String") - enc = enc.replace(RE_SPACEDASH, "").toLowerCase(); - var codec = iconv.encodings[enc]; - var type = getType(codec); - if (type === "String") { - // Link to other encoding. - codecOptions = {originalEncoding: enc}; - enc = codec; - } - else if (type === "Object" && codec.type != undefined) { - // Options for other encoding. - codecOptions = codec; - enc = codec.type; - } - else if (type === "Function") - // Codec itself. - return codec(codecOptions); - else - throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); - } - }, - - // Define basic encodings - encodings: { - internal: function(options) { - return { - toEncoding: toInternalEncoding, - fromEncoding: fromInternalEncoding, - options: options - }; - }, - utf8: "internal", - ucs2: "internal", - binary: "internal", - ascii: "internal", - base64: "internal", - - // Codepage single-byte encodings. - singlebyte: function(options) { - // Prepare chars if needed - if (!options.charsBuf) { - if (!options.chars || (options.chars.length !== 128 && options.chars.length !== 256)) - throw new Error("Encoding '"+options.type+"' has incorrect 'chars' (must be of len 128 or 256)"); - - if (options.chars.length === 128) - options.chars = asciiString + options.chars; - - options.charsBuf = new Buffer(options.chars, 'ucs2'); - } - - if (!options.revCharsBuf) { - options.revCharsBuf = new Buffer(65536); - var defChar = iconv.defaultCharSingleByte.charCodeAt(0); - for (var i = 0; i < options.revCharsBuf.length; i++) - options.revCharsBuf[i] = defChar; - for (var i = 0; i < options.chars.length; i++) - options.revCharsBuf[options.chars.charCodeAt(i)] = i; - } - - return { - toEncoding: toSingleByteEncoding, - fromEncoding: fromSingleByteEncoding, - options: options, - }; - }, - - // Codepage double-byte encodings. - table: function(options) { - if (!options.table) { - throw new Error("Encoding '" + options.type + "' has incorect 'table' option"); - } - if (!options.revCharsTable) { - var revCharsTable = options.revCharsTable = {}; - for (var i = 0; i <= 0xFFFF; i++) { - revCharsTable[i] = 0; - } - - var table = options.table; - for (var key in table) { - revCharsTable[table[key]] = +key; - } - } - - return { - toEncoding: toTableEncoding, - fromEncoding: fromTableEncoding, - options: options, - }; - } - } -}; - -function toInternalEncoding(str) { - return new Buffer(ensureString(str), this.options.originalEncoding); -} - -function fromInternalEncoding(buf) { - return ensureBuffer(buf).toString(this.options.originalEncoding); -} - -function toTableEncoding(str) { - str = ensureString(str); - var strLen = str.length; - var revCharsTable = this.options.revCharsTable; - var newBuf = new Buffer(strLen*2), gbkcode, unicode, - defaultChar = revCharsTable[iconv.defaultCharUnicode.charCodeAt(0)]; - - for (var i = 0, j = 0; i < strLen; i++) { - unicode = str.charCodeAt(i); - if (unicode >> 7) { - gbkcode = revCharsTable[unicode] || defaultChar; - newBuf[j++] = gbkcode >> 8; //high byte; - newBuf[j++] = gbkcode & 0xFF; //low byte - } else {//ascii - newBuf[j++] = unicode; - } - } - return newBuf.slice(0, j); -} - -function fromTableEncoding(buf) { - buf = ensureBuffer(buf); - var bufLen = buf.length; - var table = this.options.table; - var newBuf = new Buffer(bufLen*2), unicode, gbkcode, - defaultChar = iconv.defaultCharUnicode.charCodeAt(0); - - for (var i = 0, j = 0; i < bufLen; i++, j+=2) { - gbkcode = buf[i]; - if (gbkcode & 0x80) { - gbkcode = (gbkcode << 8) + buf[++i]; - unicode = table[gbkcode] || defaultChar; - } else { - unicode = gbkcode; - } - newBuf[j] = unicode & 0xFF; //low byte - newBuf[j+1] = unicode >> 8; //high byte - } - return newBuf.slice(0, j).toString('ucs2'); -} - -function toSingleByteEncoding(str) { - str = ensureString(str); - - var buf = new Buffer(str.length); - var revCharsBuf = this.options.revCharsBuf; - for (var i = 0; i < str.length; i++) - buf[i] = revCharsBuf[str.charCodeAt(i)]; - - return buf; -} - -function fromSingleByteEncoding(buf) { - buf = ensureBuffer(buf); - - // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. - var charsBuf = this.options.charsBuf; - var newBuf = new Buffer(buf.length*2); - var idx1 = 0, idx2 = 0; - for (var i = 0, _len = buf.length; i < _len; i++) { - idx1 = buf[i]*2; idx2 = i*2; - newBuf[idx2] = charsBuf[idx1]; - newBuf[idx2+1] = charsBuf[idx1+1]; - } - return newBuf.toString('ucs2'); -} - -// Add aliases to convert functions -iconv.encode = iconv.toEncoding; -iconv.decode = iconv.fromEncoding; - -// Load other encodings manually from files in /encodings dir. -function loadEncodings() { - if (!iconv.encodingsLoaded) { - [ require('./encodings/singlebyte'), - require('./encodings/gbk'), - require('./encodings/big5') - ].forEach(function(encodings) { - for (var key in encodings) - iconv.encodings[key] = encodings[key] - }); - iconv.encodingsLoaded = true; - } -} - - - -// Utilities -var asciiString = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ - ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'; - -var ensureBuffer = function(buf) { - buf = buf || new Buffer(0); - return (buf instanceof Buffer) ? buf : new Buffer(""+buf, "binary"); -} - -var ensureString = function(str) { - str = str || ""; - return (str instanceof Buffer) ? str.toString('utf8') : (""+str); -} - -var getType = function(obj) { - return Object.prototype.toString.call(obj).slice(8, -1); -} - diff --git a/node_modules/grunt/node_modules/iconv-lite/package.json b/node_modules/grunt/node_modules/iconv-lite/package.json deleted file mode 100644 index 098d1f3..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/package.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "name": "iconv-lite", - "description": "Convert character encodings in pure javascript.", - "version": "0.2.11", - "license": "MIT", - "keywords": [ - "iconv", - "convert", - "charset" - ], - "author": { - "name": "Alexander Shtuchkin", - "email": "ashtuchkin@gmail.com" - }, - "contributors": [ - { - "name": "Jinwu Zhan", - "url": "https://github.com/jenkinv" - }, - { - "name": "Adamansky Anton", - "url": "https://github.com/adamansky" - }, - { - "name": "George Stagas", - "url": "https://github.com/stagas" - }, - { - "name": "Mike D Pilsbury", - "url": "https://github.com/pekim" - }, - { - "name": "Niggler", - "url": "https://github.com/Niggler" - }, - { - "name": "wychi", - "url": "https://github.com/wychi" - }, - { - "name": "David Kuo", - "url": "https://github.com/david50407" - }, - { - "name": "ChangZhuo Chen", - "url": "https://github.com/czchen" - }, - { - "name": "Lee Treveil", - "url": "https://github.com/leetreveil" - }, - { - "name": "Brian White", - "url": "https://github.com/mscdex" - } - ], - "main": "index.js", - "homepage": "https://github.com/ashtuchkin/iconv-lite", - "repository": { - "type": "git", - "url": "git://github.com/ashtuchkin/iconv-lite.git" - }, - "engines": { - "node": ">=0.4.0" - }, - "scripts": { - "test": "vows --spec" - }, - "devDependencies": { - "vows": "", - "iconv": ">=1.1" - }, - "readme": "iconv-lite - pure javascript character encoding conversion\n======================================================================\n\n[![Build Status](https://secure.travis-ci.org/ashtuchkin/iconv-lite.png?branch=master)](http://travis-ci.org/ashtuchkin/iconv-lite)\n\n## Features\n\n* Pure javascript. Doesn't need native code compilation.\n* Easy API.\n* Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n* Encoding is much faster than node-iconv (see below for performance comparison).\n\n## Usage\n\n var iconv = require('iconv-lite');\n \n // Convert from an encoded buffer to string.\n str = iconv.decode(buf, 'win1251');\n \n // Convert from string to an encoded buffer.\n buf = iconv.encode(\"Sample input string\", 'win1251');\n\n // Check if encoding is supported\n iconv.encodingExists(\"us-ascii\")\n\n\n## Supported encodings\n\n* All node.js native encodings: 'utf8', 'ucs2', 'ascii', 'binary', 'base64'\n* All widespread single byte encodings: Windows 125x family, ISO-8859 family, \n IBM/DOS codepages, Macintosh family, KOI8 family. \n Aliases like 'latin1', 'us-ascii' also supported.\n* Multibyte encodings: 'gbk', 'gb2313', 'Big5', 'cp950'.\n\nOthers are easy to add, see the source. Please, participate.\nMost encodings are generated from node-iconv. Thank you Ben Noordhuis and iconv authors!\n\nNot supported yet: EUC family, Shift_JIS.\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on Ubuntu 12.04, Core i5/2.5 GHz, Node v0.8.7). \nNote: your results may vary, so please always check on your hardware.\n\n operation iconv@1.2.4 iconv-lite@0.2.4 \n ----------------------------------------------------------\n encode('win1251') ~115 Mb/s ~230 Mb/s\n decode('win1251') ~95 Mb/s ~130 Mb/s\n\n\n## Notes\n\nWhen decoding, a 'binary'-encoded string can be used as a source buffer. \nUntranslatable characters are set to � or ?. No transliteration is currently supported, pull requests are welcome.\n\n## Testing\n\n git clone git@github.com:ashtuchkin/iconv-lite.git\n cd iconv-lite\n npm install\n npm test\n \n # To view performance:\n node test/performance.js\n\n## TODO\n\n* Support streaming character conversion, something like util.pipe(req, iconv.fromEncodingStream('latin1')).\n* Add more encodings.\n* Add transliteration (best fit char).\n* Add tests and correct support of variable-byte encodings (currently work is delegated to node).\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ashtuchkin/iconv-lite/issues" - }, - "_id": "iconv-lite@0.2.11", - "_from": "iconv-lite@~0.2.11" -} diff --git a/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js b/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js deleted file mode 100644 index f3fe1a8..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js +++ /dev/null @@ -1,36 +0,0 @@ -var vows = require('vows'), - fs = require('fs'), - assert = require('assert'), - iconv = require(__dirname + '/../'); - -var testString = "中文abc", //unicode contains Big5-code and ascii - testStringBig5Buffer = new Buffer([0xa4,0xa4,0xa4,0xe5,0x61,0x62,0x63]), - testString2 = '測試', - testStringBig5Buffer2 = new Buffer([0xb4, 0xfa, 0xb8, 0xd5]); - -vows.describe("Big5 tests").addBatch({ - "Big5 correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testString, "big5").toString('binary'), testStringBig5Buffer.toString('binary')); - assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "big5"), testString); - assert.strictEqual(iconv.toEncoding(testString2, 'big5').toString('binary'), testStringBig5Buffer2.toString('binary')); - assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer2, 'big5'), testString2); - }, - "cp950 correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testString, "cp950").toString('binary'), testStringBig5Buffer.toString('binary')); - assert.strictEqual(iconv.fromEncoding(testStringBig5Buffer, "cp950"), testString); - }, - "Big5 file read decoded,compare with iconv result": function() { - var contentBuffer = fs.readFileSync(__dirname+"/big5File.txt"); - var str = iconv.fromEncoding(contentBuffer, "big5"); - var iconvc = new (require('iconv').Iconv)('big5','utf8'); - assert.strictEqual(iconvc.convert(contentBuffer).toString(), str); - }, - "Big5 correctly decodes and encodes characters · and ×": function() { - // https://github.com/ashtuchkin/iconv-lite/issues/13 - // Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT - var chars = "·×"; - var big5Chars = new Buffer([0xA1, 0x50, 0xA1, 0xD1]); - assert.strictEqual(iconv.toEncoding(chars, "big5").toString('binary'), big5Chars.toString('binary')); - assert.strictEqual(iconv.fromEncoding(big5Chars, "big5"), chars) - }, -}).export(module) diff --git a/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt b/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt deleted file mode 100644 index 9c13042..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt +++ /dev/null @@ -1,13 +0,0 @@ - - - meta ҪϥΡG - - - - -oO@c餤I
    -(This page uses big5 character set.)
    -charset=big5 - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js b/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js deleted file mode 100644 index 259d283..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js +++ /dev/null @@ -1,86 +0,0 @@ -var vows = require('vows'), - assert = require('assert'), - iconv = require(__dirname+'/../'); - -var baseStrings = { - empty: "", - hi: "Привет!", - ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ - ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f', - rus: "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя", - additional1: "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬\xAD®Ї°±Ііґµ¶·ё№є»јЅѕї", - additional2: "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©", - additional3: " ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏ№ёђѓєѕіїјљњћќ§ўџ", - untranslatable: "£Åçþÿ¿", -}; - -var encodings = [{ - name: "Win-1251", - variations: ['win1251', 'Windows-1251', 'windows1251', 'CP1251', 1251], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\xcf\xf0\xe8\xe2\xe5\xf2!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - rus: new Buffer('\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'), - additional1: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf','binary'), - } -}, { - name: "Koi8-R", - variations: ['koi8r', 'KOI8-R', 'cp20866', 20866], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\xf0\xd2\xc9\xd7\xc5\xd4!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - rus: new Buffer('\xe1\xe2\xf7\xe7\xe4\xe5\xf6\xfa\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf2\xf3\xf4\xf5\xe6\xe8\xe3\xfe\xfb\xfd\xff\xf9\xf8\xfc\xe0\xf1\xc1\xc2\xd7\xc7\xc4\xc5\xd6\xda\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd2\xd3\xd4\xd5\xc6\xc8\xc3\xde\xdb\xdd\xdf\xd9\xd8\xdc\xc0\xd1', 'binary'), - additional2: new Buffer('\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf', 'binary'), - } -}, { - name: "ISO 8859-5", - variations: ['iso88595', 'ISO-8859-5', 'ISO 8859-5', 'cp28595', 28595], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\xbf\xe0\xd8\xd2\xd5\xe2!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - rus: new Buffer('\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef', 'binary'), - additional3: new Buffer('\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', 'binary'), - } -}]; - -var testsBatch = {}; -encodings.forEach(function(encoding) { - var enc = encoding.variations[0]; - var key = "hi"; - var tests = { - "Convert to empty buffer": function() { - assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); - }, - "Convert from empty buffer": function() { - assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); - }, - "Convert from buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), - baseStrings[key]); - }, - "Convert to buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), - encoding.encodedStrings[key].toString('binary')); - }, - "Try different variations of encoding": function() { - encoding.variations.forEach(function(enc) { - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]); - assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); - }); - }, - "Untranslatable chars are converted to defaultCharSingleByte": function() { - var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); - assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. - } - }; - - testsBatch[encoding.name+":"] = tests; -}); - -vows.describe("Test Cyrillic encodings").addBatch(testsBatch).export(module); - diff --git a/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js b/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js deleted file mode 100644 index 7b2e47b..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js +++ /dev/null @@ -1,38 +0,0 @@ -var vows = require('vows'), - fs = require('fs'), - assert = require('assert'), - iconv = require(__dirname+'/../'); - -var testString = "中国abc",//unicode contains GBK-code and ascii - testStringGBKBuffer = new Buffer([0xd6,0xd0,0xb9,0xfa,0x61,0x62,0x63]); - -vows.describe("GBK tests").addBatch({ - "Vows is working": function() {}, - "Return values are of correct types": function() { - assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer); - var s = iconv.fromEncoding(new Buffer(testString), "utf8"); - assert.strictEqual(Object.prototype.toString.call(s), "[object String]"); - }, - "GBK correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testString, "GBK").toString('binary'), testStringGBKBuffer.toString('binary')); - assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GBK"), testString); - }, - "GB2312 correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testString, "GB2312").toString('binary'), testStringGBKBuffer.toString('binary')); - assert.strictEqual(iconv.fromEncoding(testStringGBKBuffer, "GB2312"), testString); - }, - "GBK file read decoded,compare with iconv result": function() { - var contentBuffer = fs.readFileSync(__dirname+"/gbkFile.txt"); - var str = iconv.fromEncoding(contentBuffer, "GBK"); - var iconvc = new (require('iconv').Iconv)('GBK','utf8'); - assert.strictEqual(iconvc.convert(contentBuffer).toString(), str); - }, - "GBK correctly decodes and encodes characters · and ×": function() { - // https://github.com/ashtuchkin/iconv-lite/issues/13 - // Reference: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT - var chars = "·×"; - var gbkChars = new Buffer([0xA1, 0xA4, 0xA1, 0xC1]); - assert.strictEqual(iconv.toEncoding(chars, "GBK").toString('binary'), gbkChars.toString('binary')); - assert.strictEqual(iconv.fromEncoding(gbkChars, "GBK"), chars) - }, -}).export(module) diff --git a/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt b/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt deleted file mode 100644 index 345b5d0..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt +++ /dev/null @@ -1,14 +0,0 @@ -ٶһ£֪ - - -
     | ¼
    - - - - - - - - \ No newline at end of file diff --git a/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js b/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js deleted file mode 100644 index 0394ee6..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js +++ /dev/null @@ -1,79 +0,0 @@ -var vows = require('vows'), - assert = require('assert'), - iconv = require(__dirname+'/../'); - -var baseStrings = { - empty: "", - hi: "Γειά!", - ascii: '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ - ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f', - greek: "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩάέήίόύώΆΈΉΊΌΎΏϊϋΪΫ", - untranslatable: "Åçþÿ¿" -}; - -var encodings = [{ - name: "windows1253", - variations: ['windows-1253', 'win-1253', 'win1253', 'cp1253', 'cp-1253', 1253], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xa2\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'), - } -}, { - name: "iso88597", - variations: ['iso-8859-7', 'greek', 'greek8', 'cp28597', 'cp-28597', 28597], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\xc3\xe5\xe9\xdc!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - greek: new Buffer('\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xdc\xdd\xde\xdf\xfc\xfd\xfe\xb6\xb8\xb9\xba\xbc\xbe\xbf\xfa\xfb\xda\xdb', 'binary'), - } -}, { - name: "cp737", - variations: ['cp-737', 737], - encodedStrings: { - empty: new Buffer(''), - hi: new Buffer('\x82\x9c\xa0\xe1!', 'binary'), - ascii: new Buffer(baseStrings.ascii, 'binary'), - greek: new Buffer('\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xab\xac\xad\xae\xaf\xe0\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\xe1\xe2\xe3\xe5\xe6\xe7\xe9\xea\xeb\xec\xed\xee\xef\xf0\xe4\xe8\xf4\xf5', 'binary'), - } -}]; - -var testsBatch = {}; -encodings.forEach(function(encoding) { - var enc = encoding.variations[0]; - var key = "hi"; - var tests = { - "Convert to empty buffer": function() { - assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); - }, - "Convert from empty buffer": function() { - assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); - }, - "Convert from buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), - baseStrings[key]); - }, - "Convert to buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), - encoding.encodedStrings[key].toString('binary')); - }, - "Try different variations of encoding": function() { - encoding.variations.forEach(function(enc) { - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), baseStrings[key]); - assert.strictEqual(iconv.toEncoding(baseStrings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); - }); - }, - "Untranslatable chars are converted to defaultCharSingleByte": function() { - var expected = baseStrings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); - assert.strictEqual(iconv.toEncoding(baseStrings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. - } - }; - - testsBatch[encoding.name+":"] = tests; -}); - -vows.describe("Test Greek encodings").addBatch(testsBatch).export(module); diff --git a/node_modules/grunt/node_modules/iconv-lite/test/main-test.js b/node_modules/grunt/node_modules/iconv-lite/test/main-test.js deleted file mode 100644 index 50177f2..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/main-test.js +++ /dev/null @@ -1,55 +0,0 @@ -var vows = require('vows'), - assert = require('assert'), - iconv = require(__dirname+'/../'); - -var testString = "Hello123!"; -var testStringLatin1 = "Hello123!£Å÷×çþÿ¿®"; -var testStringBase64 = "SGVsbG8xMjMh"; - -vows.describe("Generic UTF8-UCS2 tests").addBatch({ - "Vows is working": function() {}, - "Return values are of correct types": function() { - assert.ok(iconv.toEncoding(testString, "utf8") instanceof Buffer); - - var s = iconv.fromEncoding(new Buffer(testString), "utf8"); - assert.strictEqual(Object.prototype.toString.call(s), "[object String]"); - }, - "Internal encodings all correctly encoded/decoded": function() { - ['utf8', "UTF-8", "UCS2", "binary", ""].forEach(function(enc) { - assert.strictEqual(iconv.toEncoding(testStringLatin1, enc).toString(enc), testStringLatin1); - assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, enc), enc), testStringLatin1); - }); - }, - "Base64 correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testStringBase64, "base64").toString("binary"), testString); - assert.strictEqual(iconv.fromEncoding(new Buffer(testString, "binary"), "base64"), testStringBase64); - }, - "Latin1 correctly encoded/decoded": function() { - assert.strictEqual(iconv.toEncoding(testStringLatin1, "latin1").toString("binary"), testStringLatin1); - assert.strictEqual(iconv.fromEncoding(new Buffer(testStringLatin1, "binary"), "latin1"), testStringLatin1); - }, - "Convert from string, not buffer (binary encoding used)": function() { - assert.strictEqual(iconv.fromEncoding(testStringLatin1, "binary"), testStringLatin1); - }, - "Convert to string, not buffer (utf8 used)": function() { - var res = iconv.toEncoding(new Buffer(testStringLatin1, "utf8")); - assert.ok(res instanceof Buffer); - assert.strictEqual(res.toString("utf8"), testStringLatin1); - }, - "Throws on unknown encodings": function() { - assert.throws(function() { iconv.toEncoding("a", "xxx"); }); - assert.throws(function() { iconv.fromEncoding("a", "xxx"); }); - }, - "Convert non-strings and non-buffers": function() { - assert.strictEqual(iconv.toEncoding({}, "utf8").toString(), "[object Object]"); - assert.strictEqual(iconv.toEncoding(10, "utf8").toString(), "10"); - assert.strictEqual(iconv.toEncoding(undefined, "utf8").toString(), ""); - assert.strictEqual(iconv.fromEncoding({}, "utf8"), "[object Object]"); - assert.strictEqual(iconv.fromEncoding(10, "utf8"), "10"); - assert.strictEqual(iconv.fromEncoding(undefined, "utf8"), ""); - }, - "Aliases encode and decode work the same as toEncoding and fromEncoding": function() { - assert.strictEqual(iconv.toEncoding(testString, "latin1").toString("binary"), iconv.encode(testString, "latin1").toString("binary")); - assert.strictEqual(iconv.fromEncoding(testStringLatin1, "latin1"), iconv.decode(testStringLatin1, "latin1")); - }, -}).export(module) diff --git a/node_modules/grunt/node_modules/iconv-lite/test/performance.js b/node_modules/grunt/node_modules/iconv-lite/test/performance.js deleted file mode 100644 index 835deac..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/performance.js +++ /dev/null @@ -1,67 +0,0 @@ - -var iconv = require('iconv'); -var iconv_lite = require("../index"); - -var encoding = process.argv[2] || "windows-1251"; -var convertTimes = 10000; - -var encodingStrings = { - 'windows-1251': 'This is a test string 32 chars..', - 'gbk': '这是中文字符测试。。!@¥%12', - 'utf8': '这是中文字符测试。。!@¥%12This is a test string 48 chars..', -}; -// Test encoding. -var str = encodingStrings[encoding]; -if (!str) { - throw new Error('Don\'t support ' + encoding + ' performance test.'); -} -for (var i = 0; i < 13; i++) { - str = str + str; -} - -console.log('\n' + encoding + ' charset performance test:'); -console.log("\nEncoding "+str.length+" chars "+convertTimes+" times:"); - -var start = Date.now(); -var converter = new iconv.Iconv("utf8", encoding); -for (var i = 0; i < convertTimes; i++) { - var b = converter.convert(str); -} -var duration = Date.now() - start; -var mbs = convertTimes*b.length/duration/1024; - -console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); - -var start = Date.now(); -for (var i = 0; i < convertTimes; i++) { - var b = iconv_lite.encode(str, encoding); -} -var duration = Date.now() - start; -var mbs = convertTimes*b.length/duration/1024; - -console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); - - -// Test decoding. -var buf = iconv_lite.encode(str, encoding); -console.log("\nDecoding "+buf.length+" bytes "+convertTimes+" times:"); - -var start = Date.now(); -var converter = new iconv.Iconv(encoding, "utf8"); -for (var i = 0; i < convertTimes; i++) { - var s = converter.convert(buf).toString(); -} -var duration = Date.now() - start; -var mbs = convertTimes*buf.length/duration/1024; - -console.log("iconv: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); - -var start = Date.now(); -for (var i = 0; i < convertTimes; i++) { - var s = iconv_lite.decode(buf, encoding); -} -var duration = Date.now() - start; -var mbs = convertTimes*buf.length/duration/1024; - -console.log("iconv-lite: "+duration+"ms, "+mbs.toFixed(2)+" Mb/s."); - diff --git a/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js b/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js deleted file mode 100644 index b2eb68e..0000000 --- a/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js +++ /dev/null @@ -1,90 +0,0 @@ -var vows = require('vows'), - assert = require('assert'), - iconv = require(__dirname+'/../'); - -var ascii = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'+ - ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f'; - -var encodings = [{ - name: "windows1254", - variations: ['windows-1254', 'win-1254', 'win1254', 'cp1254', 'cp-1254', 1254], - strings: { - empty: "", - ascii: ascii, - turkish: "€‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", - untranslatable: "\x81\x8d\x8e\x8f\x90\x9d\x9e" - }, - encodedStrings: { - empty: new Buffer(''), - ascii: new Buffer(ascii, 'binary'), - turkish: new Buffer( - '\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c' + - '\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9f' + - '\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf' + - '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' + - '\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' + - '\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' + - '\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' + - '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', - 'binary'), - } -}, { - name: "iso88599", - variations: ['iso-8859-9', 'turkish', 'turkish8', 'cp28599', 'cp-28599', 28599], - strings: { - empty: "", - ascii: ascii, - turkish: "\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ", - untranslatable: '' - }, - encodedStrings: { - empty: new Buffer(''), - ascii: new Buffer(ascii, 'binary'), - turkish: new Buffer( - '\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' + - '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf' + - '\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf' + - '\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf' + - '\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef' + - '\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff', - 'binary') - } -}]; - -var testsBatch = {}; -encodings.forEach(function(encoding) { - var enc = encoding.variations[0]; - var key = "turkish"; - var tests = { - "Convert to empty buffer": function() { - assert.strictEqual(iconv.toEncoding("", enc).toString('binary'), new Buffer('').toString('binary')); - }, - "Convert from empty buffer": function() { - assert.strictEqual(iconv.fromEncoding(new Buffer(''), enc), ""); - }, - "Convert from buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), - encoding.strings[key]); - }, - "Convert to buffer": function() { - for (var key in encoding.encodedStrings) - assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'), - encoding.encodedStrings[key].toString('binary')); - }, - "Try different variations of encoding": function() { - encoding.variations.forEach(function(enc) { - assert.strictEqual(iconv.fromEncoding(encoding.encodedStrings[key], enc), encoding.strings[key]); - assert.strictEqual(iconv.toEncoding(encoding.strings[key], enc).toString('binary'), encoding.encodedStrings[key].toString('binary')); - }); - }, - "Untranslatable chars are converted to defaultCharSingleByte": function() { - var expected = encoding.strings.untranslatable.split('').map(function(c) {return iconv.defaultCharSingleByte; }).join(''); - assert.strictEqual(iconv.toEncoding(encoding.strings.untranslatable, enc).toString('binary'), expected); // Only '?' characters. - } - }; - - testsBatch[encoding.name+":"] = tests; -}); - -vows.describe("Test Turkish encodings").addBatch(testsBatch).export(module); diff --git a/node_modules/grunt/node_modules/js-yaml/HISTORY.md b/node_modules/grunt/node_modules/js-yaml/HISTORY.md deleted file mode 100644 index dfc48c2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/HISTORY.md +++ /dev/null @@ -1,155 +0,0 @@ -2.0.5 / 2013-04-26 ------------------- - -* Close security issue in !!js/function constructor. - Big thanks to @nealpoole for security audit. - - -2.0.4 / 2013-04-08 ------------------- - -* Updated .npmignore to reduce package size - - -2.0.3 / 2013-02-26 ------------------- - -* Fixed dumping of empty arrays ans objects. ([] and {} instead of null) - - -2.0.2 / 2013-02-15 ------------------- - -* Fixed input validation: tabs are printable characters. - - -2.0.1 / 2013-02-09 ------------------- - -* Fixed error, when options not passed to function cass - - -2.0.0 / 2013-02-09 ------------------- - -* Full rewrite. New architecture. Fast one-stage parsing. -* Changed custom types API. -* Added YAML dumper. - - -1.0.3 / 2012-11-05 ------------------- - -* Fixed utf-8 files loading. - - -1.0.2 / 2012-08-02 ------------------- - -* Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. -* Fix timstamps incorectly parsed in local time when no time part specified. - - -1.0.1 / 2012-07-07 ------------------- - -* Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. -* Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. - - -1.0.0 / 2012-07-01 ------------------- - -* `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. - Fixes #42. -* `require(filename)` now returns a single document and throws an Error if - file contains more than one document. -* CLI was merged back from js-yaml.bin - - -0.3.7 / 2012-02-28 ------------------- - -* Fix export of `addConstructor()`. Closes #39. - - -0.3.6 / 2012-02-22 ------------------- - -* Removed AMD parts - too buggy to use. Need help to rewrite from scratch -* Removed YUI compressor warning (renamed `double` variable). Closes #40. - - -0.3.5 / 2012-01-10 ------------------- - -* Workagound for .npmignore fuckup under windows. Thanks to airportyh. - - -0.3.4 / 2011-12-24 ------------------- - -* Fixes str[] for oldIEs support. -* Adds better has change support for browserified demo. -* improves compact output of Error. Closes #33. - - -0.3.3 / 2011-12-20 ------------------- - -* jsyaml executable moved to separate module. -* adds `compact` stringification of Errors. - - -0.3.2 / 2011-12-16 ------------------- - -* Fixes ug with block style scalars. Closes #26. -* All sources are passing JSLint now. -* Fixes bug in Safari. Closes #28. -* Fixes bug in Opers. Closes #29. -* Improves browser support. Closes #20. -* Added jsyaml executable. -* Added !!js/function support. Closes #12. - - -0.3.1 / 2011-11-18 ------------------- - -* Added AMD support for browserified version. -* Wrapped browserified js-yaml into closure. -* Fixed the resolvement of non-specific tags. Closes #17. -* Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. -* Added !!js/regexp and !!js/undefined types. Partially solves #12. -* Fixed !!set mapping. -* Fixed month parse in dates. Closes #19. - - -0.3.0 / 2011-11-09 ------------------- - -* Removed JS.Class dependency. Closes #3. -* Added browserified version. Closes #13. -* Added live demo of browserified version. -* Ported some of the PyYAML tests. See #14. -* Fixed timestamp bug when fraction was given. - - -0.2.2 / 2011-11-06 ------------------- - -* Fixed crash on docs without ---. Closes #8. -* Fixed miltiline string parse -* Fixed tests/comments for using array as key - - -0.2.1 / 2011-11-02 ------------------- - -* Fixed short file read (<4k). Closes #9. - - -0.2.0 / 2011-11-02 ------------------- - -* First public release diff --git a/node_modules/grunt/node_modules/js-yaml/LICENSE b/node_modules/grunt/node_modules/js-yaml/LICENSE deleted file mode 100644 index 0f16ee9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2011, 2013 by Vitaly Puzrin - -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/grunt/node_modules/js-yaml/README.md b/node_modules/grunt/node_modules/js-yaml/README.md deleted file mode 100644 index e326d60..0000000 --- a/node_modules/grunt/node_modules/js-yaml/README.md +++ /dev/null @@ -1,249 +0,0 @@ -JS-YAML - YAML 1.2 parser and serializer for JavaScript -======================================================= - -[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml) - -[Online Demo](http://nodeca.github.com/js-yaml/) - - -This is an implementation of [YAML](http://yaml.org/), a human friendly data -serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was -completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. - - -Breaking changes in 1.x.x -> 2.0.x ----------------------------------- - -If your have not used __custom__ tags or loader classes - no changes needed. Just -upgrade library and enjoy high parse speed. - -In other case, you should rewrite your tag constructors and custom loader -classes, to conform new schema-based API. See -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and -[wiki](https://github.com/nodeca/js-yaml/wiki) for details. -Note, that parser internals were completely rewritten. - - -Installation ------------- - -### YAML module for node.js - -``` -npm install js-yaml -``` - - -### CLI executable - -If you want to inspect your YAML files from CLI, install js-yaml globally: - -``` -npm install js-yaml -g -``` - -#### Usage - -``` -usage: js-yaml [-h] [-v] [-c] [-j] [-t] file - -Positional arguments: - file File with YAML document(s) - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -c, --compact Display errors in compact mode - -j, --to-json Output a non-funky boring JSON - -t, --trace Show stack trace on error -``` - - -### Bundled YAML library for browsers - -``` html - - -``` - -Browser support was done mostly for online demo. If you find any errors - feel -free to send pull requests with fixes. Also note, that IE and other old browsers -needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. - - -API ---- - -Here we cover the most 'useful' methods. If you need advanced details (creating -your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and -[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more -info. - -In node.js JS-YAML automatically registers handlers for `.yml` and `.yaml` -files. You can load them just with `require`. That's mostly equivalent to -calling `load()` on fetched content of a file. Just with one string! - -``` javascript -require('js-yaml'); - -// Get document, or throw exception on error -try { - var doc = require('/home/ixti/example.yml'); - console.log(doc); -} catch (e) { - console.log(e); -} -``` - - -### load (string [ , options ]) - -Parses `string` as single YAML document. Returns a JavaScript object or throws -`YAMLException` on error. - -NOTE: This function **does not** understands multi-document sources, it throws -exception on those. - -options: - -- `filename` _(default: null)_ - string to be used as a file path in - error/warning messages. -- `strict` _(default - false)_ makes the loader to throw errors instead of - warnings. -- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use. - - -### loadAll (string, iterator [ , options ]) - -Same as `load()`, but understands multi-document sources and apply `iterator` to -each document. - -``` javascript -var yaml = require('js-yaml'); - -yaml.loadAll(data, function (doc) { - console.log(doc); -}); -``` - - -### safeLoad (string [ , options ]) - -Same as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### safeLoadAll (string, iterator [ , options ]) - -Same as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -### dump (object [ , options ]) - -Serializes `object` as YAML document. - -options: - -- `indent` _(default: 2)_ - indentation width to use (in spaces). -- `flowLevel` (default: -1) - specifies level of nesting, when to switch from - block to flow style for collections. -1 means block style everwhere -- `styles` - "tag" => "style" map. Each tag may have own set of styles. -- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use. - -styles: - -``` none -!!null - "canonical" => "~" - -!!int - "binary" => "0b1", "0b101010", "0b1110001111010" - "octal" => "01", "052", "016172" - "decimal" => "1", "42", "7290" - "hexadecimal" => "0x1", "0x2A", "0x1C7A" - -!!null, !!bool, !!float - "lowercase" => "null", "true", "false", ".nan", '.inf' - "uppercase" => "NULL", "TRUE", "FALSE", ".NAN", '.INF' - "camelcase" => "Null", "True", "False", ".NaN", '.Inf' -``` - -By default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`. - - -### safeDump (object [ , options ]) - -Same as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of -YAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`). - - -Supported YAML types --------------------- - -The list of standard YAML tags and corresponding JavaScipt types. See also -[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and -[YAML types repository](http://yaml.org/type/). - -``` -!!null '' # null -!!bool 'yes' # bool -!!int '3...' # number -!!float '3.14...' # number -!!binary '...base64...' # buffer -!!timestamp 'YYYY-...' # date -!!omap [ ... ] # array of key-value pairs -!!pairs [ ... ] # array or array pairs -!!set { ... } # array of objects with given keys and null values -!!str '...' # string -!!seq [ ... ] # array -!!map { ... } # object -``` - -**JavaScript-specific tags** - -``` -!!js/regexp /pattern/gim # RegExp -!!js/undefined '' # Undefined -!!js/function 'function () {...}' # Function -``` - - - - -## Caveats - -Note, that you use arrays or objects as key in JS-YAML. JS do not allows objects -or array as keys, and stringifies (by calling .toString method) them at the -moment of adding them. - -``` yaml ---- -? [ foo, bar ] -: - baz -? { foo: bar } -: - baz - - baz -``` - -``` javascript -{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } -``` - -Also, reading of properties on implicit block mapping keys is not supported yet. -So, the following YAML document cannot be loaded. - -``` yaml -&anchor foo: - foo: bar - *anchor: duplicate key - baz: bat - *anchor: duplicate key -``` - -## License - -View the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file -(MIT). diff --git a/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js b/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js deleted file mode 100755 index 5110a4c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js +++ /dev/null @@ -1,125 +0,0 @@ -#!/usr/bin/env node - - -'use strict'; - - -// stdlib -var fs = require('fs'); -var util = require('util'); - - -// 3rd-party -var ArgumentParser = require('argparse').ArgumentParser; - - -// internal -var yaml = require('..'); - - -//////////////////////////////////////////////////////////////////////////////// - - -var cli = new ArgumentParser({ - prog: 'js-yaml', - version: require('../package.json').version, - addHelp: true -}); - - -cli.addArgument(['-c', '--compact'], { - help: 'Display errors in compact mode', - action: 'storeTrue' -}); - - -cli.addArgument(['-j', '--to-json'], { - help: 'Output a non-funky boring JSON', - dest: 'json', - action: 'storeTrue' -}); - - -cli.addArgument(['-t', '--trace'], { - help: 'Show stack trace on error', - action: 'storeTrue' -}); - - -cli.addArgument(['file'], { - help: 'File to read' -}); - - -//////////////////////////////////////////////////////////////////////////////// - - -var options = cli.parseArgs(); - - -//////////////////////////////////////////////////////////////////////////////// - - -fs.readFile(options.file, 'utf8', function (error, input) { - var output, isYaml; - - if (error) { - if ('ENOENT' === error.code) { - console.error('File not found: ' + options.file); - process.exit(2); - } - - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - - try { - output = JSON.parse(input); - isYaml = false; - } catch (error) { - if (error instanceof SyntaxError) { - try { - output = []; - yaml.loadAll(input, function (doc) { output.push(doc); }, {}); - isYaml = true; - - if (0 === output.length) { - output = null; - } else if (1 === output.length) { - output = output[0]; - } - } catch (error) { - if (options.trace && error.stack) { - console.error(error.stack); - } else { - console.error(error.toString(options.compact)); - } - - process.exit(1); - } - } else { - console.error( - options.trace && error.stack || - error.message || - String(error)); - - process.exit(1); - } - } - - if (isYaml) { - if (options.json) { - console.log(JSON.stringify(output, null, ' ')); - } else { - console.log("\n" + util.inspect(output, false, 10, true) + "\n"); - } - } else { - console.log(yaml.dump(output)); - } - - process.exit(0); -}); diff --git a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js b/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js deleted file mode 100644 index 1cb987c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - - -var fs = require('fs'); -var path = require('path'); -var util = require('util'); -var yaml = require('../lib/js-yaml'); - - -// Let define a couple of classes... - -function Point(x, y, z) { - this.klass = 'Point'; - this.x = x; - this.y = y; - this.z = z; -} - - -function Space(height, width, points) { - if (points) { - if (!points.every(function (point) { return point instanceof Point; })) { - throw new Error('A non-Point inside a points array!'); - } - } - - this.klass = 'Space'; - this.height = height; - this.width = width; - this.points = points; -} - - -// Let define YAML types to load and dump our Point/Space objects. - -var pointYamlType = new yaml.Type('!point', { - // The information used to load a Point. - loader: { - kind: 'array', // It must be an array. (sequence in YAML) - resolver: function (object) { - // It must contain exactly tree elements. - if (3 === object.length) { - return new Point(object[0], object[1], object[2]); - - // Otherwise, it is NOT a Point. - } else { - return yaml.NIL; - } - } - }, - // The information used to dump a Point. - dumper: { - kind: 'object', // It must be an object but not an array. - instanceOf: Point, // Also, it must be an instance of Point class. - representer: function (point) { - // And it should be represented in YAML as three-element sequence. - return [ point.x, point.y, point.z ]; - } - } -}); - - -var spaceYamlType = new yaml.Type('!space', { - loader: { - kind: 'object', // 'object' here means 'mapping' in YAML. - resolver: function (object) { - return new Space(object.height, object.width, object.points); - } - }, - dumper: { - kind: 'object', - instanceOf: Space - // The representer is omitted here. So, Space objects will be dumped as is. - // That is regular mapping with three key-value pairs but with !space tag. - } -}); - - -// After our types are defined, it's time to join them into a schema. - -var SPACE_SCHEMA = yaml.Schema.create([ spaceYamlType, pointYamlType ]); - - -// And read a document using that schema. - -fs.readFile(path.join(__dirname, 'custom_types.yaml'), 'utf8', function (error, data) { - var loaded; - - if (!error) { - loaded = yaml.load(data, { schema: SPACE_SCHEMA }); - console.log(util.inspect(loaded, false, 20, true)); - } else { - console.error(error.stack || error.message || String(error)); - } -}); - - -// There are some exports to play with this example interactively. - -module.exports.Point = Point; -module.exports.Space = Space; -module.exports.pointYamlType = pointYamlType; -module.exports.spaceYamlType = spaceYamlType; -module.exports.SPACE_SCHEMA = SPACE_SCHEMA; diff --git a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml b/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml deleted file mode 100644 index 033134f..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml +++ /dev/null @@ -1,18 +0,0 @@ -subject: Custom types in JS-YAML -spaces: -- !space - height: 1000 - width: 1000 - points: - - !point [ 10, 43, 23 ] - - !point [ 165, 0, 50 ] - - !point [ 100, 100, 100 ] - -- !space - height: 64 - width: 128 - points: - - !point [ 12, 43, 0 ] - - !point [ 1, 4, 90 ] - -- !space {} # An empty space diff --git a/node_modules/grunt/node_modules/js-yaml/examples/dumper.js b/node_modules/grunt/node_modules/js-yaml/examples/dumper.js deleted file mode 100644 index 7952b18..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/dumper.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - - -var yaml = require('../lib/js-yaml'); -var object = require('./dumper.json'); - - -console.log(yaml.dump(object, { - flowLevel: 3, - styles: { - '!!int' : 'hexadecimal', - '!!null' : 'camelcase' - } -})); - - -// Output: -//============================================================================== -// name: Wizzard -// level: 0x11 -// sanity: Null -// inventory: -// - name: Hat -// features: [magic, pointed] -// traits: {} -// - name: Staff -// features: [] -// traits: {damage: 0xA} -// - name: Cloak -// features: [old] -// traits: {defence: 0x0, comfort: 0x3} diff --git a/node_modules/grunt/node_modules/js-yaml/examples/dumper.json b/node_modules/grunt/node_modules/js-yaml/examples/dumper.json deleted file mode 100644 index 9f54c05..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/dumper.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name" : "Wizzard", - "level" : 17, - "sanity" : null, - "inventory" : [ - { - "name" : "Hat", - "features" : [ "magic", "pointed" ], - "traits" : {} - }, - { - "name" : "Staff", - "features" : [], - "traits" : { "damage" : 10 } - }, - { - "name" : "Cloak", - "features" : [ "old" ], - "traits" : { "defence" : 0, "comfort" : 3 } - } - ] -} diff --git a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js b/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js deleted file mode 100644 index 1ce370d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - - -var inspect = require('util').inspect; - -// just require jsyaml -require('../lib/js-yaml'); - - -try { - var doc = require(__dirname + '/sample_document.yaml'); - console.log(inspect(doc, false, 10, true)); -} catch (e) { - console.log(e.stack || e.toString()); -} diff --git a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml b/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml deleted file mode 100644 index 4479ee9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# Collection Types ############################################################# -################################################################################ - -# http://yaml.org/type/map.html -----------------------------------------------# - -map: - # Unordered set of key: value pairs. - Block style: !!map - Clark : Evans - Ingy : döt Net - Oren : Ben-Kiki - Flow style: !!map { Clark: Evans, Ingy: döt Net, Oren: Ben-Kiki } - -# http://yaml.org/type/omap.html ----------------------------------------------# - -omap: - # Explicitly typed ordered map (dictionary). - Bestiary: !!omap - - aardvark: African pig-like ant eater. Ugly. - - anteater: South-American ant eater. Two species. - - anaconda: South-American constrictor snake. Scaly. - # Etc. - # Flow style - Numbers: !!omap [ one: 1, two: 2, three : 3 ] - -# http://yaml.org/type/pairs.html ---------------------------------------------# - -pairs: - # Explicitly typed pairs. - Block tasks: !!pairs - - meeting: with team. - - meeting: with boss. - - break: lunch. - - meeting: with client. - Flow tasks: !!pairs [ meeting: with team, meeting: with boss ] - -# http://yaml.org/type/set.html -----------------------------------------------# - -set: - # Explicitly typed set. - baseball players: !!set - ? Mark McGwire - ? Sammy Sosa - ? Ken Griffey - # Flow style - baseball teams: !!set { Boston Red Sox, Detroit Tigers, New York Yankees } - -# http://yaml.org/type/seq.html -----------------------------------------------# - -seq: - # Ordered sequence of nodes - Block style: !!seq - - Mercury # Rotates - no light/dark sides. - - Venus # Deadliest. Aptly named. - - Earth # Mostly dirt. - - Mars # Seems empty. - - Jupiter # The king. - - Saturn # Pretty. - - Uranus # Where the sun hardly shines. - - Neptune # Boring. No rings. - - Pluto # You call this a planet? - Flow style: !!seq [ Mercury, Venus, Earth, Mars, # Rocks - Jupiter, Saturn, Uranus, Neptune, # Gas - Pluto ] # Overrated - - -# Scalar Types ################################################################# -################################################################################ - -# http://yaml.org/type/binary.html --------------------------------------------# - -binary: - canonical: !!binary "\ - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=" - generic: !!binary | - R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 - OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ - +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC - AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= - description: - The binary value above is a tiny arrow encoded as a gif image. - -# http://yaml.org/type/bool.html ----------------------------------------------# - -bool: - - true - - True - - TRUE - - false - - False - - FALSE - -# http://yaml.org/type/float.html ---------------------------------------------# - -float: - canonical: 6.8523015e+5 - exponentioal: 685.230_15e+03 - fixed: 685_230.15 - sexagesimal: 190:20:30.15 - negative infinity: -.inf - not a number: .NaN - -# http://yaml.org/type/int.html -----------------------------------------------# - -int: - canonical: 685230 - decimal: +685_230 - octal: 02472256 - hexadecimal: 0x_0A_74_AE - binary: 0b1010_0111_0100_1010_1110 - sexagesimal: 190:20:30 - -# http://yaml.org/type/merge.html ---------------------------------------------# - -merge: - - &CENTER { x: 1, y: 2 } - - &LEFT { x: 0, y: 2 } - - &BIG { r: 10 } - - &SMALL { r: 1 } - - # All the following maps are equal: - - - # Explicit keys - x: 1 - y: 2 - r: 10 - label: nothing - - - # Merge one map - << : *CENTER - r: 10 - label: center - - - # Merge multiple maps - << : [ *CENTER, *BIG ] - label: center/big - - - # Override - << : [ *BIG, *LEFT, *SMALL ] - x: 1 - label: big/left/small - -# http://yaml.org/type/null.html ----------------------------------------------# - -null: - # This mapping has four keys, - # one has a value. - empty: - canonical: ~ - english: null - ~: null key - # This sequence has five - # entries, two have values. - sparse: - - ~ - - 2nd entry - - - - 4th entry - - Null - -# http://yaml.org/type/str.html -----------------------------------------------# - -string: abcd - -# http://yaml.org/type/timestamp.html -----------------------------------------# - -timestamp: - canonical: 2001-12-15T02:59:43.1Z - valid iso8601: 2001-12-14t21:59:43.10-05:00 - space separated: 2001-12-14 21:59:43.10 -5 - no time zone (Z): 2001-12-15 2:59:43.10 - date (00:00:00Z): 2002-12-14 - - -# JavaScript Specific Types #################################################### -################################################################################ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp - -regexp: - simple: !!js/regexp foobar - modifiers: !!js/regexp /foobar/mi - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/undefined - -undefined: !!js/undefined ~ - -# https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function - -function: !!js/function > - function foobar() { - return 'Wow! JS-YAML Rocks!'; - } diff --git a/node_modules/grunt/node_modules/js-yaml/index.js b/node_modules/grunt/node_modules/js-yaml/index.js deleted file mode 100644 index 40606dd..0000000 --- a/node_modules/grunt/node_modules/js-yaml/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/js-yaml.js'); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js deleted file mode 100644 index a5146a3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js +++ /dev/null @@ -1,33 +0,0 @@ -'use strict'; - - -var loader = require('./js-yaml/loader'); -var dumper = require('./js-yaml/dumper'); - - -function deprecated(name) { - return function () { - throw new Error('Function ' + name + ' is deprecated and cannot be used.'); - }; -} - - -module.exports.Type = require('./js-yaml/type'); -module.exports.Schema = require('./js-yaml/schema'); -module.exports.MINIMAL_SCHEMA = require('./js-yaml/schema/minimal'); -module.exports.SAFE_SCHEMA = require('./js-yaml/schema/safe'); -module.exports.DEFAULT_SCHEMA = require('./js-yaml/schema/default'); -module.exports.load = loader.load; -module.exports.loadAll = loader.loadAll; -module.exports.safeLoad = loader.safeLoad; -module.exports.safeLoadAll = loader.safeLoadAll; -module.exports.dump = dumper.dump; -module.exports.safeDump = dumper.safeDump; -module.exports.YAMLException = require('./js-yaml/exception'); -module.exports.scan = deprecated('scan'); -module.exports.parse = deprecated('parse'); -module.exports.compose = deprecated('compose'); -module.exports.addConstructor = deprecated('addConstructor'); - - -require('./js-yaml/require'); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js deleted file mode 100644 index cc7f824..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - - -var NIL = {}; - - -function isNothing(subject) { - return (undefined === subject) || (null === subject); -} - - -function isObject(subject) { - return ('object' === typeof subject) && (null !== subject); -} - - -function toArray(sequence) { - if (Array.isArray(sequence)) { - return sequence; - } else if (isNothing(sequence)) { - return []; - } else { - return [ sequence ]; - } -} - - -function extend(target, source) { - var index, length, key, sourceKeys; - - if (source) { - sourceKeys = Object.keys(source); - - for (index = 0, length = sourceKeys.length; index < length; index += 1) { - key = sourceKeys[index]; - target[key] = source[key]; - } - } - - return target; -} - - -function repeat(string, count) { - var result = '', cycle; - - for (cycle = 0; cycle < count; cycle += 1) { - result += string; - } - - return result; -} - - -module.exports.NIL = NIL; -module.exports.isNothing = isNothing; -module.exports.isObject = isObject; -module.exports.toArray = toArray; -module.exports.repeat = repeat; -module.exports.extend = extend; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js deleted file mode 100644 index 2385f56..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js +++ /dev/null @@ -1,437 +0,0 @@ -'use strict'; - - -var common = require('./common'); -var NIL = common.NIL; -var YAMLException = require('./exception'); -var DEFAULT_SCHEMA = require('./schema/default'); -var SAFE_SCHEMA = require('./schema/safe'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var CHAR_TAB = 0x09; /* Tab */ -var CHAR_LINE_FEED = 0x0A; /* LF */ -var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ -var CHAR_SPACE = 0x20; /* Space */ -var CHAR_EXCLAMATION = 0x21; /* ! */ -var CHAR_DOUBLE_QUOTE = 0x22; /* " */ -var CHAR_SHARP = 0x23; /* # */ -var CHAR_PERCENT = 0x25; /* % */ -var CHAR_AMPERSAND = 0x26; /* & */ -var CHAR_SINGLE_QUOTE = 0x27; /* ' */ -var CHAR_ASTERISK = 0x2A; /* * */ -var CHAR_COMMA = 0x2C; /* , */ -var CHAR_MINUS = 0x2D; /* - */ -var CHAR_COLON = 0x3A; /* : */ -var CHAR_GREATER_THAN = 0x3E; /* > */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - - -var ESCAPE_SEQUENCES = {}; - -ESCAPE_SEQUENCES[0x00] = '\\0'; -ESCAPE_SEQUENCES[0x07] = '\\a'; -ESCAPE_SEQUENCES[0x08] = '\\b'; -ESCAPE_SEQUENCES[0x09] = '\\t'; -ESCAPE_SEQUENCES[0x0A] = '\\n'; -ESCAPE_SEQUENCES[0x0B] = '\\v'; -ESCAPE_SEQUENCES[0x0C] = '\\f'; -ESCAPE_SEQUENCES[0x0D] = '\\r'; -ESCAPE_SEQUENCES[0x1B] = '\\e'; -ESCAPE_SEQUENCES[0x22] = '\\"'; -ESCAPE_SEQUENCES[0x5C] = '\\\\'; -ESCAPE_SEQUENCES[0x85] = '\\N'; -ESCAPE_SEQUENCES[0xA0] = '\\_'; -ESCAPE_SEQUENCES[0x2028] = '\\L'; -ESCAPE_SEQUENCES[0x2029] = '\\P'; - - -function kindOf(object) { - var kind = typeof object; - - if (null === object) { - return 'null'; - } else if ('number' === kind) { - return 0 === object % 1 ? 'integer' : 'float'; - } else if ('object' === kind && Array.isArray(object)) { - return 'array'; - } else { - return kind; - } -} - - -function compileStyleMap(schema, map) { - var result, keys, index, length, tag, style, type; - - if (null === map) { - return {}; - } - - result = {}; - keys = Object.keys(map); - - for (index = 0, length = keys.length; index < length; index += 1) { - tag = keys[index]; - style = String(map[tag]); - - if ('!!' === tag.slice(0, 2)) { - tag = 'tag:yaml.org,2002:' + tag.slice(2); - } - - type = schema.compiledTypeMap[tag]; - - if (type && type.dumper) { - if (_hasOwnProperty.call(type.dumper.styleAliases, style)) { - style = type.dumper.styleAliases[style]; - } - } - - result[tag] = style; - } - - return result; -} - - -function encodeHex(character) { - var string, handle, length; - - string = character.toString(16).toUpperCase(); - - if (character <= 0xFF) { - handle = 'x'; - length = 2; - } else if (character <= 0xFFFF) { - handle = 'u'; - length = 4; - } else if (character <= 0xFFFFFFFF) { - handle = 'U'; - length = 8; - } else { - throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); - } - - return '\\' + handle + common.repeat('0', length - string.length) + string; -} - - -function dump(input, options) { - options = options || {}; - - var schema = options['schema'] || DEFAULT_SCHEMA, - indent = Math.max(1, (options['indent'] || 2)), - flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']), - styleMap = compileStyleMap(schema, options['styles'] || null), - - implicitTypes = schema.compiledImplicit, - explicitTypes = schema.compiledExplicit, - - kind, - tag, - result; - - function generateNextLine(level) { - return '\n' + common.repeat(' ', indent * level); - } - - function testImplicitResolving(object) { - var index, length, type; - - for (index = 0, length = implicitTypes.length; index < length; index += 1) { - type = implicitTypes[index]; - - if (null !== type.loader && - NIL !== type.loader.resolver(object, false)) { - return true; - } - } - - return false; - } - - function writeScalar(object) { - var isQuoted, checkpoint, position, length, character; - - result = ''; - isQuoted = false; - checkpoint = 0; - - if (0 === object.length || - CHAR_SPACE === object.charCodeAt(0) || - CHAR_SPACE === object.charCodeAt(object.length - 1)) { - isQuoted = true; - } - - for (position = 0, length = object.length; position < length; position += 1) { - character = object.charCodeAt(position); - - if (!isQuoted) { - if (CHAR_TAB === character || - CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character || - CHAR_COMMA === character || - CHAR_LEFT_SQUARE_BRACKET === character || - CHAR_RIGHT_SQUARE_BRACKET === character || - CHAR_LEFT_CURLY_BRACKET === character || - CHAR_RIGHT_CURLY_BRACKET === character || - CHAR_SHARP === character || - CHAR_AMPERSAND === character || - CHAR_ASTERISK === character || - CHAR_EXCLAMATION === character || - CHAR_VERTICAL_LINE === character || - CHAR_GREATER_THAN === character || - CHAR_SINGLE_QUOTE === character || - CHAR_DOUBLE_QUOTE === character || - CHAR_PERCENT === character || - CHAR_COMMERCIAL_AT === character || - CHAR_GRAVE_ACCENT === character || - CHAR_QUESTION === character || - CHAR_COLON === character || - CHAR_MINUS === character) { - isQuoted = true; - } - } - - if (ESCAPE_SEQUENCES[character] || - !((0x00020 <= character && character <= 0x00007E) || - (0x00085 === character) || - (0x000A0 <= character && character <= 0x00D7FF) || - (0x0E000 <= character && character <= 0x00FFFD) || - (0x10000 <= character && character <= 0x10FFFF))) { - result += object.slice(checkpoint, position); - result += ESCAPE_SEQUENCES[character] || encodeHex(character); - checkpoint = position + 1; - isQuoted = true; - } - } - - if (checkpoint < position) { - result += object.slice(checkpoint, position); - } - - if (!isQuoted && testImplicitResolving(result)) { - isQuoted = true; - } - - if (isQuoted) { - result = '"' + result + '"'; - } - } - - function writeFlowSequence(level, object) { - var _result = '', - _tag = tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - if (0 !== index) { - _result += ', '; - } - - writeNode(level, object[index], false, false); - _result += result; - } - - tag = _tag; - result = '[' + _result + ']'; - } - - function writeBlockSequence(level, object, compact) { - var _result = '', - _tag = tag, - index, - length; - - for (index = 0, length = object.length; index < length; index += 1) { - if (!compact || 0 !== index) { - _result += generateNextLine(level); - } - - writeNode(level + 1, object[index], true, true); - _result += '- ' + result; - } - - tag = _tag; - result = _result; - } - - function writeFlowMapping(level, object) { - var _result = '', - _tag = tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - if (0 !== index) { - _result += ', '; - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - writeNode(level, objectKey, false, false); - - if (result.length > 1024) { - _result += '? '; - } - - _result += result + ': '; - writeNode(level, objectValue, false, false); - _result += result; - } - - tag = _tag; - result = '{' + _result + '}'; - } - - function writeBlockMapping(level, object, compact) { - var _result = '', - _tag = tag, - objectKeyList = Object.keys(object), - index, - length, - objectKey, - objectValue, - explicitPair; - - for (index = 0, length = objectKeyList.length; index < length; index += 1) { - if (!compact || 0 !== index) { - _result += generateNextLine(level); - } - - objectKey = objectKeyList[index]; - objectValue = object[objectKey]; - - writeNode(level + 1, objectKey, true, true); - explicitPair = (null !== tag && '?' !== tag && result.length <= 1024); - - if (explicitPair) { - _result += '? '; - } - - _result += result; - - if (explicitPair) { - _result += generateNextLine(level); - } - - writeNode(level + 1, objectValue, true, explicitPair); - _result += ': ' + result; - } - - tag = _tag; - result = _result; - } - - function detectType(object, explicit) { - var _result, typeList, index, length, type, style; - - typeList = explicit ? explicitTypes : implicitTypes; - kind = kindOf(object); - - for (index = 0, length = typeList.length; index < length; index += 1) { - type = typeList[index]; - - if ((null !== type.dumper) && - (null === type.dumper.kind || kind === type.dumper.kind) && - (null === type.dumper.instanceOf || object instanceof type.dumper.instanceOf) && - (null === type.dumper.predicate || type.dumper.predicate(object))) { - tag = explicit ? type.tag : '?'; - - if (null !== type.dumper.representer) { - style = styleMap[type.tag] || type.dumper.defaultStyle; - - if ('function' === typeof type.dumper.representer) { - _result = type.dumper.representer(object, style); - } else if (_hasOwnProperty.call(type.dumper.representer, style)) { - _result = type.dumper.representer[style](object, style); - } else { - throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); - } - - if (NIL !== _result) { - kind = kindOf(_result); - result = _result; - } else { - if (explicit) { - throw new YAMLException('cannot represent an object of !<' + type.tag + '> type'); - } else { - continue; - } - } - } - - return true; - } - } - - return false; - } - - function writeNode(level, object, block, compact) { - tag = null; - result = object; - - if (!detectType(object, false)) { - detectType(object, true); - } - - if (block) { - block = (0 > flowLevel || flowLevel > level); - } - - if ((null !== tag && '?' !== tag) || (2 !== indent && level > 0)) { - compact = false; - } - - if ('object' === kind) { - if (block && (0 !== Object.keys(result).length)) { - writeBlockMapping(level, result, compact); - } else { - writeFlowMapping(level, result); - } - } else if ('array' === kind) { - if (block && (0 !== result.length)) { - writeBlockSequence(level, result, compact); - } else { - writeFlowSequence(level, result); - } - } else if ('string' === kind) { - if ('?' !== tag) { - writeScalar(result); - } - } else { - throw new YAMLException('unacceptabe kind of an object to dump (' + kind + ')'); - } - - if (null !== tag && '?' !== tag) { - result = '!<' + tag + '> ' + result; - } - } - - writeNode(0, input, true, true); - return result + '\n'; -} - - -function safeDump(input, options) { - return dump(input, common.extend({ schema: SAFE_SCHEMA }, options)); -} - - -module.exports.dump = dump; -module.exports.safeDump = safeDump; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js deleted file mode 100644 index 479ba88..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - - -function YAMLException(reason, mark) { - this.name = 'YAMLException'; - this.reason = reason; - this.mark = mark; - this.message = this.toString(false); -} - - -YAMLException.prototype.toString = function toString(compact) { - var result; - - result = 'JS-YAML: ' + (this.reason || '(unknown reason)'); - - if (!compact && this.mark) { - result += ' ' + this.mark.toString(); - } - - return result; -}; - - -module.exports = YAMLException; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js deleted file mode 100644 index bdc71d1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js +++ /dev/null @@ -1,1549 +0,0 @@ -'use strict'; - - -var common = require('./common'); -var YAMLException = require('./exception'); -var Mark = require('./mark'); -var NIL = common.NIL; -var SAFE_SCHEMA = require('./schema/safe'); -var DEFAULT_SCHEMA = require('./schema/default'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -var KIND_STRING = 'string'; -var KIND_ARRAY = 'array'; -var KIND_OBJECT = 'object'; - - -var CONTEXT_FLOW_IN = 1; -var CONTEXT_FLOW_OUT = 2; -var CONTEXT_BLOCK_IN = 3; -var CONTEXT_BLOCK_OUT = 4; - - -var CHOMPING_CLIP = 1; -var CHOMPING_STRIP = 2; -var CHOMPING_KEEP = 3; - - -var CHAR_TAB = 0x09; /* Tab */ -var CHAR_LINE_FEED = 0x0A; /* LF */ -var CHAR_CARRIAGE_RETURN = 0x0D; /* CR */ -var CHAR_SPACE = 0x20; /* Space */ -var CHAR_EXCLAMATION = 0x21; /* ! */ -var CHAR_DOUBLE_QUOTE = 0x22; /* " */ -var CHAR_SHARP = 0x23; /* # */ -var CHAR_PERCENT = 0x25; /* % */ -var CHAR_AMPERSAND = 0x26; /* & */ -var CHAR_SINGLE_QUOTE = 0x27; /* ' */ -var CHAR_ASTERISK = 0x2A; /* * */ -var CHAR_PLUS = 0x2B; /* + */ -var CHAR_COMMA = 0x2C; /* , */ -var CHAR_MINUS = 0x2D; /* - */ -var CHAR_DOT = 0x2E; /* . */ -var CHAR_SLASH = 0x2F; /* / */ -var CHAR_DIGIT_ZERO = 0x30; /* 0 */ -var CHAR_DIGIT_ONE = 0x31; /* 1 */ -var CHAR_DIGIT_NINE = 0x39; /* 9 */ -var CHAR_COLON = 0x3A; /* : */ -var CHAR_LESS_THAN = 0x3C; /* < */ -var CHAR_GREATER_THAN = 0x3E; /* > */ -var CHAR_QUESTION = 0x3F; /* ? */ -var CHAR_COMMERCIAL_AT = 0x40; /* @ */ -var CHAR_CAPITAL_A = 0x41; /* A */ -var CHAR_CAPITAL_F = 0x46; /* F */ -var CHAR_CAPITAL_L = 0x4C; /* L */ -var CHAR_CAPITAL_N = 0x4E; /* N */ -var CHAR_CAPITAL_P = 0x50; /* P */ -var CHAR_CAPITAL_U = 0x55; /* U */ -var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ -var CHAR_BACKSLASH = 0x5C; /* \ */ -var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ -var CHAR_UNDERSCORE = 0x5F; /* _ */ -var CHAR_GRAVE_ACCENT = 0x60; /* ` */ -var CHAR_SMALL_A = 0x61; /* a */ -var CHAR_SMALL_B = 0x62; /* b */ -var CHAR_SMALL_E = 0x65; /* e */ -var CHAR_SMALL_F = 0x66; /* f */ -var CHAR_SMALL_N = 0x6E; /* n */ -var CHAR_SMALL_R = 0x72; /* r */ -var CHAR_SMALL_T = 0x74; /* t */ -var CHAR_SMALL_U = 0x75; /* u */ -var CHAR_SMALL_V = 0x76; /* v */ -var CHAR_SMALL_X = 0x78; /* x */ -var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ -var CHAR_VERTICAL_LINE = 0x7C; /* | */ -var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ - - -var SIMPLE_ESCAPE_SEQUENCES = {}; - -SIMPLE_ESCAPE_SEQUENCES[CHAR_DIGIT_ZERO] = '\x00'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_A] = '\x07'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_B] = '\x08'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_T] = '\x09'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_TAB] = '\x09'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_N] = '\x0A'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_V] = '\x0B'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_F] = '\x0C'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_R] = '\x0D'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SMALL_E] = '\x1B'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SPACE] = ' '; -SIMPLE_ESCAPE_SEQUENCES[CHAR_DOUBLE_QUOTE] = '\x22'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_SLASH] = '/'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_BACKSLASH] = '\x5C'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_N] = '\x85'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_UNDERSCORE] = '\xA0'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_L] = '\u2028'; -SIMPLE_ESCAPE_SEQUENCES[CHAR_CAPITAL_P] = '\u2029'; - - -var HEXADECIMAL_ESCAPE_SEQUENCES = {}; - -HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_SMALL_X] = 2; -HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_SMALL_U] = 4; -HEXADECIMAL_ESCAPE_SEQUENCES[CHAR_CAPITAL_U] = 8; - - -var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uD800-\uDFFF\uFFFE\uFFFF]/; -var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; -var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; -var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; -var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; - - -function loadAll(input, output, options) { - options = options || {}; - - var filename = options['filename'] || null, - schema = options['schema'] || DEFAULT_SCHEMA, - resolve = options['resolve'] || true, - validate = options['validate'] || true, - strict = options['strict'] || false, - legacy = options['legacy'] || false, - - directiveHandlers = {}, - implicitTypes = schema.compiledImplicit, - typeMap = schema.compiledTypeMap, - - length = input.length, - position = 0, - line = 0, - lineStart = 0, - lineIndent = 0, - character = input.charCodeAt(position), - - version, - checkLineBreaks, - tagMap, - anchorMap, - tag, - anchor, - kind, - result; - - function generateError(message) { - return new YAMLException( - message, - new Mark(filename, input, position, line, (position - lineStart))); - } - - function throwError(message) { - throw generateError(message); - } - - function throwWarning(message) { - var error = generateError(message); - - if (strict) { - throw error; - } else { - console.warn(error.toString()); - } - } - - directiveHandlers['YAML'] = function handleYamlDirective(name, args) { - var match, major, minor; - - if (null !== version) { - throwError('duplication of %YAML directive'); - } - - if (1 !== args.length) { - throwError('YAML directive accepts exactly one argument'); - } - - match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); - - if (null === match) { - throwError('ill-formed argument of the YAML directive'); - } - - major = parseInt(match[1], 10); - minor = parseInt(match[2], 10); - - if (1 !== major) { - throwError('unacceptable YAML version of the document'); - } - - version = args[0]; - checkLineBreaks = (minor < 2); - - if (1 !== minor && 2 !== minor) { - throwWarning('unsupported YAML version of the document'); - } - }; - - directiveHandlers['TAG'] = function handleTagDirective(name, args) { - var handle, prefix; - - if (2 !== args.length) { - throwError('TAG directive accepts exactly two arguments'); - } - - handle = args[0]; - prefix = args[1]; - - if (!PATTERN_TAG_HANDLE.test(handle)) { - throwError('ill-formed tag handle (first argument) of the TAG directive'); - } - - if (_hasOwnProperty.call(tagMap, handle)) { - throwError('there is a previously declared suffix for "' + handle + '" tag handle'); - } - - if (!PATTERN_TAG_URI.test(prefix)) { - throwError('ill-formed tag prefix (second argument) of the TAG directive'); - } - - tagMap[handle] = prefix; - }; - - function captureSegment(start, end, checkJson) { - var _position, _length, _character, _result; - - if (start < end) { - _result = input.slice(start, end); - - if (checkJson && validate) { - for (_position = 0, _length = _result.length; - _position < _length; - _position += 1) { - _character = _result.charCodeAt(_position); - if (!(0x09 === _character || - 0x20 <= _character && _character <= 0x10FFFF)) { - throwError('expected valid JSON character'); - } - } - } - - result += _result; - } - } - - function mergeMappings(destination, source) { - var sourceKeys, key, index, quantity; - - if (!common.isObject(source)) { - throwError('cannot merge mappings; the provided source object is unacceptable'); - } - - sourceKeys = Object.keys(source); - - for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { - key = sourceKeys[index]; - - if (!_hasOwnProperty.call(destination, key)) { - destination[key] = source[key]; - } - } - } - - function storeMappingPair(_result, keyTag, keyNode, valueNode) { - var index, quantity; - - keyNode = String(keyNode); - - if (null === _result) { - _result = {}; - } - - if ('tag:yaml.org,2002:merge' === keyTag) { - if (Array.isArray(valueNode)) { - for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { - mergeMappings(_result, valueNode[index]); - } - } else { - mergeMappings(_result, valueNode); - } - } else { - _result[keyNode] = valueNode; - } - - return _result; - } - - function readLineBreak() { - if (CHAR_LINE_FEED === character) { - position += 1; - } else if (CHAR_CARRIAGE_RETURN === character) { - if (CHAR_LINE_FEED === input.charCodeAt(position + 1)) { - position += 2; - } else { - position += 1; - } - } else { - throwError('a line break is expected'); - } - - line += 1; - lineStart = position; - character = input.charCodeAt(position); - } - - function skipSeparationSpace(allowComments, checkIndent) { - var lineBreaks = 0; - - while (position < length) { - while (CHAR_SPACE === character || CHAR_TAB === character) { - character = input.charCodeAt(++position); - } - - if (allowComments && CHAR_SHARP === character) { - do { character = input.charCodeAt(++position); } - while (position < length && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character); - } - - if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { - readLineBreak(); - lineBreaks += 1; - lineIndent = 0; - - while (CHAR_SPACE === character) { - lineIndent += 1; - character = input.charCodeAt(++position); - } - - if (lineIndent < checkIndent) { - throwWarning('deficient indentation'); - } - } else { - break; - } - } - - return lineBreaks; - } - - function testDocumentSeparator() { - var _position, _character; - - if (position === lineStart && - (CHAR_MINUS === character || CHAR_DOT === character) && - input.charCodeAt(position + 1) === character && - input.charCodeAt(position + 2) === character) { - - _position = position + 3; - _character = input.charCodeAt(_position); - - if (_position >= length || - CHAR_SPACE === _character || - CHAR_TAB === _character || - CHAR_LINE_FEED === _character || - CHAR_CARRIAGE_RETURN === _character) { - return true; - } - } - - return false; - } - - function writeFoldedLines(count) { - if (1 === count) { - result += ' '; - } else if (count > 1) { - result += common.repeat('\n', count - 1); - } - } - - function readPlainScalar(nodeIndent, withinFlowCollection) { - var preceding, - following, - captureStart, - captureEnd, - hasPendingContent, - _line, - _lineStart, - _lineIndent, - _kind = kind, - _result = result; - - if (CHAR_SPACE === character || - CHAR_TAB === character || - CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character || - CHAR_COMMA === character || - CHAR_LEFT_SQUARE_BRACKET === character || - CHAR_RIGHT_SQUARE_BRACKET === character || - CHAR_LEFT_CURLY_BRACKET === character || - CHAR_RIGHT_CURLY_BRACKET === character || - CHAR_SHARP === character || - CHAR_AMPERSAND === character || - CHAR_ASTERISK === character || - CHAR_EXCLAMATION === character || - CHAR_VERTICAL_LINE === character || - CHAR_GREATER_THAN === character || - CHAR_SINGLE_QUOTE === character || - CHAR_DOUBLE_QUOTE === character || - CHAR_PERCENT === character || - CHAR_COMMERCIAL_AT === character || - CHAR_GRAVE_ACCENT === character) { - return false; - } - - if (CHAR_QUESTION === character || - CHAR_MINUS === character) { - following = input.charCodeAt(position + 1); - - if (CHAR_SPACE === following || - CHAR_TAB === following || - CHAR_LINE_FEED === following || - CHAR_CARRIAGE_RETURN === following || - withinFlowCollection && - (CHAR_COMMA === following || - CHAR_LEFT_SQUARE_BRACKET === following || - CHAR_RIGHT_SQUARE_BRACKET === following || - CHAR_LEFT_CURLY_BRACKET === following || - CHAR_RIGHT_CURLY_BRACKET === following)) { - return false; - } - } - - kind = KIND_STRING; - result = ''; - captureStart = captureEnd = position; - hasPendingContent = false; - - while (position < length) { - if (CHAR_COLON === character) { - following = input.charCodeAt(position + 1); - - if (CHAR_SPACE === following || - CHAR_TAB === following || - CHAR_LINE_FEED === following || - CHAR_CARRIAGE_RETURN === following || - withinFlowCollection && - (CHAR_COMMA === following || - CHAR_LEFT_SQUARE_BRACKET === following || - CHAR_RIGHT_SQUARE_BRACKET === following || - CHAR_LEFT_CURLY_BRACKET === following || - CHAR_RIGHT_CURLY_BRACKET === following)) { - break; - } - - } else if (CHAR_SHARP === character) { - preceding = input.charCodeAt(position - 1); - - if (CHAR_SPACE === preceding || - CHAR_TAB === preceding || - CHAR_LINE_FEED === preceding || - CHAR_CARRIAGE_RETURN === preceding) { - break; - } - - } else if ((position === lineStart && testDocumentSeparator()) || - withinFlowCollection && - (CHAR_COMMA === character || - CHAR_LEFT_SQUARE_BRACKET === character || - CHAR_RIGHT_SQUARE_BRACKET === character || - CHAR_LEFT_CURLY_BRACKET === character || - CHAR_RIGHT_CURLY_BRACKET === character)) { - break; - - } else if (CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character) { - _line = line; - _lineStart = lineStart; - _lineIndent = lineIndent; - skipSeparationSpace(false, -1); - - if (lineIndent >= nodeIndent) { - hasPendingContent = true; - continue; - } else { - position = captureEnd; - line = _line; - lineStart = _lineStart; - lineIndent = _lineIndent; - character = input.charCodeAt(position); - break; - } - } - - if (hasPendingContent) { - captureSegment(captureStart, captureEnd, false); - writeFoldedLines(line - _line); - captureStart = captureEnd = position; - hasPendingContent = false; - } - - if (CHAR_SPACE !== character && CHAR_TAB !== character) { - captureEnd = position + 1; - } - - character = input.charCodeAt(++position); - } - - captureSegment(captureStart, captureEnd, false); - - if (result) { - return true; - } else { - kind = _kind; - result = _result; - return false; - } - } - - function readSingleQuotedScalar(nodeIndent) { - var captureStart, captureEnd; - - if (CHAR_SINGLE_QUOTE !== character) { - return false; - } - - kind = KIND_STRING; - result = ''; - character = input.charCodeAt(++position); - captureStart = captureEnd = position; - - while (position < length) { - if (CHAR_SINGLE_QUOTE === character) { - captureSegment(captureStart, position, true); - character = input.charCodeAt(++position); - - if (CHAR_SINGLE_QUOTE === character) { - captureStart = captureEnd = position; - character = input.charCodeAt(++position); - } else { - return true; - } - - } else if (CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character) { - captureSegment(captureStart, captureEnd, true); - writeFoldedLines(skipSeparationSpace(false, nodeIndent)); - captureStart = captureEnd = position; - character = input.charCodeAt(position); - - } else if (position === lineStart && testDocumentSeparator()) { - throwError('unexpected end of the document within a single quoted scalar'); - - } else { - character = input.charCodeAt(++position); - captureEnd = position; - } - } - - throwError('unexpected end of the stream within a single quoted scalar'); - } - - function readDoubleQuotedScalar(nodeIndent) { - var captureStart, - captureEnd, - hexLength, - hexIndex, - hexOffset, - hexResult; - - if (CHAR_DOUBLE_QUOTE !== character) { - return false; - } - - kind = KIND_STRING; - result = ''; - character = input.charCodeAt(++position); - captureStart = captureEnd = position; - - while (position < length) { - if (CHAR_DOUBLE_QUOTE === character) { - captureSegment(captureStart, position, true); - character = input.charCodeAt(++position); - return true; - - } else if (CHAR_BACKSLASH === character) { - captureSegment(captureStart, position, true); - character = input.charCodeAt(++position); - - if (CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character) { - skipSeparationSpace(false, nodeIndent); - - } else if (SIMPLE_ESCAPE_SEQUENCES[character]) { - result += SIMPLE_ESCAPE_SEQUENCES[character]; - character = input.charCodeAt(++position); - - } else if (HEXADECIMAL_ESCAPE_SEQUENCES[character]) { - hexLength = HEXADECIMAL_ESCAPE_SEQUENCES[character]; - hexResult = 0; - - for (hexIndex = 1; hexIndex <= hexLength; hexIndex += 1) { - hexOffset = (hexLength - hexIndex) * 4; - character = input.charCodeAt(++position); - - if (CHAR_DIGIT_ZERO <= character && character <= CHAR_DIGIT_NINE) { - hexResult |= (character - CHAR_DIGIT_ZERO) << hexOffset; - - } else if (CHAR_CAPITAL_A <= character && character <= CHAR_CAPITAL_F) { - hexResult |= (character - CHAR_CAPITAL_A + 10) << hexOffset; - - } else if (CHAR_SMALL_A <= character && character <= CHAR_SMALL_F) { - hexResult |= (character - CHAR_SMALL_A + 10) << hexOffset; - - } else { - throwError('expected hexadecimal character'); - } - } - - result += String.fromCharCode(hexResult); - character = input.charCodeAt(++position); - - } else { - throwError('unknown escape sequence'); - } - - captureStart = captureEnd = position; - - } else if (CHAR_LINE_FEED === character || - CHAR_CARRIAGE_RETURN === character) { - captureSegment(captureStart, captureEnd, true); - writeFoldedLines(skipSeparationSpace(false, nodeIndent)); - captureStart = captureEnd = position; - character = input.charCodeAt(position); - - } else if (position === lineStart && testDocumentSeparator()) { - throwError('unexpected end of the document within a double quoted scalar'); - - } else { - character = input.charCodeAt(++position); - captureEnd = position; - } - } - - throwError('unexpected end of the stream within a double quoted scalar'); - } - - function readFlowCollection(nodeIndent) { - var readNext = true, - _line, - _tag = tag, - _result, - following, - terminator, - isPair, - isExplicitPair, - isMapping, - keyNode, - keyTag, - valueNode; - - switch (character) { - case CHAR_LEFT_SQUARE_BRACKET: - terminator = CHAR_RIGHT_SQUARE_BRACKET; - isMapping = false; - _result = []; - break; - - case CHAR_LEFT_CURLY_BRACKET: - terminator = CHAR_RIGHT_CURLY_BRACKET; - isMapping = true; - _result = {}; - break; - - default: - return false; - } - - if (null !== anchor) { - anchorMap[anchor] = _result; - } - - character = input.charCodeAt(++position); - - while (position < length) { - skipSeparationSpace(true, nodeIndent); - - if (character === terminator) { - character = input.charCodeAt(++position); - tag = _tag; - kind = isMapping ? KIND_OBJECT : KIND_ARRAY; - result = _result; - return true; - } else if (!readNext) { - throwError('missed comma between flow collection entries'); - } - - keyTag = keyNode = valueNode = null; - isPair = isExplicitPair = false; - - if (CHAR_QUESTION === character) { - following = input.charCodeAt(position + 1); - - if (CHAR_SPACE === following || - CHAR_TAB === following || - CHAR_LINE_FEED === following || - CHAR_CARRIAGE_RETURN === following) { - isPair = isExplicitPair = true; - position += 1; - character = following; - skipSeparationSpace(true, nodeIndent); - } - } - - _line = line; - composeNode(nodeIndent, CONTEXT_FLOW_IN, false, true); - keyTag = tag; - keyNode = result; - - if ((isExplicitPair || line === _line) && CHAR_COLON === character) { - isPair = true; - character = input.charCodeAt(++position); - skipSeparationSpace(true, nodeIndent); - composeNode(nodeIndent, CONTEXT_FLOW_IN, false, true); - valueNode = result; - } - - if (isMapping) { - storeMappingPair(_result, keyTag, keyNode, valueNode); - } else if (isPair) { - _result.push(storeMappingPair(null, keyTag, keyNode, valueNode)); - } else { - _result.push(keyNode); - } - - skipSeparationSpace(true, nodeIndent); - - if (CHAR_COMMA === character) { - readNext = true; - character = input.charCodeAt(++position); - } else { - readNext = false; - } - } - - throwError('unexpected end of the stream within a flow collection'); - } - - function readBlockScalar(nodeIndent) { - var captureStart, - folding, - chomping = CHOMPING_CLIP, - detectedIndent = false, - textIndent = nodeIndent, - emptyLines = -1; - - switch (character) { - case CHAR_VERTICAL_LINE: - folding = false; - break; - - case CHAR_GREATER_THAN: - folding = true; - break; - - default: - return false; - } - - kind = KIND_STRING; - result = ''; - - while (position < length) { - character = input.charCodeAt(++position); - - if (CHAR_PLUS === character || CHAR_MINUS === character) { - if (CHOMPING_CLIP === chomping) { - chomping = (CHAR_PLUS === character) ? CHOMPING_KEEP : CHOMPING_STRIP; - } else { - throwError('repeat of a chomping mode identifier'); - } - - } else if (CHAR_DIGIT_ZERO <= character && character <= CHAR_DIGIT_NINE) { - if (CHAR_DIGIT_ZERO === character) { - throwError('bad explicit indentation width of a block scalar; it cannot be less than one'); - } else if (!detectedIndent) { - textIndent = nodeIndent + (character - CHAR_DIGIT_ONE); - detectedIndent = true; - } else { - throwError('repeat of an indentation width identifier'); - } - - } else { - break; - } - } - - if (CHAR_SPACE === character || CHAR_TAB === character) { - do { character = input.charCodeAt(++position); } - while (CHAR_SPACE === character || CHAR_TAB === character); - - if (CHAR_SHARP === character) { - do { character = input.charCodeAt(++position); } - while (position < length && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character); - } - } - - while (position < length) { - readLineBreak(); - lineIndent = 0; - - while ((!detectedIndent || lineIndent < textIndent) && - (CHAR_SPACE === character)) { - lineIndent += 1; - character = input.charCodeAt(++position); - } - - if (!detectedIndent && lineIndent > textIndent) { - textIndent = lineIndent; - } - - if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { - emptyLines += 1; - continue; - } - - // End of the scalar. Perform the chomping. - if (lineIndent < textIndent) { - if (CHOMPING_KEEP === chomping) { - result += common.repeat('\n', emptyLines + 1); - } else if (CHOMPING_CLIP === chomping) { - result += '\n'; - } - break; - } - - detectedIndent = true; - - if (folding) { - if (CHAR_SPACE === character || CHAR_TAB === character) { - result += common.repeat('\n', emptyLines + 1); - emptyLines = 1; - } else if (0 === emptyLines) { - result += ' '; - emptyLines = 0; - } else { - result += common.repeat('\n', emptyLines); - emptyLines = 0; - } - } else { - result += common.repeat('\n', emptyLines + 1); - emptyLines = 0; - } - - captureStart = position; - - do { character = input.charCodeAt(++position); } - while (position < length && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character); - - captureSegment(captureStart, position, false); - } - - return true; - } - - function readBlockSequence(nodeIndent) { - var _line, - _tag = tag, - _result = [], - following, - detected = false; - - if (null !== anchor) { - anchorMap[anchor] = _result; - } - - while (position < length) { - if (CHAR_MINUS !== character) { - break; - } - - following = input.charCodeAt(position + 1); - - if (CHAR_SPACE !== following && - CHAR_TAB !== following && - CHAR_LINE_FEED !== following && - CHAR_CARRIAGE_RETURN !== following) { - break; - } - - detected = true; - position += 1; - character = following; - - if (skipSeparationSpace(true, -1)) { - if (lineIndent <= nodeIndent) { - _result.push(null); - continue; - } - } - - _line = line; - composeNode(nodeIndent, CONTEXT_BLOCK_IN, false, true); - _result.push(result); - skipSeparationSpace(true, -1); - - if ((line === _line || lineIndent > nodeIndent) && position < length) { - throwError('bad indentation of a sequence entry'); - } else if (lineIndent < nodeIndent) { - break; - } - } - - if (detected) { - tag = _tag; - kind = KIND_ARRAY; - result = _result; - return true; - } else { - return false; - } - } - - function readBlockMapping(nodeIndent) { - var following, - allowCompact, - _line, - _tag = tag, - _result = {}, - keyTag = null, - keyNode = null, - valueNode = null, - atExplicitKey = false, - detected = false; - - if (null !== anchor) { - anchorMap[anchor] = _result; - } - - while (position < length) { - following = input.charCodeAt(position + 1); - _line = line; // Save the current line. - - if ((CHAR_QUESTION === character || - CHAR_COLON === character) && - (CHAR_SPACE === following || - CHAR_TAB === following || - CHAR_LINE_FEED === following || - CHAR_CARRIAGE_RETURN === following)) { - - if (CHAR_QUESTION === character) { - if (atExplicitKey) { - storeMappingPair(_result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = true; - allowCompact = true; - - } else if (atExplicitKey) { - // i.e. CHAR_COLON === character after the explicit key. - atExplicitKey = false; - allowCompact = true; - - } else { - throwError('incomplete explicit mapping pair; a key node is missed'); - } - - position += 1; - character = following; - - } else if (composeNode(nodeIndent, CONTEXT_FLOW_OUT, false, true)) { - if (line === _line) { - // TODO: Remove this cycle when the flow readers will consume - // trailing whitespaces like the block readers. - while (CHAR_SPACE === character || - CHAR_TAB === character) { - character = input.charCodeAt(++position); - } - - if (CHAR_COLON === character) { - character = input.charCodeAt(++position); - - if (CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character) { - throwError('a whitespace character is expected after the key-value separator within a block mapping'); - } - - if (atExplicitKey) { - storeMappingPair(_result, keyTag, keyNode, null); - keyTag = keyNode = valueNode = null; - } - - detected = true; - atExplicitKey = false; - allowCompact = false; - keyTag = tag; - keyNode = result; - - } else if (detected) { - throwError('can not read an implicit mapping pair; a colon is missed'); - - } else { - tag = _tag; - return true; // Keep the result of `composeNode`. - } - - } else if (detected) { - throwError('can not read a block mapping entry; a multiline key may not be an implicit key'); - - } else { - tag = _tag; - return true; // Keep the result of `composeNode`. - } - - } else { - break; - } - - if (line === _line || lineIndent > nodeIndent) { - if (composeNode(nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { - if (atExplicitKey) { - keyNode = result; - } else { - valueNode = result; - } - } - - if (!atExplicitKey) { - storeMappingPair(_result, keyTag, keyNode, valueNode); - keyTag = keyNode = valueNode = null; - } - - // TODO: It is needed only for flow node readers. It should be removed - // when the flow readers will consume trailing whitespaces as well as - // the block readers. - skipSeparationSpace(true, -1); - } - - if (lineIndent > nodeIndent && position < length) { - throwError('bad indentation of a mapping entry'); - } else if (lineIndent < nodeIndent) { - break; - } - } - - if (atExplicitKey) { - storeMappingPair(_result, keyTag, keyNode, null); - } - - if (detected) { - tag = _tag; - kind = KIND_OBJECT; - result = _result; - } - - return detected; - } - - function readTagProperty() { - var _position, - isVerbatim = false, - isNamed = false, - tagHandle, - tagName; - - if (CHAR_EXCLAMATION !== character) { - return false; - } - - if (null !== tag) { - throwError('duplication of a tag property'); - } - - character = input.charCodeAt(++position); - - if (CHAR_LESS_THAN === character) { - isVerbatim = true; - character = input.charCodeAt(++position); - - } else if (CHAR_EXCLAMATION === character) { - isNamed = true; - tagHandle = '!!'; - character = input.charCodeAt(++position); - - } else { - tagHandle = '!'; - } - - _position = position; - - if (isVerbatim) { - do { character = input.charCodeAt(++position); } - while (position < length && CHAR_GREATER_THAN !== character); - - if (position < length) { - tagName = input.slice(_position, position); - character = input.charCodeAt(++position); - } else { - throwError('unexpected end of the stream within a verbatim tag'); - } - } else { - while (position < length && - CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character) { - - if (CHAR_EXCLAMATION === character) { - if (!isNamed) { - tagHandle = input.slice(_position - 1, position + 1); - - if (validate && !PATTERN_TAG_HANDLE.test(tagHandle)) { - throwError('named tag handle cannot contain such characters'); - } - - isNamed = true; - _position = position + 1; - } else { - throwError('tag suffix cannot contain exclamation marks'); - } - } - - character = input.charCodeAt(++position); - } - - tagName = input.slice(_position, position); - - if (validate && PATTERN_FLOW_INDICATORS.test(tagName)) { - throwError('tag suffix cannot contain flow indicator characters'); - } - } - - if (validate && tagName && !PATTERN_TAG_URI.test(tagName)) { - throwError('tag name cannot contain such characters: ' + tagName); - } - - if (isVerbatim) { - tag = tagName; - - } else if (_hasOwnProperty.call(tagMap, tagHandle)) { - tag = tagMap[tagHandle] + tagName; - - } else if ('!' === tagHandle) { - tag = '!' + tagName; - - } else if ('!!' === tagHandle) { - tag = 'tag:yaml.org,2002:' + tagName; - - } else { - throwError('undeclared tag handle "' + tagHandle + '"'); - } - - return true; - } - - function readAnchorProperty() { - var _position; - - if (CHAR_AMPERSAND !== character) { - return false; - } - - if (null !== anchor) { - throwError('duplication of an anchor property'); - } - - character = input.charCodeAt(++position); - _position = position; - - while (position < length && - CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character) { - character = input.charCodeAt(++position); - } - - if (position === _position) { - throwError('name of an anchor node must contain at least one character'); - } - - anchor = input.slice(_position, position); - return true; - } - - function readAlias() { - var _position, alias; - - if (CHAR_ASTERISK !== character) { - return false; - } - - character = input.charCodeAt(++position); - _position = position; - - while (position < length && - CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character && - CHAR_COMMA !== character && - CHAR_LEFT_SQUARE_BRACKET !== character && - CHAR_RIGHT_SQUARE_BRACKET !== character && - CHAR_LEFT_CURLY_BRACKET !== character && - CHAR_RIGHT_CURLY_BRACKET !== character) { - character = input.charCodeAt(++position); - } - - if (position === _position) { - throwError('name of an alias node must contain at least one character'); - } - - alias = input.slice(_position, position); - - if (!anchorMap.hasOwnProperty(alias)) { - throwError('unidentified alias "' + alias + '"'); - } - - result = anchorMap[alias]; - skipSeparationSpace(true, -1); - return true; - } - - function composeNode(parentIndent, nodeContext, allowToSeek, allowCompact) { - var allowBlockStyles, - allowBlockScalars, - allowBlockCollections, - atNewLine = false, - isIndented = true, - hasContent = false, - typeIndex, - typeQuantity, - type, - typeLoader, - flowIndent, - blockIndent, - _result; - - tag = null; - anchor = null; - kind = null; - result = null; - - allowBlockStyles = allowBlockScalars = allowBlockCollections = - CONTEXT_BLOCK_OUT === nodeContext || - CONTEXT_BLOCK_IN === nodeContext; - - if (allowToSeek) { - if (skipSeparationSpace(true, -1)) { - atNewLine = true; - - if (lineIndent === parentIndent) { - isIndented = false; - - } else if (lineIndent > parentIndent) { - isIndented = true; - - } else { - return false; - } - } - } - - if (isIndented) { - while (readTagProperty() || readAnchorProperty()) { - if (skipSeparationSpace(true, -1)) { - atNewLine = true; - - if (lineIndent > parentIndent) { - isIndented = true; - allowBlockCollections = allowBlockStyles; - - } else if (lineIndent === parentIndent) { - isIndented = false; - allowBlockCollections = allowBlockStyles; - - } else { - return true; - } - } else { - allowBlockCollections = false; - } - } - } - - if (allowBlockCollections) { - allowBlockCollections = atNewLine || allowCompact; - } - - if (isIndented || CONTEXT_BLOCK_OUT === nodeContext) { - if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { - flowIndent = parentIndent; - } else { - flowIndent = parentIndent + 1; - } - - blockIndent = position - lineStart; - - if (isIndented) { - if (allowBlockCollections && - (readBlockSequence(blockIndent) || - readBlockMapping(blockIndent)) || - readFlowCollection(flowIndent)) { - hasContent = true; - } else { - if ((allowBlockScalars && readBlockScalar(flowIndent)) || - readSingleQuotedScalar(flowIndent) || - readDoubleQuotedScalar(flowIndent)) { - hasContent = true; - - } else if (readAlias()) { - hasContent = true; - - if (null !== tag || null !== anchor) { - throwError('alias node should not have any properties'); - } - - } else if (readPlainScalar(flowIndent, CONTEXT_FLOW_IN === nodeContext)) { - hasContent = true; - - if (null === tag) { - tag = '?'; - } - } - - if (null !== anchor) { - anchorMap[anchor] = result; - } - } - } else { - hasContent = allowBlockCollections && readBlockSequence(blockIndent); - } - } - - if (null !== tag && '!' !== tag) { - if ('?' === tag) { - if (resolve) { - for (typeIndex = 0, typeQuantity = implicitTypes.length; - typeIndex < typeQuantity; - typeIndex += 1) { - type = implicitTypes[typeIndex]; - - // Implicit resolving is not allowed for non-scalar types, and '?' - // non-specific tag is only assigned to plain scalars. So, it isn't - // needed to check for 'kind' conformity. - _result = type.loader.resolver(result, false); - - if (NIL !== _result) { - tag = type.tag; - result = _result; - break; - } - } - } - } else if (_hasOwnProperty.call(typeMap, tag)) { - typeLoader = typeMap[tag].loader; - - if (null !== result && typeLoader.kind !== kind) { - throwError('unacceptable node kind for !<' + tag + '> tag; it should be "' + typeLoader.kind + '", not "' + kind + '"'); - } - - if (typeLoader.resolver) { - _result = typeLoader.resolver(result, true); - - if (NIL !== _result) { - result = _result; - } else { - throwError('cannot resolve a node with !<' + tag + '> explicit tag'); - } - } - } else { - throwWarning('unknown tag !<' + tag + '>'); - } - } - - return null !== tag || null !== anchor || hasContent; - } - - function readDocument() { - var documentStart = position, - _position, - directiveName, - directiveArgs, - hasDirectives = false; - - version = null; - checkLineBreaks = legacy; - tagMap = {}; - anchorMap = {}; - - while (position < length) { - skipSeparationSpace(true, -1); - - if (lineIndent > 0 || CHAR_PERCENT !== character) { - break; - } - - hasDirectives = true; - character = input.charCodeAt(++position); - _position = position; - - while (position < length && - CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character) { - character = input.charCodeAt(++position); - } - - directiveName = input.slice(_position, position); - directiveArgs = []; - - if (directiveName.length < 1) { - throwError('directive name must not be less than one character in length'); - } - - while (position < length) { - while (CHAR_SPACE === character || CHAR_TAB === character) { - character = input.charCodeAt(++position); - } - - if (CHAR_SHARP === character) { - do { character = input.charCodeAt(++position); } - while (position < length && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character); - break; - } - - if (CHAR_LINE_FEED === character || CHAR_CARRIAGE_RETURN === character) { - break; - } - - _position = position; - - while (position < length && - CHAR_SPACE !== character && - CHAR_TAB !== character && - CHAR_LINE_FEED !== character && - CHAR_CARRIAGE_RETURN !== character) { - character = input.charCodeAt(++position); - } - - directiveArgs.push(input.slice(_position, position)); - } - - if (position < length) { - readLineBreak(); - } - - if (_hasOwnProperty.call(directiveHandlers, directiveName)) { - directiveHandlers[directiveName](directiveName, directiveArgs); - } else { - throwWarning('unknown document directive "' + directiveName + '"'); - } - } - - skipSeparationSpace(true, -1); - - if (0 === lineIndent && - CHAR_MINUS === character && - CHAR_MINUS === input.charCodeAt(position + 1) && - CHAR_MINUS === input.charCodeAt(position + 2)) { - position += 3; - character = input.charCodeAt(position); - skipSeparationSpace(true, -1); - - } else if (hasDirectives) { - throwError('directives end mark is expected'); - } - - composeNode(lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); - skipSeparationSpace(true, -1); - - if (validate && checkLineBreaks && - PATTERN_NON_ASCII_LINE_BREAKS.test(input.slice(documentStart, position))) { - throwWarning('non-ASCII line breaks are interpreted as content'); - } - - output(result); - - if (position === lineStart && testDocumentSeparator()) { - if (CHAR_DOT === character) { - position += 3; - character = input.charCodeAt(position); - skipSeparationSpace(true, -1); - } - return; - } - - if (position < length) { - throwError('end of the stream or a document separator is expected'); - } else { - return; - } - } - - if (validate && PATTERN_NON_PRINTABLE.test(input)) { - throwError('the stream contains non-printable characters'); - } - - while (CHAR_SPACE === character) { - lineIndent += 1; - character = input.charCodeAt(++position); - } - - while (position < length) { - readDocument(); - } -} - - -function load(input, options) { - var result = null, received = false; - - function callback(data) { - if (!received) { - result = data; - received = true; - } else { - throw new YAMLException('expected a single document in the stream, but found more'); - } - } - - loadAll(input, callback, options); - - return result; -} - - -function safeLoadAll(input, output, options) { - loadAll(input, output, common.extend({ schema: SAFE_SCHEMA }, options)); -} - - -function safeLoad(input, options) { - return load(input, common.extend({ schema: SAFE_SCHEMA }, options)); -} - - -module.exports.loadAll = loadAll; -module.exports.load = load; -module.exports.safeLoadAll = safeLoadAll; -module.exports.safeLoad = safeLoad; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js deleted file mode 100644 index bfe279b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js +++ /dev/null @@ -1,78 +0,0 @@ -'use strict'; - - -var common = require('./common'); - - -function Mark(name, buffer, position, line, column) { - this.name = name; - this.buffer = buffer; - this.position = position; - this.line = line; - this.column = column; -} - - -Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { - var head, start, tail, end, snippet; - - if (!this.buffer) { - return null; - } - - indent = indent || 4; - maxLength = maxLength || 75; - - head = ''; - start = this.position; - - while (start > 0 && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1))) { - start -= 1; - if (this.position - start > (maxLength / 2 - 1)) { - head = ' ... '; - start += 5; - break; - } - } - - tail = ''; - end = this.position; - - while (end < this.buffer.length && -1 === '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end))) { - end += 1; - if (end - this.position > (maxLength / 2 - 1)) { - tail = ' ... '; - end -= 5; - break; - } - } - - snippet = this.buffer.slice(start, end); - - return common.repeat(' ', indent) + head + snippet + tail + '\n' + - common.repeat(' ', indent + this.position - start + head.length) + '^'; -}; - - -Mark.prototype.toString = function toString(compact) { - var snippet, where = ''; - - if (this.name) { - where += 'in "' + this.name + '" '; - } - - where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); - - if (!compact) { - snippet = this.getSnippet(); - - if (snippet) { - where += ':\n' + snippet; - } - } - - return where; -}; - - -module.exports = Mark; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js deleted file mode 100644 index 47b77e3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - - -var fs = require('fs'); -var loader = require('./loader'); - - -function yamlRequireHandler(module, filename) { - var content = fs.readFileSync(filename, 'utf8'); - - // fill in documents - module.exports = loader.load(content, { filename: filename }); -} - -// register require extensions only if we're on node.js -// hack for browserify -if (undefined !== require.extensions) { - require.extensions['.yml'] = yamlRequireHandler; - require.extensions['.yaml'] = yamlRequireHandler; -} - - -module.exports = require; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js deleted file mode 100644 index ce21391..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js +++ /dev/null @@ -1,103 +0,0 @@ -'use strict'; - - -var common = require('./common'); -var YAMLException = require('./exception'); -var Type = require('./type'); - - -function compileList(schema, name, result) { - var exclude = []; - - schema.include.forEach(function (includedSchema) { - result = compileList(includedSchema, name, result); - }); - - schema[name].forEach(function (currentType) { - result.forEach(function (previousType, previousIndex) { - if (previousType.tag === currentType.tag) { - exclude.push(previousIndex); - } - }); - - result.push(currentType); - }); - - return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); - }); -} - - -function compileMap(/* lists... */) { - var result = {}, index, length; - - function collectType(type) { - result[type.tag] = type; - } - - for (index = 0, length = arguments.length; index < length; index += 1) { - arguments[index].forEach(collectType); - } - - return result; -} - - -function Schema(definition) { - this.include = definition.include || []; - this.implicit = definition.implicit || []; - this.explicit = definition.explicit || []; - - this.implicit.forEach(function (type) { - if (null !== type.loader && 'string' !== type.loader.kind) { - throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); - } - }); - - this.compiledImplicit = compileList(this, 'implicit', []); - this.compiledExplicit = compileList(this, 'explicit', []); - this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); -} - - -Schema.DEFAULT = null; - - -Schema.create = function createSchema() { - var schemas, types; - - switch (arguments.length) { - case 1: - schemas = Schema.DEFAULT; - types = arguments[0]; - break; - - case 2: - schemas = arguments[0]; - types = arguments[1]; - break; - - default: - throw new YAMLException('Wrong number of arguments for Schema.create function'); - } - - schemas = common.toArray(schemas); - types = common.toArray(types); - - if (!schemas.every(function (schema) { return schema instanceof Schema; })) { - throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); - } - - if (!types.every(function (type) { return type instanceof Type; })) { - throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); - } - - return new Schema({ - include: schemas, - explicit: types - }); -}; - - -module.exports = Schema; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js deleted file mode 100644 index 71bb3fc..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = Schema.DEFAULT = new Schema({ - include: [ - require('./safe') - ], - explicit: [ - require('../type/js/undefined'), - require('../type/js/regexp'), - require('../type/js/function') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js deleted file mode 100644 index 7a6ebbe..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - explicit: [ - require('../type/str'), - require('../type/seq'), - require('../type/map') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js deleted file mode 100644 index 856b7c4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js +++ /dev/null @@ -1,25 +0,0 @@ -'use strict'; - - -var Schema = require('../schema'); - - -module.exports = new Schema({ - include: [ - require('./minimal') - ], - implicit: [ - require('../type/null'), - require('../type/bool'), - require('../type/int'), - require('../type/float'), - require('../type/timestamp'), - require('../type/merge') - ], - explicit: [ - require('../type/binary'), - require('../type/omap'), - require('../type/pairs'), - require('../type/set') - ] -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js deleted file mode 100644 index e0124f2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js +++ /dev/null @@ -1,82 +0,0 @@ -'use strict'; - - -var YAMLException = require('./exception'); - - -// TODO: Add tag format check. -function Type(tag, options) { - options = options || {}; - - this.tag = tag; - this.loader = options['loader'] || null; - this.dumper = options['dumper'] || null; - - if (null === this.loader && null === this.dumper) { - throw new YAMLException('Incomplete YAML type definition. "loader" or "dumper" setting must be specified.'); - } - - if (null !== this.loader) { - this.loader = new Type.Loader(this.loader); - } - - if (null !== this.dumper) { - this.dumper = new Type.Dumper(this.dumper); - } -} - - -Type.Loader = function TypeLoader(options) { - options = options || {}; - - this.kind = options['kind'] || null; - this.resolver = options['resolver'] || null; - - if ('string' !== this.kind && - 'array' !== this.kind && - 'object' !== this.kind) { - throw new YAMLException('Unacceptable "kind" setting of a type loader.'); - } -}; - - -function compileAliases(map) { - var result = {}; - - if (null !== map) { - Object.keys(map).forEach(function (style) { - map[style].forEach(function (alias) { - result[String(alias)] = style; - }); - }); - } - - return result; -} - - -Type.Dumper = function TypeDumper(options) { - options = options || {}; - - this.kind = options['kind'] || null; - this.defaultStyle = options['defaultStyle'] || null; - this.instanceOf = options['instanceOf'] || null; - this.predicate = options['predicate'] || null; - this.representer = options['representer'] || null; - this.styleAliases = compileAliases(options['styleAliases'] || null); - - if ('undefined' !== this.kind && - 'null' !== this.kind && - 'boolean' !== this.kind && - 'integer' !== this.kind && - 'float' !== this.kind && - 'string' !== this.kind && - 'array' !== this.kind && - 'object' !== this.kind && - 'function' !== this.kind) { - throw new YAMLException('Unacceptable "kind" setting of a type dumper.'); - } -}; - - -module.exports = Type; diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js deleted file mode 100644 index 37b4bc7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js +++ /dev/null @@ -1,118 +0,0 @@ -// Modified from: -// https://raw.github.com/kanaka/noVNC/d890e8640f20fba3215ba7be8e0ff145aeb8c17c/include/base64.js - -'use strict'; - - -var NodeBuffer = require('buffer').Buffer; // A trick for browserified version. -var common = require('../common'); -var NIL = common.NIL; -var Type = require('../type'); - - - -var BASE64_PADDING = '='; - -var BASE64_BINTABLE = [ - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -1, -1, - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 -]; - -var BASE64_CHARTABLE = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - -function resolveYamlBinary(object /*, explicit*/) { - var value, code, idx = 0, result = [], leftbits, leftdata; - - leftbits = 0; // number of bits decoded, but yet to be appended - leftdata = 0; // bits decoded, but yet to be appended - - // Convert one by one. - for (idx = 0; idx < object.length; idx += 1) { - code = object.charCodeAt(idx); - value = BASE64_BINTABLE[code & 0x7F]; - - // Skip LF(NL) || CR - if (0x0A !== code && 0x0D !== code) { - // Fail on illegal characters - if (-1 === value) { - return NIL; - } - - // Collect data into leftdata, update bitcount - leftdata = (leftdata << 6) | value; - leftbits += 6; - - // If we have 8 or more bits, append 8 bits to the result - if (leftbits >= 8) { - leftbits -= 8; - - // Append if not padding. - if (BASE64_PADDING !== object.charAt(idx)) { - result.push((leftdata >> leftbits) & 0xFF); - } - - leftdata &= (1 << leftbits) - 1; - } - } - } - - // If there are any bits left, the base64 string was corrupted - if (leftbits) { - return NIL; - } else { - return new NodeBuffer(result); - } -} - - -function representYamlBinary(object /*, style*/) { - var result = '', index, length, rest; - - // Convert every three bytes to 4 ASCII characters. - for (index = 0, length = object.length - 2; index < length; index += 3) { - result += BASE64_CHARTABLE[object[index + 0] >> 2]; - result += BASE64_CHARTABLE[((object[index + 0] & 0x03) << 4) + (object[index + 1] >> 4)]; - result += BASE64_CHARTABLE[((object[index + 1] & 0x0F) << 2) + (object[index + 2] >> 6)]; - result += BASE64_CHARTABLE[object[index + 2] & 0x3F]; - } - - rest = object.length % 3; - - // Convert the remaining 1 or 2 bytes, padding out to 4 characters. - if (0 !== rest) { - index = object.length - rest; - result += BASE64_CHARTABLE[object[index + 0] >> 2]; - - if (2 === rest) { - result += BASE64_CHARTABLE[((object[index + 0] & 0x03) << 4) + (object[index + 1] >> 4)]; - result += BASE64_CHARTABLE[(object[index + 1] & 0x0F) << 2]; - result += BASE64_PADDING; - } else { - result += BASE64_CHARTABLE[(object[index + 0] & 0x03) << 4]; - result += BASE64_PADDING + BASE64_PADDING; - } - } - - return result; -} - - -module.exports = new Type('tag:yaml.org,2002:binary', { - loader: { - kind: 'string', - resolver: resolveYamlBinary - }, - dumper: { - kind: 'object', - instanceOf: NodeBuffer, - representer: representYamlBinary - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js deleted file mode 100644 index 987a9e6..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js +++ /dev/null @@ -1,74 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var YAML_IMPLICIT_BOOLEAN_MAP = { - 'true' : true, - 'True' : true, - 'TRUE' : true, - 'false' : false, - 'False' : false, - 'FALSE' : false -}; - -var YAML_EXPLICIT_BOOLEAN_MAP = { - 'true' : true, - 'True' : true, - 'TRUE' : true, - 'false' : false, - 'False' : false, - 'FALSE' : false, - 'y' : true, - 'Y' : true, - 'yes' : true, - 'Yes' : true, - 'YES' : true, - 'n' : false, - 'N' : false, - 'no' : false, - 'No' : false, - 'NO' : false, - 'on' : true, - 'On' : true, - 'ON' : true, - 'off' : false, - 'Off' : false, - 'OFF' : false -}; - - -function resolveYamlBoolean(object, explicit) { - if (explicit) { - if (YAML_EXPLICIT_BOOLEAN_MAP.hasOwnProperty(object)) { - return YAML_EXPLICIT_BOOLEAN_MAP[object]; - } else { - return NIL; - } - } else { - if (YAML_IMPLICIT_BOOLEAN_MAP.hasOwnProperty(object)) { - return YAML_IMPLICIT_BOOLEAN_MAP[object]; - } else { - return NIL; - } - } -} - - -module.exports = new Type('tag:yaml.org,2002:bool', { - loader: { - kind: 'string', - resolver: resolveYamlBoolean - }, - dumper: { - kind: 'boolean', - defaultStyle: 'lowercase', - representer: { - lowercase: function (object) { return object ? 'true' : 'false'; }, - uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, - camelcase: function (object) { return object ? 'True' : 'False'; } - } - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js deleted file mode 100644 index edb5fcb..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js +++ /dev/null @@ -1,102 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var YAML_FLOAT_PATTERN = new RegExp( - '^(?:[-+]?(?:[0-9][0-9_]*)\\.[0-9_]*(?:[eE][-+][0-9]+)?' + - '|\\.[0-9_]+(?:[eE][-+][0-9]+)?' + - '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + - '|[-+]?\\.(?:inf|Inf|INF)' + - '|\\.(?:nan|NaN|NAN))$'); - - -function resolveYamlFloat(object /*, explicit*/) { - var value, sign, base, digits; - - if (!YAML_FLOAT_PATTERN.test(object)) { - return NIL; - } - - value = object.replace(/_/g, '').toLowerCase(); - sign = '-' === value[0] ? -1 : 1; - digits = []; - - if (0 <= '+-'.indexOf(value[0])) { - value = value.slice(1); - } - - if ('.inf' === value) { - return (1 === sign) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; - - } else if ('.nan' === value) { - return NaN; - - } else if (0 <= value.indexOf(':')) { - value.split(':').forEach(function (v) { - digits.unshift(parseFloat(v, 10)); - }); - - value = 0.0; - base = 1; - - digits.forEach(function (d) { - value += d * base; - base *= 60; - }); - - return sign * value; - - } else { - return sign * parseFloat(value, 10); - } -} - - -function representYamlFloat(object, style) { - if (isNaN(object)) { - switch (style) { - case 'lowercase': - return '.nan'; - case 'uppercase': - return '.NAN'; - case 'camelcase': - return '.NaN'; - } - } else if (Number.POSITIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '.inf'; - case 'uppercase': - return '.INF'; - case 'camelcase': - return '.Inf'; - } - } else if (Number.NEGATIVE_INFINITY === object) { - switch (style) { - case 'lowercase': - return '-.inf'; - case 'uppercase': - return '-.INF'; - case 'camelcase': - return '-.Inf'; - } - } else { - return object.toString(10); - } -} - - -module.exports = new Type('tag:yaml.org,2002:float', { - loader: { - kind: 'string', - resolver: resolveYamlFloat - }, - dumper: { - kind: 'float', - defaultStyle: 'lowercase', - representer: representYamlFloat - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js deleted file mode 100644 index f5e1e7e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var YAML_INTEGER_PATTERN = new RegExp( - '^(?:[-+]?0b[0-1_]+' + - '|[-+]?0[0-7_]+' + - '|[-+]?(?:0|[1-9][0-9_]*)' + - '|[-+]?0x[0-9a-fA-F_]+' + - '|[-+]?[1-9][0-9_]*(?::[0-5]?[0-9])+)$'); - - -function resolveYamlInteger(object /*, explicit*/) { - var value, sign, base, digits; - - if (!YAML_INTEGER_PATTERN.test(object)) { - return NIL; - } - - value = object.replace(/_/g, ''); - sign = '-' === value[0] ? -1 : 1; - digits = []; - - if (0 <= '+-'.indexOf(value[0])) { - value = value.slice(1); - } - - if ('0' === value) { - return 0; - - } else if (/^0b/.test(value)) { - return sign * parseInt(value.slice(2), 2); - - } else if (/^0x/.test(value)) { - return sign * parseInt(value, 16); - - } else if ('0' === value[0]) { - return sign * parseInt(value, 8); - - } else if (0 <= value.indexOf(':')) { - value.split(':').forEach(function (v) { - digits.unshift(parseInt(v, 10)); - }); - - value = 0; - base = 1; - - digits.forEach(function (d) { - value += (d * base); - base *= 60; - }); - - return sign * value; - - } else { - return sign * parseInt(value, 10); - } -} - - -module.exports = new Type('tag:yaml.org,2002:int', { - loader: { - kind: 'string', - resolver: resolveYamlInteger - }, - dumper: { - kind: 'integer', - defaultStyle: 'decimal', - representer: { - binary: function (object) { return '0b' + object.toString(2); }, - octal: function (object) { return '0' + object.toString(8); }, - decimal: function (object) { return object.toString(10); }, - hexadecimal: function (object) { return '0x' + object.toString(16).toUpperCase(); } - }, - styleAliases: { - binary: [ 2, 'bin' ], - octal: [ 8, 'oct' ], - decimal: [ 10, 'dec' ], - hexadecimal: [ 16, 'hex' ] - } - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js deleted file mode 100644 index 4b3b3ca..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - - -var esprima = require('esprima'); - - -var NIL = require('../../common').NIL; -var Type = require('../../type'); - - -function resolveJavascriptFunction(object /*, explicit*/) { - /*jslint evil:true*/ - - try { - var source = '(' + object + ')', - ast = esprima.parse(source, { range: true }), - params = [], - body; - - if ('Program' !== ast.type || - 1 !== ast.body.length || - 'ExpressionStatement' !== ast.body[0].type || - 'FunctionExpression' !== ast.body[0].expression.type) { - return NIL; - } - - ast.body[0].expression.params.forEach(function (param) { - params.push(param.name); - }); - - body = ast.body[0].expression.body.range; - - // Esprima's ranges include the first '{' and the last '}' characters on - // function expressions. So cut them out. - return new Function(params, source.slice(body[0]+1, body[1]-1)); - } catch (err) { - return NIL; - } -} - - -function representJavascriptFunction(object /*, style*/) { - return object.toString(); -} - - -module.exports = new Type('tag:yaml.org,2002:js/function', { - loader: { - kind: 'string', - resolver: resolveJavascriptFunction - }, - dumper: { - kind: 'function', - representer: representJavascriptFunction, - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js deleted file mode 100644 index 9f4f89e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +++ /dev/null @@ -1,56 +0,0 @@ -'use strict'; - - -var NIL = require('../../common').NIL; -var Type = require('../../type'); - - -function resolveJavascriptRegExp(object /*, explicit*/) { - var regexp = object, - tail = /\/([gim]*)$/.exec(object), - modifiers; - - // `/foo/gim` - tail can be maximum 4 chars - if ('/' === regexp[0] && tail && 4 >= tail[0].length) { - regexp = regexp.slice(1, regexp.length - tail[0].length); - modifiers = tail[1]; - } - - try { - return new RegExp(regexp, modifiers); - } catch (error) { - return NIL; - } -} - - -function representJavascriptRegExp(object /*, style*/) { - var result = '/' + object.source + '/'; - - if (object.global) { - result += 'g'; - } - - if (object.multiline) { - result += 'm'; - } - - if (object.ignoreCase) { - result += 'i'; - } - - return result; -} - - -module.exports = new Type('tag:yaml.org,2002:js/regexp', { - loader: { - kind: 'string', - resolver: resolveJavascriptRegExp - }, - dumper: { - kind: 'object', - instanceOf: RegExp, - representer: representJavascriptRegExp - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js deleted file mode 100644 index 8d2835e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - - -var Type = require('../../type'); - - -function resolveJavascriptUndefined(/*object, explicit*/) { - var undef; - - return undef; -} - - -function representJavascriptUndefined(/*object, explicit*/) { - return ''; -} - - -module.exports = new Type('tag:yaml.org,2002:js/undefined', { - loader: { - kind: 'string', - resolver: resolveJavascriptUndefined - }, - dumper: { - kind: 'undefined', - representer: representJavascriptUndefined - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js deleted file mode 100644 index 5cda6de..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:map', { - loader: { - kind: 'object' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js deleted file mode 100644 index 8facc70..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -function resolveYamlMerge(object /*, explicit*/) { - return '<<' === object ? object : NIL; -} - - -module.exports = new Type('tag:yaml.org,2002:merge', { - loader: { - kind: 'string', - resolver: resolveYamlMerge - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js deleted file mode 100644 index 796e1af..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var YAML_NULL_MAP = { - '~' : true, - 'null' : true, - 'Null' : true, - 'NULL' : true -}; - - -function resolveYamlNull(object /*, explicit*/) { - return YAML_NULL_MAP[object] ? null : NIL; -} - - -module.exports = new Type('tag:yaml.org,2002:null', { - loader: { - kind: 'string', - resolver: resolveYamlNull - }, - dumper: { - kind: 'null', - defaultStyle: 'lowercase', - representer: { - canonical: function () { return '~'; }, - lowercase: function () { return 'null'; }, - uppercase: function () { return 'NULL'; }, - camelcase: function () { return 'Null'; }, - } - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js deleted file mode 100644 index f7c248d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; -var _toString = Object.prototype.toString; - - -function resolveYamlOmap(object /*, explicit*/) { - var objectKeys = [], index, length, pair, pairKey, pairHasKey; - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - pairHasKey = false; - - if ('[object Object]' !== _toString.call(pair)) { - return NIL; - } - - for (pairKey in pair) { - if (_hasOwnProperty.call(pair, pairKey)) { - if (!pairHasKey) { - pairHasKey = true; - } else { - return NIL; - } - } - } - - if (!pairHasKey) { - return NIL; - } - - if (-1 === objectKeys.indexOf(pairKey)) { - objectKeys.push(pairKey); - } else { - return NIL; - } - } - - return object; -} - - -module.exports = new Type('tag:yaml.org,2002:omap', { - loader: { - kind: 'array', - resolver: resolveYamlOmap - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js deleted file mode 100644 index 828ff1b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var _toString = Object.prototype.toString; - - -function resolveYamlPairs(object /*, explicit*/) { - var index, length, pair, keys, result; - - result = new Array(object.length); - - for (index = 0, length = object.length; index < length; index += 1) { - pair = object[index]; - - if ('[object Object]' !== _toString.call(pair)) { - return NIL; - } - - keys = Object.keys(pair); - - if (1 !== keys.length) { - return NIL; - } - - result[index] = [ keys[0], pair[keys[0]] ]; - } - - return result; -} - - -module.exports = new Type('tag:yaml.org,2002:pairs', { - loader: { - kind: 'array', - resolver: resolveYamlPairs - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js deleted file mode 100644 index 80a7cf0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:seq', { - loader: { - kind: 'array' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js deleted file mode 100644 index 64bdc66..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var _hasOwnProperty = Object.prototype.hasOwnProperty; - - -function resolveYamlSet(object /*, explicit*/) { - var key; - - for (key in object) { - if (_hasOwnProperty.call(object, key)) { - if (null !== object[key]) { - return NIL; - } - } - } - - return object; -} - - -module.exports = new Type('tag:yaml.org,2002:set', { - loader: { - kind: 'object', - resolver: resolveYamlSet - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js deleted file mode 100644 index 384f14e..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js +++ /dev/null @@ -1,11 +0,0 @@ -'use strict'; - - -var Type = require('../type'); - - -module.exports = new Type('tag:yaml.org,2002:str', { - loader: { - kind: 'string' - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js deleted file mode 100644 index 24da9e2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - - -var NIL = require('../common').NIL; -var Type = require('../type'); - - -var YAML_TIMESTAMP_REGEXP = new RegExp( - '^([0-9][0-9][0-9][0-9])' + // [1] year - '-([0-9][0-9]?)' + // [2] month - '-([0-9][0-9]?)' + // [3] day - '(?:(?:[Tt]|[ \\t]+)' + // ... - '([0-9][0-9]?)' + // [4] hour - ':([0-9][0-9])' + // [5] minute - ':([0-9][0-9])' + // [6] second - '(?:\\.([0-9]*))?' + // [7] fraction - '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour - '(?::([0-9][0-9]))?))?)?$'); // [11] tz_minute - - -function resolveYamlTimestamp(object /*, explicit*/) { - var match, year, month, day, hour, minute, second, fraction = 0, - delta = null, tz_hour, tz_minute, data; - - match = YAML_TIMESTAMP_REGEXP.exec(object); - - if (null === match) { - return NIL; - } - - // match: [1] year [2] month [3] day - - year = +(match[1]); - month = +(match[2]) - 1; // JS month starts with 0 - day = +(match[3]); - - if (!match[4]) { // no hour - return new Date(Date.UTC(year, month, day)); - } - - // match: [4] hour [5] minute [6] second [7] fraction - - hour = +(match[4]); - minute = +(match[5]); - second = +(match[6]); - - if (match[7]) { - fraction = match[7].slice(0, 3); - while (fraction.length < 3) { // milli-seconds - fraction += '0'; - } - fraction = +fraction; - } - - // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute - - if (match[9]) { - tz_hour = +(match[10]); - tz_minute = +(match[11] || 0); - delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds - if ('-' === match[9]) { - delta = -delta; - } - } - - data = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); - - if (delta) { - data.setTime(data.getTime() - delta); - } - - return data; -} - - -function representYamlTimestamp(object /*, style*/) { - return object.toISOString(); -} - - -module.exports = new Type('tag:yaml.org,2002:timestamp', { - loader: { - kind: 'string', - resolver: resolveYamlTimestamp - }, - dumper: { - kind: 'object', - instanceOf: Date, - representer: representYamlTimestamp - } -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse b/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse deleted file mode 120000 index 7423b18..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esparse.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate b/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate deleted file mode 120000 index 16069ef..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima/bin/esvalidate.js \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md deleted file mode 100644 index 102f82b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md +++ /dev/null @@ -1,109 +0,0 @@ -0.1.15 / 2013-05-13 -------------------- - -* Fixed #55, @trebor89 - - -0.1.14 / 2013-05-12 -------------------- - -* Fixed #62, @maxtaco - - -0.1.13 / 2013-04-08 -------------------- - -* Added `.npmignore` to reduce package size - - -0.1.12 / 2013-02-10 -------------------- - -* Fixed conflictHandler (#46), @hpaulj - - -0.1.11 / 2013-02-07 -------------------- - -* Multiple bugfixes, @hpaulj -* Added 70+ tests (ported from python), @hpaulj -* Added conflictHandler, @applepicke -* Added fromfilePrefixChar, @hpaulj - - -0.1.10 / 2012-12-30 -------------------- - -* Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion) - support, thanks to @hpaulj -* Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj - - -0.1.9 / 2012-12-27 ------------------- - -* Fixed option dest interferens with other options (issue #23), thanks to @hpaulj -* Fixed default value behavior with `*` positionals, thanks to @hpaulj -* Improve `getDefault()` behavior, thanks to @hpaulj -* Imrove negative argument parsing, thanks to @hpaulj - - -0.1.8 / 2012-12-01 ------------------- - -* Fixed parser parents (issue #19), thanks to @hpaulj -* Fixed negative argument parse (issue #20), thanks to @hpaulj - - -0.1.7 / 2012-10-14 ------------------- - -* Fixed 'choices' argument parse (issue #16) -* Fixed stderr output (issue #15) - - -0.1.6 / 2012-09-09 ------------------- - -* Fixed check for conflict of options (thanks to @tomxtobin) - - -0.1.5 / 2012-09-03 ------------------- - -* Fix parser #setDefaults method (thanks to @tomxtobin) - - -0.1.4 / 2012-07-30 ------------------- - -* Fixed pseudo-argument support (thanks to @CGamesPlay) -* Fixed addHelp default (should be true), if not set (thanks to @benblank) - - -0.1.3 / 2012-06-27 ------------------- - -* Fixed formatter api name: Formatter -> HelpFormatter - - -0.1.2 / 2012-05-29 ------------------- - -* Added basic tests -* Removed excess whitespace in help -* Fixed error reporting, when parcer with subcommands - called with empty arguments - - -0.1.1 / 2012-05-23 ------------------- - -* Fixed line wrapping in help formatter -* Added better error reporting on invalid arguments - - -0.1.0 / 2012-05-16 ------------------- - -* First release. diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE deleted file mode 100644 index 1afdae5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -(The MIT License) - -Copyright (C) 2012 by Vitaly Puzrin - -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/grunt/node_modules/js-yaml/node_modules/argparse/README.md b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md deleted file mode 100644 index f20e0c1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md +++ /dev/null @@ -1,239 +0,0 @@ -argparse -======== - -[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse) - -CLI arguments parser for node.js. Javascript port of python's -[argparse](http://docs.python.org/dev/library/argparse.html) module -(original version 3.2). That's a full port, except some very rare options, -recorded in issue tracker. - -**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/). - - -Example -======= - -test.js file: - -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse example' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); -var args = parser.parseArgs(); -console.dir(args); -``` - -Display help: - -``` -$ ./test.js -h -usage: example.js [-h] [-v] [-f FOO] [-b BAR] - -Argparse example - -Optional arguments: - -h, --help Show this help message and exit. - -v, --version Show program's version number and exit. - -f FOO, --foo FOO foo bar - -b BAR, --bar BAR bar foo -``` - -Parse arguments: - -``` -$ ./test.js -f=3 --bar=4 -{ foo: '3', bar: '4' } -``` - -More [examples](https://github.com/nodeca/argparse/tree/master/examples). - - -ArgumentParser objects -====================== - -``` -new ArgumentParser({paramters hash}); -``` - -Creates a new ArgumentParser object. - -**Supported params:** - -- ```description``` - Text to display before the argument help. -- ```epilog``` - Text to display after the argument help. -- ```addHelp``` - Add a -h/–help option to the parser. (default: True) -- ```argumentDefault``` - Set the global default value for arguments. (default: None) -- ```parents``` - A list of ArgumentParser objects whose arguments should also be included. -- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘) -- ```formatterClass``` - A class for customizing the help output. -- ```prog``` - The name of the program (default: sys.argv[0]) -- ```usage``` - The string describing the program usage (default: generated) -- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals. - -**Not supportied yet** - -- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read. - - -Details in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects) - - -addArgument() method -==================== - -``` -ArgumentParser.addArgument([names or flags], {options}) -``` - -Defines how a single command-line argument should be parsed. - -- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo. - -Options: - -- ```action``` - The basic type of action to be taken when this argument is encountered at the command line. -- ```nargs```- The number of command-line arguments that should be consumed. -- ```constant``` - A constant value required by some action and nargs selections. -- ```defaultValue``` - The value produced if the argument is absent from the command line. -- ```type``` - The type to which the command-line argument should be converted. -- ```choices``` - A container of the allowable values for the argument. -- ```required``` - Whether or not the command-line option may be omitted (optionals only). -- ```help``` - A brief description of what the argument does. -- ```metavar``` - A name for the argument in usage messages. -- ```dest``` - The name of the attribute to be added to the object returned by parseArgs(). - -Details in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method) - - -Action (some details) -================ - -ArgumentParser objects associate command-line arguments with actions. -These actions can do just about anything with the command-line arguments associated -with them, though most actions simply add an attribute to the object returned by -parseArgs(). The action keyword argument specifies how the command-line arguments -should be handled. The supported actions are: - -- ```store``` - Just stores the argument’s value. This is the default action. -- ```storeConst``` - Stores value, specified by the const keyword argument. - (Note that the const keyword argument defaults to the rather unhelpful None.) - The 'storeConst' action is most commonly used with optional arguments, that - specify some sort of flag. -- ```storeTrue``` and ```storeFalse``` - Stores values True and False - respectively. These are special cases of 'storeConst'. -- ```append``` - Stores a list, and appends each argument value to the list. - This is useful to allow an option to be specified multiple times. -- ```appendConst``` - Stores a list, and appends value, specified by the - const keyword argument to the list. (Note, that the const keyword argument defaults - is None.) The 'appendConst' action is typically used when multiple arguments need - to store constants to the same list. -- ```count``` - Counts the number of times a keyword argument occurs. For example, - used for increasing verbosity levels. -- ```help``` - Prints a complete help message for all the options in the current - parser and then exits. By default a help action is automatically added to the parser. - See ArgumentParser for details of how the output is created. -- ```version``` - Prints version information and exit. Expects a `version=` - keyword argument in the addArgument() call. - -Details in [original action guide](http://docs.python.org/dev/library/argparse.html#action) - - -Sub-commands -============ - -ArgumentParser.addSubparsers() - -Many programs split their functionality into a number of sub-commands, for -example, the svn program can invoke sub-commands like `svn checkout`, `svn update`, -and `svn commit`. Splitting up functionality this way can be a particularly good -idea when a program performs several different functions which require different -kinds of command-line arguments. `ArgumentParser` supports creation of such -sub-commands with `addSubparsers()` method. The `addSubparsers()` method is -normally called with no arguments and returns an special action object. -This object has a single method `addParser()`, which takes a command name and -any `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object -that can be modified as usual. - -Example: - -sub_commands.js -```javascript -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp:true, - description: 'Argparse examples: sub-commands', -}); - -var subparsers = parser.addSubparsers({ - title:'subcommands', - dest:"subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp:true}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases:['co'], addHelp:true} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); - -var args = parser.parseArgs(); -console.dir(args); - -``` - -Details in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands) - - -Contributors -============ - -- [Eugene Shkuropat](https://github.com/shkuropat) -- [Paul Jacobson](https://github.com/hpaulj) - -[others](https://github.com/nodeca/argparse/graphs/contributors) - -License -======= - -Copyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin). -Released under the MIT license. See -[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details. - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js deleted file mode 100755 index 5b090fa..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: arguments' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar' - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo' - } -); - - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-f 1 -b2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('-f=3 --bar=4'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--foo 5 --bar 6'.split(' ')); -console.dir(args); -console.log('-----------'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js deleted file mode 100755 index 2616fa4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: choice' -}); - -parser.addArgument(['foo'], {choices: 'abc'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['c']); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['X']); -console.dir(args); - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js deleted file mode 100755 index 172a4f3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: constant' -}); - -parser.addArgument( - [ '-a'], - { - action: 'storeConst', - dest: 'answer', - help: 'store constant', - constant: 42 - } -); -parser.addArgument( - [ '--str' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "str" to types', - constant: 'str' - } -); -parser.addArgument( - [ '--int' ], - { - action: 'appendConst', - dest: 'types', - help: 'append constant "int" to types', - constant: 'int' - } -); - -parser.addArgument( - [ '--true' ], - { - action: 'storeTrue', - help: 'store true constant' - } -); -parser.addArgument( - [ '--false' ], - { - action: 'storeFalse', - help: 'store false constant' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('-a --str --int --true'.split(' ')); -console.dir(args); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js deleted file mode 100755 index 7eb9555..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: help', - epilog: 'help epilog', - prog: 'help_example_prog', - usage: 'Usage %(prog)s ' -}); -parser.printHelp(); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js deleted file mode 100755 index 74f376b..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: nargs' -}); -parser.addArgument( - [ '-f', '--foo' ], - { - help: 'foo bar', - nargs: 1 - } -); -parser.addArgument( - [ '-b', '--bar' ], - { - help: 'bar foo', - nargs: '*' - } -); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('--foo a --bar c d'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('--bar b c f --foo a'.split(' ')); -console.dir(args); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js deleted file mode 100755 index dfe8968..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; - -var args; -var parent_parser = new ArgumentParser({ addHelp: false }); -// note addHelp:false to prevent duplication of the -h option -parent_parser.addArgument( - ['--parent'], - { type: 'int', description: 'parent' } -); - -var foo_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child1' -}); -foo_parser.addArgument(['foo']); -args = foo_parser.parseArgs(['--parent', '2', 'XXX']); -console.log(args); - -var bar_parser = new ArgumentParser({ - parents: [ parent_parser ], - description: 'child2' -}); -bar_parser.addArgument(['--bar']); -args = bar_parser.parseArgs(['--bar', 'YYY']); -console.log(args); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js deleted file mode 100755 index 430d5e1..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: prefix_chars', - prefixChars: '-+' -}); -parser.addArgument(['+f', '++foo']); -parser.addArgument(['++bar'], {action: 'storeTrue'}); - -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs(['+f', '1']); -console.dir(args); -args = parser.parseArgs(['++bar']); -console.dir(args); -args = parser.parseArgs(['++foo', '2', '++bar']); -console.dir(args); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js deleted file mode 100755 index df9c494..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env node -'use strict'; - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ - version: '0.0.1', - addHelp: true, - description: 'Argparse examples: sub-commands' -}); - -var subparsers = parser.addSubparsers({ - title: 'subcommands', - dest: "subcommand_name" -}); - -var bar = subparsers.addParser('c1', {addHelp: true, help: 'c1 help'}); -bar.addArgument( - [ '-f', '--foo' ], - { - action: 'store', - help: 'foo3 bar3' - } -); -var bar = subparsers.addParser( - 'c2', - {aliases: ['co'], addHelp: true, help: 'c2 help'} -); -bar.addArgument( - [ '-b', '--bar' ], - { - action: 'store', - type: 'int', - help: 'foo3 bar3' - } -); -parser.printHelp(); -console.log('-----------'); - -var args; -args = parser.parseArgs('c1 -f 2'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('c2 -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -args = parser.parseArgs('co -b 1'.split(' ')); -console.dir(args); -console.log('-----------'); -parser.parseArgs(['c1', '-h']); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js deleted file mode 100755 index 4532800..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env node - -'use strict'; - - -var ArgumentParser = require('../lib/argparse').ArgumentParser; -var parser = new ArgumentParser({ description: 'Process some integers.' }); - - -function sum(arr) { - return arr.reduce(function (a, b) { - return a + b; - }, 0); -} -function max(arr) { - return Math.max.apply(Math, arr); -} - - -parser.addArgument(['integers'], { - metavar: 'N', - type: 'int', - nargs: '+', - help: 'an integer for the accumulator' -}); -parser.addArgument(['--sum'], { - dest: 'accumulate', - action: 'storeConst', - constant: sum, - defaultValue: max, - help: 'sum the integers (default: find the max)' -}); - -var args = parser.parseArgs('--sum 1 2 -1'.split(' ')); -console.log(args.accumulate(args.integers)); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js deleted file mode 100644 index afb4a2d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +++ /dev/null @@ -1,270 +0,0 @@ -'use strict'; - -var a, group, parser, helptext; - -var assert = require('assert'); -var _ = require('underscore'); -_.str = require('underscore.string'); -var print = function () { - return console.log.apply(console, arguments); - }; -// print = function () {}; - -var argparse = require('argparse'); - -print("TEST argparse.ArgumentDefaultsHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - formatterClass: argparse.ArgumentDefaultsHelpFormatter, - description: 'description' -}); - -parser.addArgument(['--foo'], { - help: 'foo help - oh and by the way, %(defaultValue)s' -}); - -parser.addArgument(['--bar'], { - action: 'storeTrue', - help: 'bar help' -}); - -parser.addArgument(['spam'], { - help: 'spam help' -}); - -parser.addArgument(['badger'], { - nargs: '?', - defaultValue: 'wooden', - help: 'badger help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: 'group description' -}); - -group.addArgument(['--baz'], { - type: 'int', - defaultValue: 42, - help: 'baz help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(/badger help \(default: wooden\)/)); -assert(helptext.match(/foo help - oh and by the way, null/)); -assert(helptext.match(/bar help \(default: false\)/)); -assert(helptext.match(/title:\n {2}group description/)); // test indent -assert(helptext.match(/baz help \(default: 42\)/im)); - -/* -usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger] - -description - -positional arguments: - spam spam help - badger badger help (default: wooden) - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help - oh and by the way, null - --bar bar help (default: false) - -title: - group description - - --baz BAZ baz help (default: 42) -*/ - -print("TEST argparse.RawDescriptionHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawDescriptionHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should not\n' + - ' retain this odd formatting' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert.equal(helptext.match(a.help), null); -assert(helptext.match(/foo help should not retain this odd formatting/)); - -/* -class TestHelpRawDescription(HelpTestCase): - """Test the RawTextHelpFormatter""" -.... - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should not retain this odd formatting - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST argparse.RawTextHelpFormatter"); - -parser = new argparse.ArgumentParser({ - debug: true, - prog: 'PROG', - formatterClass: argparse.RawTextHelpFormatter, - description: 'Keep the formatting\n' + - ' exactly as it is written\n' + - '\n' + - 'here\n' -}); - -parser.addArgument(['--baz'], { - help: ' baz help should also\n' + - 'appear as given here' -}); - -a = parser.addArgument(['--foo'], { - help: ' foo help should also\n' + - 'appear as given here' -}); - -parser.addArgument(['spam'], { - 'help': 'spam help' -}); - -group = parser.addArgumentGroup({ - title: 'title', - description: ' This text\n' + - ' should be indented\n' + - ' exactly like it is here\n' -}); - -group.addArgument(['--bar'], { - help: 'bar help' -}); - -helptext = parser.formatHelp(); -print(helptext); -// test selected clips -assert(helptext.match(parser.description)); -assert(helptext.match(/( {14})appear as given here/gm)); - -/* -class TestHelpRawText(HelpTestCase): - """Test the RawTextHelpFormatter""" - -usage: PROG [-h] [--foo FOO] [--bar BAR] spam - -Keep the formatting - exactly as it is written - -here - -positional arguments: - spam spam help - -optional arguments: - -h, --help show this help message and exit - --foo FOO foo help should also - appear as given here - -title: - This text - should be indented - exactly like it is here - - --bar BAR bar help -*/ - - -print("TEST metavar as a tuple"); - -parser = new argparse.ArgumentParser({ - prog: 'PROG' -}); - -parser.addArgument(['-w'], { - help: 'w', - nargs: '+', - metavar: ['W1', 'W2'] -}); - -parser.addArgument(['-x'], { - help: 'x', - nargs: '*', - metavar: ['X1', 'X2'] -}); - -parser.addArgument(['-y'], { - help: 'y', - nargs: 3, - metavar: ['Y1', 'Y2', 'Y3'] -}); - -parser.addArgument(['-z'], { - help: 'z', - nargs: '?', - metavar: ['Z1'] -}); - -helptext = parser.formatHelp(); -print(helptext); -var ustring = 'PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]]'; -ustring = ustring.replace(/\[/g, '\\[').replace(/\]/g, '\\]'); -// print(ustring) -assert(helptext.match(new RegExp(ustring))); - -/* -class TestHelpTupleMetavar(HelpTestCase): - """Test specifying metavar as a tuple""" - -usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] [-z [Z1]] - -optional arguments: - -h, --help show this help message and exit - -w W1 [W2 ...] w - -x [X1 [X2 ...]] x - -y Y1 Y2 Y3 y - -z [Z1] z -*/ - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js deleted file mode 100644 index 3b6eea0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/argparse'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js deleted file mode 100644 index 6f7e9a5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * class Action - * - * Base class for all actions - * Do not call in your code, use this class only for inherits your own action - * - * Information about how to convert command line strings to Javascript objects. - * Action objects are used by an ArgumentParser to represent the information - * needed to parse a single argument from one or more strings from the command - * line. The keyword arguments to the Action constructor are also all attributes - * of Action instances. - * - * #####Alowed keywords: - * - * - `store` - * - `storeConstant` - * - `storeTrue` - * - `storeFalse` - * - `append` - * - `appendConstant` - * - `count` - * - `help` - * - `version` - * - * Information about action options see [[Action.new]] - * - * See also [original guide](http://docs.python.org/dev/library/argparse.html#action) - * - **/ - -'use strict'; - - -// Constants -var $$ = require('./const'); - - -/** - * new Action(options) - * - * Base class for all actions. Used only for inherits - * - * - * ##### Options: - * - * - `optionStrings` A list of command-line option strings for the action. - * - `dest` Attribute to hold the created object(s) - * - `nargs` The number of command-line arguments that should be consumed. - * By default, one argument will be consumed and a single value will be - * produced. - * - `constant` Default value for an action with no value. - * - `defaultValue` The value to be produced if the option is not specified. - * - `type` Cast to 'string'|'int'|'float'|'complex'|function (string). If - * None, 'string'. - * - `choices` The choices available. - * - `required` True if the action must always be specified at the command - * line. - * - `help` The help describing the argument. - * - `metavar` The name to be used for the option's argument with the help - * string. If None, the 'dest' value will be used as the name. - * - * ##### nargs supported values: - * - * - `N` (an integer) consumes N arguments (and produces a list) - * - `?` consumes zero or one arguments - * - `*` consumes zero or more arguments (and produces a list) - * - `+` consumes one or more arguments (and produces a list) - * - * Note: that the difference between the default and nargs=1 is that with the - * default, a single value will be produced, while with nargs=1, a list - * containing a single value will be produced. - **/ -var Action = module.exports = function Action(options) { - options = options || {}; - this.optionStrings = options.optionStrings || []; - this.dest = options.dest; - this.nargs = options.nargs !== undefined ? options.nargs : null; - this.constant = options.constant !== undefined ? options.constant : null; - this.defaultValue = options.defaultValue; - this.type = options.type !== undefined ? options.type : null; - this.choices = options.choices !== undefined ? options.choices : null; - this.required = options.required !== undefined ? options.required: false; - this.help = options.help !== undefined ? options.help : null; - this.metavar = options.metavar !== undefined ? options.metavar : null; - - if (!(this.optionStrings instanceof Array)) { - throw new Error('optionStrings should be an array'); - } - if (this.required !== undefined && typeof(this.required) !== 'boolean') { - throw new Error('required should be a boolean'); - } -}; - -/** - * Action#getName -> String - * - * Tells action name - **/ -Action.prototype.getName = function () { - if (this.optionStrings.length > 0) { - return this.optionStrings.join('/'); - } else if (this.metavar !== null && this.metavar !== $$.SUPPRESS) { - return this.metavar; - } else if (this.dest !== undefined && this.dest !== $$.SUPPRESS) { - return this.dest; - } - return null; -}; - -/** - * Action#isOptional -> Boolean - * - * Return true if optional - **/ -Action.prototype.isOptional = function () { - return !this.isPositional(); -}; - -/** - * Action#isPositional -> Boolean - * - * Return true if positional - **/ -Action.prototype.isPositional = function () { - return (this.optionStrings.length === 0); -}; - -/** - * Action#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Should be implemented in inherited classes - * - * ##### Example - * - * ActionCount.prototype.call = function (parser, namespace, values, optionString) { - * namespace.set(this.dest, (namespace[this.dest] || 0) + 1); - * }; - * - **/ -Action.prototype.call = function () { - throw new Error('.call() not defined');// Not Implemented error -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js deleted file mode 100644 index 48c6dbe..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +++ /dev/null @@ -1,55 +0,0 @@ -/*:nodoc:* - * class ActionAppend - * - * This action stores a list, and appends each argument value to the list. - * This is useful to allow an option to be specified multiple times. - * This class inherided from [[Action]] - * - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - -/*:nodoc:* - * new ActionAppend(options) - * - options (object): options hash see [[Action.new]] - * - * Note: options.nargs should be optional for constants - * and more then zero for other - **/ -var ActionAppend = module.exports = function ActionAppend(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for append actions must be > 0; if arg ' + - 'strings are not supplying the value to append, ' + - 'the append const action may be more appropriate'); - } - if (!!this.constant && this.nargs !== $$.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionAppend, Action); - -/*:nodoc:* - * ActionAppend#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppend.prototype.call = function (parser, namespace, values) { - var items = [].concat(namespace[this.dest] || []); // or _.clone - items.push(values); - namespace.set(this.dest, items); -}; - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js deleted file mode 100644 index 90747ab..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +++ /dev/null @@ -1,47 +0,0 @@ -/*:nodoc:* - * class ActionAppendConstant - * - * This stores a list, and appends the value specified by - * the const keyword argument to the list. - * (Note that the const keyword argument defaults to null.) - * The 'appendConst' action is typically useful when multiple - * arguments need to store constants to the same list. - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionAppendConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionAppendConstant = module.exports = function ActionAppendConstant(options) { - options = options || {}; - options.nargs = 0; - if (options.constant === undefined) { - throw new Error('constant option is required for appendAction'); - } - Action.call(this, options); -}; -util.inherits(ActionAppendConstant, Action); - -/*:nodoc:* - * ActionAppendConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionAppendConstant.prototype.call = function (parser, namespace) { - var items = [].concat(namespace[this.dest] || []); - items.push(this.constant); - namespace.set(this.dest, items); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js deleted file mode 100644 index d6a5899..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +++ /dev/null @@ -1,40 +0,0 @@ -/*:nodoc:* - * class ActionCount - * - * This counts the number of times a keyword argument occurs. - * For example, this is useful for increasing verbosity levels - * - * This class inherided from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -/*:nodoc:* - * new ActionCount(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionCount = module.exports = function ActionCount(options) { - options = options || {}; - options.nargs = 0; - - Action.call(this, options); -}; -util.inherits(ActionCount, Action); - -/*:nodoc:* - * ActionCount#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionCount.prototype.call = function (parser, namespace) { - namespace.set(this.dest, (namespace[this.dest] || 0) + 1); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js deleted file mode 100644 index 7f7b4e2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +++ /dev/null @@ -1,48 +0,0 @@ -/*:nodoc:* - * class ActionHelp - * - * Support action for printing help - * This class inherided from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - -/*:nodoc:* - * new ActionHelp(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionHelp = module.exports = function ActionHelp(options) { - options = options || {}; - if (options.defaultValue !== null) { - options.defaultValue = options.defaultValue; - } - else { - options.defaultValue = $$.SUPPRESS; - } - options.dest = (options.dest !== null ? options.dest: $$.SUPPRESS); - options.nargs = 0; - Action.call(this, options); - -}; -util.inherits(ActionHelp, Action); - -/*:nodoc:* - * ActionHelp#call(parser, namespace, values, optionString) - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print help and exit - **/ -ActionHelp.prototype.call = function (parser) { - parser.printHelp(); - parser.exit(); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js deleted file mode 100644 index 8ebc974..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +++ /dev/null @@ -1,50 +0,0 @@ -/*:nodoc:* - * class ActionStore - * - * This action just stores the argument’s value. This is the default action. - * - * This class inherited from [[Action]] - * - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - - -/*:nodoc:* - * new ActionStore(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStore = module.exports = function ActionStore(options) { - options = options || {}; - if (this.nargs <= 0) { - throw new Error('nargs for store actions must be > 0; if you ' + - 'have nothing to store, actions such as store ' + - 'true or store const may be more appropriate'); - - } - if (this.constant !== undefined && this.nargs !== $$.OPTIONAL) { - throw new Error('nargs must be OPTIONAL to supply const'); - } - Action.call(this, options); -}; -util.inherits(ActionStore, Action); - -/*:nodoc:* - * ActionStore#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStore.prototype.call = function (parser, namespace, values) { - namespace.set(this.dest, values); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js deleted file mode 100644 index 8410fcf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +++ /dev/null @@ -1,43 +0,0 @@ -/*:nodoc:* - * class ActionStoreConstant - * - * This action stores the value specified by the const keyword argument. - * (Note that the const keyword argument defaults to the rather unhelpful null.) - * The 'store_const' action is most commonly used with optional - * arguments that specify some sort of flag. - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../../action'); - -/*:nodoc:* - * new ActionStoreConstant(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreConstant = module.exports = function ActionStoreConstant(options) { - options = options || {}; - options.nargs = 0; - if (options.constant === undefined) { - throw new Error('constant option is required for storeAction'); - } - Action.call(this, options); -}; -util.inherits(ActionStoreConstant, Action); - -/*:nodoc:* - * ActionStoreConstant#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Save result in namespace object - **/ -ActionStoreConstant.prototype.call = function (parser, namespace) { - namespace.set(this.dest, this.constant); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js deleted file mode 100644 index 66417bf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +++ /dev/null @@ -1,27 +0,0 @@ -/*:nodoc:* - * class ActionStoreFalse - * - * This action store the values False respectively. - * This is special cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ - -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreFalse(options) - * - options (object): hash of options see [[Action.new]] - * - **/ -var ActionStoreFalse = module.exports = function ActionStoreFalse(options) { - options = options || {}; - options.constant = false; - options.defaultValue = options.defaultValue !== null ? options.defaultValue: true; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreFalse, ActionStoreConstant); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js deleted file mode 100644 index 43ec708..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +++ /dev/null @@ -1,26 +0,0 @@ -/*:nodoc:* - * class ActionStoreTrue - * - * This action store the values True respectively. - * This isspecial cases of 'storeConst' - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var ActionStoreConstant = require('./constant'); - -/*:nodoc:* - * new ActionStoreTrue(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionStoreTrue = module.exports = function ActionStoreTrue(options) { - options = options || {}; - options.constant = true; - options.defaultValue = options.defaultValue !== null ? options.defaultValue: false; - ActionStoreConstant.call(this, options); -}; -util.inherits(ActionStoreTrue, ActionStoreConstant); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js deleted file mode 100644 index adecf65..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +++ /dev/null @@ -1,148 +0,0 @@ -/** internal - * class ActionSubparsers - * - * Support the creation of such sub-commands with the addSubparsers() - * - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; -var _ = require('underscore'); - - -var Action = require('../action'); - -// Constants -var $$ = require('../const'); - -// Errors -var argumentErrorHelper = require('../argument/error'); - - -/*:nodoc:* - * new ChoicesPseudoAction(name, help) - * - * Create pseudo action for correct help text - * - **/ -var ChoicesPseudoAction = function (name, help) { - var options = { - optionStrings: [], - dest: name, - help: help - }; - - Action.call(this, options); -}; -util.inherits(ChoicesPseudoAction, Action); - -/** - * new ActionSubparsers(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionSubparsers = module.exports = function ActionSubparsers(options) { - options = options || {}; - options.dest = options.dest || $$.SUPPRESS; - options.nargs = $$.PARSER; - - this.debug = (options.debug === true); - - this._progPrefix = options.prog; - this._parserClass = options.parserClass; - this._nameParserMap = {}; - this._choicesActions = []; - - options.choices = this._nameParserMap; - Action.call(this, options); -}; -util.inherits(ActionSubparsers, Action); - -/*:nodoc:* - * ActionSubparsers#addParser(name, options) -> ArgumentParser - * - name (string): sub-command name - * - options (object): see [[ArgumentParser.new]] - * - * Note: - * addParser supports an additional aliases option, - * which allows multiple strings to refer to the same subparser. - * This example, like svn, aliases co as a shorthand for checkout - * - **/ -ActionSubparsers.prototype.addParser = function (name, options) { - var parser; - - var self = this; - - options = options || {}; - - options.debug = (this.debug === true); - - // set program from the existing prefix - if (!options.prog) { - options.prog = this._progPrefix + ' ' + name; - } - - var aliases = options.aliases || []; - - // create a pseudo-action to hold the choice help - if (!!options.help || _.isString(options.help)) { - var help = options.help; - delete options.help; - - var choiceAction = new ChoicesPseudoAction(name, help); - this._choicesActions.push(choiceAction); - } - - // create the parser and add it to the map - parser = new this._parserClass(options); - this._nameParserMap[name] = parser; - - // make parser available under aliases also - aliases.forEach(function (alias) { - self._nameParserMap[alias] = parser; - }); - - return parser; -}; - -ActionSubparsers.prototype._getSubactions = function () { - return this._choicesActions; -}; - -/*:nodoc:* - * ActionSubparsers#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Call the action. Parse input aguments - **/ -ActionSubparsers.prototype.call = function (parser, namespace, values) { - var parserName = values[0]; - var argStrings = values.slice(1); - - // set the parser name if requested - if (this.dest !== $$.SUPPRESS) { - namespace[this.dest] = parserName; - } - - // select the parser - if (!!this._nameParserMap[parserName]) { - parser = this._nameParserMap[parserName]; - } else { - throw argumentErrorHelper(format( - 'Unknown parser "%s" (choices: [%s]).', - parserName, - _.keys(this._nameParserMap).join(', ') - )); - } - - // parse all the remaining options into the namespace - parser.parseArgs(argStrings, namespace); -}; - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js deleted file mode 100644 index a17877c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +++ /dev/null @@ -1,50 +0,0 @@ -/*:nodoc:* - * class ActionVersion - * - * Support action for printing program version - * This class inherited from [[Action]] - **/ -'use strict'; - -var util = require('util'); - -var Action = require('../action'); - -// -// Constants -// -var $$ = require('../const'); - -/*:nodoc:* - * new ActionVersion(options) - * - options (object): options hash see [[Action.new]] - * - **/ -var ActionVersion = module.exports = function ActionVersion(options) { - options = options || {}; - options.defaultValue = (!!options.defaultValue ? options.defaultValue: $$.SUPPRESS); - options.dest = (options.dest || $$.SUPPRESS); - options.nargs = 0; - this.version = options.version; - Action.call(this, options); -}; -util.inherits(ActionVersion, Action); - -/*:nodoc:* - * ActionVersion#call(parser, namespace, values, optionString) -> Void - * - parser (ArgumentParser): current parser - * - namespace (Namespace): namespace for output data - * - values (Array): parsed values - * - optionString (Array): input option string(not parsed) - * - * Print version and exit - **/ -ActionVersion.prototype.call = function (parser) { - var version = this.version || parser.version; - var formatter = parser._getFormatter(); - formatter.addText(version); - parser.exit(0, formatter.formatHelp()); -}; - - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js deleted file mode 100644 index dbe3e3c..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +++ /dev/null @@ -1,481 +0,0 @@ -/** internal - * class ActionContainer - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - **/ - -'use strict'; - -var format = require('util').format; -var _ = require('underscore'); - -_.str = require('underscore.string'); - -// Constants -var $$ = require('./const'); - -//Actions -var ActionHelp = require('./action/help'); -var ActionAppend = require('./action/append'); -var ActionAppendConstant = require('./action/append/constant'); -var ActionCount = require('./action/count'); -var ActionStore = require('./action/store'); -var ActionStoreConstant = require('./action/store/constant'); -var ActionStoreTrue = require('./action/store/true'); -var ActionStoreFalse = require('./action/store/false'); -var ActionVersion = require('./action/version'); -var ActionSubparsers = require('./action/subparsers'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - - - -/** - * new ActionContainer(options) - * - * Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]] - * - * ##### Options: - * - * - `description` -- A description of what the program does - * - `prefixChars` -- Characters that prefix optional arguments - * - `argumentDefault` -- The default value for all arguments - * - `conflictHandler` -- The conflict handler to use for duplicate arguments - **/ -var ActionContainer = module.exports = function ActionContainer(options) { - options = options || {}; - - this.description = options.description; - this.argumentDefault = options.argumentDefault; - this.prefixChars = options.prefixChars || ''; - this.conflictHandler = options.conflictHandler; - - // set up registries - this._registries = {}; - - // register actions - this.register('action', null, ActionStore); - this.register('action', 'store', ActionStore); - this.register('action', 'storeConst', ActionStoreConstant); - this.register('action', 'storeTrue', ActionStoreTrue); - this.register('action', 'storeFalse', ActionStoreFalse); - this.register('action', 'append', ActionAppend); - this.register('action', 'appendConst', ActionAppendConstant); - this.register('action', 'count', ActionCount); - this.register('action', 'help', ActionHelp); - this.register('action', 'version', ActionVersion); - this.register('action', 'parsers', ActionSubparsers); - - // raise an exception if the conflict handler is invalid - this._getHandler(); - - // action storage - this._actions = []; - this._optionStringActions = {}; - - // groups - this._actionGroups = []; - this._mutuallyExclusiveGroups = []; - - // defaults storage - this._defaults = {}; - - // determines whether an "option" looks like a negative number - // -1, -1.5 -5e+4 - this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$'); - - // whether or not there are any optionals that look like negative - // numbers -- uses a list so it can be shared and edited - this._hasNegativeNumberOptionals = []; -}; - -// Groups must be required, then ActionContainer already defined -var ArgumentGroup = require('./argument/group'); -var MutuallyExclusiveGroup = require('./argument/exclusive'); - -// -// Registration methods -// - -/** - * ActionContainer#register(registryName, value, object) -> Void - * - registryName (String) : object type action|type - * - value (string) : keyword - * - object (Object|Function) : handler - * - * Register handlers - **/ -ActionContainer.prototype.register = function (registryName, value, object) { - this._registries[registryName] = this._registries[registryName] || {}; - this._registries[registryName][value] = object; -}; - -ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) { - if (3 > arguments.length) { - defaultValue = null; - } - return this._registries[registryName][value] || defaultValue; -}; - -// -// Namespace default accessor methods -// - -/** - * ActionContainer#setDefaults(options) -> Void - * - options (object):hash of options see [[Action.new]] - * - * Set defaults - **/ -ActionContainer.prototype.setDefaults = function (options) { - options = options || {}; - for (var property in options) { - this._defaults[property] = options[property]; - } - - // if these defaults match any existing arguments, replace the previous - // default on the object with the new one - this._actions.forEach(function (action) { - if (action.dest in options) { - action.defaultValue = options[action.dest]; - } - }); -}; - -/** - * ActionContainer#getDefault(dest) -> Mixed - * - dest (string): action destination - * - * Return action default value - **/ -ActionContainer.prototype.getDefault = function (dest) { - var result = (_.has(this._defaults, dest)) ? this._defaults[dest] : null; - - this._actions.forEach(function (action) { - if (action.dest === dest && _.has(action, 'defaultValue')) { - result = action.defaultValue; - } - }); - - return result; -}; -// -// Adding argument actions -// - -/** - * ActionContainer#addArgument(args, options) -> Object - * - args (Array): array of argument keys - * - options (Object): action objects see [[Action.new]] - * - * #### Examples - * - addArgument([-f, --foo], {action:'store', defaultValue=1, ...}) - * - addArgument(['bar'], action: 'store', nargs:1, ...}) - **/ -ActionContainer.prototype.addArgument = function (args, options) { - args = args; - options = options || {}; - - if (!_.isArray(args)) { - throw new TypeError('addArgument first argument should be an array'); - } - if (!_.isObject(options) || _.isArray(options)) { - throw new TypeError('addArgument second argument should be a hash'); - } - - // if no positional args are supplied or only one is supplied and - // it doesn't look like an option string, parse a positional argument - if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) { - if (args && !!options.dest) { - throw new Error('dest supplied twice for positional argument'); - } - options = this._getPositional(args, options); - - // otherwise, we're adding an optional argument - } else { - options = this._getOptional(args, options); - } - - // if no default was supplied, use the parser-level default - if (_.isUndefined(options.defaultValue)) { - var dest = options.dest; - if (_.has(this._defaults, dest)) { - options.defaultValue = this._defaults[dest]; - } else if (!_.isUndefined(this.argumentDefault)) { - options.defaultValue = this.argumentDefault; - } - } - - // create the action object, and add it to the parser - var ActionClass = this._popActionClass(options); - if (! _.isFunction(ActionClass)) { - throw new Error(format('Unknown action "%s".', ActionClass)); - } - var action = new ActionClass(options); - - // throw an error if the action type is not callable - var typeFunction = this._registryGet('type', action.type, action.type); - if (!_.isFunction(typeFunction)) { - throw new Error(format('"%s" is not callable', typeFunction)); - } - - return this._addAction(action); -}; - -/** - * ActionContainer#addArgumentGroup(options) -> ArgumentGroup - * - options (Object): hash of options see [[ArgumentGroup.new]] - * - * Create new arguments groups - **/ -ActionContainer.prototype.addArgumentGroup = function (options) { - var group = new ArgumentGroup(this, options); - this._actionGroups.push(group); - return group; -}; - -/** - * ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup - * - options (Object): {required: false} - * - * Create new mutual exclusive groups - **/ -ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) { - var group = new MutuallyExclusiveGroup(this, options); - this._mutuallyExclusiveGroups.push(group); - return group; -}; - -ActionContainer.prototype._addAction = function (action) { - var self = this; - - // resolve any conflicts - this._checkConflict(action); - - // add to actions list - this._actions.push(action); - action.container = this; - - // index the action by any option strings it has - action.optionStrings.forEach(function (optionString) { - self._optionStringActions[optionString] = action; - }); - - // set the flag if any option strings look like negative numbers - action.optionStrings.forEach(function (optionString) { - if (optionString.match(self._regexpNegativeNumber)) { - if (!_.any(self._hasNegativeNumberOptionals)) { - self._hasNegativeNumberOptionals.push(true); - } - } - }); - - // return the created action - return action; -}; - -ActionContainer.prototype._removeAction = function (action) { - var actionIndex = this._actions.indexOf(action); - if (actionIndex >= 0) { - this._actions.splice(actionIndex, 1); - } -}; - -ActionContainer.prototype._addContainerActions = function (container) { - // collect groups by titles - var titleGroupMap = {}; - this._actionGroups.forEach(function (group) { - if (titleGroupMap[group.title]) { - throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title)); - } - titleGroupMap[group.title] = group; - }); - - // map each action to its group - var groupMap = {}; - function actionHash(action) { - // unique (hopefully?) string suitable as dictionary key - return action.getName(); - } - container._actionGroups.forEach(function (group) { - // if a group with the title exists, use that, otherwise - // create a new group matching the container's group - if (!titleGroupMap[group.title]) { - titleGroupMap[group.title] = this.addArgumentGroup({ - title: group.title, - description: group.description - }); - } - - // map the actions to their new group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = titleGroupMap[group.title]; - }); - }, this); - - // add container's mutually exclusive groups - // NOTE: if add_mutually_exclusive_group ever gains title= and - // description= then this code will need to be expanded as above - var mutexGroup; - container._mutuallyExclusiveGroups.forEach(function (group) { - mutexGroup = this.addMutuallyExclusiveGroup({ - required: group.required - }); - // map the actions to their new mutex group - group._groupActions.forEach(function (action) { - groupMap[actionHash(action)] = mutexGroup; - }); - }, this); // forEach takes a 'this' argument - - // add all actions to this container or their group - container._actions.forEach(function (action) { - var key = actionHash(action); - if (!!groupMap[key]) { - groupMap[key]._addAction(action); - } - else - { - this._addAction(action); - } - }); -}; - -ActionContainer.prototype._getPositional = function (dest, options) { - if (_.isArray(dest)) { - dest = _.first(dest); - } - // make sure required is not specified - if (options.required) { - throw new Error('"required" is an invalid argument for positionals.'); - } - - // mark positional arguments as required if at least one is - // always required - if (options.nargs !== $$.OPTIONAL && options.nargs !== $$.ZERO_OR_MORE) { - options.required = true; - } - if (options.nargs === $$.ZERO_OR_MORE && options.defaultValue === undefined) { - options.required = true; - } - - // return the keyword arguments with no option strings - options.dest = dest; - options.optionStrings = []; - return options; -}; - -ActionContainer.prototype._getOptional = function (args, options) { - var prefixChars = this.prefixChars; - var optionStrings = []; - var optionStringsLong = []; - - // determine short and long option strings - args.forEach(function (optionString) { - // error on strings that don't start with an appropriate prefix - if (prefixChars.indexOf(optionString[0]) < 0) { - throw new Error(format('Invalid option string "%s": must start with a "%s".', - optionString, - prefixChars - )); - } - - // strings starting with two prefix characters are long options - optionStrings.push(optionString); - if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) { - optionStringsLong.push(optionString); - } - }); - - // infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x' - var dest = options.dest || null; - delete options.dest; - - if (!dest) { - var optionStringDest = optionStringsLong.length ? optionStringsLong[0] :optionStrings[0]; - dest = _.str.strip(optionStringDest, this.prefixChars); - - if (dest.length === 0) { - throw new Error( - format('dest= is required for options like "%s"', optionStrings.join(', ')) - ); - } - dest = dest.replace(/-/g, '_'); - } - - // return the updated keyword arguments - options.dest = dest; - options.optionStrings = optionStrings; - - return options; -}; - -ActionContainer.prototype._popActionClass = function (options, defaultValue) { - defaultValue = defaultValue || null; - - var action = (options.action || defaultValue); - delete options.action; - - var actionClass = this._registryGet('action', action, action); - return actionClass; -}; - -ActionContainer.prototype._getHandler = function () { - var handlerString = this.conflictHandler; - var handlerFuncName = "_handleConflict" + _.str.capitalize(handlerString); - var func = this[handlerFuncName]; - if (typeof func === 'undefined') { - var msg = "invalid conflict resolution value: " + handlerString; - throw new Error(msg); - } else { - return func; - } -}; - -ActionContainer.prototype._checkConflict = function (action) { - var optionStringActions = this._optionStringActions; - var conflictOptionals = []; - - // find all options that conflict with this option - // collect pairs, the string, and an existing action that it conflicts with - action.optionStrings.forEach(function (optionString) { - var conflOptional = optionStringActions[optionString]; - if (typeof conflOptional !== 'undefined') { - conflictOptionals.push([optionString, conflOptional]); - } - }); - - if (conflictOptionals.length > 0) { - var conflictHandler = this._getHandler(); - conflictHandler.call(this, action, conflictOptionals); - } -}; - -ActionContainer.prototype._handleConflictError = function (action, conflOptionals) { - var conflicts = _.map(conflOptionals, function (pair) {return pair[0]; }); - conflicts = conflicts.join(', '); - throw argumentErrorHelper( - action, - format('Conflicting option string(s): %s', conflicts) - ); -}; - -ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) { - // remove all conflicting options - var self = this; - conflOptionals.forEach(function (pair) { - var optionString = pair[0]; - var conflictingAction = pair[1]; - // remove the conflicting option string - var i = conflictingAction.optionStrings.indexOf(optionString); - if (i >= 0) { - conflictingAction.optionStrings.splice(i, 1); - } - delete self._optionStringActions[optionString]; - // if the option now has no option string, remove it from the - // container holding it - if (conflictingAction.optionStrings.length === 0) { - conflictingAction.container._removeAction(conflictingAction); - } - }); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js deleted file mode 100644 index f2a2c51..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -module.exports.ArgumentParser = require('./argument_parser.js'); -module.exports.Namespace = require('./namespace'); -module.exports.Action = require('./action'); -module.exports.HelpFormatter = require('./help/formatter.js'); -module.exports.Const = require('./const.js'); - -module.exports.ArgumentDefaultsHelpFormatter = - require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter; -module.exports.RawDescriptionHelpFormatter = - require('./help/added_formatters.js').RawDescriptionHelpFormatter; -module.exports.RawTextHelpFormatter = - require('./help/added_formatters.js').RawTextHelpFormatter; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js deleted file mode 100644 index c8a02a0..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +++ /dev/null @@ -1,50 +0,0 @@ -'use strict'; - - -var format = require('util').format; - - -var ERR_CODE = 'ARGError'; - -/*:nodoc:* - * argumentError(argument, message) -> TypeError - * - argument (Object): action with broken argument - * - message (String): error message - * - * Error format helper. An error from creating or using an argument - * (optional or positional). The string value of this exception - * is the message, augmented with information - * about the argument that caused it. - * - * #####Example - * - * var argumentErrorHelper = require('./argument/error'); - * if (conflictOptionals.length > 0) { - * throw argumentErrorHelper( - * action, - * format('Conflicting option string(s): %s', conflictOptionals.join(', ')) - * ); - * } - * - **/ -module.exports = function (argument, message) { - var argumentName = null; - var errMessage; - var err; - - if (argument.getName) { - argumentName = argument.getName(); - } else { - argumentName = '' + argument; - } - - if (!argumentName) { - errMessage = message; - } else { - errMessage = format('argument "%s": %s', argumentName, message); - } - - err = new TypeError(errMessage); - err.code = ERR_CODE; - return err; -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js deleted file mode 100644 index 8287e00..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +++ /dev/null @@ -1,54 +0,0 @@ -/** internal - * class MutuallyExclusiveGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ArgumentGroup = require('./group'); - -/** - * new MutuallyExclusiveGroup(container, options) - * - container (object): main container - * - options (object): options.required -> true/false - * - * `required` could be an argument itself, but making it a property of - * the options argument is more consistent with the JS adaptation of the Python) - **/ -var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) { - var required; - options = options || {}; - required = options.required || false; - ArgumentGroup.call(this, container); - this.required = required; - -}; -util.inherits(MutuallyExclusiveGroup, ArgumentGroup); - - -MutuallyExclusiveGroup.prototype._addAction = function (action) { - var msg; - if (action.required) { - msg = 'mutually exclusive arguments must be optional'; - throw new Error(msg); - } - action = this._container._addAction(action); - this._groupActions.push(action); - return action; -}; - - -MutuallyExclusiveGroup.prototype._removeAction = function (action) { - this._container._removeAction(action); - this._groupActions.remove(action); -}; - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js deleted file mode 100644 index 58b271f..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +++ /dev/null @@ -1,75 +0,0 @@ -/** internal - * class ArgumentGroup - * - * Group arguments. - * By default, ArgumentParser groups command-line arguments - * into “positional arguments” and “optional arguments” - * when displaying help messages. When there is a better - * conceptual grouping of arguments than this default one, - * appropriate groups can be created using the addArgumentGroup() method - * - * This class inherited from [[ArgumentContainer]] - **/ -'use strict'; - -var util = require('util'); - -var ActionContainer = require('../action_container'); - - -/** - * new ArgumentGroup(container, options) - * - container (object): main container - * - options (object): hash of group options - * - * #### options - * - **prefixChars** group name prefix - * - **argumentDefault** default argument value - * - **title** group title - * - **description** group description - * - **/ -var ArgumentGroup = module.exports = function ArgumentGroup(container, options) { - - options = options || {}; - - // add any missing keyword arguments by checking the container - options.conflictHandler = (options.conflictHandler || container.conflictHandler); - options.prefixChars = (options.prefixChars || container.prefixChars); - options.argumentDefault = (options.argumentDefault || container.argumentDefault); - - ActionContainer.call(this, options); - - // group attributes - this.title = options.title; - this._groupActions = []; - - // share most attributes with the container - this._container = container; - this._registries = container._registries; - this._actions = container._actions; - this._optionStringActions = container._optionStringActions; - this._defaults = container._defaults; - this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals; - this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups; -}; -util.inherits(ArgumentGroup, ActionContainer); - - -ArgumentGroup.prototype._addAction = function (action) { - // Parent add action - action = ActionContainer.prototype._addAction.call(this, action); - this._groupActions.push(action); - return action; -}; - - -ArgumentGroup.prototype._removeAction = function (action) { - // Parent remove action - ActionContainer.prototype._removeAction.call(this, action); - var actionIndex = this._groupActions.indexOf(action); - if (actionIndex >= 0) { - this._groupActions.splice(actionIndex, 1); - } -}; - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js deleted file mode 100644 index 97cf098..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +++ /dev/null @@ -1,1165 +0,0 @@ -/** - * class ArgumentParser - * - * Object for parsing command line strings into js objects. - * - * Inherited from [[ActionContainer]] - **/ -'use strict'; - -var util = require('util'); -var format = require('util').format; -var Path = require('path'); - -var _ = require('underscore'); -_.str = require('underscore.string'); - -// Constants -var $$ = require('./const'); - -var ActionContainer = require('./action_container'); - -// Errors -var argumentErrorHelper = require('./argument/error'); - -var HelpFormatter = require('./help/formatter'); - -var Namespace = require('./namespace'); - - -/** - * new ArgumentParser(options) - * - * Create a new ArgumentParser object. - * - * ##### Options: - * - `prog` The name of the program (default: sys.argv[0]) - * - `usage` A usage message (default: auto-generated from arguments) - * - `description` A description of what the program does - * - `epilog` Text following the argument descriptions - * - `parents` Parsers whose arguments should be copied into this one - * - `formatterClass` HelpFormatter class for printing help messages - * - `prefixChars` Characters that prefix optional arguments - * - `fromfilePrefixChars` Characters that prefix files containing additional arguments - * - `argumentDefault` The default value for all arguments - * - `addHelp` Add a -h/-help option - * - `conflictHandler` Specifies how to handle conflicting argument names - * - `debug` Enable debug mode. Argument errors throw exception in - * debug mode and process.exit in normal. Used for development and - * testing (default: false) - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#argumentparser-objects - **/ -var ArgumentParser = module.exports = function ArgumentParser(options) { - var self = this; - options = options || {}; - - options.description = (options.description || null); - options.argumentDefault = (options.argumentDefault || null); - options.prefixChars = (options.prefixChars || '-'); - options.conflictHandler = (options.conflictHandler || 'error'); - ActionContainer.call(this, options); - - options.addHelp = (options.addHelp === undefined || !!options.addHelp); - options.parents = (options.parents || []); - // default program name - options.prog = (options.prog || Path.basename(process.argv[1])); - this.prog = options.prog; - this.usage = options.usage; - this.epilog = options.epilog; - this.version = options.version; - - this.debug = (options.debug === true); - - this.formatterClass = (options.formatterClass || HelpFormatter); - this.fromfilePrefixChars = options.fromfilePrefixChars || null; - this._positionals = this.addArgumentGroup({title: 'Positional arguments'}); - this._optionals = this.addArgumentGroup({title: 'Optional arguments'}); - this._subparsers = null; - - // register types - var FUNCTION_IDENTITY = function (o) { - return o; - }; - this.register('type', 'auto', FUNCTION_IDENTITY); - this.register('type', null, FUNCTION_IDENTITY); - this.register('type', 'int', function (x) { - var result = parseInt(x, 10); - if (isNaN(result)) { - throw new Error(x + ' is not a valid integer.'); - } - return result; - }); - this.register('type', 'float', function (x) { - var result = parseFloat(x); - if (isNaN(result)) { - throw new Error(x + ' is not a valid float.'); - } - return result; - }); - this.register('type', 'string', function (x) { - return '' + x; - }); - - // add help and version arguments if necessary - var defaultPrefix = (this.prefixChars.indexOf('-') > -1) ? '-' : this.prefixChars[0]; - if (options.addHelp) { - this.addArgument( - [defaultPrefix + 'h', defaultPrefix + defaultPrefix + 'help'], - { - action: 'help', - defaultValue: $$.SUPPRESS, - help: 'Show this help message and exit.' - } - ); - } - if (this.version !== undefined) { - this.addArgument( - [defaultPrefix + 'v', defaultPrefix + defaultPrefix + 'version'], - { - action: 'version', - version: this.version, - defaultValue: $$.SUPPRESS, - help: "Show program's version number and exit." - } - ); - } - - // add parent arguments and defaults - options.parents.forEach(function (parent) { - self._addContainerActions(parent); - if (parent._defaults !== undefined) { - for (var defaultKey in parent._defaults) { - if (parent._defaults.hasOwnProperty(defaultKey)) { - self._defaults[defaultKey] = parent._defaults[defaultKey]; - } - } - } - }); - -}; -util.inherits(ArgumentParser, ActionContainer); - -/** - * ArgumentParser#addSubparsers(options) -> [[ActionSubparsers]] - * - options (object): hash of options see [[ActionSubparsers.new]] - * - * See also [subcommands][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#sub-commands - **/ -ArgumentParser.prototype.addSubparsers = function (options) { - if (!!this._subparsers) { - this.error('Cannot have multiple subparser arguments.'); - } - - options = options || {}; - options.debug = (this.debug === true); - options.optionStrings = []; - options.parserClass = (options.parserClass || ArgumentParser); - - - if (!!options.title || !!options.description) { - - this._subparsers = this.addArgumentGroup({ - title: (options.title || 'subcommands'), - description: options.description - }); - delete options.title; - delete options.description; - - } else { - this._subparsers = this._positionals; - } - - // prog defaults to the usage message of this parser, skipping - // optional arguments and with no "usage:" prefix - if (!options.prog) { - var formatter = this._getFormatter(); - var positionals = this._getPositionalActions(); - var groups = this._mutuallyExclusiveGroups; - formatter.addUsage(this.usage, positionals, groups, ''); - options.prog = _.str.strip(formatter.formatHelp()); - } - - // create the parsers action and add it to the positionals list - var ParsersClass = this._popActionClass(options, 'parsers'); - var action = new ParsersClass(options); - this._subparsers._addAction(action); - - // return the created parsers action - return action; -}; - -ArgumentParser.prototype._addAction = function (action) { - if (action.isOptional()) { - this._optionals._addAction(action); - } else { - this._positionals._addAction(action); - } - return action; -}; - -ArgumentParser.prototype._getOptionalActions = function () { - return this._actions.filter(function (action) { - return action.isOptional(); - }); -}; - -ArgumentParser.prototype._getPositionalActions = function () { - return this._actions.filter(function (action) { - return action.isPositional(); - }); -}; - - -/** - * ArgumentParser#parseArgs(args, namespace) -> Namespace|Object - * - args (array): input elements - * - namespace (Namespace|Object): result object - * - * Parsed args and throws error if some arguments are not recognized - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-parse-args-method - **/ -ArgumentParser.prototype.parseArgs = function (args, namespace) { - var argv; - var result = this.parseKnownArgs(args, namespace); - - args = result[0]; - argv = result[1]; - if (argv && argv.length > 0) { - this.error( - format('Unrecognized arguments: %s.', argv.join(' ')) - ); - } - return args; -}; - -/** - * ArgumentParser#parseKnownArgs(args, namespace) -> array - * - args (array): input options - * - namespace (Namespace|Object): result object - * - * Parse known arguments and return tuple of result object - * and unknown args - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#partial-parsing - **/ -ArgumentParser.prototype.parseKnownArgs = function (args, namespace) { - var self = this; - - // args default to the system args - args = args || process.argv.slice(2); - - // default Namespace built from parser defaults - namespace = namespace || new Namespace(); - - self._actions.forEach(function (action) { - if (action.dest !== $$.SUPPRESS) { - if (!_.has(namespace, action.dest)) { - if (action.defaultValue !== $$.SUPPRESS) { - var defaultValue = action.defaultValue; - if (_.isString(action.defaultValue)) { - defaultValue = self._getValue(action, defaultValue); - } - namespace[action.dest] = defaultValue; - } - } - } - }); - - _.keys(self._defaults).forEach(function (dest) { - namespace[dest] = self._defaults[dest]; - }); - - // parse the arguments and exit if there are any errors - try { - var res = this._parseKnownArgs(args, namespace); - - namespace = res[0]; - args = res[1]; - if (_.has(namespace, $$._UNRECOGNIZED_ARGS_ATTR)) { - args = _.union(args, namespace[$$._UNRECOGNIZED_ARGS_ATTR]); - delete namespace[$$._UNRECOGNIZED_ARGS_ATTR]; - } - return [namespace, args]; - } catch (e) { - this.error(e); - } -}; - -ArgumentParser.prototype._parseKnownArgs = function (argStrings, namespace) { - var self = this; - - var extras = []; - - // replace arg strings that are file references - if (this.fromfilePrefixChars !== null) { - argStrings = this._readArgsFromFiles(argStrings); - } - // map all mutually exclusive arguments to the other arguments - // they can't occur with - // Python has 'conflicts = action_conflicts.setdefault(mutex_action, [])' - // though I can't conceive of a way in which an action could be a member - // of two different mutually exclusive groups. - - function actionHash(action) { - // some sort of hashable key for this action - // action itself cannot be a key in actionConflicts - // I think getName() (join of optionStrings) is unique enough - return action.getName(); - } - var conflicts, key; - var actionConflicts = {}; - this._mutuallyExclusiveGroups.forEach(function (mutexGroup) { - mutexGroup._groupActions.forEach(function (mutexAction, i, groupActions) { - key = actionHash(mutexAction); - if (!_.has(actionConflicts, key)) { - actionConflicts[key] = []; - } - conflicts = actionConflicts[key]; - conflicts.push.apply(conflicts, groupActions.slice(0, i)); - conflicts.push.apply(conflicts, groupActions.slice(i + 1)); - }); - }); - - // find all option indices, and determine the arg_string_pattern - // which has an 'O' if there is an option at an index, - // an 'A' if there is an argument, or a '-' if there is a '--' - var optionStringIndices = {}; - - var argStringPatternParts = []; - - argStrings.forEach(function (argString, argStringIndex) { - if (argString === '--') { - argStringPatternParts.push('-'); - while (argStringIndex < argStrings.length) { - argStringPatternParts.push('A'); - argStringIndex++; - } - } - // otherwise, add the arg to the arg strings - // and note the index if it was an option - else { - var pattern; - var optionTuple = self._parseOptional(argString); - if (!optionTuple) { - pattern = 'A'; - } - else { - optionStringIndices[argStringIndex] = optionTuple; - pattern = 'O'; - } - argStringPatternParts.push(pattern); - } - }); - var argStringsPattern = argStringPatternParts.join(''); - - var seenActions = []; - var seenNonDefaultActions = []; - - - function takeAction(action, argumentStrings, optionString) { - seenActions.push(action); - var argumentValues = self._getValues(action, argumentStrings); - - // error if this argument is not allowed with other previously - // seen arguments, assuming that actions that use the default - // value don't really count as "present" - if (argumentValues !== action.defaultValue) { - seenNonDefaultActions.push(action); - if (!!actionConflicts[actionHash(action)]) { - actionConflicts[actionHash(action)].forEach(function (actionConflict) { - if (seenNonDefaultActions.indexOf(actionConflict) >= 0) { - throw argumentErrorHelper( - action, - format('Not allowed with argument "%s".', actionConflict.getName()) - ); - } - }); - } - } - - if (argumentValues !== $$.SUPPRESS) { - action.call(self, namespace, argumentValues, optionString); - } - } - - function consumeOptional(startIndex) { - // get the optional identified at this index - var optionTuple = optionStringIndices[startIndex]; - var action = optionTuple[0]; - var optionString = optionTuple[1]; - var explicitArg = optionTuple[2]; - - // identify additional optionals in the same arg string - // (e.g. -xyz is the same as -x -y -z if no args are required) - var actionTuples = []; - - var args, argCount, start, stop; - - while (true) { - if (!action) { - extras.push(argStrings[startIndex]); - return startIndex + 1; - } - if (!!explicitArg) { - argCount = self._matchArgument(action, 'A'); - - // if the action is a single-dash option and takes no - // arguments, try to parse more single-dash options out - // of the tail of the option string - var chars = self.prefixChars; - if (argCount === 0 && chars.indexOf(optionString[1]) < 0) { - actionTuples.push([action, [], optionString]); - optionString = optionString[0] + explicitArg[0]; - var newExplicitArg = explicitArg.slice(1) || null; - var optionalsMap = self._optionStringActions; - - if (_.keys(optionalsMap).indexOf(optionString) >= 0) { - action = optionalsMap[optionString]; - explicitArg = newExplicitArg; - } - else { - var msg = 'ignored explicit argument %r'; - throw argumentErrorHelper(action, msg); - } - } - // if the action expect exactly one argument, we've - // successfully matched the option; exit the loop - else if (argCount === 1) { - stop = startIndex + 1; - args = [explicitArg]; - actionTuples.push([action, args, optionString]); - break; - } - // error if a double-dash option did not use the - // explicit argument - else { - var message = 'ignored explicit argument %r'; - throw argumentErrorHelper(action, _.str.sprintf(message, explicitArg)); - } - } - // if there is no explicit argument, try to match the - // optional's string arguments with the following strings - // if successful, exit the loop - else { - - start = startIndex + 1; - var selectedPatterns = argStringsPattern.substr(start); - - argCount = self._matchArgument(action, selectedPatterns); - stop = start + argCount; - - - args = argStrings.slice(start, stop); - - actionTuples.push([action, args, optionString]); - break; - } - - } - - // add the Optional to the list and return the index at which - // the Optional's string args stopped - if (actionTuples.length < 1) { - throw new Error('length should be > 0'); - } - for (var i = 0; i < actionTuples.length; i++) { - takeAction.apply(self, actionTuples[i]); - } - return stop; - } - - // the list of Positionals left to be parsed; this is modified - // by consume_positionals() - var positionals = self._getPositionalActions(); - - function consumePositionals(startIndex) { - // match as many Positionals as possible - var selectedPattern = argStringsPattern.substr(startIndex); - var argCounts = self._matchArgumentsPartial(positionals, selectedPattern); - - // slice off the appropriate arg strings for each Positional - // and add the Positional and its args to the list - _.zip(positionals, argCounts).forEach(function (item) { - var action = item[0]; - var argCount = item[1]; - if (argCount === undefined) { - return; - } - var args = argStrings.slice(startIndex, startIndex + argCount); - - startIndex += argCount; - takeAction(action, args); - }); - - // slice off the Positionals that we just parsed and return the - // index at which the Positionals' string args stopped - positionals = positionals.slice(argCounts.length); - return startIndex; - } - - // consume Positionals and Optionals alternately, until we have - // passed the last option string - var startIndex = 0; - var position; - - var maxOptionStringIndex = -1; - if (!!optionStringIndices) { - for (position in optionStringIndices) { - maxOptionStringIndex = Math.max(maxOptionStringIndex, parseInt(position, 10)); - } - } - - var positionalsEndIndex, nextOptionStringIndex; - - while (startIndex <= maxOptionStringIndex) { - // consume any Positionals preceding the next option - nextOptionStringIndex = null; - for (position in optionStringIndices) { - position = parseInt(position, 10); - if (position >= startIndex) { - if (nextOptionStringIndex !== null) { - nextOptionStringIndex = Math.min(nextOptionStringIndex, position); - } - else { - nextOptionStringIndex = position; - } - } - } - - if (startIndex !== nextOptionStringIndex) { - positionalsEndIndex = consumePositionals(startIndex); - // only try to parse the next optional if we didn't consume - // the option string during the positionals parsing - if (positionalsEndIndex > startIndex) { - startIndex = positionalsEndIndex; - continue; - } - else { - startIndex = positionalsEndIndex; - } - } - - // if we consumed all the positionals we could and we're not - // at the index of an option string, there were extra arguments - if (!optionStringIndices[startIndex]) { - var strings = argStrings.slice(startIndex, nextOptionStringIndex); - extras = extras.concat(strings); - startIndex = nextOptionStringIndex; - } - // consume the next optional and any arguments for it - startIndex = consumeOptional(startIndex); - } - - // consume any positionals following the last Optional - var stopIndex = consumePositionals(startIndex); - - // if we didn't consume all the argument strings, there were extras - extras = extras.concat(_.rest(argStrings, stopIndex)); - - // if we didn't use all the Positional objects, there were too few - // arg strings supplied. - if (positionals.length > 0) { - self.error('too few arguments'); - } - - // make sure all required actions were present - self._actions.forEach(function (action) { - if (action.required) { - if (_.indexOf(seenActions, action) < 0) { - self.error(format('Argument "%s" is required', action.getName())); - } - } - }); - - // make sure all required groups have one option present - var actionUsed = false; - self._mutuallyExclusiveGroups.forEach(function (group) { - if (group.required) { - actionUsed = _.any(group._groupActions, function (action) { - return _.contains(seenNonDefaultActions, action); - }); - - // if no actions were used, report the error - if (!actionUsed) { - var names = []; - group._groupActions.forEach(function (action) { - if (action.help !== $$.SUPPRESS) { - names.push(action.getName()); - } - }); - names = names.join(' '); - var msg = 'one of the arguments ' + names + ' is required'; - self.error(msg); - } - } - }); - - // return the updated namespace and the extra arguments - return [namespace, extras]; -}; - -ArgumentParser.prototype._readArgsFromFiles = function (argStrings) { - // expand arguments referencing files - var _this = this; - var fs = require('fs'); - var newArgStrings = []; - argStrings.forEach(function (argString) { - if (_this.fromfilePrefixChars.indexOf(argString[0]) < 0) { - // for regular arguments, just add them back into the list - newArgStrings.push(argString); - } else { - // replace arguments referencing files with the file content - try { - var argstrs = []; - var filename = argString.slice(1); - var content = fs.readFileSync(filename, 'utf8'); - content = content.trim().split('\n'); - content.forEach(function (argLine) { - _this.convertArgLineToArgs(argLine).forEach(function (arg) { - argstrs.push(arg); - }); - argstrs = _this._readArgsFromFiles(argstrs); - }); - newArgStrings.push.apply(newArgStrings, argstrs); - } catch (error) { - return _this.error(error.message); - } - } - }); - return newArgStrings; -}; - -ArgumentParser.prototype.convertArgLineToArgs = function (argLine) { - return [argLine]; -}; - -ArgumentParser.prototype._matchArgument = function (action, regexpArgStrings) { - - // match the pattern for this action to the arg strings - var regexpNargs = new RegExp('^' + this._getNargsPattern(action)); - var matches = regexpArgStrings.match(regexpNargs); - var message; - - // throw an exception if we weren't able to find a match - if (!matches) { - switch (action.nargs) { - case undefined: - case null: - message = 'Expected one argument.'; - break; - case $$.OPTIONAL: - message = 'Expected at most one argument.'; - break; - case $$.ONE_OR_MORE: - message = 'Expected at least one argument.'; - break; - default: - message = 'Expected %s argument(s)'; - } - - throw argumentErrorHelper( - action, - format(message, action.nargs) - ); - } - // return the number of arguments matched - return matches[1].length; -}; - -ArgumentParser.prototype._matchArgumentsPartial = function (actions, regexpArgStrings) { - // progressively shorten the actions list by slicing off the - // final actions until we find a match - var self = this; - var result = []; - var actionSlice, pattern, matches; - var i, j; - - var getLength = function (string) { - return string.length; - }; - - for (i = actions.length; i > 0; i -= 1) { - pattern = ''; - actionSlice = actions.slice(0, i); - for (j in actionSlice) { - pattern += self._getNargsPattern(actionSlice[j]); - } - - pattern = new RegExp('^' + pattern); - matches = regexpArgStrings.match(pattern); - - if (matches && matches.length > 0) { - // need only groups - matches = matches.splice(1); - result = result.concat(matches.map(getLength)); - break; - } - } - - // return the list of arg string counts - return result; -}; - -ArgumentParser.prototype._parseOptional = function (argString) { - var action, optionString, argExplicit, optionTuples; - - // if it's an empty string, it was meant to be a positional - if (!argString) { - return null; - } - - // if it doesn't start with a prefix, it was meant to be positional - if (this.prefixChars.indexOf(argString[0]) < 0) { - return null; - } - - // if the option string is present in the parser, return the action - if (!!this._optionStringActions[argString]) { - return [this._optionStringActions[argString], argString, null]; - } - - // if it's just a single character, it was meant to be positional - if (argString.length === 1) { - return null; - } - - // if the option string before the "=" is present, return the action - if (argString.indexOf('=') >= 0) { - var argStringSplit = argString.split('='); - optionString = argStringSplit[0]; - argExplicit = argStringSplit[1]; - - if (!!this._optionStringActions[optionString]) { - action = this._optionStringActions[optionString]; - return [action, optionString, argExplicit]; - } - } - - // search through all possible prefixes of the option string - // and all actions in the parser for possible interpretations - optionTuples = this._getOptionTuples(argString); - - // if multiple actions match, the option string was ambiguous - if (optionTuples.length > 1) { - var optionStrings = optionTuples.map(function (optionTuple) { - return optionTuple[1]; - }); - this.error(format( - 'Ambiguous option: "%s" could match %s.', - argString, optionStrings.join(', ') - )); - // if exactly one action matched, this segmentation is good, - // so return the parsed action - } else if (optionTuples.length === 1) { - return optionTuples[0]; - } - - // if it was not found as an option, but it looks like a negative - // number, it was meant to be positional - // unless there are negative-number-like options - if (argString.match(this._regexpNegativeNumber)) { - if (!_.any(this._hasNegativeNumberOptionals)) { - return null; - } - } - // if it contains a space, it was meant to be a positional - if (argString.search(' ') >= 0) { - return null; - } - - // it was meant to be an optional but there is no such option - // in this parser (though it might be a valid option in a subparser) - return [null, argString, null]; -}; - -ArgumentParser.prototype._getOptionTuples = function (optionString) { - var result = []; - var chars = this.prefixChars; - var optionPrefix; - var argExplicit; - var action; - var actionOptionString; - - // option strings starting with two prefix characters are only split at - // the '=' - if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) >= 0) { - if (optionString.indexOf('=') >= 0) { - var optionStringSplit = optionString.split('=', 1); - - optionPrefix = optionStringSplit[0]; - argExplicit = optionStringSplit[1]; - } else { - optionPrefix = optionString; - argExplicit = null; - } - - for (actionOptionString in this._optionStringActions) { - if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - action = this._optionStringActions[actionOptionString]; - result.push([action, actionOptionString, argExplicit]); - } - } - - // single character options can be concatenated with their arguments - // but multiple character options always have to have their argument - // separate - } else if (chars.indexOf(optionString[0]) >= 0 && chars.indexOf(optionString[1]) < 0) { - optionPrefix = optionString; - argExplicit = null; - var optionPrefixShort = optionString.substr(0, 2); - var argExplicitShort = optionString.substr(2); - - for (actionOptionString in this._optionStringActions) { - action = this._optionStringActions[actionOptionString]; - if (actionOptionString === optionPrefixShort) { - result.push([action, actionOptionString, argExplicitShort]); - } else if (actionOptionString.substr(0, optionPrefix.length) === optionPrefix) { - result.push([action, actionOptionString, argExplicit]); - } - } - - // shouldn't ever get here - } else { - throw new Error(format('Unexpected option string: %s.', optionString)); - } - // return the collected option tuples - return result; -}; - -ArgumentParser.prototype._getNargsPattern = function (action) { - // in all examples below, we have to allow for '--' args - // which are represented as '-' in the pattern - var regexpNargs; - - switch (action.nargs) { - // the default (null) is assumed to be a single argument - case undefined: - case null: - regexpNargs = '(-*A-*)'; - break; - // allow zero or more arguments - case $$.OPTIONAL: - regexpNargs = '(-*A?-*)'; - break; - // allow zero or more arguments - case $$.ZERO_OR_MORE: - regexpNargs = '(-*[A-]*)'; - break; - // allow one or more arguments - case $$.ONE_OR_MORE: - regexpNargs = '(-*A[A-]*)'; - break; - // allow any number of options or arguments - case $$.REMAINDER: - regexpNargs = '([-AO]*)'; - break; - // allow one argument followed by any number of options or arguments - case $$.PARSER: - regexpNargs = '(-*A[-AO]*)'; - break; - // all others should be integers - default: - regexpNargs = '(-*' + _.str.repeat('-*A', action.nargs) + '-*)'; - } - - // if this is an optional action, -- is not allowed - if (action.isOptional()) { - regexpNargs = regexpNargs.replace(/-\*/g, ''); - regexpNargs = regexpNargs.replace(/-/g, ''); - } - - // return the pattern - return regexpNargs; -}; - -// -// Value conversion methods -// - -ArgumentParser.prototype._getValues = function (action, argStrings) { - var self = this; - - // for everything but PARSER args, strip out '--' - if (action.nargs !== $$.PARSER && action.nargs !== $$.REMAINDER) { - argStrings = argStrings.filter(function (arrayElement) { - return arrayElement !== '--'; - }); - } - - var value, argString; - - // optional argument produces a default when not present - if (argStrings.length === 0 && action.nargs === $$.OPTIONAL) { - - value = (action.isOptional()) ? action.constant: action.defaultValue; - - if (typeof(value) === 'string') { - value = this._getValue(action, value); - this._checkValue(action, value); - } - - // when nargs='*' on a positional, if there were no command-line - // args, use the default if it is anything other than None - } else if (argStrings.length === 0 && action.nargs === $$.ZERO_OR_MORE && - action.optionStrings.length === 0) { - - value = (action.defaultValue || argStrings); - this._checkValue(action, value); - - // single argument or optional argument produces a single value - } else if (argStrings.length === 1 && - (!action.nargs || action.nargs === $$.OPTIONAL)) { - - argString = argStrings[0]; - value = this._getValue(action, argString); - this._checkValue(action, value); - - // REMAINDER arguments convert all values, checking none - } else if (action.nargs === $$.REMAINDER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - - // PARSER arguments convert all values, but check only the first - } else if (action.nargs === $$.PARSER) { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - this._checkValue(action, value[0]); - - // all other types of nargs produce a list - } else { - value = argStrings.map(function (v) { - return self._getValue(action, v); - }); - value.forEach(function (v) { - self._checkValue(action, v); - }); - } - - // return the converted value - return value; -}; - -ArgumentParser.prototype._getValue = function (action, argString) { - var result; - - var typeFunction = this._registryGet('type', action.type, action.type); - if (!_.isFunction(typeFunction)) { - var message = format('%s is not callable', typeFunction); - throw argumentErrorHelper(action, message); - } - - // convert the value to the appropriate type - try { - result = typeFunction(argString); - - // ArgumentTypeErrors indicate errors - // If action.type is not a registered string, it is a function - // Try to deduce its name for inclusion in the error message - // Failing that, include the error message it raised. - } catch (e) { - var name = null; - if (_.isString(action.type)) { - name = action.type; - } else { - name = action.type.name || action.type.displayName || ''; - } - var msg = format('Invalid %s value: %s', name, argString); - if (name === '') {msg += '\n' + e.message; } - throw argumentErrorHelper(action, msg); - } - // return the converted value - return result; -}; - -ArgumentParser.prototype._checkValue = function (action, value) { - // converted value must be one of the choices (if specified) - var choices = action.choices; - if (!!choices) { - // choise for argument can by array or string - if ((_.isString(choices) || _.isArray(choices)) && - choices.indexOf(value) !== -1) { - return; - } - // choise for subparsers can by only hash - if (_.isObject(choices) && !_.isArray(choices) && choices[value]) { - return; - } - - if (_.isString(choices)) { - choices = choices.split('').join(', '); - } - else if (_.isArray(choices)) { - choices = choices.join(', '); - } - else { - choices = _.keys(choices).join(', '); - } - var message = format('Invalid choice: %s (choose from [%s])', value, choices); - throw argumentErrorHelper(action, message); - } -}; - -// -// Help formatting methods -// - -/** - * ArgumentParser#formatUsage -> string - * - * Return usage string - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatUsage = function () { - var formatter = this._getFormatter(); - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - return formatter.formatHelp(); -}; - -/** - * ArgumentParser#formatHelp -> string - * - * Return help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.formatHelp = function () { - var formatter = this._getFormatter(); - - // usage - formatter.addUsage(this.usage, this._actions, this._mutuallyExclusiveGroups); - - // description - formatter.addText(this.description); - - // positionals, optionals and user-defined groups - this._actionGroups.forEach(function (actionGroup) { - formatter.startSection(actionGroup.title); - formatter.addText(actionGroup.description); - formatter.addArguments(actionGroup._groupActions); - formatter.endSection(); - }); - - // epilog - formatter.addText(this.epilog); - - // determine help from format above - return formatter.formatHelp(); -}; - -ArgumentParser.prototype._getFormatter = function () { - var FormatterClass = this.formatterClass; - var formatter = new FormatterClass({prog: this.prog}); - return formatter; -}; - -// -// Print functions -// - -/** - * ArgumentParser#printUsage() -> Void - * - * Print usage - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printUsage = function () { - this._printMessage(this.formatUsage()); -}; - -/** - * ArgumentParser#printHelp() -> Void - * - * Print help - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#printing-help - **/ -ArgumentParser.prototype.printHelp = function () { - this._printMessage(this.formatHelp()); -}; - -ArgumentParser.prototype._printMessage = function (message, stream) { - if (!stream) { - stream = process.stdout; - } - if (message) { - stream.write('' + message); - } -}; - -// -// Exit functions -// - -/** - * ArgumentParser#exit(status=0, message) -> Void - * - status (int): exit status - * - message (string): message - * - * Print message in stderr/stdout and exit program - **/ -ArgumentParser.prototype.exit = function (status, message) { - if (!!message) { - if (status === 0) { - this._printMessage(message); - } - else { - this._printMessage(message, process.stderr); - } - } - - process.exit(status); -}; - -/** - * ArgumentParser#error(message) -> Void - * - err (Error|string): message - * - * Error method Prints a usage message incorporating the message to stderr and - * exits. If you override this in a subclass, - * it should not return -- it should - * either exit or throw an exception. - * - **/ -ArgumentParser.prototype.error = function (err) { - var message; - if (err instanceof Error) { - if (this.debug === true) { - throw err; - } - message = err.message; - } - else { - message = err; - } - var msg = format('%s: error: %s', this.prog, message) + $$.EOL; - - if (this.debug === true) { - throw new Error(msg); - } - - this.printUsage(process.stderr); - - return this.exit(2, msg); -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js deleted file mode 100644 index de831ba..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js +++ /dev/null @@ -1,18 +0,0 @@ -// -// Constants -// -module.exports.EOL = '\n'; - -module.exports.SUPPRESS = '==SUPPRESS=='; - -module.exports.OPTIONAL = '?'; - -module.exports.ZERO_OR_MORE = '*'; - -module.exports.ONE_OR_MORE = '+'; - -module.exports.PARSER = 'A...'; - -module.exports.REMAINDER = '...'; - -module.exports._UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js deleted file mode 100644 index cd2f369..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +++ /dev/null @@ -1,88 +0,0 @@ -'use strict'; - -var util = require('util'); -var _ = require('underscore'); -_.str = require('underscore.string'); - -// Constants -var $$ = require('../const'); - -var HelpFormatter = require('./formatter.js'); - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which adds default values to argument help. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -var ArgumentDefaultsHelpFormatter = function ArgumentDefaultsHelpFormatter(options) { - HelpFormatter.call(this, options); -}; - -util.inherits(ArgumentDefaultsHelpFormatter, HelpFormatter); - -ArgumentDefaultsHelpFormatter.prototype._getHelpString = function (action) { - var help = action.help; - if (action.help.indexOf('%(defaultValue)s') === -1) { - if (action.defaultValue !== $$.SUPPRESS) { - var defaulting_nargs = [$$.OPTIONAL, $$.ZERO_OR_MORE]; - if (action.isOptional() || (defaulting_nargs.indexOf(action.nargs) >= 0)) { - help += ' (default: %(defaultValue)s)'; - } - } - } - return help; -}; - -module.exports.ArgumentDefaultsHelpFormatter = ArgumentDefaultsHelpFormatter; - -/** - * new RawDescriptionHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawDescriptionHelpFormatter, ...}) - * - * Help message formatter which retains any formatting in descriptions. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -var RawDescriptionHelpFormatter = function RawDescriptionHelpFormatter(options) { - HelpFormatter.call(this, options); -}; - -util.inherits(RawDescriptionHelpFormatter, HelpFormatter); - -RawDescriptionHelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = text.split('\n'); - lines = lines.map(function (line) { - return _.str.rtrim(indent + line); - }); - return lines.join('\n'); -}; -module.exports.RawDescriptionHelpFormatter = RawDescriptionHelpFormatter; - -/** - * new RawTextHelpFormatter(options) - * new ArgumentParser({formatterClass: argparse.RawTextHelpFormatter, ...}) - * - * Help message formatter which retains formatting of all help text. - * - * Only the name of this class is considered a public API. All the methods - * provided by the class are considered an implementation detail. - **/ - -var RawTextHelpFormatter = function RawTextHelpFormatter(options) { - RawDescriptionHelpFormatter.call(this, options); -}; - -util.inherits(RawTextHelpFormatter, RawDescriptionHelpFormatter); - -RawTextHelpFormatter.prototype._splitLines = function (text) { - return text.split('\n'); -}; - -module.exports.RawTextHelpFormatter = RawTextHelpFormatter; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js deleted file mode 100644 index 541d918..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +++ /dev/null @@ -1,803 +0,0 @@ -/** - * class HelpFormatter - * - * Formatter for generating usage messages and argument help strings. Only the - * name of this class is considered a public API. All the methods provided by - * the class are considered an implementation detail. - * - * Do not call in your code, use this class only for inherits your own forvatter - * - * ToDo add [additonal formatters][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#formatter-class - **/ -'use strict'; - -var _ = require('underscore'); -_.str = require('underscore.string'); - -// Constants -var $$ = require('../const'); - - -/*:nodoc:* internal - * new Support(parent, heding) - * - parent (object): parent section - * - heading (string): header string - * - **/ -function Section(parent, heading) { - this._parent = parent; - this._heading = heading; - this._items = []; -} - -/*:nodoc:* internal - * Section#addItem(callback) -> Void - * - callback (array): tuple with function and args - * - * Add function for single element - **/ -Section.prototype.addItem = function (callback) { - this._items.push(callback); -}; - -/*:nodoc:* internal - * Section#formatHelp(formatter) -> string - * - formatter (HelpFormatter): current formatter - * - * Form help section string - * - **/ -Section.prototype.formatHelp = function (formatter) { - var itemHelp, heading; - - // format the indented section - if (!!this._parent) { - formatter._indent(); - } - - itemHelp = this._items.map(function (item) { - var obj, func, args; - - obj = formatter; - func = item[0]; - args = item[1]; - return func.apply(obj, args); - }); - itemHelp = formatter._joinParts(itemHelp); - - if (!!this._parent) { - formatter._dedent(); - } - - // return nothing if the section was empty - if (!itemHelp) { - return ''; - } - - // add the heading if the section was non-empty - heading = ''; - if (!!this._heading && this._heading !== $$.SUPPRESS) { - var currentIndent = formatter.currentIndent; - heading = _.str.repeat(' ', currentIndent) + this._heading + ':' + $$.EOL; - } - - // join the section-initialize newline, the heading and the help - return formatter._joinParts([$$.EOL, heading, itemHelp, $$.EOL]); -}; - -/** - * new HelpFormatter(options) - * - * #### Options: - * - `prog`: program name - * - `indentIncriment`: indent step, default value 2 - * - `maxHelpPosition`: max help position, default value = 24 - * - `width`: line width - * - **/ -var HelpFormatter = module.exports = function HelpFormatter(options) { - options = options || {}; - - this._prog = options.prog; - - this._maxHelpPosition = options.maxHelpPosition || 24; - this._width = (options.width || ((process.env.COLUMNS || 80) - 2)); - - this._currentIndent = 0; - this._indentIncriment = options.indentIncriment || 2; - this._level = 0; - this._actionMaxLength = 0; - - this._rootSection = new Section(null); - this._currentSection = this._rootSection; - - this._whitespaceMatcher = new RegExp('\\s+', 'g'); - this._longBreakMatcher = new RegExp($$.EOL + $$.EOL + $$.EOL + '+', 'g'); -}; - -HelpFormatter.prototype._indent = function () { - this._currentIndent += this._indentIncriment; - this._level += 1; -}; - -HelpFormatter.prototype._dedent = function () { - this._currentIndent -= this._indentIncriment; - this._level -= 1; - if (this._currentIndent < 0) { - throw new Error('Indent decreased below 0.'); - } -}; - -HelpFormatter.prototype._addItem = function (func, args) { - this._currentSection.addItem([func, args]); -}; - -// -// Message building methods -// - -/** - * HelpFormatter#startSection(heading) -> Void - * - heading (string): header string - * - * Start new help section - * - * See alse [code example][1] - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.startSection = function (heading) { - this._indent(); - var section = new Section(this._currentSection, heading); - var func = section.formatHelp.bind(section); - this._addItem(func, [this]); - this._currentSection = section; -}; - -/** - * HelpFormatter#endSection -> Void - * - * End help section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - **/ -HelpFormatter.prototype.endSection = function () { - this._currentSection = this._currentSection._parent; - this._dedent(); -}; - -/** - * HelpFormatter#addText(text) -> Void - * - text (string): plain text - * - * Add plain text into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addText = function (text) { - if (!!text && text !== $$.SUPPRESS) { - this._addItem(this._formatText, [text]); - } -}; - -/** - * HelpFormatter#addUsage(usage, actions, groups, prefix) -> Void - * - usage (string): usage text - * - actions (array): actions list - * - groups (array): groups list - * - prefix (string): usage prefix - * - * Add usage data into current section - * - * ##### Example - * - * formatter.addUsage(this.usage, this._actions, []); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.addUsage = function (usage, actions, groups, prefix) { - if (usage !== $$.SUPPRESS) { - this._addItem(this._formatUsage, [usage, actions, groups, prefix]); - } -}; - -/** - * HelpFormatter#addArgument(action) -> Void - * - action (object): action - * - * Add argument into current section - * - * Single variant of [[HelpFormatter#addArguments]] - **/ -HelpFormatter.prototype.addArgument = function (action) { - if (action.help !== $$.SUPPRESS) { - var self = this; - - // find all invocations - var invocations = [this._formatActionInvocation(action)]; - var invocationLength = invocations[0].length; - - var actionLength; - - if (!!action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - - var invocationNew = self._formatActionInvocation(subaction); - invocations.push(invocationNew); - invocationLength = Math.max(invocationLength, invocationNew.length); - - }); - this._dedent(); - } - - // update the maximum item length - actionLength = invocationLength + this._currentIndent; - this._actionMaxLength = Math.max(this._actionMaxLength, actionLength); - - // add the item to the list - this._addItem(this._formatAction, [action]); - } -}; - -/** - * HelpFormatter#addArguments(actions) -> Void - * - actions (array): actions list - * - * Mass add arguments into current section - * - * ##### Example - * - * formatter.startSection(actionGroup.title); - * formatter.addText(actionGroup.description); - * formatter.addArguments(actionGroup._groupActions); - * formatter.endSection(); - * - **/ -HelpFormatter.prototype.addArguments = function (actions) { - var self = this; - actions.forEach(function (action) { - self.addArgument(action); - }); -}; - -// -// Help-formatting methods -// - -/** - * HelpFormatter#formatHelp -> string - * - * Format help - * - * ##### Example - * - * formatter.addText(this.epilog); - * return formatter.formatHelp(); - * - **/ -HelpFormatter.prototype.formatHelp = function () { - var help = this._rootSection.formatHelp(this); - if (help) { - help = help.replace(this._longBreakMatcher, $$.EOL + $$.EOL); - help = _.str.strip(help, $$.EOL) + $$.EOL; - } - return help; -}; - -HelpFormatter.prototype._joinParts = function (partStrings) { - return partStrings.filter(function (part) { - return (!!part && part !== $$.SUPPRESS); - }).join(''); -}; - -HelpFormatter.prototype._formatUsage = function (usage, actions, groups, prefix) { - if (!prefix && !_.isString(prefix)) { - prefix = 'usage: '; - } - - actions = actions || []; - groups = groups || []; - - - // if usage is specified, use that - if (usage) { - usage = _.str.sprintf(usage, {prog: this._prog}); - - // if no optionals or positionals are available, usage is just prog - } else if (!usage && actions.length === 0) { - usage = this._prog; - - // if optionals and positionals are available, calculate usage - } else if (!usage) { - var prog = this._prog; - var optionals = []; - var positionals = []; - var actionUsage; - var textWidth; - - // split optionals from positionals - actions.forEach(function (action) { - if (action.isOptional()) { - optionals.push(action); - } else { - positionals.push(action); - } - }); - - // build full usage string - actionUsage = this._formatActionsUsage([].concat(optionals, positionals), groups); - usage = [prog, actionUsage].join(' '); - - // wrap the usage parts if it's too long - textWidth = this._width - this._currentIndent; - if ((prefix.length + usage.length) > textWidth) { - - // break usage into wrappable parts - var regexpPart = new RegExp('\\(.*?\\)+|\\[.*?\\]+|\\S+', 'g'); - var optionalUsage = this._formatActionsUsage(optionals, groups); - var positionalUsage = this._formatActionsUsage(positionals, groups); - - - var optionalParts = optionalUsage.match(regexpPart); - var positionalParts = positionalUsage.match(regexpPart) || []; - - if (optionalParts.join(' ') !== optionalUsage) { - throw new Error('assert "optionalParts.join(\' \') === optionalUsage"'); - } - if (positionalParts.join(' ') !== positionalUsage) { - throw new Error('assert "positionalParts.join(\' \') === positionalUsage"'); - } - - // helper for wrapping lines - var _getLines = function (parts, indent, prefix) { - var lines = []; - var line = []; - - var lineLength = !!prefix ? prefix.length - 1: indent.length - 1; - - parts.forEach(function (part) { - if (lineLength + 1 + part.length > textWidth) { - lines.push(indent + line.join(' ')); - line = []; - lineLength = indent.length - 1; - } - line.push(part); - lineLength += part.length + 1; - }); - - if (line) { - lines.push(indent + line.join(' ')); - } - if (prefix) { - lines[0] = lines[0].substr(indent.length); - } - return lines; - }; - - var lines, indent, parts; - // if prog is short, follow it with optionals or positionals - if (prefix.length + prog.length <= 0.75 * textWidth) { - indent = _.str.repeat(' ', (prefix.length + prog.length + 1)); - if (optionalParts) { - lines = [].concat( - _getLines([prog].concat(optionalParts), indent, prefix), - _getLines(positionalParts, indent) - ); - } else if (positionalParts) { - lines = _getLines([prog].concat(positionalParts), indent, prefix); - } else { - lines = [prog]; - } - - // if prog is long, put it on its own line - } else { - indent = _.str.repeat(' ', prefix.length); - parts = optionalParts + positionalParts; - lines = _getLines(parts, indent); - if (lines.length > 1) { - lines = [].concat( - _getLines(optionalParts, indent), - _getLines(positionalParts, indent) - ); - } - lines = [prog] + lines; - } - // join lines into usage - usage = lines.join($$.EOL); - } - } - - // prefix with 'usage:' - return prefix + usage + $$.EOL + $$.EOL; -}; - -HelpFormatter.prototype._formatActionsUsage = function (actions, groups) { - // find group indices and identify actions in groups - var groupActions = []; - var inserts = []; - var self = this; - - groups.forEach(function (group) { - var end; - var i; - - var start = actions.indexOf(group._groupActions[0]); - if (start >= 0) { - end = start + group._groupActions.length; - - //if (actions.slice(start, end) === group._groupActions) { - if (_.isEqual(actions.slice(start, end), group._groupActions)) { - group._groupActions.forEach(function (action) { - groupActions.push(action); - }); - - if (!group.required) { - if (!!inserts[start]) { - inserts[start] += ' ['; - } - else { - inserts[start] = '['; - } - inserts[end] = ']'; - } else { - if (!!inserts[start]) { - inserts[start] += ' ('; - } - else { - inserts[start] = '('; - } - inserts[end] = ')'; - } - for (i = start + 1; i < end; i += 1) { - inserts[i] = '|'; - } - } - } - }); - - // collect all actions format strings - var parts = []; - - actions.forEach(function (action, actionIndex) { - var part; - var optionString; - var argsDefault; - var argsString; - - // suppressed arguments are marked with None - // remove | separators for suppressed arguments - if (action.help === $$.SUPPRESS) { - parts.push(null); - if (inserts[actionIndex] === '|') { - inserts.splice(actionIndex, actionIndex); - } else if (inserts[actionIndex + 1] === '|') { - inserts.splice(actionIndex + 1, actionIndex + 1); - } - - // produce all arg strings - } else if (!action.isOptional()) { - part = self._formatArgs(action, action.dest); - - // if it's in a group, strip the outer [] - if (groupActions.indexOf(action) >= 0) { - if (part[0] === '[' && part[part.length - 1] === ']') { - part = part.slice(1, -1); - } - } - // add the action string to the list - parts.push(part); - - // produce the first way to invoke the option in brackets - } else { - optionString = action.optionStrings[0]; - - // if the Optional doesn't take a value, format is: -s or --long - if (action.nargs === 0) { - part = '' + optionString; - - // if the Optional takes a value, format is: -s ARGS or --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = self._formatArgs(action, argsDefault); - part = optionString + ' ' + argsString; - } - // make it look optional if it's not required or in a group - if (!action.required && groupActions.indexOf(action) < 0) { - part = '[' + part + ']'; - } - // add the action string to the list - parts.push(part); - } - }); - - // insert things at the necessary indices - for (var i = inserts.length - 1; i >= 0; --i) { - if (inserts[i] !== null) { - parts.splice(i, 0, inserts[i]); - } - } - - // join all the action items with spaces - var text = parts.filter(function (part) { - return !!part; - }).join(' '); - - // clean up separators for mutually exclusive groups - text = text.replace(/([\[(]) /g, '$1'); // remove spaces - text = text.replace(/ ([\])])/g, '$1'); - text = text.replace(/\[ *\]/g, ''); // remove empty groups - text = text.replace(/\( *\)/g, ''); - text = text.replace(/\(([^|]*)\)/g, '$1'); // remove () from single action groups - - text = _.str.strip(text); - - // return the text - return text; -}; - -HelpFormatter.prototype._formatText = function (text) { - text = _.str.sprintf(text, {prog: this._prog}); - var textWidth = this._width - this._currentIndent; - var indentIncriment = _.str.repeat(' ', this._currentIndent); - return this._fillText(text, textWidth, indentIncriment) + $$.EOL + $$.EOL; -}; - -HelpFormatter.prototype._formatAction = function (action) { - var self = this; - - var helpText; - var helpLines; - var parts; - var indentFirst; - - // determine the required width and the entry label - var helpPosition = Math.min(this._actionMaxLength + 2, this._maxHelpPosition); - var helpWidth = this._width - helpPosition; - var actionWidth = helpPosition - this._currentIndent - 2; - var actionHeader = this._formatActionInvocation(action); - - // no help; start on same line and add a final newline - if (!action.help) { - actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; - - // short action name; start on the same line and pad two spaces - } else if (actionHeader.length <= actionWidth) { - actionHeader = _.str.repeat(' ', this._currentIndent) + - actionHeader + - ' ' + - _.str.repeat(' ', actionWidth - actionHeader.length); - indentFirst = 0; - - // long action name; start on the next line - } else { - actionHeader = _.str.repeat(' ', this._currentIndent) + actionHeader + $$.EOL; - indentFirst = helpPosition; - } - - // collect the pieces of the action help - parts = [actionHeader]; - - // if there was help for the action, add lines of help text - if (!!action.help) { - helpText = this._expandHelp(action); - helpLines = this._splitLines(helpText, helpWidth); - parts.push(_.str.repeat(' ', indentFirst) + helpLines[0] + $$.EOL); - helpLines.slice(1).forEach(function (line) { - parts.push(_.str.repeat(' ', helpPosition) + line + $$.EOL); - }); - - // or add a newline if the description doesn't end with one - } else if (actionHeader.charAt(actionHeader.length - 1) !== $$.EOL) { - parts.push($$.EOL); - } - // if there are any sub-actions, add their help as well - if (!!action._getSubactions) { - this._indent(); - action._getSubactions().forEach(function (subaction) { - parts.push(self._formatAction(subaction)); - }); - this._dedent(); - } - // return a single string - return this._joinParts(parts); -}; - -HelpFormatter.prototype._formatActionInvocation = function (action) { - if (!action.isOptional()) { - var format_func = this._metavarFormatter(action, action.dest); - var metavars = format_func(1); - return metavars[0]; - } else { - var parts = []; - var argsDefault; - var argsString; - - // if the Optional doesn't take a value, format is: -s, --long - if (action.nargs === 0) { - parts = parts.concat(action.optionStrings); - - // if the Optional takes a value, format is: -s ARGS, --long ARGS - } else { - argsDefault = action.dest.toUpperCase(); - argsString = this._formatArgs(action, argsDefault); - action.optionStrings.forEach(function (optionString) { - parts.push(optionString + ' ' + argsString); - }); - } - return parts.join(', '); - } -}; - -HelpFormatter.prototype._metavarFormatter = function (action, metavarDefault) { - var result; - - if (!!action.metavar || action.metavar === '') { - result = action.metavar; - } else if (!!action.choices) { - var choices = action.choices; - - if (_.isString(choices)) { - choices = choices.split('').join(', '); - } else if (_.isArray(choices)) { - choices = choices.join(','); - } - else - { - choices = _.keys(choices).join(','); - } - result = '{' + choices + '}'; - } else { - result = metavarDefault; - } - - return function (size) { - if (Array.isArray(result)) { - return result; - } else { - var metavars = []; - for (var i = 0; i < size; i += 1) { - metavars.push(result); - } - return metavars; - } - }; -}; - -HelpFormatter.prototype._formatArgs = function (action, metavarDefault) { - var result; - var metavars; - - var buildMetavar = this._metavarFormatter(action, metavarDefault); - - switch (action.nargs) { - case undefined: - case null: - metavars = buildMetavar(1); - result = '' + metavars[0]; - break; - case $$.OPTIONAL: - metavars = buildMetavar(1); - result = '[' + metavars[0] + ']'; - break; - case $$.ZERO_OR_MORE: - metavars = buildMetavar(2); - result = '[' + metavars[0] + ' [' + metavars[1] + ' ...]]'; - break; - case $$.ONE_OR_MORE: - metavars = buildMetavar(2); - result = '' + metavars[0] + ' [' + metavars[1] + ' ...]'; - break; - case $$.REMAINDER: - result = '...'; - break; - case $$.PARSER: - metavars = buildMetavar(1); - result = metavars[0] + ' ...'; - break; - default: - metavars = buildMetavar(action.nargs); - result = metavars.join(' '); - } - return result; -}; - -HelpFormatter.prototype._expandHelp = function (action) { - var actionProperty; - var actionValue; - - var params = {prog: this._prog}; - - for (actionProperty in action) { - if (action.hasOwnProperty(actionProperty)) { - actionValue = action[actionProperty]; - - if (actionValue !== $$.SUPPRESS) { - params[actionProperty] = actionValue; - } - } - } - - if (!!params.choices) { - if (_.isString(params.choices)) { - params.choices = params.choices.split('').join(', '); - } - else if (_.isArray(params.choices)) { - params.choices = params.choices.join(', '); - } - else { - params.choices = _.keys(params.choices).join(', '); - } - } - - return _.str.sprintf(this._getHelpString(action), params); -}; - -HelpFormatter.prototype._splitLines = function (text, width) { - var lines = []; - var delimiters = [" ", ".", ",", "!", "?"]; - var re = new RegExp('[' + delimiters.join('') + '][^' + delimiters.join('') + ']*$'); - - text = text.replace(/[\n\|\t]/g, ' '); - - text = _.str.strip(text); - text = text.replace(this._whitespaceMatcher, ' '); - - // Wraps the single paragraph in text (a string) so every line - // is at most width characters long. - text.split($$.EOL).forEach(function (line) { - if (width >= line.length) { - lines.push(line); - return; - } - - var wrapStart = 0; - var wrapEnd = width; - var delimiterIndex = 0; - while (wrapEnd <= line.length) { - if (wrapEnd !== line.length && delimiters.indexOf(line[wrapEnd] < -1)) { - delimiterIndex = (re.exec(line.substring(wrapStart, wrapEnd)) || {}).index; - wrapEnd = wrapStart + delimiterIndex + 1; - } - lines.push(line.substring(wrapStart, wrapEnd)); - wrapStart = wrapEnd; - wrapEnd += width; - } - if (wrapStart < line.length) { - lines.push(line.substring(wrapStart, wrapEnd)); - } - }); - - return lines; -}; - -HelpFormatter.prototype._fillText = function (text, width, indent) { - var lines = this._splitLines(text, width); - lines = lines.map(function (line) { - return indent + line; - }); - return lines.join($$.EOL); -}; - -HelpFormatter.prototype._getHelpString = function (action) { - return action.help; -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js deleted file mode 100644 index 3546f2d..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +++ /dev/null @@ -1,77 +0,0 @@ -/** - * class Namespace - * - * Simple object for storing attributes. Implements equality by attribute names - * and values, and provides a simple string representation. - * - * See also [original guide][1] - * - * [1]:http://docs.python.org/dev/library/argparse.html#the-namespace-object - **/ -'use strict'; - -var _ = require('underscore'); - -/** - * new Namespace(options) - * - options(object): predefined propertis for result object - * - **/ -var Namespace = module.exports = function Namespace(options) { - _.extend(this, options); -}; - -/** - * Namespace#isset(key) -> Boolean - * - key (string|number): property name - * - * Tells whenever `namespace` contains given `key` or not. - **/ -Namespace.prototype.isset = function (key) { - return _.has(this, key); -}; - -/** - * Namespace#set(key, value) -> self - * -key (string|number|object): propery name - * -value (mixed): new property value - * - * Set the property named key with value. - * If key object then set all key properties to namespace object - **/ -Namespace.prototype.set = function (key, value) { - if (typeof (key) === 'object') { - _.extend(this, key); - } else { - this[key] = value; - } - return this; -}; - -/** - * Namespace#get(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return the property key or defaulValue if not set - **/ -Namespace.prototype.get = function (key, defaultValue) { - return !this[key] ? defaultValue: this[key]; -}; - -/** - * Namespace#unset(key, defaultValue) -> mixed - * - key (string|number): property name - * - defaultValue (mixed): default value - * - * Return data[key](and delete it) or defaultValue - **/ -Namespace.prototype.unset = function (key, defaultValue) { - var value = this[key]; - if (value !== null) { - delete this[key]; - return value; - } else { - return defaultValue; - } -}; diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: ruby -rvm: - - 1.9.3 - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile deleted file mode 100644 index aed29c3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source "https://rubygems.org" - -gem 'uglifier' -gem 'rake' diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index 2c52be4..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,17 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - execjs (1.4.0) - multi_json (~> 1.0) - multi_json (1.3.6) - rake (0.9.2.2) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - uglifier diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown deleted file mode 100644 index 1a39ad9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,814 +0,0 @@ -# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # - - - -Javascript lacks complete string manipulation operations. -This an attempt to fill that gap. List of build-in methods can be found -for example from [Dive Into JavaScript][d]. - -[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object - - -As name states this an extension for [Underscore.js][u], but it can be used -independently from **_s**-global variable. But with Underscore.js you can -use Object-Oriented style and chaining: - -[u]: http://documentcloud.github.com/underscore/ - -```javascript -_(" epeli ").chain().trim().capitalize().value() -=> "Epeli" -``` - -## Download ## - - * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* - * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* - - -## Node.js installation ## - -**npm package** - - npm install underscore.string - -**Standalone usage**: - -```javascript -var _s = require('underscore.string'); -``` - -**Integrate with Underscore.js**: - -```javascript -var _ = require('underscore'); - -// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) -_.str = require('underscore.string'); - -// Mix in non-conflict functions to Underscore namespace if you want -_.mixin(_.str.exports()); - -// All functions, include conflict, will be available through _.str object -_.str.include('Underscore.string', 'string'); // => true -``` - -**Or Integrate with Underscore.js without module loading** - -Run the following expression after Underscore.js and Underscore.string are loaded -```javascript -// _.str becomes a global variable if no module loading is detected -// Mix in non-conflict functions to Underscore namespace -_.mixin(_.str.exports()); -``` - -## String Functions ## - -For availability of functions in this way you need to mix in Underscore.string functions: - -```javascript -_.mixin(_.string.exports()); -``` - -otherwise functions from examples will be available through _.string or _.str objects: - -```javascript -_.str.capitalize('epeli') -=> "Epeli" -``` - -**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=',']) - -Formats the numbers. - -```javascript -_.numberFormat(1000, 2) -=> "1,000.00" - -_.numberFormat(123456789.123, 5, '.', ',') -=> "123,456,789.12300" -``` - - -**levenshtein** _.levenshtein(string1, string2) - -Calculates [Levenshtein distance][ld] between two strings. -[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance - -```javascript -_.levenshtein('kitten', 'kittah') -=> 2 -``` - -**capitalize** _.capitalize(string) - -Converts first letter of the string to uppercase. - -```javascript -_.capitalize("foo Bar") -=> "Foo Bar" -``` - -**chop** _.chop(string, step) - -```javascript -_.chop('whitespace', 3) -=> ['whi','tes','pac','e'] -``` - -**clean** _.clean(str) - -Compress some whitespaces to one. - -```javascript -_.clean(" foo bar ") -=> 'foo bar' -``` - -**chars** _.chars(str) - -```javascript -_.chars('Hello') -=> ['H','e','l','l','o'] -``` - -**swapCase** _.swapCase(str) - -Returns a copy of the string in which all the case-based characters have had their case swapped. - -```javascript -_.swapCase('hELLO') -=> 'Hello' -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("foobar", "ob") -=> true -``` - -(removed) **includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**includes** function was removed - -But you can create it in this way, for compatibility with previous versions: - -```javascript -_.includes = _.str.include -``` - -**count** _.count(string, substring) - -```javascript -_('Hello world').count('l') -=> 3 -``` - -**escapeHTML** _.escapeHTML(string) - -Converts HTML special characters to their entity equivalents. - -```javascript -_('
    Blah blah blah
    ').escapeHTML(); -=> '<div>Blah blah blah</div>' -``` - -**unescapeHTML** _.unescapeHTML(string) - -Converts entity characters to HTML equivalents. - -```javascript -_('<div>Blah blah blah</div>').unescapeHTML(); -=> '
    Blah blah blah
    ' -``` - -**insert** _.insert(string, index, substing) - -```javascript -_('Hello ').insert(6, 'world') -=> 'Hello world' -``` - -**isBlank** _.isBlank(string) - -```javascript -_('').isBlank(); // => true -_('\n').isBlank(); // => true -_(' ').isBlank(); // => true -_('a').isBlank(); // => false -``` - -**join** _.join(separator, *strings) - -Joins strings together with given separator - -```javascript -_.join(" ", "foo", "bar") -=> "foo bar" -``` - -**lines** _.lines(str) - -```javascript -_.lines("Hello\nWorld") -=> ["Hello", "World"] -``` - -**reverse** available only through _.str object, because Underscore has function with the same name. - -Return reversed string: - -```javascript -_.str.reverse("foobar") -=> 'raboof' -``` - -**splice** _.splice(string, index, howmany, substring) - -Like a array splice. - -```javascript -_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') -=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' -``` - -**startsWith** _.startsWith(string, starts) - -This method checks whether string starts with starts. - -```javascript -_("image.gif").startsWith("image") -=> true -``` - -**endsWith** _.endsWith(string, ends) - -This method checks whether string ends with ends. - -```javascript -_("image.gif").endsWith("gif") -=> true -``` - -**succ** _.succ(str) - -Returns the successor to str. - -```javascript -_('a').succ() -=> 'b' - -_('A').succ() -=> 'B' -``` - -**supplant** - -Supplant function was removed, use Underscore.js [template function][p]. - -[p]: http://documentcloud.github.com/underscore/#template - -**strip** alias for *trim* - -**lstrip** alias for *ltrim* - -**rstrip** alias for *rtrim* - -**titleize** _.titleize(string) - -```javascript -_('my name is epeli').titleize() -=> 'My Name Is Epeli' -``` - -**camelize** _.camelize(string) - -Converts underscored or dasherized string to a camelized one - -```javascript -_('-moz-transform').camelize() -=> 'MozTransform' -``` - -**classify** _.classify(string) - -Converts string to camelized class name - -```javascript -_('some_class_name').classify() -=> 'SomeClassName' -``` - -**underscored** _.underscored(string) - -Converts a camelized or dasherized string into an underscored one - -```javascript -_('MozTransform').underscored() -=> 'moz_transform' -``` - -**dasherize** _.dasherize(string) - -Converts a underscored or camelized string into an dasherized one - -```javascript -_('MozTransform').dasherize() -=> '-moz-transform' -``` - -**humanize** _.humanize(string) - -Converts an underscored, camelized, or dasherized string into a humanized one. -Also removes beginning and ending whitespace, and removes the postfix '_id'. - -```javascript -_(' capitalize dash-CamelCase_underscore trim ').humanize() -=> 'Capitalize dash camel case underscore trim' -``` - -**trim** _.trim(string, [characters]) - -trims defined characters from begining and ending of the string. -Defaults to whitespace characters. - -```javascript -_.trim(" foobar ") -=> "foobar" - -_.trim("_-foobar-_", "_-") -=> "foobar" -``` - - -**ltrim** _.ltrim(string, [characters]) - -Left trim. Similar to trim, but only for left side. - - -**rtrim** _.rtrim(string, [characters]) - -Right trim. Similar to trim, but only for right side. - -**truncate** _.truncate(string, length, truncateString) - -```javascript -_('Hello world').truncate(5) -=> 'Hello...' - -_('Hello').truncate(10) -=> 'Hello' -``` - -**prune** _.prune(string, length, pruneString) - -Elegant version of truncate. -Makes sure the pruned string does not exceed the original length. -Avoid half-chopped words when truncating. - -```javascript -_('Hello, world').prune(5) -=> 'Hello...' - -_('Hello, world').prune(8) -=> 'Hello...' - -_('Hello, world').prune(5, ' (read a lot more)') -=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) - -_('Hello, cruel world').prune(15) -=> 'Hello, cruel...' - -_('Hello').prune(10) -=> 'Hello' -``` - -**words** _.words(str, delimiter=/\s+/) - -Split string by delimiter (String or RegExp), /\s+/ by default. - -```javascript -_.words(" I love you ") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] - -_.words(" ") -=> [] -``` - -**sprintf** _.sprintf(string format, *arguments) - -C like string formatting. -Credits goes to [Alexandru Marasteanu][o]. -For more detailed documentation, see the [original page][o]. - -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript - -```javascript -_.sprintf("%.1f", 1.17) -"1.2" -``` - -**pad** _.pad(str, length, [padStr, type]) - -pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. - -```javascript -_.pad("1", 8) --> " 1"; - -_.pad("1", 8, '0') --> "00000001"; - -_.pad("1", 8, '0', 'right') --> "10000000"; - -_.pad("1", 8, '0', 'both') --> "00001000"; - -_.pad("1", 8, 'bleepblorp', 'both') --> "bbbb1bbb"; -``` - -**lpad** _.lpad(str, length, [padStr]) - -left-pad a string. Alias for `pad(str, length, padStr, 'left')` - -```javascript -_.lpad("1", 8, '0') --> "00000001"; -``` - -**rpad** _.rpad(str, length, [padStr]) - -right-pad a string. Alias for `pad(str, length, padStr, 'right')` - -```javascript -_.rpad("1", 8, '0') --> "10000000"; -``` - -**lrpad** _.lrpad(str, length, [padStr]) - -left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` - -```javascript -_.lrpad("1", 8, '0') --> "00001000"; -``` - -**center** alias for **lrpad** - -**ljust** alias for *rpad* - -**rjust** alias for *lpad* - -**toNumber** _.toNumber(string, [decimals]) - -Parse string to number. Returns NaN if string can't be parsed to number. - -```javascript -_('2.556').toNumber() -=> 3 - -_('2.556').toNumber(1) -=> 2.6 -``` - -**strRight** _.strRight(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRight('_') -=> "is_a_test_string"; -``` - -**strRightBack** _.strRightBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRightBack('_') -=> "string"; -``` - -**strLeft** _.strLeft(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeft('_') -=> "This"; -``` - -**strLeftBack** _.strLeftBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeftBack('_') -=> "This_is_a_test"; -``` - -**stripTags** - -Removes all html tags from string. - -```javascript -_('a link').stripTags() -=> 'a link' - -_('a link').stripTags() -=> 'a linkalert("hello world!")' -``` - -**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) - -Join an array into a human readable sentence. - -```javascript -_.toSentence(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools and Prototype'; - -_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') -=> 'jQuery, Mootools unt Prototype'; -``` - -**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter]) - -The same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma). - -```javascript -_.toSentenceSerial(['jQuery', 'Mootools']) -=> 'jQuery and Mootools'; - -_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools, and Prototype' - -_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt '); -=> 'jQuery, Mootools, unt Prototype'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**surround** _.surround(string, wrap) - -Surround a string with another string. - -```javascript -_.surround("foo", "ab") -=> 'abfooab'; -``` - -**quote** _.quote(string, quoteChar) or _.q(string, quoteChar) - -Quotes a string. `quoteChar` defaults to `"`. - -```javascript -_.quote('foo', quoteChar) -=> '"foo"'; -``` -**unquote** _.unquote(string, quoteChar) - -Unquotes a string. `quoteChar` defaults to `"`. - -```javascript -_.unquote('"foo"') -=> 'foo'; -_.unquote("'foo'", "'") -=> 'foo'; -``` - - -**slugify** _.slugify(string) - -Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. - -```javascript -_.slugify("Un éléphant à l'orée du bois") -=> 'un-elephant-a-loree-du-bois'; -``` - -***Caution: this function is charset dependent*** - -**naturalCmp** array.sort(_.naturalCmp) - -Naturally sort strings like humans would do. - -```javascript -['foo20', 'foo5'].sort(_.naturalCmp) -=> [ 'foo5', 'foo20' ] -``` - -**toBoolean** _.toBoolean(string) or _.toBool(string) - -Turn strings that can be commonly considered as booleas to real booleans. Such as "true", "false", "1" and "0". This function is case insensitive. - -```javascript -_.toBoolean("true") -=> true -_.toBoolean("FALSE") -=> false -_.toBoolean("random") -=> undefined -``` - -It can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects. - -```javascript -_.toBoolean("truthy", ["truthy"], ["falsy"]) -=> true -_.toBoolean("true only at start", [/^true/]) -=> true -``` - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -#### Problems - -We lose two things for `include` and `reverse` methods from `_.string`: - -* Calls like `_('foobar').include('bar')` aren't available; -* Chaining isn't available too. - -But if you need this functionality you can create aliases for conflict functions which will be convenient for you: - -```javascript -_.mixin({ - includeString: _.str.include, - reverseString: _.str.reverse -}) - -// Now wrapper calls and chaining are available. -_('foobar').chain().reverseString().includeString('rab').value() -``` - -#### Standalone Usage - -If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias -But of course you can just reassign `_` variable with `_.string` - -```javascript -_ = _.string -``` - -## Changelog ## - -### 2.3.3 ### - -* Add `toBoolean` -* Add `unquote` -* Add quote char option to `quote` -* Support dash-separated words in `titleize` - -### 2.3.2 ### - -* Add `naturalCmp` -* Bug fix to `camelize` -* Add ă, ș, ț and ś to `slugify` -* Doc updates -* Add support for [component](http://component.io/) -* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2) - -### 2.3.1 ### - -* Bug fixes to `escapeHTML`, `classify`, `substr` -* Faster `count` -* Documentation fixes -* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1) - -### 2.3.0 ### - -* Added `numberformat` method -* Added `levenshtein` method (Levenshtein distance calculation) -* Added `swapCase` method -* Changed default behavior of `words` method -* Added `toSentenceSerial` method -* Added `surround` and `quote` methods - -### 2.2.1 ### - -* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama - -### 2.2.0 ### - -* Capitalize method behavior changed -* Various perfomance tweaks - -### 2.1.1### - -* Fixed words method bug -* Added classify method - -### 2.1.0 ### - -* AMD support -* Added toSentence method -* Added slugify method -* Lots of speed optimizations - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -For upgrading to this version you need to mix in Underscore.string library to Underscore object: - -```javascript -_.mixin(_.string.exports()); -``` - -and all non-conflict Underscore.string functions will be available through Underscore object. -Also function `includes` has been removed, you should replace this function by `_.str.include` -or create alias `_.includes = _.str.include` and all your code will work fine. - -### 1.1.6 ### - -* Fixed reverse and truncate -* Added isBlank, stripTags, inlude(alias for includes) -* Added uglifier compression - -### 1.1.5 ### - -* Added strRight, strRightBack, strLeft, strLeftBack - -### 1.1.4 ### - -* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust -* Integration with Underscore 1.1.6 - -### 1.1.3 ### - -* Added methods: underscored, camelize, dasherize -* Support newer version of npm - -### 1.1.2 ### - -* Created functions: lines, chars, words functions - -### 1.0.2 ### - -* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) -* Removed 'reverse' function, because this function override underscore.js 'reverse' - -## Contribute ## - -* Fork & pull request. Don't forget about tests. -* If you planning add some feature please create issue before. - -Otherwise changes will be rejected. - -## Contributors list ## -[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors). - - -## Licence ## - -The MIT License - -Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org - -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/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile deleted file mode 100644 index 2cd9eed..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js', :encoding => 'utf-8') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "test/test_underscore/index.html"} - - exit(result1 && result2 ? 0 : 1) -end diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json deleted file mode 100644 index ae91b65..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "underscore.string", - "repo": "epeli/underscore.string", - "description": "String manipulation extensions for Underscore.js javascript library", - "version": "2.3.3", - "keywords": ["underscore", "string"], - "dependencies": {}, - "development": {}, - "main": "lib/underscore.string.js", - "scripts": ["lib/underscore.string.js"] -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index 4f6b2b9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,n){"use strict";function r(e,n){var r,t,u=e.toLowerCase();for(n=[].concat(n),r=0;n.length>r;r+=1)if(t=n[r]){if(t.test&&t.test(e))return!0;if(t.toLowerCase()===u)return!0}}var t=n.prototype.trim,u=n.prototype.trimRight,i=n.prototype.trimLeft,l=function(e){return 1*e||0},o=function(e,n){if(1>n)return"";for(var r="";n>0;)1&n&&(r+=e),n>>=1,e+=e;return r},a=[].slice,c=function(e){return null==e?"\\s":e.source?e.source:"["+g.escapeRegExp(e)+"]"},s={lt:"<",gt:">",quot:'"',amp:"&",apos:"'"},f={};for(var p in s)f[s[p]]=p;f["'"]="#39";var h=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var r=o,t=function(){return t.cache.hasOwnProperty(arguments[0])||(t.cache[arguments[0]]=t.parse(arguments[0])),t.format.call(null,t.cache[arguments[0]],arguments)};return t.format=function(t,u){var i,l,o,a,c,s,f,p=1,g=t.length,d="",m=[];for(l=0;g>l;l++)if(d=e(t[l]),"string"===d)m.push(t[l]);else if("array"===d){if(a=t[l],a[2])for(i=u[p],o=0;a[2].length>o;o++){if(!i.hasOwnProperty(a[2][o]))throw new Error(h('[_.sprintf] property "%s" does not exist',a[2][o]));i=i[a[2][o]]}else i=a[1]?u[a[1]]:u[p++];if(/[^s]/.test(a[8])&&"number"!=e(i))throw new Error(h("[_.sprintf] expecting number but found %s",e(i)));switch(a[8]){case"b":i=i.toString(2);break;case"c":i=n.fromCharCode(i);break;case"d":i=parseInt(i,10);break;case"e":i=a[7]?i.toExponential(a[7]):i.toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"o":i=i.toString(8);break;case"s":i=(i=n(i))&&a[7]?i.substring(0,a[7]):i;break;case"u":i=Math.abs(i);break;case"x":i=i.toString(16);break;case"X":i=i.toString(16).toUpperCase()}i=/[def]/.test(a[8])&&a[3]&&i>=0?"+"+i:i,s=a[4]?"0"==a[4]?"0":a[4].charAt(1):" ",f=a[6]-n(i).length,c=a[6]?r(s,f):"",m.push(a[5]?i+c:c+i)}return m.join("")},t.cache={},t.parse=function(e){for(var n=e,r=[],t=[],u=0;n;){if(null!==(r=/^[^\x25]+/.exec(n)))t.push(r[0]);else if(null!==(r=/^\x25{2}/.exec(n)))t.push("%");else{if(null===(r=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(n)))throw new Error("[_.sprintf] huh?");if(r[2]){u|=1;var i=[],l=r[2],o=[];if(null===(o=/^([a-z_][a-z_\d]*)/i.exec(l)))throw new Error("[_.sprintf] huh?");for(i.push(o[1]);""!==(l=l.substring(o[0].length));)if(null!==(o=/^\.([a-z_][a-z_\d]*)/i.exec(l)))i.push(o[1]);else{if(null===(o=/^\[(\d+)\]/.exec(l)))throw new Error("[_.sprintf] huh?");i.push(o[1])}r[2]=i}else u|=2;if(3===u)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");t.push(r)}n=n.substring(r[0].length)}return t},t}(),g={VERSION:"2.3.0",isBlank:function(e){return null==e&&(e=""),/^\s*$/.test(e)},stripTags:function(e){return null==e?"":n(e).replace(/<\/?[^>]+>/g,"")},capitalize:function(e){return e=null==e?"":n(e),e.charAt(0).toUpperCase()+e.slice(1)},chop:function(e,r){return null==e?[]:(e=n(e),r=~~r,r>0?e.match(new RegExp(".{1,"+r+"}","g")):[e])},clean:function(e){return g.strip(e).replace(/\s+/g," ")},count:function(e,r){if(null==e||null==r)return 0;e=n(e),r=n(r);for(var t=0,u=0,i=r.length;;){if(u=e.indexOf(r,u),-1===u)break;t++,u+=i}return t},chars:function(e){return null==e?[]:n(e).split("")},swapCase:function(e){return null==e?"":n(e).replace(/\S/g,function(e){return e===e.toUpperCase()?e.toLowerCase():e.toUpperCase()})},escapeHTML:function(e){return null==e?"":n(e).replace(/[&<>"']/g,function(e){return"&"+f[e]+";"})},unescapeHTML:function(e){return null==e?"":n(e).replace(/\&([^;]+);/g,function(e,r){var t;return r in s?s[r]:(t=r.match(/^#x([\da-fA-F]+)$/))?n.fromCharCode(parseInt(t[1],16)):(t=r.match(/^#(\d+)$/))?n.fromCharCode(~~t[1]):e})},escapeRegExp:function(e){return null==e?"":n(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")},splice:function(e,n,r,t){var u=g.chars(e);return u.splice(~~n,~~r,t),u.join("")},insert:function(e,n,r){return g.splice(e,n,0,r)},include:function(e,r){return""===r?!0:null==e?!1:-1!==n(e).indexOf(r)},join:function(){var e=a.call(arguments),n=e.shift();return null==n&&(n=""),e.join(n)},lines:function(e){return null==e?[]:n(e).split("\n")},reverse:function(e){return g.chars(e).reverse().join("")},startsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(0,r.length)===r)},endsWith:function(e,r){return""===r?!0:null==e||null==r?!1:(e=n(e),r=n(r),e.length>=r.length&&e.slice(e.length-r.length)===r)},succ:function(e){return null==e?"":(e=n(e),e.slice(0,-1)+n.fromCharCode(e.charCodeAt(e.length-1)+1))},titleize:function(e){return null==e?"":(e=n(e).toLowerCase(),e.replace(/(?:^|\s|-)\S/g,function(e){return e.toUpperCase()}))},camelize:function(e){return g.trim(e).replace(/[-_\s]+(.)?/g,function(e,n){return n?n.toUpperCase():""})},underscored:function(e){return g.trim(e).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(e){return g.trim(e).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()},classify:function(e){return g.titleize(n(e).replace(/[\W_]/g," ")).replace(/\s/g,"")},humanize:function(e){return g.capitalize(g.underscored(e).replace(/_id$/,"").replace(/_/g," "))},trim:function(e,r){return null==e?"":!r&&t?t.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+|"+r+"+$","g"),""))},ltrim:function(e,r){return null==e?"":!r&&i?i.call(e):(r=c(r),n(e).replace(new RegExp("^"+r+"+"),""))},rtrim:function(e,r){return null==e?"":!r&&u?u.call(e):(r=c(r),n(e).replace(new RegExp(r+"+$"),""))},truncate:function(e,r,t){return null==e?"":(e=n(e),t=t||"...",r=~~r,e.length>r?e.slice(0,r)+t:e)},prune:function(e,r,t){if(null==e)return"";if(e=n(e),r=~~r,t=null!=t?n(t):"...",r>=e.length)return e;var u=function(e){return e.toUpperCase()!==e.toLowerCase()?"A":" "},i=e.slice(0,r+1).replace(/.(?=\W*\w*$)/g,u);return i=i.slice(i.length-2).match(/\w\w/)?i.replace(/\s*\S+$/,""):g.rtrim(i.slice(0,i.length-1)),(i+t).length>e.length?e:e.slice(0,i.length)+t},words:function(e,n){return g.isBlank(e)?[]:g.trim(e,n).split(n||/\s+/)},pad:function(e,r,t,u){e=null==e?"":n(e),r=~~r;var i=0;switch(t?t.length>1&&(t=t.charAt(0)):t=" ",u){case"right":return i=r-e.length,e+o(t,i);case"both":return i=r-e.length,o(t,Math.ceil(i/2))+e+o(t,Math.floor(i/2));default:return i=r-e.length,o(t,i)+e}},lpad:function(e,n,r){return g.pad(e,n,r)},rpad:function(e,n,r){return g.pad(e,n,r,"right")},lrpad:function(e,n,r){return g.pad(e,n,r,"both")},sprintf:h,vsprintf:function(e,n){return n.unshift(e),h.apply(null,n)},toNumber:function(e,n){return e?(e=g.trim(e),e.match(/^-?\d+(?:\.\d+)?$/)?l(l(e).toFixed(~~n)):0/0):0},numberFormat:function(e,n,r,t){if(isNaN(e)||null==e)return"";e=e.toFixed(~~n),t="string"==typeof t?t:",";var u=e.split("."),i=u[0],l=u[1]?(r||".")+u[1]:"";return i.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+t)+l},strRight:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strRightBack:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.lastIndexOf(r):-1;return~t?e.slice(t+r.length,e.length):e},strLeft:function(e,r){if(null==e)return"";e=n(e),r=null!=r?n(r):r;var t=r?e.indexOf(r):-1;return~t?e.slice(0,t):e},strLeftBack:function(e,n){if(null==e)return"";e+="",n=null!=n?""+n:n;var r=e.lastIndexOf(n);return~r?e.slice(0,r):e},toSentence:function(e,n,r,t){n=n||", ",r=r||" and ";var u=e.slice(),i=u.pop();return e.length>2&&t&&(r=g.rtrim(n)+r),u.length?u.join(n)+r+i:i},toSentenceSerial:function(){var e=a.call(arguments);return e[3]=!0,g.toSentence.apply(g,e)},slugify:function(e){if(null==e)return"";var r="ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź",t="aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz",u=new RegExp(c(r),"g");return e=n(e).toLowerCase().replace(u,function(e){var n=r.indexOf(e);return t.charAt(n)||"-"}),g.dasherize(e.replace(/[^\w\s-]/g,""))},surround:function(e,n){return[n,e,n].join("")},quote:function(e,n){return g.surround(e,n||'"')},unquote:function(e,n){return n=n||'"',e[0]===n&&e[e.length-1]===n?e.slice(1,e.length-1):e},exports:function(){var e={};for(var n in this)this.hasOwnProperty(n)&&!n.match(/^(?:include|contains|reverse)$/)&&(e[n]=this[n]);return e},repeat:function(e,r,t){if(null==e)return"";if(r=~~r,null==t)return o(n(e),r);for(var u=[];r>0;u[--r]=e);return u.join(t)},naturalCmp:function(e,r){if(e==r)return 0;if(!e)return-1;if(!r)return 1;for(var t=/(\.\d+)|(\d+)|(\D+)/g,u=n(e).toLowerCase().match(t),i=n(r).toLowerCase().match(t),l=Math.min(u.length,i.length),o=0;l>o;o++){var a=u[o],c=i[o];if(a!==c){var s=parseInt(a,10);if(!isNaN(s)){var f=parseInt(c,10);if(!isNaN(f)&&s-f)return s-f}return c>a?-1:1}}return u.length===i.length?u.length-i.length:r>e?-1:1},levenshtein:function(e,r){if(null==e&&null==r)return 0;if(null==e)return n(r).length;if(null==r)return n(e).length;e=n(e),r=n(r);for(var t,u,i=[],l=0;r.length>=l;l++)for(var o=0;e.length>=o;o++)u=l&&o?e.charAt(o-1)===r.charAt(l-1)?t:Math.min(i[o],i[o-1],t)+1:l+o,t=i[o],i[o]=u;return i.pop()},toBoolean:function(e,n,t){return"number"==typeof e&&(e=""+e),"string"!=typeof e?!!e:(e=g.trim(e),r(e,n||["true","1"])?!0:r(e,t||["false","0"])?!1:void 0)}};g.strip=g.trim,g.lstrip=g.ltrim,g.rstrip=g.rtrim,g.center=g.lrpad,g.rjust=g.lpad,g.ljust=g.rpad,g.contains=g.include,g.q=g.quote,g.toBool=g.toBoolean,"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(module.exports=g),exports._s=g),"function"==typeof define&&define.amd&&define("underscore.string",[],function(){return g}),e._=e._||{},e._.string=e._.str=g}(this,String); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js deleted file mode 100644 index 8761117..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +++ /dev/null @@ -1,673 +0,0 @@ -// Underscore.string -// (c) 2010 Esa-Matti Suuronen -// Underscore.string is freely distributable under the terms of the MIT license. -// Documentation: https://github.com/epeli/underscore.string -// Some code is borrowed from MooTools and Alexandru Marasteanu. -// Version '2.3.2' - -!function(root, String){ - 'use strict'; - - // Defining helper functions. - - var nativeTrim = String.prototype.trim; - var nativeTrimRight = String.prototype.trimRight; - var nativeTrimLeft = String.prototype.trimLeft; - - var parseNumber = function(source) { return source * 1 || 0; }; - - var strRepeat = function(str, qty){ - if (qty < 1) return ''; - var result = ''; - while (qty > 0) { - if (qty & 1) result += str; - qty >>= 1, str += str; - } - return result; - }; - - var slice = [].slice; - - var defaultToWhiteSpace = function(characters) { - if (characters == null) - return '\\s'; - else if (characters.source) - return characters.source; - else - return '[' + _s.escapeRegExp(characters) + ']'; - }; - - // Helper for toBoolean - function boolMatch(s, matchers) { - var i, matcher, down = s.toLowerCase(); - matchers = [].concat(matchers); - for (i = 0; i < matchers.length; i += 1) { - matcher = matchers[i]; - if (!matcher) continue; - if (matcher.test && matcher.test(s)) return true; - if (matcher.toLowerCase() === down) return true; - } - } - - var escapeChars = { - lt: '<', - gt: '>', - quot: '"', - amp: '&', - apos: "'" - }; - - var reversedEscapeChars = {}; - for(var key in escapeChars) reversedEscapeChars[escapeChars[key]] = key; - reversedEscapeChars["'"] = '#39'; - - // sprintf() for JavaScript 0.7-beta1 - // http://www.diveintojavascript.com/projects/javascript-sprintf - // - // Copyright (c) Alexandru Marasteanu - // All rights reserved. - - var sprintf = (function() { - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); - } - - var str_repeat = strRepeat; - - var str_format = function() { - if (!str_format.cache.hasOwnProperty(arguments[0])) { - str_format.cache[arguments[0]] = str_format.parse(arguments[0]); - } - return str_format.format.call(null, str_format.cache[arguments[0]], arguments); - }; - - str_format.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]); - if (node_type === 'string') { - output.push(parse_tree[i]); - } - else if (node_type === 'array') { - match = parse_tree[i]; // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor]; - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); - } - arg = arg[match[2][k]]; - } - } else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]]; - } - else { // positional argument (implicit) - arg = argv[cursor++]; - } - - if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { - throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); - } - switch (match[8]) { - case 'b': arg = arg.toString(2); break; - case 'c': arg = String.fromCharCode(arg); break; - case 'd': arg = parseInt(arg, 10); break; - case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; - case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; - case 'o': arg = arg.toString(8); break; - case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; - case 'u': arg = Math.abs(arg); break; - case 'x': arg = arg.toString(16); break; - case 'X': arg = arg.toString(16).toUpperCase(); break; - } - arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); - pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; - pad_length = match[6] - String(arg).length; - pad = match[6] ? str_repeat(pad_character, pad_length) : ''; - output.push(match[5] ? arg + pad : pad + arg); - } - } - return output.join(''); - }; - - str_format.cache = {}; - - str_format.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; - while (_fmt) { - if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { - parse_tree.push(match[0]); - } - else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { - parse_tree.push('%'); - } - else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1; - var field_list = [], replacement_field = match[2], field_match = []; - if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { - if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else { - throw new Error('[_.sprintf] huh?'); - } - } - } - else { - throw new Error('[_.sprintf] huh?'); - } - match[2] = field_list; - } - else { - arg_names |= 2; - } - if (arg_names === 3) { - throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); - } - parse_tree.push(match); - } - else { - throw new Error('[_.sprintf] huh?'); - } - _fmt = _fmt.substring(match[0].length); - } - return parse_tree; - }; - - return str_format; - })(); - - - - // Defining underscore.string - - var _s = { - - VERSION: '2.3.0', - - isBlank: function(str){ - if (str == null) str = ''; - return (/^\s*$/).test(str); - }, - - stripTags: function(str){ - if (str == null) return ''; - return String(str).replace(/<\/?[^>]+>/g, ''); - }, - - capitalize : function(str){ - str = str == null ? '' : String(str); - return str.charAt(0).toUpperCase() + str.slice(1); - }, - - chop: function(str, step){ - if (str == null) return []; - str = String(str); - step = ~~step; - return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str]; - }, - - clean: function(str){ - return _s.strip(str).replace(/\s+/g, ' '); - }, - - count: function(str, substr){ - if (str == null || substr == null) return 0; - - str = String(str); - substr = String(substr); - - var count = 0, - pos = 0, - length = substr.length; - - while (true) { - pos = str.indexOf(substr, pos); - if (pos === -1) break; - count++; - pos += length; - } - - return count; - }, - - chars: function(str) { - if (str == null) return []; - return String(str).split(''); - }, - - swapCase: function(str) { - if (str == null) return ''; - return String(str).replace(/\S/g, function(c){ - return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase(); - }); - }, - - escapeHTML: function(str) { - if (str == null) return ''; - return String(str).replace(/[&<>"']/g, function(m){ return '&' + reversedEscapeChars[m] + ';'; }); - }, - - unescapeHTML: function(str) { - if (str == null) return ''; - return String(str).replace(/\&([^;]+);/g, function(entity, entityCode){ - var match; - - if (entityCode in escapeChars) { - return escapeChars[entityCode]; - } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { - return String.fromCharCode(parseInt(match[1], 16)); - } else if (match = entityCode.match(/^#(\d+)$/)) { - return String.fromCharCode(~~match[1]); - } else { - return entity; - } - }); - }, - - escapeRegExp: function(str){ - if (str == null) return ''; - return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); - }, - - splice: function(str, i, howmany, substr){ - var arr = _s.chars(str); - arr.splice(~~i, ~~howmany, substr); - return arr.join(''); - }, - - insert: function(str, i, substr){ - return _s.splice(str, i, 0, substr); - }, - - include: function(str, needle){ - if (needle === '') return true; - if (str == null) return false; - return String(str).indexOf(needle) !== -1; - }, - - join: function() { - var args = slice.call(arguments), - separator = args.shift(); - - if (separator == null) separator = ''; - - return args.join(separator); - }, - - lines: function(str) { - if (str == null) return []; - return String(str).split("\n"); - }, - - reverse: function(str){ - return _s.chars(str).reverse().join(''); - }, - - startsWith: function(str, starts){ - if (starts === '') return true; - if (str == null || starts == null) return false; - str = String(str); starts = String(starts); - return str.length >= starts.length && str.slice(0, starts.length) === starts; - }, - - endsWith: function(str, ends){ - if (ends === '') return true; - if (str == null || ends == null) return false; - str = String(str); ends = String(ends); - return str.length >= ends.length && str.slice(str.length - ends.length) === ends; - }, - - succ: function(str){ - if (str == null) return ''; - str = String(str); - return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length-1) + 1); - }, - - titleize: function(str){ - if (str == null) return ''; - str = String(str).toLowerCase(); - return str.replace(/(?:^|\s|-)\S/g, function(c){ return c.toUpperCase(); }); - }, - - camelize: function(str){ - return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, c){ return c ? c.toUpperCase() : ""; }); - }, - - underscored: function(str){ - return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); - }, - - dasherize: function(str){ - return _s.trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase(); - }, - - classify: function(str){ - return _s.titleize(String(str).replace(/[\W_]/g, ' ')).replace(/\s/g, ''); - }, - - humanize: function(str){ - return _s.capitalize(_s.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); - }, - - trim: function(str, characters){ - if (str == null) return ''; - if (!characters && nativeTrim) return nativeTrim.call(str); - characters = defaultToWhiteSpace(characters); - return String(str).replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); - }, - - ltrim: function(str, characters){ - if (str == null) return ''; - if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str); - characters = defaultToWhiteSpace(characters); - return String(str).replace(new RegExp('^' + characters + '+'), ''); - }, - - rtrim: function(str, characters){ - if (str == null) return ''; - if (!characters && nativeTrimRight) return nativeTrimRight.call(str); - characters = defaultToWhiteSpace(characters); - return String(str).replace(new RegExp(characters + '+$'), ''); - }, - - truncate: function(str, length, truncateStr){ - if (str == null) return ''; - str = String(str); truncateStr = truncateStr || '...'; - length = ~~length; - return str.length > length ? str.slice(0, length) + truncateStr : str; - }, - - /** - * _s.prune: a more elegant version of truncate - * prune extra chars, never leaving a half-chopped word. - * @author github.com/rwz - */ - prune: function(str, length, pruneStr){ - if (str == null) return ''; - - str = String(str); length = ~~length; - pruneStr = pruneStr != null ? String(pruneStr) : '...'; - - if (str.length <= length) return str; - - var tmpl = function(c){ return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' '; }, - template = str.slice(0, length+1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA' - - if (template.slice(template.length-2).match(/\w\w/)) - template = template.replace(/\s*\S+$/, ''); - else - template = _s.rtrim(template.slice(0, template.length-1)); - - return (template+pruneStr).length > str.length ? str : str.slice(0, template.length)+pruneStr; - }, - - words: function(str, delimiter) { - if (_s.isBlank(str)) return []; - return _s.trim(str, delimiter).split(delimiter || /\s+/); - }, - - pad: function(str, length, padStr, type) { - str = str == null ? '' : String(str); - length = ~~length; - - var padlen = 0; - - if (!padStr) - padStr = ' '; - else if (padStr.length > 1) - padStr = padStr.charAt(0); - - switch(type) { - case 'right': - padlen = length - str.length; - return str + strRepeat(padStr, padlen); - case 'both': - padlen = length - str.length; - return strRepeat(padStr, Math.ceil(padlen/2)) + str - + strRepeat(padStr, Math.floor(padlen/2)); - default: // 'left' - padlen = length - str.length; - return strRepeat(padStr, padlen) + str; - } - }, - - lpad: function(str, length, padStr) { - return _s.pad(str, length, padStr); - }, - - rpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'right'); - }, - - lrpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'both'); - }, - - sprintf: sprintf, - - vsprintf: function(fmt, argv){ - argv.unshift(fmt); - return sprintf.apply(null, argv); - }, - - toNumber: function(str, decimals) { - if (!str) return 0; - str = _s.trim(str); - if (!str.match(/^-?\d+(?:\.\d+)?$/)) return NaN; - return parseNumber(parseNumber(str).toFixed(~~decimals)); - }, - - numberFormat : function(number, dec, dsep, tsep) { - if (isNaN(number) || number == null) return ''; - - number = number.toFixed(~~dec); - tsep = typeof tsep == 'string' ? tsep : ','; - - var parts = number.split('.'), fnums = parts[0], - decimals = parts[1] ? (dsep || '.') + parts[1] : ''; - - return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals; - }, - - strRight: function(str, sep){ - if (str == null) return ''; - str = String(str); sep = sep != null ? String(sep) : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strRightBack: function(str, sep){ - if (str == null) return ''; - str = String(str); sep = sep != null ? String(sep) : sep; - var pos = !sep ? -1 : str.lastIndexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strLeft: function(str, sep){ - if (str == null) return ''; - str = String(str); sep = sep != null ? String(sep) : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - strLeftBack: function(str, sep){ - if (str == null) return ''; - str += ''; sep = sep != null ? ''+sep : sep; - var pos = str.lastIndexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - toSentence: function(array, separator, lastSeparator, serial) { - separator = separator || ', '; - lastSeparator = lastSeparator || ' and '; - var a = array.slice(), lastMember = a.pop(); - - if (array.length > 2 && serial) lastSeparator = _s.rtrim(separator) + lastSeparator; - - return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember; - }, - - toSentenceSerial: function() { - var args = slice.call(arguments); - args[3] = true; - return _s.toSentence.apply(_s, args); - }, - - slugify: function(str) { - if (str == null) return ''; - - var from = "ąàáäâãåæăćęèéëêìíïîłńòóöôõøśșțùúüûñçżź", - to = "aaaaaaaaaceeeeeiiiilnoooooosstuuuunczz", - regex = new RegExp(defaultToWhiteSpace(from), 'g'); - - str = String(str).toLowerCase().replace(regex, function(c){ - var index = from.indexOf(c); - return to.charAt(index) || '-'; - }); - - return _s.dasherize(str.replace(/[^\w\s-]/g, '')); - }, - - surround: function(str, wrapper) { - return [wrapper, str, wrapper].join(''); - }, - - quote: function(str, quoteChar) { - return _s.surround(str, quoteChar || '"'); - }, - - unquote: function(str, quoteChar) { - quoteChar = quoteChar || '"'; - if (str[0] === quoteChar && str[str.length-1] === quoteChar) - return str.slice(1,str.length-1); - else return str; - }, - - exports: function() { - var result = {}; - - for (var prop in this) { - if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse)$/)) continue; - result[prop] = this[prop]; - } - - return result; - }, - - repeat: function(str, qty, separator){ - if (str == null) return ''; - - qty = ~~qty; - - // using faster implementation if separator is not needed; - if (separator == null) return strRepeat(String(str), qty); - - // this one is about 300x slower in Google Chrome - for (var repeat = []; qty > 0; repeat[--qty] = str) {} - return repeat.join(separator); - }, - - naturalCmp: function(str1, str2){ - if (str1 == str2) return 0; - if (!str1) return -1; - if (!str2) return 1; - - var cmpRegex = /(\.\d+)|(\d+)|(\D+)/g, - tokens1 = String(str1).toLowerCase().match(cmpRegex), - tokens2 = String(str2).toLowerCase().match(cmpRegex), - count = Math.min(tokens1.length, tokens2.length); - - for(var i = 0; i < count; i++) { - var a = tokens1[i], b = tokens2[i]; - - if (a !== b){ - var num1 = parseInt(a, 10); - if (!isNaN(num1)){ - var num2 = parseInt(b, 10); - if (!isNaN(num2) && num1 - num2) - return num1 - num2; - } - return a < b ? -1 : 1; - } - } - - if (tokens1.length === tokens2.length) - return tokens1.length - tokens2.length; - - return str1 < str2 ? -1 : 1; - }, - - levenshtein: function(str1, str2) { - if (str1 == null && str2 == null) return 0; - if (str1 == null) return String(str2).length; - if (str2 == null) return String(str1).length; - - str1 = String(str1); str2 = String(str2); - - var current = [], prev, value; - - for (var i = 0; i <= str2.length; i++) - for (var j = 0; j <= str1.length; j++) { - if (i && j) - if (str1.charAt(j - 1) === str2.charAt(i - 1)) - value = prev; - else - value = Math.min(current[j], current[j - 1], prev) + 1; - else - value = i + j; - - prev = current[j]; - current[j] = value; - } - - return current.pop(); - }, - - toBoolean: function(str, trueValues, falseValues) { - if (typeof str === "number") str = "" + str; - if (typeof str !== "string") return !!str; - str = _s.trim(str); - if (boolMatch(str, trueValues || ["true", "1"])) return true; - if (boolMatch(str, falseValues || ["false", "0"])) return false; - } - }; - - // Aliases - - _s.strip = _s.trim; - _s.lstrip = _s.ltrim; - _s.rstrip = _s.rtrim; - _s.center = _s.lrpad; - _s.rjust = _s.lpad; - _s.ljust = _s.rpad; - _s.contains = _s.include; - _s.q = _s.quote; - _s.toBool = _s.toBoolean; - - // Exporting - - // CommonJS module is defined - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) - module.exports = _s; - - exports._s = _s; - } - - // Register as a named module with AMD. - if (typeof define === 'function' && define.amd) - define('underscore.string', [], function(){ return _s; }); - - - // Integrate with Underscore.js if defined - // or create our own underscore object. - root._ = root._ || {}; - root._.string = root._.str = _s; -}(this, String); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json deleted file mode 100644 index 4b47216..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.3.3", - "description": "String manipulation extensions for Underscore.js javascript library.", - "homepage": "http://epeli.github.com/underscore.string/", - "contributors": [ - { - "name": "Esa-Matti Suuronen", - "email": "esa-matti@suuronen.org", - "url": "http://esa-matti.suuronen.org/" - }, - { - "name": "Edward Tsech", - "email": "edtsech@gmail.com" - }, - { - "name": "Pavel Pravosud", - "email": "pavel@pravosud.com", - "url": "" - }, - { - "name": "Sasha Koss", - "email": "kossnocorp@gmail.com", - "url": "http://koss.nocorp.me/" - }, - { - "name": "Vladimir Dronnikov", - "email": "dronnikov@gmail.com" - }, - { - "name": "Pete Kruckenberg", - "email": "https://github.com/kruckenb", - "url": "" - }, - { - "name": "Paul Chavard", - "email": "paul@chavard.net", - "url": "" - }, - { - "name": "Ed Finkler", - "email": "coj@funkatron.com", - "url": "" - } - ], - "keywords": [ - "underscore", - "string" - ], - "main": "./lib/underscore.string", - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/epeli/underscore.string.git" - }, - "bugs": { - "url": "https://github.com/epeli/underscore.string/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n**Or Integrate with Underscore.js without module loading**\n\nRun the following expression after Underscore.js and Underscore.string are loaded\n```javascript\n// _.str becomes a global variable if no module loading is detected\n// Mix in non-conflict functions to Underscore namespace\n_.mixin(_.str.exports());\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**numberFormat** _.numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=','])\n\nFormats the numbers.\n\n```javascript\n_.numberFormat(1000, 2)\n=> \"1,000.00\"\n\n_.numberFormat(123456789.123, 5, '.', ',')\n=> \"123,456,789.12300\"\n```\n\n\n**levenshtein** _.levenshtein(string1, string2)\n\nCalculates [Levenshtein distance][ld] between two strings.\n[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance\n\n```javascript\n_.levenshtein('kitten', 'kittah')\n=> 2\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**swapCase** _.swapCase(str)\n\nReturns a copy of the string in which all the case-based characters have had their case swapped.\n\n```javascript\n_.swapCase('hELLO')\n=> 'Hello'\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n(removed) **includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
    Blah blah blah
    ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
    Blah blah blah
    '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=/\\s+/)\n\nSplit string by delimiter (String or RegExp), /\\s+/ by default.\n\n```javascript\n_.words(\" I love you \")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\" \")\n=> []\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**toSentenceSerial** _.toSentenceSerial(array, [delimiter, lastDelimiter])\n\nThe same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).\n\n```javascript\n_.toSentenceSerial(['jQuery', 'Mootools'])\n=> 'jQuery and Mootools';\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools, and Prototype'\n\n_.toSentenceSerial(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ');\n=> 'jQuery, Mootools, unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**surround** _.surround(string, wrap)\n\nSurround a string with another string.\n\n```javascript\n_.surround(\"foo\", \"ab\")\n=> 'abfooab';\n```\n\n**quote** _.quote(string, quoteChar) or _.q(string, quoteChar)\n\nQuotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.quote('foo', quoteChar)\n=> '\"foo\"';\n```\n**unquote** _.unquote(string, quoteChar)\n\nUnquotes a string. `quoteChar` defaults to `\"`.\n\n```javascript\n_.unquote('\"foo\"')\n=> 'foo';\n_.unquote(\"'foo'\", \"'\")\n=> 'foo';\n```\n\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n**naturalCmp** array.sort(_.naturalCmp)\n\nNaturally sort strings like humans would do.\n\n```javascript\n['foo20', 'foo5'].sort(_.naturalCmp)\n=> [ 'foo5', 'foo20' ]\n```\n\n**toBoolean** _.toBoolean(string) or _.toBool(string)\n\nTurn strings that can be commonly considered as booleas to real booleans. Such as \"true\", \"false\", \"1\" and \"0\". This function is case insensitive.\n\n```javascript\n_.toBoolean(\"true\")\n=> true\n_.toBoolean(\"FALSE\")\n=> false\n_.toBoolean(\"random\")\n=> undefined\n```\n\nIt can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects.\n\n```javascript\n_.toBoolean(\"truthy\", [\"truthy\"], [\"falsy\"])\n=> true\n_.toBoolean(\"true only at start\", [/^true/])\n=> true\n```\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n\n## Changelog ##\n\n### 2.3.3 ###\n\n* Add `toBoolean`\n* Add `unquote`\n* Add quote char option to `quote`\n* Support dash-separated words in `titleize`\n\n### 2.3.2 ###\n\n* Add `naturalCmp`\n* Bug fix to `camelize`\n* Add ă, ș, ț and ś to `slugify`\n* Doc updates\n* Add support for [component](http://component.io/)\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2)\n\n### 2.3.1 ###\n\n* Bug fixes to `escapeHTML`, `classify`, `substr`\n* Faster `count`\n* Documentation fixes\n* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1)\n\n### 2.3.0 ###\n\n* Added `numberformat` method\n* Added `levenshtein` method (Levenshtein distance calculation)\n* Added `swapCase` method\n* Changed default behavior of `words` method\n* Added `toSentenceSerial` method\n* Added `surround` and `quote` methods\n\n### 2.2.1 ###\n\n* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama\n\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n[Can be found here](https://github.com/epeli/underscore.string/graphs/contributors).\n\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.3.3", - "_from": "underscore.string@~2.3.1" -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 44a2167..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,45 +0,0 @@ -function waitFor(test, complete, timeout) { - var result, start = new Date().getTime() - setInterval(function interval() { - if ((new Date().getTime() - start < timeout) && !result) { - result = test() - } else { - if (!result) { - phantom.exit(1) - } else { - complete() - clearInterval(interval) - } - } - }, 100) -} - - -var fs = require('fs'), page = require('webpage').create(); -var url = 'file://localhost' + fs.workingDirectory + '/' + phantom.args[0]; - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(url, function(status) { - waitFor(function() { - return page.evaluate(function(){ - var el = document.getElementById('qunit-testresult') - return el && el.innerText.match('completed') - }) - }, function() { - var failures = page.evaluate(function() { - var el = document.getElementById('qunit-testresult'), - fails = document.getElementsByClassName('fail') - - for (var i = 0; i < fails.length; i++) - console.log(fails[i].innerText) - - console.log(el.innerText) - - return parseInt(el.getElementsByClassName('failed')[0].innerHTML) - }) - phantom.exit(failures > 0 ? 1 : 0) - }, 10000) -}) \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 9ceeea7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,148 +0,0 @@ -(function() { - - JSLitmus.test('levenshtein', function() { - return [ - _.levenshtein('pineapple', 'potato'), - _.levenshtein('seven', 'eight'), - _.levenshtein('the very same string', 'the very same string'), - _.levenshtein('very very very long string', 'something completely different') - ]; - }); - - - JSLitmus.test('trimNoNative', function() { - return _.trim(" foobar ", " "); - }); - - JSLitmus.test('trim', function() { - return _.trim(" foobar "); - }); - - JSLitmus.test('trim object-oriented', function() { - return _(" foobar ").trim(); - }); - - JSLitmus.test('trim jQuery', function() { - return jQuery.trim(" foobar "); - }); - - JSLitmus.test('ltrimp', function() { - return _.ltrim(" foobar ", " "); - }); - - JSLitmus.test('rtrimp', function() { - return _.rtrim(" foobar ", " "); - }); - - JSLitmus.test('startsWith', function() { - return _.startsWith("foobar", "foo"); - }); - - JSLitmus.test('endsWith', function() { - return _.endsWith("foobar", "xx"); - }); - - JSLitmus.test('chop', function(){ - return _('whitespace').chop(2); - }); - - JSLitmus.test('count', function(){ - return _('Hello worls').count('l'); - }); - - JSLitmus.test('insert', function() { - return _('Hello ').insert(6, 'world'); - }); - - JSLitmus.test('splice', function() { - return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); - }); - - JSLitmus.test('succ', function(){ - var let = 'a', alphabet = []; - - for (var i=0; i < 26; i++) { - alphabet.push(let); - let = _(let).succ(); - } - - return alphabet; - }); - - JSLitmus.test('titleize', function(){ - return _('the titleize string method').titleize(); - }); - - JSLitmus.test('truncate', function(){ - return _('Hello world').truncate(5); - }); - - JSLitmus.test('prune', function(){ - return _('Hello world').prune(5); - }); - - JSLitmus.test('isBlank', function(){ - return _('').isBlank(); - }); - - JSLitmus.test('escapeHTML', function(){ - _('
    Blah blah blah
    ').escapeHTML(); - }); - - JSLitmus.test('unescapeHTML', function(){ - _('<div>Blah blah blah</div>').unescapeHTML(); - }); - - JSLitmus.test('reverse', function(){ - _('Hello World').reverse(); - }); - - JSLitmus.test('pad default', function(){ - _('foo').pad(12); - }); - - JSLitmus.test('pad hash left', function(){ - _('foo').pad(12, '#'); - }); - - JSLitmus.test('pad hash right', function(){ - _('foo').pad(12, '#', 'right'); - }); - - JSLitmus.test('pad hash both', function(){ - _('foo').pad(12, '#', 'both'); - }); - - JSLitmus.test('pad hash both longPad', function(){ - _('foo').pad(12, 'f00f00f00', 'both'); - }); - - JSLitmus.test('toNumber', function(){ - _('10.232323').toNumber(2); - }); - - JSLitmus.test('strRight', function(){ - _('aaa_bbb_ccc').strRight('_'); - }); - - JSLitmus.test('strRightBack', function(){ - _('aaa_bbb_ccc').strRightBack('_'); - }); - - JSLitmus.test('strLeft', function(){ - _('aaa_bbb_ccc').strLeft('_'); - }); - - JSLitmus.test('strLeftBack', function(){ - _('aaa_bbb_ccc').strLeftBack('_'); - }); - - JSLitmus.test('join', function(){ - _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); - }); - - JSLitmus.test('slugify', function(){ - _("Un éléphant à l'orée du bois").slugify(); - }); - -})(); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js deleted file mode 100644 index 77364f2..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,685 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module('String extensions'); - - test('Strings: naturalSort', function() { - var arr = ['foo2', 'foo1', 'foo10', 'foo30', 'foo100', 'foo10bar'], - sorted = ['foo1', 'foo2', 'foo10', 'foo10bar', 'foo30', 'foo100']; - deepEqual(arr.sort(_.naturalCmp), sorted); - }); - - test('Strings: trim', function() { - equal(_.trim(123), '123', 'Non string'); - equal(_(' foo').trim(), 'foo'); - equal(_('foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(), 'foo'); - equal(_(' foo ').trim(' '), 'foo', 'Manually set whitespace'); - equal(_('\t foo \t ').trim(/\s/), 'foo', 'Manually set RegExp /\\s+/'); - - equal(_('ffoo').trim('f'), 'oo'); - equal(_('ooff').trim('f'), 'oo'); - equal(_('ffooff').trim('f'), 'oo'); - - - equal(_('_-foobar-_').trim('_-'), 'foobar'); - - equal(_('http://foo/').trim('/'), 'http://foo'); - equal(_('c:\\').trim('\\'), 'c:'); - - equal(_(123).trim(), '123'); - equal(_(123).trim(3), '12'); - equal(_('').trim(), '', 'Trim empty string should return empty string'); - equal(_(null).trim(), '', 'Trim null should return empty string'); - equal(_(undefined).trim(), '', 'Trim undefined should return empty string'); - }); - - test('String: levenshtein', function() { - equal(_.levenshtein('Godfather', 'Godfather'), 0); - equal(_.levenshtein('Godfather', 'Godfathe'), 1); - equal(_.levenshtein('Godfather', 'odfather'), 1); - equal(_.levenshtein('Godfather', 'Gdfthr'), 3); - equal(_.levenshtein('seven', 'eight'), 5); - equal(_.levenshtein('123', 123), 0); - equal(_.levenshtein(321, '321'), 0); - equal(_.levenshtein('lol', null), 3); - equal(_.levenshtein('lol'), 3); - equal(_.levenshtein(null, 'lol'), 3); - equal(_.levenshtein(undefined, 'lol'), 3); - equal(_.levenshtein(), 0); - }); - - test('Strings: ltrim', function() { - equal(_(' foo').ltrim(), 'foo'); - equal(_(' foo').ltrim(), 'foo'); - equal(_('foo ').ltrim(), 'foo '); - equal(_(' foo ').ltrim(), 'foo '); - equal(_('').ltrim(), '', 'ltrim empty string should return empty string'); - equal(_(null).ltrim(), '', 'ltrim null should return empty string'); - equal(_(undefined).ltrim(), '', 'ltrim undefined should return empty string'); - - equal(_('ffoo').ltrim('f'), 'oo'); - equal(_('ooff').ltrim('f'), 'ooff'); - equal(_('ffooff').ltrim('f'), 'ooff'); - - equal(_('_-foobar-_').ltrim('_-'), 'foobar-_'); - - equal(_(123).ltrim(1), '23'); - }); - - test('Strings: rtrim', function() { - equal(_('http://foo/').rtrim('/'), 'http://foo', 'clean trailing slash'); - equal(_(' foo').rtrim(), ' foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo ').rtrim(), 'foo'); - equal(_('foo bar ').rtrim(), 'foo bar'); - equal(_(' foo ').rtrim(), ' foo'); - - equal(_('ffoo').rtrim('f'), 'ffoo'); - equal(_('ooff').rtrim('f'), 'oo'); - equal(_('ffooff').rtrim('f'), 'ffoo'); - - equal(_('_-foobar-_').rtrim('_-'), '_-foobar'); - - equal(_(123).rtrim(3), '12'); - equal(_('').rtrim(), '', 'rtrim empty string should return empty string'); - equal(_(null).rtrim(), '', 'rtrim null should return empty string'); - }); - - test('Strings: capitalize', function() { - equal(_('fabio').capitalize(), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('fabio'), 'Fabio', 'First letter is upper case'); - equal(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equal(_(123).capitalize(), '123', 'Non string'); - equal(_.capitalize(''), '', 'Capitalizing empty string returns empty string'); - equal(_.capitalize(null), '', 'Capitalizing null returns empty string'); - equal(_.capitalize(undefined), '', 'Capitalizing undefined returns empty string'); - }); - - test('Strings: join', function() { - equal(_.join('', 'foo', 'bar'), 'foobar', 'basic join'); - equal(_.join('', 1, 'foo', 2), '1foo2', 'join numbers and strings'); - equal(_.join(' ','foo', 'bar'), 'foo bar', 'join with spaces'); - equal(_.join('1', '2', '2'), '212', 'join number strings'); - equal(_.join(1, 2, 2), '212', 'join numbers'); - equal(_.join('','foo', null), 'foo', 'join null with string returns string'); - equal(_.join(null,'foo', 'bar'), 'foobar', 'join strings with null returns string'); - equal(_(' ').join('foo', 'bar'), 'foo bar', 'join object oriented'); - }); - - test('Strings: reverse', function() { - equal(_.str.reverse('foo'), 'oof' ); - equal(_.str.reverse('foobar'), 'raboof' ); - equal(_.str.reverse('foo bar'), 'rab oof' ); - equal(_.str.reverse('saippuakauppias'), 'saippuakauppias' ); - equal(_.str.reverse(123), '321', 'Non string'); - equal(_.str.reverse(123.45), '54.321', 'Non string'); - equal(_.str.reverse(''), '', 'reversing empty string returns empty string' ); - equal(_.str.reverse(null), '', 'reversing null returns empty string' ); - equal(_.str.reverse(undefined), '', 'reversing undefined returns empty string' ); - }); - - test('Strings: clean', function() { - equal(_(' foo bar ').clean(), 'foo bar'); - equal(_(123).clean(), '123'); - equal(_('').clean(), '', 'claning empty string returns empty string'); - equal(_(null).clean(), '', 'claning null returns empty string'); - equal(_(undefined).clean(), '', 'claning undefined returns empty string'); - }); - - test('Strings: sprintf', function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equal(_.sprintf('Hello %s', 'me'), 'Hello me', 'basic'); - equal(_('Hello %s').sprintf('me'), 'Hello me', 'object'); - equal(_('hello %s').chain().sprintf('me').capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.sprintf('%.1f', 1.22222), '1.2', 'round'); - equal(_.sprintf('%.1f', 1.17), '1.2', 'round 2'); - equal(_.sprintf('%(id)d - %(name)s', {id: 824, name: 'Hello World'}), '824 - Hello World', 'Named replacements work'); - equal(_.sprintf('%(args[0].id)d - %(args[1].name)s', {args: [{id: 824}, {name: 'Hello World'}]}), '824 - Hello World', 'Named replacements with arrays work'); - }); - - - test('Strings: vsprintf', function() { - equal(_.vsprintf('Hello %s', ['me']), 'Hello me', 'basic'); - equal(_('Hello %s').vsprintf(['me']), 'Hello me', 'object'); - equal(_('hello %s').chain().vsprintf(['me']).capitalize().value(), 'Hello me', 'Chaining works'); - equal(_.vsprintf('%.1f', [1.22222]), '1.2', 'round'); - equal(_.vsprintf('%.1f', [1.17]), '1.2', 'round 2'); - equal(_.vsprintf('%(id)d - %(name)s', [{id: 824, name: 'Hello World'}]), '824 - Hello World', 'Named replacement works'); - equal(_.vsprintf('%(args[0].id)d - %(args[1].name)s', [{args: [{id: 824}, {name: 'Hello World'}]}]), '824 - Hello World', 'Named replacement with arrays works'); - }); - - test('Strings: startsWith', function() { - ok(_('foobar').startsWith('foo'), 'foobar starts with foo'); - ok(!_('oobar').startsWith('foo'), 'oobar does not start with foo'); - ok(_(12345).startsWith(123), '12345 starts with 123'); - ok(!_(2345).startsWith(123), '2345 does not start with 123'); - ok(_('').startsWith(''), 'empty string starts with empty string'); - ok(_(null).startsWith(''), 'null starts with empty string'); - ok(!_(null).startsWith('foo'), 'null starts with foo'); - }); - - test('Strings: endsWith', function() { - ok(_('foobar').endsWith('bar'), 'foobar ends with bar'); - ok(_.endsWith('foobar', 'bar'), 'foobar ends with bar'); - ok(_.endsWith('00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4', 'mp4'), 'endsWith .mp4'); - ok(!_('fooba').endsWith('bar'), 'fooba does not end with bar'); - ok(_.endsWith(12345, 45), '12345 ends with 45'); - ok(!_.endsWith(12345, 6), '12345 does not end with 6'); - ok(_('').endsWith(''), 'empty string ends with empty string'); - ok(_(null).endsWith(''), 'null ends with empty string'); - ok(!_(null).endsWith('foo'), 'null ends with foo'); - }); - - test('Strings: include', function() { - ok(_.str.include('foobar', 'bar'), 'foobar includes bar'); - ok(!_.str.include('foobar', 'buzz'), 'foobar does not includes buzz'); - ok(_.str.include(12345, 34), '12345 includes 34'); - ok(!_.str.contains(12345, 6), '12345 does not includes 6'); - ok(!_.str.include('', 34), 'empty string includes 34'); - ok(!_.str.include(null, 34), 'null includes 34'); - ok(_.str.include(null, ''), 'null includes empty string'); - }); - - test('String: chop', function(){ - ok(_('whitespace').chop(2).length === 5, 'output [wh, it, es, pa, ce]'); - ok(_('whitespace').chop(3).length === 4, 'output [whi, tes, pac, e]'); - ok(_('whitespace').chop()[0].length === 10, 'output [whitespace]'); - ok(_(12345).chop(1).length === 5, 'output [1, 2, 3, 4, 5]'); - }); - - test('String: clean', function(){ - equal(_.clean(' foo bar '), 'foo bar'); - equal(_.clean(''), ''); - equal(_.clean(null), ''); - equal(_.clean(1), '1'); - }); - - test('String: count', function(){ - equal(_('Hello world').count('l'), 3); - equal(_('Hello world').count('Hello'), 1); - equal(_('Hello world').count('foo'), 0); - equal(_('x.xx....x.x').count('x'), 5); - equal(_('').count('x'), 0); - equal(_(null).count('x'), 0); - equal(_(undefined).count('x'), 0); - equal(_(12345).count(1), 1); - equal(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equal(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equal(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equal(_('').insert(100, 'Jessy'), 'Jessy'); - equal(_(null).insert(100, 'Jessy'), 'Jessy'); - equal(_(undefined).insert(100, 'Jessy'), 'Jessy'); - equal(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equal(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equal(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equal(_('a').succ(), 'b'); - equal(_('A').succ(), 'B'); - equal(_('+').succ(), ','); - equal(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('the titleize string method').titleize(), 'The Titleize String Method'); - equal(_('').titleize(), '', 'Titleize empty string returns empty string'); - equal(_(null).titleize(), '', 'Titleize null returns empty string'); - equal(_(undefined).titleize(), '', 'Titleize undefined returns empty string'); - equal(_('let\'s have some fun').titleize(), 'Let\'s Have Some Fun'); - equal(_('a-dash-separated-string').titleize(), 'A-Dash-Separated-String'); - equal(_('A-DASH-SEPARATED-STRING').titleize(), 'A-Dash-Separated-String'); - equal(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equal(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equal(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equal(_('').camelize(), '', 'Camelize empty string returns empty string'); - equal(_(null).camelize(), '', 'Camelize null returns empty string'); - equal(_(undefined).camelize(), '', 'Camelize undefined returns empty string'); - equal(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equal(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equal(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equal(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equal(_('').underscored(), ''); - equal(_(null).underscored(), ''); - equal(_(undefined).underscored(), ''); - equal(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equal(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equal(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equal(_('thisIsATest').dasherize(), 'this-is-a-test'); - equal(_('this Is A Test').dasherize(), 'this-is-a-test'); - equal(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equal(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equal(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equal(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equal(_('téléphone').dasherize(), 'téléphone'); - equal(_('foo$bar').dasherize(), 'foo$bar'); - equal(_('').dasherize(), ''); - equal(_(null).dasherize(), ''); - equal(_(undefined).dasherize(), ''); - equal(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equal(_.camelize('-moz-transform'), 'MozTransform'); - equal(_.camelize('webkit-transform'), 'webkitTransform'); - equal(_.camelize('under_scored'), 'underScored'); - equal(_.camelize(' with spaces'), 'withSpaces'); - equal(_('').camelize(), ''); - equal(_(null).camelize(), ''); - equal(_(undefined).camelize(), ''); - equal(_("_som eWeird---name-").camelize(), 'SomEWeirdName'); - }); - - test('String: join', function(){ - equal(_.join(1, 2, 3, 4), '21314'); - equal(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - equal(_.join('',2,3,null), '23'); - equal(_.join(null,2,3), '23'); - }); - - test('String: classify', function(){ - equal(_.classify(1), '1'); - equal(_('some_class_name').classify(), 'SomeClassName'); - equal(_('my wonderfull class_name').classify(), 'MyWonderfullClassName'); - equal(_('my wonderfull.class.name').classify(), 'MyWonderfullClassName'); - }); - - test('String: humanize', function(){ - equal(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equal(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equal(_('the humanize string method').humanize(), 'The humanize string method'); - equal(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equal(_('the humanize string method ').humanize(), 'The humanize string method'); - equal(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equal(_(123).humanize(), '123'); - equal(_('').humanize(), ''); - equal(_(null).humanize(), ''); - equal(_(undefined).humanize(), ''); - }); - - test('String: truncate', function(){ - equal(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equal(_('Hello world').truncate(5), 'Hello...'); - equal(_('Hello').truncate(10), 'Hello'); - equal(_('').truncate(10), ''); - equal(_(null).truncate(10), ''); - equal(_(undefined).truncate(10), ''); - equal(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equal(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equal(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equal(_('Hello, world').prune(5), 'Hello...'); - equal(_('Hello, world').prune(8), 'Hello...'); - equal(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equal(_('Hello world').prune(22), 'Hello world'); - equal(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equal(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equal(_('Привет, мир').prune(6), 'Привет...'); - equal(_('Привет, мир').prune(8), 'Привет...'); - equal(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equal(_('Привет, мир').prune(22), 'Привет, мир'); - equal(_('alksjd!!!!!!....').prune(100, ''), 'alksjd!!!!!!....'); - equal(_(123).prune(10), '123'); - equal(_(123).prune(1, 321), '321'); - equal(_('').prune(5), ''); - equal(_(null).prune(5), ''); - equal(_(undefined).prune(5), ''); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - ok(_('').isBlank()); - ok(_(null).isBlank()); - ok(_(undefined).isBlank()); - }); - - test('String: escapeRegExp', function(){ - equal(_.escapeRegExp(/hello(?=\sworld)/.source), 'hello\\(\\?\\=\\\\sworld\\)', 'with lookahead'); - equal(_.escapeRegExp(/hello(?!\shell)/.source), 'hello\\(\\?\\!\\\\shell\\)', 'with negative lookahead'); - }); - - test('String: escapeHTML', function(){ - equal(_('
    Blah & "blah" & \'blah\'
    ').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equal(_('<').escapeHTML(), '&lt;'); - equal(_(5).escapeHTML(), '5'); - equal(_('').escapeHTML(), ''); - equal(_(null).escapeHTML(), ''); - equal(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equal(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
    Blah & "blah" & \'blah\'
    '); - equal(_('&lt;').unescapeHTML(), '<'); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_(''').unescapeHTML(), '\''); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('J').unescapeHTML(), 'J'); - equal(_('&_#39;').unescapeHTML(), '&_#39;'); - equal(_(''_;').unescapeHTML(), ''_;'); - equal(_('&#38;').unescapeHTML(), '&'); - equal(_('&amp;').unescapeHTML(), '&'); - equal(_('').unescapeHTML(), ''); - equal(_(null).unescapeHTML(), ''); - equal(_(undefined).unescapeHTML(), ''); - equal(_(5).unescapeHTML(), '5'); - // equal(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - deepEqual(_('I love you!').words(), ['I', 'love', 'you!']); - deepEqual(_(' I love you! ').words(), ['I', 'love', 'you!']); - deepEqual(_('I_love_you!').words('_'), ['I', 'love', 'you!']); - deepEqual(_('I-love-you!').words(/-/), ['I', 'love', 'you!']); - deepEqual(_(123).words(), ['123'], '123 number has one word "123".'); - deepEqual(_(0).words(), ['0'], 'Zero number has one word "0".'); - deepEqual(_('').words(), [], 'Empty strings has no words.'); - deepEqual(_(' ').words(), [], 'Blank strings has no words.'); - deepEqual(_(null).words(), [], 'null has no words.'); - deepEqual(_(undefined).words(), [], 'undefined has no words.'); - }); - - test('String: chars', function() { - equal(_('Hello').chars().length, 5); - equal(_(123).chars().length, 3); - equal(_('').chars().length, 0); - equal(_(null).chars().length, 0); - equal(_(undefined).chars().length, 0); - }); - - test('String: swapCase', function(){ - equal(_('AaBbCcDdEe').swapCase(), 'aAbBcCdDeE'); - equal(_('Hello World').swapCase(), 'hELLO wORLD'); - equal(_('').swapCase(), ''); - equal(_(null).swapCase(), ''); - equal(_(undefined).swapCase(), ''); - }); - - test('String: lines', function() { - equal(_('Hello\nWorld').lines().length, 2); - equal(_('Hello World').lines().length, 1); - equal(_(123).lines().length, 1); - equal(_('').lines().length, 1); - equal(_(null).lines().length, 0); - equal(_(undefined).lines().length, 0); - }); - - test('String: pad', function() { - equal(_('1').pad(8), ' 1'); - equal(_(1).pad(8), ' 1'); - equal(_('1').pad(8, '0'), '00000001'); - equal(_('1').pad(8, '0', 'left'), '00000001'); - equal(_('1').pad(8, '0', 'right'), '10000000'); - equal(_('1').pad(8, '0', 'both'), '00001000'); - equal(_('foo').pad(8, '0', 'both'), '000foo00'); - equal(_('foo').pad(7, '0', 'both'), '00foo00'); - equal(_('foo').pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - equal(_('').pad(2), ' '); - equal(_(null).pad(2), ' '); - equal(_(undefined).pad(2), ' '); - }); - - test('String: lpad', function() { - equal(_('1').lpad(8), ' 1'); - equal(_(1).lpad(8), ' 1'); - equal(_('1').lpad(8, '0'), '00000001'); - equal(_('1').lpad(8, '0', 'left'), '00000001'); - equal(_('').lpad(2), ' '); - equal(_(null).lpad(2), ' '); - equal(_(undefined).lpad(2), ' '); - }); - - test('String: rpad', function() { - equal(_('1').rpad(8), '1 '); - equal(_(1).lpad(8), ' 1'); - equal(_('1').rpad(8, '0'), '10000000'); - equal(_('foo').rpad(8, '0'), 'foo00000'); - equal(_('foo').rpad(7, '0'), 'foo0000'); - equal(_('').rpad(2), ' '); - equal(_(null).rpad(2), ' '); - equal(_(undefined).rpad(2), ' '); - }); - - test('String: lrpad', function() { - equal(_('1').lrpad(8), ' 1 '); - equal(_(1).lrpad(8), ' 1 '); - equal(_('1').lrpad(8, '0'), '00001000'); - equal(_('foo').lrpad(8, '0'), '000foo00'); - equal(_('foo').lrpad(7, '0'), '00foo00'); - equal(_('foo').lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - equal(_('').lrpad(2), ' '); - equal(_(null).lrpad(2), ' '); - equal(_(undefined).lrpad(2), ' '); - }); - - test('String: toNumber', function() { - deepEqual(_('not a number').toNumber(), NaN); - equal(_(0).toNumber(), 0); - equal(_('0').toNumber(), 0); - equal(_('0.0').toNumber(), 0); - equal(_('0.1').toNumber(), 0); - equal(_('0.1').toNumber(1), 0.1); - equal(_(' 0.1 ').toNumber(1), 0.1); - equal(_('0000').toNumber(), 0); - equal(_('2.345').toNumber(), 2); - equal(_('2.345').toNumber(NaN), 2); - equal(_('2.345').toNumber(2), 2.35); - equal(_('2.344').toNumber(2), 2.34); - equal(_('2').toNumber(2), 2.00); - equal(_(2).toNumber(2), 2.00); - equal(_(-2).toNumber(), -2); - equal(_('-2').toNumber(), -2); - equal(_('').toNumber(), 0); - equal(_(null).toNumber(), 0); - equal(_(undefined).toNumber(), 0); - }); - - test('String: numberFormat', function() { - equal(_.numberFormat(9000), '9,000'); - equal(_.numberFormat(9000, 0), '9,000'); - equal(_.numberFormat(9000, 0, '', ''), '9000'); - equal(_.numberFormat(90000, 2), '90,000.00'); - equal(_.numberFormat(1000.754), '1,001'); - equal(_.numberFormat(1000.754, 2), '1,000.75'); - equal(_.numberFormat(1000.754, 0, ',', '.'), '1.001'); - equal(_.numberFormat(1000.754, 2, ',', '.'), '1.000,75'); - equal(_.numberFormat(1000000.754, 2, ',', '.'), '1.000.000,75'); - equal(_.numberFormat(1000000000), '1,000,000,000'); - equal(_.numberFormat(100000000), '100,000,000'); - equal(_.numberFormat('not number'), ''); - equal(_.numberFormat(), ''); - equal(_.numberFormat(null, '.', ','), ''); - equal(_.numberFormat(undefined, '.', ','), ''); - equal(_.numberFormat(new Number(5000)), '5,000'); - }); - - test('String: strRight', function() { - equal(_('This_is_a_test_string').strRight('_'), 'is_a_test_string'); - equal(_('This_is_a_test_string').strRight('string'), ''); - equal(_('This_is_a_test_string').strRight(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight('-'), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRight(''), 'This_is_a_test_string'); - equal(_('').strRight('foo'), ''); - equal(_(null).strRight('foo'), ''); - equal(_(undefined).strRight('foo'), ''); - equal(_(12345).strRight(2), '345'); - }); - - test('String: strRightBack', function() { - equal(_('This_is_a_test_string').strRightBack('_'), 'string'); - equal(_('This_is_a_test_string').strRightBack('string'), ''); - equal(_('This_is_a_test_string').strRightBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strRightBack('-'), 'This_is_a_test_string'); - equal(_('').strRightBack('foo'), ''); - equal(_(null).strRightBack('foo'), ''); - equal(_(undefined).strRightBack('foo'), ''); - equal(_(12345).strRightBack(2), '345'); - }); - - test('String: strLeft', function() { - equal(_('This_is_a_test_string').strLeft('_'), 'This'); - equal(_('This_is_a_test_string').strLeft('This'), ''); - equal(_('This_is_a_test_string').strLeft(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeft('-'), 'This_is_a_test_string'); - equal(_('').strLeft('foo'), ''); - equal(_(null).strLeft('foo'), ''); - equal(_(undefined).strLeft('foo'), ''); - equal(_(123454321).strLeft(3), '12'); - }); - - test('String: strLeftBack', function() { - equal(_('This_is_a_test_string').strLeftBack('_'), 'This_is_a_test'); - equal(_('This_is_a_test_string').strLeftBack('This'), ''); - equal(_('This_is_a_test_string').strLeftBack(), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack(''), 'This_is_a_test_string'); - equal(_('This_is_a_test_string').strLeftBack('-'), 'This_is_a_test_string'); - equal(_('').strLeftBack('foo'), ''); - equal(_(null).strLeftBack('foo'), ''); - equal(_(undefined).strLeftBack('foo'), ''); - equal(_(123454321).strLeftBack(3), '123454'); - }); - - test('Strings: stripTags', function() { - equal(_('a link').stripTags(), 'a link'); - equal(_('a link - - - - - - - - -

    Underscore.string Test Suite

    -

    -

    -
      -
      -

      Underscore.string Speed Suite

      - -
      - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

      Underscore.string Test Suite

      -

      -

      -
        - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index 32252a3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,200 +0,0 @@ -$(document).ready(function() { - - module("Arrays"); - - test("first", function() { - equal(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equal(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equal(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); - equal(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - equal(_.first([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to first'); - var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); - equal(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equal(result.join(','), '1,1', 'works well with _.map'); - result = (function() { return _.take([1,2,3], 2); })(); - equal(result.join(','), '1,2', 'aliased as take'); - - equal(_.first(null), undefined, 'handles nulls'); - }); - - test("rest", function() { - var numbers = [1, 2, 3, 4]; - equal(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equal(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); - equal(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equal(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equal(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - result = (function(){ return _(arguments).drop(); })(1, 2, 3, 4); - equal(result.join(', '), '2, 3, 4', 'aliased as drop and works on arguments object'); - }); - - test("initial", function() { - equal(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); - equal(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); - var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); - equal(result.join(", "), "1, 2, 3", 'initial works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.initial); - equal(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); - }); - - test("last", function() { - equal(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - equal(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); - equal(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); - equal(_.last([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to last'); - var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); - equal(result, 4, 'works on an arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.last); - equal(result.join(','), '3,3', 'works well with _.map'); - - equal(_.last(null), undefined, 'handles nulls'); - }); - - test("compact", function() { - equal(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); - var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); - equal(result, 3, 'works on an arguments object'); - }); - - test("flatten", function() { - if (window.JSON) { - var list = [1, [2], [3, [[[4]]]]]; - equal(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); - equal(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equal(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); - } - }); - - test("without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equal(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); - var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); - equal(result.join(', '), '2, 3, 4', 'works on an arguments object'); - - var list = [{one : 1}, {two : 2}]; - ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); - ok(_.without(list, list[0]).length == 1, 'ditto.'); - }); - - test("uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equal(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equal(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); - - var list = [{name:'moe'}, {name:'curly'}, {name:'larry'}, {name:'curly'}]; - var iterator = function(value) { return value.name; }; - equal(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator'); - - var iterator = function(value) { return value +1; }; - var list = [1, 2, 2, 3, 4, 4]; - equal(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array'); - - var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); - equal(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("intersection", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equal(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equal(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); - equal(result.join(''), 'moe', 'works on an arguments object'); - }); - - test("union", function() { - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); - equal(result.join(' '), '1 2 3 30 40', 'takes the union of a list of arrays'); - - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]); - equal(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); - }); - - test("difference", function() { - var result = _.difference([1, 2, 3], [2, 30, 40]); - equal(result.join(' '), '1 3', 'takes the difference of two arrays'); - - var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); - equal(result.join(' '), '3 4', 'takes the difference of three arrays'); - }); - - test('zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equal(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test('object', function() { - var result = _.object(['moe', 'larry', 'curly'], [30, 40, 50]); - var shouldBe = {moe: 30, larry: 40, curly: 50}; - ok(_.isEqual(result, shouldBe), 'two arrays zipped together into an object'); - - result = _.object([['one', 1], ['two', 2], ['three', 3]]); - shouldBe = {one: 1, two: 2, three: 3}; - ok(_.isEqual(result, shouldBe), 'an array of pairs zipped together into an object'); - - var stooges = {moe: 30, larry: 40, curly: 50}; - ok(_.isEqual(_.object(_.pairs(stooges)), stooges), 'an object converted to pairs and back to an object'); - - ok(_.isEqual(_.object(null), {}), 'handles nulls'); - }); - - test("indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equal(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equal(result, 1, 'works on an arguments object'); - equal(_.indexOf(null, 2), -1, 'handles nulls properly'); - - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.indexOf(numbers, num, true); - equal(index, -1, '35 is not in the list'); - - numbers = [10, 20, 30, 40, 50]; num = 40; - index = _.indexOf(numbers, num, true); - equal(index, 3, '40 is in the list'); - - numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40; - index = _.indexOf(numbers, num, true); - equal(index, 1, '40 is in the list'); - - numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; - index = _.indexOf(numbers, 2, 5); - equal(index, 7, 'supports the fromIndex argument'); - }); - - test("lastIndexOf", function() { - var numbers = [1, 0, 1]; - equal(_.lastIndexOf(numbers, 1), 2); - - numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equal(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equal(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equal(result, 5, 'works on an arguments object'); - equal(_.indexOf(null, 2), -1, 'handles nulls properly'); - - numbers = [1, 2, 3, 1, 2, 3, 1, 2, 3]; - index = _.lastIndexOf(numbers, 2, 2); - equal(index, 1, 'supports the fromIndex argument'); - }); - - test("range", function() { - equal(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equal(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equal(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a<b generates an array of elements a,a+1,a+2,...,b-2,b-1'); - equal(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); - equal(_.range(3, 10, 3).join(' '), '3 6 9', 'range with three arguments a & b & c, c < b-a, a < b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) < c'); - equal(_.range(3, 10, 15).join(''), '3', 'range with three arguments a & b & c, c > b-a, a < b generates an array with a single element, equal to a'); - equal(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); - equal(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); - }); - -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 16cf7bf..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("map/flatten/reduce", function() { - var lyrics = [ - "I'm a lumberjack and I'm okay", - "I sleep all night and I work all day", - "He's a lumberjack and he's okay", - "He sleeps all night and he works all day" - ]; - var counts = _(lyrics).chain() - .map(function(line) { return line.split(''); }) - .flatten() - .reduce(function(hash, l) { - hash[l] = hash[l] || 0; - hash[l]++; - return hash; - }, {}).value(); - ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); - }); - - test("select/reject/sortBy", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _(numbers).chain().select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("select/reject/sortBy in functional style", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _.chain(numbers).select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equal(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("reverse/concat/unshift/pop/map", function() { - var numbers = [1,2,3,4,5]; - numbers = _(numbers).chain() - .reverse() - .concat([5, 5, 5]) - .unshift(17) - .pop() - .map(function(n){ return n * 2; }) - .value(); - equal(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index e089626..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,426 +0,0 @@ -$(document).ready(function() { - - module("Collections"); - - test("each", function() { - _.each([1, 2, 3], function(num, i) { - equal(num, i + 1, 'each iterators provide value and iteration count'); - }); - - var answers = []; - _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); - equal(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equal(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); - - answers = []; - var obj = {one : 1, two : 2, three : 3}; - obj.constructor.prototype.four = 4; - _.each(obj, function(value, key){ answers.push(key); }); - equal(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); - delete obj.constructor.prototype.four; - - answer = null; - _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); - ok(answer, 'can reference the original collection from inside the iterator'); - - answers = 0; - _.each(null, function(){ ++answers; }); - equal(answers, 0, 'handles a null properly'); - }); - - test('map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equal(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equal(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - if (document.querySelectorAll) { - var ids = _.map(document.querySelectorAll('#map-test *'), function(n){ return n.id; }); - deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on NodeLists.'); - } - - var ids = _.map($('#map-test').children(), function(n){ return n.id; }); - deepEqual(ids, ['id1', 'id2'], 'Can use collection methods on jQuery Array-likes.'); - - var ids = _.map(document.images, function(n){ return n.id; }); - ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); - - var ifnull = _.map(null, function(){}); - ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly'); - }); - - test('reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'can sum up an array'); - - var context = {multiplier : 3}; - sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); - equal(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equal(sum, 6, 'OO-style reduce'); - - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); - equal(sum, 6, 'default initial value'); - - var ifnull; - try { - _.reduce(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - ok(_.reduce(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - equal(_.reduce([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduce([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - }); - - test('reduceRight', function() { - var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equal(list, 'bazbarfoo', 'can perform right folds'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equal(list, 'bazbarfoo', 'aliased as "foldr"'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); - equal(list, 'bazbarfoo', 'default initial value'); - - var ifnull; - try { - _.reduceRight(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - var sum = _.reduceRight({a: 1, b: 2, c: 3}, function(sum, num){ return sum + num; }); - equal(sum, 6, 'default initial value on object'); - - ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - - equal(_.reduceRight([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduceRight([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - - // Assert that the correct arguments are being passed. - - var args, - memo = {}, - object = {a: 1, b: 2}, - lastKey = _.keys(object).pop(); - - var expected = lastKey == 'a' - ? [memo, 1, 'a', object] - : [memo, 2, 'b', object]; - - _.reduceRight(object, function() { - args || (args = _.toArray(arguments)); - }, memo); - - deepEqual(args, expected); - - // And again, with numeric keys. - - object = {'2': 'a', '1': 'b'}; - lastKey = _.keys(object).pop(); - args = null; - - expected = lastKey == '2' - ? [memo, 'a', '2', object] - : [memo, 'b', '1', object]; - - _.reduceRight(object, function() { - args || (args = _.toArray(arguments)); - }, memo); - - deepEqual(args, expected); - }); - - test('find', function() { - var array = [1, 2, 3, 4]; - strictEqual(_.find(array, function(n) { return n > 2; }), 3, 'should return first found `value`'); - strictEqual(_.find(array, function() { return false; }), void 0, 'should return `undefined` if `value` is not found'); - }); - - test('detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equal(result, 2, 'found the first "2" and broke the loop'); - }); - - test('select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equal(odds.join(', '), '1, 3, 5', 'rejected each even number'); - - var context = "obj"; - - var evens = _.reject([1, 2, 3, 4, 5, 6], function(num){ - equal(context, "obj"); - return num % 2 != 0; - }, context); - equal(evens.join(', '), '2, 4, 6', 'rejected each odd number'); - }); - - test('all', function() { - ok(_.all([], _.identity), 'the empty set'); - ok(_.all([true, true, true], _.identity), 'all true values'); - ok(!_.all([true, false, true], _.identity), 'one false value'); - ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); - ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); - ok(_.all([1], _.identity) === true, 'cast to boolean - true'); - ok(_.all([0], _.identity) === false, 'cast to boolean - false'); - ok(_.every([true, true, true], _.identity), 'aliased as "every"'); - ok(!_.all([undefined, undefined, undefined], _.identity), 'works with arrays of undefined'); - }); - - test('any', function() { - var nativeSome = Array.prototype.some; - Array.prototype.some = null; - ok(!_.any([]), 'the empty set'); - ok(!_.any([false, false, false]), 'all false values'); - ok(_.any([false, false, true]), 'one true value'); - ok(_.any([null, 0, 'yes', false]), 'a string'); - ok(!_.any([null, 0, '', false]), 'falsy values'); - ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); - ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); - ok(_.any([1], _.identity) === true, 'cast to boolean - true'); - ok(_.any([0], _.identity) === false, 'cast to boolean - false'); - ok(_.some([false, false, true]), 'aliased as "some"'); - Array.prototype.some = nativeSome; - }); - - test('include', function() { - ok(_.include([1,2,3], 2), 'two is in the array'); - ok(!_.include([1,3,9], 2), 'two is not in the array'); - ok(_.contains({moe:1, larry:3, curly:9}, 3) === true, '_.include on objects checks their values'); - ok(_([1,2,3]).include(2), 'OO-style include'); - }); - - test('invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('invoke w/ function reference', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, Array.prototype.sort); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - // Relevant when using ClojureScript - test('invoke when strings have a call method', function() { - String.prototype.call = function() { - return 42; - }; - var list = [[5, 1, 7], [3, 2, 1]]; - var s = "foo"; - equal(s.call(), 42, "call function exists"); - var result = _.invoke(list, 'sort'); - equal(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equal(result[1].join(', '), '1, 2, 3', 'second array sorted'); - delete String.prototype.call; - equal(s.call, undefined, "call function removed"); - }); - - test('pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('where', function() { - var list = [{a: 1, b: 2}, {a: 2, b: 2}, {a: 1, b: 3}, {a: 1, b: 4}]; - var result = _.where(list, {a: 1}); - equal(result.length, 3); - equal(result[result.length - 1].b, 4); - result = _.where(list, {b: 2}); - equal(result.length, 2); - equal(result[0].a, 1); - }); - - test('max', function() { - equal(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equal(neg, 1, 'can perform a computation-based max'); - - equal(-Infinity, _.max({}), 'Maximum value of an empty object'); - equal(-Infinity, _.max([]), 'Maximum value of an empty array'); - - equal(299999, _.max(_.range(1,300000)), "Maximum value of a too-big array"); - }); - - test('min', function() { - equal(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equal(neg, 3, 'can perform a computation-based min'); - - equal(Infinity, _.min({}), 'Minimum value of an empty object'); - equal(Infinity, _.min([]), 'Minimum value of an empty array'); - - var now = new Date(9999999999); - var then = new Date(0); - equal(_.min([now, then]), then); - - equal(1, _.min(_.range(1,300000)), "Minimum value of a too-big array"); - }); - - test('sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equal(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - - var list = [undefined, 4, 1, undefined, 3, 2]; - equal(_.sortBy(list, _.identity).join(','), '1,2,3,4,,', 'sortBy with undefined values'); - - var list = ["one", "two", "three", "four", "five"]; - var sorted = _.sortBy(list, 'length'); - equal(sorted.join(' '), 'one two four five three', 'sorted by length'); - - function Pair(x, y) { - this.x = x; - this.y = y; - } - - var collection = [ - new Pair(1, 1), new Pair(1, 2), - new Pair(1, 3), new Pair(1, 4), - new Pair(1, 5), new Pair(1, 6), - new Pair(2, 1), new Pair(2, 2), - new Pair(2, 3), new Pair(2, 4), - new Pair(2, 5), new Pair(2, 6), - new Pair(undefined, 1), new Pair(undefined, 2), - new Pair(undefined, 3), new Pair(undefined, 4), - new Pair(undefined, 5), new Pair(undefined, 6) - ]; - - var actual = _.sortBy(collection, function(pair) { - return pair.x; - }); - - deepEqual(actual, collection, 'sortBy should be stable'); - }); - - test('groupBy', function() { - var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; }); - ok('0' in parity && '1' in parity, 'created a group for each value'); - equal(parity[0].join(', '), '2, 4, 6', 'put each even number in the right group'); - - var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; - var grouped = _.groupBy(list, 'length'); - equal(grouped['3'].join(' '), 'one two six ten'); - equal(grouped['4'].join(' '), 'four five nine'); - equal(grouped['5'].join(' '), 'three seven eight'); - - var context = {}; - _.groupBy([{}], function(){ ok(this === context); }, context); - - grouped = _.groupBy([4.2, 6.1, 6.4], function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; - }); - equal(grouped.constructor.length, 1); - equal(grouped.hasOwnProperty.length, 2); - - var array = [{}]; - _.groupBy(array, function(value, index, obj){ ok(obj === array); }); - }); - - test('countBy', function() { - var parity = _.countBy([1, 2, 3, 4, 5], function(num){ return num % 2 == 0; }); - equal(parity['true'], 2); - equal(parity['false'], 3); - - var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; - var grouped = _.countBy(list, 'length'); - equal(grouped['3'], 4); - equal(grouped['4'], 3); - equal(grouped['5'], 3); - - var context = {}; - _.countBy([{}], function(){ ok(this === context); }, context); - - grouped = _.countBy([4.2, 6.1, 6.4], function(num) { - return Math.floor(num) > 4 ? 'hasOwnProperty' : 'constructor'; - }); - equal(grouped.constructor, 1); - equal(grouped.hasOwnProperty, 2); - - var array = [{}]; - _.countBy(array, function(value, index, obj){ ok(obj === array); }); - }); - - test('sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var indexForNum = _.sortedIndex(numbers, num); - equal(indexForNum, 3, '35 should be inserted at index 3'); - - var indexFor30 = _.sortedIndex(numbers, 30); - equal(indexFor30, 2, '30 should be inserted at index 2'); - - var objects = [{x: 10}, {x: 20}, {x: 30}, {x: 40}]; - var iterator = function(obj){ return obj.x; }; - strictEqual(_.sortedIndex(objects, {x: 25}, iterator), 2); - strictEqual(_.sortedIndex(objects, {x: 35}, 'x'), 3); - - var context = {1: 2, 2: 3, 3: 4}; - iterator = function(obj){ return this[obj]; }; - strictEqual(_.sortedIndex([1, 3], 2, iterator, context), 1); - }); - - test('shuffle', function() { - var numbers = _.range(10); - var shuffled = _.shuffle(numbers).sort(); - notStrictEqual(numbers, shuffled, 'original object is unmodified'); - equal(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); - }); - - test('toArray', function() { - ok(!_.isArray(arguments), 'arguments object is not an array'); - ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); - var a = [1,2,3]; - ok(_.toArray(a) !== a, 'array is cloned'); - equal(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equal(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('size', function() { - equal(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - equal(_.size([1, 2, 3]), 3, 'can compute the size of an array'); - - var func = function() { - return _.size(arguments); - }; - - equal(func(1, 2, 3, 4), 4, 'can test the size of the arguments object'); - - equal(_.size('hello'), 5, 'can compute the size of a string'); - - equal(_.size(null), 0, 'handles nulls'); - }); - -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index a529658..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,259 +0,0 @@ -$(document).ready(function() { - - module("Functions"); - - test("bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equal(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equal(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equal(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equal(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equal(func(), 'hello: curly', 'the function was completely applied in advance'); - - var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; }; - func = _.bind(func, this, 'hello', 'moe', 'curly'); - equal(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); - - func = function(context, message) { equal(this, context, message); }; - _.bind(func, 0, 0, 'can bind a function to `0`')(); - _.bind(func, '', '', 'can bind a function to an empty string')(); - _.bind(func, false, false, 'can bind a function to `false`')(); - - // These tests are only meaningful when using a browser without a native bind function - // To test this with a modern browser, set underscore's nativeBind to undefined - var F = function () { return this; }; - var Boundf = _.bind(F, {hello: "moe curly"}); - equal(new Boundf().hello, undefined, "function should not be bound to the context, to comply with ECMAScript 5"); - equal(Boundf().hello, "moe curly", "When called without the new operator, it's OK to be bound to the context"); - }); - - test("bindAll", function() { - var curly = {name : 'curly'}, moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - curly.getName = moe.getName; - _.bindAll(moe, 'getName', 'sayHi'); - curly.sayHi = moe.sayHi; - equal(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equal(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); - - curly = {name : 'curly'}; - moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - _.bindAll(moe); - curly.sayHi = moe.sayHi; - equal(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equal(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equal(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - - var o = function(str) { - return str; - }; - var fastO = _.memoize(o); - equal(o('toString'), 'toString', 'checks hasOwnProperty'); - equal(fastO('toString'), 'toString', 'checks hasOwnProperty'); - }); - - asyncTest("delay", 2, function() { - var delayed = false; - _.delay(function(){ delayed = true; }, 100); - setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); - setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150); - }); - - asyncTest("defer", 1, function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - asyncTest("throttle", 2, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); throttledIncr(); - setTimeout(throttledIncr, 70); - setTimeout(throttledIncr, 120); - setTimeout(throttledIncr, 140); - setTimeout(throttledIncr, 190); - setTimeout(throttledIncr, 220); - setTimeout(throttledIncr, 240); - _.delay(function(){ equal(counter, 1, "incr was called immediately"); }, 30); - _.delay(function(){ equal(counter, 4, "incr was throttled"); start(); }, 400); - }); - - asyncTest("throttle arguments", 2, function() { - var value = 0; - var update = function(val){ value = val; }; - var throttledUpdate = _.throttle(update, 100); - throttledUpdate(1); throttledUpdate(2); throttledUpdate(3); - setTimeout(function(){ throttledUpdate(4); }, 120); - setTimeout(function(){ throttledUpdate(5); }, 140); - setTimeout(function(){ throttledUpdate(6); }, 250); - _.delay(function(){ equal(value, 1, "updated to latest value"); }, 40); - _.delay(function(){ equal(value, 6, "updated to latest value"); start(); }, 400); - }); - - asyncTest("throttle once", 2, function() { - var counter = 0; - var incr = function(){ return ++counter; }; - var throttledIncr = _.throttle(incr, 100); - var result = throttledIncr(); - _.delay(function(){ - equal(result, 1, "throttled functions return their value"); - equal(counter, 1, "incr was called once"); start(); - }, 220); - }); - - asyncTest("throttle twice", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); - _.delay(function(){ equal(counter, 2, "incr was called twice"); start(); }, 220); - }); - - asyncTest("throttle repeatedly with results", 9, function() { - var counter = 0; - var incr = function(){ return ++counter; }; - var throttledIncr = _.throttle(incr, 100); - var results = []; - var saveResult = function() { results.push(throttledIncr()); }; - saveResult(); saveResult(); saveResult(); - setTimeout(saveResult, 70); - setTimeout(saveResult, 120); - setTimeout(saveResult, 140); - setTimeout(saveResult, 190); - setTimeout(saveResult, 240); - setTimeout(saveResult, 260); - _.delay(function() { - equal(results[0], 1, "incr was called once"); - equal(results[1], 1, "incr was throttled"); - equal(results[2], 1, "incr was throttled"); - equal(results[3], 1, "incr was throttled"); - equal(results[4], 2, "incr was called twice"); - equal(results[5], 2, "incr was throttled"); - equal(results[6], 2, "incr was throttled"); - equal(results[7], 3, "incr was called thrice"); - equal(results[8], 3, "incr was throttled"); - start(); - }, 400); - }); - - asyncTest("debounce", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var debouncedIncr = _.debounce(incr, 50); - debouncedIncr(); debouncedIncr(); debouncedIncr(); - setTimeout(debouncedIncr, 30); - setTimeout(debouncedIncr, 60); - setTimeout(debouncedIncr, 90); - setTimeout(debouncedIncr, 120); - setTimeout(debouncedIncr, 150); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); - }); - - asyncTest("debounce asap", 5, function() { - var a, b, c; - var counter = 0; - var incr = function(){ return ++counter; }; - var debouncedIncr = _.debounce(incr, 50, true); - a = debouncedIncr(); - b = debouncedIncr(); - c = debouncedIncr(); - equal(a, 1); - equal(b, 1); - equal(c, 1); - equal(counter, 1, 'incr was called immediately'); - setTimeout(debouncedIncr, 30); - setTimeout(debouncedIncr, 60); - setTimeout(debouncedIncr, 90); - setTimeout(debouncedIncr, 120); - setTimeout(debouncedIncr, 150); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 220); - }); - - asyncTest("debounce asap recursively", 2, function() { - var counter = 0; - var debouncedIncr = _.debounce(function(){ - counter++; - if (counter < 5) debouncedIncr(); - }, 50, true); - debouncedIncr(); - equal(counter, 1, 'incr was called immediately'); - _.delay(function(){ equal(counter, 1, "incr was debounced"); start(); }, 70); - }); - - test("once", function() { - var num = 0; - var increment = _.once(function(){ num++; }); - increment(); - increment(); - equal(num, 1); - }); - - test("wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equal(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); - - var inner = function(){ return "Hello "; }; - var obj = {name : "Moe"}; - obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; }); - equal(obj.hi(), "Hello Moe"); - - var noop = function(){}; - var wrapped = _.wrap(noop, function(fn){ return Array.prototype.slice.call(arguments, 0); }); - var ret = wrapped(['whats', 'your'], 'vector', 'victor'); - deepEqual(ret, [noop, ['whats', 'your'], 'vector', 'victor']); - }); - - test("compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equal(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equal(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - - test("after", function() { - var testAfter = function(afterAmount, timesCalled) { - var afterCalled = 0; - var after = _.after(afterAmount, function() { - afterCalled++; - }); - while (timesCalled--) after(); - return afterCalled; - }; - - equal(testAfter(5, 5), 1, "after(N) should fire after being called N times"); - equal(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); - equal(testAfter(0, 0), 1, "after(0) should fire immediately"); - }); - -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html deleted file mode 100644 index 064fa98..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - - -
        -
        -
        -
        -
        -
        -
        -
        -

        Underscore Speed Suite

        -

        - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

        - For example, the 'intersection' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

        -
        - - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 22949c3..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,548 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("keys", function() { - equal(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); - // the test above is not safe because it relies on for-in enumeration order - var a = []; a[1] = 0; - equal(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, TypeError, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, TypeError, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, TypeError, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, TypeError, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, TypeError, 'throws an error for boolean primitives'); - }); - - test("values", function() { - equal(_.values({one: 1, two: 2}).join(', '), '1, 2', 'can extract the values from an object'); - equal(_.values({one: 1, two: 2, length: 3}).join(', '), '1, 2, 3', '... even when one of them is "length"'); - }); - - test("pairs", function() { - deepEqual(_.pairs({one: 1, two: 2}), [['one', 1], ['two', 2]], 'can convert an object into pairs'); - deepEqual(_.pairs({one: 1, two: 2, length: 3}), [['one', 1], ['two', 2], ['length', 3]], '... even when one of them is "length"'); - }); - - test("invert", function() { - var obj = {first: 'Moe', second: 'Larry', third: 'Curly'}; - equal(_.keys(_.invert(obj)).join(' '), 'Moe Larry Curly', 'can invert an object'); - ok(_.isEqual(_.invert(_.invert(obj)), obj), 'two inverts gets you back where you started'); - - var obj = {length: 3}; - ok(_.invert(obj)['3'] == 'length', 'can invert an object with "length"') - }); - - test("functions", function() { - var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; - ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); - - var Animal = function(){}; - Animal.prototype.run = function(){}; - equal(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("extend", function() { - var result; - equal(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equal(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equal(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); - result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); - ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); - result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); - ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); - result = _.extend({}, {a: void 0, b: null}); - equal(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("pick", function() { - var result; - result = _.pick({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {a:1, c:3}), 'can restrict properties to those named'); - result = _.pick({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {b:2, c:3}), 'can restrict properties to those named in an array'); - result = _.pick({a:1, b:2, c:3}, ['a'], 'b'); - ok(_.isEqual(result, {a:1, b:2}), 'can restrict properties to those named in mixed args'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.pick(new Obj, 'a', 'c'), {a:1, c: 3}), 'include prototype props'); - }); - - test("omit", function() { - var result; - result = _.omit({a:1, b:2, c:3}, 'b'); - ok(_.isEqual(result, {a:1, c:3}), 'can omit a single named property'); - result = _.omit({a:1, b:2, c:3}, 'a', 'c'); - ok(_.isEqual(result, {b:2}), 'can omit several named properties'); - result = _.omit({a:1, b:2, c:3}, ['b', 'c']); - ok(_.isEqual(result, {a:1}), 'can omit properties named in an array'); - - var Obj = function(){}; - Obj.prototype = {a: 1, b: 2, c: 3}; - ok(_.isEqual(_.omit(new Obj, 'b'), {a:1, c: 3}), 'include prototype props'); - }); - - test("defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equal(options.zero, 0, 'value exists'); - equal(options.one, 1, 'value exists'); - equal(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equal(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equal(options.word, "word", 'new value is added, first one wins'); - }); - - test("clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equal(clone.name, 'moe', 'the clone as the attributes of the original'); - - clone.name = 'curly'; - ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); - - clone.lucky.push(101); - equal(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equal(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equal(_.clone(1), 1, 'non objects should not be changed by clone'); - equal(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("isEqual", function() { - function First() { - this.value = 1; - } - First.prototype.value = 1; - function Second() { - this.value = 1; - } - Second.prototype.value = 2; - - // Basic equality and identity comparisons. - ok(_.isEqual(null, null), "`null` is equal to `null`"); - ok(_.isEqual(), "`undefined` is equal to `undefined`"); - - ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); - ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); - ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); - ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); - - // String object and primitive comparisons. - ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); - ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); - ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); - ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); - - ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); - ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); - ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); - - // Number object and primitive comparisons. - ok(_.isEqual(75, 75), "Identical number primitives are equal"); - ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); - ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); - ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); - ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); - - ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); - ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); - - // Comparisons involving `NaN`. - ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); - ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); - ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); - ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); - - // Boolean object and primitive comparisons. - ok(_.isEqual(true, true), "Identical boolean primitives are equal"); - ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); - ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); - ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); - - // Common type coercions. - ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); - ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); - ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); - ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); - ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); - ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); - ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); - ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); - ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); - - // Dates. - ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); - ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); - ok(!_.isEqual(new Date(2009, 11, 13), { - getTime: function(){ - return 12606876e5; - } - }), "Date objects and objects with a `getTime` method are not equal"); - ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); - - // Functions. - ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); - - // RegExps. - ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); - ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); - ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); - ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); - ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); - - // Empty arrays, array-like objects, and object literals. - ok(_.isEqual({}, {}), "Empty object literals are equal"); - ok(_.isEqual([], []), "Empty array literals are equal"); - ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); - ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); - ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); - - ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); - ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); - - // Arrays with primitive and object values. - ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); - ok(_.isEqual([(/Moe/g), new Date(2009, 9, 25)], [(/Moe/g), new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); - - // Multi-dimensional arrays. - var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); - - // Overwrite the methods defined in ES 5.1 section 15.4.4. - a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; - b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; - - // Array elements and properties. - ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); - a.push("White Rocks"); - ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); - a.push("East Boulder"); - b.push("Gunbarrel Ranch", "Teller Farm"); - ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); - - // Sparse arrays. - ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); - ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); - - // Simple objects. - ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); - ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); - ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); - ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); - ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); - - // `A` contains nested objects and arrays. - a = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - - // `B` contains equivalent nested objects and arrays. - b = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); - - // Instances. - ok(_.isEqual(new First, new First), "Object instances are equal"); - ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); - ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); - ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); - - // Circular Arrays. - (a = []).push(a); - (b = []).push(b); - ok(_.isEqual(a, b), "Arrays containing circular references are equal"); - a.push(new String("Larry")); - b.push(new String("Larry")); - ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); - a.push("Shemp"); - b.push("Curly"); - ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); - - // More circular arrays #767. - a = ["everything is checked but", "this", "is not"]; - a[1] = a; - b = ["everything is checked but", ["this", "array"], "is not"]; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular references are not equal"); - - // Circular Objects. - a = {abc: null}; - b = {abc: null}; - a.abc = a; - b.abc = b; - ok(_.isEqual(a, b), "Objects containing circular references are equal"); - a.def = 75; - b.def = 75; - ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); - a.def = new Number(75); - b.def = new Number(63); - ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); - - // More circular objects #767. - a = {everything: "is checked", but: "this", is: "not"}; - a.but = a; - b = {everything: "is checked", but: {that:"object"}, is: "not"}; - ok(!_.isEqual(a, b), "Comparison of circular references with non-circular object references are not equal"); - - // Cyclic Structures. - a = [{abc: null}]; - b = [{abc: null}]; - (a[0].abc = a).push(a); - (b[0].abc = b).push(b); - ok(_.isEqual(a, b), "Cyclic structures are equal"); - a[0].def = "Larry"; - b[0].def = "Larry"; - ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); - a[0].def = new String("Larry"); - b[0].def = new String("Curly"); - ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); - - // Complex Circular References. - a = {foo: {b: {foo: {c: {foo: null}}}}}; - b = {foo: {b: {foo: {c: {foo: null}}}}}; - a.foo.b.foo.c.foo = a; - b.foo.b.foo.c.foo = b; - ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); - - // Chaining. - ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); - equal(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); - - // Custom `isEqual` methods. - var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; - var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; - - ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); - ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); - ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); - ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); - - // Objects from another frame. - ok(_.isEqual({}, iObject)); - }); - - test("isEmpty", function() { - ok(!_([1]).isEmpty(), '[1] is not empty'); - ok(_.isEmpty([]), '[] is empty'); - ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); - ok(_.isEmpty({}), '{} is empty'); - ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); - ok(_.isEmpty(null), 'null is empty'); - ok(_.isEmpty(), 'undefined is empty'); - ok(_.isEmpty(''), 'the empty string is empty'); - ok(!_.isEmpty('moe'), 'but other strings are not'); - - var obj = {one : 1}; - delete obj.one; - ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); - }); - - // Setup remote variables for iFrame tests. - var iframe = document.createElement('iframe'); - jQuery(iframe).appendTo(document.body); - var iDoc = iframe.contentDocument || iframe.contentWindow.document; - iDoc.write( - "" - ); - iDoc.close(); - - test("isElement", function() { - ok(!_.isElement('div'), 'strings are not dom elements'); - ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); - ok(_.isElement(iElement), 'even from another frame'); - }); - - test("isArguments", function() { - var args = (function(){ return arguments; })(1, 2, 3); - ok(!_.isArguments('string'), 'a string is not an arguments object'); - ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); - ok(_.isArguments(args), 'but the arguments object is an arguments object'); - ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); - ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); - ok(_.isArguments(iArguments), 'even from another frame'); - }); - - test("isObject", function() { - ok(_.isObject(arguments), 'the arguments object is object'); - ok(_.isObject([1, 2, 3]), 'and arrays'); - ok(_.isObject($('html')[0]), 'and DOM element'); - ok(_.isObject(iElement), 'even from another frame'); - ok(_.isObject(function () {}), 'and functions'); - ok(_.isObject(iFunction), 'even from another frame'); - ok(!_.isObject(null), 'but not null'); - ok(!_.isObject(undefined), 'and not undefined'); - ok(!_.isObject('string'), 'and not string'); - ok(!_.isObject(12), 'and not number'); - ok(!_.isObject(true), 'and not boolean'); - ok(_.isObject(new String('string')), 'but new String()'); - }); - - test("isArray", function() { - ok(!_.isArray(arguments), 'the arguments object is not an array'); - ok(_.isArray([1, 2, 3]), 'but arrays are'); - ok(_.isArray(iArray), 'even from another frame'); - }); - - test("isString", function() { - ok(!_.isString(document.body), 'the document body is not a string'); - ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); - ok(_.isString(iString), 'even from another frame'); - }); - - test("isNumber", function() { - ok(!_.isNumber('string'), 'a string is not a number'); - ok(!_.isNumber(arguments), 'the arguments object is not a number'); - ok(!_.isNumber(undefined), 'undefined is not a number'); - ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); - ok(_.isNumber(NaN), 'NaN *is* a number'); - ok(_.isNumber(Infinity), 'Infinity is a number'); - ok(_.isNumber(iNumber), 'even from another frame'); - ok(!_.isNumber('1'), 'numeric strings are not numbers'); - }); - - test("isBoolean", function() { - ok(!_.isBoolean(2), 'a number is not a boolean'); - ok(!_.isBoolean("string"), 'a string is not a boolean'); - ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); - ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); - ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); - ok(!_.isBoolean(undefined), 'undefined is not a boolean'); - ok(!_.isBoolean(NaN), 'NaN is not a boolean'); - ok(!_.isBoolean(null), 'null is not a boolean'); - ok(_.isBoolean(true), 'but true is'); - ok(_.isBoolean(false), 'and so is false'); - ok(_.isBoolean(iBoolean), 'even from another frame'); - }); - - test("isFunction", function() { - ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); - ok(!_.isFunction('moe'), 'strings are not functions'); - ok(_.isFunction(_.isFunction), 'but functions are'); - ok(_.isFunction(iFunction), 'even from another frame'); - }); - - test("isDate", function() { - ok(!_.isDate(100), 'numbers are not dates'); - ok(!_.isDate({}), 'objects are not dates'); - ok(_.isDate(new Date()), 'but dates are'); - ok(_.isDate(iDate), 'even from another frame'); - }); - - test("isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("isFinite", function() { - ok(!_.isFinite(undefined), 'undefined is not Finite'); - ok(!_.isFinite(null), 'null is not Finite'); - ok(!_.isFinite(NaN), 'NaN is not Finite'); - ok(!_.isFinite(Infinity), 'Infinity is not Finite'); - ok(!_.isFinite(-Infinity), '-Infinity is not Finite'); - ok(!_.isFinite('12'), 'Strings are not numbers'); - var obj = new Number(5); - ok(_.isFinite(obj), 'Number instances can be finite'); - ok(_.isFinite(0), '0 is Finite'); - ok(_.isFinite(123), 'Ints are Finite'); - ok(_.isFinite(-12.44), 'Floats are Finite'); - }); - - test("isNaN", function() { - ok(!_.isNaN(undefined), 'undefined is not NaN'); - ok(!_.isNaN(null), 'null is not NaN'); - ok(!_.isNaN(0), '0 is not NaN'); - ok(_.isNaN(NaN), 'but NaN is'); - ok(_.isNaN(iNaN), 'even from another frame'); - ok(_.isNaN(new Number(NaN)), 'wrapped NaN is still NaN'); - }); - - test("isNull", function() { - ok(!_.isNull(undefined), 'undefined is not null'); - ok(!_.isNull(NaN), 'NaN is not null'); - ok(_.isNull(null), 'but null is'); - ok(_.isNull(iNull), 'even from another frame'); - }); - - test("isUndefined", function() { - ok(!_.isUndefined(1), 'numbers are defined'); - ok(!_.isUndefined(null), 'null is defined'); - ok(!_.isUndefined(false), 'false is defined'); - ok(!_.isUndefined(NaN), 'NaN is defined'); - ok(_.isUndefined(), 'nothing is undefined'); - ok(_.isUndefined(undefined), 'undefined is undefined'); - ok(_.isUndefined(iUndefined), 'even from another frame'); - }); - - if (window.ActiveXObject) { - test("IE host objects", function() { - var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); - ok(!_.isNumber(xml)); - ok(!_.isBoolean(xml)); - ok(!_.isNaN(xml)); - ok(!_.isFunction(xml)); - ok(!_.isNull(xml)); - ok(!_.isUndefined(xml)); - }); - } - - test("tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equal(intercepted, 1, "passes tapped object to interceptor"); - equal(returned, 1, "returns tapped object"); - - returned = _([1,2,3]).chain(). - map(function(n){ return n * 2; }). - max(). - tap(interceptor). - value(); - ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); - }); -}); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 05e3f2a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,75 +0,0 @@ -(function() { - - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - var deep = _.map(_.range(100), function() { return _.range(1000); }); - - JSLitmus.test('_.each()', function() { - var timesTwo = []; - _.each(numbers, function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('_(list).each()', function() { - var timesTwo = []; - _(numbers).each(function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('jQuery.each()', function() { - var timesTwo = []; - jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); - return timesTwo; - }); - - JSLitmus.test('_.map()', function() { - return _.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('jQuery.map()', function() { - return jQuery.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('_.pluck()', function() { - return _.pluck(objects, 'num'); - }); - - JSLitmus.test('_.uniq()', function() { - return _.uniq(randomized); - }); - - JSLitmus.test('_.uniq() (sorted)', function() { - return _.uniq(numbers, true); - }); - - JSLitmus.test('_.sortBy()', function() { - return _.sortBy(numbers, function(num){ return -num; }); - }); - - JSLitmus.test('_.isEqual()', function() { - return _.isEqual(numbers, randomized); - }); - - JSLitmus.test('_.keys()', function() { - return _.keys(objects); - }); - - JSLitmus.test('_.values()', function() { - return _.values(objects); - }); - - JSLitmus.test('_.intersection()', function() { - return _.intersection(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - - JSLitmus.test('_.flatten()', function() { - return _.flatten(deep); - }); - -})(); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index c9be20a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,249 +0,0 @@ -$(document).ready(function() { - - var templateSettings; - - module("Utility", { - - setup: function() { - templateSettings = _.clone(_.templateSettings); - }, - - teardown: function() { - _.templateSettings = templateSettings; - } - - }); - - test("#750 - Return _ instance.", 2, function() { - var instance = _([]); - ok(_(instance) === instance); - ok(new _(instance) === instance); - }); - - test("identity", function() { - var moe = {name : 'moe'}; - equal(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equal(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("times", function() { - var vals = []; - _.times(3, function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); - // - vals = []; - _(3).times(function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); - }); - - test("mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equal(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equal(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("_.escape", function() { - equal(_.escape("Curly & Moe"), "Curly & Moe"); - equal(_.escape("Curly & Moe"), "Curly &amp; Moe"); - equal(_.escape(null), ''); - }); - - test("_.unescape", function() { - var string = "Curly & Moe"; - equal(_.unescape("Curly & Moe"), string); - equal(_.unescape("Curly &amp; Moe"), "Curly & Moe"); - equal(_.unescape(null), ''); - equal(_.unescape(_.escape(string)), string); - }); - - test("template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equal(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equal(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equal(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equal(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); - - var fancyTemplate = _.template("
          <% \ - for (key in people) { \ - %>
        • <%= people[key] %>
        • <% } %>
        "); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equal(result, "
        • Moe
        • Larry
        • Curly
        ", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template("
          <% _.each(numbers.split('\\n'), function(item) { %>
        • <%= item %>
        • <% }) %>
        "); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equal(result, "
        • one
        • two
        • three
        • four
        ", 'Can use escaped characters (e.g. \\n) in Javascript'); - - var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
        \">
        <% }); %>"); - result = namespaceCollisionTemplate({ - pageCount: 3, - thumbnails: { - 1: "p1-thumbnail.gif", - 2: "p2-thumbnail.gif", - 3: "p3-thumbnail.gif" - } - }); - equal(result, "3 p3-thumbnail.gif
        "); - - var noInterpolateTemplate = _.template("

        Just some text. Hey, I know this is silly but it aids consistency.

        "); - result = noInterpolateTemplate(); - equal(result, "

        Just some text. Hey, I know this is silly but it aids consistency.

        "); - - var quoteTemplate = _.template("It's its, not it's"); - equal(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equal(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equal(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: " - - - diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json deleted file mode 100644 index 014ab26..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://underscorejs.org", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.4.4", - "devDependencies": { - "phantomjs": "0.2.2" - }, - "scripts": { - "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true" - }, - "readme": " __\n /\\ \\ __\n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____\n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\\n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/\n \\ \\____/\n \\/___/\n\nUnderscore.js is a utility-belt library for JavaScript that provides\nsupport for the usual functional suspects (each, map, reduce, filter...)\nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://underscorejs.org\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/documentcloud/underscore/issues" - }, - "_id": "underscore@1.4.4", - "_from": "underscore@~1.4.3" -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js deleted file mode 100644 index c1d9d3a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.indexi;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js deleted file mode 100644 index a12f0d9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1226 +0,0 @@ -// Underscore.js 1.4.4 -// http://underscorejs.org -// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore may be freely distributed under the MIT license. - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var push = ArrayProto.push, - slice = ArrayProto.slice, - concat = ArrayProto.concat, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { - if (obj instanceof _) return obj; - if (!(this instanceof _)) return new _(obj); - this._wrapped = obj; - }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root._ = _; - } - - // Current version. - _.VERSION = '1.4.4'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - return results; - }; - - var reduceError = 'Reduce of empty array with no initial value'; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var length = obj.length; - if (length !== +length) { - var keys = _.keys(obj); - length = keys.length; - } - each(obj, function(value, index, list) { - index = keys ? keys[--length] : --length; - if (!initial) { - memo = obj[index]; - initial = true; - } else { - memo = iterator.call(context, memo, obj[index], index, list); - } - }); - if (!initial) throw new TypeError(reduceError); - return memo; - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - return _.filter(obj, function(value, index, list) { - return !iterator.call(context, value, index, list); - }, context); - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if the array or object contains a given value (using `===`). - // Aliased as `include`. - _.contains = _.include = function(obj, target) { - if (obj == null) return false; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - return any(obj, function(value) { - return value === target; - }); - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - var isFunc = _.isFunction(method); - return _.map(obj, function(value) { - return (isFunc ? method : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Convenience version of a common use case of `filter`: selecting only objects - // containing specific `key:value` pairs. - _.where = function(obj, attrs, first) { - if (_.isEmpty(attrs)) return first ? null : []; - return _[first ? 'find' : 'filter'](obj, function(value) { - for (var key in attrs) { - if (attrs[key] !== value[key]) return false; - } - return true; - }); - }; - - // Convenience version of a common use case of `find`: getting the first object - // containing specific `key:value` pairs. - _.findWhere = function(obj, attrs) { - return _.where(obj, attrs, true); - }; - - // Return the maximum element or (element-based computation). - // Can't optimize arrays of integers longer than 65,535 elements. - // See: https://bugs.webkit.org/show_bug.cgi?id=80797 - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.max.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity, value: -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { - return Math.min.apply(Math, obj); - } - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity, value: Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var rand; - var index = 0; - var shuffled = []; - each(obj, function(value) { - rand = _.random(index++); - shuffled[index - 1] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // An internal function to generate lookup iterators. - var lookupIterator = function(value) { - return _.isFunction(value) ? value : function(obj){ return obj[value]; }; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, value, context) { - var iterator = lookupIterator(value); - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - index : index, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria; - var b = right.criteria; - if (a !== b) { - if (a > b || a === void 0) return 1; - if (a < b || b === void 0) return -1; - } - return left.index < right.index ? -1 : 1; - }), 'value'); - }; - - // An internal function used for aggregate "group by" operations. - var group = function(obj, value, context, behavior) { - var result = {}; - var iterator = lookupIterator(value || _.identity); - each(obj, function(value, index) { - var key = iterator.call(context, value, index, obj); - behavior(result, key, value); - }); - return result; - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, value, context) { - return group(obj, value, context, function(result, key, value) { - (_.has(result, key) ? result[key] : (result[key] = [])).push(value); - }); - }; - - // Counts instances of an object that group by a certain criterion. Pass - // either a string attribute to count by, or a function that returns the - // criterion. - _.countBy = function(obj, value, context) { - return group(obj, value, context, function(result, key) { - if (!_.has(result, key)) result[key] = 0; - result[key]++; - }); - }; - - // Use a comparator function to figure out the smallest index at which - // an object should be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator, context) { - iterator = iterator == null ? _.identity : lookupIterator(iterator); - var value = iterator.call(context, obj); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >>> 1; - iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (obj.length === +obj.length) return _.map(obj, _.identity); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - if (obj == null) return 0; - return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - if (array == null) return void 0; - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especially useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if (array == null) return void 0; - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. - // Especially useful on the arguments object. Passing an **n** will return - // the rest N values in the array. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = _.drop = function(array, n, guard) { - return slice.call(array, (n == null) || guard ? 1 : n); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, _.identity); - }; - - // Internal implementation of a recursive `flatten` function. - var flatten = function(input, shallow, output) { - each(input, function(value) { - if (_.isArray(value)) { - shallow ? push.apply(output, value) : flatten(value, shallow, output); - } else { - output.push(value); - } - }); - return output; - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return flatten(array, shallow, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator, context) { - if (_.isFunction(isSorted)) { - context = iterator; - iterator = isSorted; - isSorted = false; - } - var initial = iterator ? _.map(array, iterator, context) : array; - var results = []; - var seen = []; - each(initial, function(value, index) { - if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { - seen.push(value); - results.push(array[index]); - } - }); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(concat.apply(ArrayProto, arguments)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. - _.intersection = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); - return _.filter(array, function(value){ return !_.contains(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) { - results[i] = _.pluck(args, "" + i); - } - return results; - }; - - // Converts lists into objects. Pass either a single array of `[key, value]` - // pairs, or two parallel arrays of the same length -- one of keys, and one of - // the corresponding values. - _.object = function(list, values) { - if (list == null) return {}; - var result = {}; - for (var i = 0, l = list.length; i < l; i++) { - if (values) { - result[list[i]] = values[i]; - } else { - result[list[i][0]] = list[i][1]; - } - } - return result; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i = 0, l = array.length; - if (isSorted) { - if (typeof isSorted == 'number') { - i = (isSorted < 0 ? Math.max(0, l + isSorted) : isSorted); - } else { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); - for (; i < l; i++) if (array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item, from) { - if (array == null) return -1; - var hasIndex = from != null; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { - return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); - } - var i = (hasIndex ? from : array.length); - while (i--) if (array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if - // available. - _.bind = function(func, context) { - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - var args = slice.call(arguments, 2); - return function() { - return func.apply(context, args.concat(slice.call(arguments))); - }; - }; - - // Partially apply a function by creating a version that has had some of its - // arguments pre-filled, without changing its dynamic `this` context. - _.partial = function(func) { - var args = slice.call(arguments, 1); - return function() { - return func.apply(this, args.concat(slice.call(arguments))); - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length === 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, result; - var previous = 0; - var later = function() { - previous = new Date; - timeout = null; - result = func.apply(context, args); - }; - return function() { - var now = new Date; - var remaining = wait - (now - previous); - context = this; - args = arguments; - if (remaining <= 0) { - clearTimeout(timeout); - timeout = null; - previous = now; - result = func.apply(context, args); - } else if (!timeout) { - timeout = setTimeout(later, remaining); - } - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout, result; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) result = func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) result = func.apply(context, args); - return result; - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - memo = func.apply(this, arguments); - func = null; - return memo; - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { - return func.apply(this, arguments); - } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - var values = []; - for (var key in obj) if (_.has(obj, key)) values.push(obj[key]); - return values; - }; - - // Convert an object into a list of `[key, value]` pairs. - _.pairs = function(obj) { - var pairs = []; - for (var key in obj) if (_.has(obj, key)) pairs.push([key, obj[key]]); - return pairs; - }; - - // Invert the keys and values of an object. The values must be serializable. - _.invert = function(obj) { - var result = {}; - for (var key in obj) if (_.has(obj, key)) result[obj[key]] = key; - return result; - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - each(keys, function(key) { - if (key in obj) copy[key] = obj[key]; - }); - return copy; - }; - - // Return a copy of the object without the blacklisted properties. - _.omit = function(obj) { - var copy = {}; - var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); - for (var key in obj) { - if (!_.contains(keys, key)) copy[key] = obj[key]; - } - return copy; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - if (source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function for `isEqual`. - var eq = function(a, b, aStack, bStack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a instanceof _) a = a._wrapped; - if (b instanceof _) b = b._wrapped; - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = aStack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (aStack[length] == a) return bStack[length] == b; - } - // Add the first object to the stack of traversed objects. - aStack.push(a); - bStack.push(b); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - if (!(result = eq(a[size], b[size], aStack, bStack))) break; - } - } - } else { - // Objects with different constructors are not equivalent, but `Object`s - // from different frames are. - var aCtor = a.constructor, bCtor = b.constructor; - if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && - _.isFunction(bCtor) && (bCtor instanceof bCtor))) { - return false; - } - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - aStack.pop(); - bStack.pop(); - return result; - }; - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, [], []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType === 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. - each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { - _['is' + name] = function(obj) { - return toString.call(obj) == '[object ' + name + ']'; - }; - }); - - // Define a fallback version of the method in browsers (ahem, IE), where - // there isn't any inspectable "Arguments" type. - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Optimize `isFunction` if appropriate. - if (typeof (/./) !== 'function') { - _.isFunction = function(obj) { - return typeof obj === 'function'; - }; - } - - // Is a given object a finite number? - _.isFinite = function(obj) { - return isFinite(obj) && !isNaN(parseFloat(obj)); - }; - - // Is the given value `NaN`? (NaN is the only number which does not equal itself). - _.isNaN = function(obj) { - return _.isNumber(obj) && obj != +obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Shortcut function for checking if an object has a given property directly - // on itself (in other words, not on a prototype). - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function(n, iterator, context) { - var accum = Array(n); - for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); - return accum; - }; - - // Return a random integer between min and max (inclusive). - _.random = function(min, max) { - if (max == null) { - max = min; - min = 0; - } - return min + Math.floor(Math.random() * (max - min + 1)); - }; - - // List of HTML entities for escaping. - var entityMap = { - escape: { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '/': '/' - } - }; - entityMap.unescape = _.invert(entityMap.escape); - - // Regexes containing the keys and values listed immediately above. - var entityRegexes = { - escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), - unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - _.each(['escape', 'unescape'], function(method) { - _[method] = function(string) { - if (string == null) return ''; - return ('' + string).replace(entityRegexes[method], function(match) { - return entityMap[method][match]; - }); - }; - }); - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - var func = _[name] = obj[name]; - _.prototype[name] = function() { - var args = [this._wrapped]; - push.apply(args, arguments); - return result.call(this, func.apply(_, args)); - }; - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = ++idCounter + ''; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /(.)^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - "'": "'", - '\\': '\\', - '\r': 'r', - '\n': 'n', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - var render; - settings = _.defaults({}, settings, _.templateSettings); - - // Combine delimiters into one regular expression via alternation. - var matcher = new RegExp([ - (settings.escape || noMatch).source, - (settings.interpolate || noMatch).source, - (settings.evaluate || noMatch).source - ].join('|') + '|$', 'g'); - - // Compile the template source, escaping string literals appropriately. - var index = 0; - var source = "__p+='"; - text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { - source += text.slice(index, offset) - .replace(escaper, function(match) { return '\\' + escapes[match]; }); - - if (escape) { - source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; - } - if (interpolate) { - source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; - } - if (evaluate) { - source += "';\n" + evaluate + "\n__p+='"; - } - index = offset + match.length; - return match; - }); - source += "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __t,__p='',__j=Array.prototype.join," + - "print=function(){__p+=__j.call(arguments,'');};\n" + - source + "return __p;\n"; - - try { - render = new Function(settings.variable || 'obj', '_', source); - } catch (e) { - e.source = source; - throw e; - } - - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // OOP - // --------------- - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - - // Helper function to continue chaining intermediate results. - var result = function(obj) { - return this._chain ? _(obj).chain() : obj; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - var obj = this._wrapped; - method.apply(obj, arguments); - if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; - return result.call(this, obj); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - _.prototype[name] = function() { - return result.call(this, method.apply(this._wrapped, arguments)); - }; - }); - - _.extend(_.prototype, { - - // Start chaining a wrapped Underscore object. - chain: function() { - this._chain = true; - return this; - }, - - // Extracts the result from a wrapped and chained object. - value: function() { - return this._wrapped; - } - - }); - -}).call(this); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json deleted file mode 100644 index 09382f8..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "argparse", - "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", - "version": "0.1.15", - "keywords": [ - "cli", - "parser", - "argparse", - "option", - "args" - ], - "homepage": "https://github.com/nodeca/argparse", - "contributors": [ - { - "name": "Eugene Shkuropat" - }, - { - "name": "Paul Jacobson" - } - ], - "bugs": { - "url": "https://github.com/nodeca/argparse/issues" - }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/argparse/blob/master/LICENSE" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodeca/argparse.git" - }, - "main": "./index.js", - "scripts": { - "test": "make test" - }, - "dependencies": { - "underscore": "~1.4.3", - "underscore.string": "~2.3.1" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "argparse\n========\n\n[![Build Status](https://secure.travis-ci.org/nodeca/argparse.png?branch=master)](http://travis-ci.org/nodeca/argparse)\n\nCLI arguments parser for node.js. Javascript port of python's\n[argparse](http://docs.python.org/dev/library/argparse.html) module\n(original version 3.2). That's a full port, except some very rare options,\nrecorded in issue tracker.\n\n**NB.** Method names changed to camelCase. See [generated docs](http://nodeca.github.com/argparse/).\n\n\nExample\n=======\n\ntest.js file:\n\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse example'\n});\nparser.addArgument(\n [ '-f', '--foo' ],\n {\n help: 'foo bar'\n }\n);\nparser.addArgument(\n [ '-b', '--bar' ],\n {\n help: 'bar foo'\n }\n);\nvar args = parser.parseArgs();\nconsole.dir(args);\n```\n\nDisplay help:\n\n```\n$ ./test.js -h\nusage: example.js [-h] [-v] [-f FOO] [-b BAR]\n\nArgparse example\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -f FOO, --foo FOO foo bar\n -b BAR, --bar BAR bar foo\n```\n\nParse arguments:\n\n```\n$ ./test.js -f=3 --bar=4\n{ foo: '3', bar: '4' }\n```\n\nMore [examples](https://github.com/nodeca/argparse/tree/master/examples).\n\n\nArgumentParser objects\n======================\n\n```\nnew ArgumentParser({paramters hash});\n```\n\nCreates a new ArgumentParser object.\n\n**Supported params:**\n\n- ```description``` - Text to display before the argument help.\n- ```epilog``` - Text to display after the argument help.\n- ```addHelp``` - Add a -h/–help option to the parser. (default: True)\n- ```argumentDefault``` - Set the global default value for arguments. (default: None)\n- ```parents``` - A list of ArgumentParser objects whose arguments should also be included.\n- ```prefixChars``` - The set of characters that prefix optional arguments. (default: ‘-‘)\n- ```formatterClass``` - A class for customizing the help output.\n- ```prog``` - The name of the program (default: sys.argv[0])\n- ```usage``` - The string describing the program usage (default: generated)\n- ```conflictHandler``` - Usually unnecessary, defines strategy for resolving conflicting optionals.\n\n**Not supportied yet**\n\n- ```fromfilePrefixChars``` - The set of characters that prefix files from which additional arguments should be read.\n\n\nDetails in [original ArgumentParser guide](http://docs.python.org/dev/library/argparse.html#argumentparser-objects)\n\n\naddArgument() method\n====================\n\n```\nArgumentParser.addArgument([names or flags], {options})\n```\n\nDefines how a single command-line argument should be parsed.\n\n- ```name or flags``` - Either a name or a list of option strings, e.g. foo or -f, --foo.\n\nOptions:\n\n- ```action``` - The basic type of action to be taken when this argument is encountered at the command line.\n- ```nargs```- The number of command-line arguments that should be consumed.\n- ```constant``` - A constant value required by some action and nargs selections.\n- ```defaultValue``` - The value produced if the argument is absent from the command line.\n- ```type``` - The type to which the command-line argument should be converted.\n- ```choices``` - A container of the allowable values for the argument.\n- ```required``` - Whether or not the command-line option may be omitted (optionals only).\n- ```help``` - A brief description of what the argument does.\n- ```metavar``` - A name for the argument in usage messages.\n- ```dest``` - The name of the attribute to be added to the object returned by parseArgs().\n\nDetails in [original add_argument guide](http://docs.python.org/dev/library/argparse.html#the-add-argument-method)\n\n\nAction (some details)\n================\n\nArgumentParser objects associate command-line arguments with actions.\nThese actions can do just about anything with the command-line arguments associated\nwith them, though most actions simply add an attribute to the object returned by\nparseArgs(). The action keyword argument specifies how the command-line arguments\nshould be handled. The supported actions are:\n\n- ```store``` - Just stores the argument’s value. This is the default action.\n- ```storeConst``` - Stores value, specified by the const keyword argument.\n (Note that the const keyword argument defaults to the rather unhelpful None.)\n The 'storeConst' action is most commonly used with optional arguments, that\n specify some sort of flag.\n- ```storeTrue``` and ```storeFalse``` - Stores values True and False\n respectively. These are special cases of 'storeConst'.\n- ```append``` - Stores a list, and appends each argument value to the list.\n This is useful to allow an option to be specified multiple times.\n- ```appendConst``` - Stores a list, and appends value, specified by the\n const keyword argument to the list. (Note, that the const keyword argument defaults\n is None.) The 'appendConst' action is typically used when multiple arguments need\n to store constants to the same list.\n- ```count``` - Counts the number of times a keyword argument occurs. For example,\n used for increasing verbosity levels.\n- ```help``` - Prints a complete help message for all the options in the current\n parser and then exits. By default a help action is automatically added to the parser.\n See ArgumentParser for details of how the output is created.\n- ```version``` - Prints version information and exit. Expects a `version=`\n keyword argument in the addArgument() call.\n\nDetails in [original action guide](http://docs.python.org/dev/library/argparse.html#action)\n\n\nSub-commands\n============\n\nArgumentParser.addSubparsers()\n\nMany programs split their functionality into a number of sub-commands, for\nexample, the svn program can invoke sub-commands like `svn checkout`, `svn update`,\nand `svn commit`. Splitting up functionality this way can be a particularly good\nidea when a program performs several different functions which require different\nkinds of command-line arguments. `ArgumentParser` supports creation of such\nsub-commands with `addSubparsers()` method. The `addSubparsers()` method is\nnormally called with no arguments and returns an special action object.\nThis object has a single method `addParser()`, which takes a command name and\nany `ArgumentParser` constructor arguments, and returns an `ArgumentParser` object\nthat can be modified as usual.\n\nExample:\n\nsub_commands.js\n```javascript\n#!/usr/bin/env node\n'use strict';\n\nvar ArgumentParser = require('../lib/argparse').ArgumentParser;\nvar parser = new ArgumentParser({\n version: '0.0.1',\n addHelp:true,\n description: 'Argparse examples: sub-commands',\n});\n\nvar subparsers = parser.addSubparsers({\n title:'subcommands',\n dest:\"subcommand_name\"\n});\n\nvar bar = subparsers.addParser('c1', {addHelp:true});\nbar.addArgument(\n [ '-f', '--foo' ],\n {\n action: 'store',\n help: 'foo3 bar3'\n }\n);\nvar bar = subparsers.addParser(\n 'c2',\n {aliases:['co'], addHelp:true}\n);\nbar.addArgument(\n [ '-b', '--bar' ],\n {\n action: 'store',\n type: 'int',\n help: 'foo3 bar3'\n }\n);\n\nvar args = parser.parseArgs();\nconsole.dir(args);\n\n```\n\nDetails in [original sub-commands guide](http://docs.python.org/dev/library/argparse.html#sub-commands)\n\n\nContributors\n============\n\n- [Eugene Shkuropat](https://github.com/shkuropat)\n- [Paul Jacobson](https://github.com/hpaulj)\n\n[others](https://github.com/nodeca/argparse/graphs/contributors)\n\nLicense\n=======\n\nCopyright (c) 2012 [Vitaly Puzrin](https://github.com/puzrin).\nReleased under the MIT license. See\n[LICENSE](https://github.com/nodeca/argparse/blob/master/LICENSE) for details.\n\n\n", - "readmeFilename": "README.md", - "_id": "argparse@0.1.15", - "_from": "argparse@~ 0.1.11" -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md deleted file mode 100644 index a74bd12..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md +++ /dev/null @@ -1,73 +0,0 @@ -**Esprima** ([esprima.org](http://esprima.org)) is a high performance, -standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) -parser written in ECMAScript (also popularly known as -[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)). -Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat), -with the help of [many contributors](https://github.com/ariya/esprima/contributors). - -Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as -[Node.js](http://nodejs.org). - -### Features - -- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262) -- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla -[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) -- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage) -- Optional tracking of syntax node location (index-based and line-column) -- Experimental support for ES6/Harmony (module, class, destructuring, ...) - -Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)). -It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html) -with the new generation of fast parsers. - -### Applications - -Esprima serves as the basis for many popular JavaScript development tools: - -- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul) -- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck) -- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS), -[Sweet.js](http://sweetjs.org/) (macro) -- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr) -- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html)) -- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter), -- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen) - -### Questions? -- [Documentation](http://esprima.org/doc) -- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect) -and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement) -- [Mailing list](http://groups.google.com/group/esprima) -- [Contribution guide](http://esprima.org/doc/index.html#contribution) - -Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the -development updates. -Feedback and contribution are welcomed! - -### License - -Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about) - and other contributors. - -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. - -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 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/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js deleted file mode 100755 index 3e7bb81..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2011 Ariya Hidayat - - 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. - - 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 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. -*/ - -/*jslint sloppy:true node:true rhino:true */ - -var fs, esprima, fname, content, options, syntax; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esparse.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esparse [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --comment Gather all line and block comments in an array'); - console.log(' --loc Include line-column location info for each syntax node'); - console.log(' --range Include index-based range for each syntax node'); - console.log(' --raw Display the raw value of literals'); - console.log(' --tokens List all tokens in an array'); - console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)'); - console.log(' -v, --version Shows program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = {}; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Parser (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry === '--comment') { - options.comment = true; - } else if (entry === '--loc') { - options.loc = true; - } else if (entry === '--range') { - options.range = true; - } else if (entry === '--raw') { - options.raw = true; - } else if (entry === '--tokens') { - options.tokens = true; - } else if (entry === '--tolerant') { - options.tolerant = true; - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else if (typeof fname === 'string') { - console.log('Error: more than one input file.'); - process.exit(1); - } else { - fname = entry; - } -}); - -if (typeof fname !== 'string') { - console.log('Error: no input file.'); - process.exit(1); -} - -try { - content = fs.readFileSync(fname, 'utf-8'); - syntax = esprima.parse(content, options); - console.log(JSON.stringify(syntax, null, 4)); -} catch (e) { - console.log('Error: ' + e.message); - process.exit(1); -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js deleted file mode 100755 index e0af3f7..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +++ /dev/null @@ -1,177 +0,0 @@ -#!/usr/bin/env node -/* - Copyright (C) 2012 Ariya Hidayat - - 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. - - 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 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. -*/ - -/*jslint sloppy:true plusplus:true node:true rhino:true */ - -var fs, esprima, options, fnames, count; - -if (typeof require === 'function') { - fs = require('fs'); - esprima = require('esprima'); -} else if (typeof load === 'function') { - try { - load('esprima.js'); - } catch (e) { - load('../esprima.js'); - } -} - -// Shims to Node.js objects when running under Rhino. -if (typeof console === 'undefined' && typeof process === 'undefined') { - console = { log: print }; - fs = { readFileSync: readFile }; - process = { argv: arguments, exit: quit }; - process.argv.unshift('esvalidate.js'); - process.argv.unshift('rhino'); -} - -function showUsage() { - console.log('Usage:'); - console.log(' esvalidate [options] file.js'); - console.log(); - console.log('Available options:'); - console.log(); - console.log(' --format=type Set the report format, plain (default) or junit'); - console.log(' -v, --version Print program version'); - console.log(); - process.exit(1); -} - -if (process.argv.length <= 2) { - showUsage(); -} - -options = { - format: 'plain' -}; - -fnames = []; - -process.argv.splice(2).forEach(function (entry) { - - if (entry === '-h' || entry === '--help') { - showUsage(); - } else if (entry === '-v' || entry === '--version') { - console.log('ECMAScript Validator (using Esprima version', esprima.version, ')'); - console.log(); - process.exit(0); - } else if (entry.slice(0, 9) === '--format=') { - options.format = entry.slice(9); - if (options.format !== 'plain' && options.format !== 'junit') { - console.log('Error: unknown report format ' + options.format + '.'); - process.exit(1); - } - } else if (entry.slice(0, 2) === '--') { - console.log('Error: unknown option ' + entry + '.'); - process.exit(1); - } else { - fnames.push(entry); - } -}); - -if (fnames.length === 0) { - console.log('Error: no input file.'); - process.exit(1); -} - -if (options.format === 'junit') { - console.log(''); - console.log(''); -} - -count = 0; -fnames.forEach(function (fname) { - var content, timestamp, syntax, name; - try { - content = fs.readFileSync(fname, 'utf-8'); - - if (content[0] === '#' && content[1] === '!') { - content = '//' + content.substr(2, content.length); - } - - timestamp = Date.now(); - syntax = esprima.parse(content, { tolerant: true }); - - if (options.format === 'junit') { - - name = fname; - if (name.lastIndexOf('/') >= 0) { - name = name.slice(name.lastIndexOf('/') + 1); - } - - console.log(''); - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - console.log(' '); - console.log(' ' + - error.message + '(' + name + ':' + error.lineNumber + ')' + - ''); - console.log(' '); - }); - - console.log(''); - - } else if (options.format === 'plain') { - - syntax.errors.forEach(function (error) { - var msg = error.message; - msg = msg.replace(/^Line\ [0-9]*\:\ /, ''); - msg = fname + ':' + error.lineNumber + ': ' + msg; - console.log(msg); - ++count; - }); - - } - } catch (e) { - ++count; - if (options.format === 'junit') { - console.log(''); - console.log(' '); - console.log(' ' + - e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') + - ')'); - console.log(' '); - console.log(''); - } else { - console.log('Error: ' + e.message); - } - } -}); - -if (options.format === 'junit') { - console.log(''); -} - -if (count > 0) { - process.exit(1); -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js deleted file mode 100644 index f1320da..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js +++ /dev/null @@ -1,3908 +0,0 @@ -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Mathias Bynens - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Kris Kowal - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - - 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. - - 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 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. -*/ - -/*jslint bitwise:true plusplus:true */ -/*global esprima:true, define:true, exports:true, window: true, -throwError: true, createLiteral: true, generateStatement: true, -parseAssignmentExpression: true, parseBlock: true, parseExpression: true, -parseFunctionDeclaration: true, parseFunctionExpression: true, -parseFunctionSourceElements: true, parseVariableIdentifier: true, -parseLeftHandSideExpression: true, -parseStatement: true, parseSourceElement: true */ - -(function (root, factory) { - 'use strict'; - - // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, - // Rhino, and plain browser loading. - if (typeof define === 'function' && define.amd) { - define(['exports'], factory); - } else if (typeof exports !== 'undefined') { - factory(exports); - } else { - factory((root.esprima = {})); - } -}(this, function (exports) { - 'use strict'; - - var Token, - TokenName, - Syntax, - PropertyKind, - Messages, - Regex, - source, - strict, - index, - lineNumber, - lineStart, - length, - buffer, - state, - extra; - - Token = { - BooleanLiteral: 1, - EOF: 2, - Identifier: 3, - Keyword: 4, - NullLiteral: 5, - NumericLiteral: 6, - Punctuator: 7, - StringLiteral: 8 - }; - - TokenName = {}; - TokenName[Token.BooleanLiteral] = 'Boolean'; - TokenName[Token.EOF] = ''; - TokenName[Token.Identifier] = 'Identifier'; - TokenName[Token.Keyword] = 'Keyword'; - TokenName[Token.NullLiteral] = 'Null'; - TokenName[Token.NumericLiteral] = 'Numeric'; - TokenName[Token.Punctuator] = 'Punctuator'; - TokenName[Token.StringLiteral] = 'String'; - - Syntax = { - AssignmentExpression: 'AssignmentExpression', - ArrayExpression: 'ArrayExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - Program: 'Program', - Property: 'Property', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' - }; - - PropertyKind = { - Data: 1, - Get: 2, - Set: 4 - }; - - // Error messages should be identical to V8. - Messages = { - UnexpectedToken: 'Unexpected token %0', - UnexpectedNumber: 'Unexpected number', - UnexpectedString: 'Unexpected string', - UnexpectedIdentifier: 'Unexpected identifier', - UnexpectedReserved: 'Unexpected reserved word', - UnexpectedEOS: 'Unexpected end of input', - NewlineAfterThrow: 'Illegal newline after throw', - InvalidRegExp: 'Invalid regular expression', - UnterminatedRegExp: 'Invalid regular expression: missing /', - InvalidLHSInAssignment: 'Invalid left-hand side in assignment', - InvalidLHSInForIn: 'Invalid left-hand side in for-in', - MultipleDefaultsInSwitch: 'More than one default clause in switch statement', - NoCatchOrFinally: 'Missing catch or finally after try', - UnknownLabel: 'Undefined label \'%0\'', - Redeclaration: '%0 \'%1\' has already been declared', - IllegalContinue: 'Illegal continue statement', - IllegalBreak: 'Illegal break statement', - IllegalReturn: 'Illegal return statement', - StrictModeWith: 'Strict mode code may not include a with statement', - StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', - StrictVarName: 'Variable name may not be eval or arguments in strict mode', - StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', - StrictParamDupe: 'Strict mode function may not have duplicate parameter names', - StrictFunctionName: 'Function name may not be eval or arguments in strict mode', - StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', - StrictDelete: 'Delete of an unqualified identifier in strict mode.', - StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode', - AccessorDataProperty: 'Object literal may not have data and accessor property with the same name', - AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name', - StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', - StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', - StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', - StrictReservedWord: 'Use of future reserved word in strict mode' - }; - - // See also tools/generate-unicode-regex.py. - Regex = { - NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\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\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\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\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-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\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-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\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\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\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\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\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]'), - NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\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\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\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\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]') - }; - - // Ensure the condition is true, otherwise throw an error. - // This is only to have a better contract semantic, i.e. another safety net - // to catch a logic error. The condition shall be fulfilled in normal case. - // Do NOT use this to enforce a certain condition on any user input. - - function assert(condition, message) { - if (!condition) { - throw new Error('ASSERT: ' + message); - } - } - - function sliceSource(from, to) { - return source.slice(from, to); - } - - if (typeof 'esprima'[0] === 'undefined') { - sliceSource = function sliceArraySource(from, to) { - return source.slice(from, to).join(''); - }; - } - - function isDecimalDigit(ch) { - return '0123456789'.indexOf(ch) >= 0; - } - - function isHexDigit(ch) { - return '0123456789abcdefABCDEF'.indexOf(ch) >= 0; - } - - function isOctalDigit(ch) { - return '01234567'.indexOf(ch) >= 0; - } - - - // 7.2 White Space - - function isWhiteSpace(ch) { - return (ch === ' ') || (ch === '\u0009') || (ch === '\u000B') || - (ch === '\u000C') || (ch === '\u00A0') || - (ch.charCodeAt(0) >= 0x1680 && - '\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0); - } - - // 7.3 Line Terminators - - function isLineTerminator(ch) { - return (ch === '\n' || ch === '\r' || ch === '\u2028' || ch === '\u2029'); - } - - // 7.6 Identifier Names and Identifiers - - function isIdentifierStart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch)); - } - - function isIdentifierPart(ch) { - return (ch === '$') || (ch === '_') || (ch === '\\') || - (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - ((ch >= '0') && (ch <= '9')) || - ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierPart.test(ch)); - } - - // 7.6.1.2 Future Reserved Words - - function isFutureReservedWord(id) { - switch (id) { - - // Future reserved words. - case 'class': - case 'enum': - case 'export': - case 'extends': - case 'import': - case 'super': - return true; - } - - return false; - } - - function isStrictModeReservedWord(id) { - switch (id) { - - // Strict Mode reserved words. - case 'implements': - case 'interface': - case 'package': - case 'private': - case 'protected': - case 'public': - case 'static': - case 'yield': - case 'let': - return true; - } - - return false; - } - - function isRestrictedWord(id) { - return id === 'eval' || id === 'arguments'; - } - - // 7.6.1.1 Keywords - - function isKeyword(id) { - var keyword = false; - switch (id.length) { - case 2: - keyword = (id === 'if') || (id === 'in') || (id === 'do'); - break; - case 3: - keyword = (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try'); - break; - case 4: - keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with'); - break; - case 5: - keyword = (id === 'while') || (id === 'break') || (id === 'catch') || (id === 'throw'); - break; - case 6: - keyword = (id === 'return') || (id === 'typeof') || (id === 'delete') || (id === 'switch'); - break; - case 7: - keyword = (id === 'default') || (id === 'finally'); - break; - case 8: - keyword = (id === 'function') || (id === 'continue') || (id === 'debugger'); - break; - case 10: - keyword = (id === 'instanceof'); - break; - } - - if (keyword) { - return true; - } - - switch (id) { - // Future reserved words. - // 'const' is specialized as Keyword in V8. - case 'const': - return true; - - // For compatiblity to SpiderMonkey and ES.next - case 'yield': - case 'let': - return true; - } - - if (strict && isStrictModeReservedWord(id)) { - return true; - } - - return isFutureReservedWord(id); - } - - // 7.4 Comments - - function skipComment() { - var ch, blockComment, lineComment; - - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - lineComment = false; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - ++index; - blockComment = false; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - index += 2; - lineComment = true; - } else if (ch === '*') { - index += 2; - blockComment = true; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function scanHexEscape(prefix) { - var i, len, ch, code = 0; - - len = (prefix === 'u') ? 4 : 2; - for (i = 0; i < len; ++i) { - if (index < length && isHexDigit(source[index])) { - ch = source[index++]; - code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); - } else { - return ''; - } - } - return String.fromCharCode(code); - } - - function scanIdentifier() { - var ch, start, id, restore; - - ch = source[index]; - if (!isIdentifierStart(ch)) { - return; - } - - start = index; - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; - } - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierStart(ch)) { - return; - } - id = ch; - } else { - index = restore; - id = 'u'; - } - } else { - id = source[index++]; - } - - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch)) { - break; - } - if (ch === '\\') { - ++index; - if (source[index] !== 'u') { - return; - } - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - if (ch === '\\' || !isIdentifierPart(ch)) { - return; - } - id += ch; - } else { - index = restore; - id += 'u'; - } - } else { - id += source[index++]; - } - } - - // There is no keyword or literal with only one character. - // Thus, it must be an identifier. - if (id.length === 1) { - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (isKeyword(id)) { - return { - type: Token.Keyword, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.1 Null Literals - - if (id === 'null') { - return { - type: Token.NullLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.2 Boolean Literals - - if (id === 'true' || id === 'false') { - return { - type: Token.BooleanLiteral, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - return { - type: Token.Identifier, - value: id, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.7 Punctuators - - function scanPunctuator() { - var start = index, - ch1 = source[index], - ch2, - ch3, - ch4; - - // Check for most common single-character punctuators. - - if (ch1 === ';' || ch1 === '{' || ch1 === '}') { - ++index; - return { - type: Token.Punctuator, - value: ch1, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === ',' || ch1 === '(' || ch1 === ')') { - ++index; - return { - type: Token.Punctuator, - value: ch1, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // Dot (.) can also start a floating-point number, hence the need - // to check the next character. - - ch2 = source[index + 1]; - if (ch1 === '.' && !isDecimalDigit(ch2)) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // Peek more characters. - - ch3 = source[index + 2]; - ch4 = source[index + 3]; - - // 4-character punctuator: >>>= - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - if (ch4 === '=') { - index += 4; - return { - type: Token.Punctuator, - value: '>>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 3-character punctuators: === !== >>> <<= >>= - - if (ch1 === '=' && ch2 === '=' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '===', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '!' && ch2 === '=' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '!==', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '>' && ch2 === '>' && ch3 === '>') { - index += 3; - return { - type: Token.Punctuator, - value: '>>>', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '<' && ch2 === '<' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '<<=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - if (ch1 === '>' && ch2 === '>' && ch3 === '=') { - index += 3; - return { - type: Token.Punctuator, - value: '>>=', - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 2-character punctuators: <= >= == != ++ -- << >> && || - // += -= *= %= &= |= ^= /= - - if (ch2 === '=') { - if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - if (ch1 === ch2 && ('+-<>&|'.indexOf(ch1) >= 0)) { - if ('+-<>&|'.indexOf(ch2) >= 0) { - index += 2; - return { - type: Token.Punctuator, - value: ch1 + ch2, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // The remaining 1-character punctuators. - - if ('[]<>+-*%&|^!~?:=/'.indexOf(ch1) >= 0) { - return { - type: Token.Punctuator, - value: source[index++], - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - } - - // 7.8.3 Numeric Literals - - function scanNumericLiteral() { - var number, start, ch; - - ch = source[index]; - assert(isDecimalDigit(ch) || (ch === '.'), - 'Numeric literal must start with a decimal digit or a decimal point'); - - start = index; - number = ''; - if (ch !== '.') { - number = source[index++]; - ch = source[index]; - - // Hex number starts with '0x'. - // Octal number starts with '0'. - if (number === '0') { - if (ch === 'x' || ch === 'X') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isHexDigit(ch)) { - break; - } - number += source[index++]; - } - - if (number.length <= 2) { - // only 0x - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 16), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } else if (isOctalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isOctalDigit(ch)) { - break; - } - number += source[index++]; - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch) || isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - return { - type: Token.NumericLiteral, - value: parseInt(number, 8), - octal: true, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // decimal number starts with '0' such as '09' is illegal. - if (isDecimalDigit(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } - - if (ch === '.') { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } - - if (ch === 'e' || ch === 'E') { - number += source[index++]; - - ch = source[index]; - if (ch === '+' || ch === '-') { - number += source[index++]; - } - - ch = source[index]; - if (isDecimalDigit(ch)) { - number += source[index++]; - while (index < length) { - ch = source[index]; - if (!isDecimalDigit(ch)) { - break; - } - number += source[index++]; - } - } else { - ch = 'character ' + ch; - if (index >= length) { - ch = ''; - } - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - if (index < length) { - ch = source[index]; - if (isIdentifierStart(ch)) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } - - return { - type: Token.NumericLiteral, - value: parseFloat(number), - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - // 7.8.4 String Literals - - function scanStringLiteral() { - var str = '', quote, start, ch, code, unescaped, restore, octal = false; - - quote = source[index]; - assert((quote === '\'' || quote === '"'), - 'String literal must starts with a quote'); - - start = index; - ++index; - - while (index < length) { - ch = source[index++]; - - if (ch === quote) { - quote = ''; - break; - } else if (ch === '\\') { - ch = source[index++]; - if (!isLineTerminator(ch)) { - switch (ch) { - case 'n': - str += '\n'; - break; - case 'r': - str += '\r'; - break; - case 't': - str += '\t'; - break; - case 'u': - case 'x': - restore = index; - unescaped = scanHexEscape(ch); - if (unescaped) { - str += unescaped; - } else { - index = restore; - str += ch; - } - break; - case 'b': - str += '\b'; - break; - case 'f': - str += '\f'; - break; - case 'v': - str += '\x0B'; - break; - - default: - if (isOctalDigit(ch)) { - code = '01234567'.indexOf(ch); - - // \0 is not octal escape sequence - if (code !== 0) { - octal = true; - } - - if (index < length && isOctalDigit(source[index])) { - octal = true; - code = code * 8 + '01234567'.indexOf(source[index++]); - - // 3 digits are only allowed when string starts - // with 0, 1, 2, 3 - if ('0123'.indexOf(ch) >= 0 && - index < length && - isOctalDigit(source[index])) { - code = code * 8 + '01234567'.indexOf(source[index++]); - } - } - str += String.fromCharCode(code); - } else { - str += ch; - } - break; - } - } else { - ++lineNumber; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - } - } else if (isLineTerminator(ch)) { - break; - } else { - str += ch; - } - } - - if (quote !== '') { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - return { - type: Token.StringLiteral, - value: str, - octal: octal, - lineNumber: lineNumber, - lineStart: lineStart, - range: [start, index] - }; - } - - function scanRegExp() { - var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false; - - buffer = null; - skipComment(); - - start = index; - ch = source[index]; - assert(ch === '/', 'Regular expression literal must start with a slash'); - str = source[index++]; - - while (index < length) { - ch = source[index++]; - str += ch; - if (ch === '\\') { - ch = source[index++]; - // ECMA-262 7.8.5 - if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); - } - str += ch; - } else if (classMarker) { - if (ch === ']') { - classMarker = false; - } - } else { - if (ch === '/') { - terminated = true; - break; - } else if (ch === '[') { - classMarker = true; - } else if (isLineTerminator(ch)) { - throwError({}, Messages.UnterminatedRegExp); - } - } - } - - if (!terminated) { - throwError({}, Messages.UnterminatedRegExp); - } - - // Exclude leading and trailing slash. - pattern = str.substr(1, str.length - 2); - - flags = ''; - while (index < length) { - ch = source[index]; - if (!isIdentifierPart(ch)) { - break; - } - - ++index; - if (ch === '\\' && index < length) { - ch = source[index]; - if (ch === 'u') { - ++index; - restore = index; - ch = scanHexEscape('u'); - if (ch) { - flags += ch; - str += '\\u'; - for (; restore < index; ++restore) { - str += source[restore]; - } - } else { - index = restore; - flags += 'u'; - str += '\\u'; - } - } else { - str += '\\'; - } - } else { - flags += ch; - str += ch; - } - } - - try { - value = new RegExp(pattern, flags); - } catch (e) { - throwError({}, Messages.InvalidRegExp); - } - - return { - literal: str, - value: value, - range: [start, index] - }; - } - - function isIdentifierName(token) { - return token.type === Token.Identifier || - token.type === Token.Keyword || - token.type === Token.BooleanLiteral || - token.type === Token.NullLiteral; - } - - function advance() { - var ch, token; - - skipComment(); - - if (index >= length) { - return { - type: Token.EOF, - lineNumber: lineNumber, - lineStart: lineStart, - range: [index, index] - }; - } - - token = scanPunctuator(); - if (typeof token !== 'undefined') { - return token; - } - - ch = source[index]; - - if (ch === '\'' || ch === '"') { - return scanStringLiteral(); - } - - if (ch === '.' || isDecimalDigit(ch)) { - return scanNumericLiteral(); - } - - token = scanIdentifier(); - if (typeof token !== 'undefined') { - return token; - } - - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - - function lex() { - var token; - - if (buffer) { - index = buffer.range[1]; - lineNumber = buffer.lineNumber; - lineStart = buffer.lineStart; - token = buffer; - buffer = null; - return token; - } - - buffer = null; - return advance(); - } - - function lookahead() { - var pos, line, start; - - if (buffer !== null) { - return buffer; - } - - pos = index; - line = lineNumber; - start = lineStart; - buffer = advance(); - index = pos; - lineNumber = line; - lineStart = start; - - return buffer; - } - - // Return true if there is a line terminator before the next token. - - function peekLineTerminator() { - var pos, line, start, found; - - pos = index; - line = lineNumber; - start = lineStart; - skipComment(); - found = lineNumber !== line; - index = pos; - lineNumber = line; - lineStart = start; - - return found; - } - - // Throw an exception - - function throwError(token, messageFormat) { - var error, - args = Array.prototype.slice.call(arguments, 2), - msg = messageFormat.replace( - /%(\d)/g, - function (whole, index) { - return args[index] || ''; - } - ); - - if (typeof token.lineNumber === 'number') { - error = new Error('Line ' + token.lineNumber + ': ' + msg); - error.index = token.range[0]; - error.lineNumber = token.lineNumber; - error.column = token.range[0] - lineStart + 1; - } else { - error = new Error('Line ' + lineNumber + ': ' + msg); - error.index = index; - error.lineNumber = lineNumber; - error.column = index - lineStart + 1; - } - - throw error; - } - - function throwErrorTolerant() { - try { - throwError.apply(null, arguments); - } catch (e) { - if (extra.errors) { - extra.errors.push(e); - } else { - throw e; - } - } - } - - - // Throw an exception because of the token. - - function throwUnexpected(token) { - if (token.type === Token.EOF) { - throwError(token, Messages.UnexpectedEOS); - } - - if (token.type === Token.NumericLiteral) { - throwError(token, Messages.UnexpectedNumber); - } - - if (token.type === Token.StringLiteral) { - throwError(token, Messages.UnexpectedString); - } - - if (token.type === Token.Identifier) { - throwError(token, Messages.UnexpectedIdentifier); - } - - if (token.type === Token.Keyword) { - if (isFutureReservedWord(token.value)) { - throwError(token, Messages.UnexpectedReserved); - } else if (strict && isStrictModeReservedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictReservedWord); - return; - } - throwError(token, Messages.UnexpectedToken, token.value); - } - - // BooleanLiteral, NullLiteral, or Punctuator. - throwError(token, Messages.UnexpectedToken, token.value); - } - - // Expect the next token to match the specified punctuator. - // If not, an exception will be thrown. - - function expect(value) { - var token = lex(); - if (token.type !== Token.Punctuator || token.value !== value) { - throwUnexpected(token); - } - } - - // Expect the next token to match the specified keyword. - // If not, an exception will be thrown. - - function expectKeyword(keyword) { - var token = lex(); - if (token.type !== Token.Keyword || token.value !== keyword) { - throwUnexpected(token); - } - } - - // Return true if the next token matches the specified punctuator. - - function match(value) { - var token = lookahead(); - return token.type === Token.Punctuator && token.value === value; - } - - // Return true if the next token matches the specified keyword - - function matchKeyword(keyword) { - var token = lookahead(); - return token.type === Token.Keyword && token.value === keyword; - } - - // Return true if the next token is an assignment operator - - function matchAssign() { - var token = lookahead(), - op = token.value; - - if (token.type !== Token.Punctuator) { - return false; - } - return op === '=' || - op === '*=' || - op === '/=' || - op === '%=' || - op === '+=' || - op === '-=' || - op === '<<=' || - op === '>>=' || - op === '>>>=' || - op === '&=' || - op === '^=' || - op === '|='; - } - - function consumeSemicolon() { - var token, line; - - // Catch the very common case first. - if (source[index] === ';') { - lex(); - return; - } - - line = lineNumber; - skipComment(); - if (lineNumber !== line) { - return; - } - - if (match(';')) { - lex(); - return; - } - - token = lookahead(); - if (token.type !== Token.EOF && !match('}')) { - throwUnexpected(token); - } - } - - // Return true if provided expression is LeftHandSideExpression - - function isLeftHandSide(expr) { - return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression; - } - - // 11.1.4 Array Initialiser - - function parseArrayInitialiser() { - var elements = []; - - expect('['); - - while (!match(']')) { - if (match(',')) { - lex(); - elements.push(null); - } else { - elements.push(parseAssignmentExpression()); - - if (!match(']')) { - expect(','); - } - } - } - - expect(']'); - - return { - type: Syntax.ArrayExpression, - elements: elements - }; - } - - // 11.1.5 Object Initialiser - - function parsePropertyFunction(param, first) { - var previousStrict, body; - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (first && strict && isRestrictedWord(param[0].name)) { - throwErrorTolerant(first, Messages.StrictParamName); - } - strict = previousStrict; - - return { - type: Syntax.FunctionExpression, - id: null, - params: param, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - function parseObjectPropertyKey() { - var token = lex(); - - // Note: This function is called only from parseObjectProperty(), where - // EOF and Punctuator tokens are already filtered out. - - if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseObjectProperty() { - var token, key, id, param; - - token = lookahead(); - - if (token.type === Token.Identifier) { - - id = parseObjectPropertyKey(); - - // Property Assignment: Getter and Setter. - - if (token.value === 'get' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'get' - }; - } else if (token.value === 'set' && !match(':')) { - key = parseObjectPropertyKey(); - expect('('); - token = lookahead(); - if (token.type !== Token.Identifier) { - expect(')'); - throwErrorTolerant(token, Messages.UnexpectedToken, token.value); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction([]), - kind: 'set' - }; - } else { - param = [ parseVariableIdentifier() ]; - expect(')'); - return { - type: Syntax.Property, - key: key, - value: parsePropertyFunction(param, token), - kind: 'set' - }; - } - } else { - expect(':'); - return { - type: Syntax.Property, - key: id, - value: parseAssignmentExpression(), - kind: 'init' - }; - } - } else if (token.type === Token.EOF || token.type === Token.Punctuator) { - throwUnexpected(token); - } else { - key = parseObjectPropertyKey(); - expect(':'); - return { - type: Syntax.Property, - key: key, - value: parseAssignmentExpression(), - kind: 'init' - }; - } - } - - function parseObjectInitialiser() { - var properties = [], property, name, kind, map = {}, toString = String; - - expect('{'); - - while (!match('}')) { - property = parseObjectProperty(); - - if (property.key.type === Syntax.Identifier) { - name = property.key.name; - } else { - name = toString(property.key.value); - } - kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set; - if (Object.prototype.hasOwnProperty.call(map, name)) { - if (map[name] === PropertyKind.Data) { - if (strict && kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.StrictDuplicateProperty); - } else if (kind !== PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } - } else { - if (kind === PropertyKind.Data) { - throwErrorTolerant({}, Messages.AccessorDataProperty); - } else if (map[name] & kind) { - throwErrorTolerant({}, Messages.AccessorGetSet); - } - } - map[name] |= kind; - } else { - map[name] = kind; - } - - properties.push(property); - - if (!match('}')) { - expect(','); - } - } - - expect('}'); - - return { - type: Syntax.ObjectExpression, - properties: properties - }; - } - - // 11.1.6 The Grouping Operator - - function parseGroupExpression() { - var expr; - - expect('('); - - expr = parseExpression(); - - expect(')'); - - return expr; - } - - - // 11.1 Primary Expressions - - function parsePrimaryExpression() { - var token = lookahead(), - type = token.type; - - if (type === Token.Identifier) { - return { - type: Syntax.Identifier, - name: lex().value - }; - } - - if (type === Token.StringLiteral || type === Token.NumericLiteral) { - if (strict && token.octal) { - throwErrorTolerant(token, Messages.StrictOctalLiteral); - } - return createLiteral(lex()); - } - - if (type === Token.Keyword) { - if (matchKeyword('this')) { - lex(); - return { - type: Syntax.ThisExpression - }; - } - - if (matchKeyword('function')) { - return parseFunctionExpression(); - } - } - - if (type === Token.BooleanLiteral) { - lex(); - token.value = (token.value === 'true'); - return createLiteral(token); - } - - if (type === Token.NullLiteral) { - lex(); - token.value = null; - return createLiteral(token); - } - - if (match('[')) { - return parseArrayInitialiser(); - } - - if (match('{')) { - return parseObjectInitialiser(); - } - - if (match('(')) { - return parseGroupExpression(); - } - - if (match('/') || match('/=')) { - return createLiteral(scanRegExp()); - } - - return throwUnexpected(lex()); - } - - // 11.2 Left-Hand-Side Expressions - - function parseArguments() { - var args = []; - - expect('('); - - if (!match(')')) { - while (index < length) { - args.push(parseAssignmentExpression()); - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - return args; - } - - function parseNonComputedProperty() { - var token = lex(); - - if (!isIdentifierName(token)) { - throwUnexpected(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseNonComputedMember() { - expect('.'); - - return parseNonComputedProperty(); - } - - function parseComputedMember() { - var expr; - - expect('['); - - expr = parseExpression(); - - expect(']'); - - return expr; - } - - function parseNewExpression() { - var expr; - - expectKeyword('new'); - - expr = { - type: Syntax.NewExpression, - callee: parseLeftHandSideExpression(), - 'arguments': [] - }; - - if (match('(')) { - expr['arguments'] = parseArguments(); - } - - return expr; - } - - function parseLeftHandSideExpressionAllowCall() { - var expr; - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - } - } - - return expr; - } - - - function parseLeftHandSideExpression() { - var expr; - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - } - } - - return expr; - } - - // 11.3 Postfix Expressions - - function parsePostfixExpression() { - var expr = parseLeftHandSideExpressionAllowCall(), token; - - token = lookahead(); - if (token.type !== Token.Punctuator) { - return expr; - } - - if ((match('++') || match('--')) && !peekLineTerminator()) { - // 11.3.1, 11.3.2 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPostfix); - } - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - expr = { - type: Syntax.UpdateExpression, - operator: lex().value, - argument: expr, - prefix: false - }; - } - - return expr; - } - - // 11.4 Unary Operators - - function parseUnaryExpression() { - var token, expr; - - token = lookahead(); - if (token.type !== Token.Punctuator && token.type !== Token.Keyword) { - return parsePostfixExpression(); - } - - if (match('++') || match('--')) { - token = lex(); - expr = parseUnaryExpression(); - // 11.4.4, 11.4.5 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant({}, Messages.StrictLHSPrefix); - } - - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - expr = { - type: Syntax.UpdateExpression, - operator: token.value, - argument: expr, - prefix: true - }; - return expr; - } - - if (match('+') || match('-') || match('~') || match('!')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - return expr; - } - - if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) { - expr = { - type: Syntax.UnaryExpression, - operator: lex().value, - argument: parseUnaryExpression(), - prefix: true - }; - if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) { - throwErrorTolerant({}, Messages.StrictDelete); - } - return expr; - } - - return parsePostfixExpression(); - } - - // 11.5 Multiplicative Operators - - function parseMultiplicativeExpression() { - var expr = parseUnaryExpression(); - - while (match('*') || match('/') || match('%')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseUnaryExpression() - }; - } - - return expr; - } - - // 11.6 Additive Operators - - function parseAdditiveExpression() { - var expr = parseMultiplicativeExpression(); - - while (match('+') || match('-')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseMultiplicativeExpression() - }; - } - - return expr; - } - - // 11.7 Bitwise Shift Operators - - function parseShiftExpression() { - var expr = parseAdditiveExpression(); - - while (match('<<') || match('>>') || match('>>>')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseAdditiveExpression() - }; - } - - return expr; - } - // 11.8 Relational Operators - - function parseRelationalExpression() { - var expr, previousAllowIn; - - previousAllowIn = state.allowIn; - state.allowIn = true; - - expr = parseShiftExpression(); - - while (match('<') || match('>') || match('<=') || match('>=') || (previousAllowIn && matchKeyword('in')) || matchKeyword('instanceof')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseShiftExpression() - }; - } - - state.allowIn = previousAllowIn; - return expr; - } - - // 11.9 Equality Operators - - function parseEqualityExpression() { - var expr = parseRelationalExpression(); - - while (match('==') || match('!=') || match('===') || match('!==')) { - expr = { - type: Syntax.BinaryExpression, - operator: lex().value, - left: expr, - right: parseRelationalExpression() - }; - } - - return expr; - } - - // 11.10 Binary Bitwise Operators - - function parseBitwiseANDExpression() { - var expr = parseEqualityExpression(); - - while (match('&')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '&', - left: expr, - right: parseEqualityExpression() - }; - } - - return expr; - } - - function parseBitwiseXORExpression() { - var expr = parseBitwiseANDExpression(); - - while (match('^')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '^', - left: expr, - right: parseBitwiseANDExpression() - }; - } - - return expr; - } - - function parseBitwiseORExpression() { - var expr = parseBitwiseXORExpression(); - - while (match('|')) { - lex(); - expr = { - type: Syntax.BinaryExpression, - operator: '|', - left: expr, - right: parseBitwiseXORExpression() - }; - } - - return expr; - } - - // 11.11 Binary Logical Operators - - function parseLogicalANDExpression() { - var expr = parseBitwiseORExpression(); - - while (match('&&')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '&&', - left: expr, - right: parseBitwiseORExpression() - }; - } - - return expr; - } - - function parseLogicalORExpression() { - var expr = parseLogicalANDExpression(); - - while (match('||')) { - lex(); - expr = { - type: Syntax.LogicalExpression, - operator: '||', - left: expr, - right: parseLogicalANDExpression() - }; - } - - return expr; - } - - // 11.12 Conditional Operator - - function parseConditionalExpression() { - var expr, previousAllowIn, consequent; - - expr = parseLogicalORExpression(); - - if (match('?')) { - lex(); - previousAllowIn = state.allowIn; - state.allowIn = true; - consequent = parseAssignmentExpression(); - state.allowIn = previousAllowIn; - expect(':'); - - expr = { - type: Syntax.ConditionalExpression, - test: expr, - consequent: consequent, - alternate: parseAssignmentExpression() - }; - } - - return expr; - } - - // 11.13 Assignment Operators - - function parseAssignmentExpression() { - var token, expr; - - token = lookahead(); - expr = parseConditionalExpression(); - - if (matchAssign()) { - // LeftHandSideExpression - if (!isLeftHandSide(expr)) { - throwErrorTolerant({}, Messages.InvalidLHSInAssignment); - } - - // 11.13.1 - if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) { - throwErrorTolerant(token, Messages.StrictLHSAssignment); - } - - expr = { - type: Syntax.AssignmentExpression, - operator: lex().value, - left: expr, - right: parseAssignmentExpression() - }; - } - - return expr; - } - - // 11.14 Comma Operator - - function parseExpression() { - var expr = parseAssignmentExpression(); - - if (match(',')) { - expr = { - type: Syntax.SequenceExpression, - expressions: [ expr ] - }; - - while (index < length) { - if (!match(',')) { - break; - } - lex(); - expr.expressions.push(parseAssignmentExpression()); - } - - } - return expr; - } - - // 12.1 Block - - function parseStatementList() { - var list = [], - statement; - - while (index < length) { - if (match('}')) { - break; - } - statement = parseSourceElement(); - if (typeof statement === 'undefined') { - break; - } - list.push(statement); - } - - return list; - } - - function parseBlock() { - var block; - - expect('{'); - - block = parseStatementList(); - - expect('}'); - - return { - type: Syntax.BlockStatement, - body: block - }; - } - - // 12.2 Variable Statement - - function parseVariableIdentifier() { - var token = lex(); - - if (token.type !== Token.Identifier) { - throwUnexpected(token); - } - - return { - type: Syntax.Identifier, - name: token.value - }; - } - - function parseVariableDeclaration(kind) { - var id = parseVariableIdentifier(), - init = null; - - // 12.2.1 - if (strict && isRestrictedWord(id.name)) { - throwErrorTolerant({}, Messages.StrictVarName); - } - - if (kind === 'const') { - expect('='); - init = parseAssignmentExpression(); - } else if (match('=')) { - lex(); - init = parseAssignmentExpression(); - } - - return { - type: Syntax.VariableDeclarator, - id: id, - init: init - }; - } - - function parseVariableDeclarationList(kind) { - var list = []; - - do { - list.push(parseVariableDeclaration(kind)); - if (!match(',')) { - break; - } - lex(); - } while (index < length); - - return list; - } - - function parseVariableStatement() { - var declarations; - - expectKeyword('var'); - - declarations = parseVariableDeclarationList(); - - consumeSemicolon(); - - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: 'var' - }; - } - - // kind may be `const` or `let` - // Both are experimental and not in the specification yet. - // see http://wiki.ecmascript.org/doku.php?id=harmony:const - // and http://wiki.ecmascript.org/doku.php?id=harmony:let - function parseConstLetDeclaration(kind) { - var declarations; - - expectKeyword(kind); - - declarations = parseVariableDeclarationList(kind); - - consumeSemicolon(); - - return { - type: Syntax.VariableDeclaration, - declarations: declarations, - kind: kind - }; - } - - // 12.3 Empty Statement - - function parseEmptyStatement() { - expect(';'); - - return { - type: Syntax.EmptyStatement - }; - } - - // 12.4 Expression Statement - - function parseExpressionStatement() { - var expr = parseExpression(); - - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; - } - - // 12.5 If statement - - function parseIfStatement() { - var test, consequent, alternate; - - expectKeyword('if'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - consequent = parseStatement(); - - if (matchKeyword('else')) { - lex(); - alternate = parseStatement(); - } else { - alternate = null; - } - - return { - type: Syntax.IfStatement, - test: test, - consequent: consequent, - alternate: alternate - }; - } - - // 12.6 Iteration Statements - - function parseDoWhileStatement() { - var body, test, oldInIteration; - - expectKeyword('do'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - if (match(';')) { - lex(); - } - - return { - type: Syntax.DoWhileStatement, - body: body, - test: test - }; - } - - function parseWhileStatement() { - var test, body, oldInIteration; - - expectKeyword('while'); - - expect('('); - - test = parseExpression(); - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - return { - type: Syntax.WhileStatement, - test: test, - body: body - }; - } - - function parseForVariableDeclaration() { - var token = lex(); - - return { - type: Syntax.VariableDeclaration, - declarations: parseVariableDeclarationList(), - kind: token.value - }; - } - - function parseForStatement() { - var init, test, update, left, right, body, oldInIteration; - - init = test = update = null; - - expectKeyword('for'); - - expect('('); - - if (match(';')) { - lex(); - } else { - if (matchKeyword('var') || matchKeyword('let')) { - state.allowIn = false; - init = parseForVariableDeclaration(); - state.allowIn = true; - - if (init.declarations.length === 1 && matchKeyword('in')) { - lex(); - left = init; - right = parseExpression(); - init = null; - } - } else { - state.allowIn = false; - init = parseExpression(); - state.allowIn = true; - - if (matchKeyword('in')) { - // LeftHandSideExpression - if (!isLeftHandSide(init)) { - throwErrorTolerant({}, Messages.InvalidLHSInForIn); - } - - lex(); - left = init; - right = parseExpression(); - init = null; - } - } - - if (typeof left === 'undefined') { - expect(';'); - } - } - - if (typeof left === 'undefined') { - - if (!match(';')) { - test = parseExpression(); - } - expect(';'); - - if (!match(')')) { - update = parseExpression(); - } - } - - expect(')'); - - oldInIteration = state.inIteration; - state.inIteration = true; - - body = parseStatement(); - - state.inIteration = oldInIteration; - - if (typeof left === 'undefined') { - return { - type: Syntax.ForStatement, - init: init, - test: test, - update: update, - body: body - }; - } - - return { - type: Syntax.ForInStatement, - left: left, - right: right, - body: body, - each: false - }; - } - - // 12.7 The continue statement - - function parseContinueStatement() { - var token, label = null; - - expectKeyword('continue'); - - // Optimize the most common form: 'continue;'. - if (source[index] === ';') { - lex(); - - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: null - }; - } - - if (peekLineTerminator()) { - if (!state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: null - }; - } - - token = lookahead(); - if (token.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !state.inIteration) { - throwError({}, Messages.IllegalContinue); - } - - return { - type: Syntax.ContinueStatement, - label: label - }; - } - - // 12.8 The break statement - - function parseBreakStatement() { - var token, label = null; - - expectKeyword('break'); - - // Optimize the most common form: 'break;'. - if (source[index] === ';') { - lex(); - - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: null - }; - } - - if (peekLineTerminator()) { - if (!(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: null - }; - } - - token = lookahead(); - if (token.type === Token.Identifier) { - label = parseVariableIdentifier(); - - if (!Object.prototype.hasOwnProperty.call(state.labelSet, label.name)) { - throwError({}, Messages.UnknownLabel, label.name); - } - } - - consumeSemicolon(); - - if (label === null && !(state.inIteration || state.inSwitch)) { - throwError({}, Messages.IllegalBreak); - } - - return { - type: Syntax.BreakStatement, - label: label - }; - } - - // 12.9 The return statement - - function parseReturnStatement() { - var token, argument = null; - - expectKeyword('return'); - - if (!state.inFunctionBody) { - throwErrorTolerant({}, Messages.IllegalReturn); - } - - // 'return' followed by a space and an identifier is very common. - if (source[index] === ' ') { - if (isIdentifierStart(source[index + 1])) { - argument = parseExpression(); - consumeSemicolon(); - return { - type: Syntax.ReturnStatement, - argument: argument - }; - } - } - - if (peekLineTerminator()) { - return { - type: Syntax.ReturnStatement, - argument: null - }; - } - - if (!match(';')) { - token = lookahead(); - if (!match('}') && token.type !== Token.EOF) { - argument = parseExpression(); - } - } - - consumeSemicolon(); - - return { - type: Syntax.ReturnStatement, - argument: argument - }; - } - - // 12.10 The with statement - - function parseWithStatement() { - var object, body; - - if (strict) { - throwErrorTolerant({}, Messages.StrictModeWith); - } - - expectKeyword('with'); - - expect('('); - - object = parseExpression(); - - expect(')'); - - body = parseStatement(); - - return { - type: Syntax.WithStatement, - object: object, - body: body - }; - } - - // 12.10 The swith statement - - function parseSwitchCase() { - var test, - consequent = [], - statement; - - if (matchKeyword('default')) { - lex(); - test = null; - } else { - expectKeyword('case'); - test = parseExpression(); - } - expect(':'); - - while (index < length) { - if (match('}') || matchKeyword('default') || matchKeyword('case')) { - break; - } - statement = parseStatement(); - if (typeof statement === 'undefined') { - break; - } - consequent.push(statement); - } - - return { - type: Syntax.SwitchCase, - test: test, - consequent: consequent - }; - } - - function parseSwitchStatement() { - var discriminant, cases, clause, oldInSwitch, defaultFound; - - expectKeyword('switch'); - - expect('('); - - discriminant = parseExpression(); - - expect(')'); - - expect('{'); - - cases = []; - - if (match('}')) { - lex(); - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; - } - - oldInSwitch = state.inSwitch; - state.inSwitch = true; - defaultFound = false; - - while (index < length) { - if (match('}')) { - break; - } - clause = parseSwitchCase(); - if (clause.test === null) { - if (defaultFound) { - throwError({}, Messages.MultipleDefaultsInSwitch); - } - defaultFound = true; - } - cases.push(clause); - } - - state.inSwitch = oldInSwitch; - - expect('}'); - - return { - type: Syntax.SwitchStatement, - discriminant: discriminant, - cases: cases - }; - } - - // 12.13 The throw statement - - function parseThrowStatement() { - var argument; - - expectKeyword('throw'); - - if (peekLineTerminator()) { - throwError({}, Messages.NewlineAfterThrow); - } - - argument = parseExpression(); - - consumeSemicolon(); - - return { - type: Syntax.ThrowStatement, - argument: argument - }; - } - - // 12.14 The try statement - - function parseCatchClause() { - var param; - - expectKeyword('catch'); - - expect('('); - if (match(')')) { - throwUnexpected(lookahead()); - } - - param = parseVariableIdentifier(); - // 12.14.1 - if (strict && isRestrictedWord(param.name)) { - throwErrorTolerant({}, Messages.StrictCatchVariable); - } - - expect(')'); - - return { - type: Syntax.CatchClause, - param: param, - body: parseBlock() - }; - } - - function parseTryStatement() { - var block, handlers = [], finalizer = null; - - expectKeyword('try'); - - block = parseBlock(); - - if (matchKeyword('catch')) { - handlers.push(parseCatchClause()); - } - - if (matchKeyword('finally')) { - lex(); - finalizer = parseBlock(); - } - - if (handlers.length === 0 && !finalizer) { - throwError({}, Messages.NoCatchOrFinally); - } - - return { - type: Syntax.TryStatement, - block: block, - guardedHandlers: [], - handlers: handlers, - finalizer: finalizer - }; - } - - // 12.15 The debugger statement - - function parseDebuggerStatement() { - expectKeyword('debugger'); - - consumeSemicolon(); - - return { - type: Syntax.DebuggerStatement - }; - } - - // 12 Statements - - function parseStatement() { - var token = lookahead(), - expr, - labeledBody; - - if (token.type === Token.EOF) { - throwUnexpected(token); - } - - if (token.type === Token.Punctuator) { - switch (token.value) { - case ';': - return parseEmptyStatement(); - case '{': - return parseBlock(); - case '(': - return parseExpressionStatement(); - default: - break; - } - } - - if (token.type === Token.Keyword) { - switch (token.value) { - case 'break': - return parseBreakStatement(); - case 'continue': - return parseContinueStatement(); - case 'debugger': - return parseDebuggerStatement(); - case 'do': - return parseDoWhileStatement(); - case 'for': - return parseForStatement(); - case 'function': - return parseFunctionDeclaration(); - case 'if': - return parseIfStatement(); - case 'return': - return parseReturnStatement(); - case 'switch': - return parseSwitchStatement(); - case 'throw': - return parseThrowStatement(); - case 'try': - return parseTryStatement(); - case 'var': - return parseVariableStatement(); - case 'while': - return parseWhileStatement(); - case 'with': - return parseWithStatement(); - default: - break; - } - } - - expr = parseExpression(); - - // 12.12 Labelled Statements - if ((expr.type === Syntax.Identifier) && match(':')) { - lex(); - - if (Object.prototype.hasOwnProperty.call(state.labelSet, expr.name)) { - throwError({}, Messages.Redeclaration, 'Label', expr.name); - } - - state.labelSet[expr.name] = true; - labeledBody = parseStatement(); - delete state.labelSet[expr.name]; - - return { - type: Syntax.LabeledStatement, - label: expr, - body: labeledBody - }; - } - - consumeSemicolon(); - - return { - type: Syntax.ExpressionStatement, - expression: expr - }; - } - - // 13 Function Definition - - function parseFunctionSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted, - oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody; - - expect('{'); - - while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - oldLabelSet = state.labelSet; - oldInIteration = state.inIteration; - oldInSwitch = state.inSwitch; - oldInFunctionBody = state.inFunctionBody; - - state.labelSet = {}; - state.inIteration = false; - state.inSwitch = false; - state.inFunctionBody = true; - - while (index < length) { - if (match('}')) { - break; - } - sourceElement = parseSourceElement(); - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - - expect('}'); - - state.labelSet = oldLabelSet; - state.inIteration = oldInIteration; - state.inSwitch = oldInSwitch; - state.inFunctionBody = oldInFunctionBody; - - return { - type: Syntax.BlockStatement, - body: sourceElements - }; - } - - function parseFunctionDeclaration() { - var id, param, params = [], body, token, stricted, firstRestricted, message, previousStrict, paramSet; - - expectKeyword('function'); - token = lookahead(); - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return { - type: Syntax.FunctionDeclaration, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - function parseFunctionExpression() { - var token, id = null, stricted, firstRestricted, message, param, params = [], body, previousStrict, paramSet; - - expectKeyword('function'); - - if (!match('(')) { - token = lookahead(); - id = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - throwErrorTolerant(token, Messages.StrictFunctionName); - } - } else { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictFunctionName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } - } - } - - expect('('); - - if (!match(')')) { - paramSet = {}; - while (index < length) { - token = lookahead(); - param = parseVariableIdentifier(); - if (strict) { - if (isRestrictedWord(token.value)) { - stricted = token; - message = Messages.StrictParamName; - } - if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - stricted = token; - message = Messages.StrictParamDupe; - } - } else if (!firstRestricted) { - if (isRestrictedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictParamName; - } else if (isStrictModeReservedWord(token.value)) { - firstRestricted = token; - message = Messages.StrictReservedWord; - } else if (Object.prototype.hasOwnProperty.call(paramSet, token.value)) { - firstRestricted = token; - message = Messages.StrictParamDupe; - } - } - params.push(param); - paramSet[param.name] = true; - if (match(')')) { - break; - } - expect(','); - } - } - - expect(')'); - - previousStrict = strict; - body = parseFunctionSourceElements(); - if (strict && firstRestricted) { - throwError(firstRestricted, message); - } - if (strict && stricted) { - throwErrorTolerant(stricted, message); - } - strict = previousStrict; - - return { - type: Syntax.FunctionExpression, - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }; - } - - // 14 Program - - function parseSourceElement() { - var token = lookahead(); - - if (token.type === Token.Keyword) { - switch (token.value) { - case 'const': - case 'let': - return parseConstLetDeclaration(token.value); - case 'function': - return parseFunctionDeclaration(); - default: - return parseStatement(); - } - } - - if (token.type !== Token.EOF) { - return parseStatement(); - } - } - - function parseSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted; - - while (index < length) { - token = lookahead(); - if (token.type !== Token.StringLiteral) { - break; - } - - sourceElement = parseSourceElement(); - sourceElements.push(sourceElement); - if (sourceElement.expression.type !== Syntax.Literal) { - // this is not directive - break; - } - directive = sliceSource(token.range[0] + 1, token.range[1] - 1); - if (directive === 'use strict') { - strict = true; - if (firstRestricted) { - throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral); - } - } else { - if (!firstRestricted && token.octal) { - firstRestricted = token; - } - } - } - - while (index < length) { - sourceElement = parseSourceElement(); - if (typeof sourceElement === 'undefined') { - break; - } - sourceElements.push(sourceElement); - } - return sourceElements; - } - - function parseProgram() { - var program; - strict = false; - program = { - type: Syntax.Program, - body: parseSourceElements() - }; - return program; - } - - // The following functions are needed only when the option to preserve - // the comments is active. - - function addComment(type, value, start, end, loc) { - assert(typeof start === 'number', 'Comment must have valid position'); - - // Because the way the actual token is scanned, often the comments - // (if any) are skipped twice during the lexical analysis. - // Thus, we need to skip adding a comment if the comment array already - // handled it. - if (extra.comments.length > 0) { - if (extra.comments[extra.comments.length - 1].range[1] > start) { - return; - } - } - - extra.comments.push({ - type: type, - value: value, - range: [start, end], - loc: loc - }); - } - - function scanComment() { - var comment, ch, loc, start, blockComment, lineComment; - - comment = ''; - blockComment = false; - lineComment = false; - - while (index < length) { - ch = source[index]; - - if (lineComment) { - ch = source[index++]; - if (isLineTerminator(ch)) { - loc.end = { - line: lineNumber, - column: index - lineStart - 1 - }; - lineComment = false; - addComment('Line', comment, start, index - 1, loc); - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - comment = ''; - } else if (index >= length) { - lineComment = false; - comment += ch; - loc.end = { - line: lineNumber, - column: length - lineStart - }; - addComment('Line', comment, start, length, loc); - } else { - comment += ch; - } - } else if (blockComment) { - if (isLineTerminator(ch)) { - if (ch === '\r' && source[index + 1] === '\n') { - ++index; - comment += '\r\n'; - } else { - comment += ch; - } - ++lineNumber; - ++index; - lineStart = index; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - ch = source[index++]; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - comment += ch; - if (ch === '*') { - ch = source[index]; - if (ch === '/') { - comment = comment.substr(0, comment.length - 1); - blockComment = false; - ++index; - loc.end = { - line: lineNumber, - column: index - lineStart - }; - addComment('Block', comment, start, index, loc); - comment = ''; - } - } - } - } else if (ch === '/') { - ch = source[index + 1]; - if (ch === '/') { - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - start = index; - index += 2; - lineComment = true; - if (index >= length) { - loc.end = { - line: lineNumber, - column: index - lineStart - }; - lineComment = false; - addComment('Line', comment, start, index, loc); - } - } else if (ch === '*') { - start = index; - index += 2; - blockComment = true; - loc = { - start: { - line: lineNumber, - column: index - lineStart - 2 - } - }; - if (index >= length) { - throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); - } - } else { - break; - } - } else if (isWhiteSpace(ch)) { - ++index; - } else if (isLineTerminator(ch)) { - ++index; - if (ch === '\r' && source[index] === '\n') { - ++index; - } - ++lineNumber; - lineStart = index; - } else { - break; - } - } - } - - function filterCommentLocation() { - var i, entry, comment, comments = []; - - for (i = 0; i < extra.comments.length; ++i) { - entry = extra.comments[i]; - comment = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - comment.range = entry.range; - } - if (extra.loc) { - comment.loc = entry.loc; - } - comments.push(comment); - } - - extra.comments = comments; - } - - function collectToken() { - var start, loc, token, range, value; - - skipComment(); - start = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - token = extra.advance(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - if (token.type !== Token.EOF) { - range = [token.range[0], token.range[1]]; - value = sliceSource(token.range[0], token.range[1]); - extra.tokens.push({ - type: TokenName[token.type], - value: value, - range: range, - loc: loc - }); - } - - return token; - } - - function collectRegex() { - var pos, loc, regex, token; - - skipComment(); - - pos = index; - loc = { - start: { - line: lineNumber, - column: index - lineStart - } - }; - - regex = extra.scanRegExp(); - loc.end = { - line: lineNumber, - column: index - lineStart - }; - - // Pop the previous token, which is likely '/' or '/=' - if (extra.tokens.length > 0) { - token = extra.tokens[extra.tokens.length - 1]; - if (token.range[0] === pos && token.type === 'Punctuator') { - if (token.value === '/' || token.value === '/=') { - extra.tokens.pop(); - } - } - } - - extra.tokens.push({ - type: 'RegularExpression', - value: regex.literal, - range: [pos, index], - loc: loc - }); - - return regex; - } - - function filterTokenLocation() { - var i, entry, token, tokens = []; - - for (i = 0; i < extra.tokens.length; ++i) { - entry = extra.tokens[i]; - token = { - type: entry.type, - value: entry.value - }; - if (extra.range) { - token.range = entry.range; - } - if (extra.loc) { - token.loc = entry.loc; - } - tokens.push(token); - } - - extra.tokens = tokens; - } - - function createLiteral(token) { - return { - type: Syntax.Literal, - value: token.value - }; - } - - function createRawLiteral(token) { - return { - type: Syntax.Literal, - value: token.value, - raw: sliceSource(token.range[0], token.range[1]) - }; - } - - function createLocationMarker() { - var marker = {}; - - marker.range = [index, index]; - marker.loc = { - start: { - line: lineNumber, - column: index - lineStart - }, - end: { - line: lineNumber, - column: index - lineStart - } - }; - - marker.end = function () { - this.range[1] = index; - this.loc.end.line = lineNumber; - this.loc.end.column = index - lineStart; - }; - - marker.applyGroup = function (node) { - if (extra.range) { - node.groupRange = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.groupLoc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; - - marker.apply = function (node) { - if (extra.range) { - node.range = [this.range[0], this.range[1]]; - } - if (extra.loc) { - node.loc = { - start: { - line: this.loc.start.line, - column: this.loc.start.column - }, - end: { - line: this.loc.end.line, - column: this.loc.end.column - } - }; - } - }; - - return marker; - } - - function trackGroupExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - expect('('); - - expr = parseExpression(); - - expect(')'); - - marker.end(); - marker.applyGroup(expr); - - return expr; - } - - function trackLeftHandSideExpression() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[')) { - if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } - - function trackLeftHandSideExpressionAllowCall() { - var marker, expr; - - skipComment(); - marker = createLocationMarker(); - - expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression(); - - while (match('.') || match('[') || match('(')) { - if (match('(')) { - expr = { - type: Syntax.CallExpression, - callee: expr, - 'arguments': parseArguments() - }; - marker.end(); - marker.apply(expr); - } else if (match('[')) { - expr = { - type: Syntax.MemberExpression, - computed: true, - object: expr, - property: parseComputedMember() - }; - marker.end(); - marker.apply(expr); - } else { - expr = { - type: Syntax.MemberExpression, - computed: false, - object: expr, - property: parseNonComputedMember() - }; - marker.end(); - marker.apply(expr); - } - } - - return expr; - } - - function filterGroup(node) { - var n, i, entry; - - n = (Object.prototype.toString.apply(node) === '[object Array]') ? [] : {}; - for (i in node) { - if (node.hasOwnProperty(i) && i !== 'groupRange' && i !== 'groupLoc') { - entry = node[i]; - if (entry === null || typeof entry !== 'object' || entry instanceof RegExp) { - n[i] = entry; - } else { - n[i] = filterGroup(entry); - } - } - } - return n; - } - - function wrapTrackingFunction(range, loc) { - - return function (parseFunction) { - - function isBinary(node) { - return node.type === Syntax.LogicalExpression || - node.type === Syntax.BinaryExpression; - } - - function visit(node) { - var start, end; - - if (isBinary(node.left)) { - visit(node.left); - } - if (isBinary(node.right)) { - visit(node.right); - } - - if (range) { - if (node.left.groupRange || node.right.groupRange) { - start = node.left.groupRange ? node.left.groupRange[0] : node.left.range[0]; - end = node.right.groupRange ? node.right.groupRange[1] : node.right.range[1]; - node.range = [start, end]; - } else if (typeof node.range === 'undefined') { - start = node.left.range[0]; - end = node.right.range[1]; - node.range = [start, end]; - } - } - if (loc) { - if (node.left.groupLoc || node.right.groupLoc) { - start = node.left.groupLoc ? node.left.groupLoc.start : node.left.loc.start; - end = node.right.groupLoc ? node.right.groupLoc.end : node.right.loc.end; - node.loc = { - start: start, - end: end - }; - } else if (typeof node.loc === 'undefined') { - node.loc = { - start: node.left.loc.start, - end: node.right.loc.end - }; - } - } - } - - return function () { - var marker, node; - - skipComment(); - - marker = createLocationMarker(); - node = parseFunction.apply(null, arguments); - marker.end(); - - if (range && typeof node.range === 'undefined') { - marker.apply(node); - } - - if (loc && typeof node.loc === 'undefined') { - marker.apply(node); - } - - if (isBinary(node)) { - visit(node); - } - - return node; - }; - }; - } - - function patch() { - - var wrapTracking; - - if (extra.comments) { - extra.skipComment = skipComment; - skipComment = scanComment; - } - - if (extra.raw) { - extra.createLiteral = createLiteral; - createLiteral = createRawLiteral; - } - - if (extra.range || extra.loc) { - - extra.parseGroupExpression = parseGroupExpression; - extra.parseLeftHandSideExpression = parseLeftHandSideExpression; - extra.parseLeftHandSideExpressionAllowCall = parseLeftHandSideExpressionAllowCall; - parseGroupExpression = trackGroupExpression; - parseLeftHandSideExpression = trackLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = trackLeftHandSideExpressionAllowCall; - - wrapTracking = wrapTrackingFunction(extra.range, extra.loc); - - extra.parseAdditiveExpression = parseAdditiveExpression; - extra.parseAssignmentExpression = parseAssignmentExpression; - extra.parseBitwiseANDExpression = parseBitwiseANDExpression; - extra.parseBitwiseORExpression = parseBitwiseORExpression; - extra.parseBitwiseXORExpression = parseBitwiseXORExpression; - extra.parseBlock = parseBlock; - extra.parseFunctionSourceElements = parseFunctionSourceElements; - extra.parseCatchClause = parseCatchClause; - extra.parseComputedMember = parseComputedMember; - extra.parseConditionalExpression = parseConditionalExpression; - extra.parseConstLetDeclaration = parseConstLetDeclaration; - extra.parseEqualityExpression = parseEqualityExpression; - extra.parseExpression = parseExpression; - extra.parseForVariableDeclaration = parseForVariableDeclaration; - extra.parseFunctionDeclaration = parseFunctionDeclaration; - extra.parseFunctionExpression = parseFunctionExpression; - extra.parseLogicalANDExpression = parseLogicalANDExpression; - extra.parseLogicalORExpression = parseLogicalORExpression; - extra.parseMultiplicativeExpression = parseMultiplicativeExpression; - extra.parseNewExpression = parseNewExpression; - extra.parseNonComputedProperty = parseNonComputedProperty; - extra.parseObjectProperty = parseObjectProperty; - extra.parseObjectPropertyKey = parseObjectPropertyKey; - extra.parsePostfixExpression = parsePostfixExpression; - extra.parsePrimaryExpression = parsePrimaryExpression; - extra.parseProgram = parseProgram; - extra.parsePropertyFunction = parsePropertyFunction; - extra.parseRelationalExpression = parseRelationalExpression; - extra.parseStatement = parseStatement; - extra.parseShiftExpression = parseShiftExpression; - extra.parseSwitchCase = parseSwitchCase; - extra.parseUnaryExpression = parseUnaryExpression; - extra.parseVariableDeclaration = parseVariableDeclaration; - extra.parseVariableIdentifier = parseVariableIdentifier; - - parseAdditiveExpression = wrapTracking(extra.parseAdditiveExpression); - parseAssignmentExpression = wrapTracking(extra.parseAssignmentExpression); - parseBitwiseANDExpression = wrapTracking(extra.parseBitwiseANDExpression); - parseBitwiseORExpression = wrapTracking(extra.parseBitwiseORExpression); - parseBitwiseXORExpression = wrapTracking(extra.parseBitwiseXORExpression); - parseBlock = wrapTracking(extra.parseBlock); - parseFunctionSourceElements = wrapTracking(extra.parseFunctionSourceElements); - parseCatchClause = wrapTracking(extra.parseCatchClause); - parseComputedMember = wrapTracking(extra.parseComputedMember); - parseConditionalExpression = wrapTracking(extra.parseConditionalExpression); - parseConstLetDeclaration = wrapTracking(extra.parseConstLetDeclaration); - parseEqualityExpression = wrapTracking(extra.parseEqualityExpression); - parseExpression = wrapTracking(extra.parseExpression); - parseForVariableDeclaration = wrapTracking(extra.parseForVariableDeclaration); - parseFunctionDeclaration = wrapTracking(extra.parseFunctionDeclaration); - parseFunctionExpression = wrapTracking(extra.parseFunctionExpression); - parseLeftHandSideExpression = wrapTracking(parseLeftHandSideExpression); - parseLogicalANDExpression = wrapTracking(extra.parseLogicalANDExpression); - parseLogicalORExpression = wrapTracking(extra.parseLogicalORExpression); - parseMultiplicativeExpression = wrapTracking(extra.parseMultiplicativeExpression); - parseNewExpression = wrapTracking(extra.parseNewExpression); - parseNonComputedProperty = wrapTracking(extra.parseNonComputedProperty); - parseObjectProperty = wrapTracking(extra.parseObjectProperty); - parseObjectPropertyKey = wrapTracking(extra.parseObjectPropertyKey); - parsePostfixExpression = wrapTracking(extra.parsePostfixExpression); - parsePrimaryExpression = wrapTracking(extra.parsePrimaryExpression); - parseProgram = wrapTracking(extra.parseProgram); - parsePropertyFunction = wrapTracking(extra.parsePropertyFunction); - parseRelationalExpression = wrapTracking(extra.parseRelationalExpression); - parseStatement = wrapTracking(extra.parseStatement); - parseShiftExpression = wrapTracking(extra.parseShiftExpression); - parseSwitchCase = wrapTracking(extra.parseSwitchCase); - parseUnaryExpression = wrapTracking(extra.parseUnaryExpression); - parseVariableDeclaration = wrapTracking(extra.parseVariableDeclaration); - parseVariableIdentifier = wrapTracking(extra.parseVariableIdentifier); - } - - if (typeof extra.tokens !== 'undefined') { - extra.advance = advance; - extra.scanRegExp = scanRegExp; - - advance = collectToken; - scanRegExp = collectRegex; - } - } - - function unpatch() { - if (typeof extra.skipComment === 'function') { - skipComment = extra.skipComment; - } - - if (extra.raw) { - createLiteral = extra.createLiteral; - } - - if (extra.range || extra.loc) { - parseAdditiveExpression = extra.parseAdditiveExpression; - parseAssignmentExpression = extra.parseAssignmentExpression; - parseBitwiseANDExpression = extra.parseBitwiseANDExpression; - parseBitwiseORExpression = extra.parseBitwiseORExpression; - parseBitwiseXORExpression = extra.parseBitwiseXORExpression; - parseBlock = extra.parseBlock; - parseFunctionSourceElements = extra.parseFunctionSourceElements; - parseCatchClause = extra.parseCatchClause; - parseComputedMember = extra.parseComputedMember; - parseConditionalExpression = extra.parseConditionalExpression; - parseConstLetDeclaration = extra.parseConstLetDeclaration; - parseEqualityExpression = extra.parseEqualityExpression; - parseExpression = extra.parseExpression; - parseForVariableDeclaration = extra.parseForVariableDeclaration; - parseFunctionDeclaration = extra.parseFunctionDeclaration; - parseFunctionExpression = extra.parseFunctionExpression; - parseGroupExpression = extra.parseGroupExpression; - parseLeftHandSideExpression = extra.parseLeftHandSideExpression; - parseLeftHandSideExpressionAllowCall = extra.parseLeftHandSideExpressionAllowCall; - parseLogicalANDExpression = extra.parseLogicalANDExpression; - parseLogicalORExpression = extra.parseLogicalORExpression; - parseMultiplicativeExpression = extra.parseMultiplicativeExpression; - parseNewExpression = extra.parseNewExpression; - parseNonComputedProperty = extra.parseNonComputedProperty; - parseObjectProperty = extra.parseObjectProperty; - parseObjectPropertyKey = extra.parseObjectPropertyKey; - parsePrimaryExpression = extra.parsePrimaryExpression; - parsePostfixExpression = extra.parsePostfixExpression; - parseProgram = extra.parseProgram; - parsePropertyFunction = extra.parsePropertyFunction; - parseRelationalExpression = extra.parseRelationalExpression; - parseStatement = extra.parseStatement; - parseShiftExpression = extra.parseShiftExpression; - parseSwitchCase = extra.parseSwitchCase; - parseUnaryExpression = extra.parseUnaryExpression; - parseVariableDeclaration = extra.parseVariableDeclaration; - parseVariableIdentifier = extra.parseVariableIdentifier; - } - - if (typeof extra.scanRegExp === 'function') { - advance = extra.advance; - scanRegExp = extra.scanRegExp; - } - } - - function stringToArray(str) { - var length = str.length, - result = [], - i; - for (i = 0; i < length; ++i) { - result[i] = str.charAt(i); - } - return result; - } - - function parse(code, options) { - var program, toString; - - toString = String; - if (typeof code !== 'string' && !(code instanceof String)) { - code = toString(code); - } - - source = code; - index = 0; - lineNumber = (source.length > 0) ? 1 : 0; - lineStart = 0; - length = source.length; - buffer = null; - state = { - allowIn: true, - labelSet: {}, - inFunctionBody: false, - inIteration: false, - inSwitch: false - }; - - extra = {}; - if (typeof options !== 'undefined') { - extra.range = (typeof options.range === 'boolean') && options.range; - extra.loc = (typeof options.loc === 'boolean') && options.loc; - extra.raw = (typeof options.raw === 'boolean') && options.raw; - if (typeof options.tokens === 'boolean' && options.tokens) { - extra.tokens = []; - } - if (typeof options.comment === 'boolean' && options.comment) { - extra.comments = []; - } - if (typeof options.tolerant === 'boolean' && options.tolerant) { - extra.errors = []; - } - } - - if (length > 0) { - if (typeof source[0] === 'undefined') { - // Try first to convert to a string. This is good as fast path - // for old IE which understands string indexing for string - // literals only and not for string object. - if (code instanceof String) { - source = code.valueOf(); - } - - // Force accessing the characters via an array. - if (typeof source[0] === 'undefined') { - source = stringToArray(code); - } - } - } - - patch(); - try { - program = parseProgram(); - if (typeof extra.comments !== 'undefined') { - filterCommentLocation(); - program.comments = extra.comments; - } - if (typeof extra.tokens !== 'undefined') { - filterTokenLocation(); - program.tokens = extra.tokens; - } - if (typeof extra.errors !== 'undefined') { - program.errors = extra.errors; - } - if (extra.range || extra.loc) { - program.body = filterGroup(program.body); - } - } catch (e) { - throw e; - } finally { - unpatch(); - extra = {}; - } - - return program; - } - - // Sync with package.json. - exports.version = '1.0.4'; - - exports.parse = parse; - - // Deep copy. - exports.Syntax = (function () { - var name, types = {}; - - if (typeof Object.create === 'function') { - types = Object.create(null); - } - - for (name in Syntax) { - if (Syntax.hasOwnProperty(name)) { - types[name] = Syntax[name]; - } - } - - if (typeof Object.freeze === 'function') { - Object.freeze(types); - } - - return types; - }()); - -})); -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json deleted file mode 100644 index 9a2294a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "esprima", - "description": "ECMAScript parsing infrastructure for multipurpose analysis", - "homepage": "http://esprima.org", - "main": "esprima.js", - "bin": { - "esparse": "./bin/esparse.js", - "esvalidate": "./bin/esvalidate.js" - }, - "files": [ - "bin", - "test/run.js", - "test/runner.js", - "test/test.js", - "test/compat.js", - "test/reflect.js", - "esprima.js" - ], - "version": "1.0.4", - "engines": { - "node": ">=0.4.0" - }, - "maintainers": [ - { - "name": "Ariya Hidayat", - "email": "ariya.hidayat@gmail.com", - "url": "http://ariya.ofilabs.com" - } - ], - "repository": { - "type": "git", - "url": "http://github.com/ariya/esprima.git" - }, - "licenses": [ - { - "type": "BSD", - "url": "http://github.com/ariya/esprima/raw/master/LICENSE.BSD" - } - ], - "keywords": [ - "ast", - "ecmascript", - "javascript", - "parser", - "syntax" - ], - "scripts": { - "test": "node test/run.js", - "benchmark": "node test/benchmarks.js", - "benchmark-quick": "node test/benchmarks.js quick" - }, - "readme": "**Esprima** ([esprima.org](http://esprima.org)) is a high performance,\nstandard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\nparser written in ECMAScript (also popularly known as\n[JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).\nEsprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),\nwith the help of [many contributors](https://github.com/ariya/esprima/contributors).\n\nEsprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as\n[Node.js](http://nodejs.org).\n\n### Features\n\n- Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262)\n- Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla\n[Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)\n- Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage)\n- Optional tracking of syntax node location (index-based and line-column)\n- Experimental support for ES6/Harmony (module, class, destructuring, ...)\n\nEsprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)).\nIt is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html)\nwith the new generation of fast parsers.\n\n### Applications\n\nEsprima serves as the basis for many popular JavaScript development tools:\n\n- Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul)\n- Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck)\n- Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS),\n[Sweet.js](http://sweetjs.org/) (macro)\n- ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr)\n- Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html))\n- Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter),\n- Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen)\n\n### Questions?\n- [Documentation](http://esprima.org/doc)\n- [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect)\nand [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement)\n- [Mailing list](http://groups.google.com/group/esprima)\n- [Contribution guide](http://esprima.org/doc/index.html#contribution)\n\nFollow [@Esprima](http://twitter.com/Esprima) on Twitter to get the\ndevelopment updates.\nFeedback and contribution are welcomed!\n\n### License\n\nCopyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)\n and other contributors.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\nDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\nON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\nTHIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/ariya/esprima/issues" - }, - "_id": "esprima@1.0.4", - "_from": "esprima@~ 1.0.2" -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js deleted file mode 100644 index ee3a629..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2011 Ariya Hidayat - - 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. - - 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 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. -*/ - -/*jslint node: true */ -/*global document: true, window:true, esprima: true, testReflect: true */ - -var runTests; - -function getContext(esprima, reportCase, reportFailure) { - 'use strict'; - - var Reflect, Pattern; - - // Maps Mozilla Reflect object to our Esprima parser. - Reflect = { - parse: function (code) { - var result; - - reportCase(code); - - try { - result = esprima.parse(code); - } catch (error) { - result = error; - } - - return result; - } - }; - - // This is used by Reflect test suite to match a syntax tree. - Pattern = function (obj) { - var pattern; - - // Poor man's deep object cloning. - pattern = JSON.parse(JSON.stringify(obj)); - - // Special handling for regular expression literal since we need to - // convert it to a string literal, otherwise it will be decoded - // as object "{}" and the regular expression would be lost. - if (obj.type && obj.type === 'Literal') { - if (obj.value instanceof RegExp) { - pattern = { - type: obj.type, - value: obj.value.toString() - }; - } - } - - // Special handling for branch statement because SpiderMonkey - // prefers to put the 'alternate' property before 'consequent'. - if (obj.type && obj.type === 'IfStatement') { - pattern = { - type: pattern.type, - test: pattern.test, - consequent: pattern.consequent, - alternate: pattern.alternate - }; - } - - // Special handling for do while statement because SpiderMonkey - // prefers to put the 'test' property before 'body'. - if (obj.type && obj.type === 'DoWhileStatement') { - pattern = { - type: pattern.type, - body: pattern.body, - test: pattern.test - }; - } - - function adjustRegexLiteralAndRaw(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } else if (key === 'raw' && typeof value === "string") { - // Ignore Esprima-specific 'raw' property. - return undefined; - } - return value; - } - - if (obj.type && (obj.type === 'Program')) { - pattern.assert = function (tree) { - var actual, expected; - actual = JSON.stringify(tree, adjustRegexLiteralAndRaw, 4); - expected = JSON.stringify(obj, null, 4); - - if (expected !== actual) { - reportFailure(expected, actual); - } - }; - } - - return pattern; - }; - - return { - Reflect: Reflect, - Pattern: Pattern - }; -} - -if (typeof window !== 'undefined') { - // Run all tests in a browser environment. - runTests = function () { - 'use strict'; - - var total = 0, - failures = 0; - - function setText(el, str) { - if (typeof el.innerText === 'string') { - el.innerText = str; - } else { - el.textContent = str; - } - } - - function reportCase(code) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - total += 1; - } - - function reportFailure(expected, actual) { - var report, e; - - failures += 1; - - report = document.getElementById('report'); - - e = document.createElement('p'); - setText(e, 'Expected'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'expected'); - setText(e, expected); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Actual'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'actual'); - setText(e, actual); - report.appendChild(e); - } - - setText(document.getElementById('version'), esprima.version); - - window.setTimeout(function () { - var tick, context = getContext(esprima, reportCase, reportFailure); - - tick = new Date(); - testReflect(context.Reflect, context.Pattern); - tick = (new Date()) - tick; - - if (failures > 0) { - setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms'); - } else { - setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms'); - } - }, 513); - }; -} else { - (function (global) { - 'use strict'; - var esprima = require('../esprima'), - tick, - total = 0, - failures = [], - header, - current, - context; - - function reportCase(code) { - total += 1; - current = code; - } - - function reportFailure(expected, actual) { - failures.push({ - source: current, - expected: expected.toString(), - actual: actual.toString() - }); - } - - context = getContext(esprima, reportCase, reportFailure); - - tick = new Date(); - require('./reflect').testReflect(context.Reflect, context.Pattern); - tick = (new Date()) - tick; - - header = total + ' tests. ' + failures.length + ' failures. ' + - tick + ' ms'; - if (failures.length) { - console.error(header); - failures.forEach(function (failure) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); - }); - } else { - console.log(header); - } - process.exit(failures.length === 0 ? 0 : 1); - }(this)); -} -/* vim: set sw=4 ts=4 et tw=80 : */ diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js deleted file mode 100644 index dba1ba8..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js +++ /dev/null @@ -1,422 +0,0 @@ -// This is modified from Mozilla Reflect.parse test suite (the file is located -// at js/src/tests/js1_8_5/extensions/reflect-parse.js in the source tree). -// -// Some notable changes: -// * Removed unsupported features (destructuring, let, comprehensions...). -// * Removed tests for E4X (ECMAScript for XML). -// * Removed everything related to builder. -// * Enclosed every 'Pattern' construct with a scope. -// * Tweaked some expected tree to remove generator field. -// * Removed the test for bug 632030 and bug 632024. - -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/licenses/publicdomain/ - */ - -(function (exports) { - -function testReflect(Reflect, Pattern) { - -function program(elts) { return Pattern({ type: "Program", body: elts }) } -function exprStmt(expr) { return Pattern({ type: "ExpressionStatement", expression: expr }) } -function throwStmt(expr) { return Pattern({ type: "ThrowStatement", argument: expr }) } -function returnStmt(expr) { return Pattern({ type: "ReturnStatement", argument: expr }) } -function yieldExpr(expr) { return Pattern({ type: "YieldExpression", argument: expr }) } -function lit(val) { return Pattern({ type: "Literal", value: val }) } -var thisExpr = Pattern({ type: "ThisExpression" }); -function funDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function genFunDecl(id, params, body) { return Pattern({ type: "FunctionDeclaration", - id: id, - params: params, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function declarator(id, init) { return Pattern({ type: "VariableDeclarator", id: id, init: init }) } -function varDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "var" }) } -function letDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "let" }) } -function constDecl(decls) { return Pattern({ type: "VariableDeclaration", declarations: decls, kind: "const" }) } -function ident(name) { return Pattern({ type: "Identifier", name: name }) } -function dotExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: false, object: obj, property: id }) } -function memExpr(obj, id) { return Pattern({ type: "MemberExpression", computed: true, object: obj, property: id }) } -function forStmt(init, test, update, body) { return Pattern({ type: "ForStatement", init: init, test: test, update: update, body: body }) } -function forInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: false }) } -function forEachInStmt(lhs, rhs, body) { return Pattern({ type: "ForInStatement", left: lhs, right: rhs, body: body, each: true }) } -function breakStmt(lab) { return Pattern({ type: "BreakStatement", label: lab }) } -function continueStmt(lab) { return Pattern({ type: "ContinueStatement", label: lab }) } -function blockStmt(body) { return Pattern({ type: "BlockStatement", body: body }) } -var emptyStmt = Pattern({ type: "EmptyStatement" }); -function ifStmt(test, cons, alt) { return Pattern({ type: "IfStatement", test: test, alternate: alt, consequent: cons }) } -function labStmt(lab, stmt) { return Pattern({ type: "LabeledStatement", label: lab, body: stmt }) } -function withStmt(obj, stmt) { return Pattern({ type: "WithStatement", object: obj, body: stmt }) } -function whileStmt(test, stmt) { return Pattern({ type: "WhileStatement", test: test, body: stmt }) } -function doStmt(stmt, test) { return Pattern({ type: "DoWhileStatement", test: test, body: stmt }) } -function switchStmt(disc, cases) { return Pattern({ type: "SwitchStatement", discriminant: disc, cases: cases }) } -function caseClause(test, stmts) { return Pattern({ type: "SwitchCase", test: test, consequent: stmts }) } -function defaultClause(stmts) { return Pattern({ type: "SwitchCase", test: null, consequent: stmts }) } -function catchClause(id, guard, body) { if (guard) { return Pattern({ type: "GuardedCatchClause", param: id, guard: guard, body: body }) } else { return Pattern({ type: "CatchClause", param: id, body: body }) } } -function tryStmt(body, guarded, catches, fin) { return Pattern({ type: "TryStatement", block: body, guardedHandlers: guarded, handlers: catches, finalizer: fin }) } -function letStmt(head, body) { return Pattern({ type: "LetStatement", head: head, body: body }) } -function funExpr(id, args, body, gen) { return Pattern({ type: "FunctionExpression", - id: id, - params: args, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } -function genFunExpr(id, args, body) { return Pattern({ type: "FunctionExpression", - id: id, - params: args, - defaults: [], - body: body, - rest: null, - generator: false, - expression: false - }) } - -function unExpr(op, arg) { return Pattern({ type: "UnaryExpression", operator: op, argument: arg, prefix: true }) } -function binExpr(op, left, right) { return Pattern({ type: "BinaryExpression", operator: op, left: left, right: right }) } -function aExpr(op, left, right) { return Pattern({ type: "AssignmentExpression", operator: op, left: left, right: right }) } -function updExpr(op, arg, prefix) { return Pattern({ type: "UpdateExpression", operator: op, argument: arg, prefix: prefix }) } -function logExpr(op, left, right) { return Pattern({ type: "LogicalExpression", operator: op, left: left, right: right }) } - -function condExpr(test, cons, alt) { return Pattern({ type: "ConditionalExpression", test: test, consequent: cons, alternate: alt }) } -function seqExpr(exprs) { return Pattern({ type: "SequenceExpression", expressions: exprs }) } -function newExpr(callee, args) { return Pattern({ type: "NewExpression", callee: callee, arguments: args }) } -function callExpr(callee, args) { return Pattern({ type: "CallExpression", callee: callee, arguments: args }) } -function arrExpr(elts) { return Pattern({ type: "ArrayExpression", elements: elts }) } -function objExpr(elts) { return Pattern({ type: "ObjectExpression", properties: elts }) } -function objProp(key, value, kind) { return Pattern({ type: "Property", key: key, value: value, kind: kind }) } - -function arrPatt(elts) { return Pattern({ type: "ArrayPattern", elements: elts }) } -function objPatt(elts) { return Pattern({ type: "ObjectPattern", properties: elts }) } - -function localSrc(src) { return "(function(){ " + src + " })" } -function localPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([patt])))]) } -function blockSrc(src) { return "(function(){ { " + src + " } })" } -function blockPatt(patt) { return program([exprStmt(funExpr(null, [], blockStmt([blockStmt([patt])])))]) } - -function assertBlockStmt(src, patt) { - blockPatt(patt).assert(Reflect.parse(blockSrc(src))); -} - -function assertBlockExpr(src, patt) { - assertBlockStmt(src, exprStmt(patt)); -} - -function assertBlockDecl(src, patt, builder) { - blockPatt(patt).assert(Reflect.parse(blockSrc(src), {builder: builder})); -} - -function assertLocalStmt(src, patt) { - localPatt(patt).assert(Reflect.parse(localSrc(src))); -} - -function assertLocalExpr(src, patt) { - assertLocalStmt(src, exprStmt(patt)); -} - -function assertLocalDecl(src, patt) { - localPatt(patt).assert(Reflect.parse(localSrc(src))); -} - -function assertGlobalStmt(src, patt, builder) { - program([patt]).assert(Reflect.parse(src, {builder: builder})); -} - -function assertGlobalExpr(src, patt, builder) { - program([exprStmt(patt)]).assert(Reflect.parse(src, {builder: builder})); - //assertStmt(src, exprStmt(patt)); -} - -function assertGlobalDecl(src, patt) { - program([patt]).assert(Reflect.parse(src)); -} - -function assertProg(src, patt) { - program(patt).assert(Reflect.parse(src)); -} - -function assertStmt(src, patt) { - assertLocalStmt(src, patt); - assertGlobalStmt(src, patt); - assertBlockStmt(src, patt); -} - -function assertExpr(src, patt) { - assertLocalExpr(src, patt); - assertGlobalExpr(src, patt); - assertBlockExpr(src, patt); -} - -function assertDecl(src, patt) { - assertLocalDecl(src, patt); - assertGlobalDecl(src, patt); - assertBlockDecl(src, patt); -} - -function assertError(src, errorType) { - try { - Reflect.parse(src); - } catch (e) { - return; - } - throw new Error("expected " + errorType.name + " for " + uneval(src)); -} - - -// general tests - -// NB: These are useful but for now jit-test doesn't do I/O reliably. - -//program(_).assert(Reflect.parse(snarf('data/flapjax.txt'))); -//program(_).assert(Reflect.parse(snarf('data/jquery-1.4.2.txt'))); -//program(_).assert(Reflect.parse(snarf('data/prototype.js'))); -//program(_).assert(Reflect.parse(snarf('data/dojo.js.uncompressed.js'))); -//program(_).assert(Reflect.parse(snarf('data/mootools-1.2.4-core-nc.js'))); - - -// declarations - -assertDecl("var x = 1, y = 2, z = 3", - varDecl([declarator(ident("x"), lit(1)), - declarator(ident("y"), lit(2)), - declarator(ident("z"), lit(3))])); -assertDecl("var x, y, z", - varDecl([declarator(ident("x"), null), - declarator(ident("y"), null), - declarator(ident("z"), null)])); -assertDecl("function foo() { }", - funDecl(ident("foo"), [], blockStmt([]))); -assertDecl("function foo() { return 42 }", - funDecl(ident("foo"), [], blockStmt([returnStmt(lit(42))]))); - - -// Bug 591437: rebound args have their defs turned into uses -assertDecl("function f(a) { function a() { } }", - funDecl(ident("f"), [ident("a")], blockStmt([funDecl(ident("a"), [], blockStmt([]))]))); -assertDecl("function f(a,b,c) { function b() { } }", - funDecl(ident("f"), [ident("a"),ident("b"),ident("c")], blockStmt([funDecl(ident("b"), [], blockStmt([]))]))); - -// expressions - -assertExpr("true", lit(true)); -assertExpr("false", lit(false)); -assertExpr("42", lit(42)); -assertExpr("(/asdf/)", lit(/asdf/)); -assertExpr("this", thisExpr); -assertExpr("foo", ident("foo")); -assertExpr("foo.bar", dotExpr(ident("foo"), ident("bar"))); -assertExpr("foo[bar]", memExpr(ident("foo"), ident("bar"))); -assertExpr("(function(){})", funExpr(null, [], blockStmt([]))); -assertExpr("(function f() {})", funExpr(ident("f"), [], blockStmt([]))); -assertExpr("(function f(x,y,z) {})", funExpr(ident("f"), [ident("x"),ident("y"),ident("z")], blockStmt([]))); -assertExpr("(++x)", updExpr("++", ident("x"), true)); -assertExpr("(x++)", updExpr("++", ident("x"), false)); -assertExpr("(+x)", unExpr("+", ident("x"))); -assertExpr("(-x)", unExpr("-", ident("x"))); -assertExpr("(!x)", unExpr("!", ident("x"))); -assertExpr("(~x)", unExpr("~", ident("x"))); -assertExpr("(delete x)", unExpr("delete", ident("x"))); -assertExpr("(typeof x)", unExpr("typeof", ident("x"))); -assertExpr("(void x)", unExpr("void", ident("x"))); -assertExpr("(x == y)", binExpr("==", ident("x"), ident("y"))); -assertExpr("(x != y)", binExpr("!=", ident("x"), ident("y"))); -assertExpr("(x === y)", binExpr("===", ident("x"), ident("y"))); -assertExpr("(x !== y)", binExpr("!==", ident("x"), ident("y"))); -assertExpr("(x < y)", binExpr("<", ident("x"), ident("y"))); -assertExpr("(x <= y)", binExpr("<=", ident("x"), ident("y"))); -assertExpr("(x > y)", binExpr(">", ident("x"), ident("y"))); -assertExpr("(x >= y)", binExpr(">=", ident("x"), ident("y"))); -assertExpr("(x << y)", binExpr("<<", ident("x"), ident("y"))); -assertExpr("(x >> y)", binExpr(">>", ident("x"), ident("y"))); -assertExpr("(x >>> y)", binExpr(">>>", ident("x"), ident("y"))); -assertExpr("(x + y)", binExpr("+", ident("x"), ident("y"))); -assertExpr("(w + x + y + z)", binExpr("+", binExpr("+", binExpr("+", ident("w"), ident("x")), ident("y")), ident("z"))); -assertExpr("(x - y)", binExpr("-", ident("x"), ident("y"))); -assertExpr("(w - x - y - z)", binExpr("-", binExpr("-", binExpr("-", ident("w"), ident("x")), ident("y")), ident("z"))); -assertExpr("(x * y)", binExpr("*", ident("x"), ident("y"))); -assertExpr("(x / y)", binExpr("/", ident("x"), ident("y"))); -assertExpr("(x % y)", binExpr("%", ident("x"), ident("y"))); -assertExpr("(x | y)", binExpr("|", ident("x"), ident("y"))); -assertExpr("(x ^ y)", binExpr("^", ident("x"), ident("y"))); -assertExpr("(x & y)", binExpr("&", ident("x"), ident("y"))); -assertExpr("(x in y)", binExpr("in", ident("x"), ident("y"))); -assertExpr("(x instanceof y)", binExpr("instanceof", ident("x"), ident("y"))); -assertExpr("(x = y)", aExpr("=", ident("x"), ident("y"))); -assertExpr("(x += y)", aExpr("+=", ident("x"), ident("y"))); -assertExpr("(x -= y)", aExpr("-=", ident("x"), ident("y"))); -assertExpr("(x *= y)", aExpr("*=", ident("x"), ident("y"))); -assertExpr("(x /= y)", aExpr("/=", ident("x"), ident("y"))); -assertExpr("(x %= y)", aExpr("%=", ident("x"), ident("y"))); -assertExpr("(x <<= y)", aExpr("<<=", ident("x"), ident("y"))); -assertExpr("(x >>= y)", aExpr(">>=", ident("x"), ident("y"))); -assertExpr("(x >>>= y)", aExpr(">>>=", ident("x"), ident("y"))); -assertExpr("(x |= y)", aExpr("|=", ident("x"), ident("y"))); -assertExpr("(x ^= y)", aExpr("^=", ident("x"), ident("y"))); -assertExpr("(x &= y)", aExpr("&=", ident("x"), ident("y"))); -assertExpr("(x || y)", logExpr("||", ident("x"), ident("y"))); -assertExpr("(x && y)", logExpr("&&", ident("x"), ident("y"))); -assertExpr("(w || x || y || z)", logExpr("||", logExpr("||", logExpr("||", ident("w"), ident("x")), ident("y")), ident("z"))) -assertExpr("(x ? y : z)", condExpr(ident("x"), ident("y"), ident("z"))); -assertExpr("(x,y)", seqExpr([ident("x"),ident("y")])) -assertExpr("(x,y,z)", seqExpr([ident("x"),ident("y"),ident("z")])) -assertExpr("(a,b,c,d,e,f,g)", seqExpr([ident("a"),ident("b"),ident("c"),ident("d"),ident("e"),ident("f"),ident("g")])); -assertExpr("(new Object)", newExpr(ident("Object"), [])); -assertExpr("(new Object())", newExpr(ident("Object"), [])); -assertExpr("(new Object(42))", newExpr(ident("Object"), [lit(42)])); -assertExpr("(new Object(1,2,3))", newExpr(ident("Object"), [lit(1),lit(2),lit(3)])); -assertExpr("(String())", callExpr(ident("String"), [])); -assertExpr("(String(42))", callExpr(ident("String"), [lit(42)])); -assertExpr("(String(1,2,3))", callExpr(ident("String"), [lit(1),lit(2),lit(3)])); -assertExpr("[]", arrExpr([])); -assertExpr("[1]", arrExpr([lit(1)])); -assertExpr("[1,2]", arrExpr([lit(1),lit(2)])); -assertExpr("[1,2,3]", arrExpr([lit(1),lit(2),lit(3)])); -assertExpr("[1,,2,3]", arrExpr([lit(1),,lit(2),lit(3)])); -assertExpr("[1,,,2,3]", arrExpr([lit(1),,,lit(2),lit(3)])); -assertExpr("[1,,,2,,3]", arrExpr([lit(1),,,lit(2),,lit(3)])); -assertExpr("[1,,,2,,,3]", arrExpr([lit(1),,,lit(2),,,lit(3)])); -assertExpr("[,1,2,3]", arrExpr([,lit(1),lit(2),lit(3)])); -assertExpr("[,,1,2,3]", arrExpr([,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3]", arrExpr([,,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3,]", arrExpr([,,,lit(1),lit(2),lit(3)])); -assertExpr("[,,,1,2,3,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined])); -assertExpr("[,,,1,2,3,,,]", arrExpr([,,,lit(1),lit(2),lit(3),undefined,undefined])); -assertExpr("[,,,,,]", arrExpr([undefined,undefined,undefined,undefined,undefined])); -assertExpr("({})", objExpr([])); -assertExpr("({x:1})", objExpr([objProp(ident("x"), lit(1), "init")])); -assertExpr("({x:1, y:2})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(ident("y"), lit(2), "init")])); -assertExpr("({x:1, y:2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(ident("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({x:1, 'y':2, z:3})", objExpr([objProp(ident("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({'x':1, 'y':2, z:3})", objExpr([objProp(lit("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(ident("z"), lit(3), "init") ])); -assertExpr("({'x':1, 'y':2, 3:3})", objExpr([objProp(lit("x"), lit(1), "init"), - objProp(lit("y"), lit(2), "init"), - objProp(lit(3), lit(3), "init") ])); - -// Bug 571617: eliminate constant-folding -assertExpr("2 + 3", binExpr("+", lit(2), lit(3))); - -// Bug 632026: constant-folding -assertExpr("typeof(0?0:a)", unExpr("typeof", condExpr(lit(0), lit(0), ident("a")))); - -// Bug 632056: constant-folding -program([exprStmt(ident("f")), - ifStmt(lit(1), - funDecl(ident("f"), [], blockStmt([])), - null)]).assert(Reflect.parse("f; if (1) function f(){}")); - -// statements - -assertStmt("throw 42", throwStmt(lit(42))); -assertStmt("for (;;) break", forStmt(null, null, null, breakStmt(null))); -assertStmt("for (x; y; z) break", forStmt(ident("x"), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (var x; y; z) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (var x = 42; y; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), ident("y"), ident("z"), breakStmt(null))); -assertStmt("for (x; ; z) break", forStmt(ident("x"), null, ident("z"), breakStmt(null))); -assertStmt("for (var x; ; z) break", forStmt(varDecl([declarator(ident("x"), null)]), null, ident("z"), breakStmt(null))); -assertStmt("for (var x = 42; ; z) break", forStmt(varDecl([declarator(ident("x"), lit(42))]), null, ident("z"), breakStmt(null))); -assertStmt("for (x; y; ) break", forStmt(ident("x"), ident("y"), null, breakStmt(null))); -assertStmt("for (var x; y; ) break", forStmt(varDecl([declarator(ident("x"), null)]), ident("y"), null, breakStmt(null))); -assertStmt("for (var x = 42; y; ) break", forStmt(varDecl([declarator(ident("x"),lit(42))]), ident("y"), null, breakStmt(null))); -assertStmt("for (var x in y) break", forInStmt(varDecl([declarator(ident("x"),null)]), ident("y"), breakStmt(null))); -assertStmt("for (x in y) break", forInStmt(ident("x"), ident("y"), breakStmt(null))); -assertStmt("{ }", blockStmt([])); -assertStmt("{ throw 1; throw 2; throw 3; }", blockStmt([ throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))])); -assertStmt(";", emptyStmt); -assertStmt("if (foo) throw 42;", ifStmt(ident("foo"), throwStmt(lit(42)), null)); -assertStmt("if (foo) throw 42; else true;", ifStmt(ident("foo"), throwStmt(lit(42)), exprStmt(lit(true)))); -assertStmt("if (foo) { throw 1; throw 2; throw 3; }", - ifStmt(ident("foo"), - blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), - null)); -assertStmt("if (foo) { throw 1; throw 2; throw 3; } else true;", - ifStmt(ident("foo"), - blockStmt([throwStmt(lit(1)), throwStmt(lit(2)), throwStmt(lit(3))]), - exprStmt(lit(true)))); -assertStmt("foo: for(;;) break foo;", labStmt(ident("foo"), forStmt(null, null, null, breakStmt(ident("foo"))))); -assertStmt("foo: for(;;) continue foo;", labStmt(ident("foo"), forStmt(null, null, null, continueStmt(ident("foo"))))); -assertStmt("with (obj) { }", withStmt(ident("obj"), blockStmt([]))); -assertStmt("with (obj) { obj; }", withStmt(ident("obj"), blockStmt([exprStmt(ident("obj"))]))); -assertStmt("while (foo) { }", whileStmt(ident("foo"), blockStmt([]))); -assertStmt("while (foo) { foo; }", whileStmt(ident("foo"), blockStmt([exprStmt(ident("foo"))]))); -assertStmt("do { } while (foo);", doStmt(blockStmt([]), ident("foo"))); -assertStmt("do { foo; } while (foo)", doStmt(blockStmt([exprStmt(ident("foo"))]), ident("foo"))); -assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; }", - switchStmt(ident("foo"), - [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), - caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), - defaultClause([ exprStmt(lit(3)) ]) ])); -assertStmt("switch (foo) { case 1: 1; break; case 2: 2; break; default: 3; case 42: 42; }", - switchStmt(ident("foo"), - [ caseClause(lit(1), [ exprStmt(lit(1)), breakStmt(null) ]), - caseClause(lit(2), [ exprStmt(lit(2)), breakStmt(null) ]), - defaultClause([ exprStmt(lit(3)) ]), - caseClause(lit(42), [ exprStmt(lit(42)) ]) ])); -assertStmt("try { } catch (e) { }", - tryStmt(blockStmt([]), - [], - [ catchClause(ident("e"), null, blockStmt([])) ], - null)); -assertStmt("try { } catch (e) { } finally { }", - tryStmt(blockStmt([]), - [], - [ catchClause(ident("e"), null, blockStmt([])) ], - blockStmt([]))); -assertStmt("try { } finally { }", - tryStmt(blockStmt([]), - [], - [], - blockStmt([]))); - -// redeclarations (TOK_NAME nodes with lexdef) - -assertStmt("function f() { function g() { } function g() { } }", - funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), - funDecl(ident("g"), [], blockStmt([]))]))); - -assertStmt("function f() { function g() { } function g() { return 42 } }", - funDecl(ident("f"), [], blockStmt([funDecl(ident("g"), [], blockStmt([])), - funDecl(ident("g"), [], blockStmt([returnStmt(lit(42))]))]))); - -assertStmt("function f() { var x = 42; var x = 43; }", - funDecl(ident("f"), [], blockStmt([varDecl([declarator(ident("x"),lit(42))]), - varDecl([declarator(ident("x"),lit(43))])]))); - -// getters and setters - - assertExpr("({ get x() { return 42 } })", - objExpr([ objProp(ident("x"), - funExpr(null, [], blockStmt([returnStmt(lit(42))])), - "get" ) ])); - assertExpr("({ set x(v) { return 42 } })", - objExpr([ objProp(ident("x"), - funExpr(null, [ident("v")], blockStmt([returnStmt(lit(42))])), - "set" ) ])); - -} - -exports.testReflect = testReflect; - -}(typeof exports === 'undefined' ? this : exports)); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js deleted file mode 100644 index 32ca3fa..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Ariya Hidayat - - 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. - - 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 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. -*/ - -/*jslint node:true */ - -(function () { - 'use strict'; - - var child = require('child_process'), - nodejs = '"' + process.execPath + '"', - ret = 0, - suites, - index; - - suites = [ - 'runner', - 'compat' - ]; - - function nextTest() { - var suite = suites[index]; - - if (index < suites.length) { - child.exec(nodejs + ' ./test/' + suite + '.js', function (err, stdout, stderr) { - if (stdout) { - process.stdout.write(suite + ': ' + stdout); - } - if (stderr) { - process.stderr.write(suite + ': ' + stderr); - } - if (err) { - ret = err.code; - } - index += 1; - nextTest(); - }); - } else { - process.exit(ret); - } - } - - index = 0; - nextTest(); -}()); diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js deleted file mode 100644 index c1a3fc9..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js +++ /dev/null @@ -1,387 +0,0 @@ -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - Copyright (C) 2011 Yusuke Suzuki - Copyright (C) 2011 Arpad Borsos - - 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. - - 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 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. -*/ - -/*jslint browser:true node:true */ -/*global esprima:true, testFixture:true */ - -var runTests; - -// Special handling for regular expression literal since we need to -// convert it to a string literal, otherwise it will be decoded -// as object "{}" and the regular expression would be lost. -function adjustRegexLiteral(key, value) { - 'use strict'; - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return value; -} - -function NotMatchingError(expected, actual) { - 'use strict'; - Error.call(this, 'Expected '); - this.expected = expected; - this.actual = actual; -} -NotMatchingError.prototype = new Error(); - -function errorToObject(e) { - 'use strict'; - var msg = e.toString(); - - // Opera 9.64 produces an non-standard string in toString(). - if (msg.substr(0, 6) !== 'Error:') { - if (typeof e.message === 'string') { - msg = 'Error: ' + e.message; - } - } - - return { - index: e.index, - lineNumber: e.lineNumber, - column: e.column, - message: msg - }; -} - -function testParse(esprima, code, syntax) { - 'use strict'; - var expected, tree, actual, options, StringObject, i, len, err; - - // alias, so that JSLint does not complain. - StringObject = String; - - options = { - comment: (typeof syntax.comments !== 'undefined'), - range: true, - loc: true, - tokens: (typeof syntax.tokens !== 'undefined'), - raw: true, - tolerant: (typeof syntax.errors !== 'undefined') - }; - - if (typeof syntax.tokens !== 'undefined') { - if (syntax.tokens.length > 0) { - options.range = (typeof syntax.tokens[0].range !== 'undefined'); - options.loc = (typeof syntax.tokens[0].loc !== 'undefined'); - } - } - - if (typeof syntax.comments !== 'undefined') { - if (syntax.comments.length > 0) { - options.range = (typeof syntax.comments[0].range !== 'undefined'); - options.loc = (typeof syntax.comments[0].loc !== 'undefined'); - } - } - - expected = JSON.stringify(syntax, null, 4); - try { - tree = esprima.parse(code, options); - tree = (options.comment || options.tokens || options.tolerant) ? tree : tree.body[0]; - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - - actual = JSON.stringify(tree, adjustRegexLiteral, 4); - - // Only to ensure that there is no error when using string object. - esprima.parse(new StringObject(code), options); - - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } - - function filter(key, value) { - if (key === 'value' && value instanceof RegExp) { - value = value.toString(); - } - return (key === 'loc' || key === 'range') ? undefined : value; - } - - if (options.tolerant) { - return; - } - - - // Check again without any location info. - options.range = false; - options.loc = false; - expected = JSON.stringify(syntax, filter, 4); - try { - tree = esprima.parse(code, options); - tree = (options.comment || options.tokens) ? tree : tree.body[0]; - - if (options.tolerant) { - for (i = 0, len = tree.errors.length; i < len; i += 1) { - tree.errors[i] = errorToObject(tree.errors[i]); - } - } - - actual = JSON.stringify(tree, filter, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function testError(esprima, code, exception) { - 'use strict'; - var i, options, expected, actual, handleInvalidRegexFlag; - - // Different parsing options should give the same error. - options = [ - {}, - { comment: true }, - { raw: true }, - { raw: true, comment: true } - ]; - - // If handleInvalidRegexFlag is true, an invalid flag in a regular expression - // will throw an exception. In some old version V8, this is not the case - // and hence handleInvalidRegexFlag is false. - handleInvalidRegexFlag = false; - try { - 'test'.match(new RegExp('[a-z]', 'x')); - } catch (e) { - handleInvalidRegexFlag = true; - } - - expected = JSON.stringify(exception); - - for (i = 0; i < options.length; i += 1) { - - try { - esprima.parse(code, options[i]); - } catch (e) { - actual = JSON.stringify(errorToObject(e)); - } - - if (expected !== actual) { - - // Compensate for old V8 which does not handle invalid flag. - if (exception.message.indexOf('Invalid regular expression') > 0) { - if (typeof actual === 'undefined' && !handleInvalidRegexFlag) { - return; - } - } - - throw new NotMatchingError(expected, actual); - } - - } -} - -function testAPI(esprima, code, result) { - 'use strict'; - var expected, res, actual; - - expected = JSON.stringify(result.result, null, 4); - try { - if (typeof result.property !== 'undefined') { - res = esprima[result.property]; - } else { - res = esprima[result.call].apply(esprima, result.args); - } - actual = JSON.stringify(res, adjustRegexLiteral, 4); - } catch (e) { - throw new NotMatchingError(expected, e.toString()); - } - if (expected !== actual) { - throw new NotMatchingError(expected, actual); - } -} - -function runTest(esprima, code, result) { - 'use strict'; - if (result.hasOwnProperty('lineNumber')) { - testError(esprima, code, result); - } else if (result.hasOwnProperty('result')) { - testAPI(esprima, code, result); - } else { - testParse(esprima, code, result); - } -} - -if (typeof window !== 'undefined') { - // Run all tests in a browser environment. - runTests = function () { - 'use strict'; - var total = 0, - failures = 0, - category, - fixture, - source, - tick, - expected, - index, - len; - - function setText(el, str) { - if (typeof el.innerText === 'string') { - el.innerText = str; - } else { - el.textContent = str; - } - } - - function startCategory(category) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('h4'); - setText(e, category); - report.appendChild(e); - } - - function reportSuccess(code) { - var report, e; - report = document.getElementById('report'); - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - } - - function reportFailure(code, expected, actual) { - var report, e; - - report = document.getElementById('report'); - - e = document.createElement('p'); - setText(e, 'Code:'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'code'); - setText(e, code); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Expected'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'expected'); - setText(e, expected); - report.appendChild(e); - - e = document.createElement('p'); - setText(e, 'Actual'); - report.appendChild(e); - - e = document.createElement('pre'); - e.setAttribute('class', 'actual'); - setText(e, actual); - report.appendChild(e); - } - - setText(document.getElementById('version'), esprima.version); - - tick = new Date(); - for (category in testFixture) { - if (testFixture.hasOwnProperty(category)) { - startCategory(category); - fixture = testFixture[category]; - for (source in fixture) { - if (fixture.hasOwnProperty(source)) { - expected = fixture[source]; - total += 1; - try { - runTest(esprima, source, expected); - reportSuccess(source, JSON.stringify(expected, null, 4)); - } catch (e) { - failures += 1; - reportFailure(source, e.expected, e.actual); - } - } - } - } - } - tick = (new Date()) - tick; - - if (failures > 0) { - setText(document.getElementById('status'), total + ' tests. ' + - 'Failures: ' + failures + '. ' + tick + ' ms'); - } else { - setText(document.getElementById('status'), total + ' tests. ' + - 'No failure. ' + tick + ' ms'); - } - }; -} else { - (function () { - 'use strict'; - - var esprima = require('../esprima'), - vm = require('vm'), - fs = require('fs'), - total = 0, - failures = [], - tick = new Date(), - expected, - header; - - vm.runInThisContext(fs.readFileSync(__dirname + '/test.js', 'utf-8')); - - Object.keys(testFixture).forEach(function (category) { - Object.keys(testFixture[category]).forEach(function (source) { - total += 1; - expected = testFixture[category][source]; - try { - runTest(esprima, source, expected); - } catch (e) { - e.source = source; - failures.push(e); - } - }); - }); - tick = (new Date()) - tick; - - header = total + ' tests. ' + failures.length + ' failures. ' + - tick + ' ms'; - if (failures.length) { - console.error(header); - failures.forEach(function (failure) { - console.error(failure.source + ': Expected\n ' + - failure.expected.split('\n').join('\n ') + - '\nto match\n ' + failure.actual); - }); - } else { - console.log(header); - } - process.exit(failures.length === 0 ? 0 : 1); - }()); -} diff --git a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js b/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js deleted file mode 100644 index 8ceee54..0000000 --- a/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js +++ /dev/null @@ -1,20238 +0,0 @@ -/* - Copyright (C) 2012 Ariya Hidayat - Copyright (C) 2012 Joost-Wim Boekesteijn - Copyright (C) 2012 Yusuke Suzuki - Copyright (C) 2012 Arpad Borsos - Copyright (C) 2011 Ariya Hidayat - Copyright (C) 2011 Yusuke Suzuki - Copyright (C) 2011 Arpad Borsos - - 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. - - 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 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. -*/ - -var testFixture = { - - 'Primary Expression': { - - 'this\n': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'ThisExpression', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } - } - }], - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } - }, - tokens: [{ - type: 'Keyword', - value: 'this', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }] - }, - - 'null\n': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: null, - raw: 'null', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } - } - }], - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 0 } - }, - tokens: [{ - type: 'Null', - value: 'null', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }] - }, - - '\n 42\n\n': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [5, 9], - loc: { - start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } - } - }], - range: [5, 9], - loc: { - start: { line: 2, column: 4 }, - end: { line: 4, column: 0 } - }, - tokens: [{ - type: 'Numeric', - value: '42', - range: [5, 7], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }] - }, - - '(1 + 2 ) * 3': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Literal', - value: 1, - raw: '1', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'Literal', - value: 2, - raw: '2', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [1, 6], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Literal', - value: 3, - raw: '3', - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - } - - }, - - 'Grouping Operator': { - - '(1) + (2 ) + 3': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Literal', - value: 1, - raw: '1', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'Literal', - value: 2, - raw: '2', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - right: { - type: 'Literal', - value: 3, - raw: '3', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - - '4 + 5 << (6)': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Literal', - value: 4, - raw: '4', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 5, - raw: '5', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Literal', - value: 6, - raw: '6', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - } - - }, - - 'Array Initializer': { - - 'x = []': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }], - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - }, - tokens: [{ - type: 'Identifier', - value: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, { - type: 'Punctuator', - value: '=', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Punctuator', - value: '[', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: ']', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }] - }, - - 'x = [ ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x = [ 42 ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [{ - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }], - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - - 'x = [ 42, ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [{ - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }], - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'x = [ ,, 42 ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [ - null, - null, - { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'x = [ 1, 2, 3, ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [{ - type: 'Literal', - value: 1, - raw: '1', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'Literal', - value: 2, - raw: '2', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, { - type: 'Literal', - value: 3, - raw: '3', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }], - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - 'x = [ 1, 2,, 3, ]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ArrayExpression', - elements: [{ - type: 'Literal', - value: 1, - raw: '1', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'Literal', - value: 2, - raw: '2', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, null, { - type: 'Literal', - value: 3, - raw: '3', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - '日本語 = []': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: '日本語', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'T\u203F = []': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'T\u203F', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'T\u200C = []': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'T\u200C', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'T\u200D = []': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'T\u200D', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '\u2163\u2161 = []': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: '\u2163\u2161', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '\u2163\u2161\u200A=\u2009[]': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: '\u2163\u2161', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Object Initializer': { - - 'x = {}': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [], - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x = { }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x = { answer: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'answer', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [14, 16], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 16 } - } - }, - kind: 'init', - range: [6, 16], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 16 } - } - }], - range: [4, 18], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }, - - 'x = { if: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'if', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - kind: 'init', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }], - range: [4, 14], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'x = { true: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'true', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - kind: 'init', - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }], - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - 'x = { false: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'false', - range: [6, 11], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 11 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } - } - }, - kind: 'init', - range: [6, 15], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - 'x = { null: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'null', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - kind: 'init', - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }], - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - 'x = { "answer": 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 'answer', - raw: '"answer"', - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [16, 18], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 18 } - } - }, - kind: 'init', - range: [6, 18], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 18 } - } - }], - range: [4, 20], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - - 'x = { x: 1, x: 2 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [ - { - type: 'Property', - key: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - value: { - type: 'Literal', - value: 1, - raw: '1', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - kind: 'init', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - { - type: 'Property', - key: { - type: 'Identifier', - name: 'x', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - value: { - type: 'Literal', - value: 2, - raw: '2', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, - kind: 'init', - range: [12, 16], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 16 } - } - } - ], - range: [4, 18], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }, - - 'x = { get width() { return m_width } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'width', - range: [10, 15], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: { - type: 'Identifier', - name: 'm_width', - range: [27, 34], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } - } - }, - range: [20, 35], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 35 } - } - }], - range: [18, 36], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 36 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 36], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 36 } - } - }, - kind: 'get', - range: [6, 36], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 36 } - } - }], - range: [4, 38], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 38 } - } - }, - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - - 'x = { get undef() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'undef', - range: [10, 15], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - kind: 'get', - range: [6, 20], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 20 } - } - }], - range: [4, 22], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - 'x = { get if() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'if', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - kind: 'get', - range: [6, 17], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 17 } - } - }], - range: [4, 19], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - - 'x = { get true() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'true', - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [17, 19], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 19 } - } - }, - rest: null, - generator: false, - expression: false, - range: [17, 19], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 19 } - } - }, - kind: 'get', - range: [6, 19], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 19 } - } - }], - range: [4, 21], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'x = { get false() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'false', - range: [10, 15], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - kind: 'get', - range: [6, 20], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 20 } - } - }], - range: [4, 22], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - 'x = { get null() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'null', - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [17, 19], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 19 } - } - }, - rest: null, - generator: false, - expression: false, - range: [17, 19], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 19 } - } - }, - kind: 'get', - range: [6, 19], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 19 } - } - }], - range: [4, 21], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'x = { get "undef"() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 'undef', - raw: '"undef"', - range: [10, 17], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 17 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [20, 22], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } - } - }, - rest: null, - generator: false, - expression: false, - range: [20, 22], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } - } - }, - kind: 'get', - range: [6, 22], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 22 } - } - }], - range: [4, 24], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'x = { get 10() {} }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 10, - raw: '10', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - kind: 'get', - range: [6, 17], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 17 } - } - }], - range: [4, 19], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - - 'x = { set width(w) { m_width = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'width', - range: [10, 15], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_width', - range: [21, 28], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 28 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [31, 32], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 32 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } - }, - range: [21, 33], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 33 } - } - }], - range: [19, 34], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [19, 34], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } - } - }, - kind: 'set', - range: [6, 34], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } - } - }], - range: [4, 36], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'x = { set if(w) { m_if = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'if', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_if', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [25, 26], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } - } - }, - range: [18, 26], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 26 } - } - }, - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }], - range: [16, 28], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 28 } - } - }, - rest: null, - generator: false, - expression: false, - range: [16, 28], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 28 } - } - }, - kind: 'set', - range: [6, 28], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 28 } - } - }], - range: [4, 30], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 30 } - } - }, - range: [0, 30], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } - } - }, - range: [0, 30], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } - } - }, - - 'x = { set true(w) { m_true = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'true', - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_true', - range: [20, 26], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 26 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [29, 30], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 30], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }], - range: [18, 32], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 32], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } - } - }, - kind: 'set', - range: [6, 32], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 32 } - } - }], - range: [4, 34], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - - 'x = { set false(w) { m_false = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'false', - range: [10, 15], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_false', - range: [21, 28], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 28 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [31, 32], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 32 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } - }, - range: [21, 33], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 33 } - } - }], - range: [19, 34], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [19, 34], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } - } - }, - kind: 'set', - range: [6, 34], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } - } - }], - range: [4, 36], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'x = { set null(w) { m_null = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'null', - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_null', - range: [20, 26], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 26 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [29, 30], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 30], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }], - range: [18, 32], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 32], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } - } - }, - kind: 'set', - range: [6, 32], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 32 } - } - }], - range: [4, 34], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - - 'x = { set "null"(w) { m_null = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 'null', - raw: '"null"', - range: [10, 16], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 16 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_null', - range: [22, 28], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 28 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [31, 32], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 32 } - } - }, - range: [22, 32], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 32 } - } - }, - range: [22, 33], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 33 } - } - }], - range: [20, 34], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [20, 34], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 34 } - } - }, - kind: 'set', - range: [6, 34], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } - } - }], - range: [4, 36], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'x = { set 10(w) { m_null = w } }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 10, - raw: '10', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'w', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'm_null', - range: [18, 24], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 24 } - } - }, - right: { - type: 'Identifier', - name: 'w', - range: [27, 28], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 28 } - } - }, - range: [18, 28], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 28 } - } - }, - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }], - range: [16, 30], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 30 } - } - }, - rest: null, - generator: false, - expression: false, - range: [16, 30], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 30 } - } - }, - kind: 'set', - range: [6, 30], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 30 } - } - }], - range: [4, 32], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 32 } - } - }, - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - - 'x = { get: 42 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'get', - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [11, 13], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } - } - }, - kind: 'init', - range: [6, 13], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 13 } - } - }], - range: [4, 15], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - - 'x = { set: 43 }': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'set', - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - value: { - type: 'Literal', - value: 43, - raw: '43', - range: [11, 13], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } - } - }, - kind: 'init', - range: [6, 13], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 13 } - } - }], - range: [4, 15], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - } - - }, - - 'Comments': { - - '/* block comment */ 42': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [20, 22], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } - } - }, - range: [20, 22], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 22 } - } - }, - - '42 /*The*/ /*Answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }], - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - comments: [{ - type: 'Block', - value: 'The', - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, { - type: 'Block', - value: 'Answer', - range: [11, 21], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } - } - }] - }, - - '42 /*the*/ /*answer*/': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2] - }, - range: [0, 21] - }], - range: [0, 21], - comments: [{ - type: 'Block', - value: 'the', - range: [3, 10] - }, { - type: 'Block', - value: 'answer', - range: [11, 21] - }] - }, - - '/* multiline\ncomment\nshould\nbe\nignored */ 42': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - range: [42, 44], - loc: { - start: { line: 5, column: 11 }, - end: { line: 5, column: 13 } - } - }, - - '/*a\r\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [9, 11], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\r\nb', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\rb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\rb', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nb*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - range: [8, 10], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\nb', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '/*a\nc*/ 42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }, - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - } - }], - loc: { - start: { line: 2, column: 4 }, - end: { line: 2, column: 6 } - }, - comments: [{ - type: 'Block', - value: 'a\nc', - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 3 } - } - }] - }, - - '// line comment\n42': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [16, 18], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }, - range: [16, 18], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }, - - '42 // line comment': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - comments: [{ - type: 'Line', - value: ' line comment', - range: [3, 18], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 18 } - } - }] - }, - - '// Hello, world!\n42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }, - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }], - range: [17, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }] - }, - - '// Hello, world!\n': { - type: 'Program', - body: [], - range: [17, 17], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } - }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }] - }, - - '// Hallo, world!\n': { - type: 'Program', - body: [], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 0 } - }, - comments: [{ - type: 'Line', - value: ' Hallo, world!', - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }] - }, - - '//\n42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }, - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }], - range: [3, 5], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - }, - comments: [{ - type: 'Line', - value: '', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }] - }, - - '//': { - type: 'Program', - body: [], - range: [2, 2], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 2 } - }, - comments: [{ - type: 'Line', - value: '', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }] - }, - - '// ': { - type: 'Program', - body: [], - range: [3, 3], - comments: [{ - type: 'Line', - value: ' ', - range: [0, 3] - }] - }, - - '/**/42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }], - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - }, - comments: [{ - type: 'Block', - value: '', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }] - }, - - '// Hello, world!\n\n// Another hello\n42': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [37, 39], - loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } - } - }, - range: [37, 39], - loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } - } - }], - range: [37, 39], - loc: { - start: { line: 4, column: 0 }, - end: { line: 4, column: 2 } - }, - comments: [{ - type: 'Line', - value: ' Hello, world!', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Line', - value: ' Another hello', - range: [18, 36], - loc: { - start: { line: 3, column: 0 }, - end: { line: 3, column: 18 } - } - }] - }, - - 'if (x) { // Some comment\ndoThat(); }': { - type: 'Program', - body: [{ - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - consequent: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [25, 31], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }, - 'arguments': [], - range: [25, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 8 } - } - }, - range: [25, 34], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 9 } - } - }], - range: [7, 36], - loc: { - start: { line: 1, column: 7 }, - end: { line: 2, column: 11 } - } - }, - alternate: null, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } - } - }], - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 11 } - }, - comments: [{ - type: 'Line', - value: ' Some comment', - range: [9, 24], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 24 } - } - }] - }, - - 'switch (answer) { case 42: /* perfect */ bingo() }': { - type: 'Program', - body: [{ - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } - } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'bingo', - range: [41, 46], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 46 } - } - }, - 'arguments': [], - range: [41, 48], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 48 } - } - }, - range: [41, 49], - loc: { - start: { line: 1, column: 41 }, - end: { line: 1, column: 49 } - } - }], - range: [18, 49], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 49 } - } - }], - range: [0, 50], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } - } - }], - range: [0, 50], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 50 } - }, - comments: [{ - type: 'Block', - value: ' perfect ', - range: [27, 40], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 40 } - } - }] - } - - }, - - 'Numeric Literals': { - - '0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - - '42': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42, - raw: '42', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - '3': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 3, - raw: '3', - range: [0, 1] - }, - range: [0, 1] - }], - range: [0, 1], - tokens: [{ - type: 'Numeric', - value: '3', - range: [0, 1] - }] - }, - - '5': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 5, - raw: '5', - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - }, - tokens: [{ - type: 'Numeric', - value: '5', - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }] - }, - - '.14': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0.14, - raw: '.14', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - '3.14159': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 3.14159, - raw: '3.14159', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '6.02214179e+23': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 6.02214179e+23, - raw: '6.02214179e+23', - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - '1.492417830e-10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 1.49241783e-10, - raw: '1.492417830e-10', - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - - '0x0': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0x0', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - '0e+100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0, - raw: '0e+100', - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '0xabc': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xabc, - raw: '0xabc', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0xdef': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0xdef, - raw: '0xdef', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X1A': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x1A, - raw: '0X1A', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '0x10': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x10, - raw: '0x10', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '0x100': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0x100, - raw: '0x100', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '0X04': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 0X04, - raw: '0X04', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '02': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 2, - raw: '02', - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - '012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '012', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - '0012': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 10, - raw: '0012', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - } - - }, - - 'String Literals': { - - '"Hello"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello', - raw: '"Hello"', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: '\n\r\t\x0B\b\f\\\'"\x00', - raw: '"\\n\\r\\t\\v\\b\\f\\\\\\\'\\"\\0"', - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - '"\\u0061"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\u0061"', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - '"\\x61"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'a', - raw: '"\\x61"', - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '"\\u00"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'u00', - raw: '"\\u00"', - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '"\\xt"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'xt', - raw: '"\\xt"', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '"Hello\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\nworld', - raw: '"Hello\\nworld"', - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - '"Hello\\\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\nworld"', - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 14 } - } - }, - - '"Hello\\02World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u0002World', - raw: '"Hello\\02World"', - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - - '"Hello\\012World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000AWorld', - raw: '"Hello\\012World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\122World', - raw: '"Hello\\122World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\0122World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u000A2World', - raw: '"Hello\\0122World"', - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - '"Hello\\312World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u00CAWorld', - raw: '"Hello\\312World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\412World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\412World', - raw: '"Hello\\412World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\812World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello812World', - raw: '"Hello\\812World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\712World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\712World', - raw: '"Hello\\712World"', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '"Hello\\0World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u0000World', - raw: '"Hello\\0World"', - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - '"Hello\\\r\nworld"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Helloworld', - raw: '"Hello\\\r\nworld"', - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 15 } - } - }, - - '"Hello\\1World"': { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'Hello\u0001World', - raw: '"Hello\\1World"', - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - }, - - 'Regular Expression Literals': { - - 'var x = /[a-z]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[a-z]/i', - raw: '/[a-z]/i', - range: [8, 16], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }, - range: [4, 16], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }], - kind: 'var', - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[a-z]/i', - range: [8, 16], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }] - }, - - 'var x = /[x-z]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5] - }, - init: { - type: 'Literal', - value: '/[x-z]/i', - raw: '/[x-z]/i', - range: [8, 16] - }, - range: [4, 16] - }], - kind: 'var', - range: [0, 16] - }], - range: [0, 16], - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3] - }, { - type: 'Identifier', - value: 'x', - range: [4, 5] - }, { - type: 'Punctuator', - value: '=', - range: [6, 7] - }, { - type: 'RegularExpression', - value: '/[x-z]/i', - range: [8, 16] - }] - }, - - 'var x = /[a-c]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[a-c]/i', - raw: '/[a-c]/i', - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }, - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 16 } - } - }], - kind: 'var', - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[a-c]/i', - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 16 } - } - }] - }, - - 'var x = /[P QR]/i': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/i', - raw: '/[P QR]/i', - range: [8, 17], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } - } - }, - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }], - kind: 'var', - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }], - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/i', - range: [8, 17], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 17 } - } - }] - }, - - 'var x = /[\\]/]/': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: new RegExp('[\\]/]').toString(), - raw: '/[\\]/]/', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - range: [4, 15], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 15 } - } - }], - kind: 'var', - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }], - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[\\]/]/', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }] - }, - - 'var x = /foo\\/bar/': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/foo\\/bar/', - raw: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } - } - }], - kind: 'var', - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/foo\\/bar/', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }] - }, - - 'var x = /=([^=\\s])+/g': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/=([^=\\s])+/g', - raw: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }, - range: [4, 21], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 21 } - } - }], - kind: 'var', - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }], - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/=([^=\\s])+/g', - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }] - }, - - 'var x = /[P QR]/\\u0067': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } - }, - range: [4, 22], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }], - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\u0067', - range: [8, 22], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 22 } - } - }] - }, - - 'var x = /[P QR]/\\g': { - type: 'Program', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: '/[P QR]/g', - raw: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }, - range: [4, 18], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 18 } - } - }], - kind: 'var', - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }], - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - }, - tokens: [{ - type: 'Keyword', - value: 'var', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, { - type: 'Identifier', - value: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'Punctuator', - value: '=', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, { - type: 'RegularExpression', - value: '/[P QR]/\\g', - range: [8, 18], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 18 } - } - }] - } - - }, - - 'Left-Hand-Side Expression': { - - 'new Button': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - - 'new Button()': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'Button', - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, - 'arguments': [], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - - 'new new foo': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'new new foo()': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'new foo().bar()': { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - 'arguments': [], - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - range: [0, 15], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 15 } - } - }, - - 'new foo[bar]': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 12], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - - 'new foo.bar()': { - type: 'ExpressionStatement', - expression: { - type: 'NewExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'foo', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [8, 11], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 11 } - } - }, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - 'arguments': [], - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - '( new foo).bar()': { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'NewExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [6, 9], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 9 } - } - }, - 'arguments': [], - range: [2, 9], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 9 } - } - }, - property: { - type: 'Identifier', - name: 'bar', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - 'arguments': [], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - 'foo(bar, baz)': { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'bar', - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, { - type: 'Identifier', - name: 'baz', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }], - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - '( foo )()': { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'universe.milkyway': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - 'universe.milkyway.solarsystem': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - - 'universe.milkyway.solarsystem.Earth': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [9, 17], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - property: { - type: 'Identifier', - name: 'solarsystem', - range: [18, 29], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 29 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - property: { - type: 'Identifier', - name: 'Earth', - range: [30, 35], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 35 } - } - }, - range: [0, 35], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } - } - }, - range: [0, 35], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } - } - }, - - 'universe[galaxyName, otherUselessName]': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'SequenceExpression', - expressions: [{ - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, { - type: 'Identifier', - name: 'otherUselessName', - range: [21, 37], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 37 } - } - }], - range: [9, 37], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 37 } - } - }, - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - - 'universe[galaxyName]': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'galaxyName', - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - - 'universe[42].galaxies': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: true, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'universe(42).galaxies': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'universe(42).galaxies(14, 3, 77).milkyway': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 42, - raw: '42', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }], - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - property: { - type: 'Identifier', - name: 'galaxies', - range: [13, 21], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 14, - raw: '14', - range: [22, 24], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 24 } - } - }, { - type: 'Literal', - value: 3, - raw: '3', - range: [26, 27], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 27 } - } - }, { - type: 'Literal', - value: 77, - raw: '77', - range: [29, 31], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 31 } - } - }], - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - property: { - type: 'Identifier', - name: 'milkyway', - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - } - }, - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - } - }, - - 'earth.asia.Indonesia.prepareForElection(2014)': { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'earth', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - property: { - type: 'Identifier', - name: 'asia', - range: [6, 10], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - property: { - type: 'Identifier', - name: 'Indonesia', - range: [11, 20], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - property: { - type: 'Identifier', - name: 'prepareForElection', - range: [21, 39], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 39 } - } - }, - range: [0, 39], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 39 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 2014, - raw: '2014', - range: [40, 44], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 44 } - } - }], - range: [0, 45], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } - } - }, - range: [0, 45], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 45 } - } - }, - - 'universe.if': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'if', - range: [9, 11], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'universe.true': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'true', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'universe.false': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'false', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'universe.null': { - type: 'ExpressionStatement', - expression: { - type: 'MemberExpression', - computed: false, - object: { - type: 'Identifier', - name: 'universe', - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - property: { - type: 'Identifier', - name: 'null', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - } - - }, - - 'Postfix Expressions': { - - 'x++': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - 'x--': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - 'eval++': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'eval--': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - prefix: false, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'arguments++': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'arguments--': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - prefix: false, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - } - - }, - - 'Unary Operators': { - - '++x': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - prefix: true, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - '--x': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - prefix: true, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - '++eval': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '--eval': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - '++arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } - } - }, - prefix: true, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - '--arguments': { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [2, 11], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } - } - }, - prefix: true, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - '+x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: '+', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - '-x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: '-', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - '~x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: '~', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - '!x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: '!', - argument: { - type: 'Identifier', - name: 'x', - range: [1, 2], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 2 } - } - }, - prefix: true, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - }, - - 'void x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: 'void', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: true, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'delete x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: 'delete', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'typeof x': { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: 'typeof', - argument: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - prefix: true, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - } - - }, - - 'Multiplicative Operators': { - - 'x * y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x / y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x % y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - } - - }, - - 'Additive Operators': { - - 'x + y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x - y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - } - - }, - - 'Bitwise Shift Operator': { - - 'x << y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x >> y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x >>> y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '>>>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Relational Operators': { - - 'x < y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x > y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '>', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x <= y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x >= y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '>=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x in y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x instanceof y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: 'instanceof', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'x < y < z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - } - - }, - - 'Equality Operators': { - - 'x == y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x != y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x === y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '===', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x !== y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '!==', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Binary Bitwise Operators': { - - 'x & y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x ^ y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'x | y': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - } - - }, - - 'Binary Expressions': { - - 'x + y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x - y + z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x + y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x - y - z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x + y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x + y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '+', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x - y % z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '-', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x * y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x * y / z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '/', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x * y % z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x % y * z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'BinaryExpression', - operator: '%', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x << y << z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'BinaryExpression', - operator: '<<', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'x | y | z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x & y & z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x ^ y ^ z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x & y | z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x | y ^ z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x | y & z': { - type: 'ExpressionStatement', - expression: { - type: 'BinaryExpression', - operator: '|', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '&', - left: { - type: 'Identifier', - name: 'y', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - } - - }, - - 'Binary Logical Operators': { - - 'x || y': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x && y': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'x || y || z': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'x && y && z': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'x || y && z': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [5, 11], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'x || y ^ z': { - type: 'ExpressionStatement', - expression: { - type: 'LogicalExpression', - operator: '||', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'BinaryExpression', - operator: '^', - left: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'Identifier', - name: 'z', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - } - - }, - - 'Conditional Operator': { - - 'y ? 1 : 2': { - type: 'ExpressionStatement', - expression: { - type: 'ConditionalExpression', - test: { - type: 'Identifier', - name: 'y', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x && y ? 1 : 2': { - type: 'ExpressionStatement', - expression: { - type: 'ConditionalExpression', - test: { - type: 'LogicalExpression', - operator: '&&', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - consequent: { - type: 'Literal', - value: 1, - raw: '1', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - alternate: { - type: 'Literal', - value: 2, - raw: '2', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Assignment Operators': { - - 'x = 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'eval = 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'eval', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'arguments = 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'arguments', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - 'x *= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '*=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x /= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '/=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x %= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '%=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x += 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '+=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x -= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '-=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x <<= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '<<=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'x >>= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '>>=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [6, 8], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'x >>>= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '>>>=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [7, 9], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'x &= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '&=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x ^= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '^=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - 'x |= 42': { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '|=', - left: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [5, 7], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - } - - }, - - 'Block': { - - '{ foo }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'foo', - range: [2, 5], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 5 } - } - }, - range: [2, 6], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 6 } - } - }], - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '{ doThis(); doThat(); }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThis', - range: [2, 8], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } - } - }, - 'arguments': [], - range: [2, 10], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 10 } - } - }, - range: [2, 11], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 11 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [12, 18], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 18 } - } - }, - 'arguments': [], - range: [12, 20], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 20 } - } - }, - range: [12, 21], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 21 } - } - }], - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - } - }, - - '{}': { - type: 'BlockStatement', - body: [], - range: [0, 2], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 2 } - } - } - - }, - - 'Variable Statement': { - - 'var x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: null, - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }], - kind: 'var', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - 'var x, y;': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: null, - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - init: null, - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }], - kind: 'var', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'var x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [8, 10], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } - } - }, - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }], - kind: 'var', - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - - 'var eval = 42, arguments = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'eval', - range: [4, 8], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 8 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [11, 13], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } - } - }, - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'arguments', - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - range: [15, 29], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 29 } - } - }], - kind: 'var', - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - - 'var x = 14, y = 3, z = 1977': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [8, 10], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 10 } - } - }, - range: [4, 10], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 10 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - range: [12, 17], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 17 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [23, 27], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 27 } - } - }, - range: [19, 27], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } - } - }], - kind: 'var', - range: [0, 27], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } - } - }, - - 'var implements, interface, package': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'implements', - range: [4, 14], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } - } - }, - init: null, - range: [4, 14], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 14 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'interface', - range: [16, 25], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } - } - }, - init: null, - range: [16, 25], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'package', - range: [27, 34], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } - } - }, - init: null, - range: [27, 34], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 34 } - } - }], - kind: 'var', - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - - 'var private, protected, public, static': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'private', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - init: null, - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'protected', - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - }, - init: null, - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'public', - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }, - init: null, - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'static', - range: [32, 38], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } - } - }, - init: null, - range: [32, 38], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 38 } - } - }], - kind: 'var', - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - } - - }, - - 'Let Statement': { - - 'let x': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: null, - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }], - kind: 'let', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - - '{ let x }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: null, - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }], - kind: 'let', - range: [2, 8], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 8 } - } - }], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - '{ let x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }], - kind: 'let', - range: [2, 13], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 13 } - } - }], - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - }, - - '{ let x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - range: [14, 19], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 19 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [25, 29], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 29 } - } - }, - range: [21, 29], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 29 } - } - }], - kind: 'let', - range: [2, 30], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 30 } - } - }], - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } - } - - }, - - 'Const Statement': { - - 'const x = 42': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }], - kind: 'const', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - - '{ const x = 42 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }], - kind: 'const', - range: [2, 15], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 15 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - - '{ const x = 14, y = 3, z = 1977 }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [12, 14], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 14 } - } - }, - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [16, 21], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'z', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - init: { - type: 'Literal', - value: 1977, - raw: '1977', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [23, 31], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } - } - }], - kind: 'const', - range: [2, 32], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 32 } - } - }], - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - } - } - - }, - - 'Empty Statement': { - - ';': { - type: 'EmptyStatement', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - } - - }, - - 'Expression Statement': { - - 'x': { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - - 'x, y': { - type: 'ExpressionStatement', - expression: { - type: 'SequenceExpression', - expressions: [{ - type: 'Identifier', - name: 'x', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, { - type: 'Identifier', - name: 'y', - range: [3, 4], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 4 } - } - }], - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - - '\\u0061': { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'a', - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }, - - 'a\\u0061': { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'aa', - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 7], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 7 } - } - }, - - '\\ua': { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'ua', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - - 'a\\u': { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'au', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - } - - }, - - 'If Statement': { - - 'if (morning) goodMorning()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodMorning', - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - alternate: null, - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - } - }, - - 'if (morning) (function(){})': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [24, 26], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 26 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 26], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 26 } - } - }, - range: [13, 27], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } - } - }, - alternate: null, - range: [0, 27], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } - } - }, - - 'if (morning) var x = 0;': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - range: [17, 22], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [13, 23], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 23 } - } - }, - alternate: null, - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - } - }, - - 'if (morning) function a(){}': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'a', - range: [22, 23], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 27], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 27 } - } - }, - rest: null, - generator: false, - expression: false, - range: [13, 27], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } - } - }, - alternate: null, - range: [0, 27], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } - } - }, - - 'if (morning) goodMorning(); else goodDay()': { - type: 'IfStatement', - test: { - type: 'Identifier', - name: 'morning', - range: [4, 11], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 11 } - } - }, - consequent: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodMorning', - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - range: [13, 27], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 27 } - } - }, - alternate: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'goodDay', - range: [33, 40], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 40 } - } - }, - 'arguments': [], - range: [33, 42], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } - } - }, - range: [33, 42], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 42 } - } - }, - range: [0, 42], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 42 } - } - } - - }, - - 'Iteration Statements': { - - 'do keep(); while (true)': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } - } - }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - } - }, - - 'do keep(); while (true);': { - type: 'DoWhileStatement', - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'keep', - range: [3, 7], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 7 } - } - }, - 'arguments': [], - range: [3, 9], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 9 } - } - }, - range: [3, 10], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 10 } - } - }, - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'do { x++; y--; } while (x < 10)': { - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - prefix: false, - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - range: [5, 9], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 9 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - prefix: false, - range: [10, 13], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 13 } - } - }, - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }], - range: [3, 16], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 16 } - } - }, - test: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - right: { - type: 'Literal', - value: 10, - raw: '10', - range: [28, 30], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 30 } - } - }, - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }, - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } - }, - - '{ do { } while (false) false }': { - type: 'BlockStatement', - body: [{ - type: 'DoWhileStatement', - body: { - type: 'BlockStatement', - body: [], - range: [5, 8], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 8 } - } - }, - test: { - type: 'Literal', - value: false, - raw: 'false', - range: [16, 21], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 21 } - } - }, - range: [2, 22], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 22 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: false, - raw: 'false', - range: [23, 28], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } - } - }, - range: [23, 29], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 29 } - } - }], - range: [0, 30], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } - } - }, - - 'while (true) doSomething()': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doSomething', - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - } - }, - - 'while (x < 10) { x++; y--; }': { - type: 'WhileStatement', - test: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - right: { - type: 'Literal', - value: 10, - raw: '10', - range: [11, 13], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } - } - }, - range: [7, 13], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 13 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }, - prefix: false, - range: [17, 20], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } - } - }, - range: [17, 21], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 21 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [22, 23], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } - } - }, - prefix: false, - range: [22, 25], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 25 } - } - }, - range: [22, 26], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 26 } - } - }], - range: [15, 28], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 28 } - } - }, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'for(;;);': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'for(;;){}': { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BlockStatement', - body: [], - range: [7, 9], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 9 } - } - }, - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - }, - - 'for(x = 0;;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'for(var x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }], - kind: 'var', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - 'for(let x = 0;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }], - kind: 'let', - range: [4, 13], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 13 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }, - - 'for(var x = 0, y = 1;;);': { - type: 'ForStatement', - init: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'Literal', - value: 0, - raw: '0', - range: [12, 13], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 13 } - } - }, - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, - init: { - type: 'Literal', - value: 1, - raw: '1', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }], - kind: 'var', - range: [4, 20], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 20 } - } - }, - test: null, - update: null, - body: { - type: 'EmptyStatement', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'for(x = 0; x < 42;);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - test: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: null, - body: { - type: 'EmptyStatement', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - - 'for(x = 0; x < 42; x++);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - test: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'EmptyStatement', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'for(x = 0; x < 42; x++) process(x);': { - type: 'ForStatement', - init: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - test: { - type: 'BinaryExpression', - operator: '<', - left: { - type: 'Identifier', - name: 'x', - range: [11, 12], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Literal', - value: 42, - raw: '42', - range: [15, 17], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 17 } - } - }, - range: [11, 17], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 17 } - } - }, - update: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'x', - range: [19, 20], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 20 } - } - }, - prefix: false, - range: [19, 22], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 22 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [24, 31], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 31 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [32, 33], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 33 } - } - }], - range: [24, 34], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 34 } - } - }, - range: [24, 35], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 35 } - } - }, - range: [0, 35], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } - } - }, - - 'for(x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [15, 22], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 22 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }], - range: [15, 25], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 25 } - } - }, - range: [15, 26], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 26 } - } - }, - each: false, - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - } - }, - - 'for (var x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: null, - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }], - kind: 'var', - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }], - range: [20, 30], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }, - each: false, - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } - }, - - 'for (var x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } - } - }, - range: [9, 15], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } - } - }], - kind: 'var', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [25, 32], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [33, 34], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } - } - }], - range: [25, 35], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } - } - }, - range: [25, 36], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } - } - }, - each: false, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'for (let x in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: null, - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }], - kind: 'let', - range: [5, 10], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 10 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }], - range: [20, 30], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 30 } - } - }, - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }, - each: false, - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } - }, - - 'for (let x = 42 in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: { - type: 'Literal', - value: 42, - raw: '42', - range: [13, 15], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 15 } - } - }, - range: [9, 15], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 15 } - } - }], - kind: 'let', - range: [5, 15], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [19, 23], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 23 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [25, 32], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 32 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [33, 34], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } - } - }], - range: [25, 35], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 35 } - } - }, - range: [25, 36], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 36 } - } - }, - each: false, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'for (var i = function() { return 10 in [] } in list) process(x);': { - type: 'ForInStatement', - left: { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'i', - range: [9, 10], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 10 } - } - }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: 'in', - left: { - type: 'Literal', - value: 10, - raw: '10', - range: [33, 35], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 35 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - range: [33, 41], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 41 } - } - }, - range: [26, 42], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 42 } - } - }], - range: [24, 43], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 43 } - } - }, - rest: null, - generator: false, - expression: false, - range: [13, 43], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 43 } - } - }, - range: [9, 43], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 43 } - } - }], - kind: 'var', - range: [5, 43], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 43 } - } - }, - right: { - type: 'Identifier', - name: 'list', - range: [47, 51], - loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 51 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'process', - range: [53, 60], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 60 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'x', - range: [61, 62], - loc: { - start: { line: 1, column: 61 }, - end: { line: 1, column: 62 } - } - }], - range: [53, 63], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 63 } - } - }, - range: [53, 64], - loc: { - start: { line: 1, column: 53 }, - end: { line: 1, column: 64 } - } - }, - each: false, - range: [0, 64], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 64 } - } - } - - }, - - 'continue statement': { - - 'while (true) { continue; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - } - ], - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - }, - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - } - }, - - 'while (true) { continue }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: null, - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - } - ], - range: [13, 25], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 25 } - } - }, - range: [0, 25], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } - } - }, - - 'done: while (true) { continue done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } - } - } - ], - range: [19, 36], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 36 } - } - }, - range: [6, 36], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - } - }, - - 'done: while (true) { continue done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'ContinueStatement', - label: { - type: 'Identifier', - name: 'done', - range: [30, 34], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 34 } - } - }, - range: [21, 35], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 35 } - } - } - ], - range: [19, 37], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 37 } - } - }, - range: [6, 37], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 37 } - } - }, - range: [0, 37], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 37 } - } - } - - }, - - 'break statement': { - - 'while (true) { break }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: null, - range: [15, 21], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 21 } - } - } - ], - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - 'done: while (true) { break done }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } - } - ], - range: [19, 33], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 33 } - } - }, - range: [6, 33], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 33 } - } - }, - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - } - }, - - 'done: while (true) { break done; }': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'done', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [13, 17], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 17 } - } - }, - body: { - type: 'BlockStatement', - body: [ - { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'done', - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [21, 32], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 32 } - } - } - ], - range: [19, 34], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 34 } - } - }, - range: [6, 34], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - } - - }, - - 'return statement': { - - '(function(){ return })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 21], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 21], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 21 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - }, - - '(function(){ return; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 20], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 20 } - } - } - ], - range: [11, 22], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 22 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 22], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - } - }, - - '(function(){ return x; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - range: [13, 22], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 22 } - } - } - ], - range: [11, 24], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 24 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 24], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 25], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } - } - }, - - '(function(){ return x * y })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - range: [13, 26], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 26 } - } - } - ], - range: [11, 27], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 27 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 27], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 27 } - } - }, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - } - }, - - 'with statement': { - - 'with (x) foo = bar': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - range: [0, 18], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 18 } - } - }, - - 'with (x) foo = bar;': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [9, 12], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 12 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [15, 18], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - range: [9, 19], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 19 } - } - }, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - - 'with (x) { foo = bar }': { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'foo', - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - right: { - type: 'Identifier', - name: 'bar', - range: [17, 20], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 20 } - } - }, - range: [11, 20], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 20 } - } - }, - range: [11, 21], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 21 } - } - }], - range: [9, 22], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 22 } - } - }, - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - } - } - - }, - - 'switch statement': { - - 'switch (x) {}': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'x', - range: [8, 9], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 9 } - } - }, - cases:[], - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, - - 'switch (answer) { case 42: hi(); break; }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } - } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'hi', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - 'arguments': [], - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } - } - }], - range: [18, 39], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } - } - }], - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - } - }, - - 'switch (answer) { case 42: hi(); break; default: break }': { - type: 'SwitchStatement', - discriminant: { - type: 'Identifier', - name: 'answer', - range: [8, 14], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 14 } - } - }, - cases: [{ - type: 'SwitchCase', - test: { - type: 'Literal', - value: 42, - raw: '42', - range: [23, 25], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 25 } - } - }, - consequent: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'hi', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - 'arguments': [], - range: [27, 31], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 31 } - } - }, - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, { - type: 'BreakStatement', - label: null, - range: [33, 39], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 39 } - } - }], - range: [18, 39], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 39 } - } - }, { - type: 'SwitchCase', - test: null, - consequent: [{ - type: 'BreakStatement', - label: null, - range: [49, 55], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 55 } - } - }], - range: [40, 55], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 55 } - } - }], - range: [0, 56], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 56 } - } - } - - }, - - 'Labelled Statements': { - - 'start: for (;;) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'ForStatement', - init: null, - test: null, - update: null, - body: { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'start', - range: [22, 27], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } - } - }, - range: [16, 27], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 27 } - } - }, - range: [7, 27], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 27 } - } - }, - range: [0, 27], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 27 } - } - }, - - 'start: while (true) break start': { - type: 'LabeledStatement', - label: { - type: 'Identifier', - name: 'start', - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - body: { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - body: { - type: 'BreakStatement', - label: { - type: 'Identifier', - name: 'start', - range: [26, 31], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } - } - }, - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }, - range: [7, 31], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 31 } - } - }, - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - } - } - - }, - - 'throw statement': { - - 'throw x;': { - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - range: [0, 8], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 8 } - } - }, - - 'throw x * y': { - type: 'ThrowStatement', - argument: { - type: 'BinaryExpression', - operator: '*', - left: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - right: { - type: 'Identifier', - name: 'y', - range: [10, 11], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 11 } - } - }, - range: [6, 11], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 11 } - } - }, - range: [0, 11], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 11 } - } - }, - - 'throw { message: "Error" }': { - type: 'ThrowStatement', - argument: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'message', - range: [8, 15], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 15 } - } - }, - value: { - type: 'Literal', - value: 'Error', - raw: '"Error"', - range: [17, 24], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 24 } - } - }, - kind: 'init', - range: [8, 24], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } - } - }], - range: [6, 26], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 26 } - } - }, - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - } - } - - }, - - 'try statement': { - - 'try { } catch (e) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'e', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [18, 21], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 21 } - } - }, - range: [8, 21], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 21 } - } - }], - finalizer: null, - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - } - }, - - 'try { } catch (eval) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'eval', - range: [15, 19], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 19 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } - } - }, - range: [8, 24], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 24 } - } - }], - finalizer: null, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'try { } catch (arguments) { }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'arguments', - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [26, 29], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 29 } - } - }, - range: [8, 29], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 29 } - } - }], - finalizer: null, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - - 'try { } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'e', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }], - range: [20, 26], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 26 } - } - }, - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }], - range: [18, 28], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 28 } - } - }, - range: [8, 28], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 28 } - } - }], - finalizer: null, - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - } - }, - - 'try { } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [4, 7], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 7 } - } - }, - guardedHandlers: [], - handlers: [], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'cleanup', - range: [18, 25], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 25 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'stuff', - range: [26, 31], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 31 } - } - }], - range: [18, 32], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 32 } - } - }, - range: [18, 33], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 33 } - } - }], - range: [16, 34], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 34 } - } - }, - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - - 'try { doThat(); } catch (e) { say(e) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'e', - range: [25, 26], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } - } - }, - range: [18, 38], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } - } - }], - finalizer: null, - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - - 'try { doThat(); } catch (e) { say(e) } finally { cleanup(stuff) }': { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'doThat', - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, - 'arguments': [], - range: [6, 14], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 14 } - } - }, - range: [6, 15], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 15 } - } - }], - range: [4, 17], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 17 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'e', - range: [25, 26], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 26 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'say', - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'e', - range: [34, 35], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 35 } - } - }], - range: [30, 36], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 36 } - } - }, - range: [30, 37], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 37 } - } - }], - range: [28, 38], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 38 } - } - }, - range: [18, 38], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 38 } - } - }], - finalizer: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'cleanup', - range: [49, 56], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 56 } - } - }, - 'arguments': [{ - type: 'Identifier', - name: 'stuff', - range: [57, 62], - loc: { - start: { line: 1, column: 57 }, - end: { line: 1, column: 62 } - } - }], - range: [49, 63], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 63 } - } - }, - range: [49, 64], - loc: { - start: { line: 1, column: 49 }, - end: { line: 1, column: 64 } - } - }], - range: [47, 65], - loc: { - start: { line: 1, column: 47 }, - end: { line: 1, column: 65 } - } - }, - range: [0, 65], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 65 } - } - } - - }, - - 'debugger statement': { - - 'debugger;': { - type: 'DebuggerStatement', - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 9 } - } - } - - }, - - 'Function Definition': { - - 'function hello() { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [19, 24], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 24 } - } - }, - 'arguments': [], - range: [19, 26], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 26 } - } - }, - range: [19, 27], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 27 } - } - }], - range: [17, 29], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 29 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - - 'function eval() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [16, 19], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 19 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - } - }, - - 'function arguments() { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'arguments', - range: [9, 18], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 18 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - } - }, - - 'function test(t, t) { }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'test', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [{ - type: 'Identifier', - name: 't', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, { - type: 'Identifier', - name: 't', - range: [17, 18], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 18 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - } - }, - - '(function test(t, t) { })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'test', - range: [10, 14], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 't', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Identifier', - name: 't', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [21, 24], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 24 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 24], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 24 } - } - }, - range: [0, 25], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 25 } - } - }, - - 'function eval() { function inner() { "use strict" } }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [9, 13], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 13 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'inner', - range: [27, 32], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 32 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\"use strict\"', - range: [37, 49], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 49 } - } - }, - range: [37, 50], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 50 } - } - }], - range: [35, 51], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 51 } - } - }, - rest: null, - generator: false, - expression: false, - range: [18, 51], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 51 } - } - }], - range: [16, 53], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 53 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 53], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 53 } - } - }, - - 'function hello(a) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [20, 25], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 25 } - } - }, - 'arguments': [], - range: [20, 27], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 27 } - } - }, - range: [20, 28], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 28 } - } - }], - range: [18, 30], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 30 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 30], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 30 } - } - }, - - 'function hello(a, b) { sayHi(); }': { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [{ - type: 'Identifier', - name: 'a', - range: [15, 16], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 16 } - } - }, { - type: 'Identifier', - name: 'b', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [23, 28], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 28 } - } - }, - 'arguments': [], - range: [23, 30], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 30 } - } - }, - range: [23, 31], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 31 } - } - }], - range: [21, 33], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - } - }, - - 'var hi = function() { sayHi() };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'hi', - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - init: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [22, 27], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 27 } - } - }, - 'arguments': [], - range: [22, 29], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 29 } - } - }, - range: [22, 30], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 30 } - } - }], - range: [20, 31], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 31 } - } - }, - rest: null, - generator: false, - expression: false, - range: [9, 31], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 31 } - } - }, - range: [4, 31], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 31 } - } - }], - kind: 'var', - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 32 } - } - }, - - 'var hi = function eval() { };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'hi', - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'eval', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [25, 28], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 28 } - } - }, - rest: null, - generator: false, - expression: false, - range: [9, 28], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 28 } - } - }, - range: [4, 28], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 28 } - } - }], - kind: 'var', - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 29 } - } - }, - - 'var hi = function arguments() { };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'hi', - range: [4, 6], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 6 } - } - }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'arguments', - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [30, 33], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [9, 33], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 33 } - } - }, - range: [4, 33], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 33 } - } - }], - kind: 'var', - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - } - }, - - 'var hello = function hi() { sayHi() };': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'hello', - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }, - init: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'hi', - range: [21, 23], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 23 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'sayHi', - range: [28, 33], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 33 } - } - }, - 'arguments': [], - range: [28, 35], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 35 } - } - }, - range: [28, 36], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 36 } - } - }], - range: [26, 37], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 37 } - } - }, - rest: null, - generator: false, - expression: false, - range: [12, 37], - loc: { - start: { line: 1, column: 12 }, - end: { line: 1, column: 37 } - } - }, - range: [4, 37], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 37 } - } - }], - kind: 'var', - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - } - }, - - '(function(){})': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [11, 13], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 13 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 13], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 13 } - } - }, - range: [0, 14], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 14 } - } - } - - }, - - 'Automatic semicolon insertion': { - - '{ x\n++y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - range: [2, 4], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } - } - }, - range: [4, 8], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } - } - }], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } - } - }, - - '{ x\n--y }': { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - range: [2, 4], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'y', - range: [6, 7], - loc: { - start: { line: 2, column: 2 }, - end: { line: 2, column: 3 } - } - }, - prefix: true, - range: [4, 7], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 3 } - } - }, - range: [4, 8], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 4 } - } - }], - range: [0, 9], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } - } - }, - - 'var x /* comment */;': { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - init: null, - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }], - kind: 'var', - range: [0, 20], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 20 } - } - }, - - '{ var x = 14, y = 3\nz; }': { - type: 'BlockStatement', - body: [{ - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [6, 7], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 7 } - } - }, - init: { - type: 'Literal', - value: 14, - raw: '14', - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - range: [6, 12], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 12 } - } - }, { - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'y', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - init: { - type: 'Literal', - value: 3, - raw: '3', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - range: [14, 19], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 19 } - } - }], - kind: 'var', - range: [2, 20], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'z', - range: [20, 21], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [20, 22], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - }], - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 4 } - } - }, - - 'while (true) { continue\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [24, 29], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [24, 30], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 32], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } - } - }, - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - 'while (true) { continue // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [35, 40], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [35, 41], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 43], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } - } - }, - range: [0, 43], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - 'while (true) { continue /* Multiline\nComment */there; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'ContinueStatement', - label: null, - range: [15, 23], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 23 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [47, 52], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } - } - }, - range: [47, 53], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } - } - }], - range: [13, 55], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } - } - }, - range: [0, 55], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } - } - }, - - 'while (true) { break\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [21, 26], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [21, 27], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 29], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } - } - }, - range: [0, 29], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - 'while (true) { break // Comment\nthere; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [32, 37], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [32, 38], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [13, 40], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 8 } - } - }, - range: [0, 40], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - 'while (true) { break /* Multiline\nComment */there; }': { - type: 'WhileStatement', - test: { - type: 'Literal', - value: true, - raw: 'true', - range: [7, 11], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 11 } - } - }, - body: { - type: 'BlockStatement', - body: [{ - type: 'BreakStatement', - label: null, - range: [15, 20], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 20 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'there', - range: [44, 49], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } - } - }, - range: [44, 50], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } - } - }], - range: [13, 52], - loc: { - start: { line: 1, column: 13 }, - end: { line: 2, column: 18 } - } - }, - range: [0, 52], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } - } - }, - - '(function(){ return\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [20, 21], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [20, 22], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - } - ], - range: [11, 24], - loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 24], - loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } - } - }, - range: [0, 25], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } - } - }, - - '(function(){ return // Comment\nx; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [31, 32], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 1 } - } - }, - range: [31, 33], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 2 } - } - } - ], - range: [11, 35], - loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 4 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 35], - loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 4 } - } - }, - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 5 } - } - }, - - '(function(){ return/* Multiline\nComment */x; })': { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [ - { - type: 'ReturnStatement', - argument: null, - range: [13, 19], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 19 } - } - }, - { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'x', - range: [42, 43], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 11 } - } - }, - range: [42, 44], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 12 } - } - } - ], - range: [11, 46], - loc: { - start: { line: 1, column: 11 }, - end: { line: 2, column: 14 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 46], - loc: { - start: { line: 1, column: 1 }, - end: { line: 2, column: 14 } - } - }, - range: [0, 47], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 15 } - } - }, - - '{ throw error\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 14], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'error', - range: [14, 19], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [14, 20], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - '{ throw error// Comment\nerror; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 24], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 0 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'error', - range: [24, 29], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 5 } - } - }, - range: [24, 30], - loc: { - start: { line: 2, column: 0 }, - end: { line: 2, column: 6 } - } - }], - range: [0, 32], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 8 } - } - }, - - '{ throw error/* Multiline\nComment */error; }': { - type: 'BlockStatement', - body: [{ - type: 'ThrowStatement', - argument: { - type: 'Identifier', - name: 'error', - range: [8, 13], - loc: { - start: { line: 1, column: 8 }, - end: { line: 1, column: 13 } - } - }, - range: [2, 36], - loc: { - start: { line: 1, column: 2 }, - end: { line: 2, column: 10 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'error', - range: [36, 41], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 15 } - } - }, - range: [36, 42], - loc: { - start: { line: 2, column: 10 }, - end: { line: 2, column: 16 } - } - }], - range: [0, 44], - loc: { - start: { line: 1, column: 0 }, - end: { line: 2, column: 18 } - } - } - - }, - - 'Source elements': { - - '': { - type: 'Program', - body: [], - range: [0, 0], - loc: { - start: { line: 0, column: 0 }, - end: { line: 0, column: 0 } - }, - tokens: [] - } - }, - - 'Invalid syntax': { - - '{': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected end of input' - }, - - '}': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token }' - }, - - '3ea': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in []': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e+': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3e-': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3x': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3x0': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '0x': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '09': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '018': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '01a': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '3in[]': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '0x3in[]': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '"Hello\nWorld"': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'x\\': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'x\\u005c': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'x\\u002a': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'var x = /(s/g': { - index: 13, - lineNumber: 1, - column: 14, - message: 'Error: Line 1: Invalid regular expression' - }, - - '/': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid regular expression: missing /' - }, - - '/test': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Invalid regular expression: missing /' - }, - - 'var x = /[a-z]/\\ux': { - index: 18, - lineNumber: 1, - column: 19, - message: 'Error: Line 1: Invalid regular expression' - }, - - '3 = 4': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - 'func() = 4': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '(1 + 1) = 10': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '1++': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '1--': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '++1': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '--1': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - 'for((1 + 1) in list) process(x);': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Invalid left-hand side in for-in' - }, - - '[': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected end of input' - }, - - '[,': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected end of input' - }, - - '1 + {': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - }, - - '1 + { t:t ': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Unexpected end of input' - }, - - '1 + { t:t,': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'var x = /\n/': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Invalid regular expression: missing /' - }, - - 'var x = "\n': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'var if = 42': { - index: 4, - lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token if' - }, - - 'i + 2 = 42': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '+i = 42': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }, - - '1 + (': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - }, - - '\n\n\n{': { - index: 4, - lineNumber: 4, - column: 2, - message: 'Error: Line 4: Unexpected end of input' - }, - - '\n/* Some multiline\ncomment */\n)': { - index: 30, - lineNumber: 4, - column: 1, - message: 'Error: Line 4: Unexpected token )' - }, - - '{ set 1 }': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Unexpected number' - }, - - '{ get 2 }': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Unexpected number' - }, - - '({ set: s(if) { } })': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Unexpected token if' - }, - - '({ set s(.) { } })': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token .' - }, - - '({ set s() { } })': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token )' - }, - - '({ set: s() { } })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Unexpected token {' - }, - - '({ set: s(a, b) { } })': { - index: 16, - lineNumber: 1, - column: 17, - message: 'Error: Line 1: Unexpected token {' - }, - - '({ get: g(d) { } })': { - index: 13, - lineNumber: 1, - column: 14, - message: 'Error: Line 1: Unexpected token {' - }, - - '({ get i() { }, i: 42 })': { - index: 21, - lineNumber: 1, - column: 22, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }, - - '({ i: 42, get i() { } })': { - index: 21, - lineNumber: 1, - column: 22, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }, - - '({ set i(x) { }, i: 42 })': { - index: 22, - lineNumber: 1, - column: 23, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }, - - '({ i: 42, set i(x) { } })': { - index: 22, - lineNumber: 1, - column: 23, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }, - - '({ get i() { }, get i() { } })': { - index: 27, - lineNumber: 1, - column: 28, - message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' - }, - - '({ set i(x) { }, set i(x) { } })': { - index: 29, - lineNumber: 1, - column: 30, - message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' - }, - - 'function t(if) { }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Unexpected token if' - }, - - 'function t(true) { }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Unexpected token true' - }, - - 'function t(false) { }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Unexpected token false' - }, - - 'function t(null) { }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Unexpected token null' - }, - - 'function null() { }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token null' - }, - - 'function true() { }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token true' - }, - - 'function false() { }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token false' - }, - - 'function if() { }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token if' - }, - - 'a b;': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected identifier' - }, - - 'if.a;': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token .' - }, - - 'a if;': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token if' - }, - - 'a class;': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected reserved word' - }, - - 'break\n': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Illegal break statement' - }, - - 'break 1;': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Unexpected number' - }, - - 'continue\n': { - index: 8, - lineNumber: 1, - column: 9, - message: 'Error: Line 1: Illegal continue statement' - }, - - 'continue 2;': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected number' - }, - - 'throw': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'throw;': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected token ;' - }, - - 'throw\n': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Illegal newline after throw' - }, - - 'for (var i, i2 in {});': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Unexpected token in' - }, - - 'for ((i in {}));': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Unexpected token )' - }, - - 'for (i + 1 in {});': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Invalid left-hand side in for-in' - }, - - 'for (+i in {});': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Invalid left-hand side in for-in' - }, - - 'if(false)': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'if(false) doThis(); else': { - index: 24, - lineNumber: 1, - column: 25, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'do': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'while(false)': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'for(;;)': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'with(x)': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'try { }': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Missing catch or finally after try' - }, - - 'try {} catch (42) {} ': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Unexpected number' - }, - - 'try {} catch (answer()) {} ': { - index: 20, - lineNumber: 1, - column: 21, - message: 'Error: Line 1: Unexpected token (' - }, - - 'try {} catch (-x) {} ': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Unexpected token -' - }, - - - '\u203F = 10': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'const x = 12, y;': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Unexpected token ;' - }, - - 'const x, y = 12;': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ,' - }, - - 'const x;': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ;' - }, - - 'if(true) let a = 1;': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token let' - }, - - 'if(true) const a = 1;': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token const' - }, - - 'switch (c) { default: default: }': { - index: 30, - lineNumber: 1, - column: 31, - message: 'Error: Line 1: More than one default clause in switch statement' - }, - - 'new X()."s"': { - index: 8, - lineNumber: 1, - column: 9, - message: 'Error: Line 1: Unexpected string' - }, - - '/*': { - index: 2, - lineNumber: 1, - column: 3, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '/*\n\n\n': { - index: 5, - lineNumber: 4, - column: 1, - message: 'Error: Line 4: Unexpected token ILLEGAL' - }, - - '/**': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '/*\n\n*': { - index: 5, - lineNumber: 3, - column: 2, - message: 'Error: Line 3: Unexpected token ILLEGAL' - }, - - '/*hello': { - index: 7, - lineNumber: 1, - column: 8, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '/*hello *': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '\n]': { - index: 1, - lineNumber: 2, - column: 1, - message: 'Error: Line 2: Unexpected token ]' - }, - - '\r]': { - index: 1, - lineNumber: 2, - column: 1, - message: 'Error: Line 2: Unexpected token ]' - }, - - '\r\n]': { - index: 2, - lineNumber: 2, - column: 1, - message: 'Error: Line 2: Unexpected token ]' - }, - - '\n\r]': { - index: 2, - lineNumber: 3, - column: 1, - message: 'Error: Line 3: Unexpected token ]' - }, - - '//\r\n]': { - index: 4, - lineNumber: 2, - column: 1, - message: 'Error: Line 2: Unexpected token ]' - }, - - '//\n\r]': { - index: 4, - lineNumber: 3, - column: 1, - message: 'Error: Line 3: Unexpected token ]' - }, - - '/a\\\n/': { - index: 4, - lineNumber: 1, - column: 5, - message: 'Error: Line 1: Invalid regular expression: missing /' - }, - - '//\r \n]': { - index: 5, - lineNumber: 3, - column: 1, - message: 'Error: Line 3: Unexpected token ]' - }, - - '/*\r\n*/]': { - index: 6, - lineNumber: 2, - column: 3, - message: 'Error: Line 2: Unexpected token ]' - }, - - '/*\n\r*/]': { - index: 6, - lineNumber: 3, - column: 3, - message: 'Error: Line 3: Unexpected token ]' - }, - - '/*\r \n*/]': { - index: 7, - lineNumber: 3, - column: 3, - message: 'Error: Line 3: Unexpected token ]' - }, - - '\\\\': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '\\u005c': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - - '\\x': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '\\u0000': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '\u200C = []': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '\u200D = []': { - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '"\\': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - '"\\u': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected token ILLEGAL' - }, - - 'try { } catch() {}': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Unexpected token )' - }, - - 'return': { - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Illegal return statement' - }, - - 'break': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Illegal break statement' - }, - - 'continue': { - index: 8, - lineNumber: 1, - column: 9, - message: 'Error: Line 1: Illegal continue statement' - }, - - 'switch (x) { default: continue; }': { - index: 31, - lineNumber: 1, - column: 32, - message: 'Error: Line 1: Illegal continue statement' - }, - - 'do { x } *': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token *' - }, - - 'while (true) { break x; }': { - index: 22, - lineNumber: 1, - column: 23, - message: 'Error: Line 1: Undefined label \'x\'' - }, - - 'while (true) { continue x; }': { - index: 25, - lineNumber: 1, - column: 26, - message: 'Error: Line 1: Undefined label \'x\'' - }, - - 'x: while (true) { (function () { break x; }); }': { - index: 40, - lineNumber: 1, - column: 41, - message: 'Error: Line 1: Undefined label \'x\'' - }, - - 'x: while (true) { (function () { continue x; }); }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Undefined label \'x\'' - }, - - 'x: while (true) { (function () { break; }); }': { - index: 39, - lineNumber: 1, - column: 40, - message: 'Error: Line 1: Illegal break statement' - }, - - 'x: while (true) { (function () { continue; }); }': { - index: 42, - lineNumber: 1, - column: 43, - message: 'Error: Line 1: Illegal continue statement' - }, - - 'x: while (true) { x: while (true) { } }': { - index: 20, - lineNumber: 1, - column: 21, - message: 'Error: Line 1: Label \'x\' has already been declared' - }, - - '(function () { \'use strict\'; delete i; }())': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' - }, - - '(function () { \'use strict\'; with (i); }())': { - index: 28, - lineNumber: 1, - column: 29, - message: 'Error: Line 1: Strict mode code may not include a with statement' - }, - - 'function hello() {\'use strict\'; ({ i: 42, i: 42 }) }': { - index: 47, - lineNumber: 1, - column: 48, - message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; ({ hasOwnProperty: 42, hasOwnProperty: 42 }) }': { - index: 73, - lineNumber: 1, - column: 74, - message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; var eval = 10; }': { - index: 40, - lineNumber: 1, - column: 41, - message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; var arguments = 10; }': { - index: 45, - lineNumber: 1, - column: 46, - message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; try { } catch (eval) { } }': { - index: 51, - lineNumber: 1, - column: 52, - message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; try { } catch (arguments) { } }': { - index: 56, - lineNumber: 1, - column: 57, - message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; eval = 10; }': { - index: 32, - lineNumber: 1, - column: 33, - message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; arguments = 10; }': { - index: 32, - lineNumber: 1, - column: 33, - message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; ++eval; }': { - index: 38, - lineNumber: 1, - column: 39, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; --eval; }': { - index: 38, - lineNumber: 1, - column: 39, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; ++arguments; }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; --arguments; }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; eval++; }': { - index: 36, - lineNumber: 1, - column: 37, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; eval--; }': { - index: 36, - lineNumber: 1, - column: 37, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; arguments++; }': { - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; arguments--; }': { - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }, - - 'function hello() {\'use strict\'; function eval() { } }': { - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; function arguments() { } }': { - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function eval() {\'use strict\'; }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function arguments() {\'use strict\'; }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; (function eval() { }()) }': { - index: 42, - lineNumber: 1, - column: 43, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; (function arguments() { }()) }': { - index: 42, - lineNumber: 1, - column: 43, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - '(function eval() {\'use strict\'; })()': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - '(function arguments() {\'use strict\'; })()': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - 'function hello() {\'use strict\'; ({ s: function eval() { } }); }': { - index: 47, - lineNumber: 1, - column: 48, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }, - - '(function package() {\'use strict\'; })()': { - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() {\'use strict\'; ({ i: 10, set s(eval) { } }); }': { - index: 48, - lineNumber: 1, - column: 49, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; ({ set s(eval) { } }); }': { - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello() {\'use strict\'; ({ s: function s(eval) { } }); }': { - index: 49, - lineNumber: 1, - column: 50, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello(eval) {\'use strict\';}': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello(arguments) {\'use strict\';}': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello() { \'use strict\'; function inner(eval) {} }': { - index: 48, - lineNumber: 1, - column: 49, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function hello() { \'use strict\'; function inner(arguments) {} }': { - index: 48, - lineNumber: 1, - column: 49, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - ' "\\1"; \'use strict\';': { - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { \'use strict\'; "\\1"; }': { - index: 33, - lineNumber: 1, - column: 34, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { \'use strict\'; 021; }': { - index: 33, - lineNumber: 1, - column: 34, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { \'use strict\'; ({ "\\1": 42 }); }': { - index: 36, - lineNumber: 1, - column: 37, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { \'use strict\'; ({ 021: 42 }); }': { - index: 36, - lineNumber: 1, - column: 37, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { "octal directive\\1"; "use strict"; }': { - index: 19, - lineNumber: 1, - column: 20, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { "octal directive\\1"; "octal directive\\2"; "use strict"; }': { - index: 19, - lineNumber: 1, - column: 20, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { "use strict"; function inner() { "octal directive\\1"; } }': { - index: 52, - lineNumber: 1, - column: 53, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }, - - 'function hello() { "use strict"; var implements; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var interface; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var package; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var private; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var protected; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var public; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var static; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var yield; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello() { "use strict"; var let; }': { - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function hello(static) { "use strict"; }': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function static() { "use strict"; }': { - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'var yield': { - index: 4, - lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token yield' - }, - - 'var let': { - index: 4, - lineNumber: 1, - column: 5, - message: 'Error: Line 1: Unexpected token let' - }, - - '"use strict"; function static() { }': { - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function a(t, t) { "use strict"; }': { - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, - - 'function a(eval) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - 'function a(package) { "use strict"; }': { - index: 11, - lineNumber: 1, - column: 12, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'function a() { "use strict"; function b(t, t) { }; }': { - index: 43, - lineNumber: 1, - column: 44, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, - - '(function a(t, t) { "use strict"; })': { - index: 15, - lineNumber: 1, - column: 16, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, - - 'function a() { "use strict"; (function b(t, t) { }); }': { - index: 44, - lineNumber: 1, - column: 45, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }, - - '(function a(eval) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }, - - '(function a(package) { "use strict"; })': { - index: 12, - lineNumber: 1, - column: 13, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }, - - 'var': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'let': { - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Unexpected end of input' - }, - - 'const': { - index: 5, - lineNumber: 1, - column: 6, - message: 'Error: Line 1: Unexpected end of input' - } - - }, - - 'API': { - 'parse()': { - call: 'parse', - args: [], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'undefined' - } - }] - } - }, - - 'parse(null)': { - call: 'parse', - args: [null], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: null - } - }] - } - }, - - 'parse(42)': { - call: 'parse', - args: [42], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 - } - }] - } - }, - - 'parse(true)': { - call: 'parse', - args: [true], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true - } - }] - } - }, - - 'parse(undefined)': { - call: 'parse', - args: [void 0], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'undefined' - } - }] - } - }, - - 'parse(new String("test"))': { - call: 'parse', - args: [new String('test')], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Identifier', - name: 'test' - } - }] - } - }, - - 'parse(new Number(42))': { - call: 'parse', - args: [new Number(42)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 42 - } - }] - } - }, - - 'parse(new Boolean(true))': { - call: 'parse', - args: [new Boolean(true)], - result: { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: true - } - }] - } - }, - - 'Syntax': { - property: 'Syntax', - result: { - AssignmentExpression: 'AssignmentExpression', - ArrayExpression: 'ArrayExpression', - BlockStatement: 'BlockStatement', - BinaryExpression: 'BinaryExpression', - BreakStatement: 'BreakStatement', - CallExpression: 'CallExpression', - CatchClause: 'CatchClause', - ConditionalExpression: 'ConditionalExpression', - ContinueStatement: 'ContinueStatement', - DoWhileStatement: 'DoWhileStatement', - DebuggerStatement: 'DebuggerStatement', - EmptyStatement: 'EmptyStatement', - ExpressionStatement: 'ExpressionStatement', - ForStatement: 'ForStatement', - ForInStatement: 'ForInStatement', - FunctionDeclaration: 'FunctionDeclaration', - FunctionExpression: 'FunctionExpression', - Identifier: 'Identifier', - IfStatement: 'IfStatement', - Literal: 'Literal', - LabeledStatement: 'LabeledStatement', - LogicalExpression: 'LogicalExpression', - MemberExpression: 'MemberExpression', - NewExpression: 'NewExpression', - ObjectExpression: 'ObjectExpression', - Program: 'Program', - Property: 'Property', - ReturnStatement: 'ReturnStatement', - SequenceExpression: 'SequenceExpression', - SwitchStatement: 'SwitchStatement', - SwitchCase: 'SwitchCase', - ThisExpression: 'ThisExpression', - ThrowStatement: 'ThrowStatement', - TryStatement: 'TryStatement', - UnaryExpression: 'UnaryExpression', - UpdateExpression: 'UpdateExpression', - VariableDeclaration: 'VariableDeclaration', - VariableDeclarator: 'VariableDeclarator', - WhileStatement: 'WhileStatement', - WithStatement: 'WithStatement' - } - } - - }, - - 'Tolerant parse': { - 'return': { - type: 'Program', - body: [{ - type: 'ReturnStatement', - 'argument': null, - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - } - }], - range: [0, 6], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 6 } - }, - errors: [{ - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Illegal return statement' - }] - }, - - '(function () { \'use strict\'; with (i); }())': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\'use strict\'', - range: [15, 27], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 27 } - } - }, - range: [15, 28], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 28 } - } - }, { - type: 'WithStatement', - object: { - type: 'Identifier', - name: 'i', - range: [35, 36], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 36 } - } - }, - body: { - type: 'EmptyStatement', - range: [37, 38], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 38 } - } - }, - range: [29, 38], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 38 } - } - }], - range: [13, 40], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 40 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 40], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 40 } - } - }, - 'arguments': [], - range: [1, 42], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 42 } - } - }, - range: [0, 43], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 43 } - } - }], - range: [0, 43], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 43 } - }, - errors: [{ - index: 29, - lineNumber: 1, - column: 30, - message: 'Error: Line 1: Strict mode code may not include a with statement' - }] - }, - - '(function () { \'use strict\'; 021 }())': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'CallExpression', - callee: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\'use strict\'', - range: [15, 27], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 27 } - } - }, - range: [15, 28], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 28 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 17, - raw: "021", - range: [29, 32], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 32 } - } - }, - range: [29, 33], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 33 } - } - }], - range: [13, 34], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [1, 34], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 34 } - } - }, - 'arguments': [], - range: [1, 36], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 36 } - } - }, - range: [0, 37], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 37 } - } - }], - range: [0, 37], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 37 } - }, - errors: [{ - index: 29, - lineNumber: 1, - column: 30, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }] - }, - - '"use strict"; delete x': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UnaryExpression', - operator: 'delete', - argument: { - type: 'Identifier', - name: 'x', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - prefix: true, - range: [14, 22], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 22 } - } - }, - range: [14, 22], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 22 } - } - }], - range: [0, 22], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 22 } - }, - errors: [{ - index: 22, - lineNumber: 1, - column: 23, - message: 'Error: Line 1: Delete of an unqualified identifier in strict mode.' - }] - }, - - '"use strict"; try {} catch (eval) {}': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'eval', - range: [28, 32], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 32 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [34, 36], - loc: { - start: { line: 1, column: 34 }, - end: { line: 1, column: 36 } - } - }, - range: [21, 36], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 36 } - } - }], - finalizer: null, - range: [14, 36], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 36 } - } - }], - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - }, - errors: [{ - index: 32, - lineNumber: 1, - column: 33, - message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; try {} catch (arguments) {}': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'TryStatement', - block: { - type: 'BlockStatement', - body: [], - range: [18, 20], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 20 } - } - }, - guardedHandlers: [], - handlers: [{ - type: 'CatchClause', - param: { - type: 'Identifier', - name: 'arguments', - range: [28, 37], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 37 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - range: [21, 41], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 41 } - } - }], - finalizer: null, - range: [14, 41], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 41 } - } - }], - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - }, - errors: [{ - index: 37, - lineNumber: 1, - column: 38, - message: 'Error: Line 1: Catch variable may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; var eval;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'eval', - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }, - init: null, - range: [18, 22], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 22 } - } - }], - kind: 'var', - range: [14, 23], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 23 } - } - }], - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - }, - errors: [{ - index: 22, - lineNumber: 1, - column: 23, - message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; var arguments;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'arguments', - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }, - init: null, - range: [18, 27], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 27 } - } - }], - kind: 'var', - range: [14, 28], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 28 } - } - }], - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - }, - errors: [{ - index: 27, - lineNumber: 1, - column: 28, - message: 'Error: Line 1: Variable name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; eval = 0;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'eval', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [21, 22], - loc: { - start: { line: 1, column: 21 }, - end: { line: 1, column: 22 } - } - }, - range: [14, 22], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 22 } - } - }, - range: [14, 23], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 23 } - } - }], - range: [0, 23], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 23 } - }, - errors: [{ - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' - }] - }, - - '"use strict"; eval++;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'eval', - range: [14, 18], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 18 } - } - }, - prefix: false, - range: [14, 20], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 20 } - } - }, - range: [14, 21], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 21 } - } - }], - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - errors: [{ - index: 18, - lineNumber: 1, - column: 19, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }] - }, - - '"use strict"; --eval;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'eval', - range: [16, 20], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 20 } - } - }, - prefix: true, - range: [14, 20], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 20 } - } - }, - range: [14, 21], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 21 } - } - }], - range: [0, 21], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 21 } - }, - errors: [{ - index: 20, - lineNumber: 1, - column: 21, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }] - }, - - '"use strict"; arguments = 0;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'arguments', - range: [14, 23], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 23 } - } - }, - right: { - type: 'Literal', - value: 0, - raw: '0', - range: [26, 27], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 27 } - } - }, - range: [14, 27], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 27 } - } - }, - range: [14, 28], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 28 } - } - }], - range: [0, 28], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 28 } - }, - errors: [{ - index: 14, - lineNumber: 1, - column: 15, - message: 'Error: Line 1: Assignment to eval or arguments is not allowed in strict mode' - }] - }, - - '"use strict"; arguments--;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Identifier', - name: 'arguments', - range: [14, 23], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 23 } - } - }, - prefix: false, - range: [14, 25], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 25 } - } - }, - range: [14, 26], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 26 } - } - }], - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - }, - errors: [{ - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Postfix increment/decrement may not have eval or arguments operand in strict mode' - }] - }, - - '"use strict"; ++arguments;': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Identifier', - name: 'arguments', - range: [16, 25], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 25 } - } - }, - prefix: true, - range: [14, 25], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 25 } - } - }, - range: [14, 26], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 26 } - } - }], - range: [0, 26], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 26 } - }, - errors: [{ - index: 25, - lineNumber: 1, - column: 26, - message: 'Error: Line 1: Prefix increment/decrement may not have eval or arguments operand in strict mode' - }] - }, - - - '"use strict";x={y:1,y:1}': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [13, 14], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 14 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'y', - range: [16, 17], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 17 } - } - }, - value: { - type: 'Literal', - value: 1, - raw: '1', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - kind: 'init', - range: [16, 19], - loc: { - start: { line: 1, column: 16 }, - end: { line: 1, column: 19 } - } - }, { - type: 'Property', - key: { - type: 'Identifier', - name: 'y', - range: [20, 21], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 21 } - } - }, - value: { - type: 'Literal', - value: 1, - raw: '1', - range: [22, 23], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 23 } - } - }, - kind: 'init', - range: [20, 23], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 23 } - } - }], - range: [15, 24], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 24 } - } - }, - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }, - range: [13, 24], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 24 } - } - }], - range: [0, 24], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 24 } - }, - errors: [{ - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Duplicate data property in object literal not allowed in strict mode' - }] - }, - - '"use strict"; function eval() {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'eval', - range: [23, 27], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 27 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [30, 32], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 32 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 32], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 32 } - } - }, { - type: 'EmptyStatement', - range: [32, 33], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 33 } - } - }], - range: [0, 33], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 33 } - }, - errors: [{ - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; function arguments() {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'arguments', - range: [23, 32], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 32 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [35, 37], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 37 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 37], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 37 } - } - }, { - type: 'EmptyStatement', - range: [37, 38], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 38 } - } - }], - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - }, - errors: [{ - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; function interface() {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'interface', - range: [23, 32], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 32 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [35, 37], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 37 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 37], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 37 } - } - }, { - type: 'EmptyStatement', - range: [37, 38], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 38 } - } - }], - range: [0, 38], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 38 } - }, - errors: [{ - index: 23, - lineNumber: 1, - column: 24, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }] - }, - - '"use strict"; (function eval() {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'eval', - range: [24, 28], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 28 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [31, 33], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 33], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 33 } - } - }, - range: [14, 35], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 35 } - } - }], - range: [0, 35], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 35 } - }, - errors: [{ - index: 24, - lineNumber: 1, - column: 25, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; (function arguments() {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'arguments', - range: [24, 33], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 33 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [36, 38], - loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 38 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 38], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 38 } - } - }, - range: [14, 40], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 40 } - } - }], - range: [0, 40], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 40 } - }, - errors: [{ - index: 24, - lineNumber: 1, - column: 25, - message: 'Error: Line 1: Function name may not be eval or arguments in strict mode' - }] - }, - - '"use strict"; (function interface() {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'interface', - range: [24, 33], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 33 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [36, 38], - loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 38 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 38], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 38 } - } - }, - range: [14, 40], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 40 } - } - }], - range: [0, 40], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 40 } - }, - errors: [{ - index: 24, - lineNumber: 1, - column: 25, - message: 'Error: Line 1: Use of future reserved word in strict mode' - }] - }, - - '"use strict"; function f(eval) {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'f', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - params: [{ - type: 'Identifier', - name: 'eval', - range: [25, 29], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 29 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [31, 33], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 33 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 33], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 33 } - } - }, { - type: 'EmptyStatement', - range: [33, 34], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 34 } - } - }], - range: [0, 34], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 34 } - }, - errors: [{ - index: 25, - lineNumber: 1, - column: 26, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }] - }, - - '"use strict"; function f(arguments) {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'f', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - params: [{ - type: 'Identifier', - name: 'arguments', - range: [25, 34], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 34 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [36, 38], - loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 38 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 38], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 38 } - } - }, { - type: 'EmptyStatement', - range: [38, 39], - loc: { - start: { line: 1, column: 38 }, - end: { line: 1, column: 39 } - } - }], - range: [0, 39], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 39 } - }, - errors: [{ - index: 25, - lineNumber: 1, - column: 26, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }] - }, - - '"use strict"; function f(foo, foo) {};': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'f', - range: [23, 24], - loc: { - start: { line: 1, column: 23 }, - end: { line: 1, column: 24 } - } - }, - params: [{ - type: 'Identifier', - name: 'foo', - range: [25, 28], - loc: { - start: { line: 1, column: 25 }, - end: { line: 1, column: 28 } - } - }, { - type: 'Identifier', - name: 'foo', - range: [31, 34], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 34 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [36, 38], - loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 38 } - } - }, - rest: null, - generator: false, - expression: false, - range: [14, 38], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 38 } - } - }, { - type: 'EmptyStatement', - range: [38, 39], - loc: { - start: { line: 1, column: 38 }, - end: { line: 1, column: 39 } - } - }], - range: [0, 39], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 39 } - }, - errors: [{ - index: 31, - lineNumber: 1, - column: 32, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }] - }, - - '"use strict"; (function f(eval) {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'f', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - params: [{ - type: 'Identifier', - name: 'eval', - range: [26, 30], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 30 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [32, 34], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 34], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 34 } - } - }, - range: [14, 36], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 36 } - } - }], - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - }, - errors: [{ - index: 26, - lineNumber: 1, - column: 27, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }] - }, - - - '"use strict"; (function f(arguments) {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'f', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - params: [{ - type: 'Identifier', - name: 'arguments', - range: [26, 35], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 35 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [37, 39], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 39 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 39], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 39 } - } - }, - range: [14, 41], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 41 } - } - }], - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - }, - errors: [{ - index: 26, - lineNumber: 1, - column: 27, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }] - }, - - '"use strict"; (function f(foo, foo) {});': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'FunctionExpression', - id: { - type: 'Identifier', - name: 'f', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - params: [{ - type: 'Identifier', - name: 'foo', - range: [26, 29], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 29 } - } - }, { - type: 'Identifier', - name: 'foo', - range: [32, 35], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 35 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [37, 39], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 39 } - } - }, - rest: null, - generator: false, - expression: false, - range: [15, 39], - loc: { - start: { line: 1, column: 15 }, - end: { line: 1, column: 39 } - } - }, - range: [14, 41], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 41 } - } - }], - range: [0, 41], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 41 } - }, - errors: [{ - index: 32, - lineNumber: 1, - column: 33, - message: 'Error: Line 1: Strict mode function may not have duplicate parameter names' - }] - }, - - '"use strict"; x = { set f(eval) {} }' : { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Identifier', - name: 'x', - range: [14, 15], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 15 } - } - }, - right: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'f', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - value : { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'eval', - range: [26, 30], - loc: { - start: { line: 1, column: 26 }, - end: { line: 1, column: 30 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [32, 34], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [32, 34], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 34 } - } - }, - kind: 'set', - range: [20, 34], - loc: { - start: { line: 1, column: 20 }, - end: { line: 1, column: 34 } - } - }], - range: [18, 36], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 36 } - } - }, - range: [14, 36], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 36 } - } - }, - range: [14, 36], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 36 } - } - }], - range: [0, 36], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 36 } - }, - errors: [{ - index: 26, - lineNumber: 1, - column: 27, - message: 'Error: Line 1: Parameter name eval or arguments is not allowed in strict mode' - }] - }, - - 'function hello() { "octal directive\\1"; "use strict"; }': { - type: 'Program', - body: [{ - type: 'FunctionDeclaration', - id: { - type: 'Identifier', - name: 'hello', - range: [9, 14], - loc: { - start: { line: 1, column: 9 }, - end: { line: 1, column: 14 } - } - }, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'octal directive\u0001', - raw: '"octal directive\\1"', - range: [19, 38], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 38 } - } - }, - range: [19, 39], - loc: { - start: { line: 1, column: 19 }, - end: { line: 1, column: 39 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [40, 52], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 52 } - } - }, - range: [40, 53], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 53 } - } - }], - range: [17, 55], - loc: { - start: { line: 1, column: 17 }, - end: { line: 1, column: 55 } - } - }, - rest: null, - generator: false, - expression: false, - range: [0, 55], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 55 } - } - }], - range: [0, 55], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 55 } - }, - errors: [{ - index: 19, - lineNumber: 1, - column: 20, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }] - }, - - '"\\1"; \'use strict\';': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: '\u0001', - raw: '"\\1"', - range: [0, 4], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 4 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, { - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '\'use strict\'', - range: [6, 18], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 18 } - } - }, - range: [6, 19], - loc: { - start: { line: 1, column: 6 }, - end: { line: 1, column: 19 } - } - }], - range: [0, 19], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 19 } - }, - errors: [{ - index: 0, - lineNumber: 1, - column: 1, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }] - }, - - '"use strict"; var x = { 014: 3}': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - init: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Literal', - value: 12, - raw: '014', - range: [24, 27], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 27 } - } - }, - value: { - type: 'Literal', - value: 3, - raw: '3', - range: [29, 30], - loc: { - start: { line: 1, column: 29 }, - end: { line: 1, column: 30 } - } - }, - kind: 'init', - range: [24, 30], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 30 } - } - }], - range: [22, 31], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 31 } - } - }, - range: [18, 31], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 31 } - } - }], - kind: 'var', - range: [14, 31], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 31 } - } - }], - range: [0, 31], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 31 } - }, - errors: [{ - index: 24, - lineNumber: 1, - column: 25, - message: 'Error: Line 1: Octal literals are not allowed in strict mode.' - }] - }, - - '"use strict"; var x = { get i() {}, get i() {} }': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - init: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [32, 34], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 34 } - } - }, - rest: null, - generator: false, - expression: false, - range: [32, 34], - loc: { - start: { line: 1, column: 32 }, - end: { line: 1, column: 34 } - } - }, - kind: 'get', - range: [24, 34], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 34 } - } - }, { - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [40, 41], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 41 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [44, 46], - loc: { - start: { line: 1, column: 44 }, - end: { line: 1, column: 46 } - } - }, - rest: null, - generator: false, - expression: false, - range: [44, 46], - loc: { - start: { line: 1, column: 44 }, - end: { line: 1, column: 46 } - } - }, - kind: 'get', - range: [36, 46], - loc: { - start: { line: 1, column: 36 }, - end: { line: 1, column: 46 } - } - }], - range: [22, 48], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 48 } - } - }, - range: [18, 48], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 48 } - } - }], - kind: 'var', - range: [14, 48], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 48 } - } - }], - range: [0, 48], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 48 } - }, - errors: [{ - index: 46, - lineNumber: 1, - column: 47, - message: 'Error: Line 1: Object literal may not have multiple get/set accessors with the same name' - }] - }, - - '"use strict"; var x = { i: 42, get i() {} }': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - init: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [24, 25], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 25 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [27, 29], - loc: { - start: { line: 1, column: 27 }, - end: { line: 1, column: 29 } - } - }, - kind: 'init', - range: [24, 29], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 29 } - } - }, { - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [35, 36], - loc: { - start: { line: 1, column: 35 }, - end: { line: 1, column: 36 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - rest: null, - generator: false, - expression: false, - range: [39, 41], - loc: { - start: { line: 1, column: 39 }, - end: { line: 1, column: 41 } - } - }, - kind: 'get', - range: [31, 41], - loc: { - start: { line: 1, column: 31 }, - end: { line: 1, column: 41 } - } - }], - range: [22, 43], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 43 } - } - }, - range: [18, 43], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 43 } - } - }], - kind: 'var', - range: [14, 43], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 43 } - } - }], - range: [0, 43], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 43 } - }, - errors: [{ - index: 41, - lineNumber: 1, - column: 42, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }] - }, - - '"use strict"; var x = { set i(x) {}, i: 42 }': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'Literal', - value: 'use strict', - raw: '"use strict"', - range: [0, 12], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 12 } - } - }, - range: [0, 13], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 13 } - } - }, { - type: 'VariableDeclaration', - declarations: [{ - type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'x', - range: [18, 19], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 19 } - } - }, - init: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [28, 29], - loc: { - start: { line: 1, column: 28 }, - end: { line: 1, column: 29 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [{ - type: 'Identifier', - name: 'x', - range: [30, 31], - loc: { - start: { line: 1, column: 30 }, - end: { line: 1, column: 31 } - } - }], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [33, 35], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 35 } - } - }, - rest: null, - generator: false, - expression: false, - range: [33, 35], - loc: { - start: { line: 1, column: 33 }, - end: { line: 1, column: 35 } - } - }, - kind: 'set', - range: [24, 35], - loc: { - start: { line: 1, column: 24 }, - end: { line: 1, column: 35 } - } - }, { - type: 'Property', - key: { - type: 'Identifier', - name: 'i', - range: [37, 38], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 38 } - } - }, - value: { - type: 'Literal', - value: 42, - raw: '42', - range: [40, 42], - loc: { - start: { line: 1, column: 40 }, - end: { line: 1, column: 42 } - } - }, - kind: 'init', - range: [37, 42], - loc: { - start: { line: 1, column: 37 }, - end: { line: 1, column: 42 } - } - }], - range: [22, 44], - loc: { - start: { line: 1, column: 22 }, - end: { line: 1, column: 44 } - } - }, - range: [18, 44], - loc: { - start: { line: 1, column: 18 }, - end: { line: 1, column: 44 } - } - }], - kind: 'var', - range: [14, 44], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 44 } - } - }], - range: [0, 44], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 44 } - }, - errors: [{ - index: 42, - lineNumber: 1, - column: 43, - message: 'Error: Line 1: Object literal may not have data and accessor property with the same name' - }] - - - }, - - '({ set s() { } })': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'ObjectExpression', - properties: [{ - type: 'Property', - key: { - type: 'Identifier', - name: 's', - range: [7, 8], - loc: { - start: { line: 1, column: 7 }, - end: { line: 1, column: 8 } - } - }, - value: { - type: 'FunctionExpression', - id: null, - params: [], - defaults: [], - body: { - type: 'BlockStatement', - body: [], - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - rest: null, - generator: false, - expression: false, - range: [11, 14], - loc: { - start: { line: 1, column: 11 }, - end: { line: 1, column: 14 } - } - }, - kind: 'set', - range: [3, 14], - loc: { - start: { line: 1, column: 3 }, - end: { line: 1, column: 14 } - } - }], - range: [1, 16], - loc: { - start: { line: 1, column: 1 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - } - }], - range: [0, 17], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 17 } - }, - errors: [{ - index: 9, - lineNumber: 1, - column: 10, - message: 'Error: Line 1: Unexpected token )' - }] - }, - - 'foo("bar") = baz': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'CallExpression', - callee: { - type: 'Identifier', - name: 'foo', - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - 'arguments': [{ - type: 'Literal', - value: 'bar', - raw: '"bar"', - range: [4, 9], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 9 } - } - }], - range: [0, 10], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 10 } - } - }, - right: { - type: 'Identifier', - name: 'baz', - range: [13, 16], - loc: { - start: { line: 1, column: 13 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - }, - errors: [{ - index: 10, - lineNumber: 1, - column: 11, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }] - }, - - '1 = 2': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'AssignmentExpression', - operator: '=', - left: { - type: 'Literal', - value: 1, - raw: '1', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - right: { - type: 'Literal', - value: 2, - raw: '2', - range: [4, 5], - loc: { - start: { line: 1, column: 4 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }, - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - } - }], - range: [0, 5], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 5 } - }, - errors: [{ - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }] - }, - - '3++': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '++', - argument: { - type: 'Literal', - value: 3, - raw: '3', - range: [0, 1], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 1 } - } - }, - prefix: false, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }], - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - }, - errors: [{ - index: 1, - lineNumber: 1, - column: 2, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }] - }, - - '--4': { - type: 'Program', - body: [{ - type: 'ExpressionStatement', - expression: { - type: 'UpdateExpression', - operator: '--', - argument: { - type: 'Literal', - value: 4, - raw: '4', - range: [2, 3], - loc: { - start: { line: 1, column: 2 }, - end: { line: 1, column: 3 } - } - }, - prefix: true, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }, - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - } - }], - range: [0, 3], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 3 } - }, - errors: [{ - index: 3, - lineNumber: 1, - column: 4, - message: 'Error: Line 1: Invalid left-hand side in assignment' - }] - }, - - 'for (5 in []) {}': { - type: 'Program', - body: [{ - type: 'ForInStatement', - left: { - type: 'Literal', - value: 5, - raw: '5', - range: [5, 6], - loc: { - start: { line: 1, column: 5 }, - end: { line: 1, column: 6 } - } - }, - right: { - type: 'ArrayExpression', - elements: [], - range: [10, 12], - loc: { - start: { line: 1, column: 10 }, - end: { line: 1, column: 12 } - } - }, - body: { - type: 'BlockStatement', - body: [], - range: [14, 16], - loc: { - start: { line: 1, column: 14 }, - end: { line: 1, column: 16 } - } - }, - each: false, - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - } - }], - range: [0, 16], - loc: { - start: { line: 1, column: 0 }, - end: { line: 1, column: 16 } - }, - errors: [{ - index: 6, - lineNumber: 1, - column: 7, - message: 'Error: Line 1: Invalid left-hand side in for-in' - }] - } - - - } -}; - diff --git a/node_modules/grunt/node_modules/js-yaml/package.json b/node_modules/grunt/node_modules/js-yaml/package.json deleted file mode 100644 index 43b050a..0000000 --- a/node_modules/grunt/node_modules/js-yaml/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "js-yaml", - "version": "2.0.5", - "description": "YAML 1.2 parser and serializer", - "keywords": [ - "yaml", - "parser", - "serializer", - "pyyaml" - ], - "homepage": "https://github.com/nodeca/js-yaml", - "author": { - "name": "Dervus Grim", - "email": "dervus@lavabit.com" - }, - "contributors": [ - { - "name": "Aleksey V Zapparov", - "email": "ixti@member.fsf.org", - "url": "http://www.ixti.net/" - }, - { - "name": "Martin Grenfell", - "email": "martin.grenfell@gmail.com", - "url": "http://got-ravings.blogspot.com" - } - ], - "bugs": { - "url": "https://github.com/nodeca/js-yaml/issues" - }, - "license": { - "type": "MIT", - "url": "https://github.com/nodeca/js-yaml/blob/master/LICENSE" - }, - "repository": { - "type": "git", - "url": "git://github.com/nodeca/js-yaml.git" - }, - "main": "./index.js", - "bin": { - "js-yaml": "bin/js-yaml.js" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "argparse": "~ 0.1.11", - "esprima": "~ 1.0.2" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": ">= 0.6.0" - }, - "readme": "JS-YAML - YAML 1.2 parser and serializer for JavaScript\n=======================================================\n\n[![Build Status](https://secure.travis-ci.org/nodeca/js-yaml.png)](http://travis-ci.org/nodeca/js-yaml)\n\n[Online Demo](http://nodeca.github.com/js-yaml/)\n\n\nThis is an implementation of [YAML](http://yaml.org/), a human friendly data\nserialization language. Started as [PyYAML](http://pyyaml.org/) port, it was\ncompletely rewritten from scratch. Now it's very fast, and supports 1.2 spec.\n\n\nBreaking changes in 1.x.x -> 2.0.x\n----------------------------------\n\nIf your have not used __custom__ tags or loader classes - no changes needed. Just\nupgrade library and enjoy high parse speed.\n\nIn other case, you should rewrite your tag constructors and custom loader\nclasses, to conform new schema-based API. See\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and\n[wiki](https://github.com/nodeca/js-yaml/wiki) for details.\nNote, that parser internals were completely rewritten.\n\n\nInstallation\n------------\n\n### YAML module for node.js\n\n```\nnpm install js-yaml\n```\n\n\n### CLI executable\n\nIf you want to inspect your YAML files from CLI, install js-yaml globally:\n\n```\nnpm install js-yaml -g\n```\n\n#### Usage\n\n```\nusage: js-yaml [-h] [-v] [-c] [-j] [-t] file\n\nPositional arguments:\n file File with YAML document(s)\n\nOptional arguments:\n -h, --help Show this help message and exit.\n -v, --version Show program's version number and exit.\n -c, --compact Display errors in compact mode\n -j, --to-json Output a non-funky boring JSON\n -t, --trace Show stack trace on error\n```\n\n\n### Bundled YAML library for browsers\n\n``` html\n\n\n```\n\nBrowser support was done mostly for online demo. If you find any errors - feel\nfree to send pull requests with fixes. Also note, that IE and other old browsers\nneeds [es5-shims](https://github.com/kriskowal/es5-shim) to operate.\n\n\nAPI\n---\n\nHere we cover the most 'useful' methods. If you need advanced details (creating\nyour own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and\n[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more\ninfo.\n\nIn node.js JS-YAML automatically registers handlers for `.yml` and `.yaml`\nfiles. You can load them just with `require`. That's mostly equivalent to\ncalling `load()` on fetched content of a file. Just with one string!\n\n``` javascript\nrequire('js-yaml');\n\n// Get document, or throw exception on error\ntry {\n var doc = require('/home/ixti/example.yml');\n console.log(doc);\n} catch (e) {\n console.log(e);\n}\n```\n\n\n### load (string [ , options ])\n\nParses `string` as single YAML document. Returns a JavaScript object or throws\n`YAMLException` on error.\n\nNOTE: This function **does not** understands multi-document sources, it throws\nexception on those.\n\noptions:\n\n- `filename` _(default: null)_ - string to be used as a file path in\n error/warning messages.\n- `strict` _(default - false)_ makes the loader to throw errors instead of\n warnings.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ - specifies a schema to use.\n\n\n### loadAll (string, iterator [ , options ])\n\nSame as `load()`, but understands multi-document sources and apply `iterator` to\neach document.\n\n``` javascript\nvar yaml = require('js-yaml');\n\nyaml.loadAll(data, function (doc) {\n console.log(doc);\n});\n```\n\n\n### safeLoad (string [ , options ])\n\nSame as `load()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### safeLoadAll (string, iterator [ , options ])\n\nSame as `loadAll()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\n### dump (object [ , options ])\n\nSerializes `object` as YAML document.\n\noptions:\n\n- `indent` _(default: 2)_ - indentation width to use (in spaces).\n- `flowLevel` (default: -1) - specifies level of nesting, when to switch from\n block to flow style for collections. -1 means block style everwhere\n- `styles` - \"tag\" => \"style\" map. Each tag may have own set of styles.\n- `schema` _(default: `DEFAULT_SCHEMA`)_ specifies a schema to use.\n\nstyles:\n\n``` none\n!!null\n \"canonical\" => \"~\"\n\n!!int\n \"binary\" => \"0b1\", \"0b101010\", \"0b1110001111010\"\n \"octal\" => \"01\", \"052\", \"016172\"\n \"decimal\" => \"1\", \"42\", \"7290\"\n \"hexadecimal\" => \"0x1\", \"0x2A\", \"0x1C7A\"\n\n!!null, !!bool, !!float\n \"lowercase\" => \"null\", \"true\", \"false\", \".nan\", '.inf'\n \"uppercase\" => \"NULL\", \"TRUE\", \"FALSE\", \".NAN\", '.INF'\n \"camelcase\" => \"Null\", \"True\", \"False\", \".NaN\", '.Inf'\n```\n\nBy default, !!int uses `decimal`, and !!null, !!bool, !!float use `lowercase`.\n\n\n### safeDump (object [ , options ])\n\nSame as `dump()` but uses `SAFE_SCHEMA` by default - only recommended tags of\nYAML specification (no JavaScript-specific tags, e.g. `!!js/regexp`).\n\n\nSupported YAML types\n--------------------\n\nThe list of standard YAML tags and corresponding JavaScipt types. See also\n[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and\n[YAML types repository](http://yaml.org/type/).\n\n```\n!!null '' # null\n!!bool 'yes' # bool\n!!int '3...' # number\n!!float '3.14...' # number\n!!binary '...base64...' # buffer\n!!timestamp 'YYYY-...' # date\n!!omap [ ... ] # array of key-value pairs\n!!pairs [ ... ] # array or array pairs\n!!set { ... } # array of objects with given keys and null values\n!!str '...' # string\n!!seq [ ... ] # array\n!!map { ... } # object\n```\n\n**JavaScript-specific tags**\n\n```\n!!js/regexp /pattern/gim # RegExp\n!!js/undefined '' # Undefined\n!!js/function 'function () {...}' # Function\n```\n\n\n\n\n## Caveats\n\nNote, that you use arrays or objects as key in JS-YAML. JS do not allows objects\nor array as keys, and stringifies (by calling .toString method) them at the\nmoment of adding them.\n\n``` yaml\n---\n? [ foo, bar ]\n: - baz\n? { foo: bar }\n: - baz\n - baz\n```\n\n``` javascript\n{ \"foo,bar\": [\"baz\"], \"[object Object]\": [\"baz\", \"baz\"] }\n```\n\nAlso, reading of properties on implicit block mapping keys is not supported yet.\nSo, the following YAML document cannot be loaded.\n\n``` yaml\n&anchor foo:\n foo: bar\n *anchor: duplicate key\n baz: bat\n *anchor: duplicate key\n```\n\n## License\n\nView the [LICENSE](https://github.com/nodeca/js-yaml/blob/master/LICENSE) file\n(MIT).\n", - "readmeFilename": "README.md", - "_id": "js-yaml@2.0.5", - "_from": "js-yaml@~2.0.5" -} diff --git a/node_modules/grunt/node_modules/lodash/README.md b/node_modules/grunt/node_modules/lodash/README.md deleted file mode 100644 index 55dae80..0000000 --- a/node_modules/grunt/node_modules/lodash/README.md +++ /dev/null @@ -1,140 +0,0 @@ -# Lo-Dash v0.9.2 - -A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features). - -## Download - - * [Development build](https://raw.github.com/lodash/lodash/0.9.2/lodash.js) - * [Production build](https://raw.github.com/lodash/lodash/0.9.2/lodash.min.js) - * [Underscore build](https://raw.github.com/lodash/lodash/0.9.2/lodash.underscore.min.js) tailored for projects already using Underscore - * CDN copies of ≤ v0.9.2’s [Production](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.min.js), [Underscore](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.underscore.min.js), and [Development](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/0.9.2/lodash.js) builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/) - * For optimal file size, [create a custom build](http://lodash.com/custom-builds) with only the features you need - -## Dive in - -We’ve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests). - -Create your own benchmarks at [jsPerf](http://jsperf.com), or [search](http://jsperf.com/search?q=lodash) for existing ones. - -For a list of upcoming features, check out our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap). - -## Screencasts - -For more information check out these screencasts over Lo-Dash: - - * [Introducing Lo-Dash](https://vimeo.com/44154599) - * [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601) - * [Lo-Dash’s origin and why it’s a better utility belt](https://vimeo.com/44154600) - * [Unit testing in Lo-Dash](https://vimeo.com/45865290) - * [Lo-Dash’s approach to native method use](https://vimeo.com/48576012) - -## Features - - * AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.) - * [_.clone](http://lodash.com/docs#clone) supports *“deep”* cloning - * [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument - * [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early - * [_.forIn](http://lodash.com/docs#forIn) for iterating over an object’s own and inherited properties - * [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an object’s own properties - * [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor - * [_.lateBind](http://lodash.com/docs#lateBind) for late binding - * [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend) - * [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding - * [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments - * [_.template](http://lodash.com/docs#template) supports [ES6 delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging - * [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray), - [and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings - -## Support - -Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~16, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.14, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. - -## Installation and usage - -In browsers: - -```html - -``` - -Using [npm](http://npmjs.org/): - -```bash -npm install lodash - -npm install -g lodash -npm link lodash -``` - -In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/): - -```js -var _ = require('lodash'); -``` - -**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it. - -In [RingoJS v0.7.0-](http://ringojs.org/): - -```js -var _ = require('lodash')._; -``` - -In [Rhino](http://www.mozilla.org/rhino/): - -```js -load('lodash.js'); -``` - -In an AMD loader like [RequireJS](http://requirejs.org/): - -```js -require({ - 'paths': { - 'underscore': 'path/to/lodash' - } -}, -['underscore'], function(_) { - console.log(_.VERSION); -}); -``` - -## Resolved Underscore.js issues - - * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)] - * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)] - * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)] - * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)] - * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)] - * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)] - * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)] - -## Release Notes - -### v0.9.2 - - * Added `fromIndex` argument to `_.contains` - * Added `moduleId` build option - * Added Closure Compiler *“simple”* optimizations to the build process - * Added support for strings in `_.max` and `_.min` - * Added support for ES6 template delimiters to `_.template` - * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs - * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq` - -The full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog). - -## BestieJS - -Lo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. - -## Author - -| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") | -|---| -| [John-David Dalton](http://allyoucanleet.com/) | - -## Contributors - -| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | -|---|---|---| -| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) | diff --git a/node_modules/grunt/node_modules/lodash/lodash.js b/node_modules/grunt/node_modules/lodash/lodash.js deleted file mode 100644 index 9eae931..0000000 --- a/node_modules/grunt/node_modules/lodash/lodash.js +++ /dev/null @@ -1,4258 +0,0 @@ -/*! - * Lo-Dash v0.9.2 - * (c) 2012 John-David Dalton - * Based on Underscore.js 1.4.2 - * (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. - * Available under MIT license - */ -;(function(window, undefined) { - - /** Detect free variable `exports` */ - var freeExports = typeof exports == 'object' && exports; - - /** Detect free variable `global` and use it as `window` */ - var freeGlobal = typeof global == 'object' && global; - if (freeGlobal.global === freeGlobal) { - window = freeGlobal; - } - - /** Used for array and object method references */ - var arrayRef = [], - // avoid a Closure Compiler bug by creatively creating an object - objectRef = new function(){}; - - /** Used to generate unique IDs */ - var idCounter = 0; - - /** Used internally to indicate various things */ - var indicatorObject = objectRef; - - /** Used by `cachedContains` as the default size when optimizations are enabled for large arrays */ - var largeArraySize = 30; - - /** Used to restore the original `_` reference in `noConflict` */ - var oldDash = window._; - - /** Used to detect template delimiter values that require a with-statement */ - var reComplexDelimiter = /[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/; - - /** Used to match HTML entities */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#x27);/g; - - /** Used to match empty string literals in compiled template source */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match regexp flags from their coerced string values */ - var reFlags = /\w*$/; - - /** Used to insert the data object variable into compiled template source */ - var reInsertVariable = /(?:__e|__t = )\(\s*(?![\d\s"']|this\.)/g; - - /** Used to detect if a method is native */ - var reNative = RegExp('^' + - (objectRef.valueOf + '') - .replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\$&') - .replace(/valueOf|for [^\]]+/g, '.+?') + '$' - ); - - /** - * Used to match ES6 template delimiters - * http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6 - */ - var reEsTemplate = /\$\{((?:(?=\\?)\\?[\s\S])*?)}/g; - - /** Used to match "interpolate" template delimiters */ - var reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to ensure capturing order of template delimiters */ - var reNoMatch = /($^)/; - - /** Used to match HTML characters */ - var reUnescapedHtml = /[&<>"']/g; - - /** Used to match unescaped characters in compiled string literals */ - var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g; - - /** Used to fix the JScript [[DontEnum]] bug */ - var shadowed = [ - 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', - 'toLocaleString', 'toString', 'valueOf' - ]; - - /** Used to make template sourceURLs easier to identify */ - var templateCounter = 0; - - /** Native method shortcuts */ - var ceil = Math.ceil, - concat = arrayRef.concat, - floor = Math.floor, - getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf, - hasOwnProperty = objectRef.hasOwnProperty, - push = arrayRef.push, - propertyIsEnumerable = objectRef.propertyIsEnumerable, - slice = arrayRef.slice, - toString = objectRef.toString; - - /* Native method shortcuts for methods with the same name as other `lodash` methods */ - var nativeBind = reNative.test(nativeBind = slice.bind) && nativeBind, - nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, - nativeIsFinite = window.isFinite, - nativeIsNaN = window.isNaN, - nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys, - nativeMax = Math.max, - nativeMin = Math.min, - nativeRandom = Math.random; - - /** `Object#toString` result shortcuts */ - var argsClass = '[object Arguments]', - arrayClass = '[object Array]', - boolClass = '[object Boolean]', - dateClass = '[object Date]', - funcClass = '[object Function]', - numberClass = '[object Number]', - objectClass = '[object Object]', - regexpClass = '[object RegExp]', - stringClass = '[object String]'; - - /** - * Detect the JScript [[DontEnum]] bug: - * - * In IE < 9 an objects own properties, shadowing non-enumerable ones, are - * made non-enumerable as well. - */ - var hasDontEnumBug; - - /** Detect if own properties are iterated after inherited properties (IE < 9) */ - var iteratesOwnLast; - - /** - * Detect if `Array#shift` and `Array#splice` augment array-like objects - * incorrectly: - * - * Firefox < 10, IE compatibility mode, and IE < 9 have buggy Array `shift()` - * and `splice()` functions that fail to remove the last element, `value[0]`, - * of array-like objects even though the `length` property is set to `0`. - * The `shift()` method is buggy in IE 8 compatibility mode, while `splice()` - * is buggy regardless of mode in IE < 9 and buggy in compatibility mode in IE 9. - */ - var hasObjectSpliceBug = (hasObjectSpliceBug = { '0': 1, 'length': 1 }, - arrayRef.splice.call(hasObjectSpliceBug, 0, 1), hasObjectSpliceBug[0]); - - /** Detect if an `arguments` object's indexes are non-enumerable (IE < 9) */ - var noArgsEnum = true; - - (function() { - var props = []; - function ctor() { this.x = 1; } - ctor.prototype = { 'valueOf': 1, 'y': 1 }; - for (var prop in new ctor) { props.push(prop); } - for (prop in arguments) { noArgsEnum = !prop; } - - hasDontEnumBug = !/valueOf/.test(props); - iteratesOwnLast = props[0] != 'x'; - }(1)); - - /** Detect if an `arguments` object's [[Class]] is unresolvable (Firefox < 4, IE < 9) */ - var noArgsClass = !isArguments(arguments); - - /** Detect if `Array#slice` cannot be used to convert strings to arrays (Opera < 10.52) */ - var noArraySliceOnStrings = slice.call('x')[0] != 'x'; - - /** - * Detect lack of support for accessing string characters by index: - * - * IE < 8 can't access characters by index and IE 8 can only access - * characters by index on string literals. - */ - var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx'; - - /** - * Detect if a node's [[Class]] is unresolvable (IE < 9) - * and that the JS engine won't error when attempting to coerce an object to - * a string without a `toString` property value of `typeof` "function". - */ - try { - var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass); - } catch(e) { } - - /* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */ - var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera)); - - /* Detect if `Object.keys` exists and is inferred to be fast (IE, Opera, V8) */ - var isKeysFast = nativeKeys && /^.+$|true/.test(nativeKeys + !!window.attachEvent); - - /** - * Detect if sourceURL syntax is usable without erroring: - * - * The JS engine in Adobe products, like InDesign, will throw a syntax error - * when it encounters a single line comment beginning with the `@` symbol. - * - * The JS engine in Narwhal will generate the function `function anonymous(){//}` - * and throw a syntax error. - * - * Avoid comments beginning `@` symbols in IE because they are part of its - * non-standard conditional compilation support. - * http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx - */ - try { - var useSourceURL = (Function('//@')(), !window.attachEvent); - } catch(e) { } - - /** Used to identify object classifications that `_.clone` supports */ - var cloneableClasses = {}; - cloneableClasses[argsClass] = cloneableClasses[funcClass] = false; - cloneableClasses[arrayClass] = cloneableClasses[boolClass] = cloneableClasses[dateClass] = - cloneableClasses[numberClass] = cloneableClasses[objectClass] = cloneableClasses[regexpClass] = - cloneableClasses[stringClass] = true; - - /** Used to determine if values are of the language type Object */ - var objectTypes = { - 'boolean': false, - 'function': true, - 'object': true, - 'number': false, - 'string': false, - 'undefined': false - }; - - /** Used to escape characters for inclusion in compiled string literals */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\t': 't', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The `lodash` function. - * - * @name _ - * @constructor - * @category Chaining - * @param {Mixed} value The value to wrap in a `lodash` instance. - * @returns {Object} Returns a `lodash` instance. - */ - function lodash(value) { - // exit early if already wrapped - if (value && value.__wrapped__) { - return value; - } - // allow invoking `lodash` without the `new` operator - if (!(this instanceof lodash)) { - return new lodash(value); - } - this.__wrapped__ = value; - } - - /** - * By default, the template delimiters used by Lo-Dash are similar to those in - * embedded Ruby (ERB). Change the following template settings to use alternative - * delimiters. - * - * @static - * @memberOf _ - * @type Object - */ - lodash.templateSettings = { - - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'escape': /<%-([\s\S]+?)%>/g, - - /** - * Used to detect code to be evaluated. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'evaluate': /<%([\s\S]+?)%>/g, - - /** - * Used to detect `data` property values to inject. - * - * @static - * @memberOf _.templateSettings - * @type RegExp - */ - 'interpolate': reInterpolate, - - /** - * Used to reference the data object in the template text. - * - * @static - * @memberOf _.templateSettings - * @type String - */ - 'variable': '' - }; - - /*--------------------------------------------------------------------------*/ - - /** - * The template used to create iterator functions. - * - * @private - * @param {Obect} data The data object used to populate the text. - * @returns {String} Returns the interpolated text. - */ - var iteratorTemplate = template( - // conditional strict mode - '<% if (obj.useStrict) { %>\'use strict\';\n<% } %>' + - - // the `iteratee` may be reassigned by the `top` snippet - 'var index, value, iteratee = <%= firstArg %>, ' + - // assign the `result` variable an initial value - 'result = <%= firstArg %>;\n' + - // exit early if the first argument is falsey - 'if (!<%= firstArg %>) return result;\n' + - // add code before the iteration branches - '<%= top %>;\n' + - - // array-like iteration: - '<% if (arrayLoop) { %>' + - 'var length = iteratee.length; index = -1;\n' + - 'if (typeof length == \'number\') {' + - - // add support for accessing string characters by index if needed - ' <% if (noCharByIndex) { %>\n' + - ' if (isString(iteratee)) {\n' + - ' iteratee = iteratee.split(\'\')\n' + - ' }' + - ' <% } %>\n' + - - // iterate over the array-like value - ' while (++index < length) {\n' + - ' value = iteratee[index];\n' + - ' <%= arrayLoop %>\n' + - ' }\n' + - '}\n' + - 'else {' + - - // object iteration: - // add support for iterating over `arguments` objects if needed - ' <% } else if (noArgsEnum) { %>\n' + - ' var length = iteratee.length; index = -1;\n' + - ' if (length && isArguments(iteratee)) {\n' + - ' while (++index < length) {\n' + - ' value = iteratee[index += \'\'];\n' + - ' <%= objectLoop %>\n' + - ' }\n' + - ' } else {' + - ' <% } %>' + - - // Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1 - // (if the prototype or a property on the prototype has been set) - // incorrectly sets a function's `prototype` property [[Enumerable]] - // value to `true`. Because of this Lo-Dash standardizes on skipping - // the the `prototype` property of functions regardless of its - // [[Enumerable]] value. - ' <% if (!hasDontEnumBug) { %>\n' + - ' var skipProto = typeof iteratee == \'function\' && \n' + - ' propertyIsEnumerable.call(iteratee, \'prototype\');\n' + - ' <% } %>' + - - // iterate own properties using `Object.keys` if it's fast - ' <% if (isKeysFast && useHas) { %>\n' + - ' var ownIndex = -1,\n' + - ' ownProps = objectTypes[typeof iteratee] ? nativeKeys(iteratee) : [],\n' + - ' length = ownProps.length;\n\n' + - ' while (++ownIndex < length) {\n' + - ' index = ownProps[ownIndex];\n' + - ' <% if (!hasDontEnumBug) { %>if (!(skipProto && index == \'prototype\')) {\n <% } %>' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>\n' + - ' <% if (!hasDontEnumBug) { %>}\n<% } %>' + - ' }' + - - // else using a for-in loop - ' <% } else { %>\n' + - ' for (index in iteratee) {<%' + - ' if (!hasDontEnumBug || useHas) { %>\n if (<%' + - ' if (!hasDontEnumBug) { %>!(skipProto && index == \'prototype\')<% }' + - ' if (!hasDontEnumBug && useHas) { %> && <% }' + - ' if (useHas) { %>hasOwnProperty.call(iteratee, index)<% }' + - ' %>) {' + - ' <% } %>\n' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>;' + - ' <% if (!hasDontEnumBug || useHas) { %>\n }<% } %>\n' + - ' }' + - ' <% } %>' + - - // Because IE < 9 can't set the `[[Enumerable]]` attribute of an - // existing property and the `constructor` property of a prototype - // defaults to non-enumerable, Lo-Dash skips the `constructor` - // property when it infers it's iterating over a `prototype` object. - ' <% if (hasDontEnumBug) { %>\n\n' + - ' var ctor = iteratee.constructor;\n' + - ' <% for (var k = 0; k < 7; k++) { %>\n' + - ' index = \'<%= shadowed[k] %>\';\n' + - ' if (<%' + - ' if (shadowed[k] == \'constructor\') {' + - ' %>!(ctor && ctor.prototype === iteratee) && <%' + - ' } %>hasOwnProperty.call(iteratee, index)) {\n' + - ' value = iteratee[index];\n' + - ' <%= objectLoop %>\n' + - ' }' + - ' <% } %>' + - ' <% } %>' + - ' <% if (arrayLoop || noArgsEnum) { %>\n}<% } %>\n' + - - // add code to the bottom of the iteration function - '<%= bottom %>;\n' + - // finally, return the `result` - 'return result' - ); - - /** - * Reusable iterator options shared by `forEach`, `forIn`, and `forOwn`. - */ - var forEachIteratorOptions = { - 'args': 'collection, callback, thisArg', - 'top': 'callback = createCallback(callback, thisArg)', - 'arrayLoop': 'if (callback(value, index, collection) === false) return result', - 'objectLoop': 'if (callback(value, index, collection) === false) return result' - }; - - /** Reusable iterator options for `defaults`, and `extend` */ - var extendIteratorOptions = { - 'useHas': false, - 'args': 'object', - 'top': - 'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' + - ' if (iteratee = arguments[argsIndex]) {', - 'objectLoop': 'result[index] = value', - 'bottom': ' }\n}' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'arrayLoop': null - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function optimized to search large arrays for a given `value`, - * starting at `fromIndex`, using strict equality for comparisons, i.e. `===`. - * - * @private - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=0] The index to search from. - * @param {Number} [largeSize=30] The length at which an array is considered large. - * @returns {Boolean} Returns `true` if `value` is found, else `false`. - */ - function cachedContains(array, fromIndex, largeSize) { - fromIndex || (fromIndex = 0); - - var length = array.length, - isLarge = (length - fromIndex) >= (largeSize || largeArraySize); - - if (isLarge) { - var cache = {}, - index = fromIndex - 1; - - while (++index < length) { - // manually coerce `value` to a string because `hasOwnProperty`, in some - // older versions of Firefox, coerces objects incorrectly - var key = array[index] + ''; - (hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]); - } - } - return function(value) { - if (isLarge) { - var key = value + ''; - return hasOwnProperty.call(cache, key) && indexOf(cache[key], value) > -1; - } - return indexOf(array, value, fromIndex) > -1; - } - } - - /** - * Used by `_.max` and `_.min` as the default `callback` when a given - * `collection` is a string value. - * - * @private - * @param {String} value The character to inspect. - * @returns {Number} Returns the code unit of given character. - */ - function charAtCallback(value) { - return value.charCodeAt(0); - } - - /** - * Used by `sortBy` to compare transformed `collection` values, stable sorting - * them in ascending order. - * - * @private - * @param {Object} a The object to compare to `b`. - * @param {Object} b The object to compare to `a`. - * @returns {Number} Returns the sort order indicator of `1` or `-1`. - */ - function compareAscending(a, b) { - var ai = a.index, - bi = b.index; - - a = a.criteria; - b = b.criteria; - - // ensure a stable sort in V8 and other engines - // http://code.google.com/p/v8/issues/detail?id=90 - if (a !== b) { - if (a > b || a === undefined) { - return 1; - } - if (a < b || b === undefined) { - return -1; - } - } - return ai < bi ? -1 : 1; - } - - /** - * Creates a function that, when called, invokes `func` with the `this` - * binding of `thisArg` and prepends any `partailArgs` to the arguments passed - * to the bound function. - * - * @private - * @param {Function|String} func The function to bind or the method name. - * @param {Mixed} [thisArg] The `this` binding of `func`. - * @param {Array} partialArgs An array of arguments to be partially applied. - * @returns {Function} Returns the new bound function. - */ - function createBound(func, thisArg, partialArgs) { - var isFunc = isFunction(func), - isPartial = !partialArgs, - methodName = func; - - // juggle arguments - if (isPartial) { - partialArgs = thisArg; - } - - function bound() { - // `Function#bind` spec - // http://es5.github.com/#x15.3.4.5 - var args = arguments, - thisBinding = isPartial ? this : thisArg; - - if (!isFunc) { - func = thisArg[methodName]; - } - if (partialArgs.length) { - args = args.length - ? partialArgs.concat(slice.call(args)) - : partialArgs; - } - if (this instanceof bound) { - // get `func` instance if `bound` is invoked in a `new` expression - noop.prototype = func.prototype; - thisBinding = new noop; - - // mimic the constructor's `return` behavior - // http://es5.github.com/#x13.2.2 - var result = func.apply(thisBinding, args); - return isObject(result) - ? result - : thisBinding - } - return func.apply(thisBinding, args); - } - return bound; - } - - /** - * Produces an iteration callback bound to an optional `thisArg`. If `func` is - * a property name, the callback will return the property value for a given element. - * - * @private - * @param {Function|String} [func=identity|property] The function called per - * iteration or property name to query. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Function} Returns a callback function. - */ - function createCallback(func, thisArg) { - if (!func) { - return identity; - } - if (typeof func != 'function') { - return function(object) { - return object[func]; - }; - } - if (thisArg !== undefined) { - return function(value, index, object) { - return func.call(thisArg, value, index, object); - }; - } - return func; - } - - /** - * Creates compiled iteration functions. - * - * @private - * @param {Object} [options1, options2, ...] The compile options object(s). - * useHas - A boolean to specify using `hasOwnProperty` checks in the object loop. - * args - A string of comma separated arguments the iteration function will accept. - * top - A string of code to execute before the iteration branches. - * arrayLoop - A string of code to execute in the array loop. - * objectLoop - A string of code to execute in the object loop. - * bottom - A string of code to execute after the iteration branches. - * - * @returns {Function} Returns the compiled function. - */ - function createIterator() { - var data = { - 'arrayLoop': '', - 'bottom': '', - 'hasDontEnumBug': hasDontEnumBug, - 'isKeysFast': isKeysFast, - 'objectLoop': '', - 'noArgsEnum': noArgsEnum, - 'noCharByIndex': noCharByIndex, - 'shadowed': shadowed, - 'top': '', - 'useHas': true - }; - - // merge options into a template data object - for (var object, index = 0; object = arguments[index]; index++) { - for (var key in object) { - data[key] = object[key]; - } - } - var args = data.args; - data.firstArg = /^[^,]+/.exec(args)[0]; - - // create the function factory - var factory = Function( - 'createCallback, hasOwnProperty, isArguments, isString, objectTypes, ' + - 'nativeKeys, propertyIsEnumerable', - 'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}' - ); - // return the compiled function - return factory( - createCallback, hasOwnProperty, isArguments, isString, objectTypes, - nativeKeys, propertyIsEnumerable - ); - } - - /** - * Used by `template` to escape characters for inclusion in compiled - * string literals. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeStringChar(match) { - return '\\' + stringEscapes[match]; - } - - /** - * Used by `escape` to convert characters to HTML entities. - * - * @private - * @param {String} match The matched character to escape. - * @returns {String} Returns the escaped character. - */ - function escapeHtmlChar(match) { - return htmlEscapes[match]; - } - - /** - * A no-operation function. - * - * @private - */ - function noop() { - // no operation performed - } - - /** - * Used by `unescape` to convert HTML entities to characters. - * - * @private - * @param {String} match The matched character to unescape. - * @returns {String} Returns the unescaped character. - */ - function unescapeHtmlChar(match) { - return htmlUnescapes[match]; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Checks if `value` is an `arguments` object. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is an `arguments` object, else `false`. - * @example - * - * (function() { return _.isArguments(arguments); })(1, 2, 3); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ - function isArguments(value) { - return toString.call(value) == argsClass; - } - // fallback for browsers that can't detect `arguments` objects by [[Class]] - if (noArgsClass) { - isArguments = function(value) { - return value ? hasOwnProperty.call(value, 'callee') : false; - }; - } - - /** - * Iterates over `object`'s own and inherited enumerable properties, executing - * the `callback` for each property. The `callback` is bound to `thisArg` and - * invoked with three arguments; (value, key, object). Callbacks may exit iteration - * early by explicitly returning `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * function Dog(name) { - * this.name = name; - * } - * - * Dog.prototype.bark = function() { - * alert('Woof, woof!'); - * }; - * - * _.forIn(new Dog('Dagny'), function(value, key) { - * alert(key); - * }); - * // => alerts 'name' and 'bark' (order is not guaranteed) - */ - var forIn = createIterator(forEachIteratorOptions, forOwnIteratorOptions, { - 'useHas': false - }); - - /** - * Iterates over `object`'s own enumerable properties, executing the `callback` - * for each property. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, key, object). Callbacks may exit iteration early by explicitly - * returning `false`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns `object`. - * @example - * - * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { - * alert(key); - * }); - * // => alerts '0', '1', and 'length' (order is not guaranteed) - */ - var forOwn = createIterator(forEachIteratorOptions, forOwnIteratorOptions); - - /** - * A fallback implementation of `isPlainObject` that checks if a given `value` - * is an object created by the `Object` constructor, assuming objects created - * by the `Object` constructor have no inherited enumerable properties and that - * there are no `Object.prototype` extensions. - * - * @private - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. - */ - function shimIsPlainObject(value) { - // avoid non-objects and false positives for `arguments` objects - var result = false; - if (!(value && typeof value == 'object') || isArguments(value)) { - return result; - } - // IE < 9 presents DOM nodes as `Object` objects except they have `toString` - // methods that are `typeof` "string" and still can coerce nodes to strings. - // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) - var ctor = value.constructor; - if ((!noNodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && - (!isFunction(ctor) || ctor instanceof ctor)) { - // IE < 9 iterates inherited properties before own properties. If the first - // iterated property is an object's own property then there are no inherited - // enumerable properties. - if (iteratesOwnLast) { - forIn(value, function(value, key, object) { - result = !hasOwnProperty.call(object, key); - return false; - }); - return result === false; - } - // In most environments an object's own properties are iterated before - // its inherited properties. If the last iterated property is an object's - // own property then there are no inherited enumerable properties. - forIn(value, function(value, key) { - result = key; - }); - return result === false || hasOwnProperty.call(value, result); - } - return result; - } - - /** - * A fallback implementation of `Object.keys` that produces an array of the - * given object's own enumerable property names. - * - * @private - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names. - */ - function shimKeys(object) { - var result = []; - forOwn(object, function(value, key) { - result.push(key); - }); - return result; - } - - /** - * Used to convert characters to HTML entities: - * - * Though the `>` character is escaped for symmetry, characters like `>` and `/` - * don't require escaping in HTML and have no special meaning unless they're part - * of a tag or an unquoted attribute value. - * http://mathiasbynens.be/notes/ambiguous-ampersands (under "semi-related fun fact") - */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to convert HTML entities to characters */ - var htmlUnescapes = invert(htmlEscapes); - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a clone of `value`. If `deep` is `true`, all nested objects will - * also be cloned otherwise they will be assigned by reference. Functions, DOM - * nodes, `arguments` objects, and objects created by constructors other than - * `Object` are **not** cloned. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to clone. - * @param {Boolean} deep A flag to indicate a deep clone. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `deep`. - * @param- {Array} [stackA=[]] Internally used to track traversed source objects. - * @param- {Array} [stackB=[]] Internally used to associate clones with their - * source counterparts. - * @returns {Mixed} Returns the cloned `value`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.clone({ 'name': 'moe' }); - * // => { 'name': 'moe' } - * - * var shallow = _.clone(stooges); - * shallow[0] === stooges[0]; - * // => true - * - * var deep = _.clone(stooges, true); - * shallow[0] === stooges[0]; - * // => false - */ - function clone(value, deep, guard, stackA, stackB) { - if (value == null) { - return value; - } - if (guard) { - deep = false; - } - // inspect [[Class]] - var isObj = isObject(value); - if (isObj) { - // don't clone `arguments` objects, functions, or non-object Objects - var className = toString.call(value); - if (!cloneableClasses[className] || (noArgsClass && isArguments(value))) { - return value; - } - var isArr = className == arrayClass; - isObj = isArr || (className == objectClass ? isPlainObject(value) : isObj); - } - // shallow clone - if (!isObj || !deep) { - // don't clone functions - return isObj - ? (isArr ? slice.call(value) : extend({}, value)) - : value; - } - - var ctor = value.constructor; - switch (className) { - case boolClass: - case dateClass: - return new ctor(+value); - - case numberClass: - case stringClass: - return new ctor(value); - - case regexpClass: - return ctor(value.source, reFlags.exec(value)); - } - // check for circular references and return corresponding clone - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == value) { - return stackB[length]; - } - } - // init cloned object - var result = isArr ? ctor(value.length) : {}; - - // add the source value to the stack of traversed objects - // and associate it with its clone - stackA.push(value); - stackB.push(result); - - // recursively populate clone (susceptible to call stack limits) - (isArr ? forEach : forOwn)(value, function(objValue, key) { - result[key] = clone(objValue, deep, null, stackA, stackB); - }); - - return result; - } - - /** - * Assigns enumerable properties of the default object(s) to the `destination` - * object for all `destination` properties that resolve to `null`/`undefined`. - * Once a property is set, additional defaults of the same property will be - * ignored. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [default1, default2, ...] The default objects. - * @returns {Object} Returns the destination object. - * @example - * - * var iceCream = { 'flavor': 'chocolate' }; - * _.defaults(iceCream, { 'flavor': 'vanilla', 'sprinkles': 'rainbow' }); - * // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' } - */ - var defaults = createIterator(extendIteratorOptions, { - 'objectLoop': 'if (result[index] == null) ' + extendIteratorOptions.objectLoop - }); - - /** - * Assigns enumerable properties of the source object(s) to the `destination` - * object. Subsequent sources will overwrite propery assignments of previous - * sources. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @returns {Object} Returns the destination object. - * @example - * - * _.extend({ 'name': 'moe' }, { 'age': 40 }); - * // => { 'name': 'moe', 'age': 40 } - */ - var extend = createIterator(extendIteratorOptions); - - /** - * Creates a sorted array of all enumerable properties, own and inherited, - * of `object` that have function values. - * - * @static - * @memberOf _ - * @alias methods - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names that have function values. - * @example - * - * _.functions(_); - * // => ['all', 'any', 'bind', 'bindAll', 'clone', 'compact', 'compose', ...] - */ - function functions(object) { - var result = []; - forIn(object, function(value, key) { - if (isFunction(value)) { - result.push(key); - } - }); - return result.sort(); - } - - /** - * Checks if the specified object `property` exists and is a direct property, - * instead of an inherited property. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to check. - * @param {String} property The property to check for. - * @returns {Boolean} Returns `true` if key is a direct property, else `false`. - * @example - * - * _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); - * // => true - */ - function has(object, property) { - return object ? hasOwnProperty.call(object, property) : false; - } - - /** - * Creates an object composed of the inverted keys and values of the given `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to invert. - * @returns {Object} Returns the created inverted object. - * @example - * - * _.invert({ 'first': 'Moe', 'second': 'Larry', 'third': 'Curly' }); - * // => { 'Moe': 'first', 'Larry': 'second', 'Curly': 'third' } (order is not guaranteed) - */ - function invert(object) { - var result = {}; - forOwn(object, function(value, key) { - result[value] = key; - }); - return result; - } - - /** - * Checks if `value` is an array. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is an array, else `false`. - * @example - * - * (function() { return _.isArray(arguments); })(); - * // => false - * - * _.isArray([1, 2, 3]); - * // => true - */ - var isArray = nativeIsArray || function(value) { - return toString.call(value) == arrayClass; - }; - - /** - * Checks if `value` is a boolean (`true` or `false`) value. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a boolean value, else `false`. - * @example - * - * _.isBoolean(null); - * // => false - */ - function isBoolean(value) { - return value === true || value === false || toString.call(value) == boolClass; - } - - /** - * Checks if `value` is a date. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a date, else `false`. - * @example - * - * _.isDate(new Date); - * // => true - */ - function isDate(value) { - return toString.call(value) == dateClass; - } - - /** - * Checks if `value` is a DOM element. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a DOM element, else `false`. - * @example - * - * _.isElement(document.body); - * // => true - */ - function isElement(value) { - return value ? value.nodeType === 1 : false; - } - - /** - * Checks if `value` is empty. Arrays, strings, or `arguments` objects with a - * length of `0` and objects with no own enumerable properties are considered - * "empty". - * - * @static - * @memberOf _ - * @category Objects - * @param {Array|Object|String} value The value to inspect. - * @returns {Boolean} Returns `true` if the `value` is empty, else `false`. - * @example - * - * _.isEmpty([1, 2, 3]); - * // => false - * - * _.isEmpty({}); - * // => true - * - * _.isEmpty(''); - * // => true - */ - function isEmpty(value) { - var result = true; - if (!value) { - return result; - } - var className = toString.call(value), - length = value.length; - - if ((className == arrayClass || className == stringClass || - className == argsClass || (noArgsClass && isArguments(value))) || - (className == objectClass && typeof length == 'number' && isFunction(value.splice))) { - return !length; - } - forOwn(value, function() { - return (result = false); - }); - return result; - } - - /** - * Performs a deep comparison between two values to determine if they are - * equivalent to each other. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} a The value to compare. - * @param {Mixed} b The other value to compare. - * @param- {Object} [stackA=[]] Internally used track traversed `a` objects. - * @param- {Object} [stackB=[]] Internally used track traversed `b` objects. - * @returns {Boolean} Returns `true` if the values are equvalent, else `false`. - * @example - * - * var moe = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; - * var clone = { 'name': 'moe', 'luckyNumbers': [13, 27, 34] }; - * - * moe == clone; - * // => false - * - * _.isEqual(moe, clone); - * // => true - */ - function isEqual(a, b, stackA, stackB) { - // exit early for identical values - if (a === b) { - // treat `+0` vs. `-0` as not equal - return a !== 0 || (1 / a == 1 / b); - } - // a strict comparison is necessary because `null == undefined` - if (a == null || b == null) { - return a === b; - } - // compare [[Class]] names - var className = toString.call(a); - if (className != toString.call(b)) { - return false; - } - switch (className) { - case boolClass: - case dateClass: - // coerce dates and booleans to numbers, dates to milliseconds and booleans - // to `1` or `0`, treating invalid dates coerced to `NaN` as not equal - return +a == +b; - - case numberClass: - // treat `NaN` vs. `NaN` as equal - return a != +a - ? b != +b - // but treat `+0` vs. `-0` as not equal - : (a == 0 ? (1 / a == 1 / b) : a == +b); - - case regexpClass: - case stringClass: - // coerce regexes to strings (http://es5.github.com/#x15.10.6.4) - // treat string primitives and their corresponding object instances as equal - return a == b + ''; - } - // exit early, in older browsers, if `a` is array-like but not `b` - var isArr = className == arrayClass || className == argsClass; - if (noArgsClass && !isArr && (isArr = isArguments(a)) && !isArguments(b)) { - return false; - } - if (!isArr) { - // unwrap any `lodash` wrapped values - if (a.__wrapped__ || b.__wrapped__) { - return isEqual(a.__wrapped__ || a, b.__wrapped__ || b); - } - // exit for functions and DOM nodes - if (className != objectClass || (noNodeClass && ( - (typeof a.toString != 'function' && typeof (a + '') == 'string') || - (typeof b.toString != 'function' && typeof (b + '') == 'string')))) { - return false; - } - var ctorA = a.constructor, - ctorB = b.constructor; - - // non `Object` object instances with different constructors are not equal - if (ctorA != ctorB && !( - isFunction(ctorA) && ctorA instanceof ctorA && - isFunction(ctorB) && ctorB instanceof ctorB - )) { - return false; - } - } - // assume cyclic structures are equal - // the algorithm for detecting cyclic structures is adapted from ES 5.1 - // section 15.12.3, abstract operation `JO` (http://es5.github.com/#x15.12.3) - stackA || (stackA = []); - stackB || (stackB = []); - - var length = stackA.length; - while (length--) { - if (stackA[length] == a) { - return stackB[length] == b; - } - } - - var index = -1, - result = true, - size = 0; - - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); - - // recursively compare objects and arrays (susceptible to call stack limits) - if (isArr) { - // compare lengths to determine if a deep comparison is necessary - size = a.length; - result = size == b.length; - - if (result) { - // deep compare the contents, ignoring non-numeric properties - while (size--) { - if (!(result = isEqual(a[size], b[size], stackA, stackB))) { - break; - } - } - } - return result; - } - // deep compare objects - for (var key in a) { - if (hasOwnProperty.call(a, key)) { - // count the number of properties. - size++; - // deep compare each property value. - if (!(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { - return false; - } - } - } - // ensure both objects have the same number of properties - for (key in b) { - // The JS engine in Adobe products, like InDesign, has a bug that causes - // `!size--` to throw an error so it must be wrapped in parentheses. - // https://github.com/documentcloud/underscore/issues/355 - if (hasOwnProperty.call(b, key) && !(size--)) { - // `size` will be `-1` if `b` has more properties than `a` - return false; - } - } - // handle JScript [[DontEnum]] bug - if (hasDontEnumBug) { - while (++index < 7) { - key = shadowed[index]; - if (hasOwnProperty.call(a, key) && - !(hasOwnProperty.call(b, key) && isEqual(a[key], b[key], stackA, stackB))) { - return false; - } - } - } - return true; - } - - /** - * Checks if `value` is, or can be coerced to, a finite number. - * - * Note: This is not the same as native `isFinite`, which will return true for - * booleans and empty strings. See http://es5.github.com/#x15.1.2.5. - * - * @deprecated - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a finite number, else `false`. - * @example - * - * _.isFinite(-101); - * // => true - * - * _.isFinite('10'); - * // => true - * - * _.isFinite(true); - * // => false - * - * _.isFinite(''); - * // => false - * - * _.isFinite(Infinity); - * // => false - */ - function isFinite(value) { - return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value)); - } - - /** - * Checks if `value` is a function. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a function, else `false`. - * @example - * - * _.isFunction(_); - * // => true - */ - function isFunction(value) { - return typeof value == 'function'; - } - // fallback for older versions of Chrome and Safari - if (isFunction(/x/)) { - isFunction = function(value) { - return toString.call(value) == funcClass; - }; - } - - /** - * Checks if `value` is the language type of Object. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(1); - * // => false - */ - function isObject(value) { - // check if the value is the ECMAScript language type of Object - // http://es5.github.com/#x8 - // and avoid a V8 bug - // http://code.google.com/p/v8/issues/detail?id=2291 - return value ? objectTypes[typeof value] : false; - } - - /** - * Checks if `value` is `NaN`. - * - * Note: This is not the same as native `isNaN`, which will return true for - * `undefined` and other values. See http://es5.github.com/#x15.1.2.4. - * - * @deprecated - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is `NaN`, else `false`. - * @example - * - * _.isNaN(NaN); - * // => true - * - * _.isNaN(new Number(NaN)); - * // => true - * - * isNaN(undefined); - * // => true - * - * _.isNaN(undefined); - * // => false - */ - function isNaN(value) { - // `NaN` as a primitive is the only value that is not equal to itself - // (perform the [[Class]] check first to avoid errors with some host objects in IE) - return toString.call(value) == numberClass && value != +value - } - - /** - * Checks if `value` is `null`. - * - * @deprecated - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is `null`, else `false`. - * @example - * - * _.isNull(null); - * // => true - * - * _.isNull(undefined); - * // => false - */ - function isNull(value) { - return value === null; - } - - /** - * Checks if `value` is a number. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a number, else `false`. - * @example - * - * _.isNumber(8.4 * 5); - * // => true - */ - function isNumber(value) { - return toString.call(value) == numberClass; - } - - /** - * Checks if a given `value` is an object created by the `Object` constructor. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Stooge(name, age) { - * this.name = name; - * this.age = age; - * } - * - * _.isPlainObject(new Stooge('moe', 40)); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'name': 'moe', 'age': 40 }); - * // => true - */ - var isPlainObject = !getPrototypeOf ? shimIsPlainObject : function(value) { - if (!(value && typeof value == 'object')) { - return false; - } - var valueOf = value.valueOf, - objProto = typeof valueOf == 'function' && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto); - - return objProto - ? value == objProto || (getPrototypeOf(value) == objProto && !isArguments(value)) - : shimIsPlainObject(value); - }; - - /** - * Checks if `value` is a regular expression. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a regular expression, else `false`. - * @example - * - * _.isRegExp(/moe/); - * // => true - */ - function isRegExp(value) { - return toString.call(value) == regexpClass; - } - - /** - * Checks if `value` is a string. - * - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is a string, else `false`. - * @example - * - * _.isString('moe'); - * // => true - */ - function isString(value) { - return toString.call(value) == stringClass; - } - - /** - * Checks if `value` is `undefined`. - * - * @deprecated - * @static - * @memberOf _ - * @category Objects - * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if the `value` is `undefined`, else `false`. - * @example - * - * _.isUndefined(void 0); - * // => true - */ - function isUndefined(value) { - return value === undefined; - } - - /** - * Creates an array composed of the own enumerable property names of `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property names. - * @example - * - * _.keys({ 'one': 1, 'two': 2, 'three': 3 }); - * // => ['one', 'two', 'three'] (order is not guaranteed) - */ - var keys = !nativeKeys ? shimKeys : function(object) { - // avoid iterating over the `prototype` property - return typeof object == 'function' && propertyIsEnumerable.call(object, 'prototype') - ? shimKeys(object) - : (isObject(object) ? nativeKeys(object) : []); - }; - - /** - * Merges enumerable properties of the source object(s) into the `destination` - * object. Subsequent sources will overwrite propery assignments of previous - * sources. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The destination object. - * @param {Object} [source1, source2, ...] The source objects. - * @param- {Object} [indicator] Internally used to indicate that the `stack` - * argument is an array of traversed objects instead of another source object. - * @param- {Array} [stackA=[]] Internally used to track traversed source objects. - * @param- {Array} [stackB=[]] Internally used to associate values with their - * source counterparts. - * @returns {Object} Returns the destination object. - * @example - * - * var stooges = [ - * { 'name': 'moe' }, - * { 'name': 'larry' } - * ]; - * - * var ages = [ - * { 'age': 40 }, - * { 'age': 50 } - * ]; - * - * _.merge(stooges, ages); - * // => [{ 'name': 'moe', 'age': 40 }, { 'name': 'larry', 'age': 50 }] - */ - function merge(object, source, indicator) { - var args = arguments, - index = 0, - length = 2, - stackA = args[3], - stackB = args[4]; - - if (indicator !== objectRef) { - stackA = []; - stackB = []; - length = args.length; - } - while (++index < length) { - forOwn(args[index], function(source, key) { - var found, isArr, value; - if (source && ((isArr = isArray(source)) || isPlainObject(source))) { - // avoid merging previously merged cyclic sources - var stackLength = stackA.length; - while (stackLength--) { - found = stackA[stackLength] == source; - if (found) { - break; - } - } - if (found) { - object[key] = stackB[stackLength]; - } - else { - // add `source` and associated `value` to the stack of traversed objects - stackA.push(source); - stackB.push(value = (value = object[key], isArr) - ? (isArray(value) ? value : []) - : (isPlainObject(value) ? value : {}) - ); - // recursively merge objects and arrays (susceptible to call stack limits) - object[key] = merge(value, source, objectRef, stackA, stackB); - } - } else if (source != null) { - object[key] = source; - } - }); - } - return object; - } - - /** - * Creates a shallow clone of `object` excluding the specified properties. - * Property names may be specified as individual arguments or as arrays of - * property names. If `callback` is passed, it will be executed for each property - * in the `object`, omitting the properties `callback` returns truthy for. The - * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Function|String} callback|[prop1, prop2, ...] The properties to omit - * or the function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object without the omitted properties. - * @example - * - * _.omit({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'userid'); - * // => { 'name': 'moe', 'age': 40 } - * - * _.omit({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { - * return key.charAt(0) == '_'; - * }); - * // => { 'name': 'moe' } - */ - function omit(object, callback, thisArg) { - var isFunc = typeof callback == 'function', - result = {}; - - if (isFunc) { - callback = createCallback(callback, thisArg); - } else { - var props = concat.apply(arrayRef, arguments); - } - forIn(object, function(value, key, object) { - if (isFunc - ? !callback(value, key, object) - : indexOf(props, key, 1) < 0 - ) { - result[key] = value; - } - }); - return result; - } - - /** - * Creates a two dimensional array of the given object's key-value pairs, - * i.e. `[[key1, value1], [key2, value2]]`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns new array of key-value pairs. - * @example - * - * _.pairs({ 'moe': 30, 'larry': 40, 'curly': 50 }); - * // => [['moe', 30], ['larry', 40], ['curly', 50]] (order is not guaranteed) - */ - function pairs(object) { - var result = []; - forOwn(object, function(value, key) { - result.push([key, value]); - }); - return result; - } - - /** - * Creates a shallow clone of `object` composed of the specified properties. - * Property names may be specified as individual arguments or as arrays of - * property names. If `callback` is passed, it will be executed for each property - * in the `object`, picking the properties `callback` returns truthy for. The - * `callback` is bound to `thisArg` and invoked with three arguments; (value, key, object). - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The source object. - * @param {Function|String} callback|[prop1, prop2, ...] The properties to pick - * or the function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns an object composed of the picked properties. - * @example - * - * _.pick({ 'name': 'moe', 'age': 40, 'userid': 'moe1' }, 'name', 'age'); - * // => { 'name': 'moe', 'age': 40 } - * - * _.pick({ 'name': 'moe', '_hint': 'knucklehead', '_seed': '96c4eb' }, function(value, key) { - * return key.charAt(0) != '_'; - * }); - * // => { 'name': 'moe' } - */ - function pick(object, callback, thisArg) { - var result = {}; - if (typeof callback != 'function') { - var index = 0, - props = concat.apply(arrayRef, arguments), - length = props.length; - - while (++index < length) { - var key = props[index]; - if (key in object) { - result[key] = object[key]; - } - } - } else { - callback = createCallback(callback, thisArg); - forIn(object, function(value, key, object) { - if (callback(value, key, object)) { - result[key] = value; - } - }); - } - return result; - } - - /** - * Creates an array composed of the own enumerable property values of `object`. - * - * @static - * @memberOf _ - * @category Objects - * @param {Object} object The object to inspect. - * @returns {Array} Returns a new array of property values. - * @example - * - * _.values({ 'one': 1, 'two': 2, 'three': 3 }); - * // => [1, 2, 3] - */ - function values(object) { - var result = []; - forOwn(object, function(value) { - result.push(value); - }); - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Checks if a given `target` element is present in a `collection` using strict - * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used - * as the offset from the end of the collection. - * - * @static - * @memberOf _ - * @alias include - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Mixed} target The value to check for. - * @param {Number} [fromIndex=0] The index to search from. - * @returns {Boolean} Returns `true` if the `target` element is found, else `false`. - * @example - * - * _.contains([1, 2, 3], 1); - * // => true - * - * _.contains([1, 2, 3], 1, 2); - * // => false - * - * _.contains({ 'name': 'moe', 'age': 40 }, 'moe'); - * // => true - * - * _.contains('curly', 'ur'); - * // => true - */ - function contains(collection, target, fromIndex) { - var index = -1, - length = collection ? collection.length : 0; - - fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0; - if (typeof length == 'number') { - return (isString(collection) - ? collection.indexOf(target, fromIndex) - : indexOf(collection, target, fromIndex) - ) > -1; - } - return some(collection, function(value) { - return ++index >= fromIndex && value === target; - }); - } - - /** - * Creates an object composed of keys returned from running each element of - * `collection` through a `callback`. The corresponding value of each key is - * the number of times the key was returned by `callback`. The `callback` is - * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * The `callback` argument may also be the name of a property to count by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to count by. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': 1, '6': 2 } - * - * _.countBy([4.3, 6.1, 6.4], function(num) { return this.floor(num); }, Math); - * // => { '4': 1, '6': 2 } - * - * _.countBy(['one', 'two', 'three'], 'length'); - * // => { '3': 2, '5': 1 } - */ - function countBy(collection, callback, thisArg) { - var result = {}; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, key, collection) { - key = callback(value, key, collection); - (hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1); - }); - return result; - } - - /** - * Checks if the `callback` returns a truthy value for **all** elements of a - * `collection`. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias all - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Boolean} Returns `true` if all elements pass the callback check, - * else `false`. - * @example - * - * _.every([true, 1, null, 'yes'], Boolean); - * // => false - */ - function every(collection, callback, thisArg) { - var result = true; - callback = createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (!(result = !!callback(collection[index], index, collection))) { - break; - } - } - } else { - forEach(collection, function(value, index, collection) { - return (result = !!callback(value, index, collection)); - }); - } - return result; - } - - /** - * Examines each element in a `collection`, returning an array of all elements - * the `callback` returns truthy for. The `callback` is bound to `thisArg` and - * invoked with three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias select - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that passed the callback check. - * @example - * - * var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [2, 4, 6] - */ - function filter(collection, callback, thisArg) { - var result = []; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result.push(value); - } - }); - return result; - } - - /** - * Examines each element in a `collection`, returning the first one the `callback` - * returns truthy for. The function returns as soon as it finds an acceptable - * element, and does not iterate over the entire `collection`. The `callback` is - * bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias detect - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the element that passed the callback check, - * else `undefined`. - * @example - * - * var even = _.find([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => 2 - */ - function find(collection, callback, thisArg) { - var result; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - if (callback(value, index, collection)) { - result = value; - return false; - } - }); - return result; - } - - /** - * Iterates over a `collection`, executing the `callback` for each element in - * the `collection`. The `callback` is bound to `thisArg` and invoked with three - * arguments; (value, index|key, collection). Callbacks may exit iteration early - * by explicitly returning `false`. - * - * @static - * @memberOf _ - * @alias each - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array|Object|String} Returns `collection`. - * @example - * - * _([1, 2, 3]).forEach(alert).join(','); - * // => alerts each number and returns '1,2,3' - * - * _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, alert); - * // => alerts each number (order is not guaranteed) - */ - var forEach = createIterator(forEachIteratorOptions); - - /** - * Creates an object composed of keys returned from running each element of - * `collection` through a `callback`. The corresponding value of each key is an - * array of elements passed to `callback` that returned the key. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * The `callback` argument may also be the name of a property to group by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to group by. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Object} Returns the composed aggregate object. - * @example - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return Math.floor(num); }); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy([4.2, 6.1, 6.4], function(num) { return this.floor(num); }, Math); - * // => { '4': [4.2], '6': [6.1, 6.4] } - * - * _.groupBy(['one', 'two', 'three'], 'length'); - * // => { '3': ['one', 'two'], '5': ['three'] } - */ - function groupBy(collection, callback, thisArg) { - var result = {}; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, key, collection) { - key = callback(value, key, collection); - (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value); - }); - return result; - } - - /** - * Invokes the method named by `methodName` on each element in the `collection`, - * returning an array of the results of each invoked method. Additional arguments - * will be passed to each invoked method. If `methodName` is a function it will - * be invoked for, and `this` bound to, each element in the `collection`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} methodName The name of the method to invoke or - * the function invoked per iteration. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the method with. - * @returns {Array} Returns a new array of the results of each invoked method. - * @example - * - * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); - * // => [[1, 5, 7], [1, 2, 3]] - * - * _.invoke([123, 456], String.prototype.split, ''); - * // => [['1', '2', '3'], ['4', '5', '6']] - */ - function invoke(collection, methodName) { - var args = slice.call(arguments, 2), - isFunc = typeof methodName == 'function', - result = []; - - forEach(collection, function(value) { - result.push((isFunc ? methodName : value[methodName]).apply(value, args)); - }); - return result; - } - - /** - * Creates an array of values by running each element in the `collection` - * through a `callback`. The `callback` is bound to `thisArg` and invoked with - * three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias collect - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of the results of each `callback` execution. - * @example - * - * _.map([1, 2, 3], function(num) { return num * 3; }); - * // => [3, 6, 9] - * - * _.map({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { return num * 3; }); - * // => [3, 6, 9] (order is not guaranteed) - */ - function map(collection, callback, thisArg) { - var index = -1, - length = collection ? collection.length : 0, - result = Array(typeof length == 'number' ? length : 0); - - callback = createCallback(callback, thisArg); - if (isArray(collection)) { - while (++index < length) { - result[index] = callback(collection[index], index, collection); - } - } else { - forEach(collection, function(value, key, collection) { - result[++index] = callback(value, key, collection); - }); - } - return result; - } - - /** - * Retrieves the maximum value of an `array`. If `callback` is passed, - * it will be executed for each value in the `array` to generate the - * criterion by which the value is ranked. The `callback` is bound to - * `thisArg` and invoked with three arguments; (value, index, collection). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the maximum value. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.max(stooges, function(stooge) { return stooge.age; }); - * // => { 'name': 'curly', 'age': 60 }; - */ - function max(collection, callback, thisArg) { - var computed = -Infinity, - index = -1, - length = collection ? collection.length : 0, - result = computed; - - if (callback || !isArray(collection)) { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - forEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current > computed) { - computed = current; - result = value; - } - }); - } else { - while (++index < length) { - if (collection[index] > result) { - result = collection[index]; - } - } - } - return result; - } - - /** - * Retrieves the minimum value of an `array`. If `callback` is passed, - * it will be executed for each value in the `array` to generate the - * criterion by which the value is ranked. The `callback` is bound to `thisArg` - * and invoked with three arguments; (value, index, collection). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the minimum value. - * @example - * - * _.min([10, 5, 100, 2, 1000]); - * // => 2 - */ - function min(collection, callback, thisArg) { - var computed = Infinity, - index = -1, - length = collection ? collection.length : 0, - result = computed; - - if (callback || !isArray(collection)) { - callback = !callback && isString(collection) - ? charAtCallback - : createCallback(callback, thisArg); - - forEach(collection, function(value, index, collection) { - var current = callback(value, index, collection); - if (current < computed) { - computed = current; - result = value; - } - }); - } else { - while (++index < length) { - if (collection[index] < result) { - result = collection[index]; - } - } - } - return result; - } - - /** - * Retrieves the value of a specified property from all elements in - * the `collection`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {String} property The property to pluck. - * @returns {Array} Returns a new array of property values. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.pluck(stooges, 'name'); - * // => ['moe', 'larry', 'curly'] - */ - function pluck(collection, property) { - var result = []; - forEach(collection, function(value) { - result.push(value[property]); - }); - return result; - } - - /** - * Boils down a `collection` to a single value. The initial state of the - * reduction is `accumulator` and each successive step of it should be returned - * by the `callback`. The `callback` is bound to `thisArg` and invoked with 4 - * arguments; for arrays they are (accumulator, value, index|key, collection). - * - * @static - * @memberOf _ - * @alias foldl, inject - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [accumulator] Initial value of the accumulator. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the accumulated value. - * @example - * - * var sum = _.reduce([1, 2, 3], function(memo, num) { return memo + num; }); - * // => 6 - */ - function reduce(collection, callback, accumulator, thisArg) { - var noaccum = arguments.length < 3; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - accumulator = noaccum - ? (noaccum = false, value) - : callback(accumulator, value, index, collection) - }); - return accumulator; - } - - /** - * The right-associative version of `_.reduce`. - * - * @static - * @memberOf _ - * @alias foldr - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} callback The function called per iteration. - * @param {Mixed} [accumulator] Initial value of the accumulator. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Mixed} Returns the accumulated value. - * @example - * - * var list = [[0, 1], [2, 3], [4, 5]]; - * var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); - * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, callback, accumulator, thisArg) { - var iteratee = collection, - length = collection ? collection.length : 0, - noaccum = arguments.length < 3; - - if (typeof length != 'number') { - var props = keys(collection); - length = props.length; - } else if (noCharByIndex && isString(collection)) { - iteratee = collection.split(''); - } - forEach(collection, function(value, index, collection) { - index = props ? props[--length] : --length; - accumulator = noaccum - ? (noaccum = false, iteratee[index]) - : callback.call(thisArg, accumulator, iteratee[index], index, collection); - }); - return accumulator; - } - - /** - * The opposite of `_.filter`, this method returns the values of a - * `collection` that `callback` does **not** return truthy for. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of elements that did **not** pass the - * callback check. - * @example - * - * var odds = _.reject([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; }); - * // => [1, 3, 5] - */ - function reject(collection, callback, thisArg) { - callback = createCallback(callback, thisArg); - return filter(collection, function(value, index, collection) { - return !callback(value, index, collection); - }); - } - - /** - * Creates an array of shuffled `array` values, using a version of the - * Fisher-Yates shuffle. See http://en.wikipedia.org/wiki/Fisher-Yates_shuffle. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to shuffle. - * @returns {Array} Returns a new shuffled collection. - * @example - * - * _.shuffle([1, 2, 3, 4, 5, 6]); - * // => [4, 1, 6, 3, 5, 2] - */ - function shuffle(collection) { - var index = -1, - result = Array(collection ? collection.length : 0); - - forEach(collection, function(value) { - var rand = floor(nativeRandom() * (++index + 1)); - result[index] = result[rand]; - result[rand] = value; - }); - return result; - } - - /** - * Gets the size of the `collection` by returning `collection.length` for arrays - * and array-like objects or the number of own enumerable properties for objects. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to inspect. - * @returns {Number} Returns `collection.length` or number of own enumerable properties. - * @example - * - * _.size([1, 2]); - * // => 2 - * - * _.size({ 'one': 1, 'two': 2, 'three': 3 }); - * // => 3 - * - * _.size('curly'); - * // => 5 - */ - function size(collection) { - var length = collection ? collection.length : 0; - return typeof length == 'number' ? length : keys(collection).length; - } - - /** - * Checks if the `callback` returns a truthy value for **any** element of a - * `collection`. The function returns as soon as it finds passing value, and - * does not iterate over the entire `collection`. The `callback` is bound to - * `thisArg` and invoked with three arguments; (value, index|key, collection). - * - * @static - * @memberOf _ - * @alias any - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Boolean} Returns `true` if any element passes the callback check, - * else `false`. - * @example - * - * _.some([null, 0, 'yes', false]); - * // => true - */ - function some(collection, callback, thisArg) { - var result; - callback = createCallback(callback, thisArg); - - if (isArray(collection)) { - var index = -1, - length = collection.length; - - while (++index < length) { - if (result = callback(collection[index], index, collection)) { - break; - } - } - } else { - forEach(collection, function(value, index, collection) { - return !(result = callback(value, index, collection)); - }); - } - return !!result; - } - - /** - * Creates an array, stable sorted in ascending order by the results of - * running each element of `collection` through a `callback`. The `callback` - * is bound to `thisArg` and invoked with three arguments; (value, index|key, collection). - * The `callback` argument may also be the name of a property to sort by (e.g. 'length'). - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Function|String} callback|property The function called per iteration - * or property name to sort by. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a new array of sorted elements. - * @example - * - * _.sortBy([1, 2, 3], function(num) { return Math.sin(num); }); - * // => [3, 1, 2] - * - * _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math); - * // => [3, 1, 2] - * - * _.sortBy(['larry', 'brendan', 'moe'], 'length'); - * // => ['moe', 'larry', 'brendan'] - */ - function sortBy(collection, callback, thisArg) { - var result = []; - callback = createCallback(callback, thisArg); - forEach(collection, function(value, index, collection) { - result.push({ - 'criteria': callback(value, index, collection), - 'index': index, - 'value': value - }); - }); - - var length = result.length; - result.sort(compareAscending); - while (length--) { - result[length] = result[length].value; - } - return result; - } - - /** - * Converts the `collection`, to an array. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to convert. - * @returns {Array} Returns the new converted array. - * @example - * - * (function() { return _.toArray(arguments).slice(1); })(1, 2, 3, 4); - * // => [2, 3, 4] - */ - function toArray(collection) { - if (collection && typeof collection.length == 'number') { - return (noArraySliceOnStrings ? isString(collection) : typeof collection == 'string') - ? collection.split('') - : slice.call(collection); - } - return values(collection); - } - - /** - * Examines each element in a `collection`, returning an array of all elements - * that contain the given `properties`. - * - * @static - * @memberOf _ - * @category Collections - * @param {Array|Object|String} collection The collection to iterate over. - * @param {Object} properties The object of property values to filter by. - * @returns {Array} Returns a new array of elements that contain the given `properties`. - * @example - * - * var stooges = [ - * { 'name': 'moe', 'age': 40 }, - * { 'name': 'larry', 'age': 50 }, - * { 'name': 'curly', 'age': 60 } - * ]; - * - * _.where(stooges, { 'age': 40 }); - * // => [{ 'name': 'moe', 'age': 40 }] - */ - function where(collection, properties) { - var props = []; - forIn(properties, function(value, prop) { - props.push(prop); - }); - return filter(collection, function(object) { - var length = props.length; - while (length--) { - var result = object[props[length]] === properties[props[length]]; - if (!result) { - break; - } - } - return !!result; - }); - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates an array with all falsey values of `array` removed. The values - * `false`, `null`, `0`, `""`, `undefined` and `NaN` are all falsey. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to compact. - * @returns {Array} Returns a new filtered array. - * @example - * - * _.compact([0, 1, false, 2, '', 3]); - * // => [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result.push(value); - } - } - return result; - } - - /** - * Creates an array of `array` elements not present in the other arrays - * using strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to process. - * @param {Array} [array1, array2, ...] Arrays to check. - * @returns {Array} Returns a new array of `array` elements not present in the - * other arrays. - * @example - * - * _.difference([1, 2, 3, 4, 5], [5, 2, 10]); - * // => [1, 3, 4] - */ - function difference(array) { - var index = -1, - length = array ? array.length : 0, - flattened = concat.apply(arrayRef, arguments), - contains = cachedContains(flattened, length), - result = []; - - while (++index < length) { - var value = array[index]; - if (!contains(value)) { - result.push(value); - } - } - return result; - } - - /** - * Gets the first element of the `array`. Pass `n` to return the first `n` - * elements of the `array`. - * - * @static - * @memberOf _ - * @alias head, take - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n] The number of elements to return. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Mixed} Returns the first element or an array of the first `n` - * elements of `array`. - * @example - * - * _.first([5, 4, 3, 2, 1]); - * // => 5 - */ - function first(array, n, guard) { - if (array) { - return (n == null || guard) ? array[0] : slice.call(array, 0, n); - } - } - - /** - * Flattens a nested array (the nesting can be to any depth). If `shallow` is - * truthy, `array` will only be flattened a single level. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to compact. - * @param {Boolean} shallow A flag to indicate only flattening a single level. - * @returns {Array} Returns a new flattened array. - * @example - * - * _.flatten([1, [2], [3, [[4]]]]); - * // => [1, 2, 3, 4]; - * - * _.flatten([1, [2], [3, [[4]]]], true); - * // => [1, 2, 3, [[4]]]; - */ - function flatten(array, shallow) { - var index = -1, - length = array ? array.length : 0, - result = []; - - while (++index < length) { - var value = array[index]; - - // recursively flatten arrays (susceptible to call stack limits) - if (isArray(value)) { - push.apply(result, shallow ? value : flatten(value)); - } else { - result.push(value); - } - } - return result; - } - - /** - * Gets the index at which the first occurrence of `value` is found using - * strict equality for comparisons, i.e. `===`. If the `array` is already - * sorted, passing `true` for `fromIndex` will run a faster binary search. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Boolean|Number} [fromIndex=0] The index to search from or `true` to - * perform a binary search on a sorted `array`. - * @returns {Number} Returns the index of the matched value or `-1`. - * @example - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2); - * // => 1 - * - * _.indexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 4 - * - * _.indexOf([1, 1, 2, 2, 3, 3], 2, true); - * // => 2 - */ - function indexOf(array, value, fromIndex) { - var index = -1, - length = array ? array.length : 0; - - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; - } else if (fromIndex) { - index = sortedIndex(array, value); - return array[index] === value ? index : -1; - } - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Gets all but the last element of `array`. Pass `n` to exclude the last `n` - * elements from the result. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n=1] The number of elements to exclude. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Array} Returns all but the last element or `n` elements of `array`. - * @example - * - * _.initial([3, 2, 1]); - * // => [3, 2] - */ - function initial(array, n, guard) { - return array - ? slice.call(array, 0, -((n == null || guard) ? 1 : n)) - : []; - } - - /** - * Computes the intersection of all the passed-in arrays using strict equality - * for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of unique elements, in order, that are - * present in **all** of the arrays. - * @example - * - * _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]); - * // => [1, 2] - */ - function intersection(array) { - var args = arguments, - argsLength = args.length, - cache = {}, - result = []; - - forEach(array, function(value) { - if (indexOf(result, value) < 0) { - var length = argsLength; - while (--length) { - if (!(cache[length] || (cache[length] = cachedContains(args[length])))(value)) { - return; - } - } - result.push(value); - } - }); - return result; - } - - /** - * Gets the last element of the `array`. Pass `n` to return the last `n` - * elements of the `array`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n] The number of elements to return. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Mixed} Returns the last element or an array of the last `n` - * elements of `array`. - * @example - * - * _.last([3, 2, 1]); - * // => 1 - */ - function last(array, n, guard) { - if (array) { - var length = array.length; - return (n == null || guard) ? array[length - 1] : slice.call(array, -n || length); - } - } - - /** - * Gets the index at which the last occurrence of `value` is found using strict - * equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used - * as the offset from the end of the collection. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to search. - * @param {Mixed} value The value to search for. - * @param {Number} [fromIndex=array.length-1] The index to search from. - * @returns {Number} Returns the index of the matched value or `-1`. - * @example - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2); - * // => 4 - * - * _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); - * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var index = array ? array.length : 0; - if (typeof fromIndex == 'number') { - index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1; - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; - } - - /** - * Creates an object composed from arrays of `keys` and `values`. Pass either - * a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]`, or - * two arrays, one of `keys` and one of corresponding `values`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} keys The array of keys. - * @param {Array} [values=[]] The array of values. - * @returns {Object} Returns an object composed of the given keys and - * corresponding values. - * @example - * - * _.object(['moe', 'larry', 'curly'], [30, 40, 50]); - * // => { 'moe': 30, 'larry': 40, 'curly': 50 } - */ - function object(keys, values) { - var index = -1, - length = keys ? keys.length : 0, - result = {}; - - while (++index < length) { - var key = keys[index]; - if (values) { - result[key] = values[index]; - } else { - result[key[0]] = key[1]; - } - } - return result; - } - - /** - * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to but not including `stop`. This method is a port of Python's - * `range()` function. See http://docs.python.org/library/functions.html#range. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Number} [start=0] The start of the range. - * @param {Number} end The end of the range. - * @param {Number} [step=1] The value to increment or descrement by. - * @returns {Array} Returns a new range array. - * @example - * - * _.range(10); - * // => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - * - * _.range(1, 11); - * // => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] - * - * _.range(0, 30, 5); - * // => [0, 5, 10, 15, 20, 25] - * - * _.range(0, -10, -1); - * // => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9] - * - * _.range(0); - * // => [] - */ - function range(start, end, step) { - start = +start || 0; - step = +step || 1; - - if (end == null) { - end = start; - start = 0; - } - // use `Array(length)` so V8 will avoid the slower "dictionary" mode - // http://www.youtube.com/watch?v=XAqIpGU8ZZk#t=16m27s - var index = -1, - length = nativeMax(0, ceil((end - start) / step)), - result = Array(length); - - while (++index < length) { - result[index] = start; - start += step; - } - return result; - } - - /** - * The opposite of `_.initial`, this method gets all but the first value of - * `array`. Pass `n` to exclude the first `n` values from the result. - * - * @static - * @memberOf _ - * @alias drop, tail - * @category Arrays - * @param {Array} array The array to query. - * @param {Number} [n=1] The number of elements to exclude. - * @param- {Object} [guard] Internally used to allow this method to work with - * others like `_.map` without using their callback `index` argument for `n`. - * @returns {Array} Returns all but the first value or `n` values of `array`. - * @example - * - * _.rest([3, 2, 1]); - * // => [2, 1] - */ - function rest(array, n, guard) { - return array - ? slice.call(array, (n == null || guard) ? 1 : n) - : []; - } - - /** - * Uses a binary search to determine the smallest index at which the `value` - * should be inserted into `array` in order to maintain the sort order of the - * sorted `array`. If `callback` is passed, it will be executed for `value` and - * each element in `array` to compute their sort ranking. The `callback` is - * bound to `thisArg` and invoked with one argument; (value). The `callback` - * argument may also be the name of a property to order by. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to iterate over. - * @param {Mixed} value The value to evaluate. - * @param {Function|String} [callback=identity|property] The function called - * per iteration or property name to order by. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Number} Returns the index at which the value should be inserted - * into `array`. - * @example - * - * _.sortedIndex([20, 30, 50], 40); - * // => 2 - * - * _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); - * // => 2 - * - * var dict = { - * 'wordToNumber': { 'twenty': 20, 'thirty': 30, 'fourty': 40, 'fifty': 50 } - * }; - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return dict.wordToNumber[word]; - * }); - * // => 2 - * - * _.sortedIndex(['twenty', 'thirty', 'fifty'], 'fourty', function(word) { - * return this.wordToNumber[word]; - * }, dict); - * // => 2 - */ - function sortedIndex(array, value, callback, thisArg) { - var low = 0, - high = array ? array.length : low; - - // explicitly reference `identity` for better engine inlining - callback = callback ? createCallback(callback, thisArg) : identity; - value = callback(value); - while (low < high) { - var mid = (low + high) >>> 1; - callback(array[mid]) < value - ? low = mid + 1 - : high = mid; - } - return low; - } - - /** - * Computes the union of the passed-in arrays using strict equality for - * comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of unique values, in order, that are - * present in one or more of the arrays. - * @example - * - * _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]); - * // => [1, 2, 3, 101, 10] - */ - function union() { - return uniq(concat.apply(arrayRef, arguments)); - } - - /** - * Creates a duplicate-value-free version of the `array` using strict equality - * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` - * for `isSorted` will run a faster algorithm. If `callback` is passed, each - * element of `array` is passed through a callback` before uniqueness is computed. - * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). - * - * @static - * @memberOf _ - * @alias unique - * @category Arrays - * @param {Array} array The array to process. - * @param {Boolean} [isSorted=false] A flag to indicate that the `array` is already sorted. - * @param {Function} [callback=identity] The function called per iteration. - * @param {Mixed} [thisArg] The `this` binding of `callback`. - * @returns {Array} Returns a duplicate-value-free array. - * @example - * - * _.uniq([1, 2, 1, 3, 1]); - * // => [1, 2, 3] - * - * _.uniq([1, 1, 2, 2, 3], true); - * // => [1, 2, 3] - * - * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); - * // => [1, 2, 3] - * - * _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); - * // => [1, 2, 3] - */ - function uniq(array, isSorted, callback, thisArg) { - var index = -1, - length = array ? array.length : 0, - result = [], - seen = result; - - // juggle arguments - if (typeof isSorted == 'function') { - thisArg = callback; - callback = isSorted; - isSorted = false; - } - // init value cache for large arrays - var isLarge = !isSorted && length > 74; - if (isLarge) { - var cache = {}; - } - if (callback) { - seen = []; - callback = createCallback(callback, thisArg); - } - while (++index < length) { - var value = array[index], - computed = callback ? callback(value, index, array) : value; - - if (isLarge) { - // manually coerce `computed` to a string because `hasOwnProperty`, in - // some older versions of Firefox, coerces objects incorrectly - seen = hasOwnProperty.call(cache, computed + '') ? cache[computed] : (cache[computed] = []); - } - if (isSorted - ? !index || seen[seen.length - 1] !== computed - : indexOf(seen, computed) < 0 - ) { - if (callback || isLarge) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** - * Creates an array with all occurrences of the passed values removed using - * strict equality for comparisons, i.e. `===`. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} array The array to filter. - * @param {Mixed} [value1, value2, ...] Values to remove. - * @returns {Array} Returns a new filtered array. - * @example - * - * _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); - * // => [2, 3, 4] - */ - function without(array) { - var index = -1, - length = array ? array.length : 0, - contains = cachedContains(arguments, 1, 20), - result = []; - - while (++index < length) { - var value = array[index]; - if (!contains(value)) { - result.push(value); - } - } - return result; - } - - /** - * Groups the elements of each array at their corresponding indexes. Useful for - * separate data sources that are coordinated through matching array indexes. - * For a matrix of nested arrays, `_.zip.apply(...)` can transpose the matrix - * in a similar fashion. - * - * @static - * @memberOf _ - * @category Arrays - * @param {Array} [array1, array2, ...] Arrays to process. - * @returns {Array} Returns a new array of grouped elements. - * @example - * - * _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]); - * // => [['moe', 30, true], ['larry', 40, false], ['curly', 50, false]] - */ - function zip(array) { - var index = -1, - length = array ? max(pluck(arguments, 'length')) : 0, - result = Array(length); - - while (++index < length) { - result[index] = pluck(arguments, index); - } - return result; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Creates a function that is restricted to executing `func` only after it is - * called `n` times. The `func` is executed with the `this` binding of the - * created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Number} n The number of times the function must be called before - * it is executed. - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var renderNotes = _.after(notes.length, render); - * _.forEach(notes, function(note) { - * note.asyncSave({ 'success': renderNotes }); - * }); - * // `renderNotes` is run once, after all notes have saved - */ - function after(n, func) { - if (n < 1) { - return func(); - } - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** - * Creates a function that, when called, invokes `func` with the `this` - * binding of `thisArg` and prepends any additional `bind` arguments to those - * passed to the bound function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to bind. - * @param {Mixed} [thisArg] The `this` binding of `func`. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var func = function(greeting) { - * return greeting + ' ' + this.name; - * }; - * - * func = _.bind(func, { 'name': 'moe' }, 'hi'); - * func(); - * // => 'hi moe' - */ - function bind(func, thisArg) { - // use `Function#bind` if it exists and is fast - // (in V8 `Function#bind` is slower except when partially applied) - return isBindFast || (nativeBind && arguments.length > 2) - ? nativeBind.call.apply(nativeBind, arguments) - : createBound(func, thisArg, slice.call(arguments, 2)); - } - - /** - * Binds methods on `object` to `object`, overwriting the existing method. - * If no method names are provided, all the function properties of `object` - * will be bound. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object to bind and assign the bound methods to. - * @param {String} [methodName1, methodName2, ...] Method names on the object to bind. - * @returns {Object} Returns `object`. - * @example - * - * var buttonView = { - * 'label': 'lodash', - * 'onClick': function() { alert('clicked: ' + this.label); } - * }; - * - * _.bindAll(buttonView); - * jQuery('#lodash_button').on('click', buttonView.onClick); - * // => When the button is clicked, `this.label` will have the correct value - */ - function bindAll(object) { - var funcs = arguments, - index = funcs.length > 1 ? 0 : (funcs = functions(object), -1), - length = funcs.length; - - while (++index < length) { - var key = funcs[index]; - object[key] = bind(object[key], object); - } - return object; - } - - /** - * Creates a function that is the composition of the passed functions, - * where each function consumes the return value of the function that follows. - * In math terms, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. - * Each function is executed with the `this` binding of the composed function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} [func1, func2, ...] Functions to compose. - * @returns {Function} Returns the new composed function. - * @example - * - * var greet = function(name) { return 'hi: ' + name; }; - * var exclaim = function(statement) { return statement + '!'; }; - * var welcome = _.compose(exclaim, greet); - * welcome('moe'); - * // => 'hi: moe!' - */ - function compose() { - var funcs = arguments; - return function() { - var args = arguments, - length = funcs.length; - - while (length--) { - args = [funcs[length].apply(this, args)]; - } - return args[0]; - }; - } - - /** - * Creates a function that will delay the execution of `func` until after - * `wait` milliseconds have elapsed since the last time it was invoked. Pass - * `true` for `immediate` to cause debounce to invoke `func` on the leading, - * instead of the trailing, edge of the `wait` timeout. Subsequent calls to - * the debounced function will return the result of the last `func` call. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to debounce. - * @param {Number} wait The number of milliseconds to delay. - * @param {Boolean} immediate A flag to indicate execution is on the leading - * edge of the timeout. - * @returns {Function} Returns the new debounced function. - * @example - * - * var lazyLayout = _.debounce(calculateLayout, 300); - * jQuery(window).on('resize', lazyLayout); - */ - function debounce(func, wait, immediate) { - var args, - result, - thisArg, - timeoutId; - - function delayed() { - timeoutId = null; - if (!immediate) { - result = func.apply(thisArg, args); - } - } - return function() { - var isImmediate = immediate && !timeoutId; - args = arguments; - thisArg = this; - - clearTimeout(timeoutId); - timeoutId = setTimeout(delayed, wait); - - if (isImmediate) { - result = func.apply(thisArg, args); - } - return result; - }; - } - - /** - * Executes the `func` function after `wait` milliseconds. Additional arguments - * will be passed to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to delay. - * @param {Number} wait The number of milliseconds to delay execution. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. - * @returns {Number} Returns the `setTimeout` timeout id. - * @example - * - * var log = _.bind(console.log, console); - * _.delay(log, 1000, 'logged later'); - * // => 'logged later' (Appears after one second.) - */ - function delay(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function() { func.apply(undefined, args); }, wait); - } - - /** - * Defers executing the `func` function until the current call stack has cleared. - * Additional arguments will be passed to `func` when it is invoked. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to defer. - * @param {Mixed} [arg1, arg2, ...] Arguments to invoke the function with. - * @returns {Number} Returns the `setTimeout` timeout id. - * @example - * - * _.defer(function() { alert('deferred'); }); - * // returns from the function before `alert` is called - */ - function defer(func) { - var args = slice.call(arguments, 1); - return setTimeout(function() { func.apply(undefined, args); }, 1); - } - - /** - * Creates a function that, when called, invokes `object[methodName]` and - * prepends any additional `lateBind` arguments to those passed to the bound - * function. This method differs from `_.bind` by allowing bound functions to - * reference methods that will be redefined or don't yet exist. - * - * @static - * @memberOf _ - * @category Functions - * @param {Object} object The object the method belongs to. - * @param {String} methodName The method name. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new bound function. - * @example - * - * var object = { - * 'name': 'moe', - * 'greet': function(greeting) { - * return greeting + ' ' + this.name; - * } - * }; - * - * var func = _.lateBind(object, 'greet', 'hi'); - * func(); - * // => 'hi moe' - * - * object.greet = function(greeting) { - * return greeting + ', ' + this.name + '!'; - * }; - * - * func(); - * // => 'hi, moe!' - */ - function lateBind(object, methodName) { - return createBound(methodName, object, slice.call(arguments, 2)); - } - - /** - * Creates a function that memoizes the result of `func`. If `resolver` is - * passed, it will be used to determine the cache key for storing the result - * based on the arguments passed to the memoized function. By default, the first - * argument passed to the memoized function is used as the cache key. The `func` - * is executed with the `this` binding of the memoized function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to have its output memoized. - * @param {Function} [resolver] A function used to resolve the cache key. - * @returns {Function} Returns the new memoizing function. - * @example - * - * var fibonacci = _.memoize(function(n) { - * return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2); - * }); - */ - function memoize(func, resolver) { - var cache = {}; - return function() { - var key = resolver ? resolver.apply(this, arguments) : arguments[0]; - return hasOwnProperty.call(cache, key) - ? cache[key] - : (cache[key] = func.apply(this, arguments)); - }; - } - - /** - * Creates a function that is restricted to execute `func` once. Repeat calls to - * the function will return the value of the first call. The `func` is executed - * with the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new restricted function. - * @example - * - * var initialize = _.once(createApplication); - * initialize(); - * initialize(); - * // Application is only created once. - */ - function once(func) { - var result, - ran = false; - - return function() { - if (ran) { - return result; - } - ran = true; - result = func.apply(this, arguments); - - // clear the `func` variable so the function may be garbage collected - func = null; - return result; - }; - } - - /** - * Creates a function that, when called, invokes `func` with any additional - * `partial` arguments prepended to those passed to the new function. This - * method is similar to `bind`, except it does **not** alter the `this` binding. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to partially apply arguments to. - * @param {Mixed} [arg1, arg2, ...] Arguments to be partially applied. - * @returns {Function} Returns the new partially applied function. - * @example - * - * var greet = function(greeting, name) { return greeting + ': ' + name; }; - * var hi = _.partial(greet, 'hi'); - * hi('moe'); - * // => 'hi: moe' - */ - function partial(func) { - return createBound(func, slice.call(arguments, 1)); - } - - /** - * Creates a function that, when executed, will only call the `func` - * function at most once per every `wait` milliseconds. If the throttled - * function is invoked more than once during the `wait` timeout, `func` will - * also be called on the trailing edge of the timeout. Subsequent calls to the - * throttled function will return the result of the last `func` call. - * - * @static - * @memberOf _ - * @category Functions - * @param {Function} func The function to throttle. - * @param {Number} wait The number of milliseconds to throttle executions to. - * @returns {Function} Returns the new throttled function. - * @example - * - * var throttled = _.throttle(updatePosition, 100); - * jQuery(window).on('scroll', throttled); - */ - function throttle(func, wait) { - var args, - result, - thisArg, - timeoutId, - lastCalled = 0; - - function trailingCall() { - lastCalled = new Date; - timeoutId = null; - result = func.apply(thisArg, args); - } - return function() { - var now = new Date, - remaining = wait - (now - lastCalled); - - args = arguments; - thisArg = this; - - if (remaining <= 0) { - clearTimeout(timeoutId); - lastCalled = now; - result = func.apply(thisArg, args); - } - else if (!timeoutId) { - timeoutId = setTimeout(trailingCall, remaining); - } - return result; - }; - } - - /** - * Creates a function that passes `value` to the `wrapper` function as its - * first argument. Additional arguments passed to the function are appended - * to those passed to the `wrapper` function. The `wrapper` is executed with - * the `this` binding of the created function. - * - * @static - * @memberOf _ - * @category Functions - * @param {Mixed} value The value to wrap. - * @param {Function} wrapper The wrapper function. - * @returns {Function} Returns the new function. - * @example - * - * var hello = function(name) { return 'hello ' + name; }; - * hello = _.wrap(hello, function(func) { - * return 'before, ' + func('moe') + ', after'; - * }); - * hello(); - * // => 'before, hello moe, after' - */ - function wrap(value, wrapper) { - return function() { - var args = [value]; - push.apply(args, arguments); - return wrapper.apply(this, args); - }; - } - - /*--------------------------------------------------------------------------*/ - - /** - * Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their - * corresponding HTML entities. - * - * @static - * @memberOf _ - * @category Utilities - * @param {String} string The string to escape. - * @returns {String} Returns the escaped string. - * @example - * - * _.escape('Moe, Larry & Curly'); - * // => "Moe, Larry & Curly" - */ - function escape(string) { - return string == null ? '' : (string + '').replace(reUnescapedHtml, escapeHtmlChar); - } - - /** - * This function returns the first argument passed to it. - * - * Note: It is used throughout Lo-Dash as a default callback. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Mixed} value Any value. - * @returns {Mixed} Returns `value`. - * @example - * - * var moe = { 'name': 'moe' }; - * moe === _.identity(moe); - * // => true - */ - function identity(value) { - return value; - } - - /** - * Adds functions properties of `object` to the `lodash` function and chainable - * wrapper. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Object} object The object of function properties to add to `lodash`. - * @example - * - * _.mixin({ - * 'capitalize': function(string) { - * return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase(); - * } - * }); - * - * _.capitalize('larry'); - * // => 'Larry' - * - * _('curly').capitalize(); - * // => 'Curly' - */ - function mixin(object) { - forEach(functions(object), function(methodName) { - var func = lodash[methodName] = object[methodName]; - - lodash.prototype[methodName] = function() { - var args = [this.__wrapped__]; - push.apply(args, arguments); - - var result = func.apply(lodash, args); - if (this.__chain__) { - result = new lodash(result); - result.__chain__ = true; - } - return result; - }; - }); - } - - /** - * Reverts the '_' variable to its previous value and returns a reference to - * the `lodash` function. - * - * @static - * @memberOf _ - * @category Utilities - * @returns {Function} Returns the `lodash` function. - * @example - * - * var lodash = _.noConflict(); - */ - function noConflict() { - window._ = oldDash; - return this; - } - - /** - * Produces a random number between `min` and `max` (inclusive). If only one - * argument is passed, a number between `0` and the given number will be returned. - * - * @static - * @memberOf _ - * @category Utilities - * @param {Number} [min=0] The minimum possible value. - * @param {Number} [max=1] The maximum possible value. - * @returns {Number} Returns a random number. - * @example - * - * _.random(0, 5); - * // => a number between 1 and 5 - * - * _.random(5); - * // => also a number between 1 and 5 - */ - function random(min, max) { - if (min == null && max == null) { - max = 1; - } - min = +min || 0; - if (max == null) { - max = min; - min = 0; - } - return min + floor(nativeRandom() * ((+max || 0) - min + 1)); - } - - /** - * Resolves the value of `property` on `object`. If `property` is a function - * it will be invoked and its result returned, else the property value is - * returned. If `object` is falsey, then `null` is returned. - * - * @deprecated - * @static - * @memberOf _ - * @category Utilities - * @param {Object} object The object to inspect. - * @param {String} property The property to get the value of. - * @returns {Mixed} Returns the resolved value. - * @example - * - * var object = { - * 'cheese': 'crumpets', - * 'stuff': function() { - * return 'nonsense'; - * } - * }; - * - * _.result(object, 'cheese'); - * // => 'crumpets' - * - * _.result(object, 'stuff'); - * // => 'nonsense' - */ - function result(object, property) { - // based on Backbone's private `getValue` function - // https://github.com/documentcloud/backbone/blob/0.9.2/backbone.js#L1419-1424 - var value = object ? object[property] : null; - return isFunction(value) ? object[property]() : value; - } - - /** - * A micro-templating method that handles arbitrary delimiters, preserves - * whitespace, and correctly escapes quotes within interpolated code. - * - * Note: In the development build `_.template` utilizes sourceURLs for easier - * debugging. See http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl - * - * Note: Lo-Dash may be used in Chrome extensions by either creating a `lodash csp` - * build and avoiding `_.template` use, or loading Lo-Dash in a sandboxed page. - * See http://developer.chrome.com/trunk/extensions/sandboxingEval.html - * - * @static - * @memberOf _ - * @category Utilities - * @param {String} text The template text. - * @param {Obect} data The data object used to populate the text. - * @param {Object} options The options object. - * escape - The "escape" delimiter regexp. - * evaluate - The "evaluate" delimiter regexp. - * interpolate - The "interpolate" delimiter regexp. - * sourceURL - The sourceURL of the template's compiled source. - * variable - The data object variable name. - * - * @returns {Function|String} Returns a compiled function when no `data` object - * is given, else it returns the interpolated text. - * @example - * - * // using a compiled template - * var compiled = _.template('hello <%= name %>'); - * compiled({ 'name': 'moe' }); - * // => 'hello moe' - * - * var list = '<% _.forEach(people, function(name) { %>
      1. <%= name %>
      2. <% }); %>'; - * _.template(list, { 'people': ['moe', 'larry', 'curly'] }); - * // => '
      3. moe
      4. larry
      5. curly
      6. ' - * - * // using the "escape" delimiter to escape HTML in data property values - * _.template('<%- value %>', { 'value': '\n```\n\nUsing [npm](http://npmjs.org/):\n\n```bash\nnpm install lodash\n\nnpm install -g lodash\nnpm link lodash\n```\n\nIn [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):\n\n```js\nvar _ = require('lodash');\n```\n\n**Note:** If Lo-Dash is installed globally, [run `npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your project’s root directory before requiring it.\n\nIn [RingoJS v0.7.0-](http://ringojs.org/):\n\n```js\nvar _ = require('lodash')._;\n```\n\nIn [Rhino](http://www.mozilla.org/rhino/):\n\n```js\nload('lodash.js');\n```\n\nIn an AMD loader like [RequireJS](http://requirejs.org/):\n\n```js\nrequire({\n 'paths': {\n 'underscore': 'path/to/lodash'\n }\n},\n['underscore'], function(_) {\n console.log(_.VERSION);\n});\n```\n\n## Resolved Underscore.js issues\n\n * Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L545-551)]\n * Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L558-582)]\n * Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L140-146)]\n * `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L747-752)]\n * `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L828-840)]\n * `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L921-923)]\n * `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/lodash/lodash/blob/0.9.2/test/test.js#L1337-1340)]\n\n## Release Notes\n\n### v0.9.2\n\n * Added `fromIndex` argument to `_.contains`\n * Added `moduleId` build option\n * Added Closure Compiler *“simple”* optimizations to the build process\n * Added support for strings in `_.max` and `_.min`\n * Added support for ES6 template delimiters to `_.template`\n * Ensured re-minification of Lo-Dash by third parties avoids Closure Compiler bugs\n * Optimized `_.every`, `_.find`, `_.some`, and `_.uniq`\n\nThe full changelog is available [here](https://github.com/lodash/lodash/wiki/Changelog).\n\n## BestieJS\n\nLo-Dash is part of the [BestieJS](https://github.com/bestiejs) *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.\n\n## Author\n\n| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton \"Follow @jdalton on Twitter\") |\n|---|\n| [John-David Dalton](http://allyoucanleet.com/) |\n\n## Contributors\n\n| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](http://twitter.com/blainebublitz \"Follow @BlaineBublitz on Twitter\") | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge \"Follow @kitcambridge on Twitter\") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|---|---|\n| [Blaine Bublitz](http://iceddev.com/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |\n", - "readmeFilename": "README.md", - "_id": "lodash@0.9.2", - "_from": "lodash@~0.9.2" -} diff --git a/node_modules/grunt/node_modules/minimatch/.npmignore b/node_modules/grunt/node_modules/minimatch/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/node_modules/grunt/node_modules/minimatch/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/node_modules/grunt/node_modules/minimatch/LICENSE b/node_modules/grunt/node_modules/minimatch/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/minimatch/README.md b/node_modules/grunt/node_modules/minimatch/README.md deleted file mode 100644 index 978268e..0000000 --- a/node_modules/grunt/node_modules/minimatch/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -Eventually, it will replace the C binding in node-glob. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself. When set, an empty list is returned if there are -no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/node_modules/grunt/node_modules/minimatch/minimatch.js b/node_modules/grunt/node_modules/minimatch/minimatch.js deleted file mode 100644 index c633f89..0000000 --- a/node_modules/grunt/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,1055 +0,0 @@ -;(function (require, exports, module, platform) { - -if (module) module.exports = minimatch -else exports.minimatch = minimatch - -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} - -minimatch.Minimatch = Minimatch - -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") - -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" - - // * => any number of characters - , star = qmark + "*?" - - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" - - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" - - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split("").reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - - -function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - return false - } - - // "" only matches "" - if (pattern.trim() === "") return p === "" - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) - } - - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") - } - - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function() {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return -1 === s.indexOf(false) - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 - - if (options.nonegate) return - - for ( var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === "!" - ; i ++) { - negate = !negate - negateOffset ++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() -} - -Minimatch.prototype.braceExpand = braceExpand -function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" - ? this.pattern : pattern - - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - for (var i = start; i != (end + inc); i += inc) { - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(i + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - , self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case "*": - re += star - hasMagic = true - break - case "?": - re += qmark - hasMagic = true - break - default: - re += "\\"+stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - this.debug("%s\t%s %s %j", pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += "\\" + c - escaping = false - continue - } - - SWITCH: switch (c) { - case "/": - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case "\\": - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === "!" && i === classStart + 1) c = "^" - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case "(": - if (inClass) { - re += "(" - continue - } - - if (!stateChar) { - re += "\\(" - continue - } - - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) - // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ")": - if (inClass || !patternListStack.length) { - re += "\\)" - continue - } - - clearStateChar() - hasMagic = true - re += ")" - plType = patternListStack.pop().type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway - } - continue - - case "|": - if (inClass || !patternListStack.length || escaping) { - re += "\\|" - escaping = false - continue - } - - clearStateChar() - re += "|" - continue - - // these are mostly the same in regexp and glob - case "[": - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += "\\" + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case "]": - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += "\\" + c - escaping = false - continue - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" - } - - re += c - - } // switch - } // for - - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = "\\" - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" - }) - - this.debug("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star - : pl.type === "?" ? qmark - : "\\" + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += "\\\\" - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re - - if (addPatternStart) re = patternStart + re - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [ re, hasMagic ] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) return this.regexp = false - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" - - // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" - - try { - return this.regexp = new RegExp(re, flags) - } catch (ex) { - return this.regexp = false - } -} - -minimatch.match = function (list, pattern, options) { - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug("match", f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === "" - - if (f === "/" && partial) return true - - var options = this.options - - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, "split", f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, "set", set) - - var splitFile = path.basename(f.join("/")).split("/") - - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i], file = f - if (options.matchBase && pattern.length === 1) { - file = splitFile - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug("matchOne", - { "this": this - , file: file - , pattern: pattern }) - - this.debug("matchOne", file.length, pattern.length) - - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - this.debug("matchOne loop") - var p = pattern[pi] - , f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - , pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', - file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || - (!options.dot && swallowee.charAt(0) === ".")) { - this.debug("dot detected!", file, fr, pattern, pr) - break WHILE - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr ++ - } - } - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug("\n>>> no match, partial?", file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === "string") { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug("string match", p, f, hit) - } else { - hit = f.match(p) - this.debug("pattern match", p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") - return emptyFileEnd - } - - // should be unreachable. - throw new Error("wtf?") -} - - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") -} - - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") -} - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e47..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS deleted file mode 100644 index 4a0bc50..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +++ /dev/null @@ -1,14 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Brian Cottingham -Carlos Brito Lage -Jesse Dailey -Kevin O'Hara -Marco Rogers -Mark Cavage -Marko Mikulicic -Nathan Rajlich -Satheesh Natesan -Trent Mick -ashleybrener -n4kz diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/minimatch/node_modules/lru-cache/README.md b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index 03ee0f9..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `n` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index d1d1381..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,252 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -function LRUCache (options) { - if (!(this instanceof LRUCache)) - return new LRUCache(options) - - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - this._max = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) - this._max = Infinity - - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength - - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - this._max = mL - if (this._length > this._max) trim(this) - } - , get : function () { return this._max } - , enumerable : true - }) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - this._lengthCalculator = naiveLength - this._length = this._itemCount - for (var key in this._cache) { - this._cache[key].length = 1 - } - } else { - this._lengthCalculator = lC - this._length = 0 - for (var key in this._cache) { - this._cache[key].length = this._lengthCalculator(this._cache[key].value) - this._length += this._cache[key].length - } - } - - if (this._length > this._max) trim(this) - } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - - -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0; - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - i++ - var hit = this._lruList[k] - if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { - del(this, hit) - if (!this._allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } -} - -LRUCache.prototype.keys = function () { - var keys = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - keys[i++] = hit.key - } - return keys -} - -LRUCache.prototype.values = function () { - var values = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - values[i++] = hit.value - } - return values -} - -LRUCache.prototype.reset = function () { - if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } - } - - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency - this._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 -} - -// Provided for debugging/dev purposes only. No promises whatsoever that -// this API stays stable. -LRUCache.prototype.dump = function () { - return this._cache -} - -LRUCache.prototype.dumpLru = function () { - return this._lruList -} - -LRUCache.prototype.set = function (key, value) { - if (hOP(this._cache, key)) { - // dispose of the old one before overwriting - if (this._dispose) this._dispose(key, this._cache[key].value) - if (this._maxAge) this._cache[key].now = Date.now() - this._cache[key].value = value - this.get(key) - return true - } - - var len = this._lengthCalculator(value) - var age = this._maxAge ? Date.now() : 0 - var hit = new Entry(key, value, this._mru++, len, age) - - // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) - return false - } - - this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ - - if (this._length > this._max) trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] - if (this._maxAge && (Date.now() - hit.now > this._maxAge)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] - del(this, hit) - return hit || null -} - -LRUCache.prototype.del = function (key) { - del(this, this._cache[key]) -} - -function get (self, key, doUse) { - var hit = self._cache[key] - if (hit) { - if (self._maxAge && (Date.now() - hit.now > self._maxAge)) { - del(self, hit) - if (!self._allowStale) hit = undefined - } else { - if (doUse) use(self, hit) - } - if (hit) hit = hit.value - } - return hit -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit -} - -function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) -} - -function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ -} - -function del (self, hit) { - if (hit) { - if (self._dispose) self._dispose(hit.key, hit.value) - self._length -= hit.length - self._itemCount -- - delete self._cache[ hit.key ] - shiftLU(self, hit) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now) { - this.key = key - this.value = value - this.lu = lu - this.length = length - this.now = now -} - -})() diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index a70ac8c..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.5.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "", - "weak": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" - }, - "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "_id": "lru-cache@2.5.0", - "_from": "lru-cache@2" -} diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index f72697c..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,369 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -// Note: `.dump()` is a debugging tool only. No guarantees are made -// about the format/layout of the response. -test("dump", function (t) { - var cache = new LRU(10) - var d = cache.dump(); - t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") - cache.set("a", "A") - var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } - t.ok(d.a) - t.equal(d.a.key, "a") - t.equal(d.a.value, "A") - t.equal(d.a.lu, 0) - - cache.set("b", "B") - cache.get("b") - d = cache.dump() - t.ok(d.b) - t.equal(d.b.key, "b") - t.equal(d.b.value, "B") - t.equal(d.b.lu, 2) - - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("pop the least used item", function (t) { - var cache = new LRU(3) - , last - - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - - t.equal(cache.length, 3) - t.equal(cache.max, 3) - - // Ensure we pop a, c, b - cache.get("b", "B") - - last = cache.pop() - t.equal(last.key, "a") - t.equal(last.value, "A") - t.equal(cache.length, 2) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "c") - t.equal(last.value, "C") - t.equal(cache.length, 1) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "b") - t.equal(last.value, "B") - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last, null) - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - t.end() -}) diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index eefb80d..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index 7af45b0..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env node --expose_gc - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 0c44ae7..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Isaac Z. Schlueter ("Author") -All rights reserved. - -The BSD License - -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. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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/grunt/node_modules/minimatch/node_modules/sigmund/README.md b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 7e36512..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached) - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocain-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `sys.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index ec8e2eb..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "sigmund", - "version": "1.0.0", - "description": "Quick and dirty signatures for Objects.", - "main": "sigmund.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "~0.3.0" - }, - "scripts": { - "test": "tap test/*.js", - "bench": "node bench.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund" - }, - "keywords": [ - "object", - "signature", - "key", - "data", - "psychoanalysis" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "BSD", - "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/sigmund/issues" - }, - "_id": "sigmund@1.0.0", - "_from": "sigmund@~1.0.0" -} diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js b/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 50c53a1..0000000 --- a/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) - diff --git a/node_modules/grunt/node_modules/minimatch/package.json b/node_modules/grunt/node_modules/minimatch/package.json deleted file mode 100644 index bb2b05f..0000000 --- a/node_modules/grunt/node_modules/minimatch/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "0.2.14", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "test": "tap test/*.js" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" - }, - "devDependencies": { - "tap": "" - }, - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, - "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "_id": "minimatch@0.2.14", - "_from": "minimatch@~0.2.12" -} diff --git a/node_modules/grunt/node_modules/minimatch/test/basic.js b/node_modules/grunt/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - - -var patterns = - [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - // https://github.com/isaacs/minimatch/issues/5 - , function () { - files = [ 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' - , 'a/b/.x' - , 'a/b/.x/' - , 'a/.x/b' - , '.x' - , '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b/.x/c' - , '.x/.x' ] - } - , ["**/.x/**", [ '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b' - , 'a/b/.x/' - , 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' ] ] - - ] - -var regexps = - [ '/^(?:(?=.)a[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:\\*)$/', - '/^(?:(?=.)\\*[^/]*?)$/', - '/^(?:\\*\\*)$/', - '/^(?:(?=.)b[^/]*?\\/)$/', - '/^(?:(?=.)c[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', - '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', - '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', - '/^(?:(?=.)a[^/]*?[^c])$/', - '/^(?:(?=.)a[X-]b)$/', - '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', - '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[^/]c)$/', - '/^(?:a\\*c)$/', - 'false', - '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', - '/^(?:man\\/man1\\/bash\\.1)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[-abc])$/', - '/^(?:(?!\\.)(?=.)[abc-])$/', - '/^(?:\\\\)$/', - '/^(?:(?!\\.)(?=.)[\\\\])$/', - '/^(?:(?!\\.)(?=.)[\\[])$/', - '/^(?:\\[)$/', - '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[\\]])$/', - '/^(?:(?!\\.)(?=.)[\\]-])$/', - '/^(?:(?!\\.)(?=.)[a-z])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:\\[\\])$/', - '/^(?:\\[abc)$/', - '/^(?:(?=.)XYZ)$/i', - '/^(?:(?=.)ab[^/]*?)$/i', - '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', - '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', - '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', - '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', - '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', - '/^(?:(?=.)a[^/]b)$/', - '/^(?:(?=.)#[^/]*?)$/', - '/^(?!^(?:(?=.)a[^/]*?)$).*$/', - '/^(?:(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)a[^/]*?)$/', - '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] -var re = 0; - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - patterns.forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var m = new mm.Minimatch(pattern, options) - var r = m.makeRe() - var expectRe = regexps[re++] - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - - t.equal(tapOpts.re, expectRe, tapOpts) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/node_modules/grunt/node_modules/minimatch/test/brace-expand.js b/node_modules/grunt/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index 7ee278a..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,33 +0,0 @@ -var tap = require("tap") - , minimatch = require("../") - -tap.test("brace expansion", function (t) { - // [ pattern, [expanded] ] - ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" - , [ "abxy" - , "abxz" - , "acdxy" - , "acdxz" - , "acexy" - , "acexz" - , "afhxy" - , "afhxz" - , "aghxy" - , "aghxz" ] ] - , [ "a{1..5}b" - , [ "a1b" - , "a2b" - , "a3b" - , "a4b" - , "a5b" ] ] - , [ "a{b}c", ["a{b}c"] ] - ].forEach(function (tc) { - var p = tc[0] - , expect = tc[1] - t.equivalent(minimatch.braceExpand(p), expect, p) - }) - console.error("ending") - t.end() -}) - - diff --git a/node_modules/grunt/node_modules/minimatch/test/caching.js b/node_modules/grunt/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/node_modules/grunt/node_modules/minimatch/test/defaults.js b/node_modules/grunt/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 25f1f60..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var Class = mm.defaults(options).Minimatch - var m = new Class(pattern, {}) - var r = m.makeRe() - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/node_modules/grunt/node_modules/minimatch/test/extglob-ending-with-state-char.js b/node_modules/grunt/node_modules/minimatch/test/extglob-ending-with-state-char.js deleted file mode 100644 index 6676e26..0000000 --- a/node_modules/grunt/node_modules/minimatch/test/extglob-ending-with-state-char.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tap').test -var minimatch = require('../') - -test('extglob ending with statechar', function(t) { - t.notOk(minimatch('ax', 'a?(b*)')) - t.ok(minimatch('ax', '?(a*|b)')) - t.end() -}) diff --git a/node_modules/grunt/node_modules/nopt/.npmignore b/node_modules/grunt/node_modules/nopt/.npmignore deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/nopt/LICENSE b/node_modules/grunt/node_modules/nopt/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/nopt/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/nopt/README.md b/node_modules/grunt/node_modules/nopt/README.md deleted file mode 100644 index eeddfd4..0000000 --- a/node_modules/grunt/node_modules/nopt/README.md +++ /dev/null @@ -1,208 +0,0 @@ -If you want to write an option parser, and have it be good, there are -two ways to do it. The Right Way, and the Wrong Way. - -The Wrong Way is to sit down and write an option parser. We've all done -that. - -The Right Way is to write some complex configurable program with so many -options that you go half-insane just trying to manage them all, and put -it off with duct-tape solutions until you see exactly to the core of the -problem, and finally snap and write an awesome option parser. - -If you want to write an option parser, don't write an option parser. -Write a package manager, or a source control system, or a service -restarter, or an operating system. You probably won't end up with a -good one of those, but if you don't give up, and you are relentless and -diligent enough in your procrastination, you may just end up with a very -nice option parser. - -## USAGE - - // my-program.js - var nopt = require("nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - , "many" : [String, Array] - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag"] - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - console.log(parsed) - -This would give you support for any of the following: - -```bash -$ node my-program.js --foo "blerp" --no-flag -{ "foo" : "blerp", "flag" : false } - -$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag -{ bar: 7, foo: "Mr. Hand", flag: true } - -$ node my-program.js --foo "blerp" -f -----p -{ foo: "blerp", flag: true, pick: true } - -$ node my-program.js -fp --foofoo -{ foo: "Mr. Foo", flag: true, pick: true } - -$ node my-program.js --foofoo -- -fp # -- stops the flag parsing. -{ foo: "Mr. Foo", argv: { remain: ["-fp"] } } - -$ node my-program.js --blatzk 1000 -fp # unknown opts are ok. -{ blatzk: 1000, flag: true, pick: true } - -$ node my-program.js --blatzk true -fp # but they need a value -{ blatzk: true, flag: true, pick: true } - -$ node my-program.js --no-blatzk -fp # unless they start with "no-" -{ blatzk: false, flag: true, pick: true } - -$ node my-program.js --baz b/a/z # known paths are resolved. -{ baz: "/Users/isaacs/b/a/z" } - -# if Array is one of the types, then it can take many -# values, and will always be an array. The other types provided -# specify what types are allowed in the list. - -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } - -$ node my-program.js --many foo -{ many: ["foo"] } -``` - -Read the tests at the bottom of `lib/nopt.js` for more examples of -what this puppy can do. - -## Types - -The following types are supported, and defined on `nopt.typeDefs` - -* String: A normal string. No parsing is done. -* path: A file system path. Gets resolved against cwd if not absolute. -* url: A url. If it doesn't parse, it isn't accepted. -* Number: Must be numeric. -* Date: Must parse as a date. If it does, and `Date` is one of the options, - then it will return a Date object, not a string. -* Boolean: Must be either `true` or `false`. If an option is a boolean, - then it does not need a value, and its presence will imply `true` as - the value. To negate boolean flags, do `--no-whatever` or `--whatever - false` -* NaN: Means that the option is strictly not allowed. Any value will - fail. -* Stream: An object matching the "Stream" class in node. Valuable - for use when validating programmatically. (npm uses this to let you - supply any WriteStream on the `outfd` and `logfd` config options.) -* Array: If `Array` is specified as one of the types, then the value - will be parsed as a list of options. This means that multiple values - can be specified, and that the value will always be an array. - -If a type is an array of values not on this list, then those are -considered valid values. For instance, in the example above, the -`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`, -and any other value will be rejected. - -When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents, and numeric values will be -interpreted as a number. - -You can also mix types and values, or multiple types, in a list. For -instance `{ blah: [Number, null] }` would allow a value to be set to -either a Number or null. - -To define a new type, add it to `nopt.typeDefs`. Each item in that -hash is an object with a `type` member and a `validate` method. The -`type` member is an object that matches what goes in the type list. The -`validate` method is a function that gets called with `validate(data, -key, val)`. Validate methods should assign `data[key]` to the valid -value of `val` if it can be handled properly, or return boolean -`false` if it cannot. - -You can also call `nopt.clean(data, types, typeDefs)` to clean up a -config object and remove its invalid properties. - -## Error Handling - -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method -to `nopt.invalidHandler`. This method will be called with -the offending `nopt.invalidHandler(key, val, types)`. - -If no `nopt.invalidHandler` is assigned, then it will console.error -its whining. If it is assigned to boolean `false` then the warning is -suppressed. - -## Abbreviations - -Yes, they are supported. If you define options like this: - -```javascript -{ "foolhardyelephants" : Boolean -, "pileofmonkeys" : Boolean } -``` - -Then this will work: - -```bash -node program.js --foolhar --pil -node program.js --no-f --pileofmon -# etc. -``` - -## Shorthands - -Shorthands are a hash of shorter option names to a snippet of args that -they expand to. - -If multiple one-character shorthands are all combined, and the -combination does not unambiguously match any other option or shorthand, -then they will be broken up into their constituent parts. For example: - -```json -{ "s" : ["--loglevel", "silent"] -, "g" : "--global" -, "f" : "--force" -, "p" : "--parseable" -, "l" : "--long" -} -``` - -```bash -npm ls -sgflp -# just like doing this: -npm ls --loglevel silent --global --force --long --parseable -``` - -## The Rest of the args - -The config object returned by nopt is given a special member called -`argv`, which is an object with the following fields: - -* `remain`: The remaining args after all the parsing has occurred. -* `original`: The args as they originally appeared. -* `cooked`: The args after flags and shorthands are expanded. - -## Slicing - -Node programs are called with more or less the exact argv as it appears -in C land, after the v8 and node-specific options have been plucked off. -As such, `argv[0]` is always `node` and `argv[1]` is always the -JavaScript program being run. - -That's usually not very useful to you. So they're sliced off by -default. If you want them, then you can pass in `0` as the last -argument, or any other number that you'd like to slice off the start of -the list. diff --git a/node_modules/grunt/node_modules/nopt/bin/nopt.js b/node_modules/grunt/node_modules/nopt/bin/nopt.js deleted file mode 100755 index df90c72..0000000 --- a/node_modules/grunt/node_modules/nopt/bin/nopt.js +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env node -var nopt = require("../lib/nopt") - , types = { num: Number - , bool: Boolean - , help: Boolean - , list: Array - , "num-list": [Number, Array] - , "str-list": [String, Array] - , "bool-list": [Boolean, Array] - , str: String } - , shorthands = { s: [ "--str", "astring" ] - , b: [ "--bool" ] - , nb: [ "--no-bool" ] - , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ] - , "?": ["--help"] - , h: ["--help"] - , H: ["--help"] - , n: [ "--num", "125" ] } - , parsed = nopt( types - , shorthands - , process.argv - , 2 ) - -console.log("parsed", parsed) - -if (parsed.help) { - console.log("") - console.log("nopt cli tester") - console.log("") - console.log("types") - console.log(Object.keys(types).map(function M (t) { - var type = types[t] - if (Array.isArray(type)) { - return [t, type.map(function (type) { return type.name })] - } - return [t, type && type.name] - }).reduce(function (s, i) { - s[i[0]] = i[1] - return s - }, {})) - console.log("") - console.log("shorthands") - console.log(shorthands) -} diff --git a/node_modules/grunt/node_modules/nopt/examples/my-program.js b/node_modules/grunt/node_modules/nopt/examples/my-program.js deleted file mode 100755 index 142447e..0000000 --- a/node_modules/grunt/node_modules/nopt/examples/my-program.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -//process.env.DEBUG_NOPT = 1 - -// my-program.js -var nopt = require("../lib/nopt") - , Stream = require("stream").Stream - , path = require("path") - , knownOpts = { "foo" : [String, null] - , "bar" : [Stream, Number] - , "baz" : path - , "bloo" : [ "big", "medium", "small" ] - , "flag" : Boolean - , "pick" : Boolean - } - , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] - , "b7" : ["--bar", "7"] - , "m" : ["--bloo", "medium"] - , "p" : ["--pick"] - , "f" : ["--flag", "true"] - , "g" : ["--flag"] - , "s" : "--flag" - } - // everything is optional. - // knownOpts and shorthands default to {} - // arg list defaults to process.argv - // slice defaults to 2 - , parsed = nopt(knownOpts, shortHands, process.argv, 2) - -console.log("parsed =\n"+ require("util").inspect(parsed)) diff --git a/node_modules/grunt/node_modules/nopt/lib/nopt.js b/node_modules/grunt/node_modules/nopt/lib/nopt.js deleted file mode 100644 index ff802da..0000000 --- a/node_modules/grunt/node_modules/nopt/lib/nopt.js +++ /dev/null @@ -1,552 +0,0 @@ -// info about each config option. - -var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG - ? function () { console.error.apply(console, arguments) } - : function () {} - -var url = require("url") - , path = require("path") - , Stream = require("stream").Stream - , abbrev = require("abbrev") - -module.exports = exports = nopt -exports.clean = clean - -exports.typeDefs = - { String : { type: String, validate: validateString } - , Boolean : { type: Boolean, validate: validateBoolean } - , url : { type: url, validate: validateUrl } - , Number : { type: Number, validate: validateNumber } - , path : { type: path, validate: validatePath } - , Stream : { type: Stream, validate: validateStream } - , Date : { type: Date, validate: validateDate } - } - -function nopt (types, shorthands, args, slice) { - args = args || process.argv - types = types || {} - shorthands = shorthands || {} - if (typeof slice !== "number") slice = 2 - - debug(types, shorthands, args, slice) - - args = args.slice(slice) - var data = {} - , key - , remain = [] - , cooked = args - , original = args.slice(0) - - parse(args, data, remain, types, shorthands) - // now data is full - clean(data, types, exports.typeDefs) - data.argv = {remain:remain,cooked:cooked,original:original} - data.argv.toString = function () { - return this.original.map(JSON.stringify).join(" ") - } - return data -} - -function clean (data, types, typeDefs) { - typeDefs = typeDefs || exports.typeDefs - var remove = {} - , typeDefault = [false, true, null, String, Number] - - Object.keys(data).forEach(function (k) { - if (k === "argv") return - var val = data[k] - , isArray = Array.isArray(val) - , type = types[k] - if (!isArray) val = [val] - if (!type) type = typeDefault - if (type === Array) type = typeDefault.concat(Array) - if (!Array.isArray(type)) type = [type] - - debug("val=%j", val) - debug("types=", type) - val = val.map(function (val) { - // if it's an unknown value, then parse false/true/null/numbers/dates - if (typeof val === "string") { - debug("string %j", val) - val = val.trim() - if ((val === "null" && ~type.indexOf(null)) - || (val === "true" && - (~type.indexOf(true) || ~type.indexOf(Boolean))) - || (val === "false" && - (~type.indexOf(false) || ~type.indexOf(Boolean)))) { - val = JSON.parse(val) - debug("jsonable %j", val) - } else if (~type.indexOf(Number) && !isNaN(val)) { - debug("convert to number", val) - val = +val - } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) { - debug("convert to date", val) - val = new Date(val) - } - } - - if (!types.hasOwnProperty(k)) { - return val - } - - // allow `--no-blah` to set 'blah' to null if null is allowed - if (val === false && ~type.indexOf(null) && - !(~type.indexOf(false) || ~type.indexOf(Boolean))) { - val = null - } - - var d = {} - d[k] = val - debug("prevalidated val", d, val, types[k]) - if (!validate(d, k, val, types[k], typeDefs)) { - if (exports.invalidHandler) { - exports.invalidHandler(k, val, types[k], data) - } else if (exports.invalidHandler !== false) { - debug("invalid: "+k+"="+val, types[k]) - } - return remove - } - debug("validated val", d, val, types[k]) - return d[k] - }).filter(function (val) { return val !== remove }) - - if (!val.length) delete data[k] - else if (isArray) { - debug(isArray, data[k], val) - data[k] = val - } else data[k] = val[0] - - debug("k=%s val=%j", k, val, data[k]) - }) -} - -function validateString (data, k, val) { - data[k] = String(val) -} - -function validatePath (data, k, val) { - data[k] = path.resolve(String(val)) - return true -} - -function validateNumber (data, k, val) { - debug("validate Number %j %j %j", k, val, isNaN(val)) - if (isNaN(val)) return false - data[k] = +val -} - -function validateDate (data, k, val) { - debug("validate Date %j %j %j", k, val, Date.parse(val)) - var s = Date.parse(val) - if (isNaN(s)) return false - data[k] = new Date(val) -} - -function validateBoolean (data, k, val) { - if (val instanceof Boolean) val = val.valueOf() - else if (typeof val === "string") { - if (!isNaN(val)) val = !!(+val) - else if (val === "null" || val === "false") val = false - else val = true - } else val = !!val - data[k] = val -} - -function validateUrl (data, k, val) { - val = url.parse(String(val)) - if (!val.host) return false - data[k] = val.href -} - -function validateStream (data, k, val) { - if (!(val instanceof Stream)) return false - data[k] = val -} - -function validate (data, k, val, type, typeDefs) { - // arrays are lists of types. - if (Array.isArray(type)) { - for (var i = 0, l = type.length; i < l; i ++) { - if (type[i] === Array) continue - if (validate(data, k, val, type[i], typeDefs)) return true - } - delete data[k] - return false - } - - // an array of anything? - if (type === Array) return true - - // NaN is poisonous. Means that something is not allowed. - if (type !== type) { - debug("Poison NaN", k, val, type) - delete data[k] - return false - } - - // explicit list of values - if (val === type) { - debug("Explicitly allowed %j", val) - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - return true - } - - // now go through the list of typeDefs, validate against each one. - var ok = false - , types = Object.keys(typeDefs) - for (var i = 0, l = types.length; i < l; i ++) { - debug("test type %j %j %j", k, val, types[i]) - var t = typeDefs[types[i]] - if (t && type === t.type) { - var d = {} - ok = false !== t.validate(d, k, val) - val = d[k] - if (ok) { - // if (isArray) (data[k] = data[k] || []).push(val) - // else data[k] = val - data[k] = val - break - } - } - } - debug("OK? %j (%j %j %j)", ok, k, val, types[i]) - - if (!ok) delete data[k] - return ok -} - -function parse (args, data, remain, types, shorthands) { - debug("parse", args, data, remain) - - var key = null - , abbrevs = abbrev(Object.keys(types)) - , shortAbbr = abbrev(Object.keys(shorthands)) - - for (var i = 0; i < args.length; i ++) { - var arg = args[i] - debug("arg", arg) - - if (arg.match(/^-{2,}$/)) { - // done with keys. - // the rest are args. - remain.push.apply(remain, args.slice(i + 1)) - args[i] = "--" - break - } - if (arg.charAt(0) === "-") { - if (arg.indexOf("=") !== -1) { - var v = arg.split("=") - arg = v.shift() - v = v.join("=") - args.splice.apply(args, [i, 1].concat([arg, v])) - } - // see if it's a shorthand - // if so, splice and back up to re-parse it. - var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs) - debug("arg=%j shRes=%j", arg, shRes) - if (shRes) { - debug(arg, shRes) - args.splice.apply(args, [i, 1].concat(shRes)) - if (arg !== shRes[0]) { - i -- - continue - } - } - arg = arg.replace(/^-+/, "") - var no = false - while (arg.toLowerCase().indexOf("no-") === 0) { - no = !no - arg = arg.substr(3) - } - - if (abbrevs[arg]) arg = abbrevs[arg] - - var isArray = types[arg] === Array || - Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1 - - var val - , la = args[i + 1] - - var isBool = no || - types[arg] === Boolean || - Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 || - (la === "false" && - (types[arg] === null || - Array.isArray(types[arg]) && ~types[arg].indexOf(null))) - - if (isBool) { - // just set and move along - val = !no - // however, also support --bool true or --bool false - if (la === "true" || la === "false") { - val = JSON.parse(la) - la = null - if (no) val = !val - i ++ - } - - // also support "foo":[Boolean, "bar"] and "--foo bar" - if (Array.isArray(types[arg]) && la) { - if (~types[arg].indexOf(la)) { - // an explicit type - val = la - i ++ - } else if ( la === "null" && ~types[arg].indexOf(null) ) { - // null allowed - val = null - i ++ - } else if ( !la.match(/^-{2,}[^-]/) && - !isNaN(la) && - ~types[arg].indexOf(Number) ) { - // number - val = +la - i ++ - } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) { - // string - val = la - i ++ - } - } - - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - continue - } - - if (la && la.match(/^-{2,}$/)) { - la = undefined - i -- - } - - val = la === undefined ? true : la - if (isArray) (data[arg] = data[arg] || []).push(val) - else data[arg] = val - - i ++ - continue - } - remain.push(arg) - } -} - -function resolveShort (arg, shorthands, shortAbbr, abbrevs) { - // handle single-char shorthands glommed together, like - // npm ls -glp, but only if there is one dash, and only if - // all of the chars are single-char shorthands, and it's - // not a match to some other abbrev. - arg = arg.replace(/^-+/, '') - if (abbrevs[arg] && !shorthands[arg]) { - return null - } - if (shortAbbr[arg]) { - arg = shortAbbr[arg] - } else { - var singles = shorthands.___singles - if (!singles) { - singles = Object.keys(shorthands).filter(function (s) { - return s.length === 1 - }).reduce(function (l,r) { l[r] = true ; return l }, {}) - shorthands.___singles = singles - } - var chrs = arg.split("").filter(function (c) { - return singles[c] - }) - if (chrs.join("") === arg) return chrs.map(function (c) { - return shorthands[c] - }).reduce(function (l, r) { - return l.concat(r) - }, []) - } - - if (shorthands[arg] && !Array.isArray(shorthands[arg])) { - shorthands[arg] = shorthands[arg].split(/\s+/) - } - return shorthands[arg] -} - -if (module === require.main) { -var assert = require("assert") - , util = require("util") - - , shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - } - - , types = - { aoa: Array - , nullstream: [null, Stream] - , date: Date - , str: String - , browser : String - , cache : path - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : path - , force : Boolean - , global : Boolean - , globalconfig : path - , group : [String, Number] - , gzipbin : String - , logfd : [Number, Stream] - , loglevel : ["silent","win","error","warn","info","verbose","silly"] - , long : Boolean - , "node-version" : [false, String] - , npaturl : url - , npat : Boolean - , "onload-script" : [false, String] - , outfd : [Number, Stream] - , parseable : Boolean - , pre: Boolean - , prefix: path - , proxy : url - , "rebuild-bundle" : Boolean - , registry : url - , searchopts : String - , searchexclude: [null, String] - , shell : path - , t: [Array, String] - , tag : String - , tar : String - , tmp : path - , "unsafe-perm" : Boolean - , usage : Boolean - , user : String - , username : String - , userconfig : path - , version : Boolean - , viewer: path - , _exit : Boolean - } - -; [["-v", {version:true}, []] - ,["---v", {version:true}, []] - ,["ls -s --no-reg connect -d", - {loglevel:"info",registry:null},["ls","connect"]] - ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]] - ,["ls --registry blargle", {}, ["ls"]] - ,["--no-registry", {registry:null}, []] - ,["--no-color true", {color:false}, []] - ,["--no-color false", {color:true}, []] - ,["--no-color", {color:false}, []] - ,["--color false", {color:false}, []] - ,["--color --logfd 7", {logfd:7,color:true}, []] - ,["--color=true", {color:true}, []] - ,["--logfd=10", {logfd:10}, []] - ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]] - ,["--tmp=tmp -tar=gtar", - {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]] - ,["--logfd x", {}, []] - ,["a -true -- -no-false", {true:true},["a","-no-false"]] - ,["a -no-false", {false:false},["a"]] - ,["a -no-no-true", {true:true}, ["a"]] - ,["a -no-no-no-false", {false:false}, ["a"]] - ,["---NO-no-No-no-no-no-nO-no-no"+ - "-No-no-no-no-no-no-no-no-no"+ - "-no-no-no-no-NO-NO-no-no-no-no-no-no"+ - "-no-body-can-do-the-boogaloo-like-I-do" - ,{"body-can-do-the-boogaloo-like-I-do":false}, []] - ,["we are -no-strangers-to-love "+ - "--you-know the-rules --and so-do-i "+ - "---im-thinking-of=a-full-commitment "+ - "--no-you-would-get-this-from-any-other-guy "+ - "--no-gonna-give-you-up "+ - "-no-gonna-let-you-down=true "+ - "--no-no-gonna-run-around false "+ - "--desert-you=false "+ - "--make-you-cry false "+ - "--no-tell-a-lie "+ - "--no-no-and-hurt-you false" - ,{"strangers-to-love":false - ,"you-know":"the-rules" - ,"and":"so-do-i" - ,"you-would-get-this-from-any-other-guy":false - ,"gonna-give-you-up":false - ,"gonna-let-you-down":false - ,"gonna-run-around":false - ,"desert-you":false - ,"make-you-cry":false - ,"tell-a-lie":false - ,"and-hurt-you":false - },["we", "are"]] - ,["-t one -t two -t three" - ,{t: ["one", "two", "three"]} - ,[]] - ,["-t one -t null -t three four five null" - ,{t: ["one", "null", "three"]} - ,["four", "five", "null"]] - ,["-t foo" - ,{t:["foo"]} - ,[]] - ,["--no-t" - ,{t:["false"]} - ,[]] - ,["-no-no-t" - ,{t:["true"]} - ,[]] - ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, 100]} - ,[]] - ,["-str 100" - ,{str:"100"} - ,[]] - ,["--color always" - ,{color:"always"} - ,[]] - ,["--no-nullstream" - ,{nullstream:null} - ,[]] - ,["--nullstream false" - ,{nullstream:null} - ,[]] - ,["--notadate 2011-01-25" - ,{notadate: "2011-01-25"} - ,[]] - ,["--date 2011-01-25" - ,{date: new Date("2011-01-25")} - ,[]] - ].forEach(function (test) { - var argv = test[0].split(/\s+/) - , opts = test[1] - , rem = test[2] - , actual = nopt(types, shorthands, argv, 0) - , parsed = actual.argv - delete actual.argv - console.log(util.inspect(actual, false, 2, true), parsed.remain) - for (var i in opts) { - var e = JSON.stringify(opts[i]) - , a = JSON.stringify(actual[i] === undefined ? null : actual[i]) - if (e && typeof e === "object") { - assert.deepEqual(e, a) - } else { - assert.equal(e, a) - } - } - assert.deepEqual(rem, parsed.remain) - }) -} diff --git a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/nopt/node_modules/abbrev/README.md b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js deleted file mode 100644 index bee4132..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +++ /dev/null @@ -1,111 +0,0 @@ - -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} - - -// tests -if (module === require.main) { - -var assert = require("assert") -var util = require("util") - -console.log("running tests") -function test (list, expect) { - var actual = abbrev(list) - assert.deepEqual(actual, expect, - "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - actual = abbrev.apply(exports, list) - assert.deepEqual(abbrev.apply(exports, list), expect, - "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) -} - -test([ "ruby", "ruby", "rules", "rules", "rules" ], -{ rub: 'ruby' -, ruby: 'ruby' -, rul: 'rules' -, rule: 'rules' -, rules: 'rules' -}) -test(["fool", "foom", "pool", "pope"], -{ fool: 'fool' -, foom: 'foom' -, poo: 'pool' -, pool: 'pool' -, pop: 'pope' -, pope: 'pope' -}) -test(["a", "ab", "abc", "abcd", "abcde", "acde"], -{ a: 'a' -, ab: 'ab' -, abc: 'abc' -, abcd: 'abcd' -, abcde: 'abcde' -, ac: 'acde' -, acd: 'acde' -, acde: 'acde' -}) - -console.log("pass") - -} diff --git a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json b/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json deleted file mode 100644 index 55ed011..0000000 --- a/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "abbrev", - "version": "1.0.4", - "description": "Like ruby's abbrev module, but in js", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "main": "./lib/abbrev.js", - "scripts": { - "test": "node lib/abbrev.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/abbrev-js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" - }, - "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, - "_id": "abbrev@1.0.4", - "_from": "abbrev@1" -} diff --git a/node_modules/grunt/node_modules/nopt/package.json b/node_modules/grunt/node_modules/nopt/package.json deleted file mode 100644 index 35c8f64..0000000 --- a/node_modules/grunt/node_modules/nopt/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nopt", - "version": "1.0.10", - "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "main": "lib/nopt.js", - "scripts": { - "test": "node lib/nopt.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/isaacs/nopt" - }, - "bin": { - "nopt": "./bin/nopt.js" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/nopt/raw/master/LICENSE" - }, - "dependencies": { - "abbrev": "1" - }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/nopt/issues" - }, - "_id": "nopt@1.0.10", - "_from": "nopt@~1.0.10" -} diff --git a/node_modules/grunt/node_modules/rimraf/AUTHORS b/node_modules/grunt/node_modules/rimraf/AUTHORS deleted file mode 100644 index 247b754..0000000 --- a/node_modules/grunt/node_modules/rimraf/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Authors sorted by whether or not they're me. -Isaac Z. Schlueter (http://blog.izs.me) -Wayne Larsen (http://github.com/wvl) -ritch -Marcel Laverdet -Yosef Dinerstein diff --git a/node_modules/grunt/node_modules/rimraf/LICENSE b/node_modules/grunt/node_modules/rimraf/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/rimraf/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/rimraf/README.md b/node_modules/grunt/node_modules/rimraf/README.md deleted file mode 100644 index 96ce9b2..0000000 --- a/node_modules/grunt/node_modules/rimraf/README.md +++ /dev/null @@ -1,21 +0,0 @@ -A `rm -rf` for node. - -Install with `npm install rimraf`, or just drop rimraf.js somewhere. - -## API - -`rimraf(f, callback)` - -The callback will be called with an error if there is one. Certain -errors are handled for you: - -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - - -## rimraf.sync - -It can remove stuff synchronously, too. But that's not so good. Use -the async API. It's better. diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE deleted file mode 100644 index 05a4010..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. - -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/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md deleted file mode 100644 index 7d2e681..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md +++ /dev/null @@ -1,5 +0,0 @@ -Just like node's `fs` module, but it does an incremental back-off when -EMFILE is encountered. - -Useful in asynchronous situations where one needs to try to open lots -and lots of files. diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index be9951e..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +++ /dev/null @@ -1,312 +0,0 @@ -// this keeps a queue of opened file descriptors, and will make -// fs operations wait until some have closed before trying to open more. - -var fs = require("fs") - -// there is such a thing as TOO graceful. -if (fs.open === gracefulOpen) return - -var queue = [] - , constants = require("constants") - -exports = module.exports = fs -fs._curOpen = 0 - -fs.MIN_MAX_OPEN = 64 -fs.MAX_OPEN = 1024 - -var originalOpen = fs.open - , originalOpenSync = fs.openSync - , originalClose = fs.close - , originalCloseSync = fs.closeSync - - -// prevent EMFILE errors -function OpenReq (path, flags, mode, cb) { - this.path = path - this.flags = flags - this.mode = mode - this.cb = cb -} - -function noop () {} - -fs.open = gracefulOpen - -function gracefulOpen (path, flags, mode, cb) { - if (typeof mode === "function") cb = mode, mode = null - if (typeof cb !== "function") cb = noop - - if (fs._curOpen >= fs.MAX_OPEN) { - queue.push(new OpenReq(path, flags, mode, cb)) - setTimeout(flush) - return - } - open(path, flags, mode, function (er, fd) { - if (er && er.code === "EMFILE" && fs._curOpen > fs.MIN_MAX_OPEN) { - // that was too many. reduce max, get back in queue. - // this should only happen once in a great while, and only - // if the ulimit -n is set lower than 1024. - fs.MAX_OPEN = fs._curOpen - 1 - return fs.open(path, flags, mode, cb) - } - cb(er, fd) - }) -} - -function open (path, flags, mode, cb) { - cb = cb || noop - fs._curOpen ++ - originalOpen.call(fs, path, flags, mode, function (er, fd) { - if (er) onclose() - cb(er, fd) - }) -} - -fs.openSync = function (path, flags, mode) { - var ret - ret = originalOpenSync.call(fs, path, flags, mode) - fs._curOpen ++ - return ret -} - -function onclose () { - fs._curOpen -- - flush() -} - -function flush () { - while (fs._curOpen < fs.MAX_OPEN) { - var req = queue.shift() - if (!req) return - open(req.path, req.flags || "r", req.mode || 0777, req.cb) - } -} - -fs.close = function (fd, cb) { - cb = cb || noop - originalClose.call(fs, fd, function (er) { - onclose() - cb(er) - }) -} - -fs.closeSync = function (fd) { - onclose() - return originalCloseSync.call(fs, fd) -} - - -// (re-)implement some things that are known busted or missing. - -var constants = require("constants") - -// lchmod, broken prior to 0.6.2 -// back-port the fix here. -if (constants.hasOwnProperty('O_SYMLINK') && - process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - fs.lchmod = function (path, mode, callback) { - callback = callback || noop - fs.open( path - , constants.O_WRONLY | constants.O_SYMLINK - , mode - , function (err, fd) { - if (err) { - callback(err) - return - } - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - fs.fchmod(fd, mode, function (err) { - fs.close(fd, function(err2) { - callback(err || err2) - }) - }) - }) - } - - fs.lchmodSync = function (path, mode) { - var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) - - // prefer to return the chmod error, if one occurs, - // but still try to close, and report closing errors if they occur. - var err, err2 - try { - var ret = fs.fchmodSync(fd, mode) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } -} - - -// lutimes implementation, or no-op -if (!fs.lutimes) { - if (constants.hasOwnProperty("O_SYMLINK")) { - fs.lutimes = function (path, at, mt, cb) { - fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) - fs.futimes(fd, at, mt, function (er) { - fs.close(fd, function (er2) { - return cb(er || er2) - }) - }) - }) - } - - fs.lutimesSync = function (path, at, mt) { - var fd = fs.openSync(path, constants.O_SYMLINK) - , err - , err2 - , ret - - try { - var ret = fs.futimesSync(fd, at, mt) - } catch (er) { - err = er - } - try { - fs.closeSync(fd) - } catch (er) { - err2 = er - } - if (err || err2) throw (err || err2) - return ret - } - - } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) { - // maybe utimensat will be bound soonish? - fs.lutimes = function (path, at, mt, cb) { - fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb) - } - - fs.lutimesSync = function (path, at, mt) { - return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW) - } - - } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } - fs.lutimesSync = function () {} - } -} - - -// https://github.com/isaacs/node-graceful-fs/issues/4 -// Chown should not fail on einval or eperm if non-root. - -fs.chown = chownFix(fs.chown) -fs.fchown = chownFix(fs.fchown) -fs.lchown = chownFix(fs.lchown) - -fs.chownSync = chownFixSync(fs.chownSync) -fs.fchownSync = chownFixSync(fs.fchownSync) -fs.lchownSync = chownFixSync(fs.lchownSync) - -function chownFix (orig) { - if (!orig) return orig - return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { - if (chownErOk(er)) er = null - cb(er, res) - }) - } -} - -function chownFixSync (orig) { - if (!orig) return orig - return function (target, uid, gid) { - try { - return orig.call(fs, target, uid, gid) - } catch (er) { - if (!chownErOk(er)) throw er - } - } -} - -function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true -} - - -// if lchmod/lchown do not exist, then make them no-ops -if (!fs.lchmod) { - fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) - } - fs.lchmodSync = function () {} -} -if (!fs.lchown) { - fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) - } - fs.lchownSync = function () {} -} - - - -// on Windows, A/V software can lock the directory, causing this -// to fail with an EACCES or EPERM if the directory contains newly -// created files. Try again on failure, for up to 1 second. -if (process.platform === "win32") { - var rename_ = fs.rename - fs.rename = function rename (from, to, cb) { - var start = Date.now() - rename_(from, to, function CB (er) { - if (er - && (er.code === "EACCES" || er.code === "EPERM") - && Date.now() - start < 1000) { - return rename_(from, to, CB) - } - cb(er) - }) - } -} - - -// if read() returns EAGAIN, then just try it again. -var read = fs.read -fs.read = function (fd, buffer, offset, length, position, callback_) { - var callback - if (callback_ && typeof callback_ === 'function') { - var eagCounter = 0 - callback = function (er, _, __) { - if (er && er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - return read.call(fs, fd, buffer, offset, length, position, callback) - } - callback_.apply(this, arguments) - } - } - return read.call(fs, fd, buffer, offset, length, position, callback) -} - -var readSync = fs.readSync -fs.readSync = function (fd, buffer, offset, length, position) { - var eagCounter = 0 - while (true) { - try { - return readSync.call(fs, fd, buffer, offset, length, position) - } catch (er) { - if (er.code === 'EAGAIN' && eagCounter < 10) { - eagCounter ++ - continue - } - throw er - } - } -} diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json deleted file mode 100644 index c539680..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "description": "fs monkey-patching to avoid EMFILE and other problems", - "version": "1.1.14", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" - }, - "main": "graceful-fs.js", - "engines": { - "node": ">=0.4.0" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "EMFILE", - "error", - "handling", - "monkeypatch" - ], - "license": "BSD", - "readme": "Just like node's `fs` module, but it does an incremental back-off when\nEMFILE is encountered.\n\nUseful in asynchronous situations where one needs to try to open lots\nand lots of files.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "_id": "graceful-fs@1.1.14", - "_from": "graceful-fs@~1.1" -} diff --git a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js b/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js deleted file mode 100644 index d05f880..0000000 --- a/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js +++ /dev/null @@ -1,41 +0,0 @@ -var test = require('tap').test -var fs = require('../graceful-fs.js') - -test('open an existing file works', function (t) { - var start = fs._curOpen - var fd = fs.openSync(__filename, 'r') - t.equal(fs._curOpen, start + 1) - fs.closeSync(fd) - t.equal(fs._curOpen, start) - fs.open(__filename, 'r', function (er, fd) { - if (er) throw er - t.equal(fs._curOpen, start + 1) - fs.close(fd, function (er) { - if (er) throw er - t.equal(fs._curOpen, start) - t.end() - }) - }) -}) - -test('open a non-existing file throws', function (t) { - var start = fs._curOpen - var er - try { - var fd = fs.openSync('this file does not exist', 'r') - } catch (x) { - er = x - } - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - - fs.open('neither does this file', 'r', function (er, fd) { - t.ok(er, 'should throw') - t.notOk(fd, 'should not get an fd') - t.equal(er.code, 'ENOENT') - t.equal(fs._curOpen, start) - t.end() - }) -}) diff --git a/node_modules/grunt/node_modules/rimraf/package.json b/node_modules/grunt/node_modules/rimraf/package.json deleted file mode 100644 index 9d6614f..0000000 --- a/node_modules/grunt/node_modules/rimraf/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "rimraf", - "version": "2.0.3", - "main": "rimraf.js", - "description": "A deep deletion module for node (like `rm -rf`)", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": { - "type": "MIT", - "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" - }, - "optionalDependencies": { - "graceful-fs": "~1.1" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/rimraf.git" - }, - "scripts": { - "test": "cd test && bash run.sh" - }, - "contributors": [ - { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - { - "name": "Wayne Larsen", - "email": "wayne@larsen.st", - "url": "http://github.com/wvl" - }, - { - "name": "ritch", - "email": "skawful@gmail.com" - }, - { - "name": "Marcel Laverdet" - }, - { - "name": "Yosef Dinerstein", - "email": "yosefd@microsoft.com" - } - ], - "readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/rimraf/issues" - }, - "dependencies": { - "graceful-fs": "~1.1" - }, - "_id": "rimraf@2.0.3", - "_from": "rimraf@~2.0.3" -} diff --git a/node_modules/grunt/node_modules/rimraf/rimraf.js b/node_modules/grunt/node_modules/rimraf/rimraf.js deleted file mode 100644 index 95b2de8..0000000 --- a/node_modules/grunt/node_modules/rimraf/rimraf.js +++ /dev/null @@ -1,161 +0,0 @@ -module.exports = rimraf -rimraf.sync = rimrafSync - -var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} - -var lstat = "lstat" -if (process.platform === "win32") { - // not reliable on windows prior to 0.7.9 - var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number) - if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) { - lstat = "stat" - } -} -if (!fs[lstat]) lstat = "stat" -var lstatSync = lstat + "Sync" - -// for EMFILE handling -var timeout = 0 -exports.EMFILE_MAX = 1000 -exports.BUSYTRIES_MAX = 3 - -function rimraf (p, cb) { - - if (!cb) throw new Error("No callback passed to rimraf()") - - var busyTries = 0 - - rimraf_(p, function CB (er) { - if (er) { - if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { - busyTries ++ - var time = busyTries * 100 - // try again, with the same exact callback as this one. - return setTimeout(function () { - rimraf_(p, CB) - }, time) - } - - // this one won't happen if graceful-fs is used. - if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { - return setTimeout(function () { - rimraf_(p, CB) - }, timeout ++) - } - - // already gone - if (er.code === "ENOENT") er = null - } - - timeout = 0 - cb(er) - }) -} - -function rimraf_ (p, cb) { - fs[lstat](p, function (er, s) { - if (er) { - // already gone - if (er.code === "ENOENT") return cb() - // some other kind of error, permissions, etc. - return cb(er) - } - - return rm_(p, s, false, cb) - }) -} - - -var myGid = function myGid () { - var g = process.getgid && process.getgid() - myGid = function myGid () { return g } - return g -} - -var myUid = function myUid () { - var u = process.getuid && process.getuid() - myUid = function myUid () { return u } - return u -} - - -function writable (s) { - var mode = s.mode || 0777 - , uid = myUid() - , gid = myGid() - return (mode & 0002) - || (gid === s.gid && (mode & 0020)) - || (uid === s.uid && (mode & 0200)) -} - -function rm_ (p, s, didWritableCheck, cb) { - if (!didWritableCheck && !writable(s)) { - // make file writable - // user/group/world, doesn't matter at this point - // since it's about to get nuked. - return fs.chmod(p, s.mode | 0222, function (er) { - if (er) return cb(er) - rm_(p, s, true, cb) - }) - } - - if (!s.isDirectory()) { - return fs.unlink(p, cb) - } - - // directory - fs.readdir(p, function (er, files) { - if (er) return cb(er) - asyncForEach(files.map(function (f) { - return path.join(p, f) - }), function (file, cb) { - rimraf(file, cb) - }, function (er) { - if (er) return cb(er) - fs.rmdir(p, cb) - }) - }) -} - -function asyncForEach (list, fn, cb) { - if (!list.length) cb() - var c = list.length - , errState = null - list.forEach(function (item, i, list) { - fn(item, function (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- c === 0) return cb() - }) - }) -} - -// this looks simpler, but it will fail with big directory trees, -// or on slow stupid awful cygwin filesystems -function rimrafSync (p) { - try { - var s = fs[lstatSync](p) - } catch (er) { - if (er.code === "ENOENT") return - throw er - } - - if (!writable(s)) { - fs.chmodSync(p, s.mode | 0222) - } - - if (!s.isDirectory()) return fs.unlinkSync(p) - - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) - }) - fs.rmdirSync(p) -} diff --git a/node_modules/grunt/node_modules/rimraf/test/run.sh b/node_modules/grunt/node_modules/rimraf/test/run.sh deleted file mode 100644 index 598f016..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/run.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e -for i in test-*.js; do - echo -n $i ... - bash setup.sh - node $i - ! [ -d target ] - echo "pass" -done -rm -rf target diff --git a/node_modules/grunt/node_modules/rimraf/test/setup.sh b/node_modules/grunt/node_modules/rimraf/test/setup.sh deleted file mode 100644 index 2602e63..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/setup.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -set -e - -files=10 -folders=2 -depth=4 -target="$PWD/target" - -rm -rf target - -fill () { - local depth=$1 - local files=$2 - local folders=$3 - local target=$4 - - if ! [ -d $target ]; then - mkdir -p $target - fi - - local f - - f=$files - while [ $f -gt 0 ]; do - touch "$target/f-$depth-$f" - let f-- - done - - let depth-- - - if [ $depth -le 0 ]; then - return 0 - fi - - f=$folders - while [ $f -gt 0 ]; do - mkdir "$target/folder-$depth-$f" - fill $depth $files $folders "$target/d-$depth-$f" - let f-- - done -} - -fill $depth $files $folders $target - -# sanity assert -[ -d $target ] diff --git a/node_modules/grunt/node_modules/rimraf/test/test-async.js b/node_modules/grunt/node_modules/rimraf/test/test-async.js deleted file mode 100644 index 9c2e0b7..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/test-async.js +++ /dev/null @@ -1,5 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf(path.join(__dirname, "target"), function (er) { - if (er) throw er -}) diff --git a/node_modules/grunt/node_modules/rimraf/test/test-fiber.js b/node_modules/grunt/node_modules/rimraf/test/test-fiber.js deleted file mode 100644 index e69de29..0000000 diff --git a/node_modules/grunt/node_modules/rimraf/test/test-sync.js b/node_modules/grunt/node_modules/rimraf/test/test-sync.js deleted file mode 100644 index eb71f10..0000000 --- a/node_modules/grunt/node_modules/rimraf/test/test-sync.js +++ /dev/null @@ -1,3 +0,0 @@ -var rimraf = require("../rimraf") - , path = require("path") -rimraf.sync(path.join(__dirname, "target")) diff --git a/node_modules/grunt/node_modules/underscore.string/.travis.yml b/node_modules/grunt/node_modules/underscore.string/.travis.yml deleted file mode 100644 index ab27b29..0000000 --- a/node_modules/grunt/node_modules/underscore.string/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: ruby -rvm: - - 1.9.3 - -before_script: - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - - sleep 2 \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/Gemfile b/node_modules/grunt/node_modules/underscore.string/Gemfile deleted file mode 100644 index f024827..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Gemfile +++ /dev/null @@ -1,5 +0,0 @@ -source :rubygems - -gem 'serve' -gem 'uglifier' -gem 'rake' \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/Gemfile.lock b/node_modules/grunt/node_modules/underscore.string/Gemfile.lock deleted file mode 100644 index a6bb1e7..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Gemfile.lock +++ /dev/null @@ -1,34 +0,0 @@ -GEM - remote: http://rubygems.org/ - specs: - activesupport (3.2.3) - i18n (~> 0.6) - multi_json (~> 1.0) - execjs (1.3.0) - multi_json (~> 1.0) - i18n (0.6.0) - multi_json (1.2.0) - rack (1.4.1) - rack-test (0.6.1) - rack (>= 1.0) - rake (0.9.2.2) - serve (1.5.1) - activesupport (~> 3.0) - i18n - rack (~> 1.2) - rack-test (~> 0.5) - tilt (~> 1.3) - tzinfo - tilt (1.3.3) - tzinfo (0.3.33) - uglifier (1.2.4) - execjs (>= 0.3.0) - multi_json (>= 1.0.2) - -PLATFORMS - ruby - -DEPENDENCIES - rake - serve - uglifier diff --git a/node_modules/grunt/node_modules/underscore.string/README.markdown b/node_modules/grunt/node_modules/underscore.string/README.markdown deleted file mode 100644 index d2244b5..0000000 --- a/node_modules/grunt/node_modules/underscore.string/README.markdown +++ /dev/null @@ -1,668 +0,0 @@ -# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) # - - - -Javascript lacks complete string manipulation operations. -This an attempt to fill that gap. List of build-in methods can be found -for example from [Dive Into JavaScript][d]. - -[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object - - -As name states this an extension for [Underscore.js][u], but it can be used -independently from **_s**-global variable. But with Underscore.js you can -use Object-Oriented style and chaining: - -[u]: http://documentcloud.github.com/underscore/ - -```javascript -_(" epeli ").chain().trim().capitalize().value() -=> "Epeli" -``` - -## Download ## - - * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb* - * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb* - - -## Node.js installation ## - -**npm package** - - npm install underscore.string - -**Standalone usage**: - -```javascript -var _s = require('underscore.string'); -``` - -**Integrate with Underscore.js**: - -```javascript -var _ = require('underscore'); - -// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains) -_.str = require('underscore.string'); - -// Mix in non-conflict functions to Underscore namespace if you want -_.mixin(_.str.exports()); - -// All functions, include conflict, will be available through _.str object -_.str.include('Underscore.string', 'string'); // => true -``` - -## String Functions ## - -For availability of functions in this way you need to mix in Underscore.string functions: - -```javascript -_.mixin(_.string.exports()); -``` - -otherwise functions from examples will be available through _.string or _.str objects: - -```javascript -_.str.capitalize('epeli') -=> "Epeli" -``` - -**capitalize** _.capitalize(string) - -Converts first letter of the string to uppercase. - -```javascript -_.capitalize("foo Bar") -=> "Foo Bar" -``` - -**chop** _.chop(string, step) - -```javascript -_.chop('whitespace', 3) -=> ['whi','tes','pac','e'] -``` - -**clean** _.clean(str) - -Compress some whitespaces to one. - -```javascript -_.clean(" foo bar ") -=> 'foo bar' -``` - -**chars** _.chars(str) - -```javascript -_.chars('Hello') -=> ['H','e','l','l','o'] -``` - -**includes** _.includes(string, substring) - -Tests if string contains a substring. - -```javascript -_.includes("foobar", "ob") -=> true -``` - -**include** available only through _.str object, because Underscore has function with the same name. - -```javascript -_.str.include("foobar", "ob") -=> true -``` - -**includes** function was removed - -But you can create it in this way, for compatibility with previous versions: - -```javascript -_.includes = _.str.include -``` - -**count** _.count(string, substring) - -```javascript -_('Hello world').count('l') -=> 3 -``` - -**escapeHTML** _.escapeHTML(string) - -Converts HTML special characters to their entity equivalents. - -```javascript -_('
        Blah blah blah
        ').escapeHTML(); -=> '<div>Blah blah blah</div>' -``` - -**unescapeHTML** _.unescapeHTML(string) - -Converts entity characters to HTML equivalents. - -```javascript -_('<div>Blah blah blah</div>').unescapeHTML(); -=> '
        Blah blah blah
        ' -``` - -**insert** _.insert(string, index, substing) - -```javascript -_('Hello ').insert(6, 'world') -=> 'Hello world' -``` - -**isBlank** _.isBlank(string) - -```javascript -_('').isBlank(); // => true -_('\n').isBlank(); // => true -_(' ').isBlank(); // => true -_('a').isBlank(); // => false -``` - -**join** _.join(separator, *strings) - -Joins strings together with given separator - -```javascript -_.join(" ", "foo", "bar") -=> "foo bar" -``` - -**lines** _.lines(str) - -```javascript -_.lines("Hello\nWorld") -=> ["Hello", "World"] -``` - -**reverse** available only through _.str object, because Underscore has function with the same name. - -Return reversed string: - -```javascript -_.str.reverse("foobar") -=> 'raboof' -``` - -**splice** _.splice(string, index, howmany, substring) - -Like a array splice. - -```javascript -_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli') -=> 'https://edtsech@bitbucket.org/epeli/underscore.strings' -``` - -**startsWith** _.startsWith(string, starts) - -This method checks whether string starts with starts. - -```javascript -_("image.gif").startsWith("image") -=> true -``` - -**endsWith** _.endsWith(string, ends) - -This method checks whether string ends with ends. - -```javascript -_("image.gif").endsWith("gif") -=> true -``` - -**succ** _.succ(str) - -Returns the successor to str. - -```javascript -_('a').succ() -=> 'b' - -_('A').succ() -=> 'B' -``` - -**supplant** - -Supplant function was removed, use Underscore.js [template function][p]. - -[p]: http://documentcloud.github.com/underscore/#template - -**strip** alias for *trim* - -**lstrip** alias for *ltrim* - -**rstrip** alias for *rtrim* - -**titleize** _.titleize(string) - -```javascript -_('my name is epeli').titleize() -=> 'My Name Is Epeli' -``` - -**camelize** _.camelize(string) - -Converts underscored or dasherized string to a camelized one - -```javascript -_('-moz-transform').camelize() -=> 'MozTransform' -``` - -**classify** _.classify(string) - -Converts string to camelized class name - -```javascript -_('some_class_name').classify() -=> 'SomeClassName' -``` - -**underscored** _.underscored(string) - -Converts a camelized or dasherized string into an underscored one - -```javascript -_('MozTransform').underscored() -=> 'moz_transform' -``` - -**dasherize** _.dasherize(string) - -Converts a underscored or camelized string into an dasherized one - -```javascript -_('MozTransform').dasherize() -=> '-moz-transform' -``` - -**humanize** _.humanize(string) - -Converts an underscored, camelized, or dasherized string into a humanized one. -Also removes beginning and ending whitespace, and removes the postfix '_id'. - -```javascript -_(' capitalize dash-CamelCase_underscore trim ').humanize() -=> 'Capitalize dash camel case underscore trim' -``` - -**trim** _.trim(string, [characters]) - -trims defined characters from begining and ending of the string. -Defaults to whitespace characters. - -```javascript -_.trim(" foobar ") -=> "foobar" - -_.trim("_-foobar-_", "_-") -=> "foobar" -``` - - -**ltrim** _.ltrim(string, [characters]) - -Left trim. Similar to trim, but only for left side. - - -**rtrim** _.rtrim(string, [characters]) - -Right trim. Similar to trim, but only for right side. - -**truncate** _.truncate(string, length, truncateString) - -```javascript -_('Hello world').truncate(5) -=> 'Hello...' - -_('Hello').truncate(10) -=> 'Hello' -``` - -**prune** _.prune(string, length, pruneString) - -Elegant version of truncate. -Makes sure the pruned string does not exceed the original length. -Avoid half-chopped words when truncating. - -```javascript -_('Hello, world').prune(5) -=> 'Hello...' - -_('Hello, world').prune(8) -=> 'Hello...' - -_('Hello, world').prune(5, ' (read a lot more)') -=> 'Hello, world' (as adding "(read a lot more)" would be longer than the original string) - -_('Hello, cruel world').prune(15) -=> 'Hello, cruel...' - -_('Hello').prune(10) -=> 'Hello' -``` - -**words** _.words(str, delimiter=" ") - -Split string by delimiter (String or RegExp), ' ' by default. - -```javascript -_.words("I love you") -=> ["I","love","you"] - -_.words("I_love_you", "_") -=> ["I","love","you"] - -_.words("I-love-you", /-/) -=> ["I","love","you"] -``` - -**sprintf** _.sprintf(string format, *arguments) - -C like string formatting. -Credits goes to [Alexandru Marasteanu][o]. -For more detailed documentation, see the [original page][o]. - -[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript - -```javascript -_.sprintf("%.1f", 1.17) -"1.2" -``` - -**pad** _.pad(str, length, [padStr, type]) - -pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary. - -```javascript -_.pad("1", 8) --> " 1"; - -_.pad("1", 8, '0') --> "00000001"; - -_.pad("1", 8, '0', 'right') --> "10000000"; - -_.pad("1", 8, '0', 'both') --> "00001000"; - -_.pad("1", 8, 'bleepblorp', 'both') --> "bbbb1bbb"; -``` - -**lpad** _.lpad(str, length, [padStr]) - -left-pad a string. Alias for `pad(str, length, padStr, 'left')` - -```javascript -_.lpad("1", 8, '0') --> "00000001"; -``` - -**rpad** _.rpad(str, length, [padStr]) - -right-pad a string. Alias for `pad(str, length, padStr, 'right')` - -```javascript -_.rpad("1", 8, '0') --> "10000000"; -``` - -**lrpad** _.lrpad(str, length, [padStr]) - -left/right-pad a string. Alias for `pad(str, length, padStr, 'both')` - -```javascript -_.lrpad("1", 8, '0') --> "00001000"; -``` - -**center** alias for **lrpad** - -**ljust** alias for *rpad* - -**rjust** alias for *lpad* - -**toNumber** _.toNumber(string, [decimals]) - -Parse string to number. Returns NaN if string can't be parsed to number. - -```javascript -_('2.556').toNumber() -=> 3 - -_('2.556').toNumber(1) -=> 2.6 -``` - -**strRight** _.strRight(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRight('_') -=> "is_a_test_string"; -``` - -**strRightBack** _.strRightBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strRightBack('_') -=> "string"; -``` - -**strLeft** _.strLeft(string, pattern) - -Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeft('_') -=> "This"; -``` - -**strLeftBack** _.strLeftBack(string, pattern) - -Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found. - -```javascript -_('This_is_a_test_string').strLeftBack('_') -=> "This_is_a_test"; -``` - -**stripTags** - -Removes all html tags from string. - -```javascript -_('a link').stripTags() -=> 'a link' - -_('a link').stripTags() -=> 'a linkalert("hello world!")' -``` - -**toSentence** _.toSentence(array, [delimiter, lastDelimiter]) - -Join an array into a human readable sentence. - -```javascript -_.toSentence(['jQuery', 'Mootools', 'Prototype']) -=> 'jQuery, Mootools and Prototype'; - -_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ') -=> 'jQuery, Mootools unt Prototype'; -``` - -**repeat** _.repeat(string, count, [separator]) - -Repeats a string count times. - -```javascript -_.repeat("foo", 3) -=> 'foofoofoo'; - -_.repeat("foo", 3, "bar") -=> 'foobarfoobarfoo' -``` - -**slugify** _.slugify(string) - -Transform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash. - -```javascript -_.slugify("Un éléphant à l'orée du bois") -=> 'un-elephant-a-loree-du-bois'; -``` - -***Caution: this function is charset dependent*** - -## Roadmap ## - -Any suggestions or bug reports are welcome. Just email me or more preferably open an issue. - -## Changelog ## - -### 2.0.0 ### - -* Added prune, humanize functions -* Added _.string (_.str) namespace for Underscore.string library -* Removed includes function - -#### Problems - -We lose two things for `include` and `reverse` methods from `_.string`: - -* Calls like `_('foobar').include('bar')` aren't available; -* Chaining isn't available too. - -But if you need this functionality you can create aliases for conflict functions which will be convenient for you: - -```javascript -_.mixin({ - includeString: _.str.include, - reverseString: _.str.reverse -}) - -// Now wrapper calls and chaining are available. -_('foobar').chain().reverseString().includeString('rab').value() -``` - -#### Standalone Usage - -If you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias -But of course you can just reassign `_` variable with `_.string` - -```javascript -_ = _.string -``` -### 2.2.0 ### - -* Capitalize method behavior changed -* Various perfomance tweaks - -### 2.1.1### - -* Fixed words method bug -* Added classify method - -### 2.1.0 ### - -* AMD support -* Added toSentence method -* Added slugify method -* Lots of speed optimizations - -### 2.0.0 ### - -For upgrading to this version you need to mix in Underscore.string library to Underscore object: - -```javascript -_.mixin(_.string.exports()); -``` - -and all non-conflict Underscore.string functions will be available through Underscore object. -Also function `includes` has been removed, you should replace this function by `_.str.include` -or create alias `_.includes = _.str.include` and all your code will work fine. - -### 1.1.6 ### - -* Fixed reverse and truncate -* Added isBlank, stripTags, inlude(alias for includes) -* Added uglifier compression - -### 1.1.5 ### - -* Added strRight, strRightBack, strLeft, strLeftBack - -### 1.1.4 ### - -* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust -* Integration with Underscore 1.1.6 - -### 1.1.3 ### - -* Added methods: underscored, camelize, dasherize -* Support newer version of npm - -### 1.1.2 ### - -* Created functions: lines, chars, words functions - -### 1.0.2 ### - -* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible) -* Removed 'reverse' function, because this function override underscore.js 'reverse' - -## Contribute ## - -* Fork & pull request. Don't forget about tests. -* If you planning add some feature please create issue before. - -Otherwise changes will be rejected. - -## Contributors list ## - -* Esa-Matti Suuronen (), -* Edward Tsech , -* Sasha Koss (), -* Vladimir Dronnikov , -* Pete Kruckenberg (), -* Paul Chavard (), -* Ed Finkler () -* Pavel Pravosud -* Anton Lindqvist () - -## Licence ## - -The MIT License - -Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org - -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/grunt/node_modules/underscore.string/Rakefile b/node_modules/grunt/node_modules/underscore.string/Rakefile deleted file mode 100644 index baa164c..0000000 --- a/node_modules/grunt/node_modules/underscore.string/Rakefile +++ /dev/null @@ -1,28 +0,0 @@ -# encoding: utf-8 -task default: :test - -desc 'Use UglifyJS to compress Underscore.string' -task :build do - require 'uglifier' - source = File.read('lib/underscore.string.js') - compressed = Uglifier.compile(source, copyright: false) - File.open('dist/underscore.string.min.js', 'w'){ |f| f.write compressed } - compression_rate = compressed.length.to_f/source.length - puts "compressed dist/underscore.string.min.js: #{compressed.length}/#{source.length} #{(compression_rate * 100).round}%" -end - -desc 'Run tests' -task :test do - pid = spawn('bundle exec serve', err: '/dev/null') - sleep 2 - - puts "Running underscore.string test suite." - result1 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test.html"} - - puts "Running Underscore test suite." - result2 = system %{phantomjs ./test/run-qunit.js "http://localhost:4000/test/test_underscore/test.html"} - - Process.kill 'INT', pid - - exit(result1 && result2 ? 0 : 1) -end \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js b/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js deleted file mode 100644 index cd436e1..0000000 --- a/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){"use strict";var b=String.prototype.trim,c=String.prototype.trimRight,d=String.prototype.trimLeft,e=function(a){return a*1||0},f=function(a,b,c){a+="",b=~~b;for(var d=[];b>0;d[--b]=a);return d.join(c==null?"":c)},g=function(a){return Array.prototype.slice.call(a)},h=function(a){return a!=null?"["+m.escapeRegExp(""+a)+"]":"\\s"},i={lt:"<",gt:">",quot:'"',apos:"'",amp:"&"},j={};for(var k in i)j[i[k]]=k;var l=function(){function a(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}var b=f,c=function(){return c.cache.hasOwnProperty(arguments[0])||(c.cache[arguments[0]]=c.parse(arguments[0])),c.format.call(null,c.cache[arguments[0]],arguments)};return c.format=function(c,d){var e=1,f=c.length,g="",h,i=[],j,k,m,n,o,p;for(j=0;j=0?"+"+h:h,o=m[4]?m[4]=="0"?"0":m[4].charAt(1):" ",p=m[6]-String(h).length,n=m[6]?b(o,p):"",i.push(m[5]?h+n:n+h)}}return i.join("")},c.cache={},c.parse=function(a){var b=a,c=[],d=[],e=0;while(b){if((c=/^[^\x25]+/.exec(b))!==null)d.push(c[0]);else if((c=/^\x25{2}/.exec(b))!==null)d.push("%");else{if((c=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(b))===null)throw new Error("[_.sprintf] huh?");if(c[2]){e|=1;var f=[],g=c[2],h=[];if((h=/^([a-z_][a-z_\d]*)/i.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1]);while((g=g.substring(h[0].length))!=="")if((h=/^\.([a-z_][a-z_\d]*)/i.exec(g))!==null)f.push(h[1]);else{if((h=/^\[(\d+)\]/.exec(g))===null)throw new Error("[_.sprintf] huh?");f.push(h[1])}c[2]=f}else e|=2;if(e===3)throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");d.push(c)}b=b.substring(c[0].length)}return d},c}(),m={VERSION:"2.1.1",isBlank:function(a){return/^\s*$/.test(a)},stripTags:function(a){return(""+a).replace(/<\/?[^>]+>/g,"")},capitalize:function(a){return a+="",a.charAt(0).toUpperCase()+a.substring(1)},chop:function(a,b){a+="",b=~~b||a.length;var c=[];for(var d=0;d"']/g,function(a){return"&"+j[a]+";"})},unescapeHTML:function(a){return(""+a).replace(/\&([^;]+);/g,function(a,b){var c;return b in i?i[b]:(c=b.match(/^#x([\da-fA-F]+)$/))?String.fromCharCode(parseInt(c[1],16)):(c=b.match(/^#(\d+)$/))?String.fromCharCode(~~c[1]):a})},escapeRegExp:function(a){return a.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},insert:function(a,b,c){var d=m.chars(a);return d.splice(~~b,0,""+c),d.join("")},include:function(a,b){return!!~(""+a).indexOf(b)},join:function(){var a=g(arguments);return a.join(a.shift())},lines:function(a){return(""+a).split("\n")},reverse:function(a){return m.chars(a).reverse().join("")},splice:function(a,b,c,d){var e=m.chars(a);return e.splice(~~b,~~c,d),e.join("")},startsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(0,b.length)===b},endsWith:function(a,b){return a+="",b+="",a.length>=b.length&&a.substring(a.length-b.length)===b},succ:function(a){a+="";var b=m.chars(a);return b.splice(a.length-1,1,String.fromCharCode(a.charCodeAt(a.length-1)+1)),b.join("")},titleize:function(a){return(""+a).replace(/\b./g,function(a){return a.toUpperCase()})},camelize:function(a){return m.trim(a).replace(/[-_\s]+(.)?/g,function(a,b){return b&&b.toUpperCase()})},underscored:function(a){return m.trim(a).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()},dasherize:function(a){return m.trim(a).replace(/[_\s]+/g,"-").replace(/([A-Z])/g,"-$1").replace(/-+/g,"-").toLowerCase()},classify:function(a){return a+="",m.titleize(a.replace(/_/g," ")).replace(/\s/g,"")},humanize:function(a){return m.capitalize(this.underscored(a).replace(/_id$/,"").replace(/_/g," "))},trim:function(a,c){return a+="",!c&&b?b.call(a):(c=h(c),a.replace(new RegExp("^"+c+"+|"+c+"+$","g"),""))},ltrim:function(a,b){return a+="",!b&&d?d.call(a):(b=h(b),a.replace(new RegExp("^"+b+"+"),""))},rtrim:function(a,b){return a+="",!b&&c?c.call(a):(b=h(b),a.replace(new RegExp(b+"+$"),""))},truncate:function(a,b,c){return a+="",c=c||"...",b=~~b,a.length>b?a.slice(0,b)+c:a},prune:function(a,b,c){a+="",b=~~b,c=c!=null?""+c:"...";var d,e,f=a.replace(/\W/g,function(a){return a.toUpperCase()!==a.toLowerCase()?"A":" "});return e=f.charAt(b),d=f.slice(0,b),e&&e.match(/\S/)&&(d=d.replace(/\s\S+$/,"")),d=m.rtrim(d),(d+c).length>a.length?a:a.substring(0,d.length)+c},words:function(a,b){return m.trim(a,b).split(b||/\s+/)},pad:function(a,b,c,d){a+="";var e=0;b=~~b,c?c.length>1&&(c=c.charAt(0)):c=" ";switch(d){case"right":return e=b-a.length,a+f(c,e);case"both":return e=b-a.length,f(c,Math.ceil(e/2))+a+f(c,Math.floor(e/2));default:return e=b-a.length,f(c,e)+a}},lpad:function(a,b,c){return m.pad(a,b,c)},rpad:function(a,b,c){return m.pad(a,b,c,"right")},lrpad:function(a,b,c){return m.pad(a,b,c,"both")},sprintf:l,vsprintf:function(a,b){return b.unshift(a),l.apply(null,b)},toNumber:function(a,b){a+="";var c=e(e(a).toFixed(~~b));return c===0&&!a.match(/^0+$/)?Number.NaN:c},strRight:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strRightBack:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.lastIndexOf(b):-1;return~c?a.slice(c+b.length,a.length):a},strLeft:function(a,b){a+="",b=b!=null?""+b:b;var c=b?a.indexOf(b):-1;return~c?a.slice(0,c):a},strLeftBack:function(a,b){a+="",b=b!=null?""+b:b;var c=a.lastIndexOf(b);return~c?a.slice(0,c):a},toSentence:function(a,b,c){b||(b=", "),c||(c=" and ");var d=a.length,e="";for(var f=0;f -// Underscore.strings is freely distributable under the terms of the MIT license. -// Documentation: https://github.com/epeli/underscore.string -// Some code is borrowed from MooTools and Alexandru Marasteanu. - -// Version 2.2.0rc - -(function(root){ - 'use strict'; - - // Defining helper functions. - - var nativeTrim = String.prototype.trim; - var nativeTrimRight = String.prototype.trimRight; - var nativeTrimLeft = String.prototype.trimLeft; - - var parseNumber = function(source) { return source * 1 || 0; }; - - var strRepeat = function(str, qty, separator){ - // ~~var — is the fastest available way to convert anything to Integer in javascript. - // We'll use it extensively in this lib. - str += ''; qty = ~~qty; - for (var repeat = []; qty > 0; repeat[--qty] = str) {} - return repeat.join(separator == null ? '' : separator); - }; - - var slice = function(a){ - return Array.prototype.slice.call(a); - }; - - var defaultToWhiteSpace = function(characters){ - if (characters != null) { - return '[' + _s.escapeRegExp(''+characters) + ']'; - } - return '\\s'; - }; - - var escapeChars = { - lt: '<', - gt: '>', - quot: '"', - apos: "'", - amp: '&' - }; - - var reversedEscapeChars = {}; - for(var key in escapeChars){ reversedEscapeChars[escapeChars[key]] = key; } - - // sprintf() for JavaScript 0.7-beta1 - // http://www.diveintojavascript.com/projects/javascript-sprintf - // - // Copyright (c) Alexandru Marasteanu - // All rights reserved. - - var sprintf = (function() { - function get_type(variable) { - return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase(); - } - - var str_repeat = strRepeat; - - var str_format = function() { - if (!str_format.cache.hasOwnProperty(arguments[0])) { - str_format.cache[arguments[0]] = str_format.parse(arguments[0]); - } - return str_format.format.call(null, str_format.cache[arguments[0]], arguments); - }; - - str_format.format = function(parse_tree, argv) { - var cursor = 1, tree_length = parse_tree.length, node_type = '', arg, output = [], i, k, match, pad, pad_character, pad_length; - for (i = 0; i < tree_length; i++) { - node_type = get_type(parse_tree[i]); - if (node_type === 'string') { - output.push(parse_tree[i]); - } - else if (node_type === 'array') { - match = parse_tree[i]; // convenience purposes only - if (match[2]) { // keyword argument - arg = argv[cursor]; - for (k = 0; k < match[2].length; k++) { - if (!arg.hasOwnProperty(match[2][k])) { - throw new Error(sprintf('[_.sprintf] property "%s" does not exist', match[2][k])); - } - arg = arg[match[2][k]]; - } - } else if (match[1]) { // positional argument (explicit) - arg = argv[match[1]]; - } - else { // positional argument (implicit) - arg = argv[cursor++]; - } - - if (/[^s]/.test(match[8]) && (get_type(arg) != 'number')) { - throw new Error(sprintf('[_.sprintf] expecting number but found %s', get_type(arg))); - } - switch (match[8]) { - case 'b': arg = arg.toString(2); break; - case 'c': arg = String.fromCharCode(arg); break; - case 'd': arg = parseInt(arg, 10); break; - case 'e': arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential(); break; - case 'f': arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg); break; - case 'o': arg = arg.toString(8); break; - case 's': arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg); break; - case 'u': arg = Math.abs(arg); break; - case 'x': arg = arg.toString(16); break; - case 'X': arg = arg.toString(16).toUpperCase(); break; - } - arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+'+ arg : arg); - pad_character = match[4] ? match[4] == '0' ? '0' : match[4].charAt(1) : ' '; - pad_length = match[6] - String(arg).length; - pad = match[6] ? str_repeat(pad_character, pad_length) : ''; - output.push(match[5] ? arg + pad : pad + arg); - } - } - return output.join(''); - }; - - str_format.cache = {}; - - str_format.parse = function(fmt) { - var _fmt = fmt, match = [], parse_tree = [], arg_names = 0; - while (_fmt) { - if ((match = /^[^\x25]+/.exec(_fmt)) !== null) { - parse_tree.push(match[0]); - } - else if ((match = /^\x25{2}/.exec(_fmt)) !== null) { - parse_tree.push('%'); - } - else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) { - if (match[2]) { - arg_names |= 1; - var field_list = [], replacement_field = match[2], field_match = []; - if ((field_match = /^([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') { - if ((field_match = /^\.([a-z_][a-z_\d]*)/i.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else if ((field_match = /^\[(\d+)\]/.exec(replacement_field)) !== null) { - field_list.push(field_match[1]); - } - else { - throw new Error('[_.sprintf] huh?'); - } - } - } - else { - throw new Error('[_.sprintf] huh?'); - } - match[2] = field_list; - } - else { - arg_names |= 2; - } - if (arg_names === 3) { - throw new Error('[_.sprintf] mixing positional and named placeholders is not (yet) supported'); - } - parse_tree.push(match); - } - else { - throw new Error('[_.sprintf] huh?'); - } - _fmt = _fmt.substring(match[0].length); - } - return parse_tree; - }; - - return str_format; - })(); - - - - // Defining underscore.string - - var _s = { - - VERSION: '2.2.0rc', - - isBlank: function(str){ - return (/^\s*$/).test(str); - }, - - stripTags: function(str){ - return (''+str).replace(/<\/?[^>]+>/g, ''); - }, - - capitalize : function(str) { - str += ''; - return str.charAt(0).toUpperCase() + str.substring(1); - }, - - chop: function(str, step){ - str = str+''; - step = ~~step || str.length; - var arr = []; - for (var i = 0; i < str.length; i += step) - arr.push(str.slice(i,i + step)); - return arr; - }, - - clean: function(str){ - return _s.strip(str).replace(/\s+/g, ' '); - }, - - count: function(str, substr){ - str += ''; substr += ''; - return str.split(substr).length - 1; - }, - - chars: function(str) { - return (''+str).split(''); - }, - - escapeHTML: function(str) { - return (''+str).replace(/[&<>"']/g, function(match){ return '&' + reversedEscapeChars[match] + ';'; }); - }, - - unescapeHTML: function(str) { - return (''+str).replace(/\&([^;]+);/g, function(entity, entityCode){ - var match; - - if (entityCode in escapeChars) { - return escapeChars[entityCode]; - } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) { - return String.fromCharCode(parseInt(match[1], 16)); - } else if (match = entityCode.match(/^#(\d+)$/)) { - return String.fromCharCode(~~match[1]); - } else { - return entity; - } - }); - }, - - escapeRegExp: function(str){ - // From MooTools core 1.2.4 - return str.replace(/([-.*+?^${}()|[\]\/\\])/g, '\\$1'); - }, - - insert: function(str, i, substr){ - var arr = _s.chars(str); - arr.splice(~~i, 0, ''+substr); - return arr.join(''); - }, - - include: function(str, needle){ - return !!~(''+str).indexOf(needle); - }, - - join: function() { - var args = slice(arguments); - return args.join(args.shift()); - }, - - lines: function(str) { - return (''+str).split("\n"); - }, - - reverse: function(str){ - return _s.chars(str).reverse().join(''); - }, - - splice: function(str, i, howmany, substr){ - var arr = _s.chars(str); - arr.splice(~~i, ~~howmany, substr); - return arr.join(''); - }, - - startsWith: function(str, starts){ - str += ''; starts += ''; - return str.length >= starts.length && str.substring(0, starts.length) === starts; - }, - - endsWith: function(str, ends){ - str += ''; ends += ''; - return str.length >= ends.length && str.substring(str.length - ends.length) === ends; - }, - - succ: function(str){ - str += ''; - var arr = _s.chars(str); - arr.splice(str.length-1, 1, String.fromCharCode(str.charCodeAt(str.length-1) + 1)); - return arr.join(''); - }, - - titleize: function(str){ - return (''+str).replace(/\b./g, function(ch){ return ch.toUpperCase(); }); - }, - - camelize: function(str){ - return _s.trim(str).replace(/[-_\s]+(.)?/g, function(match, chr){ - return chr && chr.toUpperCase(); - }); - }, - - underscored: function(str){ - return _s.trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase(); - }, - - dasherize: function(str){ - return _s.trim(str).replace(/[_\s]+/g, '-').replace(/([A-Z])/g, '-$1').replace(/-+/g, '-').toLowerCase(); - }, - - classify: function(str){ - str += ''; - return _s.titleize(str.replace(/_/g, ' ')).replace(/\s/g, '') - }, - - humanize: function(str){ - return _s.capitalize(this.underscored(str).replace(/_id$/,'').replace(/_/g, ' ')); - }, - - trim: function(str, characters){ - str += ''; - if (!characters && nativeTrim) { return nativeTrim.call(str); } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('\^' + characters + '+|' + characters + '+$', 'g'), ''); - }, - - ltrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimLeft) { - return nativeTrimLeft.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp('^' + characters + '+'), ''); - }, - - rtrim: function(str, characters){ - str+=''; - if (!characters && nativeTrimRight) { - return nativeTrimRight.call(str); - } - characters = defaultToWhiteSpace(characters); - return str.replace(new RegExp(characters + '+$'), ''); - }, - - truncate: function(str, length, truncateStr){ - str += ''; truncateStr = truncateStr || '...'; - length = ~~length; - return str.length > length ? str.slice(0, length) + truncateStr : str; - }, - - /** - * _s.prune: a more elegant version of truncate - * prune extra chars, never leaving a half-chopped word. - * @author github.com/sergiokas - */ - prune: function(str, length, pruneStr){ - str += ''; length = ~~length; - pruneStr = pruneStr != null ? ''+pruneStr : '...'; - - var pruned, borderChar, template = str.replace(/\W/g, function(ch){ - return (ch.toUpperCase() !== ch.toLowerCase()) ? 'A' : ' '; - }); - - borderChar = template.charAt(length); - - pruned = template.slice(0, length); - - // Check if we're in the middle of a word - if (borderChar && borderChar.match(/\S/)) - pruned = pruned.replace(/\s\S+$/, ''); - - pruned = _s.rtrim(pruned); - - return (pruned+pruneStr).length > str.length ? str : str.substring(0, pruned.length)+pruneStr; - }, - - words: function(str, delimiter) { - return _s.trim(str, delimiter).split(delimiter || /\s+/); - }, - - pad: function(str, length, padStr, type) { - str += ''; - - var padlen = 0; - - length = ~~length; - - if (!padStr) { - padStr = ' '; - } else if (padStr.length > 1) { - padStr = padStr.charAt(0); - } - - switch(type) { - case 'right': - padlen = (length - str.length); - return str + strRepeat(padStr, padlen); - case 'both': - padlen = (length - str.length); - return strRepeat(padStr, Math.ceil(padlen/2)) + - str + - strRepeat(padStr, Math.floor(padlen/2)); - default: // 'left' - padlen = (length - str.length); - return strRepeat(padStr, padlen) + str; - } - }, - - lpad: function(str, length, padStr) { - return _s.pad(str, length, padStr); - }, - - rpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'right'); - }, - - lrpad: function(str, length, padStr) { - return _s.pad(str, length, padStr, 'both'); - }, - - sprintf: sprintf, - - vsprintf: function(fmt, argv){ - argv.unshift(fmt); - return sprintf.apply(null, argv); - }, - - toNumber: function(str, decimals) { - str += ''; - var num = parseNumber(parseNumber(str).toFixed(~~decimals)); - return num === 0 && !str.match(/^0+$/) ? Number.NaN : num; - }, - - strRight: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strRightBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.lastIndexOf(sep); - return ~pos ? str.slice(pos+sep.length, str.length) : str; - }, - - strLeft: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = !sep ? -1 : str.indexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - strLeftBack: function(str, sep){ - str += ''; sep = sep != null ? ''+sep : sep; - var pos = str.lastIndexOf(sep); - return ~pos ? str.slice(0, pos) : str; - }, - - toSentence: function(array, separator, lastSeparator) { - separator || (separator = ', '); - lastSeparator || (lastSeparator = ' and '); - var length = array.length, str = ''; - - for (var i = 0; i < length; i++) { - str += array[i]; - if (i === (length - 2)) { str += lastSeparator; } - else if (i < (length - 1)) { str += separator; } - } - - return str; - }, - - slugify: function(str) { - var from = "ąàáäâãćęèéëêìíïîłńòóöôõùúüûñçżź", - to = "aaaaaaceeeeeiiiilnooooouuuunczz", - regex = new RegExp(defaultToWhiteSpace(from), 'g'); - - str = (''+str).toLowerCase(); - - str = str.replace(regex, function(ch){ - var index = from.indexOf(ch); - return to.charAt(index) || '-'; - }); - - return _s.trim(str.replace(/[^\w\s-]/g, '').replace(/[-\s]+/g, '-'), '-'); - }, - - exports: function() { - var result = {}; - - for (var prop in this) { - if (!this.hasOwnProperty(prop) || ~_s.words('include contains reverse').indexOf(prop)) continue; - result[prop] = this[prop]; - } - - return result; - }, - - repeat: strRepeat - }; - - // Aliases - - _s.strip = _s.trim; - _s.lstrip = _s.ltrim; - _s.rstrip = _s.rtrim; - _s.center = _s.lrpad; - _s.rjust = _s.lpad; - _s.ljust = _s.rpad; - _s.contains = _s.include; - - // CommonJS module is defined - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - // Export module - module.exports = _s; - } - exports._s = _s; - - } else if (typeof define === 'function' && define.amd) { - // Register as a named module with AMD. - define('underscore.string', function() { - return _s; - }); - - } else { - // Integrate with Underscore.js if defined - // or create our own underscore object. - root._ = root._ || {}; - root._.string = root._.str = _s; - } - -}(this || window)); diff --git a/node_modules/grunt/node_modules/underscore.string/package.json b/node_modules/grunt/node_modules/underscore.string/package.json deleted file mode 100644 index 6711c0a..0000000 --- a/node_modules/grunt/node_modules/underscore.string/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "underscore.string", - "version": "2.2.1", - "description": "String manipulation extensions for Underscore.js javascript library.", - "homepage": "http://epeli.github.com/underscore.string/", - "contributors": [ - { - "name": "Esa-Matti Suuronen", - "email": "esa-matti@suuronen.org", - "url": "http://esa-matti.suuronen.org/" - }, - { - "name": "Edward Tsech", - "email": "edtsech@gmail.com" - }, - { - "name": "Sasha Koss", - "email": "kossnocorp@gmail.com", - "url": "http://koss.nocorp.me/" - }, - { - "name": "Vladimir Dronnikov", - "email": "dronnikov@gmail.com" - }, - { - "name": "Pete Kruckenberg", - "email": "https://github.com/kruckenb", - "url": "" - }, - { - "name": "Paul Chavard", - "email": "paul@chavard.net", - "url": "" - }, - { - "name": "Ed Finkler", - "email": "coj@funkatron.com", - "url": "" - }, - { - "name": "Pavel Pravosud", - "email": "rwz@duckroll.ru" - } - ], - "keywords": [ - "underscore", - "string" - ], - "main": "./lib/underscore.string", - "directories": { - "lib": "./lib" - }, - "engines": { - "node": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/epeli/underscore.string.git" - }, - "bugs": { - "url": "https://github.com/epeli/underscore.string/issues" - }, - "licenses": [ - { - "type": "MIT" - } - ], - "readme": "# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #\n\n\n\nJavascript lacks complete string manipulation operations.\nThis an attempt to fill that gap. List of build-in methods can be found\nfor example from [Dive Into JavaScript][d].\n\n[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object\n\n\nAs name states this an extension for [Underscore.js][u], but it can be used\nindependently from **_s**-global variable. But with Underscore.js you can\nuse Object-Oriented style and chaining:\n\n[u]: http://documentcloud.github.com/underscore/\n\n```javascript\n_(\" epeli \").chain().trim().capitalize().value()\n=> \"Epeli\"\n```\n\n## Download ##\n\n * [Development version](https://raw.github.com/epeli/underscore.string/master/lib/underscore.string.js) *Uncompressed with Comments 18kb*\n * [Production version](https://github.com/epeli/underscore.string/raw/master/dist/underscore.string.min.js) *Minified 7kb*\n\n\n## Node.js installation ##\n\n**npm package**\n\n npm install underscore.string\n\n**Standalone usage**:\n\n```javascript\nvar _s = require('underscore.string');\n```\n\n**Integrate with Underscore.js**:\n\n```javascript\nvar _ = require('underscore');\n\n// Import Underscore.string to separate object, because there are conflict functions (include, reverse, contains)\n_.str = require('underscore.string');\n\n// Mix in non-conflict functions to Underscore namespace if you want\n_.mixin(_.str.exports());\n\n// All functions, include conflict, will be available through _.str object\n_.str.include('Underscore.string', 'string'); // => true\n```\n\n## String Functions ##\n\nFor availability of functions in this way you need to mix in Underscore.string functions:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\notherwise functions from examples will be available through _.string or _.str objects:\n\n```javascript\n_.str.capitalize('epeli')\n=> \"Epeli\"\n```\n\n**capitalize** _.capitalize(string)\n\nConverts first letter of the string to uppercase.\n\n```javascript\n_.capitalize(\"foo Bar\")\n=> \"Foo Bar\"\n```\n\n**chop** _.chop(string, step)\n\n```javascript\n_.chop('whitespace', 3)\n=> ['whi','tes','pac','e']\n```\n\n**clean** _.clean(str)\n\nCompress some whitespaces to one.\n\n```javascript\n_.clean(\" foo bar \")\n=> 'foo bar'\n```\n\n**chars** _.chars(str)\n\n```javascript\n_.chars('Hello')\n=> ['H','e','l','l','o']\n```\n\n**includes** _.includes(string, substring)\n\nTests if string contains a substring.\n\n```javascript\n_.includes(\"foobar\", \"ob\")\n=> true\n```\n\n**include** available only through _.str object, because Underscore has function with the same name.\n\n```javascript\n_.str.include(\"foobar\", \"ob\")\n=> true\n```\n\n**includes** function was removed\n\nBut you can create it in this way, for compatibility with previous versions:\n\n```javascript\n_.includes = _.str.include\n```\n\n**count** _.count(string, substring)\n\n```javascript\n_('Hello world').count('l')\n=> 3\n```\n\n**escapeHTML** _.escapeHTML(string)\n\nConverts HTML special characters to their entity equivalents.\n\n```javascript\n_('
        Blah blah blah
        ').escapeHTML();\n=> '<div>Blah blah blah</div>'\n```\n\n**unescapeHTML** _.unescapeHTML(string)\n\nConverts entity characters to HTML equivalents.\n\n```javascript\n_('<div>Blah blah blah</div>').unescapeHTML();\n=> '
        Blah blah blah
        '\n```\n\n**insert** _.insert(string, index, substing)\n\n```javascript\n_('Hello ').insert(6, 'world')\n=> 'Hello world'\n```\n\n**isBlank** _.isBlank(string)\n\n```javascript\n_('').isBlank(); // => true\n_('\\n').isBlank(); // => true\n_(' ').isBlank(); // => true\n_('a').isBlank(); // => false\n```\n\n**join** _.join(separator, *strings)\n\nJoins strings together with given separator\n\n```javascript\n_.join(\" \", \"foo\", \"bar\")\n=> \"foo bar\"\n```\n\n**lines** _.lines(str)\n\n```javascript\n_.lines(\"Hello\\nWorld\")\n=> [\"Hello\", \"World\"]\n```\n\n**reverse** available only through _.str object, because Underscore has function with the same name.\n\nReturn reversed string:\n\n```javascript\n_.str.reverse(\"foobar\")\n=> 'raboof'\n```\n\n**splice** _.splice(string, index, howmany, substring)\n\nLike a array splice.\n\n```javascript\n_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli')\n=> 'https://edtsech@bitbucket.org/epeli/underscore.strings'\n```\n\n**startsWith** _.startsWith(string, starts)\n\nThis method checks whether string starts with starts.\n\n```javascript\n_(\"image.gif\").startsWith(\"image\")\n=> true\n```\n\n**endsWith** _.endsWith(string, ends)\n\nThis method checks whether string ends with ends.\n\n```javascript\n_(\"image.gif\").endsWith(\"gif\")\n=> true\n```\n\n**succ** _.succ(str)\n\nReturns the successor to str.\n\n```javascript\n_('a').succ()\n=> 'b'\n\n_('A').succ()\n=> 'B'\n```\n\n**supplant**\n\nSupplant function was removed, use Underscore.js [template function][p].\n\n[p]: http://documentcloud.github.com/underscore/#template\n\n**strip** alias for *trim*\n\n**lstrip** alias for *ltrim*\n\n**rstrip** alias for *rtrim*\n\n**titleize** _.titleize(string)\n\n```javascript\n_('my name is epeli').titleize()\n=> 'My Name Is Epeli'\n```\n\n**camelize** _.camelize(string)\n\nConverts underscored or dasherized string to a camelized one\n\n```javascript\n_('-moz-transform').camelize()\n=> 'MozTransform'\n```\n\n**classify** _.classify(string)\n\nConverts string to camelized class name\n\n```javascript\n_('some_class_name').classify()\n=> 'SomeClassName'\n```\n\n**underscored** _.underscored(string)\n\nConverts a camelized or dasherized string into an underscored one\n\n```javascript\n_('MozTransform').underscored()\n=> 'moz_transform'\n```\n\n**dasherize** _.dasherize(string)\n\nConverts a underscored or camelized string into an dasherized one\n\n```javascript\n_('MozTransform').dasherize()\n=> '-moz-transform'\n```\n\n**humanize** _.humanize(string)\n\nConverts an underscored, camelized, or dasherized string into a humanized one.\nAlso removes beginning and ending whitespace, and removes the postfix '_id'.\n\n```javascript\n_(' capitalize dash-CamelCase_underscore trim ').humanize()\n=> 'Capitalize dash camel case underscore trim'\n```\n\n**trim** _.trim(string, [characters])\n\ntrims defined characters from begining and ending of the string.\nDefaults to whitespace characters.\n\n```javascript\n_.trim(\" foobar \")\n=> \"foobar\"\n\n_.trim(\"_-foobar-_\", \"_-\")\n=> \"foobar\"\n```\n\n\n**ltrim** _.ltrim(string, [characters])\n\nLeft trim. Similar to trim, but only for left side.\n\n\n**rtrim** _.rtrim(string, [characters])\n\nRight trim. Similar to trim, but only for right side.\n\n**truncate** _.truncate(string, length, truncateString)\n\n```javascript\n_('Hello world').truncate(5)\n=> 'Hello...'\n\n_('Hello').truncate(10)\n=> 'Hello'\n```\n\n**prune** _.prune(string, length, pruneString)\n\nElegant version of truncate.\nMakes sure the pruned string does not exceed the original length.\nAvoid half-chopped words when truncating.\n\n```javascript\n_('Hello, world').prune(5)\n=> 'Hello...'\n\n_('Hello, world').prune(8)\n=> 'Hello...'\n\n_('Hello, world').prune(5, ' (read a lot more)')\n=> 'Hello, world' (as adding \"(read a lot more)\" would be longer than the original string)\n\n_('Hello, cruel world').prune(15)\n=> 'Hello, cruel...'\n\n_('Hello').prune(10)\n=> 'Hello'\n```\n\n**words** _.words(str, delimiter=\" \")\n\nSplit string by delimiter (String or RegExp), ' ' by default.\n\n```javascript\n_.words(\"I love you\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I_love_you\", \"_\")\n=> [\"I\",\"love\",\"you\"]\n\n_.words(\"I-love-you\", /-/)\n=> [\"I\",\"love\",\"you\"]\n```\n\n**sprintf** _.sprintf(string format, *arguments)\n\nC like string formatting.\nCredits goes to [Alexandru Marasteanu][o].\nFor more detailed documentation, see the [original page][o].\n\n[o]: http://www.diveintojavascript.com/projects/sprintf-for-javascript\n\n```javascript\n_.sprintf(\"%.1f\", 1.17)\n\"1.2\"\n```\n\n**pad** _.pad(str, length, [padStr, type])\n\npads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`\" \"`). `padStr` is truncated to a single character if necessary.\n\n```javascript\n_.pad(\"1\", 8)\n-> \" 1\";\n\n_.pad(\"1\", 8, '0')\n-> \"00000001\";\n\n_.pad(\"1\", 8, '0', 'right')\n-> \"10000000\";\n\n_.pad(\"1\", 8, '0', 'both')\n-> \"00001000\";\n\n_.pad(\"1\", 8, 'bleepblorp', 'both')\n-> \"bbbb1bbb\";\n```\n\n**lpad** _.lpad(str, length, [padStr])\n\nleft-pad a string. Alias for `pad(str, length, padStr, 'left')`\n\n```javascript\n_.lpad(\"1\", 8, '0')\n-> \"00000001\";\n```\n\n**rpad** _.rpad(str, length, [padStr])\n\nright-pad a string. Alias for `pad(str, length, padStr, 'right')`\n\n```javascript\n_.rpad(\"1\", 8, '0')\n-> \"10000000\";\n```\n\n**lrpad** _.lrpad(str, length, [padStr])\n\nleft/right-pad a string. Alias for `pad(str, length, padStr, 'both')`\n\n```javascript\n_.lrpad(\"1\", 8, '0')\n-> \"00001000\";\n```\n\n**center** alias for **lrpad**\n\n**ljust** alias for *rpad*\n\n**rjust** alias for *lpad*\n\n**toNumber** _.toNumber(string, [decimals])\n\nParse string to number. Returns NaN if string can't be parsed to number.\n\n```javascript\n_('2.556').toNumber()\n=> 3\n\n_('2.556').toNumber(1)\n=> 2.6\n```\n\n**strRight** _.strRight(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRight('_')\n=> \"is_a_test_string\";\n```\n\n**strRightBack** _.strRightBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strRightBack('_')\n=> \"string\";\n```\n\n**strLeft** _.strLeft(string, pattern)\n\nSearches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeft('_')\n=> \"This\";\n```\n\n**strLeftBack** _.strLeftBack(string, pattern)\n\nSearches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.\n\n```javascript\n_('This_is_a_test_string').strLeftBack('_')\n=> \"This_is_a_test\";\n```\n\n**stripTags**\n\nRemoves all html tags from string.\n\n```javascript\n_('a link').stripTags()\n=> 'a link'\n\n_('a link').stripTags()\n=> 'a linkalert(\"hello world!\")'\n```\n\n**toSentence** _.toSentence(array, [delimiter, lastDelimiter])\n\nJoin an array into a human readable sentence.\n\n```javascript\n_.toSentence(['jQuery', 'Mootools', 'Prototype'])\n=> 'jQuery, Mootools and Prototype';\n\n_.toSentence(['jQuery', 'Mootools', 'Prototype'], ', ', ' unt ')\n=> 'jQuery, Mootools unt Prototype';\n```\n\n**repeat** _.repeat(string, count, [separator])\n\nRepeats a string count times.\n\n```javascript\n_.repeat(\"foo\", 3)\n=> 'foofoofoo';\n\n_.repeat(\"foo\", 3, \"bar\")\n=> 'foobarfoobarfoo'\n```\n\n**slugify** _.slugify(string)\n\nTransform text into a URL slug. Replaces whitespaces, accentuated, and special characters with a dash.\n\n```javascript\n_.slugify(\"Un éléphant à l'orée du bois\")\n=> 'un-elephant-a-loree-du-bois';\n```\n\n***Caution: this function is charset dependent***\n\n## Roadmap ##\n\nAny suggestions or bug reports are welcome. Just email me or more preferably open an issue.\n\n## Changelog ##\n\n### 2.0.0 ###\n\n* Added prune, humanize functions\n* Added _.string (_.str) namespace for Underscore.string library\n* Removed includes function\n\n#### Problems\n\nWe lose two things for `include` and `reverse` methods from `_.string`:\n\n* Calls like `_('foobar').include('bar')` aren't available;\n* Chaining isn't available too.\n\nBut if you need this functionality you can create aliases for conflict functions which will be convenient for you:\n\n```javascript\n_.mixin({\n includeString: _.str.include,\n reverseString: _.str.reverse\n})\n\n// Now wrapper calls and chaining are available.\n_('foobar').chain().reverseString().includeString('rab').value()\n```\n\n#### Standalone Usage\n\nIf you are using Underscore.string without Underscore. You also have `_.string` namespace for it and `_.str` alias\nBut of course you can just reassign `_` variable with `_.string`\n\n```javascript\n_ = _.string\n```\n### 2.2.0 ###\n\n* Capitalize method behavior changed\n* Various perfomance tweaks\n\n### 2.1.1###\n\n* Fixed words method bug\n* Added classify method\n\n### 2.1.0 ###\n\n* AMD support\n* Added toSentence method\n* Added slugify method\n* Lots of speed optimizations\n\n### 2.0.0 ###\n\nFor upgrading to this version you need to mix in Underscore.string library to Underscore object:\n\n```javascript\n_.mixin(_.string.exports());\n```\n\nand all non-conflict Underscore.string functions will be available through Underscore object.\nAlso function `includes` has been removed, you should replace this function by `_.str.include`\nor create alias `_.includes = _.str.include` and all your code will work fine.\n\n### 1.1.6 ###\n\n* Fixed reverse and truncate\n* Added isBlank, stripTags, inlude(alias for includes)\n* Added uglifier compression\n\n### 1.1.5 ###\n\n* Added strRight, strRightBack, strLeft, strLeftBack\n\n### 1.1.4 ###\n\n* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust\n* Integration with Underscore 1.1.6\n\n### 1.1.3 ###\n\n* Added methods: underscored, camelize, dasherize\n* Support newer version of npm\n\n### 1.1.2 ###\n\n* Created functions: lines, chars, words functions\n\n### 1.0.2 ###\n\n* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)\n* Removed 'reverse' function, because this function override underscore.js 'reverse'\n\n## Contribute ##\n\n* Fork & pull request. Don't forget about tests.\n* If you planning add some feature please create issue before.\n\nOtherwise changes will be rejected.\n\n## Contributors list ##\n\n* Esa-Matti Suuronen (),\n* Edward Tsech ,\n* Sasha Koss (),\n* Vladimir Dronnikov ,\n* Pete Kruckenberg (),\n* Paul Chavard (),\n* Ed Finkler ()\n* Pavel Pravosud \n* Anton Lindqvist ()\n\n## Licence ##\n\nThe MIT License\n\nCopyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", - "readmeFilename": "README.markdown", - "_id": "underscore.string@2.2.1", - "_from": "underscore.string@~2.2.1" -} diff --git a/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js b/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js deleted file mode 100644 index 326658e..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js +++ /dev/null @@ -1,44 +0,0 @@ -function waitFor(test, complete, timeout) { - var result, start = new Date().getTime() - setInterval(function interval() { - if ((new Date().getTime() - start < timeout) && !result) { - result = test() - } else { - if (!result) { - phantom.exit(1) - } else { - complete() - clearInterval(interval) - } - } - }, 100) -} - - -var page = new WebPage() - -page.onConsoleMessage = function(msg) { - console.log(msg) -} - -page.open(phantom.args[0], function(status) { - waitFor(function() { - return page.evaluate(function(){ - var el = document.getElementById('qunit-testresult') - return el && el.innerText.match('completed') - }) - }, function() { - var failures = page.evaluate(function() { - var el = document.getElementById('qunit-testresult'), - fails = document.getElementsByClassName('fail') - - for (var i = 0; i < fails.length; i++) - console.log(fails[i].innerText) - - console.log(el.innerText) - - return parseInt(el.getElementsByClassName('failed')[0].innerHTML) - }) - phantom.exit(failures > 0 ? 1 : 0) - }, 10000) -}) \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/test/speed.js b/node_modules/grunt/node_modules/underscore.string/test/speed.js deleted file mode 100644 index 4346414..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/speed.js +++ /dev/null @@ -1,138 +0,0 @@ -(function() { - - JSLitmus.test('trimNoNative', function() { - return _.trim(" foobar ", " "); - }); - - JSLitmus.test('trim', function() { - return _.trim(" foobar "); - }); - - JSLitmus.test('trim object-oriented', function() { - return _(" foobar ").trim(); - }); - - JSLitmus.test('trim jQuery', function() { - return jQuery.trim(" foobar "); - }); - - JSLitmus.test('ltrimp', function() { - return _.ltrim(" foobar ", " "); - }); - - JSLitmus.test('rtrimp', function() { - return _.rtrim(" foobar ", " "); - }); - - JSLitmus.test('startsWith', function() { - return _.startsWith("foobar", "foo"); - }); - - JSLitmus.test('endsWith', function() { - return _.endsWith("foobar", "xx"); - }); - - JSLitmus.test('chop', function(){ - return _('whitespace').chop(2); - }); - - JSLitmus.test('count', function(){ - return _('Hello worls').count('l'); - }); - - JSLitmus.test('insert', function() { - return _('Hello ').insert(6, 'world'); - }); - - JSLitmus.test('splice', function() { - return _('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'); - }); - - JSLitmus.test('succ', function(){ - var let = 'a', alphabet = []; - - for (var i=0; i < 26; i++) { - alphabet.push(let); - let = _(let).succ(); - } - - return alphabet; - }); - - JSLitmus.test('titleize', function(){ - return _('the titleize string method').titleize(); - }); - - JSLitmus.test('truncate', function(){ - return _('Hello world').truncate(5); - }); - - JSLitmus.test('prune', function(){ - return _('Hello world').prune(5); - }); - - JSLitmus.test('isBlank', function(){ - return _('').isBlank(); - }); - - JSLitmus.test('escapeHTML', function(){ - _('
        Blah blah blah
        ').escapeHTML(); - }); - - JSLitmus.test('unescapeHTML', function(){ - _('<div>Blah blah blah</div>').unescapeHTML(); - }); - - JSLitmus.test('reverse', function(){ - _('Hello World').reverse(); - }); - - JSLitmus.test('pad default', function(){ - _('foo').pad(12); - }); - - JSLitmus.test('pad hash left', function(){ - _('foo').pad(12, '#'); - }); - - JSLitmus.test('pad hash right', function(){ - _('foo').pad(12, '#', 'right'); - }); - - JSLitmus.test('pad hash both', function(){ - _('foo').pad(12, '#', 'both'); - }); - - JSLitmus.test('pad hash both longPad', function(){ - _('foo').pad(12, 'f00f00f00', 'both'); - }); - - JSLitmus.test('toNumber', function(){ - _('10.232323').toNumber(2); - }); - - JSLitmus.test('strRight', function(){ - _('aaa_bbb_ccc').strRight('_'); - }); - - JSLitmus.test('strRightBack', function(){ - _('aaa_bbb_ccc').strRightBack('_'); - }); - - JSLitmus.test('strLeft', function(){ - _('aaa_bbb_ccc').strLeft('_'); - }); - - JSLitmus.test('strLeftBack', function(){ - _('aaa_bbb_ccc').strLeftBack('_'); - }); - - JSLitmus.test('join', function(){ - _('separator').join(1, 2, 3, 4, 5, 6, 7, 8, 'foo', 'bar', 'lol', 'wut'); - }); - - JSLitmus.test('slugify', function(){ - _("Un éléphant à l'orée du bois").slugify(); - }); - -})(); diff --git a/node_modules/grunt/node_modules/underscore.string/test/strings.js b/node_modules/grunt/node_modules/underscore.string/test/strings.js deleted file mode 100644 index f700abf..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/strings.js +++ /dev/null @@ -1,438 +0,0 @@ -$(document).ready(function() { - - // Include Underscore.string methods to Underscore namespace - _.mixin(_.str.exports()); - - module("String extensions"); - - test("Strings: trim", function() { - equals(_.trim(123), "123", "Non string"); - equals(_(" foo").trim(), "foo"); - equals(_("foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ").trim(), "foo"); - equals(_(" foo ", " ").trim(), "foo", "Manually set whitespace"); - - equals(_("ffoo").trim("f"), "oo"); - equals(_("ooff").trim("f"), "oo"); - equals(_("ffooff").trim("f"), "oo"); - - - equals(_("_-foobar-_").trim("_-"), "foobar"); - - equals(_("http://foo/").trim("/"), "http://foo"); - equals(_("c:\\").trim('\\'), "c:"); - - equals(_(123).trim(), '123'); - equals(_(123).trim(3), '12'); - }); - - test("Strings: ltrim", function() { - equals(_(" foo").ltrim(), "foo"); - equals(_(" foo").ltrim(), "foo"); - equals(_("foo ").ltrim(), "foo "); - equals(_(" foo ").ltrim(), "foo "); - - - equals(_("ffoo").ltrim("f"), "oo"); - equals(_("ooff").ltrim("f"), "ooff"); - equals(_("ffooff").ltrim("f"), "ooff"); - - equals(_("_-foobar-_").ltrim("_-"), "foobar-_"); - - equals(_(123).ltrim(1), '23'); - }); - - test("Strings: rtrim", function() { - equals(_("http://foo/").rtrim("/"), "http://foo", 'clean trailing slash'); - equals(_(" foo").rtrim(), " foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo ").rtrim(), "foo"); - equals(_("foo bar ").rtrim(), "foo bar"); - equals(_(" foo ").rtrim(), " foo"); - - equals(_("ffoo").rtrim("f"), "ffoo"); - equals(_("ooff").rtrim("f"), "oo"); - equals(_("ffooff").rtrim("f"), "ffoo"); - - equals(_("_-foobar-_").rtrim("_-"), "_-foobar"); - - equals(_(123).rtrim(3), '12'); - }); - - test("Strings: capitalize", function() { - equals(_("fabio").capitalize(), "Fabio", 'First letter is upper case'); - equals(_.capitalize("fabio"), "Fabio", 'First letter is upper case'); - equals(_.capitalize('FOO'), 'FOO', 'Other letters unchanged'); - equals(_(123).capitalize(), "123", "Non string"); - }); - - test("Strings: join", function() { - equals(_.join("", "foo", "bar"), "foobar", 'basic join'); - equals(_.join("", 1, "foo", 2), "1foo2", 'join numbers and strings'); - equals(_.join(" ","foo", "bar"), "foo bar", 'join with spaces'); - equals(_.join("1", "2", "2"), "212", 'join number strings'); - equals(_.join(1, 2, 2), "212", 'join numbers'); - equals(_(" ").join("foo", "bar"), "foo bar", 'join object oriented'); - }); - - test("Strings: reverse", function() { - equals(_.str.reverse("foo"), "oof" ); - equals(_.str.reverse("foobar"), "raboof" ); - equals(_.str.reverse("foo bar"), "rab oof" ); - equals(_.str.reverse("saippuakauppias"), "saippuakauppias" ); - equals(_.str.reverse(123), "321", "Non string"); - equals(_.str.reverse(123.45), "54.321", "Non string"); - }); - - test("Strings: clean", function() { - equals(_(" foo bar ").clean(), "foo bar"); - equals(_(123).clean(), "123"); - }); - - test("Strings: sprintf", function() { - // Should be very tested function already. Thanks to - // http://www.diveintojavascript.com/projects/sprintf-for-javascript - equals(_.sprintf("Hello %s", "me"), "Hello me", 'basic'); - equals(_("Hello %s").sprintf("me"), "Hello me", 'object'); - equals(_("hello %s").chain().sprintf("me").capitalize().value(), "Hello me", 'Chaining works'); - equals(_.sprintf("%.1f", 1.22222), "1.2", 'round'); - equals(_.sprintf("%.1f", 1.17), "1.2", 'round 2'); - equals(_.sprintf("%(id)d - %(name)s", {id: 824, name: "Hello World"}), "824 - Hello World", 'Named replacements work'); - equals(_.sprintf("%(args[0].id)d - %(args[1].name)s", {args: [{id: 824}, {name: "Hello World"}]}), "824 - Hello World", 'Named replacements with arrays work'); - }); - - - test("Strings: vsprintf", function() { - equals(_.vsprintf("Hello %s", ["me"]), "Hello me", 'basic'); - equals(_("Hello %s").vsprintf(["me"]), "Hello me", 'object'); - equals(_("hello %s").chain().vsprintf(["me"]).capitalize().value(), "Hello me", 'Chaining works'); - equals(_.vsprintf("%.1f", [1.22222]), "1.2", 'round'); - equals(_.vsprintf("%.1f", [1.17]), "1.2", 'round 2'); - equals(_.vsprintf("%(id)d - %(name)s", [{id: 824, name: "Hello World"}]), "824 - Hello World", 'Named replacement works'); - equals(_.vsprintf("%(args[0].id)d - %(args[1].name)s", [{args: [{id: 824}, {name: "Hello World"}]}]), "824 - Hello World", 'Named replacement with arrays works'); - }); - - test("Strings: startsWith", function() { - ok(_("foobar").startsWith("foo"), 'foobar starts with foo'); - ok(!_("oobar").startsWith("foo"), 'oobar does not start with foo'); - ok(_(12345).startsWith(123), '12345 starts with 123'); - ok(!_(2345).startsWith(123), '2345 does not start with 123'); - }); - - test("Strings: endsWith", function() { - ok(_("foobar").endsWith("bar"), 'foobar ends with bar'); - ok(_.endsWith("foobar", "bar"), 'foobar ends with bar'); - ok(_.endsWith("00018-0000062.Plone.sdh264.1a7264e6912a91aa4a81b64dc5517df7b8875994.mp4", "mp4"), 'endsWith .mp4'); - ok(!_("fooba").endsWith("bar"), 'fooba does not end with bar'); - ok(_.endsWith(12345, 45), '12345 ends with 45'); - ok(!_.endsWith(12345, 6), '12345 does not end with 6'); - }); - - test("Strings: include", function() { - ok(_.str.include("foobar", "bar"), 'foobar includes bar'); - ok(!_.str.include("foobar", "buzz"), 'foobar does not includes buzz'); - ok(_.str.include(12345, 34), '12345 includes 34'); - ok(!_.str.contains(12345, 6), '12345 does not includes 6'); - }); - - test('String: chop', function(){ - ok(_('whitespace').chop(2).length === 5, "output ['wh','it','es','pa','ce']"); - ok(_('whitespace').chop(3).length === 4, "output ['whi','tes','pac','e']"); - ok(_('whitespace').chop()[0].length === 10, "output ['whitespace']"); - ok(_(12345).chop(1).length === 5, "output ['1','2','3','4','5']"); - }); - - test('String: clean', function(){ - equals(_.clean(' foo bar '), 'foo bar'); - equals(_.clean(1), '1'); - }); - - test('String: count', function(){ - equals(_('Hello world').count('l'), 3); - equals(_('Hello world').count('Hello'), 1); - equals(_('Hello world').count('foo'), 0); - equals(_('x.xx....x.x').count('x'), 5); - equals(_(12345).count(1), 1); - equals(_(11345).count(1), 2); - }); - - test('String: insert', function(){ - equals(_('Hello ').insert(6, 'Jessy'), 'Hello Jessy'); - equals(_('Hello ').insert(100, 'Jessy'), 'Hello Jessy'); - equals(_(12345).insert(6, 'Jessy'), '12345Jessy'); - }); - - test('String: splice', function(){ - equals(_('https://edtsech@bitbucket.org/edtsech/underscore.strings').splice(30, 7, 'epeli'), - 'https://edtsech@bitbucket.org/epeli/underscore.strings'); - equals(_.splice(12345, 1, 2, 321), '132145', 'Non strings'); - }); - - test('String: succ', function(){ - equals(_('a').succ(), 'b'); - equals(_('A').succ(), 'B'); - equals(_('+').succ(), ','); - equals(_(1).succ(), '2'); - }); - - test('String: titleize', function(){ - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_('the titleize string method').titleize(), 'The Titleize String Method'); - equals(_(123).titleize(), '123'); - }); - - test('String: camelize', function(){ - equals(_('the_camelize_string_method').camelize(), 'theCamelizeStringMethod'); - equals(_('-the-camelize-string-method').camelize(), 'TheCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(' the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_('the camelize string method').camelize(), 'theCamelizeStringMethod'); - equals(_(123).camelize(), '123'); - }); - - test('String: underscored', function(){ - equals(_('the-underscored-string-method').underscored(), 'the_underscored_string_method'); - equals(_('theUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_('TheUnderscoredStringMethod').underscored(), 'the_underscored_string_method'); - equals(_(' the underscored string method').underscored(), 'the_underscored_string_method'); - equals(_(123).underscored(), '123'); - }); - - test('String: dasherize', function(){ - equals(_('the_dasherize_string_method').dasherize(), 'the-dasherize-string-method'); - equals(_('TheDasherizeStringMethod').dasherize(), '-the-dasherize-string-method'); - equals(_('thisIsATest').dasherize(), 'this-is-a-test'); - equals(_('this Is A Test').dasherize(), 'this-is-a-test'); - equals(_('thisIsATest123').dasherize(), 'this-is-a-test123'); - equals(_('123thisIsATest').dasherize(), '123this-is-a-test'); - equals(_('the dasherize string method').dasherize(), 'the-dasherize-string-method'); - equals(_('the dasherize string method ').dasherize(), 'the-dasherize-string-method'); - equals(_('téléphone').dasherize(), 'téléphone'); - equals(_('foo$bar').dasherize(), 'foo$bar'); - equals(_(123).dasherize(), '123'); - }); - - test('String: camelize', function(){ - equals(_.camelize('-moz-transform'), 'MozTransform'); - equals(_.camelize('webkit-transform'), 'webkitTransform'); - equals(_.camelize('under_scored'), 'underScored'); - equals(_.camelize(' with spaces'), 'withSpaces'); - }); - - test('String: join', function(){ - equals(_.join(1, 2, 3, 4), '21314'); - equals(_.join('|', 'foo', 'bar', 'baz'), 'foo|bar|baz'); - }); - - test('String: classify', function(){ - equals(_.classify(1), '1'); - equals(_('some_class_name').classify(), 'SomeClassName'); - }); - - test('String: humanize', function(){ - equals(_('the_humanize_string_method').humanize(), 'The humanize string method'); - equals(_('ThehumanizeStringMethod').humanize(), 'Thehumanize string method'); - equals(_('the humanize string method').humanize(), 'The humanize string method'); - equals(_('the humanize_id string method_id').humanize(), 'The humanize id string method'); - equals(_('the humanize string method ').humanize(), 'The humanize string method'); - equals(_(' capitalize dash-CamelCase_underscore trim ').humanize(), 'Capitalize dash camel case underscore trim'); - equals(_(123).humanize(), '123'); - }); - - test('String: truncate', function(){ - equals(_('Hello world').truncate(6, 'read more'), 'Hello read more'); - equals(_('Hello world').truncate(5), 'Hello...'); - equals(_('Hello').truncate(10), 'Hello'); - equals(_(1234567890).truncate(5), '12345...'); - }); - - test('String: prune', function(){ - equals(_('Hello, cruel world').prune(6, ' read more'), 'Hello read more'); - equals(_('Hello, world').prune(5, 'read a lot more'), 'Hello, world'); - equals(_('Hello, world').prune(5), 'Hello...'); - equals(_('Hello, world').prune(8), 'Hello...'); - equals(_('Hello, cruel world').prune(15), 'Hello, cruel...'); - equals(_('Hello world').prune(22), 'Hello world'); - equals(_('Привет, жестокий мир').prune(6, ' read more'), 'Привет read more'); - equals(_('Привет, мир').prune(6, 'read a lot more'), 'Привет, мир'); - equals(_('Привет, мир').prune(6), 'Привет...'); - equals(_('Привет, мир').prune(8), 'Привет...'); - equals(_('Привет, жестокий мир').prune(16), 'Привет, жестокий...'); - equals(_('Привет, мир').prune(22), 'Привет, мир'); - equals(_(123).prune(10), '123'); - equals(_(123).prune(1,1), '11'); - }); - - test('String: isBlank', function(){ - ok(_('').isBlank()); - ok(_(' ').isBlank()); - ok(_('\n').isBlank()); - ok(!_('a').isBlank()); - ok(!_('0').isBlank()); - ok(!_(0).isBlank()); - }); - - test('String: escapeHTML', function(){ - equals(_('
        Blah & "blah" & \'blah\'
        ').escapeHTML(), - '<div>Blah & "blah" & 'blah'</div>'); - equals(_('<').escapeHTML(), '&lt;'); - equals(_(5).escapeHTML(), '5'); - // equals(_(undefined).escapeHTML(), ''); - }); - - test('String: unescapeHTML', function(){ - equals(_('<div>Blah & "blah" & 'blah'</div>').unescapeHTML(), - '
        Blah & "blah" & \'blah\'
        '); - equals(_('&lt;').unescapeHTML(), '<'); - equals(_(''').unescapeHTML(), "'"); - equals(_(''').unescapeHTML(), "'"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('J').unescapeHTML(), "J"); - equals(_('&_#39;').unescapeHTML(), "&_#39;"); - equals(_(''_;').unescapeHTML(), "'_;"); - equals(_('&#38;').unescapeHTML(), "&"); - equals(_('&amp;').unescapeHTML(), "&"); - equals(_(5).unescapeHTML(), '5'); - // equals(_(undefined).unescapeHTML(), ''); - }); - - test('String: words', function() { - equals(_("I love you!").words().length, 3); - equals(_(" I love you! ").words().length, 3); - equals(_("I_love_you!").words('_').length, 3); - equals(_("I-love-you!").words(/-/).length, 3); - equals(_(123).words().length, 1); - }); - - test('String: chars', function() { - equals(_("Hello").chars().length, 5); - equals(_(123).chars().length, 3); - }); - - test('String: lines', function() { - equals(_("Hello\nWorld").lines().length, 2); - equals(_("Hello World").lines().length, 1); - equals(_(123).lines().length, 1); - }); - - test('String: pad', function() { - equals(_("1").pad(8), ' 1'); - equals(_(1).pad(8), ' 1'); - equals(_("1").pad(8, '0'), '00000001'); - equals(_("1").pad(8, '0', 'left'), '00000001'); - equals(_("1").pad(8, '0', 'right'), '10000000'); - equals(_("1").pad(8, '0', 'both'), '00001000'); - equals(_("foo").pad(8, '0', 'both'), '000foo00'); - equals(_("foo").pad(7, '0', 'both'), '00foo00'); - equals(_("foo").pad(7, '!@$%dofjrofj', 'both'), '!!foo!!'); - }); - - test('String: lpad', function() { - equals(_("1").lpad(8), ' 1'); - equals(_(1).lpad(8), ' 1'); - equals(_("1").lpad(8, '0'), '00000001'); - equals(_("1").lpad(8, '0', 'left'), '00000001'); - }); - - test('String: rpad', function() { - equals(_("1").rpad(8), '1 '); - equals(_(1).lpad(8), ' 1'); - equals(_("1").rpad(8, '0'), '10000000'); - equals(_("foo").rpad(8, '0'), 'foo00000'); - equals(_("foo").rpad(7, '0'), 'foo0000'); - }); - - test('String: lrpad', function() { - equals(_("1").lrpad(8), ' 1 '); - equals(_(1).lrpad(8), ' 1 '); - equals(_("1").lrpad(8, '0'), '00001000'); - equals(_("foo").lrpad(8, '0'), '000foo00'); - equals(_("foo").lrpad(7, '0'), '00foo00'); - equals(_("foo").lrpad(7, '!@$%dofjrofj'), '!!foo!!'); - }); - - test('String: toNumber', function() { - deepEqual(_("not a number").toNumber(), Number.NaN); - equals(_(0).toNumber(), 0); - equals(_("0").toNumber(), 0); - equals(_("0000").toNumber(), 0); - equals(_("2.345").toNumber(), 2); - equals(_("2.345").toNumber(NaN), 2); - equals(_("2.345").toNumber(2), 2.35); - equals(_("2.344").toNumber(2), 2.34); - equals(_("2").toNumber(2), 2.00); - equals(_(2).toNumber(2), 2.00); - equals(_(-2).toNumber(), -2); - equals(_("-2").toNumber(), -2); - }); - - test('String: strRight', function() { - equals(_("This_is_a_test_string").strRight("_"), "is_a_test_string"); - equals(_("This_is_a_test_string").strRight("string"), ""); - equals(_("This_is_a_test_string").strRight(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRight("-"), "This_is_a_test_string"); - equals(_(12345).strRight(2), "345"); - }); - - test('String: strRightBack', function() { - equals(_("This_is_a_test_string").strRightBack("_"), "string"); - equals(_("This_is_a_test_string").strRightBack("string"), ""); - equals(_("This_is_a_test_string").strRightBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strRightBack("-"), "This_is_a_test_string"); - equals(_(12345).strRightBack(2), "345"); - }); - - test('String: strLeft', function() { - equals(_("This_is_a_test_string").strLeft("_"), "This"); - equals(_("This_is_a_test_string").strLeft("This"), ""); - equals(_("This_is_a_test_string").strLeft(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeft("-"), "This_is_a_test_string"); - equals(_(123454321).strLeft(3), "12"); - }); - - test('String: strLeftBack', function() { - equals(_("This_is_a_test_string").strLeftBack("_"), "This_is_a_test"); - equals(_("This_is_a_test_string").strLeftBack("This"), ""); - equals(_("This_is_a_test_string").strLeftBack(), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack(""), "This_is_a_test_string"); - equals(_("This_is_a_test_string").strLeftBack("-"), "This_is_a_test_string"); - equals(_(123454321).strLeftBack(3), "123454"); - }); - - test('Strings: stripTags', function() { - equals(_('a link').stripTags(), 'a link'); - equals(_('a link - - - - - - - - -

        Underscore.string Test Suite

        -

        -

        -
          -
          -

          Underscore.string Speed Suite

          - -
          - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html b/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html deleted file mode 100644 index 9854c17..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - Underscore.strings Test Suite - - - - - - - - -

          Underscore.string Test Suite

          -

          -

          -
            - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js deleted file mode 100644 index b3b1ce1..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js +++ /dev/null @@ -1,166 +0,0 @@ -$(document).ready(function() { - - module("Arrays"); - - test("arrays: first", function() { - equals(_.first([1,2,3]), 1, 'can pull out the first element of an array'); - equals(_([1, 2, 3]).first(), 1, 'can perform OO-style "first()"'); - equals(_.first([1,2,3], 0).join(', '), "", 'can pass an index to first'); - equals(_.first([1,2,3], 2).join(', '), '1, 2', 'can pass an index to first'); - equals(_.first([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to first'); - var result = (function(){ return _.first(arguments); })(4, 3, 2, 1); - equals(result, 4, 'works on an arguments object.'); - result = _.map([[1,2,3],[1,2,3]], _.first); - equals(result.join(','), '1,1', 'works well with _.map'); - }); - - test("arrays: rest", function() { - var numbers = [1, 2, 3, 4]; - equals(_.rest(numbers).join(", "), "2, 3, 4", 'working rest()'); - equals(_.rest(numbers, 0).join(", "), "1, 2, 3, 4", 'working rest(0)'); - equals(_.rest(numbers, 2).join(', '), '3, 4', 'rest can take an index'); - var result = (function(){ return _(arguments).tail(); })(1, 2, 3, 4); - equals(result.join(', '), '2, 3, 4', 'aliased as tail and works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.rest); - equals(_.flatten(result).join(','), '2,3,2,3', 'works well with _.map'); - }); - - test("arrays: initial", function() { - equals(_.initial([1,2,3,4,5]).join(", "), "1, 2, 3, 4", 'working initial()'); - equals(_.initial([1,2,3,4],2).join(", "), "1, 2", 'initial can take an index'); - var result = (function(){ return _(arguments).initial(); })(1, 2, 3, 4); - equals(result.join(", "), "1, 2, 3", 'initial works on arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.initial); - equals(_.flatten(result).join(','), '1,2,1,2', 'initial works with _.map'); - }); - - test("arrays: last", function() { - equals(_.last([1,2,3]), 3, 'can pull out the last element of an array'); - equals(_.last([1,2,3], 0).join(', '), "", 'can pass an index to last'); - equals(_.last([1,2,3], 2).join(', '), '2, 3', 'can pass an index to last'); - equals(_.last([1,2,3], 5).join(', '), '1, 2, 3', 'can pass an index to last'); - var result = (function(){ return _(arguments).last(); })(1, 2, 3, 4); - equals(result, 4, 'works on an arguments object'); - result = _.map([[1,2,3],[1,2,3]], _.last); - equals(result.join(','), '3,3', 'works well with _.map'); - }); - - test("arrays: compact", function() { - equals(_.compact([0, 1, false, 2, false, 3]).length, 3, 'can trim out all falsy values'); - var result = (function(){ return _(arguments).compact().length; })(0, 1, false, 2, false, 3); - equals(result, 3, 'works on an arguments object'); - }); - - test("arrays: flatten", function() { - if (window.JSON) { - var list = [1, [2], [3, [[[4]]]]]; - equals(JSON.stringify(_.flatten(list)), '[1,2,3,4]', 'can flatten nested arrays'); - equals(JSON.stringify(_.flatten(list, true)), '[1,2,3,[[[4]]]]', 'can shallowly flatten nested arrays'); - var result = (function(){ return _.flatten(arguments); })(1, [2], [3, [[[4]]]]); - equals(JSON.stringify(result), '[1,2,3,4]', 'works on an arguments object'); - } - }); - - test("arrays: without", function() { - var list = [1, 2, 1, 0, 3, 1, 4]; - equals(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object'); - var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4); - equals(result.join(', '), '2, 3, 4', 'works on an arguments object'); - - var list = [{one : 1}, {two : 2}]; - ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.'); - ok(_.without(list, list[0]).length == 1, 'ditto.'); - }); - - test("arrays: uniq", function() { - var list = [1, 2, 1, 3, 1, 4]; - equals(_.uniq(list).join(', '), '1, 2, 3, 4', 'can find the unique values of an unsorted array'); - - var list = [1, 1, 1, 2, 2, 3]; - equals(_.uniq(list, true).join(', '), '1, 2, 3', 'can find the unique values of a sorted array faster'); - - var list = [{name:'moe'}, {name:'curly'}, {name:'larry'}, {name:'curly'}]; - var iterator = function(value) { return value.name; }; - equals(_.map(_.uniq(list, false, iterator), iterator).join(', '), 'moe, curly, larry', 'can find the unique values of an array using a custom iterator'); - - var iterator = function(value) { return value +1; }; - var list = [1, 2, 2, 3, 4, 4]; - equals(_.uniq(list, true, iterator).join(', '), '1, 2, 3, 4', 'iterator works with sorted array'); - - var result = (function(){ return _.uniq(arguments); })(1, 2, 1, 3, 1, 4); - equals(result.join(', '), '1, 2, 3, 4', 'works on an arguments object'); - }); - - test("arrays: intersection", function() { - var stooges = ['moe', 'curly', 'larry'], leaders = ['moe', 'groucho']; - equals(_.intersection(stooges, leaders).join(''), 'moe', 'can take the set intersection of two arrays'); - equals(_(stooges).intersection(leaders).join(''), 'moe', 'can perform an OO-style intersection'); - var result = (function(){ return _.intersection(arguments, leaders); })('moe', 'curly', 'larry'); - equals(result.join(''), 'moe', 'works on an arguments object'); - }); - - test("arrays: union", function() { - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40]); - equals(result.join(' '), '1 2 3 30 40', 'takes the union of a list of arrays'); - - var result = _.union([1, 2, 3], [2, 30, 1], [1, 40, [1]]); - equals(result.join(' '), '1 2 3 30 40 1', 'takes the union of a list of nested arrays'); - }); - - test("arrays: difference", function() { - var result = _.difference([1, 2, 3], [2, 30, 40]); - equals(result.join(' '), '1 3', 'takes the difference of two arrays'); - - var result = _.difference([1, 2, 3, 4], [2, 30, 40], [1, 11, 111]); - equals(result.join(' '), '3 4', 'takes the difference of three arrays'); - }); - - test('arrays: zip', function() { - var names = ['moe', 'larry', 'curly'], ages = [30, 40, 50], leaders = [true]; - var stooges = _.zip(names, ages, leaders); - equals(String(stooges), 'moe,30,true,larry,40,,curly,50,', 'zipped together arrays of different lengths'); - }); - - test("arrays: indexOf", function() { - var numbers = [1, 2, 3]; - numbers.indexOf = null; - equals(_.indexOf(numbers, 2), 1, 'can compute indexOf, even without the native function'); - var result = (function(){ return _.indexOf(arguments, 2); })(1, 2, 3); - equals(result, 1, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.indexOf(numbers, num, true); - equals(index, -1, '35 is not in the list'); - - numbers = [10, 20, 30, 40, 50]; num = 40; - index = _.indexOf(numbers, num, true); - equals(index, 3, '40 is in the list'); - - numbers = [1, 40, 40, 40, 40, 40, 40, 40, 50, 60, 70]; num = 40; - index = _.indexOf(numbers, num, true); - equals(index, 1, '40 is in the list'); - }); - - test("arrays: lastIndexOf", function() { - var numbers = [1, 0, 1, 0, 0, 1, 0, 0, 0]; - numbers.lastIndexOf = null; - equals(_.lastIndexOf(numbers, 1), 5, 'can compute lastIndexOf, even without the native function'); - equals(_.lastIndexOf(numbers, 0), 8, 'lastIndexOf the other element'); - var result = (function(){ return _.lastIndexOf(arguments, 1); })(1, 0, 1, 0, 0, 1, 0, 0, 0); - equals(result, 5, 'works on an arguments object'); - equals(_.indexOf(null, 2), -1, 'handles nulls properly'); - }); - - test("arrays: range", function() { - equals(_.range(0).join(''), '', 'range with 0 as a first argument generates an empty array'); - equals(_.range(4).join(' '), '0 1 2 3', 'range with a single positive argument generates an array of elements 0,1,2,...,n-1'); - equals(_.range(5, 8).join(' '), '5 6 7', 'range with two arguments a & b, a<b generates an array of elements a,a+1,a+2,...,b-2,b-1'); - equals(_.range(8, 5).join(''), '', 'range with two arguments a & b, b<a generates an empty array'); - equals(_.range(3, 10, 3).join(' '), '3 6 9', 'range with three arguments a & b & c, c < b-a, a < b generates an array of elements a,a+c,a+2c,...,b - (multiplier of a) < c'); - equals(_.range(3, 10, 15).join(''), '3', 'range with three arguments a & b & c, c > b-a, a < b generates an array with a single element, equal to a'); - equals(_.range(12, 7, -2).join(' '), '12 10 8', 'range with three arguments a & b & c, a > b, c < 0 generates an array of elements a,a-c,a-2c and ends with the number not less than b'); - equals(_.range(0, -10, -1).join(' '), '0 -1 -2 -3 -4 -5 -6 -7 -8 -9', 'final example in the Python docs'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js deleted file mode 100644 index 0e3d5f3..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js +++ /dev/null @@ -1,59 +0,0 @@ -$(document).ready(function() { - - module("Chaining"); - - test("chaining: map/flatten/reduce", function() { - var lyrics = [ - "I'm a lumberjack and I'm okay", - "I sleep all night and I work all day", - "He's a lumberjack and he's okay", - "He sleeps all night and he works all day" - ]; - var counts = _(lyrics).chain() - .map(function(line) { return line.split(''); }) - .flatten() - .reduce(function(hash, l) { - hash[l] = hash[l] || 0; - hash[l]++; - return hash; - }, {}).value(); - ok(counts['a'] == 16 && counts['e'] == 10, 'counted all the letters in the song'); - }); - - test("chaining: select/reject/sortBy", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _(numbers).chain().select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: select/reject/sortBy in functional style", function() { - var numbers = [1,2,3,4,5,6,7,8,9,10]; - numbers = _.chain(numbers).select(function(n) { - return n % 2 == 0; - }).reject(function(n) { - return n % 4 == 0; - }).sortBy(function(n) { - return -n; - }).value(); - equals(numbers.join(', '), "10, 6, 2", "filtered and reversed the numbers"); - }); - - test("chaining: reverse/concat/unshift/pop/map", function() { - var numbers = [1,2,3,4,5]; - numbers = _(numbers).chain() - .reverse() - .concat([5, 5, 5]) - .unshift(17) - .pop() - .map(function(n){ return n * 2; }) - .value(); - equals(numbers.join(', '), "34, 10, 8, 6, 4, 2, 10, 10", 'can chain together array functions.'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js deleted file mode 100644 index cff9763..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js +++ /dev/null @@ -1,270 +0,0 @@ -$(document).ready(function() { - - module("Collections"); - - test("collections: each", function() { - _.each([1, 2, 3], function(num, i) { - equals(num, i + 1, 'each iterators provide value and iteration count'); - }); - - var answers = []; - _.each([1, 2, 3], function(num){ answers.push(num * this.multiplier);}, {multiplier : 5}); - equals(answers.join(', '), '5, 10, 15', 'context object property accessed'); - - answers = []; - _.forEach([1, 2, 3], function(num){ answers.push(num); }); - equals(answers.join(', '), '1, 2, 3', 'aliased as "forEach"'); - - answers = []; - var obj = {one : 1, two : 2, three : 3}; - obj.constructor.prototype.four = 4; - _.each(obj, function(value, key){ answers.push(key); }); - equals(answers.join(", "), 'one, two, three', 'iterating over objects works, and ignores the object prototype.'); - delete obj.constructor.prototype.four; - - answer = null; - _.each([1, 2, 3], function(num, index, arr){ if (_.include(arr, num)) answer = true; }); - ok(answer, 'can reference the original collection from inside the iterator'); - - answers = 0; - _.each(null, function(){ ++answers; }); - equals(answers, 0, 'handles a null properly'); - }); - - test('collections: map', function() { - var doubled = _.map([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'doubled numbers'); - - doubled = _.collect([1, 2, 3], function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'aliased as "collect"'); - - var tripled = _.map([1, 2, 3], function(num){ return num * this.multiplier; }, {multiplier : 3}); - equals(tripled.join(', '), '3, 6, 9', 'tripled numbers with context'); - - var doubled = _([1, 2, 3]).map(function(num){ return num * 2; }); - equals(doubled.join(', '), '2, 4, 6', 'OO-style doubled numbers'); - - var ids = _.map($('div.underscore-test').children(), function(n){ return n.id; }); - ok(_.include(ids, 'qunit-header'), 'can use collection methods on NodeLists'); - - var ids = _.map(document.images, function(n){ return n.id; }); - ok(ids[0] == 'chart_image', 'can use collection methods on HTMLCollections'); - - var ifnull = _.map(null, function(){}); - ok(_.isArray(ifnull) && ifnull.length === 0, 'handles a null properly'); - - var length = _.map(Array(2), function(v) { return v; }).length; - equals(length, 2, "can preserve a sparse array's length"); - }); - - test('collections: reduce', function() { - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'can sum up an array'); - - var context = {multiplier : 3}; - sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num * this.multiplier; }, 0, context); - equals(sum, 18, 'can reduce with a context object'); - - sum = _.inject([1, 2, 3], function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'aliased as "inject"'); - - sum = _([1, 2, 3]).reduce(function(sum, num){ return sum + num; }, 0); - equals(sum, 6, 'OO-style reduce'); - - var sum = _.reduce([1, 2, 3], function(sum, num){ return sum + num; }); - equals(sum, 6, 'default initial value'); - - var ifnull; - try { - _.reduce(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - ok(_.reduce(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - equals(_.reduce([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduce([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduce(sparseArray, function(a, b){ return a - b; }), 25, 'initially-sparse arrays with no memo'); - }); - - test('collections: reduceRight', function() { - var list = _.reduceRight(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'can perform right folds'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }, ''); - equals(list, 'bazbarfoo', 'aliased as "foldr"'); - - var list = _.foldr(["foo", "bar", "baz"], function(memo, str){ return memo + str; }); - equals(list, 'bazbarfoo', 'default initial value'); - - var ifnull; - try { - _.reduceRight(null, function(){}); - } catch (ex) { - ifnull = ex; - } - ok(ifnull instanceof TypeError, 'handles a null (without inital value) properly'); - - ok(_.reduceRight(null, function(){}, 138) === 138, 'handles a null (with initial value) properly'); - - equals(_.reduceRight([], function(){}, undefined), undefined, 'undefined can be passed as a special case'); - raises(function() { _.reduceRight([], function(){}); }, TypeError, 'throws an error for empty arrays with no initial value'); - - var sparseArray = []; - sparseArray[0] = 20; - sparseArray[2] = -5; - equals(_.reduceRight(sparseArray, function(a, b){ return a - b; }), -25, 'initially-sparse arrays with no memo'); - }); - - test('collections: detect', function() { - var result = _.detect([1, 2, 3], function(num){ return num * 2 == 4; }); - equals(result, 2, 'found the first "2" and broke the loop'); - }); - - test('collections: select', function() { - var evens = _.select([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'selected each even number'); - - evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(evens.join(', '), '2, 4, 6', 'aliased as "filter"'); - }); - - test('collections: reject', function() { - var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); - equals(odds.join(', '), '1, 3, 5', 'rejected each even number'); - }); - - test('collections: all', function() { - ok(_.all([], _.identity), 'the empty set'); - ok(_.all([true, true, true], _.identity), 'all true values'); - ok(!_.all([true, false, true], _.identity), 'one false value'); - ok(_.all([0, 10, 28], function(num){ return num % 2 == 0; }), 'even numbers'); - ok(!_.all([0, 11, 28], function(num){ return num % 2 == 0; }), 'an odd number'); - ok(_.every([true, true, true], _.identity), 'aliased as "every"'); - }); - - test('collections: any', function() { - var nativeSome = Array.prototype.some; - Array.prototype.some = null; - ok(!_.any([]), 'the empty set'); - ok(!_.any([false, false, false]), 'all false values'); - ok(_.any([false, false, true]), 'one true value'); - ok(_.any([null, 0, 'yes', false]), 'a string'); - ok(!_.any([null, 0, '', false]), 'falsy values'); - ok(!_.any([1, 11, 29], function(num){ return num % 2 == 0; }), 'all odd numbers'); - ok(_.any([1, 10, 29], function(num){ return num % 2 == 0; }), 'an even number'); - ok(_.some([false, false, true]), 'aliased as "some"'); - Array.prototype.some = nativeSome; - }); - - test('collections: include', function() { - ok(_.include([1,2,3], 2), 'two is in the array'); - ok(!_.include([1,3,9], 2), 'two is not in the array'); - ok(_.contains({moe:1, larry:3, curly:9}, 3) === true, '_.include on objects checks their values'); - ok(_([1,2,3]).include(2), 'OO-style include'); - }); - - test('collections: invoke', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - test('collections: invoke w/ function reference', function() { - var list = [[5, 1, 7], [3, 2, 1]]; - var result = _.invoke(list, Array.prototype.sort); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - }); - - // Relevant when using ClojureScript - test('collections: invoke when strings have a call method', function() { - String.prototype.call = function(){return 42;} - var list = [[5, 1, 7], [3, 2, 1]]; - var s = "foo"; - equals(s.call(), 42, "call function exists"); - var result = _.invoke(list, 'sort'); - equals(result[0].join(', '), '1, 5, 7', 'first array sorted'); - equals(result[1].join(', '), '1, 2, 3', 'second array sorted'); - delete String.prototype.call; - equals(s.call, undefined, "call function removed"); - }); - - test('collections: pluck', function() { - var people = [{name : 'moe', age : 30}, {name : 'curly', age : 50}]; - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'pulls names out of objects'); - }); - - test('collections: max', function() { - equals(3, _.max([1, 2, 3]), 'can perform a regular Math.max'); - - var neg = _.max([1, 2, 3], function(num){ return -num; }); - equals(neg, 1, 'can perform a computation-based max'); - - equals(-Infinity, _.max({}), 'Maximum value of an empty object'); - equals(-Infinity, _.max([]), 'Maximum value of an empty array'); - }); - - test('collections: min', function() { - equals(1, _.min([1, 2, 3]), 'can perform a regular Math.min'); - - var neg = _.min([1, 2, 3], function(num){ return -num; }); - equals(neg, 3, 'can perform a computation-based min'); - - equals(Infinity, _.min({}), 'Minimum value of an empty object'); - equals(Infinity, _.min([]), 'Minimum value of an empty array'); - }); - - test('collections: sortBy', function() { - var people = [{name : 'curly', age : 50}, {name : 'moe', age : 30}]; - people = _.sortBy(people, function(person){ return person.age; }); - equals(_.pluck(people, 'name').join(', '), 'moe, curly', 'stooges sorted by age'); - }); - - test('collections: groupBy', function() { - var parity = _.groupBy([1, 2, 3, 4, 5, 6], function(num){ return num % 2; }); - ok('0' in parity && '1' in parity, 'created a group for each value'); - equals(parity[0].join(', '), '2, 4, 6', 'put each even number in the right group'); - - var list = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; - var grouped = _.groupBy(list, 'length'); - equals(grouped['3'].join(' '), 'one two six ten'); - equals(grouped['4'].join(' '), 'four five nine'); - equals(grouped['5'].join(' '), 'three seven eight'); - }); - - test('collections: sortedIndex', function() { - var numbers = [10, 20, 30, 40, 50], num = 35; - var index = _.sortedIndex(numbers, num); - equals(index, 3, '35 should be inserted at index 3'); - }); - - test('collections: shuffle', function() { - var numbers = _.range(10); - var shuffled = _.shuffle(numbers).sort(); - notStrictEqual(numbers, shuffled, 'original object is unmodified'); - equals(shuffled.join(','), numbers.join(','), 'contains the same members before and after shuffle'); - }); - - test('collections: toArray', function() { - ok(!_.isArray(arguments), 'arguments object is not an array'); - ok(_.isArray(_.toArray(arguments)), 'arguments object converted into array'); - var a = [1,2,3]; - ok(_.toArray(a) !== a, 'array is cloned'); - equals(_.toArray(a).join(', '), '1, 2, 3', 'cloned array contains same elements'); - - var numbers = _.toArray({one : 1, two : 2, three : 3}); - equals(numbers.join(', '), '1, 2, 3', 'object flattened into array'); - }); - - test('collections: size', function() { - equals(_.size({one : 1, two : 2, three : 3}), 3, 'can compute the size of an object'); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js deleted file mode 100644 index 78721af..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js +++ /dev/null @@ -1,198 +0,0 @@ -$(document).ready(function() { - - module("Functions"); - - test("functions: bind", function() { - var context = {name : 'moe'}; - var func = function(arg) { return "name: " + (this.name || arg); }; - var bound = _.bind(func, context); - equals(bound(), 'name: moe', 'can bind a function to a context'); - - bound = _(func).bind(context); - equals(bound(), 'name: moe', 'can do OO-style binding'); - - bound = _.bind(func, null, 'curly'); - equals(bound(), 'name: curly', 'can bind without specifying a context'); - - func = function(salutation, name) { return salutation + ': ' + name; }; - func = _.bind(func, this, 'hello'); - equals(func('moe'), 'hello: moe', 'the function was partially applied in advance'); - - var func = _.bind(func, this, 'curly'); - equals(func(), 'hello: curly', 'the function was completely applied in advance'); - - var func = function(salutation, firstname, lastname) { return salutation + ': ' + firstname + ' ' + lastname; }; - func = _.bind(func, this, 'hello', 'moe', 'curly'); - equals(func(), 'hello: moe curly', 'the function was partially applied in advance and can accept multiple arguments'); - - func = function(context, message) { equals(this, context, message); }; - _.bind(func, 0, 0, 'can bind a function to `0`')(); - _.bind(func, '', '', 'can bind a function to an empty string')(); - _.bind(func, false, false, 'can bind a function to `false`')(); - - // These tests are only meaningful when using a browser without a native bind function - // To test this with a modern browser, set underscore's nativeBind to undefined - var F = function () { return this; }; - var Boundf = _.bind(F, {hello: "moe curly"}); - equal(new Boundf().hello, undefined, "function should not be bound to the context, to comply with ECMAScript 5"); - equal(Boundf().hello, "moe curly", "When called without the new operator, it's OK to be bound to the context"); - }); - - test("functions: bindAll", function() { - var curly = {name : 'curly'}, moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - curly.getName = moe.getName; - _.bindAll(moe, 'getName', 'sayHi'); - curly.sayHi = moe.sayHi; - equals(curly.getName(), 'name: curly', 'unbound function is bound to current object'); - equals(curly.sayHi(), 'hi: moe', 'bound function is still bound to original object'); - - curly = {name : 'curly'}; - moe = { - name : 'moe', - getName : function() { return 'name: ' + this.name; }, - sayHi : function() { return 'hi: ' + this.name; } - }; - _.bindAll(moe); - curly.sayHi = moe.sayHi; - equals(curly.sayHi(), 'hi: moe', 'calling bindAll with no arguments binds all functions to the object'); - }); - - test("functions: memoize", function() { - var fib = function(n) { - return n < 2 ? n : fib(n - 1) + fib(n - 2); - }; - var fastFib = _.memoize(fib); - equals(fib(10), 55, 'a memoized version of fibonacci produces identical results'); - equals(fastFib(10), 55, 'a memoized version of fibonacci produces identical results'); - - var o = function(str) { - return str; - }; - var fastO = _.memoize(o); - equals(o('toString'), 'toString', 'checks hasOwnProperty'); - equals(fastO('toString'), 'toString', 'checks hasOwnProperty'); - }); - - asyncTest("functions: delay", 2, function() { - var delayed = false; - _.delay(function(){ delayed = true; }, 100); - setTimeout(function(){ ok(!delayed, "didn't delay the function quite yet"); }, 50); - setTimeout(function(){ ok(delayed, 'delayed the function'); start(); }, 150); - }); - - asyncTest("functions: defer", 1, function() { - var deferred = false; - _.defer(function(bool){ deferred = bool; }, true); - _.delay(function(){ ok(deferred, "deferred the function"); start(); }, 50); - }); - - asyncTest("functions: throttle", 2, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); throttledIncr(); - setTimeout(throttledIncr, 70); - setTimeout(throttledIncr, 120); - setTimeout(throttledIncr, 140); - setTimeout(throttledIncr, 190); - setTimeout(throttledIncr, 220); - setTimeout(throttledIncr, 240); - _.delay(function(){ ok(counter == 1, "incr was called immediately"); }, 30); - _.delay(function(){ ok(counter == 4, "incr was throttled"); start(); }, 400); - }); - - asyncTest("functions: throttle arguments", 2, function() { - var value = 0; - var update = function(val){ value = val; }; - var throttledUpdate = _.throttle(update, 100); - throttledUpdate(1); throttledUpdate(2); throttledUpdate(3); - setTimeout(function(){ throttledUpdate(4); }, 120); - setTimeout(function(){ throttledUpdate(5); }, 140); - setTimeout(function(){ throttledUpdate(6); }, 250); - _.delay(function(){ equals(value, 1, "updated to latest value"); }, 40); - _.delay(function(){ equals(value, 6, "updated to latest value"); start(); }, 400); - }); - - asyncTest("functions: throttle once", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); - _.delay(function(){ ok(counter == 1, "incr was called once"); start(); }, 220); - }); - - asyncTest("functions: throttle twice", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var throttledIncr = _.throttle(incr, 100); - throttledIncr(); throttledIncr(); - _.delay(function(){ ok(counter == 2, "incr was called twice"); start(); }, 220); - }); - - asyncTest("functions: debounce", 1, function() { - var counter = 0; - var incr = function(){ counter++; }; - var debouncedIncr = _.debounce(incr, 50); - debouncedIncr(); debouncedIncr(); debouncedIncr(); - setTimeout(debouncedIncr, 30); - setTimeout(debouncedIncr, 60); - setTimeout(debouncedIncr, 90); - setTimeout(debouncedIncr, 120); - setTimeout(debouncedIncr, 150); - _.delay(function(){ ok(counter == 1, "incr was debounced"); start(); }, 220); - }); - - test("functions: once", function() { - var num = 0; - var increment = _.once(function(){ num++; }); - increment(); - increment(); - equals(num, 1); - }); - - test("functions: wrap", function() { - var greet = function(name){ return "hi: " + name; }; - var backwards = _.wrap(greet, function(func, name){ return func(name) + ' ' + name.split('').reverse().join(''); }); - equals(backwards('moe'), 'hi: moe eom', 'wrapped the saluation function'); - - var inner = function(){ return "Hello "; }; - var obj = {name : "Moe"}; - obj.hi = _.wrap(inner, function(fn){ return fn() + this.name; }); - equals(obj.hi(), "Hello Moe"); - - var noop = function(){}; - var wrapped = _.wrap(noop, function(fn){ return Array.prototype.slice.call(arguments, 0); }); - var ret = wrapped(['whats', 'your'], 'vector', 'victor'); - same(ret, [noop, ['whats', 'your'], 'vector', 'victor']); - }); - - test("functions: compose", function() { - var greet = function(name){ return "hi: " + name; }; - var exclaim = function(sentence){ return sentence + '!'; }; - var composed = _.compose(exclaim, greet); - equals(composed('moe'), 'hi: moe!', 'can compose a function that takes another'); - - composed = _.compose(greet, exclaim); - equals(composed('moe'), 'hi: moe!', 'in this case, the functions are also commutative'); - }); - - test("functions: after", function() { - var testAfter = function(afterAmount, timesCalled) { - var afterCalled = 0; - var after = _.after(afterAmount, function() { - afterCalled++; - }); - while (timesCalled--) after(); - return afterCalled; - }; - - equals(testAfter(5, 5), 1, "after(N) should fire after being called N times"); - equals(testAfter(5, 4), 0, "after(N) should not fire unless called N times"); - equals(testAfter(0, 0), 1, "after(0) should fire immediately"); - }); - -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js deleted file mode 100644 index 0105d60..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js +++ /dev/null @@ -1,535 +0,0 @@ -$(document).ready(function() { - - module("Objects"); - - test("objects: keys", function() { - var exception = /object/; - equals(_.keys({one : 1, two : 2}).join(', '), 'one, two', 'can extract the keys from an object'); - // the test above is not safe because it relies on for-in enumeration order - var a = []; a[1] = 0; - equals(_.keys(a).join(', '), '1', 'is not fooled by sparse arrays; see issue #95'); - raises(function() { _.keys(null); }, exception, 'throws an error for `null` values'); - raises(function() { _.keys(void 0); }, exception, 'throws an error for `undefined` values'); - raises(function() { _.keys(1); }, exception, 'throws an error for number primitives'); - raises(function() { _.keys('a'); }, exception, 'throws an error for string primitives'); - raises(function() { _.keys(true); }, exception, 'throws an error for boolean primitives'); - }); - - test("objects: values", function() { - equals(_.values({one : 1, two : 2}).join(', '), '1, 2', 'can extract the values from an object'); - }); - - test("objects: functions", function() { - var obj = {a : 'dash', b : _.map, c : (/yo/), d : _.reduce}; - ok(_.isEqual(['b', 'd'], _.functions(obj)), 'can grab the function names of any passed-in object'); - - var Animal = function(){}; - Animal.prototype.run = function(){}; - equals(_.functions(new Animal).join(''), 'run', 'also looks up functions on the prototype'); - }); - - test("objects: extend", function() { - var result; - equals(_.extend({}, {a:'b'}).a, 'b', 'can extend an object with the attributes of another'); - equals(_.extend({a:'x'}, {a:'b'}).a, 'b', 'properties in source override destination'); - equals(_.extend({x:'x'}, {a:'b'}).x, 'x', 'properties not in source dont get overriden'); - result = _.extend({x:'x'}, {a:'a'}, {b:'b'}); - ok(_.isEqual(result, {x:'x', a:'a', b:'b'}), 'can extend from multiple source objects'); - result = _.extend({x:'x'}, {a:'a', x:2}, {a:'b'}); - ok(_.isEqual(result, {x:2, a:'b'}), 'extending from multiple source objects last property trumps'); - result = _.extend({}, {a: void 0, b: null}); - equals(_.keys(result).join(''), 'ab', 'extend does not copy undefined values'); - }); - - test("objects: defaults", function() { - var result; - var options = {zero: 0, one: 1, empty: "", nan: NaN, string: "string"}; - - _.defaults(options, {zero: 1, one: 10, twenty: 20}); - equals(options.zero, 0, 'value exists'); - equals(options.one, 1, 'value exists'); - equals(options.twenty, 20, 'default applied'); - - _.defaults(options, {empty: "full"}, {nan: "nan"}, {word: "word"}, {word: "dog"}); - equals(options.empty, "", 'value exists'); - ok(_.isNaN(options.nan), "NaN isn't overridden"); - equals(options.word, "word", 'new value is added, first one wins'); - }); - - test("objects: clone", function() { - var moe = {name : 'moe', lucky : [13, 27, 34]}; - var clone = _.clone(moe); - equals(clone.name, 'moe', 'the clone as the attributes of the original'); - - clone.name = 'curly'; - ok(clone.name == 'curly' && moe.name == 'moe', 'clones can change shallow attributes without affecting the original'); - - clone.lucky.push(101); - equals(_.last(moe.lucky), 101, 'changes to deep attributes are shared with the original'); - - equals(_.clone(undefined), void 0, 'non objects should not be changed by clone'); - equals(_.clone(1), 1, 'non objects should not be changed by clone'); - equals(_.clone(null), null, 'non objects should not be changed by clone'); - }); - - test("objects: isEqual", function() { - function First() { - this.value = 1; - } - First.prototype.value = 1; - function Second() { - this.value = 1; - } - Second.prototype.value = 2; - - // Basic equality and identity comparisons. - ok(_.isEqual(null, null), "`null` is equal to `null`"); - ok(_.isEqual(), "`undefined` is equal to `undefined`"); - - ok(!_.isEqual(0, -0), "`0` is not equal to `-0`"); - ok(!_.isEqual(-0, 0), "Commutative equality is implemented for `0` and `-0`"); - ok(!_.isEqual(null, undefined), "`null` is not equal to `undefined`"); - ok(!_.isEqual(undefined, null), "Commutative equality is implemented for `null` and `undefined`"); - - // String object and primitive comparisons. - ok(_.isEqual("Curly", "Curly"), "Identical string primitives are equal"); - ok(_.isEqual(new String("Curly"), new String("Curly")), "String objects with identical primitive values are equal"); - ok(_.isEqual(new String("Curly"), "Curly"), "String primitives and their corresponding object wrappers are equal"); - ok(_.isEqual("Curly", new String("Curly")), "Commutative equality is implemented for string objects and primitives"); - - ok(!_.isEqual("Curly", "Larry"), "String primitives with different values are not equal"); - ok(!_.isEqual(new String("Curly"), new String("Larry")), "String objects with different primitive values are not equal"); - ok(!_.isEqual(new String("Curly"), {toString: function(){ return "Curly"; }}), "String objects and objects with a custom `toString` method are not equal"); - - // Number object and primitive comparisons. - ok(_.isEqual(75, 75), "Identical number primitives are equal"); - ok(_.isEqual(new Number(75), new Number(75)), "Number objects with identical primitive values are equal"); - ok(_.isEqual(75, new Number(75)), "Number primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Number(75), 75), "Commutative equality is implemented for number objects and primitives"); - ok(!_.isEqual(new Number(0), -0), "`new Number(0)` and `-0` are not equal"); - ok(!_.isEqual(0, new Number(-0)), "Commutative equality is implemented for `new Number(0)` and `-0`"); - - ok(!_.isEqual(new Number(75), new Number(63)), "Number objects with different primitive values are not equal"); - ok(!_.isEqual(new Number(63), {valueOf: function(){ return 63; }}), "Number objects and objects with a `valueOf` method are not equal"); - - // Comparisons involving `NaN`. - ok(_.isEqual(NaN, NaN), "`NaN` is equal to `NaN`"); - ok(!_.isEqual(61, NaN), "A number primitive is not equal to `NaN`"); - ok(!_.isEqual(new Number(79), NaN), "A number object is not equal to `NaN`"); - ok(!_.isEqual(Infinity, NaN), "`Infinity` is not equal to `NaN`"); - - // Boolean object and primitive comparisons. - ok(_.isEqual(true, true), "Identical boolean primitives are equal"); - ok(_.isEqual(new Boolean, new Boolean), "Boolean objects with identical primitive values are equal"); - ok(_.isEqual(true, new Boolean(true)), "Boolean primitives and their corresponding object wrappers are equal"); - ok(_.isEqual(new Boolean(true), true), "Commutative equality is implemented for booleans"); - ok(!_.isEqual(new Boolean(true), new Boolean), "Boolean objects with different primitive values are not equal"); - - // Common type coercions. - ok(!_.isEqual(true, new Boolean(false)), "Boolean objects are not equal to the boolean primitive `true`"); - ok(!_.isEqual("75", 75), "String and number primitives with like values are not equal"); - ok(!_.isEqual(new Number(63), new String(63)), "String and number objects with like values are not equal"); - ok(!_.isEqual(75, "75"), "Commutative equality is implemented for like string and number values"); - ok(!_.isEqual(0, ""), "Number and string primitives with like values are not equal"); - ok(!_.isEqual(1, true), "Number and boolean primitives with like values are not equal"); - ok(!_.isEqual(new Boolean(false), new Number(0)), "Boolean and number objects with like values are not equal"); - ok(!_.isEqual(false, new String("")), "Boolean primitives and string objects with like values are not equal"); - ok(!_.isEqual(12564504e5, new Date(2009, 9, 25)), "Dates and their corresponding numeric primitive values are not equal"); - - // Dates. - ok(_.isEqual(new Date(2009, 9, 25), new Date(2009, 9, 25)), "Date objects referencing identical times are equal"); - ok(!_.isEqual(new Date(2009, 9, 25), new Date(2009, 11, 13)), "Date objects referencing different times are not equal"); - ok(!_.isEqual(new Date(2009, 11, 13), { - getTime: function(){ - return 12606876e5; - } - }), "Date objects and objects with a `getTime` method are not equal"); - ok(!_.isEqual(new Date("Curly"), new Date("Curly")), "Invalid dates are not equal"); - - // Functions. - ok(!_.isEqual(First, Second), "Different functions with identical bodies and source code representations are not equal"); - - // RegExps. - ok(_.isEqual(/(?:)/gim, /(?:)/gim), "RegExps with equivalent patterns and flags are equal"); - ok(!_.isEqual(/(?:)/g, /(?:)/gi), "RegExps with equivalent patterns and different flags are not equal"); - ok(!_.isEqual(/Moe/gim, /Curly/gim), "RegExps with different patterns and equivalent flags are not equal"); - ok(!_.isEqual(/(?:)/gi, /(?:)/g), "Commutative equality is implemented for RegExps"); - ok(!_.isEqual(/Curly/g, {source: "Larry", global: true, ignoreCase: false, multiline: false}), "RegExps and RegExp-like objects are not equal"); - - // Empty arrays, array-like objects, and object literals. - ok(_.isEqual({}, {}), "Empty object literals are equal"); - ok(_.isEqual([], []), "Empty array literals are equal"); - ok(_.isEqual([{}], [{}]), "Empty nested arrays and objects are equal"); - ok(!_.isEqual({length: 0}, []), "Array-like objects and arrays are not equal."); - ok(!_.isEqual([], {length: 0}), "Commutative equality is implemented for array-like objects"); - - ok(!_.isEqual({}, []), "Object literals and array literals are not equal"); - ok(!_.isEqual([], {}), "Commutative equality is implemented for objects and arrays"); - - // Arrays with primitive and object values. - ok(_.isEqual([1, "Larry", true], [1, "Larry", true]), "Arrays containing identical primitives are equal"); - ok(_.isEqual([/Moe/g, new Date(2009, 9, 25)], [/Moe/g, new Date(2009, 9, 25)]), "Arrays containing equivalent elements are equal"); - - // Multi-dimensional arrays. - var a = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - var b = [new Number(47), false, "Larry", /Moe/, new Date(2009, 11, 13), ['running', 'biking', new String('programming')], {a: 47}]; - ok(_.isEqual(a, b), "Arrays containing nested arrays and objects are recursively compared"); - - // Overwrite the methods defined in ES 5.1 section 15.4.4. - a.forEach = a.map = a.filter = a.every = a.indexOf = a.lastIndexOf = a.some = a.reduce = a.reduceRight = null; - b.join = b.pop = b.reverse = b.shift = b.slice = b.splice = b.concat = b.sort = b.unshift = null; - - // Array elements and properties. - ok(_.isEqual(a, b), "Arrays containing equivalent elements and different non-numeric properties are equal"); - a.push("White Rocks"); - ok(!_.isEqual(a, b), "Arrays of different lengths are not equal"); - a.push("East Boulder"); - b.push("Gunbarrel Ranch", "Teller Farm"); - ok(!_.isEqual(a, b), "Arrays of identical lengths containing different elements are not equal"); - - // Sparse arrays. - ok(_.isEqual(Array(3), Array(3)), "Sparse arrays of identical lengths are equal"); - ok(!_.isEqual(Array(3), Array(6)), "Sparse arrays of different lengths are not equal when both are empty"); - - // According to the Microsoft deviations spec, section 2.1.26, JScript 5.x treats `undefined` - // elements in arrays as elisions. Thus, sparse arrays and dense arrays containing `undefined` - // values are equivalent. - if (0 in [undefined]) { - ok(!_.isEqual(Array(3), [undefined, undefined, undefined]), "Sparse and dense arrays are not equal"); - ok(!_.isEqual([undefined, undefined, undefined], Array(3)), "Commutative equality is implemented for sparse and dense arrays"); - } - - // Simple objects. - ok(_.isEqual({a: "Curly", b: 1, c: true}, {a: "Curly", b: 1, c: true}), "Objects containing identical primitives are equal"); - ok(_.isEqual({a: /Curly/g, b: new Date(2009, 11, 13)}, {a: /Curly/g, b: new Date(2009, 11, 13)}), "Objects containing equivalent members are equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, b: 55}), "Objects of identical sizes with different values are not equal"); - ok(!_.isEqual({a: 63, b: 75}, {a: 61, c: 55}), "Objects of identical sizes with different property names are not equal"); - ok(!_.isEqual({a: 1, b: 2}, {a: 1}), "Objects of different sizes are not equal"); - ok(!_.isEqual({a: 1}, {a: 1, b: 2}), "Commutative equality is implemented for objects"); - ok(!_.isEqual({x: 1, y: undefined}, {x: 1, z: 2}), "Objects with identical keys and different values are not equivalent"); - - // `A` contains nested objects and arrays. - a = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - - // `B` contains equivalent nested objects and arrays. - b = { - name: new String("Moe Howard"), - age: new Number(77), - stooge: true, - hobbies: ["acting"], - film: { - name: "Sing a Song of Six Pants", - release: new Date(1947, 9, 30), - stars: [new String("Larry Fine"), "Shemp Howard"], - minutes: new Number(16), - seconds: 54 - } - }; - ok(_.isEqual(a, b), "Objects with nested equivalent members are recursively compared"); - - // Instances. - ok(_.isEqual(new First, new First), "Object instances are equal"); - ok(!_.isEqual(new First, new Second), "Objects with different constructors and identical own properties are not equal"); - ok(!_.isEqual({value: 1}, new First), "Object instances and objects sharing equivalent properties are not equal"); - ok(!_.isEqual({value: 2}, new Second), "The prototype chain of objects should not be examined"); - - // Circular Arrays. - (a = []).push(a); - (b = []).push(b); - ok(_.isEqual(a, b), "Arrays containing circular references are equal"); - a.push(new String("Larry")); - b.push(new String("Larry")); - ok(_.isEqual(a, b), "Arrays containing circular references and equivalent properties are equal"); - a.push("Shemp"); - b.push("Curly"); - ok(!_.isEqual(a, b), "Arrays containing circular references and different properties are not equal"); - - // Circular Objects. - a = {abc: null}; - b = {abc: null}; - a.abc = a; - b.abc = b; - ok(_.isEqual(a, b), "Objects containing circular references are equal"); - a.def = 75; - b.def = 75; - ok(_.isEqual(a, b), "Objects containing circular references and equivalent properties are equal"); - a.def = new Number(75); - b.def = new Number(63); - ok(!_.isEqual(a, b), "Objects containing circular references and different properties are not equal"); - - // Cyclic Structures. - a = [{abc: null}]; - b = [{abc: null}]; - (a[0].abc = a).push(a); - (b[0].abc = b).push(b); - ok(_.isEqual(a, b), "Cyclic structures are equal"); - a[0].def = "Larry"; - b[0].def = "Larry"; - ok(_.isEqual(a, b), "Cyclic structures containing equivalent properties are equal"); - a[0].def = new String("Larry"); - b[0].def = new String("Curly"); - ok(!_.isEqual(a, b), "Cyclic structures containing different properties are not equal"); - - // Complex Circular References. - a = {foo: {b: {foo: {c: {foo: null}}}}}; - b = {foo: {b: {foo: {c: {foo: null}}}}}; - a.foo.b.foo.c.foo = a; - b.foo.b.foo.c.foo = b; - ok(_.isEqual(a, b), "Cyclic structures with nested and identically-named properties are equal"); - - // Chaining. - ok(!_.isEqual(_({x: 1, y: undefined}).chain(), _({x: 1, z: 2}).chain()), 'Chained objects containing different values are not equal'); - equals(_({x: 1, y: 2}).chain().isEqual(_({x: 1, y: 2}).chain()).value(), true, '`isEqual` can be chained'); - - // Custom `isEqual` methods. - var isEqualObj = {isEqual: function (o) { return o.isEqual == this.isEqual; }, unique: {}}; - var isEqualObjClone = {isEqual: isEqualObj.isEqual, unique: {}}; - - ok(_.isEqual(isEqualObj, isEqualObjClone), 'Both objects implement identical `isEqual` methods'); - ok(_.isEqual(isEqualObjClone, isEqualObj), 'Commutative equality is implemented for objects with custom `isEqual` methods'); - ok(!_.isEqual(isEqualObj, {}), 'Objects that do not implement equivalent `isEqual` methods are not equal'); - ok(!_.isEqual({}, isEqualObj), 'Commutative equality is implemented for objects with different `isEqual` methods'); - - // Custom `isEqual` methods - comparing different types - LocalizedString = (function() { - function LocalizedString(id) { this.id = id; this.string = (this.id===10)? 'Bonjour': ''; } - LocalizedString.prototype.isEqual = function(that) { - if (_.isString(that)) return this.string == that; - else if (that instanceof LocalizedString) return this.id == that.id; - return false; - }; - return LocalizedString; - })(); - var localized_string1 = new LocalizedString(10), localized_string2 = new LocalizedString(10), localized_string3 = new LocalizedString(11); - ok(_.isEqual(localized_string1, localized_string2), 'comparing same typed instances with same ids'); - ok(!_.isEqual(localized_string1, localized_string3), 'comparing same typed instances with different ids'); - ok(_.isEqual(localized_string1, 'Bonjour'), 'comparing different typed instances with same values'); - ok(_.isEqual('Bonjour', localized_string1), 'comparing different typed instances with same values'); - ok(!_.isEqual('Bonjour', localized_string3), 'comparing two localized strings with different ids'); - ok(!_.isEqual(localized_string1, 'Au revoir'), 'comparing different typed instances with different values'); - ok(!_.isEqual('Au revoir', localized_string1), 'comparing different typed instances with different values'); - - // Custom `isEqual` methods - comparing with serialized data - Date.prototype.toJSON = function() { - return { - _type:'Date', - year:this.getUTCFullYear(), - month:this.getUTCMonth(), - day:this.getUTCDate(), - hours:this.getUTCHours(), - minutes:this.getUTCMinutes(), - seconds:this.getUTCSeconds() - }; - }; - Date.prototype.isEqual = function(that) { - var this_date_components = this.toJSON(); - var that_date_components = (that instanceof Date) ? that.toJSON() : that; - delete this_date_components['_type']; delete that_date_components['_type'] - return _.isEqual(this_date_components, that_date_components); - }; - - var date = new Date(); - var date_json = { - _type:'Date', - year:date.getUTCFullYear(), - month:date.getUTCMonth(), - day:date.getUTCDate(), - hours:date.getUTCHours(), - minutes:date.getUTCMinutes(), - seconds:date.getUTCSeconds() - }; - - ok(_.isEqual(date_json, date), 'serialized date matches date'); - ok(_.isEqual(date, date_json), 'date matches serialized date'); - }); - - test("objects: isEmpty", function() { - ok(!_([1]).isEmpty(), '[1] is not empty'); - ok(_.isEmpty([]), '[] is empty'); - ok(!_.isEmpty({one : 1}), '{one : 1} is not empty'); - ok(_.isEmpty({}), '{} is empty'); - ok(_.isEmpty(new RegExp('')), 'objects with prototype properties are empty'); - ok(_.isEmpty(null), 'null is empty'); - ok(_.isEmpty(), 'undefined is empty'); - ok(_.isEmpty(''), 'the empty string is empty'); - ok(!_.isEmpty('moe'), 'but other strings are not'); - - var obj = {one : 1}; - delete obj.one; - ok(_.isEmpty(obj), 'deleting all the keys from an object empties it'); - }); - - // Setup remote variables for iFrame tests. - var iframe = document.createElement('iframe'); - jQuery(iframe).appendTo(document.body); - var iDoc = iframe.contentDocument || iframe.contentWindow.document; - iDoc.write( - "" - ); - iDoc.close(); - - test("objects: isElement", function() { - ok(!_.isElement('div'), 'strings are not dom elements'); - ok(_.isElement($('html')[0]), 'the html tag is a DOM element'); - ok(_.isElement(iElement), 'even from another frame'); - }); - - test("objects: isArguments", function() { - var args = (function(){ return arguments; })(1, 2, 3); - ok(!_.isArguments('string'), 'a string is not an arguments object'); - ok(!_.isArguments(_.isArguments), 'a function is not an arguments object'); - ok(_.isArguments(args), 'but the arguments object is an arguments object'); - ok(!_.isArguments(_.toArray(args)), 'but not when it\'s converted into an array'); - ok(!_.isArguments([1,2,3]), 'and not vanilla arrays.'); - ok(_.isArguments(iArguments), 'even from another frame'); - }); - - test("objects: isObject", function() { - ok(_.isObject(arguments), 'the arguments object is object'); - ok(_.isObject([1, 2, 3]), 'and arrays'); - ok(_.isObject($('html')[0]), 'and DOM element'); - ok(_.isObject(iElement), 'even from another frame'); - ok(_.isObject(function () {}), 'and functions'); - ok(_.isObject(iFunction), 'even from another frame'); - ok(!_.isObject(null), 'but not null'); - ok(!_.isObject(undefined), 'and not undefined'); - ok(!_.isObject('string'), 'and not string'); - ok(!_.isObject(12), 'and not number'); - ok(!_.isObject(true), 'and not boolean'); - ok(_.isObject(new String('string')), 'but new String()'); - }); - - test("objects: isArray", function() { - ok(!_.isArray(arguments), 'the arguments object is not an array'); - ok(_.isArray([1, 2, 3]), 'but arrays are'); - ok(_.isArray(iArray), 'even from another frame'); - }); - - test("objects: isString", function() { - ok(!_.isString(document.body), 'the document body is not a string'); - ok(_.isString([1, 2, 3].join(', ')), 'but strings are'); - ok(_.isString(iString), 'even from another frame'); - }); - - test("objects: isNumber", function() { - ok(!_.isNumber('string'), 'a string is not a number'); - ok(!_.isNumber(arguments), 'the arguments object is not a number'); - ok(!_.isNumber(undefined), 'undefined is not a number'); - ok(_.isNumber(3 * 4 - 7 / 10), 'but numbers are'); - ok(_.isNumber(NaN), 'NaN *is* a number'); - ok(_.isNumber(Infinity), 'Infinity is a number'); - ok(_.isNumber(iNumber), 'even from another frame'); - ok(!_.isNumber('1'), 'numeric strings are not numbers'); - }); - - test("objects: isBoolean", function() { - ok(!_.isBoolean(2), 'a number is not a boolean'); - ok(!_.isBoolean("string"), 'a string is not a boolean'); - ok(!_.isBoolean("false"), 'the string "false" is not a boolean'); - ok(!_.isBoolean("true"), 'the string "true" is not a boolean'); - ok(!_.isBoolean(arguments), 'the arguments object is not a boolean'); - ok(!_.isBoolean(undefined), 'undefined is not a boolean'); - ok(!_.isBoolean(NaN), 'NaN is not a boolean'); - ok(!_.isBoolean(null), 'null is not a boolean'); - ok(_.isBoolean(true), 'but true is'); - ok(_.isBoolean(false), 'and so is false'); - ok(_.isBoolean(iBoolean), 'even from another frame'); - }); - - test("objects: isFunction", function() { - ok(!_.isFunction([1, 2, 3]), 'arrays are not functions'); - ok(!_.isFunction('moe'), 'strings are not functions'); - ok(_.isFunction(_.isFunction), 'but functions are'); - ok(_.isFunction(iFunction), 'even from another frame'); - }); - - test("objects: isDate", function() { - ok(!_.isDate(100), 'numbers are not dates'); - ok(!_.isDate({}), 'objects are not dates'); - ok(_.isDate(new Date()), 'but dates are'); - ok(_.isDate(iDate), 'even from another frame'); - }); - - test("objects: isRegExp", function() { - ok(!_.isRegExp(_.identity), 'functions are not RegExps'); - ok(_.isRegExp(/identity/), 'but RegExps are'); - ok(_.isRegExp(iRegExp), 'even from another frame'); - }); - - test("objects: isNaN", function() { - ok(!_.isNaN(undefined), 'undefined is not NaN'); - ok(!_.isNaN(null), 'null is not NaN'); - ok(!_.isNaN(0), '0 is not NaN'); - ok(_.isNaN(NaN), 'but NaN is'); - ok(_.isNaN(iNaN), 'even from another frame'); - }); - - test("objects: isNull", function() { - ok(!_.isNull(undefined), 'undefined is not null'); - ok(!_.isNull(NaN), 'NaN is not null'); - ok(_.isNull(null), 'but null is'); - ok(_.isNull(iNull), 'even from another frame'); - }); - - test("objects: isUndefined", function() { - ok(!_.isUndefined(1), 'numbers are defined'); - ok(!_.isUndefined(null), 'null is defined'); - ok(!_.isUndefined(false), 'false is defined'); - ok(!_.isUndefined(NaN), 'NaN is defined'); - ok(_.isUndefined(), 'nothing is undefined'); - ok(_.isUndefined(undefined), 'undefined is undefined'); - ok(_.isUndefined(iUndefined), 'even from another frame'); - }); - - if (window.ActiveXObject) { - test("objects: IE host objects", function() { - var xml = new ActiveXObject("Msxml2.DOMDocument.3.0"); - ok(!_.isNumber(xml)); - ok(!_.isBoolean(xml)); - ok(!_.isNaN(xml)); - ok(!_.isFunction(xml)); - ok(!_.isNull(xml)); - ok(!_.isUndefined(xml)); - }); - } - - test("objects: tap", function() { - var intercepted = null; - var interceptor = function(obj) { intercepted = obj; }; - var returned = _.tap(1, interceptor); - equals(intercepted, 1, "passes tapped object to interceptor"); - equals(returned, 1, "returns tapped object"); - - returned = _([1,2,3]).chain(). - map(function(n){ return n * 2; }). - max(). - tap(interceptor). - value(); - ok(returned == 6 && intercepted == 6, 'can use tapped objects in a chain'); - }); -}); diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js deleted file mode 100644 index 86663a2..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js +++ /dev/null @@ -1,70 +0,0 @@ -(function() { - - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - - JSLitmus.test('_.each()', function() { - var timesTwo = []; - _.each(numbers, function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('_(list).each()', function() { - var timesTwo = []; - _(numbers).each(function(num){ timesTwo.push(num * 2); }); - return timesTwo; - }); - - JSLitmus.test('jQuery.each()', function() { - var timesTwo = []; - jQuery.each(numbers, function(){ timesTwo.push(this * 2); }); - return timesTwo; - }); - - JSLitmus.test('_.map()', function() { - return _.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('jQuery.map()', function() { - return jQuery.map(objects, function(obj){ return obj.num; }); - }); - - JSLitmus.test('_.pluck()', function() { - return _.pluck(objects, 'num'); - }); - - JSLitmus.test('_.uniq()', function() { - return _.uniq(randomized); - }); - - JSLitmus.test('_.uniq() (sorted)', function() { - return _.uniq(numbers, true); - }); - - JSLitmus.test('_.sortBy()', function() { - return _.sortBy(numbers, function(num){ return -num; }); - }); - - JSLitmus.test('_.isEqual()', function() { - return _.isEqual(numbers, randomized); - }); - - JSLitmus.test('_.keys()', function() { - return _.keys(objects); - }); - - JSLitmus.test('_.values()', function() { - return _.values(objects); - }); - - JSLitmus.test('_.intersect()', function() { - return _.intersect(numbers, randomized); - }); - - JSLitmus.test('_.range()', function() { - return _.range(1000); - }); - -})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js deleted file mode 100644 index 68c39dc..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js +++ /dev/null @@ -1,27 +0,0 @@ -(function() { - - var func = function(){}; - var date = new Date(); - var str = "a string"; - var numbers = []; - for (var i=0; i<1000; i++) numbers.push(i); - var objects = _.map(numbers, function(n){ return {num : n}; }); - var randomized = _.sortBy(numbers, function(){ return Math.random(); }); - - JSLitmus.test('_.isNumber', function() { - return _.isNumber(1000) - }); - - JSLitmus.test('_.newIsNumber', function() { - return _.newIsNumber(1000) - }); - - JSLitmus.test('_.isNumber(NaN)', function() { - return _.isNumber(NaN) - }); - - JSLitmus.test('_.newIsNumber(NaN)', function() { - return _.newIsNumber(NaN) - }); - -})(); \ No newline at end of file diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html deleted file mode 100644 index bd34f9d..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - Underscore Temporary Tests - - - - - - - -

            Underscore Temporary Tests

            -

            - A page for temporary speed tests, used for developing faster implementations - of existing Underscore methods. -

            -
            - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html deleted file mode 100644 index 77f2f3a..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - Underscore Test Suite - - - - - - - - - - - - - - - -
            -

            Underscore Test Suite

            -

            -

            -
              -
              -

              Underscore Speed Suite

              -

              - A representative sample of the functions are benchmarked here, to provide - a sense of how fast they might run in different browsers. - Each iteration runs on an array of 1000 elements.

              - For example, the 'intersect' test measures the number of times you can - find the intersection of two thousand-element arrays in one second. -

              -
              - - -
              - - diff --git a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js b/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js deleted file mode 100644 index 7bc5cb4..0000000 --- a/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js +++ /dev/null @@ -1,155 +0,0 @@ -$(document).ready(function() { - - module("Utility"); - - test("utility: noConflict", function() { - var underscore = _.noConflict(); - ok(underscore.isUndefined(_), "The '_' variable has been returned to its previous state."); - var intersection = underscore.intersect([-1, 0, 1, 2], [1, 2, 3, 4]); - equals(intersection.join(', '), '1, 2', 'but the intersection function still works'); - window._ = underscore; - }); - - test("utility: identity", function() { - var moe = {name : 'moe'}; - equals(_.identity(moe), moe, 'moe is the same as his identity'); - }); - - test("utility: uniqueId", function() { - var ids = [], i = 0; - while(i++ < 100) ids.push(_.uniqueId()); - equals(_.uniq(ids).length, ids.length, 'can generate a globally-unique stream of ids'); - }); - - test("utility: times", function() { - var vals = []; - _.times(3, function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "is 0 indexed"); - // - vals = []; - _(3).times(function (i) { vals.push(i); }); - ok(_.isEqual(vals, [0,1,2]), "works as a wrapper"); - }); - - test("utility: mixin", function() { - _.mixin({ - myReverse: function(string) { - return string.split('').reverse().join(''); - } - }); - equals(_.myReverse('panacea'), 'aecanap', 'mixed in a function to _'); - equals(_('champ').myReverse(), 'pmahc', 'mixed in a function to the OOP wrapper'); - }); - - test("utility: _.escape", function() { - equals(_.escape("Curly & Moe"), "Curly & Moe"); - equals(_.escape("Curly & Moe"), "Curly &amp; Moe"); - }); - - test("utility: template", function() { - var basicTemplate = _.template("<%= thing %> is gettin' on my noives!"); - var result = basicTemplate({thing : 'This'}); - equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation'); - - var sansSemicolonTemplate = _.template("A <% this %> B"); - equals(sansSemicolonTemplate(), "A B"); - - var backslashTemplate = _.template("<%= thing %> is \\ridanculous"); - equals(backslashTemplate({thing: 'This'}), "This is \\ridanculous"); - - var escapeTemplate = _.template('<%= a ? "checked=\\"checked\\"" : "" %>'); - equals(escapeTemplate({a: true}), 'checked="checked"', 'can handle slash escapes in interpolations.'); - - var fancyTemplate = _.template("
                <% \ - for (key in people) { \ - %>
              • <%= people[key] %>
              • <% } %>
              "); - result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}}); - equals(result, "
              • Moe
              • Larry
              • Curly
              ", 'can run arbitrary javascript in templates'); - - var escapedCharsInJavascriptTemplate = _.template("
                <% _.each(numbers.split('\\n'), function(item) { %>
              • <%= item %>
              • <% }) %>
              "); - result = escapedCharsInJavascriptTemplate({numbers: "one\ntwo\nthree\nfour"}); - equals(result, "
              • one
              • two
              • three
              • four
              ", 'Can use escaped characters (e.g. \\n) in Javascript'); - - var namespaceCollisionTemplate = _.template("<%= pageCount %> <%= thumbnails[pageCount] %> <% _.each(thumbnails, function(p) { %>
              \">
              <% }); %>"); - result = namespaceCollisionTemplate({ - pageCount: 3, - thumbnails: { - 1: "p1-thumbnail.gif", - 2: "p2-thumbnail.gif", - 3: "p3-thumbnail.gif" - } - }); - equals(result, "3 p3-thumbnail.gif
              "); - - var noInterpolateTemplate = _.template("

              Just some text. Hey, I know this is silly but it aids consistency.

              "); - result = noInterpolateTemplate(); - equals(result, "

              Just some text. Hey, I know this is silly but it aids consistency.

              "); - - var quoteTemplate = _.template("It's its, not it's"); - equals(quoteTemplate({}), "It's its, not it's"); - - var quoteInStatementAndBody = _.template("<%\ - if(foo == 'bar'){ \ - %>Statement quotes and 'quotes'.<% } %>"); - equals(quoteInStatementAndBody({foo: "bar"}), "Statement quotes and 'quotes'."); - - var withNewlinesAndTabs = _.template('This\n\t\tis: <%= x %>.\n\tok.\nend.'); - equals(withNewlinesAndTabs({x: 'that'}), 'This\n\t\tis: that.\n\tok.\nend.'); - - var template = _.template("<%- value %>"); - var result = template({value: "